Skip to content

Submit

Submit a transfer plan. The user confirms in the wallet. Amount and quote: Amount & quote.

Ready to submit

Use this checklist to enable the confirm button. submit still validates the same things and will throw if something is missing — this is only for UI.

  1. Session view is active
  2. Connection status === 'connected'
  3. Token is eligible
  4. plan.flow !== 'unavailable'
  5. Amount is valid (validateAmount)
  6. Quote is present when the flow needs one (see below)
  7. Not already in requires_retry (then show Retry instead)

Quote

Direct can omit quote. Swap and bridge need a current quote — if the amount changed, refetch and do not submit a stale one.

Pass the whole quote object into submit. Do not build or edit fields.

submit

ts
const result = await client.wallets.transfer.submit({
  plan,
  amount,
  quote,
  onStatus: event => {
    event.status;
    event.hash;
    event.error;
  },
});

ExecuteWalletTransferRequest:

FieldMeaning
planFrom getPlan / getPlanSync
amountHuman-readable source crypto
quote?From getQuote. Required for swap / bridge; optional for direct
clientTxId?Correlation id for status events. Generated when omitted
onClientTxId?Called with the id that will be used
onStatus?Per-call status events. Same payload as wallets:transferStatus

Result

ts
result.status; // 'completed' | 'requires_retry'
result.hash;
result.type; // 'evm' | 'solana' | 'bitcoin'
result.flow;
result.isSponsored;
result.clientTxId;
statusMeaning
completedTransfer finished
requires_retryThe wallet already signed and sent. Registering that deposit with Swapped failed. Call retry() — do not submit again

submit throws WALLET_TRANSFER_REQUIRES_RETRY if a previous submit already returned requires_retry.

requires_retry

The wallet already signed / sent. Registration with Swapped failed. Show Retry, not “Start over” and not a new deposit.

ts
if (result.status === 'requires_retry') {
  await client.wallets.transfer.retry({
    onStatus: event => {
      event.status;
    },
  });
}

retry throws WALLET_TRANSFER_REGISTER_FAILED if it fails again. Call retry() once more. WALLET_TRANSFER_NO_PENDING_RETRY means there is nothing to retry.

Status

onStatus and client.on('wallets:transferStatus') receive WalletTransferStatusEvent. Each event also has clientTxId, optional hash, isSponsored, and error: { code, message? }.

StatusWhat it means
initiatingDeposit is starting
waiting_for_a_signatureAsk the user to confirm / sign in the wallet
waiting_for_confirmationWallet popup is open for a normal send
sendingTransaction was submitted; hash may be present
in_progressWaiting for on-chain confirmation
swap_started_waiting_for_second_confirmationFirst swap tx sent; another confirmation may be needed
registeringOn-chain send succeeded; telling Swapped about the deposit
completedDeposit finished — show the success screen
requires_retryWallet already sent; registering with Swapped failed — show Retry
failedTransfer failed — show the error
ts
const off = client.wallets.transfer.on('transferStatus', event => {
  // same as client.on('wallets:transferStatus', event)
});

Errors

Submit rejects with WALLET_TRANSACTION_REJECTED (user cancelled in the wallet), WALLET_TRANSFER_INVALID_AMOUNT, WALLET_TRANSFER_EXECUTE_FAILED, WALLET_TRANSFER_INSUFFICIENT_FEE, WALLET_TRANSFER_REQUIRES_RETRY, WALLET_NOT_CONNECTED, SESSION_NOT_ACTIVE, and others. See Errors.