On-chain KYC verification, status queries, and transfer compliance checks
The identity sub-module interacts with the contract through the API relayer. All write operations (verify, batchVerify, revoke) execute on-chain transactions and require a configured relayer wallet on your instance.
Verify up to 500 addresses in a single on-chain transaction. Significantly more gas-efficient than individual calls for bulk onboarding.
const result = await trusset.customers.identity.batchVerify([ { walletAddress: '0xaaa...', country: 'DE' }, { walletAddress: '0xbbb...', country: 'FR', investorType: 'PROFESSIONAL' }, { walletAddress: '0xccc...', country: 'AT', softExpiryDays: 365, hardExpiryDays: 730 },])// result.totalEntries - number of addresses processed// result.txHash - single transaction hash// result.gasUsed - total gas consumed
Batch verification executes in a single transaction. If gas runs out mid-batch, remaining entries are recorded as failed on-chain. Size your batches according to your gas limits.
Returns combined on-chain and off-chain status for an address. The on-chain data comes from the IdentityRegistry contract; the off-chain data comes from the Trusset database.
If no customer record exists in the database, offChain is null. If the address was never verified on-chain, onChain.isVerified is false with a status of none.
Validates whether a token transfer between two addresses would be allowed. This runs the full compliance pipeline: identity checks for both parties, KYC expiry validation, freeze checks, and all registered compliance modules.
const check = await trusset.customers.identity.canTransfer({ from: '0xaaa...', to: '0xbbb...', amount: '1000000000000000000', // 1 token in wei fromBalance: '5000000000000000000', // sender's current balance toBalance: '0', // receiver's current balance})check.allowed // true or falsecheck.reason // numeric rejection code (0 = none)check.senderStatus // 'active', 'soft_expired', etc.check.receiverStatus // 'active', 'soft_expired', etc.
Call canTransfer before submitting transfer transactions to get a specific rejection reason rather than a generic revert.
This is a read-only operation - it does not require a relayer and does not cost gas.