# Get Started This tutorial takes you through the basics of sending your first operation on the XRP Ledger with **simpleXRPL**. ## Goals By the end of this tutorial, you will be able to: - Construct a connector. - Initialize a client. - Discover your accounts. - Transfer XRP between accounts. ## Prerequisites To complete this tutorial, you should: - Have some familiarity with writing code in TypeScript. - Have **Node.js version 20.19** or later. ## Source Code You can find the complete source code for this tutorial's examples in the [code samples section of this website's repository](https://github.com/ripple/opensource.ripple.com/tree/main/_code-samples/simplexrpl/) ## Steps ### 1. Install dependencies ```sh npm install simplexrpl ``` ### 2. Construct a connector A connector is a signing backend that determines how operations are executed and signed. This guide uses local signing with a `LocalSigner` constructor. This self-custody connector manages accounts and signs locally, making it ideal for testing and development. // This Get Started sample walks through the basics of using simpleXRPL. import { LocalSigner, SimpleXRPL } from 'simplexrpl' // --- Construct a connector --- // The LocalSigner constructor is a self-custody option that signs locally. // Intended for testing and development. const signer = LocalSigner.fromEnv() For production you'd construct a custodian connector instead and pass it to `init` in place of (or alongside) the local one. See [Connectors](/docs/simplexrpl/references/connectors) for how to build each one; every vertical operation then works the same regardless of which connector owns the account. ### 3. Initialize the client Initializing an account binds connectors to a network and builds the account index. // --- Initialize the client --- const client = await SimpleXRPL.init({ xrpldUrl: 'wss://s.altnet.rippletest.net:51233', faucetUrl: 'https://faucet.altnet.rippletest.net/accounts', signers: [signer], }) - `signers[0]` is the default *primary* account used for operations if not specified. - If you don't set a `signer`, the client is read-only and you will receive a `NoSignerError` when attempting write operations. ### 4. Discover your accounts Connectors discover their accounts at initialization, and the client merges them into a single index keyed by XRPL account address. List them, resolve the primary, and read on-chain state. // --- Discover your accounts --- // Connectors discover their accounts at init; the client merges them into one // index keyed by XRPL address. for (const [address, account] of client.accounts) { console.log(`${address}: ${account.signer.kind}`) } // Get the primary account used to submit vertical operations. // No args returns the primary account. const primary = client.resolveAccount() console.log(`primary: ${primary.address}`) // Read an account's on-chain state. No args retrieves the primary account. const state = await client.account.retrieve() console.log(`balance (XRP): ${state.data.xrpBalance} | sequence: ${state.data.sequence}`) ### 5. Transfer XRP Operations are grouped into domain-specific verticals reached off the client. This guide sends XRP from the primary address to another. For a full list of vertical operations, see: [Verticals](/docs/simplexrpl/references/verticals). // --- Send an XRP transfer --- const result = await client.xrp.transfer({ to: 'rDestination00000000000000000000000', amount: '10', }) console.log(`submitted: ${result.txHash}`) await client.disconnect() ## See Also - **References**: - [LocalSigner.fromEnv()](/docs/simplexrpl/references/connectors/local#localsignerfromenv) - [SimpleXRPL.init()](/docs/simplexrpl/references/client#simplexrplinit) - [account.retrieve()](/docs/simplexrpl/references/verticals/account/retrieve) - [xrp.transfer()](/docs/simplexrpl/references/verticals/xrp/transfer)