Skip to content

Simple JavaScript and Python scripts to interact with the XRP Ledger (XRPL), enabling wallet generation, trustline approval, transactions, AMM interactions... πŸ”§

Notifications You must be signed in to change notification settings

RippleDevRel/xrpl-js-python-simple-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

XRPL Scripts - JavaScript & Python πŸš€

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.

πŸ“ Project Structure

The scripts are divided into two main folders:

  • js/ β†’ Contains JavaScript scripts for XRPL interactions.
  • python/ β†’ Contains Python scripts for XRPL interactions.

JavaScript Scripts (js/)

  • 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 πŸ“₯

Python Scripts (python/)

  • 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 πŸ“₯

πŸ”§ Installation & Setup

JavaScript

  1. Clone this repo and navigate to the js/ folder.
  2. Run npm install to install dependencies.

Python

  1. Navigate to the python/ folder.
  2. 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```

⚠️ Important Notes

  • All scripts are designed for the XRPL Testnet.
  • 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.

πŸ”— Useful Links

About

Simple JavaScript and Python scripts to interact with the XRP Ledger (XRPL), enabling wallet generation, trustline approval, transactions, AMM interactions... πŸ”§

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published