This repository contains scripts in both JavaScript and Python to interact with the XRP Ledger (XRPL). These scripts allow testing functionalities such as wallet generation, trustline approval, transactions, and Automated Market Maker (AMM) operations.
The XRP Ledger operates on three distinct network environments, each serving different purposes in the development and deployment lifecycle.
Devnet functions as a sandbox environment where new amendments and features are tested in their pre-release state, allowing developers to experiment with upcoming functionality before it reaches production.
Mainnet (livenet) is the live production network where real XRP transactions occur and hold actual monetary value.
Testnet serves as a replica of Mainnet, mirroring its current state and configuration - when an amendment is activated on Mainnet, it is subsequently enabled on Testnet to maintain consistency between the two environments.
This tiered approach ensures thorough testing and validation of new features while providing developers with appropriate environments for different stages of application development.
The scripts are divided into two main folders:
js/
β Contains JavaScript scripts for XRPL interactions.python/
β Contains Python scripts for XRPL interactions.
generate.js
β Generates a new XRPL wallet (address & seed) πgenerate_and_trustline.js
β Generates a wallet and establishes a trustline π€trustline.js
β Creates a trustline for the RLUSD token πxrp_transaction.js
β Handles XRP transactions πΈrlusd_transaction.js
β Manages RLUSD token transactions π°amm_create_RLUSD_XRP.js
β Creates an AMM pool for RLUSD/XRP pair π¦amm_deposit_RLUSD_XRP.js
β Deposits assets into an existing AMM pool π₯escrow.js
β Create a condition and time based escrow π.
generate.py
β Generates a new XRPL wallet (address & seed) πgenerate_and_trustline.py
β Generates a wallet and establishes a trustline π€trustline.py
β Creates a trustline for the RLUSD token πxrp_transaction.py
β Handles XRP transactions πΈrlusd_transaction.py
β Manages RLUSD token transactions π°amm_create_RLUSD_XRP.py
β Creates an AMM pool for RLUSD/XRP pair π¦amm_deposit_RLUSD_XRP.py
β Deposits assets into an existing AMM pool π₯escrow.py
β Create a condition and time based escrow π
Within this folder you will find scripts to interact with new amendments that are only live on DevNet and not on Testnet/Mainnet. You can find the list of amendments currently live on DevNet here: https://devnet.xrpl.org/amendments.
Important note: An amendment may be live on DevNet but not yet supported by one of the XRPL libraries (Python/JS). Please check the library documentation or release notes for compatibility before using these scripts.
mpt.js
β Issue and interact with MPTsbatch.js
β Test the new batch transaction amendmenttokenEscrow.js
β Use MPT with Escrow instead of XRPcredential.js
-> Demonstrates On-Chain Credentials functionality
- Clone this repo and navigate to the
js/
folder. - Run
npm install
to install dependencies.
- Navigate to the
python/
folder. - Install required packages:
pip install -r requirements.txt
or:
# Create a virtual env
python3 -m venv myenv
# Activate env
source myenv/bin/activate # On macOS/Linux
# myenv\Scripts\activate # On Windows
# Install xrpl-py in the virtual env
pip install xrpl-py```
- All scripts are designed for the XRPL Testnet / Devnet.
- Keep your wallet seed secure and never share it.
- Ensure you have sufficient XRP for fees and reserves.
- RLUSD operations require an established trustline first.