Files
xrpl-dev-portal/content/_code-samples/tx-serialization/js
AlexanderBuzz de56a1f7ad - Changed test-cases README.md examples from python-cli to node-cli
- added input handling from --stdin
- wrapped some logic in callback function in main file as new --stind option works asynchronously
2023-01-20 08:00:24 +01:00
..

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.

On first run, you have to install the necessary node.js dependencies:

npm install

Command-line usage:

Simple example, use tx1.json default:

node index.js

Verbose output, use --verbose or -v:

node index.js -v

Pick JSON fixture file:

node index.js -f test-cases/tx3.json

Feed JSON as CLI argument:

node index.js -j "{\"TransactionType\":\"Payment\"}"