{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Client","siteUrl":"https://opensource.ripple.com/","meta":[{"name":"google-site-verification","content":"bLwyBi1imklcIuQxZ7JeI_kRF5Mg7yfr6arpEQV2nsE"}],"llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]},"description":"The simpleXRPL client is the runtime entry point — SimpleXRPL.init() builds it, and it exposes the verticals, the discovered accounts, and the ledger connection lifecycle."},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"client","__idx":0},"children":["Client"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://github.com/ripple/simpleXRPL/blob/95b977b15f8950c5bc076b25165217869c0b06d3/src/client/client.ts#L70"},"children":["[Source]"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SimpleXRPL.init()"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["simpleXRPL"]},"'s entry point, and it resolves to a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SimpleXRPLClient"]}]}," — the runtime client. The client binds your pre-constructed ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/simplexrpl/references/connectors"},"children":["connectors"]}," to a network, discovers the accounts they hold, and exposes the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/simplexrpl/references/verticals"},"children":["verticals"]}," you call to build operations. Its network connection and connector configuration are fixed for its lifetime."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A client constructed with no signers is still fully usable for reads; every write operation throws ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NoSignerError"]}," until a connector owns the target account."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"simplexrplinit","__idx":1},"children":["SimpleXRPL.init()"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Bind connectors to a network and discover their accounts. Resolves to a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SimpleXRPLClient"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"signature","__idx":2},"children":["Signature"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"SimpleXRPL.init(config: SimpleXRPLConfig): Promise<SimpleXRPLClient>\n","lang":"ts"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"config","__idx":3},"children":["Config"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["xrpldUrl"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The xrpld endpoint (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ws(s)://"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["http(s)://"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["faucetUrl"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Faucet endpoint, used on test networks only."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["signers"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["array"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The pre-constructed connectors (a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Custodian[]"]},"). Omit for a no-signer client that can still read the ledger; write operations then throw ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NoSignerError"]}," until a signer is added."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["primarySigner"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The default connector for operations called without an explicit account. Defaults to the first entry in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["signers"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ledger"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Advanced: the ledger connection used for reads, autofill, and Local/raw submission. Defaults to a connection built from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["xrpldUrl"]},"; inject a fake in tests."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"simplexrplclient","__idx":4},"children":["SimpleXRPLClient"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"properties","__idx":5},"children":["Properties"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Read-only members of the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SimpleXRPLClient"]}," that ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SimpleXRPL.init()"]}," returns, set at construction."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Property"},"children":["Property"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["network"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The network the client is bound to — a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NetworkInfo"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["xrpldUrl"]}," (and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["faucetUrl"]}," on test networks)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["signers"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["array"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The registered connectors, 0 or more (a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Custodian[]"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["primarySigner"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The default connector, used when an operation is called without an explicit account. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["undefined"]}," on a no-signer client."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["accounts"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Every discovered account as a read-only map keyed by r-address (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ReadonlyMap<string, Account>"]},"). See ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/simplexrpl/references/types#account"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Account"]}]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ledger"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The shared ledger connection for reads, autofill, and Local/raw submission. Created lazily from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["network.xrpldUrl"]}," when none was injected."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["intent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Read-only inspector for custodian governance intents. See ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/simplexrpl/references/intent-inspector"},"children":["Intent Inspector"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pollMptIssuanceId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["function"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Poll until the MPT issuance linked to an intent id is confirmed, then return its issuance ID: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["(intentId: string) => Promise<string>"]},". ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["undefined"]}," unless a Ripple Custody signer is configured."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"connect","__idx":6},"children":["connect()"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open the ledger connection."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"SimpleXRPLClient.connect(): Promise<void>\n","lang":"ts"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"disconnect","__idx":7},"children":["disconnect()"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Close the ledger connection and release its resources."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"SimpleXRPLClient.disconnect(): Promise<void>\n","lang":"ts"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"refreshaccounts","__idx":8},"children":["refreshAccounts()"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Re-discover every connector's accounts and rebuild the account index. New accounts become addressable; accounts removed upstream are gone on the next lookup. Throws ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AmbiguousAccountError"]}," if an r-address is claimed by two connectors."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"SimpleXRPLClient.refreshAccounts(): Promise<void>\n","lang":"ts"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"primaryaddress","__idx":9},"children":["primaryAddress()"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The primary connector's account address, or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["undefined"]}," on a no-signer client. Reads default to this; it never throws, so queries work without a signer."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"SimpleXRPLClient.primaryAddress(): string | undefined\n","lang":"ts"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"resolveaccount","__idx":10},"children":["resolveAccount()"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Resolve an ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/simplexrpl/references/types#accountselector"},"children":["AccountSelector"]}," to the full ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/simplexrpl/references/types#account"},"children":["Account"]}," record — the r-address paired with the connector that signs for it. This is the same resolution every write performs on its ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["from"]}," option, exposed so you can inspect or reuse the result: pass the returned account's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["signer"]}," to another call, or read its ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["custodianRef"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ledgerId"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Called with no selector, it returns the primary connector's primary account. Unlike ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"#primaryaddress"},"children":["primaryAddress()"]},", it throws rather than returning ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["undefined"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"SimpleXRPLClient.resolveAccount(selector?: AccountSelector): Account\n","lang":"ts"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["selector"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AccountSelector"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An r-address, an object ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ address }"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ signer, account? }"]},". Defaults to the primary connector's primary account."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Throws ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NoSignerError"]}," if no selector is given and the client has no signers, or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AccountNotFoundError"]}," if the address isn't registered — or if an explicit ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ signer, account }"]}," names an account that signer doesn't own."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"// The primary account, whichever connector owns it.\nconst primary = client.resolveAccount()\n\n// A specific address, resolved to the connector that holds it.\nconst hotWallet = client.resolveAccount('rHotWallet...')\nconsole.log(hotWallet.signer.kind)\n","lang":"ts"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example","__idx":11},"children":["Example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"import { SimpleXRPL, LocalSigner } from 'simplexrpl'\n\nconst client = await SimpleXRPL.init({\n  xrpldUrl: 'wss://s.altnet.rippletest.net:51233', // XRPL Testnet\n  signers: [LocalSigner.fromEnv()],\n})\n\nawait client.disconnect()\n","lang":"ts"},"children":[]}]},"headings":[{"value":"Client","id":"client","depth":1},{"value":"SimpleXRPL.init()","id":"simplexrplinit","depth":2},{"value":"Signature","id":"signature","depth":3},{"value":"Config","id":"config","depth":3},{"value":"SimpleXRPLClient","id":"simplexrplclient","depth":2},{"value":"Properties","id":"properties","depth":3},{"value":"connect()","id":"connect","depth":3},{"value":"disconnect()","id":"disconnect","depth":3},{"value":"refreshAccounts()","id":"refreshaccounts","depth":3},{"value":"primaryAddress()","id":"primaryaddress","depth":3},{"value":"resolveAccount()","id":"resolveaccount","depth":3},{"value":"Example","id":"example","depth":2}],"frontmatter":{"seo":{"description":"The simpleXRPL client is the runtime entry point — SimpleXRPL.init() builds it, and it exposes the verticals, the discovered accounts, and the ledger connection lifecycle.","title":"Client"},"labels":["simpleXRPL","SDK"]},"editPage":{"to":"https://github.com/ripple/opensource.ripple.com/tree/main/docs/simpleXRPL/references/client.md"},"lastModified":"2026-08-26T19:04:06.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/simplexrpl/references/client","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}