KYC

Know Your Customer (KYC) is required before any operation in Maxonrow blockchain.

Creating Instances

Kyc . create ( signerOrProvider )   => Promise<Kyc>
Creates a new instance reference from signerOrProvider and optionally connect a provider.

Signing

prototype . getKycAddress ( keyComponent )   => string

Compute kyc address from key components by SHA2-256 cryptographic hash.

The valid key components are:

  • country — the country code for issuer
  • idType — the identity document type
  • id — the identity number for the applicant
  • idExpiry — the identity document expiry date (YYYMMDD) in number
  • dob — the applicant date of birth (YYYMMDD) in number
  • seed — additional value to stir into the hashing

If the seed is not specified, it should be default to 32 bytes of zero.

prototype . sign ( keyComponentOrAddress )   => Promise<KycData>
Signs KycAddress and returns a Promise that resolves to the signed JSON object. The JSON object should be sorted and signed by applicant’s wallet.
the properties for kyc data
{
    kyc: {
        from: string,
        nonce: BigNumberish,
        kycAddress: string
    },
    pub_key: {
        type: string,
        value: string
    },
    signature: string
}
prototype . signTransaction ( transaction )   => Promise<KycTransaction>
Signs transaction and returns a Promise that resolves to the signed transaction. The transaction should be signed by KYC provider or KYC issuer.
the properties for kyc transaction
{
    payload: KycData,
    signatures: [
        {
            address: string,
            pub_key: {
                type: string,
                value: string
            },
            signature: string
        }
    ]
}
prototype . approve ( transaction )   => Promise<TransactionReceipt>

Send the signedTransaction to the entire blockchain network and returns a Promise that resolves to the Transaction Receipt. The transaction should be signed by KYC middleware.

If an error occurs after the netowrk may have received the transaction, the promise will reject with the error, with the additional property transactionHash so that further processing may be done.

prototype . revoke ( address, signer )   => Promise<KycStatusTransaction>
Signs transaction and returns a Promise that resolves to the signed transaction. The transaction should be signed by KYC provider.
the properties for kyc status transaction
{
    kyc: {
        from: string,
        to: string,
        nonce: BigNumberish,
        status: string
    },
    pub_key: {
        type: string,
        value: string
    },
    signature: string
}
prototype . signStatusTransaction ( transaction, signer )   => Promise<KycStatusTransaction>
Signs transaction and returns a Promise that resolves to the signed transaction. The transaction should be signed by KYC provider or KYC issuer.
prototype . sendStatusTransaction ( transaction, signer )   => Promise<TransactionReceipt>

Send the signedTransaction to the entire blockchain network and returns a Promise that resolves to the Transaction Receipt. The transaction should be signed by KYC middleware.

If an error occurs after the netowrk may have received the transaction, the promise will reject with the error, with the additional property transactionHash so that further processing may be done.

Checking status

wallet . isWhitelisted ( )   => Promise<Boolean>
Query KYC whitelist status by wallet address.