Skip to main content
SDK methods reject with an error object that includes a stable code field. Switch on err.code to handle each case.
try {
  const { txId } = await c8.send({ /* ... */ });
} catch (err) {
  switch (err.code) {
    case 'USER_REJECTED':       /* ... */ break;
    case 'INSUFFICIENT_FUNDS':  /* ... */ break;
    case 'POPUP_BLOCKED':       /* ... */ break;
    case 'NOT_CONNECTED':       /* ... */ break;
    // ...
  }
}

Error codes

The user dismissed the approval popup. Prompt them to retry the action.
The selected holding’s balance is too low for the requested transfer. Surface a clear “not enough balance” message to the user.
The method was called before connect(). Call await c8.connect() first.
The provider failed to initialize. Verify your C8WalletProvider config (dappName, network).
The wallet could not prepare the transfer. Often indicates invalid senderPartyId, instrumentId, or amount.
The transfer was submitted but failed to execute on the Canton ledger.
Could not retrieve transfer status. Retry, or check connectivity to the Canton network.
getInstruments() failed. Verify the wallet is connected and reachable.
getAccounts() failed. Verify the wallet is connected and reachable.
checkTxStatusById() failed. The txId may be invalid or the ledger may be temporarily unreachable.