Available from
@trusset/sdk 0.7.0.onboarding sub-module runs the whole onboarding of one customer: the identity check in your app or the sealed record from your KYC source, the wallet, and the transactions your wallet signs. Each customer has one onboarding, addressed by the customer id, your externalId, the reference key or the wallet. See Onboarding for the statuses and the rules.
Start
start creates the customer record when the externalId is new, and returns the running onboarding when there is one. created is true only when this call inserted the record. For the Trusset identity check, sdk.token is the Sumsub access token your app passes to the WebSDK or MobileSDK.
The SDK holds externalId to the rule of the API with a ValidationError before any request: a string of 1 to 128 characters with no leading or trailing spaces and no control or invisible characters, not shaped like a wallet address (0x followed by 40 hex characters) and not starting with ref_, because the onboarding routes read such an identifier as a wallet or a reference key. A walletAddress held by an archived customer record of your instance, as its primary or as a linked wallet, is refused with WALLET_IN_USE: restore that record, or bind another wallet.
Run the identity check
Pass the token to the Sumsub SDK and hand it a refresh function. Every token is issued for the same applicant.Follow the status
get reads the onboarding without calling a provider or the chain. Call it when a customer webhook arrives.
recheck asks Sumsub for a review that did not arrive, and queues a registration again when the status reads REGISTRATION_STALLED.
Bind the wallet
Sign what waits
When the status readsAWAITING_SIGNATURE, build the transactions, sign each one with a wallet of your instance, and confirm with the kind you signed.
Through a KYC source
For a profile with a KYC source,start answers AWAITING_RECORD and no token. After you opened the delivered record with the KYC courier tool, record your decision:
admissions holds one unsigned transaction for each whitelist bound to the source. Confirm each one with confirmTransactions and kind: 'WHITELIST_ADMISSION', naming the listId.
Options and cancel
options lists the profiles of your instance with the provider each one defaults to. cancel closes a running onboarding that was not approved yet.
