mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2026-02-16 11:52:25 +00:00
Compare commits
1 Commits
tutorials-
...
add-readme
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef363cff52 |
7
_code-samples/account-configurator/js/README.md
Normal file
7
_code-samples/account-configurator/js/README.md
Normal 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.
|
||||
10
_code-samples/address_encoding/js/README.md
Normal file
10
_code-samples/address_encoding/js/README.md
Normal 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
|
||||
```
|
||||
9
_code-samples/address_encoding/py/README.md
Normal file
9
_code-samples/address_encoding/py/README.md
Normal 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
|
||||
```
|
||||
7
_code-samples/amm-clob/js/README.md
Normal file
7
_code-samples/amm-clob/js/README.md
Normal 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.
|
||||
10
_code-samples/assign-regular-key/js/README.md
Normal file
10
_code-samples/assign-regular-key/js/README.md
Normal 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
|
||||
```
|
||||
12
_code-samples/assign-regular-key/py/README.md
Normal file
12
_code-samples/assign-regular-key/py/README.md
Normal 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
|
||||
```
|
||||
10
_code-samples/auction-slot/js/README.md
Normal file
10
_code-samples/auction-slot/js/README.md
Normal 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
|
||||
```
|
||||
37
_code-samples/checks/js/README.md
Normal file
37
_code-samples/checks/js/README.md
Normal 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
|
||||
```
|
||||
35
_code-samples/checks/py/README.md
Normal file
35
_code-samples/checks/py/README.md
Normal 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
|
||||
```
|
||||
2
_code-samples/checks/py/requirements.txt
Normal file
2
_code-samples/checks/py/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
xrpl-py>=4.4.0
|
||||
|
||||
10
_code-samples/claim-payment-channel/js/README.md
Normal file
10
_code-samples/claim-payment-channel/js/README.md
Normal 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
|
||||
```
|
||||
13
_code-samples/claim-payment-channel/js/package.json
Normal file
13
_code-samples/claim-payment-channel/js/package.json
Normal 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"
|
||||
}
|
||||
}
|
||||
|
||||
10
_code-samples/claim-payment-channel/js/tsconfig.json
Normal file
10
_code-samples/claim-payment-channel/js/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
|
||||
12
_code-samples/claim-payment-channel/py/README.md
Normal file
12
_code-samples/claim-payment-channel/py/README.md
Normal 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
|
||||
```
|
||||
2
_code-samples/claim-payment-channel/py/requirements.txt
Normal file
2
_code-samples/claim-payment-channel/py/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
xrpl-py>=4.4.0
|
||||
|
||||
10
_code-samples/create-amm/js/README.md
Normal file
10
_code-samples/create-amm/js/README.md
Normal 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
|
||||
```
|
||||
10
_code-samples/delete-account/js/README.md
Normal file
10
_code-samples/delete-account/js/README.md
Normal 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
|
||||
```
|
||||
8
_code-samples/delete-account/js/package.json
Normal file
8
_code-samples/delete-account/js/package.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "delete-account",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"xrpl": "^4.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
12
_code-samples/delete-account/py/README.md
Normal file
12
_code-samples/delete-account/py/README.md
Normal 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
|
||||
```
|
||||
1
_code-samples/delete-account/py/requirements.txt
Normal file
1
_code-samples/delete-account/py/requirements.txt
Normal file
@@ -0,0 +1 @@
|
||||
xrpl-py>=4.4.0
|
||||
10
_code-samples/disable-master-key/js/README.md
Normal file
10
_code-samples/disable-master-key/js/README.md
Normal 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
|
||||
```
|
||||
12
_code-samples/disable-master-key/py/README.md
Normal file
12
_code-samples/disable-master-key/py/README.md
Normal 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
|
||||
```
|
||||
33
_code-samples/escrow/js/README.md
Normal file
33
_code-samples/escrow/js/README.md
Normal 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
|
||||
```
|
||||
41
_code-samples/escrow/py/README.md
Normal file
41
_code-samples/escrow/py/README.md
Normal 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
|
||||
```
|
||||
51
_code-samples/freeze/js/README.md
Normal file
51
_code-samples/freeze/js/README.md
Normal 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
|
||||
```
|
||||
53
_code-samples/freeze/py/README.md
Normal file
53
_code-samples/freeze/py/README.md
Normal 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
|
||||
```
|
||||
10
_code-samples/get-tx/js/README.md
Normal file
10
_code-samples/get-tx/js/README.md
Normal 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
|
||||
```
|
||||
13
_code-samples/get-tx/js/package.json
Normal file
13
_code-samples/get-tx/js/package.json
Normal 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"
|
||||
}
|
||||
}
|
||||
|
||||
10
_code-samples/get-tx/js/tsconfig.json
Normal file
10
_code-samples/get-tx/js/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
|
||||
12
_code-samples/get-tx/py/README.md
Normal file
12
_code-samples/get-tx/py/README.md
Normal 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
|
||||
```
|
||||
2
_code-samples/get-tx/py/requirements.txt
Normal file
2
_code-samples/get-tx/py/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
xrpl-py>=4.4.0
|
||||
|
||||
12
_code-samples/issue-a-token/py/README.md
Normal file
12
_code-samples/issue-a-token/py/README.md
Normal 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
|
||||
```
|
||||
2
_code-samples/issue-a-token/py/requirements.txt
Normal file
2
_code-samples/issue-a-token/py/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
xrpl-py>=4.4.0
|
||||
|
||||
30
_code-samples/key-derivation/py/README.md
Normal file
30
_code-samples/key-derivation/py/README.md
Normal 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
|
||||
```
|
||||
10
_code-samples/markers-and-pagination/js/README.md
Normal file
10
_code-samples/markers-and-pagination/js/README.md
Normal 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
|
||||
```
|
||||
8
_code-samples/markers-and-pagination/js/package.json
Normal file
8
_code-samples/markers-and-pagination/js/package.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "markers-and-pagination",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"xrpl": "^4.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
12
_code-samples/markers-and-pagination/py/README.md
Normal file
12
_code-samples/markers-and-pagination/py/README.md
Normal 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
|
||||
```
|
||||
2
_code-samples/markers-and-pagination/py/requirements.txt
Normal file
2
_code-samples/markers-and-pagination/py/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
xrpl-py>=4.4.0
|
||||
|
||||
17
_code-samples/monitor-payments-websocket/js/README.md
Normal file
17
_code-samples/monitor-payments-websocket/js/README.md
Normal 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
|
||||
```
|
||||
12
_code-samples/monitor-payments-websocket/py/README.md
Normal file
12
_code-samples/monitor-payments-websocket/py/README.md
Normal 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
|
||||
```
|
||||
@@ -0,0 +1,2 @@
|
||||
xrpl-py>=4.4.0
|
||||
|
||||
21
_code-samples/multisigning/js/README.md
Normal file
21
_code-samples/multisigning/js/README.md
Normal 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
|
||||
```
|
||||
23
_code-samples/multisigning/py/README.md
Normal file
23
_code-samples/multisigning/py/README.md
Normal 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
|
||||
```
|
||||
10
_code-samples/non-fungible-token/js/README.md
Normal file
10
_code-samples/non-fungible-token/js/README.md
Normal 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
|
||||
```
|
||||
59
_code-samples/non-fungible-token/py/README.md
Normal file
59
_code-samples/non-fungible-token/py/README.md
Normal 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
|
||||
```
|
||||
2
_code-samples/non-fungible-token/py/requirements.txt
Normal file
2
_code-samples/non-fungible-token/py/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
xrpl-py>=4.4.0
|
||||
|
||||
9
_code-samples/normalize-currency-codes/js/README.md
Normal file
9
_code-samples/normalize-currency-codes/js/README.md
Normal 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
|
||||
```
|
||||
10
_code-samples/partial-payment/js/README.md
Normal file
10
_code-samples/partial-payment/js/README.md
Normal 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
|
||||
```
|
||||
13
_code-samples/partial-payment/js/package.json
Normal file
13
_code-samples/partial-payment/js/package.json
Normal 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"
|
||||
}
|
||||
}
|
||||
|
||||
10
_code-samples/partial-payment/js/tsconfig.json
Normal file
10
_code-samples/partial-payment/js/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
|
||||
12
_code-samples/partial-payment/py/README.md
Normal file
12
_code-samples/partial-payment/py/README.md
Normal 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
|
||||
```
|
||||
2
_code-samples/partial-payment/py/requirements.txt
Normal file
2
_code-samples/partial-payment/py/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
xrpl-py>=4.4.0
|
||||
|
||||
10
_code-samples/paths/js/README.md
Normal file
10
_code-samples/paths/js/README.md
Normal 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
|
||||
```
|
||||
12
_code-samples/paths/js/package.json
Normal file
12
_code-samples/paths/js/package.json
Normal 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"
|
||||
}
|
||||
}
|
||||
10
_code-samples/paths/js/tsconfig.json
Normal file
10
_code-samples/paths/js/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
|
||||
12
_code-samples/paths/py/README.md
Normal file
12
_code-samples/paths/py/README.md
Normal 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
|
||||
```
|
||||
2
_code-samples/paths/py/requirements.txt
Normal file
2
_code-samples/paths/py/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
xrpl-py>=4.4.0
|
||||
|
||||
10
_code-samples/reliable-tx-submission/js/README.md
Normal file
10
_code-samples/reliable-tx-submission/js/README.md
Normal 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
|
||||
```
|
||||
13
_code-samples/reliable-tx-submission/js/package.json
Normal file
13
_code-samples/reliable-tx-submission/js/package.json
Normal 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"
|
||||
}
|
||||
}
|
||||
|
||||
10
_code-samples/reliable-tx-submission/js/tsconfig.json
Normal file
10
_code-samples/reliable-tx-submission/js/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
|
||||
12
_code-samples/reliable-tx-submission/py/README.md
Normal file
12
_code-samples/reliable-tx-submission/py/README.md
Normal 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
|
||||
```
|
||||
2
_code-samples/reliable-tx-submission/py/requirements.txt
Normal file
2
_code-samples/reliable-tx-submission/py/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
xrpl-py>=4.4.0
|
||||
|
||||
10
_code-samples/remove-regular-key/js/README.md
Normal file
10
_code-samples/remove-regular-key/js/README.md
Normal 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
|
||||
```
|
||||
12
_code-samples/remove-regular-key/py/README.md
Normal file
12
_code-samples/remove-regular-key/py/README.md
Normal 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
|
||||
```
|
||||
10
_code-samples/secure-signing/js/README.md
Normal file
10
_code-samples/secure-signing/js/README.md
Normal 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
|
||||
```
|
||||
8
_code-samples/secure-signing/js/package.json
Normal file
8
_code-samples/secure-signing/js/package.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "secure-signing",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"xrpl": "^4.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
12
_code-samples/secure-signing/py/README.md
Normal file
12
_code-samples/secure-signing/py/README.md
Normal 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
|
||||
```
|
||||
2
_code-samples/secure-signing/py/requirements.txt
Normal file
2
_code-samples/secure-signing/py/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
xrpl-py>=4.4.0
|
||||
|
||||
12
_code-samples/send-a-memo/py/README.md
Normal file
12
_code-samples/send-a-memo/py/README.md
Normal 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
|
||||
```
|
||||
2
_code-samples/send-a-memo/py/requirements.txt
Normal file
2
_code-samples/send-a-memo/py/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
xrpl-py>=4.4.0
|
||||
|
||||
16
_code-samples/send-xrp/js/README.md
Normal file
16
_code-samples/send-xrp/js/README.md
Normal 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
|
||||
```
|
||||
12
_code-samples/send-xrp/py/README.md
Normal file
12
_code-samples/send-xrp/py/README.md
Normal 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
|
||||
```
|
||||
2
_code-samples/send-xrp/py/requirements.txt
Normal file
2
_code-samples/send-xrp/py/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
xrpl-py>=4.4.0
|
||||
|
||||
10
_code-samples/set-regular-key/js/README.md
Normal file
10
_code-samples/set-regular-key/js/README.md
Normal 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
|
||||
```
|
||||
13
_code-samples/set-regular-key/js/package.json
Normal file
13
_code-samples/set-regular-key/js/package.json
Normal 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"
|
||||
}
|
||||
}
|
||||
|
||||
10
_code-samples/set-regular-key/js/tsconfig.json
Normal file
10
_code-samples/set-regular-key/js/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
|
||||
12
_code-samples/set-regular-key/py/README.md
Normal file
12
_code-samples/set-regular-key/py/README.md
Normal 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
|
||||
```
|
||||
2
_code-samples/set-regular-key/py/requirements.txt
Normal file
2
_code-samples/set-regular-key/py/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
xrpl-py>=4.4.0
|
||||
|
||||
@@ -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.
|
||||
|
||||
35
_code-samples/submit-and-verify/js/README.md
Normal file
35
_code-samples/submit-and-verify/js/README.md
Normal 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}`)
|
||||
}
|
||||
}
|
||||
```
|
||||
12
_code-samples/submit-and-verify/py/README.md
Normal file
12
_code-samples/submit-and-verify/py/README.md
Normal 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
|
||||
```
|
||||
2
_code-samples/submit-and-verify/py/requirements.txt
Normal file
2
_code-samples/submit-and-verify/py/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
xrpl-py>=4.4.0
|
||||
|
||||
@@ -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\"}"
|
||||
```
|
||||
```
|
||||
|
||||
35
_code-samples/tx-serialization/py/README.md
Normal file
35
_code-samples/tx-serialization/py/README.md
Normal 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
|
||||
```
|
||||
27
_code-samples/use-tickets/js/README.md
Normal file
27
_code-samples/use-tickets/js/README.md
Normal 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
|
||||
```
|
||||
23
_code-samples/use-tickets/py/README.md
Normal file
23
_code-samples/use-tickets/py/README.md
Normal 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
|
||||
```
|
||||
2
_code-samples/use-tickets/py/requirements.txt
Normal file
2
_code-samples/use-tickets/py/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
xrpl-py>=4.4.0
|
||||
|
||||
10
_code-samples/walk-owner-directory/js/README.md
Normal file
10
_code-samples/walk-owner-directory/js/README.md
Normal 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
|
||||
```
|
||||
12
_code-samples/walk-owner-directory/py/README.md
Normal file
12
_code-samples/walk-owner-directory/py/README.md
Normal 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
|
||||
```
|
||||
Reference in New Issue
Block a user