Listing
organizationId the list is personal only. getOrgMe() returns the id of the caller’s
organization; pass it to list, refresh and recheck that organization’s wallets.
Each AllowanceItem carries:
The list comes from the server’s index, not from the chain. To scan again:
nextAllowedAt, wait until then. disabled: true
means scanning is turned off for the account.
recheckAllowance(request) reads one approval back from the chain through the server. The change
methods call it for you.
Revoking and reducing
- Revoke sets the allowance to
0and sends no native value. - Reduce takes
amountAtomic, a string of digits in the token’s smallest unit. There is no decimal form, so convert withtoken.decimalsyourself. The new amount must be below the current allowance and above0: userevokeAllowancefor0. - Pass the item exactly as you listed it. An organization item is changed through the organization routes automatically.
- The server accepts the change only if it lowers an allowance it can verify on chain. A refusal is thrown before anything is signed.
walletPasswordis needed in strict mode, and for wallets derived from the recovery phrase.
The result
By default the methods return right after the broadcast, withrecheck: 'pending' and
confirmation: 'unchecked'. Read the new value later with recheckAllowance or listAllowances.
Pass waitForConfirmation: true to wait for the last transaction (up to 90 s on EVM, 60 s on
Solana, 180 s on Tron) and read the allowance back:
recheck: 'updated': confirmed and read back;allowanceholds the new value.recheck: 'pending': the transaction did not confirm in time, failed, or the read-back failed.confirmationsays which (confirmed,failedortimeout). This never throws, because the transactions are already out.
Tokens that need two transactions
Some tokens (USDT-style) refuse to move a non-zero allowance straight to another non-zero value. For those, a reduce takes two transactions: set to0, then set to the new amount. The SDK finds
out by simulating against the node, never from a list. Solana is never affected, and a revoke never
is.
Check before the user confirms, and pass the plan on so it is not simulated twice:
0 after it. On Tron the second transaction is sent only after the first is confirmed,
whatever waitForConfirmation says.
If the first transaction went out and the second did not, the SDK throws
AllowanceChangePartialError with txHashes holding what was sent. The allowance may now be 0.
Do not retry blindly: read where it stands with recheckAllowance or listAllowances, then reduce
again from there.
Hardware wallets
A wallet on a hardware root uses the hardware session flow:HardwareAllowanceZeroFirstUnsupportedError
before the device is asked: offer a revoke instead. No wallet password is involved.
prepareHardwareAllowanceChange covers personal wallets only. revokeAllowance and
reduceAllowance throw HardwareSignerRequiredError for a hardware wallet.