Skip to main content
The SDK ships no wallet stack. It is not coupled to Privy, Turnkey, AppKit, wagmi, or anything else, and it never connects a wallet itself. Wallet discovery, connection, and disconnection are your app’s job. That is deliberate. A partner may be a wallet provider themselves, and every partner already has a wallet story before they reach Passage. So the SDK inverts it: you implement one small interface, EvmWallet, and the SDK drives it. Do that once and every on-chain flow works - Superstate swaps, Ondo buys and sells, Centrifuge investments, redemptions and claims, token-sale approvals, ownership proofs. Using an embedded wallet provider? See Wallet partners for providers with a documented Passage integration.
The SDK uses and ships viem types, the de-facto TypeScript standard for Ethereum, so the interface lines up with whatever you are already using. A SolanaWallet seam will follow the same shape when Solana lands.

Two shapes, one seam

There are two interfaces, and the smaller one is a subset of the larger. EvmWallet extends EvmSigner, so implementing the full interface satisfies both. If all you need is the requirements checklist binding a wallet to an offer option, a signer is enough and your users never see a gas prompt. Those entry points take a ConnectWallet, which is an EvmSigner plus the chain the signature is proven on (EvmSigner & { readonly chain: EthereumChain }). All of these types come from @passage-cl/react/universal. Since v0.13.0 the root entry point no longer re-exports them.

Implement EvmWallet

Every method that takes a chain gets it as an explicit parameter. Switch the wallet to that chain before acting - the SDK does not assume your wallet is already pointed at the right one. On a wallet session (a user signed in with their wallet instead of a CoinList login), a network change ends the session, because the session is bound to one address on one chain. signMessage signs an EIP-191 personal message. The SDK passes the text exactly as CoinList wrote it, and a changed byte fails the signature. Send it to personal_sign hex-encoded, as viem’s and wagmi’s signMessage({ message }) do. MetaMask recognizes a Sign-In With Ethereum challenge only in hex: sent as plain text, it shows a generic signature request and skips the check that warns the user when the page is not the site the message names. awaitTx gets whatever hash your writeContract or broadcastRawTx returned. If your wallet returns anything other than a transaction hash, such as a Safe or userOp hash, resolving it to the transaction that mined is your job.

Adapter: wagmi and AppKit

This is the canonical adapter, based on the one the partner demo runs. Its signMessage goes through viem, which hex-encodes the message for personal_sign. awaitTx must resolve with the receipt even when the transaction reverted: the SDK reads receipt.status to report a mined revert as a step of its own. A wallet that throws there makes the revert look like an unconfirmed transaction. Any stack that can sign a message and send a transaction works the same way.
wagmiEvmWallet.ts

Let wallet errors propagate

Do not catch and translate your wallet library’s errors. Let them throw. The SDK catches them and classifies them into a typed WalletError, so you never parse a wallet error string yourself. It walks viem’s error cause chain, so a rejection wrapped two levels deep still classifies: Before v0.15.0, a backend-built transaction that reverted at gas estimation classified as unknown. It is now contract_reverted, with the contract’s reason. Before v0.17.0, a plain 4001 from a signer that calls the provider directly classified as unknown. It now reads as user_rejected, so a user who cancels is not told something failed.

Report a disconnected wallet

When an EvmWallet method cannot act because the wallet is gone, throw WalletDisconnectedError. That covers a wallet that disconnected and a user who switched to an account other than the wallet’s address. The SDK classifies it as disconnected, and the checkouts and the Centrifuge claim ask the user to reconnect instead of to try again. WalletDisconnectedError is exported from @passage-cl/react/universal only. Its constructor is (message?, { cause? }), so you can pass your wallet library’s own error as the cause. The SDK recognizes it by its name as well as by instanceof, so one thrown from a second copy of the SDK still classifies.
guardAccount.ts
You do not need it when your wallet library already says so. The SDK walks the whole cause chain, not only viem’s, and treats these the same way:
  • an error with the EIP-1193 code 4100 (viem’s UnauthorizedProviderError), including a plain provider error object
  • wagmi’s ConnectorNotConnectedError
  • a WalletDisconnectedError anywhere in the chain
A transaction that mines and then reverts is not a WalletError. The flow reports it as a step of its own, such as approval-reverted or swap-reverted. A receipt does not say why a transaction reverted, so when your Config.logger runs at the debug level, the SDK replays the reverted transaction as an eth_call and logs the contract’s reason. The replay waits at most 10 seconds. Below debug, the SDK sends no extra RPC request. Flows surface a WalletError as the cause on the step that failed, so you can tell a user rejection apart from an infrastructure problem. See Errors and edge cases for the full breakdown.

Proving wallet ownership

With a CoinList login, two identities are involved in a purchase, and they are not the same thing:
  • The CoinList session (from OAuth) identifies who is investing.
  • The wallet is where the assets are delivered.
