Skip to main content
CrossmintEmbeddedOfframp renders the Crossmint offramp in your app for one offramp session. The React and React Native components take the same props and emit the same events. Render the component inside CrossmintProvider, which takes your client-side API key.

Packages

Both packages export:

Props

The component reloads the offramp when the value of credentials, appearance, locale or fill changes. payer and the callbacks can change without a reload.

Payer

EmbeddedOfframpPayer has one method, which the component calls when the user confirms the withdrawal:
Throw OfframpSignatureRejectedError only when the user declined and nothing was broadcast.

Refuse a mismatched wallet

No thrown error refuses a deposit cleanly. OfframpSignatureRejectedError offers a new rate for the same wallet, so a mismatch fails again on the next attempt. Any other error leaves the user on the confirming screen for a deposit that was never sent. The component sends the deposit for the payer wallet you passed when you created the session, so check before you render it: mount CrossmintEmbeddedOfframp only while your connected wallet has the same address and chain as that payer, and otherwise ask the user to switch wallets. createCrossmintWalletSigner throws a plain error for a mismatch, so it has the same effect. Apply the same check before you mount the component when you use it. createCrossmintWalletSigner(wallet) takes a Crossmint wallet, such as the one useWallet() returns. It supports EVM and Solana wallets, and refuses a deposit prepared for another chain or another wallet.

Events

Statuses

onStatusChange reports one of these statuses: orderId is present while an order is on screen, and absent on the amount and bank account screens and when an error ends the session.
One withdrawal can span several orders. After identity verification passes, after the wallet declines the deposit, or when the user takes a new rate, the component creates a new order, so orderId changes. Keep the latest orderId.

Error Reasons

onError reports one of these reasons. When retriable is false, the session cannot continue: unmount the component. When the component shows a failure screen, its Close button calls onCancel. When retriable is true, the same step can succeed on a retry, and in most cases the component shows the problem and lets the user try again. The failed status always ends the session, whatever retriable says.

Sizing

In both modes the component takes the container’s full width. Changing fill reloads the offramp.

Supported Markets

SEPA bank accounts appear in the component only when the payer wallet’s chain has EURC and your project has euro payouts set up. In a consumer (B2C) project, the user’s verified country of residence must also be in SEPA. Otherwise Add a bank account does not offer SEPA, and a SEPA account the user already saved is shown greyed out as unavailable.
Bank accounts in the Philippines, Indonesia, Thailand, Vietnam and Nigeria are listed in Add a bank account and can be saved, but withdrawals to them fail after identity verification for now. See Countries and Rails for the markets Offramp supports.

Saved Bank Accounts

Users can rename and remove their saved bank accounts in the component. Removing one deletes it from the user’s saved payment methods, so it also disappears from the bank accounts API. The component refuses a removal once the session’s withdrawal was sent, and while another withdrawal from the same wallet is still being confirmed.

See Also