| Package | Role | Depends on |
|---|---|---|
@walletconnect/pay-core | Engine API client — contract types, CAIP utilities, the browser Transport seam (createHttpTransport), and the server-side createEngineClient that holds your API key. The foundation. | — |
@walletconnect/pay-state | The headless runtime — the payment state machine, orchestration, the injectable seam contracts, the session factory, and the public PaymentSnapshot view-model. No React, no HTTP client, no wallet SDK. | pay-core |
@walletconnect/pay-react | Thin React binding — usePaymentSession returns the snapshot plus domain actions. Zero state-machine leak. | pay-state |
@walletconnect/pay-appkit | Reown AppKit adapter — implements the WalletProvider seam over a Reown AppKit instance (plus the Solana web3 loader). A /react subpath ships the wallet-connection hook. | pay-state |
@walletconnect/pay-core
The foundation: Engine contract types, CAIP utilities, and the Transport seam. Zero runtime dependencies. Two entry points — a browser-safe main entry and a server-only /server entry that holds the key.
Browser entry — @walletconnect/pay-core
Transport contract (the seam the runtime depends on) — five methods, each resolving to an EngineResponse<T> envelope (never throwing):
GetPaymentResponse, PaymentOptionExtended, Amount, CollectData, PaymentStatus, …), CAIP utilities (parseCaip2, parseCaip10, …), and transport error helpers (TRANSPORT_ERROR_CODES, isAbortError, DEFAULT_TIMEOUT_MS).
Server entry — @walletconnect/pay-core/server
EngineClient exposes the same five methods as Transport, but attaches the secret Api-Key and Wcp-Version headers and calls the Engine directly. Use it only on the server.
@walletconnect/pay-state
The headless runtime: the payment state machine, the injectable seam contracts, the framework-agnostic PaymentController, the signing strategies, and the public PaymentSnapshot view-model.
createPaymentController
The framework-agnostic binding (the React hook wraps this). Use it directly in a non-React host.
Seams
The runtime reaches the outside world only through these contracts:transport, wallet, and signer:
Signing strategies
PaymentSnapshot
The public, serializable view-model. state is one of:
| Group | States |
|---|---|
| Loading | Initializing |
| Wallet | ReadyForWallet, ConnectingWallet |
| Options | LoadingOptions, OptionsReady, NoOptions, OptionSelected |
| Compliance | InformationCapture |
| Approval | RequiresApproval, AwaitingWalletApproval, WaitingForConfirmation |
| Terminal | Succeeded, Failed, PaymentExpired, PaymentCancelled, InvalidPayment, SanctionedUser |
@walletconnect/pay-react
A single hook — usePaymentSession — a useSyncExternalStore-based binding over the controller. SSR-safe, tear-free, zero XState leak.
UsePaymentSessionOptions matches PaymentControllerOptions (paymentId, seams, wallet, initialPayment?, signingTimeoutMs?, onMachineEvent?). The return is { snapshot } plus the named actions:
| Action | Drives |
|---|---|
connectWallet(wallet, namespace?, options?) | Begin connecting a wallet |
disconnectWallet(namespace?) | Disconnect one namespace, or all |
selectOption(option, rank) | Pick a payment option |
confirmSelection() | Confirm and move toward signing |
unselectOption() | Return to the option list |
submitInfoCapture(data) | Submit collected KYC/contact data |
navigateBack() | Step back |
refreshOptions, notifyQuoteExpired, acknowledgeQuoteExpiry, markUserSanctioned, setProfileLookup, notifyPaymentExpired, failWalletConnection. Most gateways won’t need these to start.
@walletconnect/pay-appkit
The Reown AppKit adapter — implements the WalletProvider seam over an AppKit instance, and ships a headless wallet-picker controller. The main entry is framework-neutral; the React hook lives on /react.
Main entry — @walletconnect/pay-appkit
createAppKitWalletList returns a controller — wallet (the seam), getState(), subscribe(), fetchWallets(), search(), loadMore(), getWcUri() — for non-React hosts.
React entry — @walletconnect/pay-appkit/react
WalletListState and adds wallet (the seam to hand usePaymentSession), searchQuery/setSearchQuery (debounced), fetchWallets, loadMore, and getWcUri for the pairing QR.
Next steps
Implementation
The step-by-step React / Next.js walkthrough.
API Reference
The Gateway and Payments endpoints behind the SDK.