Networks
XRPL Wallet Kit supports mainnet, testnet, devnet, and custom XRPL networks, subject to adapter network restrictions. Network presets determine explorer links and non-mainnet badges. For Xahau mainnet/testnet integration since v0.2.0, see Xahau.
Built-in Networks
import {
XRPL_MAINNET,
XRPL_TESTNET,
XRPL_DEVNET,
} from "@xrpl-wallet-kit/core";
const manager = new WalletManager({
adapters: [...],
network: "mainnet",
});| Constant | Network | WebSocket URL | Browser HTTP RPC |
|---|---|---|---|
XRPL_MAINNET | Mainnet | wss://xrplcluster.com | https://xrpl.ws |
XRPL_TESTNET | Testnet | wss://s.altnet.rippletest.net:51233 | https://s.altnet.rippletest.net:51234 |
XRPL_DEVNET | Devnet | wss://s.devnet.rippletest.net:51233 | https://s.devnet.rippletest.net:51234 |
Custom Network
const manager = new WalletManager({
adapters: [...],
network: "my-network",
networks: [{
id: "my-network",
name: "My XRPL Network",
networkType: "MAINNET", // used for network badge color
rpcUrl: "wss://my-xrpl-node.example.com",
httpRpcUrl: "https://my-xrpl-node.example.com",
nativeAsset: "XRP",
nativeAssetDecimals: 6,
explorerTxUrl: "https://explorer.example.com/tx/{hash}",
explorerAccountUrl: "https://explorer.example.com/account/{address}",
walletConnectChainId: "xrpl:0", // optional, for WalletConnect
}],
});httpRpcUrl is used by browser-side account status and balance lookup. If you enable showBalance, use an HTTP JSON-RPC endpoint that sends CORS headers for your dApp origin.
Network Badge
The modal displays a colored network badge when the connected network is not mainnet:
- Mainnet — no badge (clean UI)
- Testnet — yellow badge:
TESTNET - Devnet — orange badge:
DEVNET - Custom — shows the
idvalue
The modal footer identifies the selected chain and network, for example XRPL Wallet Kit · XRPL Mainnet or XRPL Wallet Kit · Xahau Mainnet, without adding a separate mainnet badge. Testnet and devnet retain a visible network badge.
Switching Networks
Since 0.1.17, the manager exposes a unified network-switching API. It only invokes adapters that explicitly advertise switchNetwork: true and rejects targets outside the adapter's supportedNetworks metadata.
const details = manager.getCapabilityDetails();
if (
manager.can("switchNetwork") &&
details?.supportedNetworks?.includes("testnet")
) {
await manager.switchNetwork("testnet");
}On success, the manager updates and persists the active session, then emits networkChanged. createWalletKit() also exposes the bound shortcut kit.switchNetwork().
INFO
Network switching remains wallet-dependent. DropFi currently implements the unified API. Wallets without a verified switching method fail with UNSUPPORTED_METHOD; reconnect with the intended network instead of mutating session state manually.