Compare commits

...

1 Commits

Author SHA1 Message Date
Maria Shodunke
ef363cff52 Add missing READMEs for JS and Python code samples 2026-02-13 11:43:37 +00:00
89 changed files with 1163 additions and 49 deletions

View File

@@ -0,0 +1,7 @@
# Account Configurator (JavaScript)
Demonstrates how to configure account settings and flags on the XRP Ledger.
Quick setup and usage:
Open `account-configurator.html` in a web browser.

View File

@@ -0,0 +1,10 @@
# Address Encoding (JavaScript)
Demonstrates how to encode and decode XRP Ledger addresses and other identifiers.
Quick setup and usage:
```sh
npm install
node encode_address.js
```

View File

@@ -0,0 +1,9 @@
# Address Encoding (Python)
Demonstrates how to encode and decode XRP Ledger addresses and other identifiers.
Quick setup and usage:
```sh
python encode_address.py
```

View File

@@ -0,0 +1,7 @@
# Amm Clob (JavaScript)
Demonstrates how to interact with Automated Market Makers (AMM) and the Central Limit Order Book (CLOB).
Quick setup and usage:
Open `demo.html` in a web browser.

View File

@@ -0,0 +1,10 @@
# Assign Regular Key (JavaScript)
Demonstrates how to assign a regular key pair to an XRP Ledger account.
Quick setup and usage:
```sh
npm install
node assign-regular-key.js
```

View File

@@ -0,0 +1,12 @@
# Assign Regular Key (Python)
Demonstrates how to assign a regular key pair to an XRP Ledger account.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python assign-regular-key.py
```

View File

@@ -0,0 +1,10 @@
# Auction Slot (JavaScript)
Demonstrates how to bid on and use AMM auction slots.
Quick setup and usage:
```sh
npm install
node auction-slot.js
```

View File

@@ -0,0 +1,37 @@
# Checks (JavaScript)
Demonstrates how to create, cash, and cancel checks on the XRP Ledger.
## Setup
```sh
npm install
```
## Create a Check
```sh
node create-check.js
```
## Cash a Check
```sh
node cash-check-exact.js
```
```sh
node cash-check-flexible.js
```
## Cancel a Check
```sh
node cancel-check.js
```
## Get Checks
```sh
node get-checks.js
```

View File

@@ -0,0 +1,35 @@
# Checks (Python)
Demonstrates how to create, cash, and cancel checks on the XRP Ledger.
## Setup
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
## Create a Check
```sh
python create_check.py
```
## Cash a Check
```sh
python cash_check.py
```
## Cancel a Check
```sh
python cancel_check.py
```
## Get Account Checks
```sh
python account_checks.py
```

View File

@@ -0,0 +1,2 @@
xrpl-py>=4.4.0

View File

@@ -0,0 +1,10 @@
# Claim Payment Channel (JavaScript)
Demonstrates how to claim payment channels on the XRP Ledger.
Quick setup and usage:
```sh
npm install
npx ts-node claimPayChannel.ts
```

View File

@@ -0,0 +1,13 @@
{
"name": "claim-payment-channel",
"license": "MIT",
"dependencies": {
"xrpl": "^4.5.0"
},
"devDependencies": {
"ts-node": "^10.9.1",
"typescript": "^5.0.0",
"@types/node": "^20.0.0"
}
}

View File

@@ -0,0 +1,10 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}

View File

@@ -0,0 +1,12 @@
# Claim Payment Channel (Python)
Demonstrates how to claim payment channels on the XRP Ledger.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python claim_pay_channel.py
```

View File

@@ -0,0 +1,2 @@
xrpl-py>=4.4.0

View File

@@ -0,0 +1,10 @@
# Create Amm (JavaScript)
Demonstrates how to create an Automated Market Maker (AMM) on the XRP Ledger.
Quick setup and usage:
```sh
npm install
node create-amm.js
```

View File

@@ -0,0 +1,10 @@
# Delete Account (JavaScript)
Demonstrates how to delete an XRP Ledger account.
Quick setup and usage:
```sh
npm install
node blackhole-account.js
```

