KycManager
KYC / KYB — client.kyc. A receiver is the verified identity both ramps hang off: an on-ramp pays INTO one of its wallets, an off-ramp pays OUT to one…
KYC / KYB — client.kyc. A receiver is the verified identity both ramps hang off: an on-ramp pays INTO one of its wallets, an off-ramp pays OUT to one of its bank accounts, and neither works until verification passes. The order is not obvious and the API will not guess it for you: 1. termsOfService() — the acceptance the provider requires up front, which returns a tos_id. 2. upload() each document, keeping the file_url it returns. 3. createReceiver() with those URLs and the tos_id. 4. addWallet() / addBankAccount() for where money should land. 5. verification runs; fetchReceiver() refreshes kycStatus from upstream.
Properties
protected
protected get rest(): RESTMethods
createReceiver()
Create a receiver and start verification.
createReceiver(options: CreateReceiverOptions): Promise<Receiver>Parameters
options:CreateReceiverOptions
Returns Promise<Receiver>
receivers()
List this consumer's receivers (paginated).
receivers(options?: ListKycOptions): Promise<ReceiverPage>Parameters
options(optional):ListKycOptions
Returns Promise<ReceiverPage>
fetchReceiver()
One receiver, materialized. Reading it refreshes kycStatus upstream.
fetchReceiver(id: string): Promise<Receiver>Parameters
id:string
Returns Promise<Receiver>
fetchReceiverRaw()
The raw payload, so a {@link Receiver} can patch itself in place.
fetchReceiverRaw(id: string): Promise<ReceiverData>Parameters
id:string
Returns Promise<ReceiverData>
updateReceiver()
Update a receiver — the same fields as creation, all optional. Once the receiver exists at the provider, identity fields need an elevated key; see {@link UpdateReceiverOptions}.
updateReceiver(id: string, options: UpdateReceiverOptions): Promise<Receiver>Parameters
id:stringoptions:UpdateReceiverOptions
Returns Promise<Receiver>
deleteReceiver()
Delete a receiver.
deleteReceiver(id: string): Promise<void>Parameters
id:string
Returns Promise<void>
approveReceiver()
Approve a receiver sitting in review. Admin-only: it is the human gate on a verification the provider could not decide by itself.
approveReceiver(id: string, options?: ApproveReceiverOptions): Promise<ReceiverData>Parameters
id:stringoptions(optional):ApproveReceiverOptions
Returns Promise<ReceiverData>
requestTos()
Ask for a terms-of-service link for an existing receiver. channel: 'code' returns the URL to render; 'email' sends it to the receiver instead.
requestTos(id: string, options: RequestTosOptions): Promise<TermsOfServiceData>Parameters
id:stringoptions:RequestTosOptions
Returns Promise<TermsOfServiceData>
enableReceiver()
Enable an inactive receiver with an accepted terms-of-service id.
enableReceiver(id: string, options: EnableReceiverOptions): Promise<Receiver>Parameters
id:stringoptions:EnableReceiverOptions
Returns Promise<Receiver>
setReceiverAccess()
Cut a receiver off from both ramps, or let it back in. Admin-only, and the fastest lever there is when something is wrong with an account.
setReceiverAccess(id: string, options: SetReceiverAccessOptions): Promise<Receiver>Parameters
id:stringoptions:SetReceiverAccessOptions
Returns Promise<Receiver>
walletSignMessage()
The message a receiver must sign to prove it controls an address. Sign it, then pass the resulting transaction hash as signature_tx_hash to {@link addWallet}.
walletSignMessage(receiverId: string): Promise<WalletSignMessageData>Parameters
receiverId:string
Returns Promise<WalletSignMessageData>
addWallet()
Register a blockchain wallet for a receiver.
addWallet(receiverId: string, options: CreateReceiverWalletOptions): Promise<ReceiverWalletData>Parameters
receiverId:stringoptions:CreateReceiverWalletOptions
Returns Promise<ReceiverWalletData>
wallets()
A receiver's wallets (paginated).
wallets(receiverId: string, options?: ListKycOptions): Promise<ReceiverWalletPage>Parameters
receiverId:stringoptions(optional):ListKycOptions
Returns Promise<ReceiverWalletPage>
deleteWallet()
Delete one of a receiver's wallets.
deleteWallet(receiverId: string, id: string): Promise<void>Parameters
receiverId:stringid:string
Returns Promise<void>
addBankAccount()
Add a fiat bank account for a receiver — where an off-ramp pays out.
addBankAccount(receiverId: string, options: CreateBankAccountOptions): Promise<BankAccountData>Parameters
receiverId:stringoptions:CreateBankAccountOptions
Returns Promise<BankAccountData>
bankAccounts()
A receiver's bank accounts (paginated).
bankAccounts(receiverId: string, options?: ListKycOptions): Promise<BankAccountPage>Parameters
receiverId:stringoptions(optional):ListKycOptions
Returns Promise<BankAccountPage>
deleteBankAccount()
Delete one of a receiver's bank accounts.
deleteBankAccount(receiverId: string, id: string): Promise<void>Parameters
receiverId:stringid:string
Returns Promise<void>
upload()
Upload a KYC document and get back the file_url every *_file field expects. Documents are uploaded first and referenced by URL — the receiver payload never carries bytes.
upload(file: unknown): Promise<KycUploadData>Parameters
file:unknown
Returns Promise<KycUploadData>
termsOfService()
Start terms-of-service acceptance and get the hosted URL. This is the FIRST step of the flow: the provider will not create a receiver without the tos_id it produces.
termsOfService(options?: InitiateTosOptions): Promise<TermsOfServiceData>Parameters
options(optional):InitiateTosOptions
Returns Promise<TermsOfServiceData>
rails()
The bank rails available to this consumer.
rails(): Promise<KycRailsData>Returns Promise<KycRailsData>
bankDetails()
The field schema a given rail requires. The authority on which of the ~70 rail-specific bank-account fields to send — read it at runtime rather than hard-coding a rail's shape.
bankDetails(rail: string): Promise<BankDetailsData>Parameters
rail:string
Returns Promise<BankDetailsData>
Related
Receiver
A verified identity — the thing both ramps hang off. Everything a receiver owns is reachable from the instance (receiver.addBankAccount(…), receiver.wallets())…
CrossChainSwap
A swap between two chains, settled by NEAR Intents — client.crossChainSwaps. Pay exactly amountIn of the origin asset to depositAddress…