Skip to content
✨ Learn more about Convo Space & Omnid →
Docs
Convo SDK
Omnid

SDK - Omnid

Get TrustScore for Address

Syntax,

convo.omnid.getTrustScore(
    signerAddress,  // Ethereum Address
)

Example,

let resp = await convo.omnid.getTrustScore(
    "0x707aC3937A9B31C225D8C240F5917Be97cab9F20"
);

Compute entire Trust Score

Syntax,

convo.omnid.computeTrustScore(
    signerAddress,  // Ethereum Address
    computeConfig,
)

ComputeConfig is used to pass private variables to adaptors. For eg - API keys, RPC URLs etc. Some adaptors need these, some do not.

type ComputeConfig = {
  polygonMainnetRpc: string;
  etherumMainnetRpc: string;
  avalancheMainnetRpc: string;
  maticPriceInUsd: number;
  etherumPriceInUsd: number;
  deepdaoApiKey: string;
  etherscanApiKey: string;
  polygonscanApiKey: string;
  optimismscanApiKey: string;
  zapperApiKey: string;
  alchemyApiKey: string;
  CNVSEC_ID: string;
  DEBUG: boolean;
};

Example,

const computeConfig = {
    maticMainnetRpc: 'https://polygon-rpc.com/';
}
 
let resp = await convo.omnid.computeTrustScore(
    "0x707aC3937A9B31C225D8C240F5917Be97cab9F20",
    computeConfig
);

Omnid Kits

isMalicious

The isMalicious kit sources its information from the following Adaptors

  • Alchemy Spam Contract Detection (alchemy)
  • ChainAbuse Reports (chainabuse)
  • CryptoScamDB (cryptoscamdb)
  • Etherscan Phishing/Hack Label Cloud (etherscan)
  • MEW Malicious Accounts (mew)
  • OFAC SDN list (sdn)
  • Stablecoin Blacklist data (tokenblacklist)
  • Tornado Cash Interactions (txn)

Read more on the adaptors here.

isMalicious requires CNVSEC_ID (Request for one with support (opens in a new tab)) in the computeConfig along with others shown in the example below.

Syntax,

convo.omnid.kits.isMalicious(
    signerAddress,  // Ethereum Address
    computeConfig,
)

Example,

const computeConfig = {
    CNVSEC_ID: '',
    alchemyApiKey: '',
    etherscanApiKey: '',
    polygonscanApiKey: '',
    optimismscanApiKey: '',
}
 
let resp = await convo.omnid.kits.isMalicious(
    "0x707aC3937A9B31C225D8C240F5917Be97cab9F20",
    computeConfig
);

Execute individual Adaptors

Syntax,

convo.omnid.adaptors.*(
    signerAddress,  // Ethereum Address
    computeConfig, // Optional, ComputeConfig
)

Here * is the name of the Adaptor.

let resp = await convo.omnid.adaptors.getZoraData(
    "0x707aC3937A9B31C225D8C240F5917Be97cab9F20",
    computeConfig,
);

Issue - Verifiable Credentials

Syntax,

convo.omnid.credentials.issue(
    signerAddress,  // Ethereum Address
    adaptor         // Adaptor Name to use as a data source
)

Example,

let resp = await convo.omnid.credentials.issue(
    "0x707aC3937A9B31C225D8C240F5917Be97cab9F20"
    "age"
);

Verify - Verifiable Credentials

Syntax,

convo.omnid.credentials.verify(
    verifiableCredential,  // vc
)

Example,

let resp = await convo.omnid.credentials.verify({
    "@context": [
        "https://www.w3.org/2018/credentials/v1",
        "https://w3id.org/security/suites/ed25519-2020/v1"
    ],
    "id": "http://example.gov/credentials/3732",
    "type": [
        "VerifiableCredential",
        "ReputationCredential"
    ],
    "issuer": {
        "id": "did:web:omnid.space"
    },
    "issuanceDate": "2022-05-07T06:29:07.291Z",
    "credentialSubject": {
        "id": "did:ethr:0xa28992A6744e36f398DFe1b9407474e1D7A3066b",
        "data": {
            "polygon": 337,
            "ethereum": 774
        }
    },
    "proof": {
        "type": "Ed25519Signature2020",
        "created": "2022-05-07T06:29:07.291Z",
        "proofPurpose": "assertionMethod",
        "verificationMethod": [
            {
                "id": "#key-0",
                "type": "Ed25519VerificationKey2020",
                "controller": "https://example.com/issuer/123",
                "publicKeyMultibase": "zCP4BNbfPtGufUvgV6DdSSoaEExYeCZcCFTUmuTNZQ4Ge"
            }
        ],
        "proofValue": "z2ctnb9MR76vzSh6G5svNnKUPVY8RSqheTvNFukSjYtMdLCA57S6Ah5DkTp44qz3XyHSv5JR9yNTAKwUYN2123bKH"
    }
});