View File

@@ -0,0 +1,8 @@
{
"name": "delete-account",
"license": "MIT",
"dependencies": {
"xrpl": "^4.5.0"
}
}

View File

@@ -0,0 +1,12 @@
# Delete Account (Python)
Demonstrates how to delete an XRP Ledger account.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python blackhole-account.py
```

View File

@@ -0,0 +1 @@
xrpl-py>=4.4.0

View File

@@ -0,0 +1,10 @@
# Disable Master Key (JavaScript)
Demonstrates how to disable the master key for an XRP Ledger account.
Quick setup and usage:
```sh
npm install
node disable-master-key.js
```

View File

@@ -0,0 +1,12 @@
# Disable Master Key (Python)
Demonstrates how to disable the master key for an XRP Ledger account.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python disable-master-key.py
```

View File

@@ -0,0 +1,33 @@
# Escrow (JavaScript)
Demonstrates how to create, finish, and cancel escrows on the XRP Ledger.
## Setup
```sh
npm install
```
## Send Timed Escrow
```sh
node send-timed-escrow.js
```
## Send Conditional Escrow
```sh
node send-conditional-escrow.js
```
## List Escrows
```sh
node list-escrows.js
```
## Cancel Escrow
```sh
node cancel-escrow.js
```

View File

@@ -0,0 +1,41 @@
# Escrow (Python)
Demonstrates how to create, finish, and cancel escrows on the XRP Ledger.
## Setup
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
## Send Timed Escrow
```sh
python send_timed_escrow.py
```
## Send Conditional Escrow
```sh
python send_conditional_escrow.py
```
## List Escrows
```sh
python list_escrows.py
```
## Get Account Escrows
```sh
python account_escrows.py
```
## Cancel Escrow
```sh
python cancel_escrow.py
```

View File

@@ -0,0 +1,51 @@
# Freeze (JavaScript)
Demonstrates how to freeze and unfreeze trust lines on the XRP Ledger.
## Setup
```sh
npm install
```
## Set Global Freeze
```sh
node set-global-freeze.js
```
## Set Global Freeze with Checks
```sh
node set-global-freeze-with-checks.js
```
## Set Individual Freeze
```sh
node set-individual-freeze.js
```
## Set No Freeze
```sh
node set-no-freeze.js
```
## Check Global Freeze
```sh
node check-global-freeze.js
```
## Check Individual Freeze
```sh
node check-individual-freeze.js
```
## Check No Freeze
```sh
node check-no-freeze.js
```

View File

@@ -0,0 +1,53 @@
# Freeze (Python)
Demonstrates how to freeze and unfreeze trust lines on the XRP Ledger.
## Setup
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
## Freeze Token
```sh
python freeze_token.py
```
## Unfreeze Token
```sh
python unfreeze_token.py
```
## Set Global Freeze
```sh
python set_global_freeze.py
```
## Enable No Freeze
```sh
python enable_no_freeze.py
```
## Check Freeze Status
```sh
python check_freeze_status.py
```
## Check Global Freeze
```sh
python check_global_freeze.py
```
## Check No Freeze
```sh
python check_no_freeze.py
```

View File

@@ -0,0 +1,10 @@
# Get Tx (JavaScript)
Demonstrates how to retrieve transaction details from the XRP Ledger.
Quick setup and usage:
```sh
npm install
npx ts-node getTransaction.ts
```

View File

@@ -0,0 +1,13 @@
{
"name": "get-tx",
"license": "MIT",
"dependencies": {
"xrpl": "^4.5.0"
},
"devDependencies": {
"ts-node": "^10.9.1",
"typescript": "^5.0.0",
"@types/node": "^20.0.0"
}
}

View File

@@ -0,0 +1,10 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}

View File

