Guides
Wallet Verification Flow
Step-by-step guide to adding, verifying, and approving recipient wallets
Overview#
Before tokens can be distributed, each recipient's wallet must be verified. Verification uses test transactions to confirm the recipient controls the wallet address.
Wallet State Machine#
A VERIFIED wallet with isCurrent: true is the recipient's current wallet, used for distributions.
The examples use the tokuAPI helper from Build a Dashboard, which returns the data field of each response.
Step 1: Add a Wallet#
addWallet adds a wallet for the seat the token acts as, so call it with a token acting as the recipient (x-role-type: USER). To add wallets for other recipients as an admin, use bulkUploadMultipleWallets (below).
The wallet starts as PENDING. If your organization has automated test transactions on and a test transaction is configured for the network, Toku sends the test transaction straight away.
Step 2: Send Test Transaction#
To send (or resend) the test transaction yourself, as an admin:
This only works when automated test transactions are enabled for your organization. Without them, send the transaction yourself and attach it with addTestTxnToWallet:
The wallet moves to PENDING_TXN_APPROVAL and the recipient is emailed to confirm.
Step 3: Check for Wallets Awaiting Confirmation#
Step 4: Approve the Wallet#
The recipient confirms their own wallet in Toku, or an admin (CLIENT_ORG_ADMIN or FINANCE_ADMIN) approves it on their behalf. walletRequestID is the wallet's walletVerificationRequest.walletVerificationRequestID:
A wallet can only be approved once its test transaction has succeeded or a transaction link is attached.
Bulk Upload#
To add wallets for many recipients at once, as an admin:
networkName and walletType must match a network and wallet type set up in your organization. On a bad row nothing is created and the response is { success: false, createdWallets: 0, message: "..." }.
The uploaded wallets start as PENDING. Send each one a test transaction with sendTestTransaction; there is no bulk test transaction call in the API.
Handling Rejections#
If a wallet fails verification:
The recipient can then submit a new wallet address and restart the verification process. A recipient withdraws their own request with cancelWalletRequest (status CANCELLED).
Deactivating & Reactivating Wallets#
A reactivated wallet goes back to PENDING with a new verification request, so it needs a new test transaction and approval before it is current again.
Querying Wallet Status#
| Endpoint | Returns |
|---|---|
getAllWallets | Every wallet the token's seat can see (all wallets in the org for an admin) |
getEmployeeWallets | Active wallets for one employee (?roleInOrgID=, admin) |
getEmployeeHistoricalWallets | Archived, cancelled and rejected wallets for one employee (?roleInOrgID=, admin) |
getPendingWallets | PENDING wallets for the token's seat, or ?roleInOrgID= |
getPendingWalletRequests | Wallet requests still waiting for a test transaction (admin) |
getTestTxnApprovalPendingWallets | PENDING_TXN_APPROVAL wallets for the token's seat, or ?roleInOrgID= |
getVerifiedWalletTestRequests | Requests for verified, current wallets (admin) |
getPendingWalletTestRequests | Test transactions sent and awaiting confirmation (admin) |
Resending Test Transaction Email#
If a recipient didn't receive the notification: