Skip to main content

Usage

quote(input)

What the withdrawal costs this user, from Chipi: { feeBps, sponsored, userReceives }. sponsored says whether Chipi pays Circle’s fee back to the recipient on the destination chain.
  • chain (CctpEvmChain), amount (string | number), walletAddress (string: the Chipi wallet), getBearerToken.

withdrawAsync(input)

  • The signer, as useCallAnyContract: wallet (WalletData), and either usePasskey: true with externalUserId (and optionally credentialId) or an encryptKey.
  • chain (CctpEvmChain): the destination chain, from CCTP_EVM_CHAINS.
  • recipient (string): the destination EVM address. Checked before signing: 40 hex digits, not the zero address, and a correct EIP-55 checksum when it carries mixed case.
  • amount (string | number): human USDC.
  • getBearerToken (() => Promise<string | null | undefined>): asked at every step.
  • onStatus (optional): ({ step, eta, burnTxHash?, destTxHash? }) => void. Steps: quoting, burning, attesting, recording, finalizing, done.
Withdrawals always use fast finality (a standard transfer out of Starknet waits hours for the L1 proof). The burn’s maxFee is the quoted fee, so Circle attests fast; Circle only takes the real fee. Resolves with { burnTxHash, destTxHash, recipient, quote }.

Errors

A CrossChainWithdrawError means the Starknet burn is done and the delivery did not finish. It carries burnTxHash: call finalizeCrossChainWithdrawal again (the relayer is idempotent). Any other error happened before signing.

Example Implementation