@@ -0,0 +1,12 @@
# Get Tx (Python)
Demonstrates how to retrieve transaction details from the XRP Ledger.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python get_transaction.py
```

View File

@@ -0,0 +1,2 @@
xrpl-py>=4.4.0

View File

@@ -0,0 +1,12 @@
# Issue A Token (Python)
Demonstrates how to issue a fungible token on the XRP Ledger.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python issue-a-token.py
```

View File

@@ -0,0 +1,2 @@
xrpl-py>=4.4.0

View File

@@ -0,0 +1,30 @@
# Python key derivation examples
Generates key from a given input in Ed25519 and Secp256k1 format. On first run, you
have to install the necessary Python dependencies:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
## Command-line usage
### Key Derivation (Secp256k1)
```sh
python key_derivation.py
```
### Ed25519 Key Derivation
```sh
python ed25519.py
```
### RFC1751 Key Derivation
```sh
python RFC1751.py
```

View File

@@ -0,0 +1,10 @@
# Markers And Pagination (JavaScript)
Demonstrates how to use markers for paginating through ledger data.
Quick setup and usage:
```sh
npm install
node pagination-with-markers.js
```

View File

@@ -0,0 +1,8 @@
{
"name": "markers-and-pagination",
"license": "MIT",
"dependencies": {
"xrpl": "^4.5.0"
}
}

View File

@@ -0,0 +1,12 @@
# Markers And Pagination (Python)
Demonstrates how to use markers for paginating through ledger data.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python pagination-with-markers.py
```

View File

@@ -0,0 +1,2 @@
xrpl-py>=4.4.0

View File

@@ -0,0 +1,17 @@
# Monitor Payments Websocket (JavaScript)
Demonstrates how to monitor incoming payments using WebSocket connections.
## Browser
Open `index.html` in a web browser and check the browser console to see the logs.
## Command-line
Alternatively, you can run the code from the command line:
```sh
npm install
node monitor-payments.js
node read-amount-received.js
```

View File

@@ -0,0 +1,12 @@
# Monitor Payments Websocket (Python)
Demonstrates how to monitor incoming payments using WebSocket connections.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python monitor_incoming.py
```

View File

@@ -0,0 +1,2 @@
xrpl-py>=4.4.0

View File

@@ -0,0 +1,21 @@
# Multisigning (JavaScript)
Demonstrates how to set up and use multi-signature transactions on the XRP Ledger.
## Setup
```sh
npm install
```
## Set Up Multi-Signing
```sh
node set-up-multi-signing.js
```
## Send Multi-Signed Transaction
```sh
node send-multi-signed-transaction.js
```

View File

@@ -0,0 +1,23 @@
# Multisigning (Python)
Demonstrates how to set up and use multi-signature transactions on the XRP Ledger.
## Setup
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
## Set Up Multi-Signing
```sh
python set-up-multi-signing.py
```
## Send Multi-Signed Transaction
```sh
python send-multi-signed-transaction.py
```

View File

@@ -0,0 +1,10 @@
# Non Fungible Token (JavaScript)
Demonstrates how to mint and manage NFTs on the XRP Ledger.
Quick setup and usage:
```sh
npm install
node list-nft-pages-and-buy-offers.js
```

View File

@@ -0,0 +1,59 @@
# Non Fungible Token (Python)
Demonstrates how to mint and manage NFTs on the XRP Ledger.
## Setup
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
## Mint NFT
```sh
python mint-nft.py
```
## Authorize Minter
```sh
python authorize-minter.py
```
## Create Sell Offer for NFT
```sh
python create-sell-offer-nft.py
```
## Create Buy Offer for NFT
```sh
python create-buy-offer-nft.py
```
## List NFT Pages and Offers
```sh
python list-nft-pages-and-offers.py
```
## Cancel NFT Offer
```sh
python cancel-offer-nft.py
```
## Burn NFT
```sh
python burn-nft.py
```
## NFT General Operations
```sh
python nft-general.py
```

View File

@@ -0,0 +1,2 @@
xrpl-py>=4.4.0

View File

@@ -0,0 +1,9 @@
# Normalize Currency Codes (JavaScript)
Demonstrates how to normalize currency codes on the XRP Ledger.
Quick setup and usage:
```sh
node normalize-currency-code.js
```

