Get started with a reliable XRP Ledger RPC endpoint to use the tools below.
Your Chainstack XRP Ledger node serves the rippled API two ways: JSON-RPC over the HTTPS endpoint, and the WebSocket API over the WSS endpoint. The official SDKs — xrpl.js and xrpl-py — connect over WSS, and xrpl-py also connects over HTTPS. XRP Ledger has its own method set and does not implement the Ethereum eth_* interface, so EVM tooling — ethers.js, web3.py, Hardhat — does not apply here.
JSON-RPC over HTTPS
Every call is an HTTP POST carrying a method and a params array. The params array holds exactly one object, even when a method takes no arguments — a bare {} rather than an empty array.
The result object reports the client version, the ledgers this node holds, and its sync state:
Replace YOUR_CHAINSTACK_ENDPOINT with your node’s HTTPS endpoint. For the credential in that endpoint and the other ways to authenticate, see Authentication methods for different scenarios.
WebSocket API over WSS
The WSS endpoint serves the rippled WebSocket API, which frames requests differently from JSON-RPC: each message names the method in a command field and carries its arguments at the top level, with an optional id that the response echoes. A WebSocket connection also supports subscriptions, which push events such as closed ledgers and validated transactions as they happen.
The node answers with the subscription result, then sends a ledgerClosed message for every new validated ledger:
Replace YOUR_CHAINSTACK_WSS_ENDPOINT with your node’s WSS endpoint, which carries the same auth token as the HTTPS endpoint.
How much ledger history your node holds
XRP Ledger Global Nodes are Extended — they keep more recent ledgers than a default rippled server holds, but not the full chain. The node deletes old ledgers in rotation and holds between 750,000 and 1,500,000 of the most recent ledgers. At the Mainnet close rate of about 3.8 seconds per ledger, that is about 33 to 66 days of history.
Read complete_ledgers from server_info at runtime and work within it. The lower bound jumps forward each time the node rotates out old ledgers, so treat any specific depth as a moving target rather than a guarantee.
Requesting anything below the window returns lgrNotFound:
The same floor applies to transaction history and to account state alike — account_tx clamps its search range to the retained window rather than reaching further back. For queries older than the window, use a full-history source such as an XRP Ledger public full-history server.
Python
Use the official xrpl-py SDK. Its JsonRpcClient talks to your node over HTTPS:
This prints the node’s client version, its retained range, and the queried account’s balance in drops:
For subscriptions, use AsyncWebsocketClient over the WSS endpoint. This script subscribes to the ledger stream and prints each closed ledger:
JavaScript
Use the official xrpl.js SDK. Its Client connects to your node over the WSS endpoint:
Sign and submit a transaction
submitAndWait fills in Fee, Sequence, and LastLedgerSequence from the node, signs the transaction with the wallet locally, submits it, and resolves once a validated ledger contains it:
On Testnet, a successful payment prints:
Track new ledgers
Subscribe to the ledger stream and handle the ledgerClosed event. The node pushes one message for every validated ledger, every few seconds:
To follow validated transactions instead, subscribe to the transactions stream and handle the transaction event. Last modified on September 27, 2026