CrossmintEmbeddedOfframp shows its own screens for every step and every error. Its callbacks tell your app what happens, so you can update your app’s state, log errors and follow the order. This guide tells you what each event, status and error reason means, and what to do. For the props and types, see the React or React Native SDK reference.
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.
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.
Next Steps
Manage Orders
Follow an order by its
orderIdTest a Failed Payout
Check how your app handles
payout-failed