View File

@@ -0,0 +1,10 @@
# Partial Payment (JavaScript)
Demonstrates how to send and receive partial payments on the XRP Ledger.
Quick setup and usage:
```sh
npm install
npx ts-node partialPayment.ts
```

View File

@@ -0,0 +1,13 @@
{
"name": "partial-payment",
"license": "MIT",
"dependencies": {
"xrpl": "^4.5.0"
},
"devDependencies": {
"ts-node": "^10.9.1",
"typescript": "^5.0.0",
"@types/node": "^20.0.0"
}
}

View File

@@ -0,0 +1,10 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}

View File

@@ -0,0 +1,12 @@
# Partial Payment (Python)
Demonstrates how to send and receive partial payments on the XRP Ledger.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python partial-payment.py
```

View File

@@ -0,0 +1,2 @@
xrpl-py>=4.4.0

View File

@@ -0,0 +1,10 @@
# Paths (JavaScript)
Demonstrates how to find payment paths on the XRP Ledger.
Quick setup and usage:
```sh
npm install
npx ts-node paths.ts
```

View File

@@ -0,0 +1,12 @@
{
"name": "paths",
"license": "MIT",
"dependencies": {
"xrpl": "^4.5.0"
},
"devDependencies": {
"ts-node": "^10.9.1",
"typescript": "^5.0.0",
"@types/node": "^20.0.0"
}
}

View File

@@ -0,0 +1,10 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}

View File

@@ -0,0 +1,12 @@
# Paths (Python)
Demonstrates how to find payment paths on the XRP Ledger.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python paths.py
```

View File

@@ -0,0 +1,2 @@
xrpl-py>=4.4.0

View File

@@ -0,0 +1,10 @@
# Reliable Tx Submission (JavaScript)
Demonstrates reliable transaction submission patterns on the XRP Ledger.
Quick setup and usage:
```sh
npm install
npx ts-node reliableTransactionSubmission.ts
```

View File

@@ -0,0 +1,13 @@
{
"name": "reliable-tx-submission",
"license": "MIT",
"dependencies": {
"xrpl": "^4.5.0"
},
"devDependencies": {
"ts-node": "^10.9.1",
"typescript": "^5.0.0",
"@types/node": "^20.0.0"
}
}

View File

@@ -0,0 +1,10 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}

View File

@@ -0,0 +1,12 @@
# Reliable Tx Submission (Python)
Demonstrates reliable transaction submission patterns on the XRP Ledger.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python reliable_transaction-submission.py
```

View File

@@ -0,0 +1,2 @@
xrpl-py>=4.4.0

View File

@@ -0,0 +1,10 @@
# Remove Regular Key (JavaScript)
Demonstrates how to remove a regular key from an XRP Ledger account.
Quick setup and usage:
```sh
npm install
node remove-regular-key.js
```

View File

@@ -0,0 +1,12 @@
# Remove Regular Key (Python)
Demonstrates how to remove a regular key from an XRP Ledger account.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python remove-regular-key.py
```

View File

@@ -0,0 +1,10 @@
# Secure Signing (JavaScript)
Demonstrates secure transaction signing practices on the XRP Ledger.
Quick setup and usage:
```sh
npm install
node signPayment.js
```

View File

@@ -0,0 +1,8 @@
{
"name": "secure-signing",
"license": "MIT",
"dependencies": {
"xrpl": "^4.5.0"
}
}

View File

@@ -0,0 +1,12 @@
# Secure Signing (Python)
Demonstrates secure transaction signing practices on the XRP Ledger.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python sign-payment.py
```

View File

@@ -0,0 +1,2 @@
xrpl-py>=4.4.0

View File

@@ -0,0 +1,12 @@
# Send A Memo (Python)
Demonstrates how to attach memos to XRP Ledger transactions.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python send-a-memo.py
```

View File

@@ -0,0 +1,2 @@
xrpl-py>=4.4.0