An ownership proof is what links them, which is why an offer with an external_wallet or whitelisted_wallet requirement has the user sign a message before they can transact. Some offers go further: the issuer only settles to wallets they have allowlisted. Superstate assets work this way, and the same allowlists are what make permissioned DeFi pools and RWA lending markets reachable. Ownership proof is provider-agnostic, so it lives on the platform namespace rather than being duplicated per provider:
Every passage.wallets method requires a CoinList user, so a wallet session does not qualify. All of them except connect throw NotAuthenticatedError otherwise; connect returns a not_authenticated error instead. In the browser, passage.wallets.connect runs the same three steps in one call: it requests a challenge (SIWE by default, with domain and uri taken from the current page), has the wallet sign it, and submits the signature. Its wallet is a ConnectWallet, and it never throws. It resolves { type: "success", binding }, { type: "cancelled" } (only when your optional isCancelled callback returns true before the signing or binding step), or { type: "error", error: { code, retryable } }, where code is not_authenticated, user_rejected, wallet_not_whitelisted, max_wallets_reached, or unknown:
passage.wallets also reads and removes those bindings: list({ offerId, offerOptionId }) returns the wallets bound to an option, and remove({ offerId, addressId }) unbinds one.
You rarely need to write the sequence above. RequirementsChecklistContainer runs it for you when an offer has an external_wallet or whitelisted_wallet requirement, and the Superstate Swap allowlist flow wraps it in one idempotent call.

CheckoutWalletSelection: what checkout takes

EvmWallet is what the SDK drives. CheckoutWalletSelection is what you hand CheckoutContainer: the wallets the buyer may spend from, your connector for an external one, and optionally the wallet you have already settled on. It is the shared WalletSelection (from @passage-cl/react/universal, the same shape every SDK screen reads its wallets from) plus one checkout-only field, preselected:
externalAdapter is one object rather than two optional lambdas, because a screen that can connect a wallet must also be able to let it go. You can still pass a connected external with a null adapter, to show a wallet the user cannot change from the checkout. If your disconnect rejects, the SDK logs it and keeps the current selection. WalletSelection also has two helpers, from @passage-cl/react/universal: find is how a checkout tracks the wallet the user confirmed: it remembers the address and looks it up again on every render. So you can hand over a fresh EvmWallet for the same address after an account or chain change, and retire the old one. When you stop supplying that address, the checkout returns to its wallet step. See When the wallet disconnects.

Loading wallets

A wallet stack restores its wallets asynchronously after page load. Set status: "loading" until every embedded wallet is listed, then "ready". Omitting status means "ready". Privy’s ready alone is not enough: it turns true before the embedded wallet is listed, and while Privy logs in from your own session it is ready with no user yet. Wait until the embedded wallets you expect are in the list. Only the claim card reads status today, and only for its Centrifuge offers: ClaimContainer with at least one centrifuge::vault offer among its offers. It is the one screen that would read an empty selection as “the user has nothing”. Before the card’s first answer, "loading" shows its loading state, reads no Centrifuge position and offers no connect. The card answers for every offer or for none, so while it loads, its token-sale rows wait too. Once it shows content, a switch back to "loading" keeps that content until "ready". A card of token sales only, and every checkout, ignore status. See Centrifuge Vaults.

Skipping the wallet step

Set preselected to a ready EvmWallet when the page already knows the answer: a sell page reached from a position knows which wallet holds it, and an app with a single embedded wallet has only one answer on a buy too. Asking again would be a question with one possible answer. Every checkout honors it, in one of two ways:
  • Ondo buy, Ondo sell, Centrifuge buy, Centrifuge sell (redeem), and the CoinList token sale skip the wallet step. The checkout opens on the amount and renumbers the cards that remain. The wallet does not have to appear in embedded or external: you supply a ready EvmWallet, and these flows never resolve it back to a row. On every render they look its address up in the current preselected, embedded and external, so a fresh EvmWallet at the same address is used. With no wallet step to return to, a preselected wallet that is gone fails its next send as disconnected.
  • Superstate never skips its wallet step, because that step allowlists the wallet on-chain and no preselection can stand in for it. The step opens with the preselected wallet’s row already selected, so the user confirms it rather than finding it. That needs a row: a preselected wallet that matches neither an embedded wallet nor the connected external one by address selects nothing.
It is read once, at mount. Changing it mid-flow is ignored: the approval that follows the amount step is granted by one specific wallet, and moving the flow onto another under it would strand that approval. If your preselection can change on one page, add wallets.preselected?.address to the checkout’s remount key. After an order, the flow resets to the step it opened on, so a skipped wallet step stays skipped. On a wallet session, the Ondo and Centrifuge checkouts pay from wallets.external and open on the amount, whatever you set in preselected. That wallet must be at the session’s address. If it is not, even when the session’s wallet is in embedded, the checkout shows a Connect your wallet card instead. The rest of wallets stays live: a newly connected external wallet appears as a row without a remount, and a confirmed wallet you stop supplying sends the checkout back to its wallet step, when it has one. There is deliberately no separate wallet model here: EvmWallet already carries the address, so an { address, signer } pair would be a second wallet type to keep in sync with the first. Everything a wallet row displays beyond the address - the network name - comes from the checkout’s execution chain rather than from the wallet, because that is the chain the transaction goes to whatever the wallet is currently pointed at.

Next step

Building the Checkout flow

Hand your wallets to CheckoutContainer and let it render whichever provider the offer belongs to.