stellar_signXDR, and WalletConnect Pay wraps the signed transaction in a fee-bump transaction and broadcasts it. The buyer never pays the XLM network fee, and your wallet never submits the transaction.
This guide applies whether you integrate with the Wallet Pay SDK or directly with the Gateway API (API-first). The signing requirements are identical — Stellar actions arrive as
walletRpc actions, and the signed envelope is returned in the results array. The code samples below use SDK method names; if you are integrating API-first, the equivalents are:Everything else in this guide — advertising Stellar accounts, routing by namespace, the
stellar_signXDR payload, and returning the signed envelope — is the same in both integrations.Stellar payment flow
A Stellar payment follows the same three-call flow as any other WalletConnect Pay payment. The Stellar-specific parts are the signing method (stellar_signXDR), the checks your wallet performs before signing, and the fee bump WalletConnect Pay adds on confirm.
Key differences from other chains
- Fee-sponsored — WalletConnect Pay wraps the buyer-signed transaction in a fee bump and pays the XLM fee. The buyer only needs USDC; there is no fee or gas balance check.
- Sign only, never submit — use
stellar_signXDR, notstellar_signAndSubmitXDR. Submitting the inner transaction yourself would make the buyer pay the fee and consume the sequence number WalletConnect Pay is waiting for, which fails the payment. - The envelope is opaque — WalletConnect Pay pins the transaction to the buyer’s next sequence number, a single USDC payment operation, no memo, and a time bound that ends when the quote expires. Confirm validates all of these, so re-building, adding operations, changing the fee, or adjusting the time bounds gets the payment rejected.
- Plain string result — the confirm result is the signed
TransactionEnvelopeas a base64 string, just like a Solana signed transaction. No object result is involved. - Mainnet only — WalletConnect Pay settles Stellar on pubnet (
stellar:pubnet).
Supported assets
USDC is a Stellar issued asset, so the buyer’s account must have a trustline to the Circle issuer above. An account without the trustline reads as a zero balance, and the gateway does not offer the Stellar option.
Implementation requirements
Advertise Stellar accounts
Include the wallet’s Stellar pubnet account when callinggetPaymentOptions, using the CAIP-10 format with the G… StrKey account ID:
accounts.ts
Only advertise the
G… account ID. Muxed (M…) accounts and raw public keys are not valid Stellar accounts for WalletConnect Pay. The gateway checks that the account exists on-chain and holds enough USDC, and omits the Stellar option otherwise — this is expected, not an integration error.Route actions by namespace
Extract the namespace fromactions[i].walletRpc.chainId and route stellar actions to the Stellar signer:
routeActions.ts
The stellar_signXDR action
After the user selects the Stellar option, the build action resolves to a walletRpc action. Its params is a JSON string containing a single-element array:
The payload follows the Stellar RPC reference. If your wallet already implements
stellar_signXDR for WalletConnect sessions, reuse that signer.
Verify and sign the envelope
Before signing, your wallet must:- Bind the network passphrase from
chainId— derive it from the action’s CAIP-2 chain (stellar:pubnet→Public Global Stellar Network ; September 2015). Never trust a network reference from the request body. - Check the source account — the transaction’s source must equal the
accountparameter, and your wallet must custody that account. - Show the payment — decode the operation and display the USDC amount and destination in the signing UI.
- Sign without modifying — add the buyer’s signature and return the full envelope. Do not change the fee, sequence number, time bounds, memo, or operations.
stellarSigner.ts
Return the signed envelope on confirm
Pass the signed envelope indata, in the same position as its action. It is a plain base64 string, so it fits the same data array as EVM signatures and Solana transactions:
approvePayment.ts
{ "signedXDR": "<base64>" } — the stellar_signXDR response shape — as the result. Returning the bare string is the simplest option and works with every SDK version.
On confirm, WalletConnect Pay validates the envelope against the quote, wraps it in a fee bump paid by WalletConnect Pay, and broadcasts it. confirmPayment resolves with succeeded or failed, exactly as on other chains.
Error handling
Validate your integration
1
Funded Stellar account
Import a pubnet account with a USDC trustline and a USDC balance. Open a payment link whose merchant accepts USDC on Stellar and verify that:
- The Stellar option is presented
- The wallet decodes the envelope with the pubnet passphrase and checks the source account before signing
- The confirm request carries the signed envelope as a base64 string in
data confirmPaymentresolves withsucceededand the fee-bump transaction appears in a Stellar explorer, with the fee paid by an account other than the buyer
2
Account without a trustline
Advertise a Stellar account that has no USDC trustline and verify that the Stellar option is omitted while other options are still shown.
3
Regression on other chains
Confirm that EVM and Solana payments still work — their results stay in the same
data array.Sample implementation
Web
advanced/wallets/react-wallet-v2 — see StellarLib.signXDR for signing, the stellar_signXDR branch in PaymentStore.approvePayment, and pages/walletconnect.tsx for advertising the Stellar pubnet account.Additional resources
- Stellar RPC reference — method signatures, account format, and signing semantics for WalletConnect sessions.
- Fee-bump transactions — how the sponsored fee works.
- Stellar XDR reference.