View File

@@ -0,0 +1,16 @@
# Send XRP (JavaScript)
Demonstrates how to send XRP from one account to another on the XRP Ledger.
## Browser
Open `demo.html` in a web browser and check the browser console to see the logs.
## Command-line
Alternatively, you can run the code from the command line:
```sh
npm install
node send-xrp.js
```

View File

@@ -0,0 +1,12 @@
# Send XRP (Python)
Demonstrates how to send XRP from one account to another on the XRP Ledger.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python send-xrp.py
```

View File

@@ -0,0 +1,2 @@
xrpl-py>=4.4.0

View File

@@ -0,0 +1,10 @@
# Set Regular Key (JavaScript)
Demonstrates how to set a regular key for an XRP Ledger account.
Quick setup and usage:
```sh
npm install
npx ts-node setRegularKey.ts
```

View File

@@ -0,0 +1,13 @@
{
"name": "set-regular-key",
"license": "MIT",
"dependencies": {
"xrpl": "^4.5.0"
},
"devDependencies": {
"ts-node": "^10.9.1",
"typescript": "^5.0.0",
"@types/node": "^20.0.0"
}
}

View File

@@ -0,0 +1,10 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}

View File

@@ -0,0 +1,12 @@
# Set Regular Key (Python)
Demonstrates how to set a regular key for an XRP Ledger account.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python setRegularKey.py
```

View File

@@ -0,0 +1,2 @@
xrpl-py>=4.4.0

View File

