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).

const wallet = await tokuAPI('POST', 'addWallet', {
  name: 'Primary ETH Wallet',
  walletAddress: '0x1234567890abcdef1234567890abcdef12345678',
  network: 'Ethereum',
  orgNetworkID: 'network-uuid',    // from getNetworksNew
  tokenTypeID: 'token-type-uuid'   // from getTokenTypesNew
});
// { walletID: "..." }

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:

await tokuAPI('POST', 'sendTestTransaction', {
  walletID: wallet.walletID
});
// { success: true, queued: false }

This only works when automated test transactions are enabled for your organization. Without them, send the transaction yourself and attach it with addTestTxnToWallet:

await tokuAPI('POST', 'addTestTxnToWallet', {
  walletID: wallet.walletID,
  link: 'https://etherscan.io/tx/0xabc...',
  transactionHash: '0xabc...'
});

The wallet moves to PENDING_TXN_APPROVAL and the recipient is emailed to confirm.

Step 3: Check for Wallets Awaiting Confirmation#

// As an admin: every wallet whose test transaction awaits confirmation
const awaiting = await tokuAPI('GET', 'getPendingWalletTestRequests');

// As the recipient (or an admin passing ?roleInOrgID=...): that seat's wallets
const mine = await tokuAPI('GET', 'getTestTxnApprovalPendingWallets');

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:

await tokuAPI('POST', 'approveWalletRequest', {
  walletRequestID: 'wallet-verification-request-uuid',
  verifiedAmount: '0.001'  // required when your org has test amount verification on
});
// { wallet: { ..., status: "VERIFIED", isCurrent: true } }

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:

const result = await tokuAPI('POST', 'bulkUploadMultipleWallets', {
  wallets: [
    { recipientID: 'role-in-org-uuid-1', walletAddress: '0xabc...', networkName: 'Ethereum', walletType: 'Hot Wallet' },
    { recipientID: 'role-in-org-uuid-2', walletAddress: '0xdef...', networkName: 'Ethereum', walletType: 'Hot Wallet' }
  ]
});
// { success: true, createdWallets: 2 }

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:

await tokuAPI('POST', 'rejectWalletRequest', {
  walletRequestID: 'wallet-verification-request-uuid'
});
// Wallet status → REJECTED

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#

// Deactivate (move to historical)
await tokuAPI('POST', 'markWalletAsNotCurrent', {
  walletID: 'wallet-uuid'
});
// { success: true }; status → ARCHIVED

// Reactivate
await tokuAPI('POST', 'reactivateWallet', {
  walletID: 'wallet-uuid'
});
// { success: true, message: "...", wallet: {...} }; status → PENDING

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#

EndpointReturns
getAllWalletsEvery wallet the token's seat can see (all wallets in the org for an admin)
getEmployeeWalletsActive wallets for one employee (?roleInOrgID=, admin)
getEmployeeHistoricalWalletsArchived, cancelled and rejected wallets for one employee (?roleInOrgID=, admin)
getPendingWalletsPENDING wallets for the token's seat, or ?roleInOrgID=
getPendingWalletRequestsWallet requests still waiting for a test transaction (admin)
getTestTxnApprovalPendingWalletsPENDING_TXN_APPROVAL wallets for the token's seat, or ?roleInOrgID=
getVerifiedWalletTestRequestsRequests for verified, current wallets (admin)
getPendingWalletTestRequestsTest transactions sent and awaiting confirmation (admin)

Resending Test Transaction Email#

If a recipient didn't receive the notification:

await tokuAPI('POST', 'resendTestTxnEmailToWalletOwner', {
  walletID: 'wallet-uuid'
});
Was this page helpful? Suggest edits