code field. Switch on err.code to handle each case.
Error codes
USER_REJECTED
USER_REJECTED
The user dismissed the approval popup. Prompt them to retry the action.
INSUFFICIENT_FUNDS
INSUFFICIENT_FUNDS
The selected holding’s balance is too low for the requested transfer. Surface a clear “not enough balance” message to the user.
POPUP_BLOCKED
POPUP_BLOCKED
The browser blocked the wallet popup. Make sure
connect() and send() are called from a user gesture (e.g. a button click).NOT_CONNECTED
NOT_CONNECTED
The method was called before
connect(). Call await c8.connect() first.INITIALIZATION_FAILED
INITIALIZATION_FAILED
The provider failed to initialize. Verify your
C8WalletProvider config (dappName, network).TRANSFER_PREPARATION_FAILED
TRANSFER_PREPARATION_FAILED
The wallet could not prepare the transfer. Often indicates invalid
senderPartyId, instrumentId, or amount.EXECUTION_FAILED
EXECUTION_FAILED
The transfer was submitted but failed to execute on the Canton ledger.
FAILED_TO_FETCH_TRANSFER_STATUS
FAILED_TO_FETCH_TRANSFER_STATUS
Could not retrieve transfer status. Retry, or check connectivity to the Canton network.
FETCH_INSTRUMENTS_FAILED
FETCH_INSTRUMENTS_FAILED
getInstruments() failed. Verify the wallet is connected and reachable.FETCH_ACCOUNTS_FAILED
FETCH_ACCOUNTS_FAILED
getAccounts() failed. Verify the wallet is connected and reachable.CHECK_TX_STATUS_FAILED
CHECK_TX_STATUS_FAILED
checkTxStatusById() failed. The txId may be invalid or the ledger may be temporarily unreachable.