{"codeSamples":[{"path":"_code-samples/get-started","title":"Introductory Code Samples","description":"Connect to the XRP Ledger and query it for data.","href":"content/_code-samples/get-started","langs":["go","java","js","php","py","ts"]},{"path":"_code-samples/quickstart","title":"Quickstart Samples","description":"Create a test harness for XRPL features using JavaScript or Python.","href":"content/_code-samples/quickstart","langs":["js","py"]},{"path":"_code-samples/account-configurator","title":"Account Configurator","description":"Create accounts on Testnet or Devnet and try different configuration settings. You can also get account configuration settings for live accounts on Mainnet.","href":"content/_code-samples/account-configurator","langs":["js"]},{"path":"_code-samples/address_encoding","title":"Address Encoding","description":"Encode XRP Ledger addresses in base58. (This reference implementation is equivalent to the ones included in most client libraries.)","href":"content/_code-samples/address_encoding","langs":["js","py"]},{"path":"_code-samples/amm-clob","title":"AMM CLOB Demo","description":"Simulate how offers interact with each other and AMMs on the XRPL DEX.","href":"content/_code-samples/amm-clob","langs":["js"]},{"path":"_code-samples/assign-regular-key","title":"Assign a Regular Key Pair","description":"Generate a regular key pair and associate it with your account.","href":"content/_code-samples/assign-regular-key","langs":["go","js","py"]},{"path":"_code-samples/batch","title":"Batch","description":"Code samples showing how to create and submit a Batch transaction .","href":"content/_code-samples/batch","langs":["go","js"]},{"path":"_code-samples/build-a-browser-wallet","title":"Build a Browser Wallet","description":"Implement a non-custodial wallet application that runs in a web browser and can check an account's balances, send XRP, and notify when the account receives incoming transactions.","href":"content/_code-samples/build-a-browser-wallet","langs":["js"]},{"path":"_code-samples/build-a-desktop-wallet","title":"Build a Wallet","description":"Implement a non-custodial wallet application that runs on a desktop and can check an account's balances, send XRP, and notify when the account receives incoming transactions.","href":"content/_code-samples/build-a-desktop-wallet","langs":["js","py"]},{"path":"_code-samples/calculate-reserves","title":"Calculate Reserves","description":"Look up and calculate an account's reserve requirements.","href":"content/_code-samples/calculate-reserves","langs":["go","js","py"]},{"path":"_code-samples/clawback","title":"Clawback","description":"Create, configure, and execute a Clawback transaction to reclaim issued tokens from a trust line on the XRPL.","href":"content/_code-samples/clawback","langs":["go"]},{"path":"_code-samples/confidential-transfers","title":"Confidential Transfers","description":"Issue a Multi-Purpose Token (MPT) that supports confidential transfers, send confidential payments between holders, and claw back a holder's confidential balance.","href":"content/_code-samples/confidential-transfers","langs":["py","js"]},{"path":"_code-samples/create-amm","title":"Create AMM","description":"Code samples for the Create an Automated Market Maker tutorial , showing how to make set up a new AMM.","href":"content/_code-samples/create-amm","langs":["ts","js"]},{"path":"_code-samples/claim-payment-channel","title":"Create and Claim a Payment Channel","description":"Create, claim and verify a Payment Channel.","href":"content/_code-samples/claim-payment-channel","langs":["js","py"]},{"path":"_code-samples/did","title":"Create, Update, and Delete Decentralized Identifiers (DIDs)","description":"Create, update, and delete decentralized identifiers (DIDs). A Decentralized Identifier (DID) is a new type of identifier defined by the World Wide Web Consortium (W3C) that enables verifiable, digital identities.","href":"content/_code-samples/did","langs":["py"]},{"path":"_code-samples/price_oracles","title":"Create, Update, and Delete Price Oracles","description":"Create, update, and delete Price Oracles. A price oracle is a mechanism that feeds external data, such as asset prices, and exchange rates, onto the XRPLedger.","href":"content/_code-samples/price_oracles","langs":["py"]},{"path":"_code-samples/credential","title":"Credential","description":"Create, accept, and delete a credential on the XRPL using dedicated transactions between issuer and subject wallets.","href":"content/_code-samples/credential","langs":["go","java"]},{"path":"_code-samples/issue-credentials","title":"Credential Issuing Service","description":"This sample code shows how to issue credentials to XRPL users using a basic API service.","href":"content/_code-samples/issue-credentials","langs":["js","py"]},{"path":"_code-samples/key-derivation","title":"Cryptographic Key Derivation","description":"Derive secp256k1 or Ed25519 key pairs from seeds in any of the XRP Ledger's encodings and formats. (This implementation is equivalent to the ones included in most client libraries.)","href":"content/_code-samples/key-derivation","langs":["js","py"]},{"path":"_code-samples/delegate-set","title":"Delegate","description":"Example delegating payment permission to an account and executing on behalf the delegator.","href":"content/_code-samples/delegate-set","langs":["go"]},{"path":"_code-samples/delegate-permissions","title":"Delegate Permissions","description":"Delegate permissions to another account, so that the account can send transactions on your behalf.","href":"content/_code-samples/delegate-permissions","langs":["js"]},{"path":"_code-samples/delete-account","title":"Delete Account","description":"Delete an account from the XRP Ledger, removing its data and sending its XRP to another account.","href":"content/_code-samples/delete-account","langs":["js","py"]},{"path":"_code-samples/deposit-preauth","title":"DepositPreauth","description":"Example of DepositPreauth transaction demonstrating how deposit permissions can be managed.","href":"content/_code-samples/deposit-preauth","langs":["go"]},{"path":"_code-samples/disable-master-key","title":"Disable Master Key Pair","description":"Disable the master key pair that is connected to an account by default. WARNING: This can blackhole the account, making it so no one can use it or access its funds anymore.","href":"content/_code-samples/disable-master-key","langs":["js","py"]},{"path":"_code-samples/escrow","title":"Escrows","description":"Create, finish, and cancel Escrows using conditional or time-based release.","href":"content/_code-samples/escrow","langs":["go","js","py"]},{"path":"_code-samples/freeze","title":"Freezes","description":"Freeze and unfreeze issued tokens, check freeze status, or give up the ability to freeze tokens.","href":"content/_code-samples/freeze","langs":["go","js","py"]},{"path":"_code-samples/get-tx","title":"Get a Transaction on the Ledger","description":"Retrieve and display a transaction on the ledger.","href":"content/_code-samples/get-tx","langs":["go","js","py"]},{"path":"_code-samples/reliable-tx-submission","title":"Implement Reliable Transaction Submission","description":"Send a transaction and see its validation response. For the implementation in this example, we have made the following decisions:","href":"content/_code-samples/reliable-tx-submission","langs":["js","py"]},{"path":"_code-samples/issue-a-token","title":"Issue a Fungible Token","description":"Configure issuer settings and issue fungible tokens to another account.","href":"content/_code-samples/issue-a-token","langs":["go","java","js","py"]},{"path":"_code-samples/issue-mpt-with-metadata","title":"Issue an MPT with Metadata","description":"Shows how to issue a Multi-Purpose Token (MPT) with metadata encoded according to the XLS-89 schema, then update its mutable properties and declare a property immutable, as defined by XLS-94D.","href":"content/_code-samples/issue-mpt-with-metadata","langs":["js","py"]},{"path":"_code-samples/lending-protocol","title":"Lending Protocol Examples","description":"Code samples showing how to create a loan broker, claw back first-loss capital, deposit and withdraw first-loss capital, create a loan, manage a loan, and repay a loan.","href":"content/_code-samples/lending-protocol","langs":["go","js","py"]},{"path":"_code-samples/permissioned-domains","title":"Manage Permissioned Domains","description":"Create a permissioned domain to restrict access to financial services that meet compliance requirements, update it with new credentials, or delete a domain you own.","href":"content/_code-samples/permissioned-domains","langs":["js","py"]},{"path":"_code-samples/markers-and-pagination","title":"Markers and Pagination","description":"Iterate over a ledger_data method request that requires multiple calls.","href":"content/_code-samples/markers-and-pagination","langs":["js","py"]},{"path":"_code-samples/monitor-payments-websocket","title":"Monitor Incoming Payments with WebSocket","description":"Use the WebSocket protocol to watch for incoming payments to an XRP Ledger address, without using a client library.","href":"content/_code-samples/monitor-payments-websocket","langs":["go","js","py"]},{"path":"_code-samples/multisigning","title":"Multisign a transaction.","description":"Create and submit a SignerListSet and multisign a transaction.","href":"content/_code-samples/multisigning","langs":["go","js","py"]},{"path":"_code-samples/non-fungible-token","title":"NFT Examples","description":"Various NFT-related actions. Also see the Quickstart Samples for more code related to NFT tutorials.","href":"content/_code-samples/non-fungible-token","langs":["go","js","py"]},{"path":"_code-samples/normalize-currency-codes","title":"Normalize Currency Codes","description":"Convert from a string from either the XRP Ledger's \"standard\" 3-character or \"non-standard\" 40-character hexadecimal format into a string for humans to read.","href":"content/_code-samples/normalize-currency-codes","langs":["js"]},{"path":"_code-samples/remove-regular-key","title":"Remove Regular Key Pair","description":"Remove the regular key pair assigned to an account.","href":"content/_code-samples/remove-regular-key","langs":["js","py"]},{"path":"_code-samples/require-destination-tags","title":"Require Destination Tags","description":"Require incoming payments to specify a Destination Tag so you know whom to credit.","href":"content/_code-samples/require-destination-tags","langs":["js","py"]},{"path":"_code-samples/secure-signing","title":"Secure Signing","description":"Sign transactions from the security of your own machine.","href":"content/_code-samples/secure-signing","langs":["go","java","js","py"]},{"path":"_code-samples/send-an-mpt","title":"Send an MPT Examples","description":"Send a Multi-Purpose Token (MPT) payment between two accounts and compare balances before and after to confirm the transfer.","href":"content/_code-samples/send-an-mpt","langs":["go","js","py"]},{"path":"_code-samples/partial-payment","title":"Send Partial Payments","description":"Send a partial payment, which delivers less than the amount specified. Partial payments are useful for deducting fees and exchange rates from the amount delivered instead of adding them to the amount sent, but they can also lead to exploits if an integration incorrectly assumes a successful payment delivered the whole amount.","href":"content/_code-samples/partial-payment","langs":["go","js","py"]},{"path":"_code-samples/send-xrp","title":"Send XRP","description":"Send a direct XRP payment to another account in the XRP Ledger.","href":"content/_code-samples/send-xrp","langs":["go","java","js","php","py"]},{"path":"_code-samples/vaults","title":"Single Asset Vault Examples","description":"Shows how to create, deposit into, and withdraw from single asset vaults on the XRP Ledger.","href":"content/_code-samples/vaults","langs":["js","py"]},{"path":"_code-samples/sponsored-fees-and-reserves","title":"Sponsored Fees and Reserves","description":"Shows how one account can pay the transaction fees and reserve requirements of another account, using the co-signed and pre-funded sponsorship flows. Also shows how to manage a sponsorship pool and transfer a reserve sponsorship.","href":"content/_code-samples/sponsored-fees-and-reserves","langs":["js","py"]},{"path":"_code-samples/submit-and-verify","title":"Submit and Verify","description":"Demonstrates how to submit a signed transaction blob to the XRP Ledger and wait for a final result.","href":"content/_code-samples/submit-and-verify","langs":["js","py"]},{"path":"_code-samples/trade-in-the-decentralized-exchange","title":"Trade in the Decentralized Exchange","description":"Look up Offers in the Decentralized Exchange and buy a fungible token by spending XRP.","href":"content/_code-samples/trade-in-the-decentralized-exchange","langs":["js","py"]},{"path":"_code-samples/tx-serialization","title":"Transaction Serialization","description":"Convert transactions and other XRPL data from JSON to their canonical binary format for signing or cryptographic verification. (This reference implementation is equivalent to the ones included in most client libraries.)","href":"content/_code-samples/tx-serialization","langs":["js","py"]},{"path":"_code-samples/auction-slot","title":"Use AMM Auction Slot to Save on Fees","description":"Estimate the fees that would be paid for trading through an AMM and use the auction slot to save on fees if applicable.","href":"content/_code-samples/auction-slot","langs":["js"]},{"path":"_code-samples/checks","title":"Use Checks","description":"Create, cash, and cancel Checks for exact or flexible amounts.","href":"content/_code-samples/checks","langs":["go","js","py"]},{"path":"_code-samples/paths","title":"Use Paths","description":"Extract paths from RipplePathFind and send a payment using paths.","href":"content/_code-samples/paths","langs":["go","js","py"]},{"path":"_code-samples/use-tickets","title":"Use Tickets","description":"Create a batch of Tickets and use one to send a transaction outside the normal Sequence order.","href":"content/_code-samples/use-tickets","langs":["go","js","py"]},{"path":"_code-samples/verify-credential","title":"Verify Credential","description":"Check whether a specific account holds a specific credential, and the credential is currently valid.","href":"content/_code-samples/verify-credential","langs":["js","py"]},{"path":"_code-samples/walk-owner-directory","title":"Walk Owner Directory","description":"Iterate over an account's owner directory and display how many ledger entries are in each page. In cases of highly active accounts, this can demonstrate the extent of \"fragmentation\" with skipped page numbers and non-full pages.","href":"content/_code-samples/walk-owner-directory","langs":["js","py"]}],"langs":["js","py","go","ts","java","php"]}