Testnet and pubnet
Buckspay supports two Stellar networks:
Pass the
network field in BuckspayConfig. The same field is forwarded to
buckspayFacilitator, which sets the FacilitatorChain header - "stellar-testnet" or
"stellar-pubnet" (hyphen-separated).
Mainnet opt-in guard
Mainnet is supported and off by default. Without an explicit opt-in, constructing a client on"pubnet" throws BuckspayError("INVALID_CONFIG"). This makes it impossible for
a misconfigured or forgotten config to move real funds.
The opt-in is deliberately different in each environment so neither can accidentally inherit
the other’s setting:
- Browser:
allowMainnet: truein theBuckspayConfig. - Node / server:
BUCKSPAY_ALLOW_MAINNET=1environment variable.
USDC and the asset-agnostic design
Buckspay does not hardcode any USDC address. You pass the Stellar Asset Contract (SAC) address when constructing a transfer call:"1.50", "0.000001") and converted internally - you do not deal with raw stroops.
On pubnet, the USDC SAC is Circle’s official contract address. On testnet, use the Circle
testnet USDC SAC.
Dedicated Soroban RPC
createRpcSimContext(rpcUrl) connects the SDK’s simulation engine to a Soroban RPC node.
On pubnet, use a dedicated, consistent RPC endpoint rather than the shared public load
balancer, which is eventually-consistent and can cause simulation failures when ledger state
lags across nodes.
For pubnet with a contract account, mainnetSimContext(rpcUrl, { sponsorAddress }) is the
correct preset - it sets the funded sponsor G... address as the simSource that the
facilitator uses when recording the transaction.
Pubnet example
The example below shows a complete pubnet configuration with theallowMainnet: true opt-in,
a dedicated RPC URL, and mainnetSimContext:
Multi-network rail model
A single asset can be offered over multiple rails: the payer chooses which network to settle on. TheFacilitatorChain value ("stellar-testnet" | "stellar-pubnet") in the relay
payload tells the facilitator which network to submit to. The SDK resolves the rail from the
client’s network field - no extra wiring needed.
Next
Facilitator and BFF
How to configure the relayer and keep the API key server-side.
Account models
Classic and passkey accounts - both work on testnet and pubnet.