@@ -1,35 +1,3 @@
# Submit and Verify
Submit a signed transaction blob and wait until it has a final result.
- [submit-and-verify.js](js/submit-and-verify.js): ripple-lib 1.x version.
- [submit-and-verify2.js](js/submit-and-verify2.js): xrpl.js 2.x version. Unlike the submitAndWait() method built into xrpl.js, this checks the server's available history and returns a different code when the transaction's status is unknowable with the server's available history versus if the transaction was _definitely_ not confirmed by consensus.
Example usage (ripple-lib 1.x):
```js
// example testnet creds. Don't use for real
const address = "raXDGCShEGqYz2d94qkv1UmAh2uJd3UTea"
const secret = "ssNBEKCkEY3W6YFfrjcSoNit91Vvj"
api = new ripple.RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
api.connect()
api.on('connected', async () => {
const prepared = await api.prepareTransaction({
"TransactionType": "AccountSet",
"Account": address
})
const signed = api.sign(prepared.txJSON, secret)
const result = await submit_and_verify(api, signed.signedTransaction)
if (result == "tesSUCCESS") {
console.log(`Transaction succeeded: https://testnet.xrpl.org/transactions/${signed.id}`)
} else if (result == "unknown") {
console.log(`Transaction status unknown. `)
} else if (result == "tefMAX_LEDGER") {
console.log(`Transaction failed to achieve a consensus.`)
} else {
console.log(`Transaction failed with code ${result}: https://testnet.xrpl.org/transactions/${signed.id}`)
}
}
```
Demonstrates how to submit a signed transaction blob to the XRP Ledger and wait for a final result.

View File

@@ -0,0 +1,35 @@
# Submit and Verify (JavaScript)
Submit a signed transaction blob and wait until it has a final result.
- [submit-and-verify.js](js/submit-and-verify.js): ripple-lib 1.x version.
- [submit-and-verify2.js](js/submit-and-verify2.js): xrpl.js 2.x version. Unlike the submitAndWait() method built into xrpl.js, this checks the server's available history and returns a different code when the transaction's status is unknowable with the server's available history versus if the transaction was _definitely_ not confirmed by consensus.
Example usage (ripple-lib 1.x):
```js
// example testnet creds. Don't use for real
const address = "raXDGCShEGqYz2d94qkv1UmAh2uJd3UTea"
const secret = "ssNBEKCkEY3W6YFfrjcSoNit91Vvj"
api = new ripple.RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
api.connect()
api.on('connected', async () => {
const prepared = await api.prepareTransaction({
"TransactionType": "AccountSet",
"Account": address
})
const signed = api.sign(prepared.txJSON, secret)
const result = await submit_and_verify(api, signed.signedTransaction)
if (result == "tesSUCCESS") {
console.log(`Transaction succeeded: https://testnet.xrpl.org/transactions/${signed.id}`)
} else if (result == "unknown") {
console.log(`Transaction status unknown. `)
} else if (result == "tefMAX_LEDGER") {
console.log(`Transaction failed to achieve a consensus.`)
} else {
console.log(`Transaction failed with code ${result}: https://testnet.xrpl.org/transactions/${signed.id}`)
}
}
```

View File

@@ -0,0 +1,12 @@
# Submit And Verify (Python)
Demonstrates how to submit and verify transactions on the XRP Ledger.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python submit-and-verify.py
```

View File

@@ -0,0 +1,2 @@
xrpl-py>=4.4.0

View File

@@ -1,43 +1,41 @@
# JavaScript transaction serialisation examples
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.).
For a detailed explanation, see [Serialization](https://xrpl.org/serialization.html).
Convert transactions and other XRPL data from JSON to their canonical binary format for signing or cryptographic verification.
On first run, you have to install the necessary node.js dependencies:
```
```sh
npm install
```
## Command-line usage:
## Command-line usage
### Simple example, use tx1.json default:
### Simple example, use tx1.json default
```
```sh
node index.js
```
### Verbose output, use --verbose or -v:
### Verbose output, use --verbose or -v
```
```sh
node index.js -v
```
### Raw output without formatting, use --raw or -r:
### Raw output without formatting, use --raw or -r
```
```sh
node index.js -r
```
### Pick JSON fixture file:
### Pick JSON fixture file
```
```sh
node index.js -f test-cases/tx3.json
```
### Feed JSON as CLI argument:
### Feed JSON as CLI argument
```
```sh
node index.js -j "{\"TransactionType\":\"Payment\"}"
```
```

View File

@@ -0,0 +1,35 @@
# Python transaction serialization examples
Convert transactions and other XRPL data from JSON to their canonical binary format for signing or cryptographic verification.
## Command-line usage
### Simple example, use tx1.json default
```sh
python serialize.py
```
### Verbose output, use --verbose or -v
```sh
python serialize.py -v
```
### Pick JSON fixture file
```sh
python serialize.py -f test-cases/tx3.json
```
### Feed JSON as CLI argument
```sh
python serialize.py -j "{\"TransactionType\":\"Payment\"}"
```
### Read JSON from stdin
```sh
cat test-cases/tx1.json | python serialize.py --stdin
```

View File

@@ -0,0 +1,27 @@
# Use Tickets (JavaScript)
Demonstrates how to use Tickets for out-of-order transaction submission on the XRP Ledger.
## Setup
```sh
npm install
```
## Basic Ticket Usage
### Browser
Open `demo.html` in a web browser and check the browser console to see the logs.
Alternatively, you can run the code from the command line:
```sh
node use-tickets.js
```
## Tickets with Multi-Signing
```sh
node use-tickets-multisig.js
```

View File

@@ -0,0 +1,23 @@
# Use Tickets (Python)
Demonstrates how to use Tickets for out-of-order transaction submission on the XRP Ledger.
## Setup
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
## Basic Ticket Usage
```sh
python use-tickets.py
```
## Tickets with Multi-Signing
```sh
python use-tickets-to-multisign.py
```

View File

@@ -0,0 +1,2 @@
xrpl-py>=4.4.0

View File

@@ -0,0 +1,10 @@
# Walk Owner Directory (JavaScript)
Demonstrates how to iterate through all ledger objects owned by an account.
Quick setup and usage:
```sh
npm install
node iterate-owner-directory.js
```

View File

@@ -0,0 +1,12 @@
# Walk Owner Directory (Python)
Demonstrates how to iterate through all ledger objects owned by an account.
Quick setup and usage:
```sh
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python iterate-owner-directory.py
```