Compare commits

..

33 Commits

Author SHA1 Message Date
Omar Khan
5b16d0cfe3 4.2.0 release (#2896)
* update HISTORY

* update package versions

* fix version
2025-02-13 21:18:57 -05:00
Omar Khan
35e40d9d71 feat: add AMMClawback support (#2893)
* update definitions and package.json

* update rippled.cfg

* add AMMClawback transaction with unit test

* switch to rippled v2.3.1

* Revert "switch to rippled v2.3.1"

This reverts commit d0bd3bdae97fc82240d5dd18732fa301255dc26a.

* update definitions

* add integ test

* resolve type assertions

* remove package-lock.json in sub packages

* remove ts-expect-error

* update integ test

* console logs

* fix console logs

* add tfClawTwoAssets test and remove logs

* fix lint error

* refactor type assertions

* refactor error messages

* final cleanup
2025-02-11 19:00:51 -05:00
Chenna Keshava B S
ea9e3dcc98 Deep Freeze XLS-77d (#2873) 2025-02-11 12:43:32 -08:00
dependabot[bot]
61da4c567a build(deps-dev): bump @types/lodash from 4.17.13 to 4.17.15 (#2891) 2025-02-10 17:04:47 +00:00
Chenna Keshava B S
189abc1a26 PermissionedDomain XLS-80d (#2874) 2025-02-07 14:44:53 -08:00
Mayukha Vadari
ce5ca316ca feat: add support for the simulate RPC (XLS-69d) (#2867) 2025-02-07 10:38:52 -08:00
yinyiqian1
991a1d29a4 Add more unit test for DynamicNFT (#2892)
* Add more unit test for DynamicNFT

* resolve comment
2025-02-04 22:56:01 -05:00
yinyiqian1
23d26c8c2e support DynamicNFT (#2726)
* support DynamicNFT

* Update history.md

* use xrpl-codec-gen to generate definitions.json and modify ripple-binary-code HISTORY.md

* use validateRequiredField for NFTokenID check

* move comment to a proper place

* Add some comment and modify integration test

* update transaction number

* update ci rippled version
2025-02-03 10:32:30 -05:00
achowdhry-ripple
abdb192c69 Fix: parseTransactionFlags unintentionally modifies transaction (#2825)
* remove setTransactions and any reference to modifying a transaction parameter

* remove use of setter in autofill

* changelog and test fixes

* add back deprecated function with warnings

* add new helper function to exported

* update readme with deprecated

* remove references to deprecated setter

* fix changelog syntax

* revert to test old functions

* lint

* lint for deprecation

* remove unsafe assertions

* separate null check

* clean up tests

* remove outdated logic

* fix history md

* fix tests after merge conflicts

* Update packages/xrpl/HISTORY.md

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* Update packages/xrpl/src/models/utils/flags.ts

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* Update packages/xrpl/src/models/utils/flags.ts

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* Update packages/xrpl/src/models/utils/flags.ts

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* Update packages/xrpl/src/models/utils/flags.ts

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* Update packages/xrpl/src/models/utils/flags.ts

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* Update packages/xrpl/src/models/utils/flags.ts

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* Update packages/xrpl/src/models/utils/flags.ts

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* Update packages/xrpl/src/models/utils/flags.ts

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* Update packages/xrpl/test/models/utils.test.ts

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* rename a test per pr comment

* lint fixes

* Update packages/xrpl/test/models/utils.test.ts

Co-authored-by: Omar Khan <khancodegt@gmail.com>

---------

Co-authored-by: Omar Khan <khancodegt@gmail.com>
2025-01-16 11:59:44 -05:00
dependabot[bot]
84943ae0b6 build(deps-dev): bump ts-jest from 29.2.2 to 29.2.5 (#2764) 2025-01-02 15:45:13 +00:00
dependabot[bot]
d8126807a4 build(deps-dev): bump typedoc from 0.26.11 to 0.27.6 (#2863) 2025-01-02 15:29:56 +00:00
dependabot[bot]
7a2fa3fcaa build(deps-dev): bump webpack from 5.96.1 to 5.97.1 (#2853) 2025-01-02 15:23:03 +00:00
dependabot[bot]
76c3355858 build(deps-dev): bump webpack-cli from 5.1.4 to 6.0.1 (#2861) 2025-01-02 15:14:29 +00:00
Omar Khan
11e724253b 4.1.0 release (#2851)
* update HISTORY

* update package-lock

* update ripple-binary-codec HISTORY

* update release dates

* update release dates

* update HISTORY files
2024-12-21 07:10:25 +05:30
achowdhry-ripple
f34d1a7a63 Credentials (#2829)
* create credentials obj, modify depositpreauth

* structrure of transaction models

* initial validation methods and modify transactions affected by deposit auth

* cleanup and add new transactions to list

* binarycodec and add amendments to config

* methods account for credentials

* binary codec update

* add amendments to config

* error validation for credentials actions

* core logic of error validation completed

* type checking in error validation

* init test files and field type validations

* basic tests for crud transactions

* cred delete tests

* cred accept unit tests

* cred create and accept unit tests

* cred delete unit tests

* depositPreauth unit tests

* generic checks for payment, paymentchannelclaim, escrowfinish credential list

* ledger entry update

* lint errors

* cleanup and use helper methods

* fix lint bug

* init integration tests for new transactions

* fix build error, integration test docker update

* unit test fixes -- all pass now

* integration test layout complete

* integration command

* integration tests run

* cicd command edit

* lint and cleanup

* modified history markdown

* deposit preauth integration update

* update docs with new docker command

* fix validation for string id credential arrays

* exports

* add flag

* lint

* fix typo in contributing doc

* docstring typos

* readable string

* fix test'

* review comment fixes

* txn duplicate fix

* Apply suggestions from code review

Co-authored-by: Omar Khan <khancodegt@gmail.com>
Co-authored-by: Mayukha Vadari <mvadari@ripple.com>

* Apply suggestions from code review

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* Apply suggestions from code review

Co-authored-by: Omar Khan <khancodegt@gmail.com>
Co-authored-by: Mayukha Vadari <mvadari@ripple.com>

* typo in auto suggest

* rebase

* readd definitions after rebase

* cleanup list val

* unit tests fixed and running

* lint

* refactor authcred check to work

* Update packages/xrpl/src/models/transactions/payment.ts

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* typo

* Update .ci-config/rippled.cfg

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* update rippled version

* optional field nits

* add to response depositauthorize

* Update packages/xrpl/src/models/transactions/CredentialCreate.ts

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* Update packages/xrpl/src/models/transactions/CredentialDelete.ts

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* Update packages/xrpl/src/models/transactions/accountDelete.ts

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* Apply suggestions from code review

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* cleanups

* unit test fix

* more escrowfinish tests

* clearer error message

* re add statement

* undo autodeleted mandates

* remove extraneous integration tests for now

* lint

* Update .ci-config/rippled.cfg

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* Update packages/xrpl/src/models/transactions/common.ts

Co-authored-by: Omar Khan <khancodegt@gmail.com>

* added tests

* typo

---------

Co-authored-by: Omar Khan <khancodegt@gmail.com>
Co-authored-by: Mayukha Vadari <mvadari@ripple.com>
2024-12-20 14:03:56 -05:00
Shawn Xie
7bf6fecc71 add more mpt flag validations (#2856)
* remove else condition

* validation txfee

* clidation

* lint

* lint

* comments

* lint

* more typechecking

* rm newline

* refactor

* null check

* revert null check

* reuse test
2024-12-19 15:53:16 -05:00
dependabot[bot]
303c2b983c build(deps): bump @scure/bip32 from 1.5.0 to 1.6.0 (#2852) 2024-12-16 20:26:32 +00:00
Mayukha Vadari
448164da70 chore: bump Github Actions versions (#2788)
bump Github Actions versions
2024-12-13 12:17:21 -08:00
dependabot[bot]
9f72c8d384 build(deps): bump @scure/base from 1.1.9 to 1.2.1 (#2844) 2024-12-12 01:12:16 +00:00
Mayukha Vadari
e42d418662 feat: add node v22 and npm v10 support (#2695)
* add node 22 support

* add debug stuff

* try upgrading npm

* remove node 16

* debug

* remove tmux

* only allow 22.9 onwards

* try 22.8

* try 22.7

* test more 22.x versions

* test more versions

* switch back to 22.x, clean up

* update README
2024-12-11 16:50:41 -08:00
dependabot[bot]
305f2c48bf build(deps): bump @noble/curves from 1.6.0 to 1.7.0 (#2836)
Bumps [@noble/curves](https://github.com/paulmillr/noble-curves) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/paulmillr/noble-curves/releases)
- [Commits](https://github.com/paulmillr/noble-curves/compare/1.6.0...1.7.0)

---
updated-dependencies:
- dependency-name: "@noble/curves"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-11 16:00:54 -08:00
dependabot[bot]
b7dfcbf075 build(deps-dev): bump react from 18.3.1 to 19.0.0 (#2843) 2024-12-11 23:37:09 +00:00
Shawn Xie
b04efe8c9e MPT (#2661)
MPT Support for library and binary codec
2024-12-11 13:38:13 -08:00
dependabot[bot]
e3188b83ed build(deps): bump @noble/hashes from 1.5.0 to 1.6.1 (#2837)
Bumps [@noble/hashes](https://github.com/paulmillr/noble-hashes) from 1.5.0 to 1.6.1.
- [Release notes](https://github.com/paulmillr/noble-hashes/releases)
- [Commits](https://github.com/paulmillr/noble-hashes/compare/1.5.0...1.6.1)

---
updated-dependencies:
- dependency-name: "@noble/hashes"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 20:35:54 +05:30
dependabot[bot]
f4011b58e7 build(deps): bump @scure/bip39 from 1.4.0 to 1.5.0 (#2838)
Bumps [@scure/bip39](https://github.com/paulmillr/scure-bip39) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/paulmillr/scure-bip39/releases)
- [Commits](https://github.com/paulmillr/scure-bip39/compare/1.4.0...1.5.0)

---
updated-dependencies:
- dependency-name: "@scure/bip39"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Chenna Keshava B S <21219765+ckeshava@users.noreply.github.com>
2024-12-09 16:03:25 +05:30
Emmanuel Ferdman
00614753ff docs: update references in CONTRIBUTING.md (#2832)
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2024-12-04 18:41:50 -05:00
Denis Angell
b3a76bd9c0 Update HISTORY.md (#2777) 2024-12-02 15:17:02 -05:00
dependabot[bot]
24e9ad7c12 build(deps-dev): bump webpack from 5.95.0 to 5.96.1 (#2833) 2024-11-21 20:54:39 +00:00
Shawn Xie
c2dd2edbcc Update custom Payment to a higher number in binary codec test (#2824)
* update payment custom def

* comment
2024-11-18 17:34:12 -05:00
dependabot[bot]
c9207337aa build(deps-dev): bump typedoc from 0.26.10 to 0.26.11 (#2822)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.26.10 to 0.26.11.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.26.10...v0.26.11)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Omar Khan <khancodegt@gmail.com>
2024-11-15 15:29:12 -05:00
dependabot[bot]
a6852dd588 build(deps-dev): bump @types/jest from 29.5.12 to 29.5.14 (#2821)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.5.12 to 29.5.14.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

---
updated-dependencies:
- dependency-name: "@types/jest"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Omar Khan <khancodegt@gmail.com>
2024-11-15 15:06:26 -05:00
dependabot[bot]
3a604ce69a build(deps-dev): bump @types/lodash from 4.17.12 to 4.17.13 (#2819)
Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.17.12 to 4.17.13.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash)

---
updated-dependencies:
- dependency-name: "@types/lodash"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Omar Khan <khancodegt@gmail.com>
2024-11-15 14:59:19 -05:00
justinr1234
663b80f1d0 chore: remove code rabbit sequence diagram (#2827) 2024-11-14 12:40:46 -06:00
659 changed files with 11827 additions and 13722 deletions

187
.ci-config/rippled.cfg Normal file
View File

@@ -0,0 +1,187 @@
[server]
port_rpc_admin_local
port_ws_public
port_ws_admin_local
# port_peer
# port_ws_admin_local
# ssl_key = /etc/ssl/private/server.key
# ssl_cert = /etc/ssl/certs/server.crt
# IPs must be 0.0.0.0 instead of 127.0.0.1 to be accessed outside the docker container
[port_rpc_admin_local]
port = 5005
ip = 0.0.0.0
admin = 0.0.0.0
protocol = http
[port_ws_public]
port = 80
ip = 0.0.0.0
protocol = ws
# [port_peer]
# port = 51235
# ip = 0.0.0.0
# protocol = peer
[port_ws_admin_local]
port = 6006
ip = 0.0.0.0
admin = 0.0.0.0
protocol = ws
[node_size]
small
# tiny
# small
# medium
# large
# huge
[node_db]
type=NuDB
path=/var/lib/rippled/db/nudb
advisory_delete=0
# How many ledgers do we want to keep (history)?
# Integer value that defines the number of ledgers
# between online deletion events
online_delete=256
[ledger_history]
# How many ledgers do we want to keep (history)?
# Integer value (ledger count)
# or (if you have lots of TB SSD storage): 'full'
256
[database_path]
/var/lib/rippled/db
[debug_logfile]
/var/log/rippled/debug.log
[ips]
r.ripple.com 51235
[rpc_startup]
{ "command": "log_level", "severity": "info" }
# severity (order: lots of information .. only errors)
# debug
# info
# warn
# error
# fatal
[ssl_verify]
1
# The [features] stanza does not currently work for standalone mode: https://github.com/XRPLF/xrpl-dev-portal/issues/1762#issuecomment-1441252450
# In order to enable an amendment which by default would vote "No", you must include its amendment id and name here.
# To add amendments specifically from the latest releases of rippled:
# 1. Go to https://xrpl.org/known-amendments.html
# 2. Find the first amendment in the latest releases of rippled which are not already in the list below
# 3. Click on each amendment to get their Amendment ID and name to add to this list manually.
# You will likely update the list with all amendments from a new release of rippled all at once.
# To get the list of amendments on a network (e.g. devnet) follow the steps in xrpl.js's CONTRIBUTING.md for "Updating the Docker container".
# https://github.com/XRPLF/xrpl.js/blob/main/CONTRIBUTING.md
# (Running the script `getNewAmendments.js` should help you identify any new amendments that should be added.)
#
# Note: The version of rippled you use this config with must have an implementation for the amendments you attempt to enable or it will crash.
# If you need the version of rippled to be more up to date, you may need to make a comment on this repo: https://github.com/WietseWind/docker-rippled
[features]
# Devnet amendments as of June 28th, 2023
NegativeUNL
fixRemoveNFTokenAutoTrustLine
NonFungibleTokensV1
CheckCashMakesTrustLine
fixRmSmallIncreasedQOffers
fixSTAmountCanonicalize
FlowSortStrands
TicketBatch
fix1201
fixQualityUpperBound
FlowCross
EnforceInvariants
fix1523
HardenedValidations
DepositPreauth
MultiSignReserve
fix1623
FeeEscalation
PayChan
fix1513
RequireFullyCanonicalSig
fix1543
TickSize
fix1781
fixCheckThreading
fix1515
CryptoConditions
fix1528
fixPayChanRecipientOwnerDir
SortedDirectories
fix1578
fix1571
fixAmendmentMajorityCalc
fixTakerDryOfferRemoval
fixMasterKeyAsRegularKey
Flow
Escrow
TrustSetAuth
DeletableAccounts
DepositAuth
fix1368
fix1512
fix1373
MultiSign
Checks
NonFungibleTokensV1_1
# 1.10.0 Amendments
DisallowIncoming
fixNonFungibleTokensV1_2
fixTrustLinesToSelf
fixUniversalNumber
ImmediateOfferKilled
XRPFees
# 1.11.0 Amendments
ExpandedSignerList
# 1.12.0 Amendments
AMM
Clawback
fixReducedOffersV1
fixNFTokenRemint
# 2.0.0 Amendments
XChainBridge
DID
# 2.2.0-b3 Amendments
fixNFTokenReserve
fixInnerObjTemplate
fixAMMOverflowOffer
PriceOracle
fixEmptyDID
fixXChainRewardRounding
fixPreviousTxnID
fixAMMv1_1
# 2.3.0 Amendments
AMMClawback
fixAMMv1_2
Credentials
NFTokenMintOffer
MPTokensV1
fixNFTokenPageLinks
fixInnerObjTemplate2
fixEnforceNFTokenTrustline
fixReducedOffersV2
DeepFreeze
DynamicNFT
PermissionedDomains

View File

@@ -1,109 +0,0 @@
[server]
port_rpc_admin_local
port_ws_public
port_ws_admin_local
# port_peer
# port_ws_admin_local
# ssl_key = /etc/ssl/private/server.key
# ssl_cert = /etc/ssl/certs/server.crt
# IPs must be 0.0.0.0 instead of 127.0.0.1 to be accessed outside the docker container
[port_rpc_admin_local]
port = 5005
ip = 0.0.0.0
admin = 0.0.0.0
protocol = http
[port_ws_public]
port = 80
ip = 0.0.0.0
protocol = ws
# [port_peer]
# port = 51235
# ip = 0.0.0.0
# protocol = peer
[port_ws_admin_local]
port = 6006
ip = 0.0.0.0
admin = 0.0.0.0
protocol = ws
[node_size]
small
# tiny
# small
# medium
# large
# huge
[node_db]
type=NuDB
path=/var/lib/xahaud/db/nudb
advisory_delete=0
# How many ledgers do we want to keep (history)?
# Integer value that defines the number of ledgers
# between online deletion events
online_delete=256
[ledger_history]
# How many ledgers do we want to keep (history)?
# Integer value (ledger count)
# or (if you have lots of TB SSD storage): 'full'
256
[database_path]
/var/lib/xahaud/db
[debug_logfile]
/var/log/xahaud/debug.log
[sntp_servers]
time.windows.com
time.apple.com
time.nist.gov
pool.ntp.org
[ips]
r.xahau.com 51235
# # # # # [validators_file]
# # # # # validators.txt
[rpc_startup]
{ "command": "log_level", "severity": "info" }
# severity (order: lots of information .. only errors)
# debug
# info
# warn
# error
# fatal
[ssl_verify]
1
# The [features] stanza does not currently work for standalone mode: https://github.com/XRPLF/xrpl-dev-portal/issues/1762#issuecomment-1441252450
# In order to enable an amendment which by default would vote "No", you must include its amendment id and name here.
# To add amendments specifically from the latest releases of xahaud:
# 1. Go to https://xrpl.org/known-amendments.html
# 2. Find the first amendment in the latest releases of xahaud which are not already in the list below
# 3. Click on each amendment to get their Amendment ID and name to add to this list manually.
# You will likely update the list with all amendments from a new release of xahaud all at once.
# To get the list of amendments on a network (e.g. devnet) follow the steps in xahau.js's CONTRIBUTING.md for "Updating the Docker container".
# https://github.com/XRPLF/xahau.js/blob/main/CONTRIBUTING.md
# (Running the script `getNewAmendments.js` should help you identify any new amendments that should be added.)
#
# Note: The version of xahaud you use this config with must have an implementation for the amendments you attempt to enable or it will crash.
# If you need the version of xahaud to be more up to date, you may need to make a comment on this repo: https://github.com/WietseWind/docker-xahaud
[network_id]
63456

View File

@@ -13,6 +13,8 @@ reviews:
review_status: true
# Generate walkthrough in a markdown collapsible section.
collapse_walkthrough: false
# Generate sequence diagrams in the walkthrough.
sequence_diagrams: false
# Abort the in-progress review if the pull request is closed or merged.
abort_on_close: true
auto_review:

View File

@@ -33,11 +33,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -48,7 +48,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -62,4 +62,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3

View File

@@ -4,11 +4,11 @@
name: Node.js CI
env:
XAHAUD_DOCKER_IMAGE: xahauci/xahaud:2025.2.6
RIPPLED_DOCKER_IMAGE: rippleci/rippled:develop
on:
push:
branches: [main-xahau, 1.x]
branches: [main, 1.x]
pull_request:
workflow_dispatch:
@@ -22,19 +22,19 @@ jobs:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Setup npm version 9
- name: Setup npm version 10
run: |
npm i -g npm@9 --registry=https://registry.npmjs.org
npm i -g npm@10 --registry=https://registry.npmjs.org
- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
@@ -45,7 +45,6 @@ jobs:
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-deps-${{ matrix.node-version }}-
${{ runner.os }}-deps-
- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
@@ -60,22 +59,22 @@ jobs:
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Setup npm version 9
- name: Setup npm version 10
run: |
npm i -g npm@9 --registry=https://registry.npmjs.org
npm i -g npm@10 --registry=https://registry.npmjs.org
- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
@@ -86,7 +85,6 @@ jobs:
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-deps-${{ matrix.node-version }}-
${{ runner.os }}-deps-
- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
@@ -101,27 +99,27 @@ jobs:
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run docker in background
run: |
docker run --detach --rm --name xahaud-service -p 6006:6006 --volume "${{ github.workspace }}/.ci-config/":"/opt/xahau/etc/" --health-cmd="wget localhost:6006 || exit 1" --health-interval=5s --health-retries=10 --health-timeout=2s --env GITHUB_ACTIONS=true --env CI=true ${{ env.XAHAUD_DOCKER_IMAGE }} /opt/xahau/bin/xahaud -a --conf /opt/xahau/etc/xahaud.cfg
docker run --detach --rm -p 6006:6006 --volume "${{ github.workspace }}/.ci-config/":"/etc/opt/ripple/" --name rippled-service --health-cmd="rippled server_info || exit 1" --health-interval=5s --health-retries=10 --health-timeout=2s --env GITHUB_ACTIONS=true --env CI=true --entrypoint bash ${{ env.RIPPLED_DOCKER_IMAGE }} -c "rippled -a"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Setup npm version 9
- name: Setup npm version 10
run: |
npm i -g npm@9 --registry=https://registry.npmjs.org
npm i -g npm@10 --registry=https://registry.npmjs.org
- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
@@ -132,7 +130,6 @@ jobs:
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-deps-${{ matrix.node-version }}-
${{ runner.os }}-deps-
- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
@@ -145,7 +142,7 @@ jobs:
- name: Stop docker container
if: always()
run: docker stop xahaud-service
run: docker stop rippled-service
browser:
runs-on: ubuntu-latest
@@ -156,24 +153,24 @@ jobs:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Run docker in background
run: |
docker run --detach --rm --name xahaud-service -p 6006:6006 --volume "${{ github.workspace }}/.ci-config/":"/opt/ripple/etc/" --health-cmd="wget localhost:6006 || exit 1" --health-interval=5s --health-retries=10 --health-timeout=2s --env GITHUB_ACTIONS=true --env CI=true ${{ env.XAHAUD_DOCKER_IMAGE }} /opt/ripple/bin/xahaud -a --conf /opt/ripple/etc/xahaud.cfg
docker run --detach --rm -p 6006:6006 --volume "${{ github.workspace }}/.ci-config/":"/etc/opt/ripple/" --name rippled-service --health-cmd="rippled server_info || exit 1" --health-interval=5s --health-retries=10 --health-timeout=2s --env GITHUB_ACTIONS=true --env CI=true --entrypoint bash ${{ env.RIPPLED_DOCKER_IMAGE }} -c "rippled -a"
- name: Setup npm version 9
- name: Setup npm version 10
run: |
npm i -g npm@9 --registry=https://registry.npmjs.org
npm i -g npm@10 --registry=https://registry.npmjs.org
- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
@@ -184,7 +181,6 @@ jobs:
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-deps-${{ matrix.node-version }}-
${{ runner.os }}-deps-
- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
@@ -197,7 +193,7 @@ jobs:
- name: Stop docker container
if: always()
run: docker stop xahaud-service
run: docker stop rippled-service
snippets:
runs-on: ubuntu-latest
@@ -205,22 +201,22 @@ jobs:
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Setup npm version 9
- name: Setup npm version 10
run: |
npm i -g npm@9 --registry=https://registry.npmjs.org
npm i -g npm@10 --registry=https://registry.npmjs.org
- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
@@ -231,7 +227,6 @@ jobs:
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-deps-${{ matrix.node-version }}-
${{ runner.os }}-deps-
- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'

175
APPLICATIONS.md Normal file
View File

@@ -0,0 +1,175 @@
# Applications using xrpl.js
A curated list of some of the projects and apps that leverage `xrpl.js` in some way.
**Have one to add?** Please edit this file and open a PR!
## Notice (disclaimer)
These sites are independent of Ripple and have not been authorized, endorsed, sponsored or otherwise approved by Ripple or its affiliates.
Warning: Use at your own risk.
## Exchanges
- **[The World Exchange](https://www.theworldexchange.net/)**
Trade, issue, and send directly on the XRP Ledger. A user interface for the XRPL's decentralized exchange. Includes an implementation of an autobridged order book for token-to-token trading pairs in the [source code](https://github.com/pftq/TheWorldExchange).
- **[Bitso](https://bitso.com/)**
Exchange allowing clients to buy and sell XRP, based in Mexico.
## Explorers
- **[xrpintel - XRP Intelligence](https://xrpintel.com/)**
Monitor the XRP Network in real time and explore historical statistics.
- **[XRP Charts](https://xrpcharts.ripple.com/)** (xrpcharts.ripple.com)
XRP Charts provides information based on public data, including trade volume, top markets, metrics, transactions, and more.
- **[Ripple Live](https://gatehub.net/live)** (gatehub.net/live)
Visualize XRP network transactions.
- **[XRPL Dev. Dashboard](https://xrp.fans/)** (xrp.fans)
Debugging dashboard for `rippled-ws-client-pool`, transaction and query explorer, and transaction signing and submission tool.
- **[XRP Value](http://xrpvalue.com/)**
Real-time XRP price, trades, and orderbook data from the XRP Ledger.
- **[Bithomp - XRP Explorer](https://bithomp.com/explorer/)**
Look up information by entering an address, transaction hash, username, or PayID.
- **[Bithomp - XRPL validators](https://bithomp.com/validators)**
List of XRPL validators, nodes, and testnet validators.
- **[XRP Scan - XRP Ledger explorer](https://xrpscan.com)**
XRP Ledger explorer, metrics and analytics.
- **[xrplorer](https://xrplorer.com)**
XRP Ledger explorer, API, metrics, and analytics using a graph database that is synchronized live with the XRPL.
- **[XRPLWin](https://xrplwin.com)**
XRP Ledger and Xahau explorer, Hooks explorer, metrics, and analytics using a XWA backend that is synchronized live with the XRPL and Xahau.
## Data monitoring
- **[zerptracker](https://zerptracker.com)**
Monitor the XRPL using powerful JSONPath expressions, and receive notifications via email, SMS, webhooks, and more.
- **[Utility-Scan](https://utility-scan.com)**
Attempts to detect RippleNet on-demand liquidity (ODL) transactions through known fiat corridors and report these transactions in real time.
- **[XRPL Rosetta](https://threexrp.dev/)**
3D Globe written in three.js connected to a Node.js websocket server that is listening to exchanges and the XRPL. The visualization aims to show trading, ODL, and liquidity at exchanges, intra-exchange volume, and flows.
## Wallets and wallet tools
- **[GemWallet](https://gemwallet.app/)**
Users can use the GemWallet (non-custodial) web extension to interact with the XRPL from their browser. The documentation is available at [https://gemwallet.app/](https://gemwallet.app/docs/user-guide/introduction).
- **[XUMM](https://xumm.app/)**
Users can use the xumm application to track their accounts, balances and transactions. The true power of xumm is the platform available for developers.
- **[Xpring Wallet](https://xpring.io)** (uses `ripple-keypairs`)
Non-custodial XRP wallet.
- **[XRP Toolkit](https://www.xrptoolkit.com)**
A web interface to the XRP Ledger, supporting both hardware and software wallets.
- **[Toast Wallet](https://toastwallet.com/)**
A free, open source XRP Wallet for iOS, Android, Windows, Mac and Linux.
- **[Toastify Ledger](https://github.com/WietseWind/toastify-ledger)** (uses `ripple-keypairs`)
Add a Regular Key to a mnemonic XRP Wallet (e.g. Ledger Nano S) to use the account with a Family Seed (secret).
- **[Bithomp-submit](https://github.com/Bithomp/bithomp-submit)** (GitHub)
A tool to submit an offline-signed XRPL transaction.
- **[Kyte](https://kyteapp.co/)** (kyteapp.co) ([Source](https://github.com/WietseWind/Zerp-Wallet)) (Deprecated)
Web-based XRP wallet.
- **[XRP Vanity Address Generator](https://github.com/WietseWind/xrp-vanity-generator)** (Node.js)
A vanity address is a wallet address containing a few characters you like at the beginning or the end of the wallet address.
- **[XRP Account Mnemonic Recovery](https://github.com/WietseWind/xrp-mnemonic-recovery)** (uses `ripple-keypairs`)
Recover a 24 word mnemonic if one word is wrong or one word is missing.
- **[Trustline](https://trustline.co)**
A decentralized stablecoin wallet that runs on the XRP Ledger.
## Send and request payments
- **[XRP Tip Bot](https://www.xrptipbot.com/)**
A bot that enables users on reddit, Twitter and Discord to send XRP to each other through reddit comments and Twitter tweets.
- **[XRP Text](https://xrptext.com/)**
Send XRP using SMS text messages.
- **[XRParrot](https://xrparrot.com/)** (uses `ripple-address-codec`)
Easy EUR (SEPA) to XRP transfer (currency conversion).
- **[XRP Payment](https://xrpayments.co/)** (xrpayments.co)
Tool for generating a XRP payment request URI in a QR code, with currency converter.
## Development tools
- **[XRP Faucets for Testnet and Devnet](https://xrpl.org/xrp-testnet-faucet.html)**
Get some test funds for development on the test network. The faucet uses `xrpl.js`.
## Code samples and libraries
- **[ilp-plugin-xrp-paychan](https://github.com/interledgerjs/ilp-plugin-xrp-paychan)**
Send ILP payments using XRP and payment channels (PayChan).
- **[RunKit: WietseWind](https://runkit.com/wietsewind/)**
XRP Ledger code samples for Node.js.
- **[GitHub Gist: WietseWind](https://gist.github.com/WietseWind)**
XRP Ledger code samples for Node.js and the web (mostly).
- **[rippled-ws-client-sign](https://github.com/WietseWind/rippled-ws-client-sign)**
Sign transactions, with support for MultiSign.
- **[ILP-enabled power switch](https://xrpcommunity.blog/raspberry-pi-interledger-xp-powerswitch-howto/)** ([video](https://www.youtube.com/watch?v=c-eS0HQUuJg)) (uses [`moneyd-uplink-xrp`](https://github.com/interledgerjs/moneyd-uplink-xrp))
For about $30 in parts (Raspberry Pi, 3.3V Relay board and a few wires) you can build your own power switch that will switch on if a streaming ILP payment comes in. When the payment stream stops, the power turns off.
## Related apps that do not appear to use xrpl.js
- **[XRP Stats](https://ledger.exposed/)** (ledger.exposed)
Rich list, live ledger stats and XRP distribution. Visualize escrows and flow of funds.

View File

@@ -47,7 +47,7 @@ npm run lint
## Running Tests
For integration and browser tests, we use a `xahaud` node in standalone mode to test xahau.js code against. To set this up, you can either configure and run `xahaud` locally, or set up the Docker container `xahauci/xahaud` by [following these instructions](#integration-tests). The latter will require you to [install Docker](https://docs.docker.com/get-docker/).
For integration and browser tests, we use a `rippled` node in standalone mode to test xrpl.js code against. To set this up, you can either configure and run `rippled` locally, or set up the Docker container `rippleci/rippled` by [following these instructions](#integration-tests). The latter will require you to [install Docker](https://docs.docker.com/get-docker/).
### Unit Tests
@@ -59,23 +59,25 @@ npm test
### Integration Tests
From the top-level xahau.js folder (one level above `packages`), run the following commands:
From the top-level xrpl.js folder (one level above `packages`), run the following commands:
```bash
npm install
# sets up the xahaud standalone Docker container - you can skip this step if you already have it set up
docker run -p 6006:6006 --interactive -t --volume $PWD/.ci-config:/opt/xahau/etc/ --platform linux/amd64 xahauci/xahaud:2025.2.6 /opt/xahau/bin/xahaud -a --conf /opt/xahau/etc/xahaud.cfg
# sets up the rippled standalone Docker container - you can skip this step if you already have it set up
docker run -p 6006:6006 --rm -it --name rippled_standalone --volume $PWD/.ci-config:/etc/opt/ripple/ --entrypoint bash rippleci/rippled:develop -c 'rippled -a'
npm run build
npm run test:integration
```
Breaking down the command:
* `docker run -p 6006:6006` starts a Docker container with an open port for admin WebSocket requests.
* `--interactive` allows you to interact with the container.
* `-t` starts a terminal in the container for you to send commands to.
* `--volume $PWD/.ci-config:/config/` identifies the `xahaud.cfg` and `validators.txt` to import. It must be an absolute path, so we use `$PWD` instead of `./`.
* `xahauci/xahaud` is an image that is regularly updated with the latest `xahaud` releases
* `/opt/xahau/bin/xahaud -a --conf /opt/xahau/etc/xahaud.cfg` starts `xahaud` in standalone mode
`--rm` tells docker to close the container after processes are done running.
* `-it` allows you to interact with the container.
`--name rippled_standalone` is an instance name for clarity
* `--volume $PWD/.ci-config:/etc/opt/ripple/` identifies the `rippled.cfg` and `validators.txt` to import. It must be an absolute path, so we use `$PWD` instead of `./`.
* `rippleci/rippled` is an image that is regularly updated with the latest `rippled` releases
* `--entrypoint bash rippleci/rippled:develop` manually overrides the entrypoint (for the latest version of rippled on the `develop` branch)
* `-c 'rippled -a'` provides the bash command to start `rippled` in standalone mode from the manual entrypoint
### Browser Tests
@@ -85,12 +87,12 @@ One is in the browser - run `npm run build:browserTests` and open `test/localInt
The other is in the command line (this is what we use for CI) -
This should be run from the `xahau.js` top level folder (one above the `packages` folder).
This should be run from the `xrpl.js` top level folder (one above the `packages` folder).
```bash
npm run build
# sets up the xahaud standalone Docker container - you can skip this step if you already have it set up
docker run -p 6006:6006 --interactive -t --volume $PWD/.ci-config:/opt/xahau/etc/ --platform linux/amd64 xahauci/xahaud:2025.2.6 /opt/xahau/bin/xahaud -a --conf /opt/xahau/etc/xahaud.cfg
# sets up the rippled standalone Docker container - you can skip this step if you already have it set up
docker run -p 6006:6006 --rm -it --name rippled_standalone --volume $PWD/.ci-config:/etc/opt/ripple/ --entrypoint bash rippleci/rippled:develop -c 'rippled -a'
npm run test:browser
```
@@ -100,47 +102,47 @@ This is a monorepo, which means that there are multiple packages in a single Git
The 4 packages currently here are:
1. xahau.js - The client library for interacting with the ledger.
2. xahau-binary-codec - A library for serializing and deserializing transactions for the ledger.
3. xahau-keypairs - A library for generating and using cryptographic keypairs.
4. xahau-address-codec - A library for encoding and decoding Xahau Ledger addresses and seeds.
1. xrpl.js - The client library for interacting with the ledger.
2. ripple-binary-codec - A library for serializing and deserializing transactions for the ledger.
3. ripple-keypairs - A library for generating and using cryptographic keypairs.
4. ripple-address-codec - A library for encoding and decoding XRP Ledger addresses and seeds.
5. isomorphic - A collection of isomorphic implementations of crypto and utility functions.
6. secret-numbers - Generate XRPL Accounts with a number-based secret: 8 chunks of 6 digits.
Each package has it's own README which dives deeper into what it's main purpose is, and the core functionality it offers.
They also run tests independently as they were originally in separate repositories.
These are managed in a monorepo because often a change in a lower-level library will also require a change in xahau.js, and so it makes sense to be able to allow for modifications of all packages at once without coordinating versions across multiple repositories.
These are managed in a monorepo because often a change in a lower-level library will also require a change in xrpl.js, and so it makes sense to be able to allow for modifications of all packages at once without coordinating versions across multiple repositories.
Let's dive a bit into how xahau.js is structured!
Let's dive a bit into how xrpl.js is structured!
### The File Structure
Within the xrpl package, each folder has a specific purpose:
**Client** - This contains logic for handling the websocket connection to xahaud servers.
**Client** - This contains logic for handling the websocket connection to rippled servers.
**Models** - These types model LedgerObjects, Requests/Methods, and Transactions in order to give type hints and nice errors for users.
**Sugar** - This is where handy helper functions end up, like `submit`, `autofill`, and `getXAHBalance` amongst others.
**Sugar** - This is where handy helper functions end up, like `submit`, `autofill`, and `getXRPBalance` amongst others.
**Utils** - These are shared functions which are useful for conversions, or internal implementation details within the library.
**Wallet** - This logic handles managing keys, addresses, and signing within xahau.js
**Wallet** - This logic handles managing keys, addresses, and signing within xrpl.js
### Writing Tests for xahau.js
### Writing Tests for xrpl.js
For every file in `src`, we try to have a corresponding file in `test` with unit tests.
The goal is to maintain above 80% code coverage, and generally any new feature or bug fix should be accompanied by unit tests, and integration tests if applicable.
For an example of a unit test, check out the [autofill tests here](./packages/xahau/test/client/autofill.ts).
For an example of a unit test, check out the [autofill tests here](./packages/xrpl/test/client/autofill.test.ts).
If your code connects to the ledger (ex. Adding a new transaction type) it's handy to write integration tests to ensure that you can successfully interact with the ledger. Integration tests are generally run against a docker instance of xahaud which contains the latest updates. Since standalone mode allows us to manually close ledgers, this allows us to run integration tests at a much faster rate than if we had to wait 4-5 seconds per transaction for the ledger to validate the transaction. [See above](#running-tests) for how to start up the docker container to run integration tests.
If your code connects to the ledger (ex. Adding a new transaction type) it's handy to write integration tests to ensure that you can successfully interact with the ledger. Integration tests are generally run against a docker instance of rippled which contains the latest updates. Since standalone mode allows us to manually close ledgers, this allows us to run integration tests at a much faster rate than if we had to wait 4-5 seconds per transaction for the ledger to validate the transaction. [See above](#running-tests) for how to start up the docker container to run integration tests.
All integration tests should be written in the `test/integration` folder, with new `Requests` and `Transactions` tests being in their respective folders.
For an example of how to write an integration test for `xahau.js`, you can look at the [Payment integration test](./packages/xahau/test/integration/transactions/payment.ts).
For an example of how to write an integration test for `xrpl.js`, you can look at the [Payment integration test](./packages/xrpl/test/integration/transactions/payment.test.ts).
## Generate reference docs
You can see the complete reference documentation at [`xahau.js` docs](https://js.xrpl.org). You can also generate them locally using `typedoc`:
You can see the complete reference documentation at [`xrpl.js` docs](https://js.xrpl.org). You can also generate them locally using `typedoc`:
```bash
npm run docgen
@@ -150,17 +152,17 @@ This updates `docs/` at the top level, where GitHub Pages looks for the docs.
## Update `definitions.json`
Use [this repo](https://github.com/RichardAH/xrpl-codec-gen) to generate a new `definitions.json` file from the xahaud source code. Instructions are available in that README.
Use [this repo](https://github.com/RichardAH/xrpl-codec-gen) to generate a new `definitions.json` file from the rippled source code. Instructions are available in that README.
## Adding and removing packages
`xahau.js` uses `lerna` and `npm`'s workspaces features to manage a monorepo.
`xrpl.js` uses `lerna` and `npm`'s workspaces features to manage a monorepo.
Adding and removing packages requires a slightly different process than normal
as a result.
### Adding or removing development dependencies
`xahau.js` strives to use the same development dependencies in all packages.
`xrpl.js` strives to use the same development dependencies in all packages.
You may add and remove dev dependencies like normal:
```bash
@@ -175,38 +177,38 @@ npm uninstall --save-dev abbrev
You need to specify which package is changing using the `-w` flag:
```bash
### adding a new dependency to `xahau`
npm install abbrev -w xahau
### adding a new dependency to `xahau-keypairs`
npm install abbrev -w xahau-keypairs
### adding a new dependency to `xrpl`
npm install abbrev -w xrpl
### adding a new dependency to `ripple-keypairs`
npm install abbrev -w ripple-keypairs
### removing a dependency
npm uninstall abbrev -w xahau
npm uninstall abbrev -w xrpl
```
## Updating the Docker container for CI
In order to test the library, we need to enable the latest amendments in the docker container.
This requires updating the `/.ci-config/xahaud.cfg` file with the hashes and names of new amendments.
This requires updating the `/.ci-config/rippled.cfg` file with the hashes and names of new amendments.
In order to update the list, follow these steps from the top level of the library:
1. Run `node ./.ci-config/getNewAmendments.js`
2. If there are any new amendment hashes, add a comment to the end of `/.ci-config/xahaud.cfg` with the date
2. If there are any new amendment hashes, add a comment to the end of `/.ci-config/rippled.cfg` with the date
- `Ex. "# Added August 9th, 2023"`
3. For each hash printed out by the script, add the hash and name to the config file.
- Ex. `B2A4DB846F0891BF2C76AB2F2ACC8F5B4EC64437135C6E56F3F859DE5FFD5856 ExpandedSignerList`
- You can look up the name by searching for the hash on https://xrpl.org/known-amendments.html
4. Push your changes
Note: The same updated config can be used to update xahau-py's CI as well.
Note: The same updated config can be used to update xrpl-py's CI as well.
## Updating `definitions.json`
This should almost always be done using the [`xrpl-codec-gen`](https://github.com/RichardAH/xrpl-codec-gen) script - if the output needs manual intervention afterwards, consider updating the script instead.
1. Clone / pull the latest changes from [xahaud](https://github.com/XRPLF/xahaud) - Specifically the `develop` branch is usually the right one.
1. Clone / pull the latest changes from [rippled](https://github.com/XRPLF/rippled) - Specifically the `develop` branch is usually the right one.
2. Clone / pull the latest changes from [`xrpl-codec-gen`](https://github.com/RichardAH/xrpl-codec-gen)
3. From the `xrpl-codec-gen` tool, follow the steps in the `README.md` to generate a new `definitions.json` file.
4. Replace the `definitions.json` file in the `xahau-binary-codec` with the newly generated file.
4. Replace the `definitions.json` file in the `ripple-binary-codec` with the newly generated file.
5. Verify that the changes make sense by inspection before submitting, as there may be updates required for the `xrpl-codec-gen` tool depending on the latest amendments we're updating to match.
@@ -246,13 +248,13 @@ This should almost always be done using the [`xrpl-codec-gen`](https://github.co
- Stable release: Run `npx lerna publish from-package --yes`
- Beta release: Run `npx lerna publish from-package --dist-tag beta --yes`
Notice this allows developers to install the package with `npm add xahau@beta`
Notice this allows developers to install the package with `npm add xrpl@beta`
1. If requested, enter your [npmjs.com](https://npmjs.com) OTP (one-time password) to complete publication.
NOW YOU HAVE PUBLISHED! But you're not done; we have to notify people!
1. Run `git tag <tagname> -m <tagname>`, where `<tagname>` is the new package and version (e.g. `xahau@2.1.1`), for each version released.
1. Run `git tag <tagname> -m <tagname>`, where `<tagname>` is the new package and version (e.g. `xrpl@2.1.1`), for each version released.
1. Run `git push --follow-tags`, to push the tags to Github.
1. On GitHub, click the "Releases" link on the right-hand side of the page.
@@ -262,19 +264,19 @@ This should almost always be done using the [`xrpl-codec-gen`](https://github.co
1. Click "Choose a tag", and choose a tag that you just created.
1. Edit the name of the release to match the tag (IE \<package\>@\<version\>) and edit the description as you see fit.
1. Send an email to [xahau-announce](https://groups.google.com/g/xahau-announce).
1. Lastly, send a similar message to the Xahau Discord in the [`javascript` channel](https://discord.com/channels/1085202760548499486/1085203623111295068). The message should include:
1. The version changes for xahau libraries
1. Send an email to [xrpl-announce](https://groups.google.com/g/xrpl-announce).
1. Lastly, send a similar message to the XRPL Discord in the [`javascript` channel](https://discord.com/channels/886050993802985492/886053111179915295). The message should include:
1. The version changes for xrpl libraries
1. A link to the more detailed changes
1. Highlights of important changes
## Mailing Lists
We have a low-traffic mailing list for announcements of new `xahau.js` releases. (About 1 email every couple of weeks)
We have a low-traffic mailing list for announcements of new `xrpl.js` releases. (About 1 email every couple of weeks)
- [Subscribe to xahau-announce](https://groups.google.com/g/xahau-announce)
- [Subscribe to xrpl-announce](https://groups.google.com/g/xrpl-announce)
If you're using the Xahau Ledger in production, you should run a [xahaud server](https://github.com/xahau/xahaud) and subscribe to the xahau-server mailing list as well.
If you're using the XRP Ledger in production, you should run a [rippled server](https://github.com/ripple/rippled) and subscribe to the ripple-server mailing list as well.
- [Subscribe to xahau-server](https://groups.google.com/g/xahau-server)
- [Subscribe to ripple-server](https://groups.google.com/g/ripple-server)

View File

@@ -25,7 +25,7 @@ All of which works in Node.js (tested for v18+) & web browsers (tested for Chrom
### Requirements
+ **[Node.js v18](https://nodejs.org/)** is recommended. We also support v20. Other versions may work but are not frequently tested.
+ **[Node.js v18](https://nodejs.org/)** is recommended. We also support v20 and v22. Other versions may work but are not frequently tested.
### Installing xrpl.js

View File

@@ -1,31 +1,31 @@
# Unique Setup Steps for Xahau.js
# Unique Setup Steps for Xrpl.js
Starting in 3.0 xahau and all the packages in this repo no longer require custom configurations (ex. polyfills) to run.
Starting in 3.0 xrpl and all the packages in this repo no longer require custom configurations (ex. polyfills) to run.
### Using xahau.js from a CDN
### Using xrpl.js from a CDN
You can avoid setting up your build system to handle `xahau.js` by using a cdn version that is prebuilt for the browser.
You can avoid setting up your build system to handle `xrpl.js` by using a cdn version that is prebuilt for the browser.
- unpkg `<script src="https://unpkg.com/xahau@2.3.0/build/xahau-latest-min.js"></script>`
- jsdelivr `<script src="https://cdn.jsdelivr.net/npm/xahau@2.3.0/build/xahau-latest-min.js"></script>`
- unpkg `<script src="https://unpkg.com/xrpl@2.3.0/build/xrpl-latest-min.js"></script>`
- jsdelivr `<script src="https://cdn.jsdelivr.net/npm/xrpl@2.3.0/build/xrpl-latest-min.js"></script>`
Ensure that the full path is provided so the browser can find the sourcemaps.
### Using xahau.js with `create-react-app`
### Using xrpl.js with `create-react-app`
Starting in 3.0 xahau and its related packages no longer require custom configurations (ex. polyfills) to run.
Starting in 3.0 xrpl and its related packages no longer require custom configurations (ex. polyfills) to run.
This online template uses these steps to run xahau.js with React in the browser:
https://codesandbox.io/s/xahau-intro-pxgdjr?file=/src/App.js
This online template uses these steps to run xrpl.js with React in the browser:
https://codesandbox.io/s/xrpl-intro-pxgdjr?file=/src/App.js
### Using xahau.js with React Native
### Using xrpl.js with React Native
If you want to use `xahau.js` with React Native you will need to install polyfills for core NodeJS modules.
If you want to use `xrpl.js` with React Native you will need to install polyfills for core NodeJS modules.
1. Install dependencies (you can use `yarn` as well):
```shell
npm install xahau \
npm install xrpl \
fast-text-encoding \
react-native-get-random-values
```
@@ -36,7 +36,7 @@ If you want to use `xahau.js` with React Native you will need to install polyfil
# compile `react-native-get-random-values` pods see https://www.npmjs.com/package/react-native-get-random-values#installation
npx pod-install
```
3. Create `polyfills.js` and add
```javascript
@@ -53,23 +53,23 @@ import './polyfills'
...
```
### Using xahau.js with Vite React
### Using xrpl.js with Vite React
Starting in 3.0 xahau and all the packages in this repo no longer require custom configurations (ex. polyfills) to run.
Starting in 3.0 xrpl and all the packages in this repo no longer require custom configurations (ex. polyfills) to run.
### Using xahau.js with Deno
### Using xrpl.js with Deno
Until official support for [Deno](https://deno.land) is added, you can use the following work-around to use `xahau.js` with Deno:
Until official support for [Deno](https://deno.land) is added, you can use the following work-around to use `xrpl.js` with Deno:
> [!NOTE]
> The following is currently broken due to https://github.com/denoland/deno/issues/20516.
> Once that is fixed there could be other issues as well.
```javascript
import xahau from 'https://dev.jspm.io/npm:xahau';
import xrpl from 'https://dev.jspm.io/npm:xrpl';
(async () => {
const api = new (xahau as any).Client('wss://xahau-test.net');
const api = new (xrpl as any).Client('wss://s.altnet.rippletest.net:51233');
const address = 'rH8NxV12EuV...khfJ5uw9kT';
api.connect().then(() => {

View File

@@ -1,4 +1,5 @@
{
"version": "independent",
"useWorkspaces": true,
"npmClient": "npm"
}

View File

@@ -1,440 +0,0 @@
// replaceScript.ts
// @ts-ignore -- No types available for fs/promises
import * as fs from "fs/promises";
// @ts-ignore -- No types available for fs/promises
import * as path from "path";
// Constants
const rippleDocker: string = "rippleci/rippled:2.2.0-b3";
const xahauDocker: string = "xahauci/xahaud:2025.2.6";
/**
* Replace text in a file with the given replacements.
* @param filePath - Path to the file.
* @param replacements - Object with key-value pairs for replacement.
*/
async function replaceTextInFile(
filePath: string,
replacements: { [key: string]: string }
): Promise<void> {
try {
let content = await fs.readFile(filePath, "utf-8");
for (const [key, value] of Object.entries(replacements)) {
const regex = new RegExp(escapeRegExp(key), "g");
content = content.replace(regex, value);
}
await fs.writeFile(filePath, content, "utf-8");
console.log(`Updated: ${filePath}`);
} catch (error) {
console.error(
`Error processing file ${filePath}: ${(error as Error).message}`
);
}
}
/**
* Escape special characters for use in RegExp.
* @param string - The string to escape.
* @returns The escaped string.
*/
function escapeRegExp(string: string): string {
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
/**
* Replace occurrences in pyproject.toml, specifically in the [tool.poetry] authors section.
* @param filePath - Path to pyproject.toml.
* @param newAuthors - Array of new authors to add.
*/
// async function replaceInPoetry(filePath: string, newAuthors: string[]): Promise<void> {
// try {
// let content = await fs.readFile(filePath, 'utf-8');
// // Replace specific texts
// const replacements: { [key: string]: string } = {
// "https://github.com/XRPLF/xrpl-py": "https://github.com/Xahau/xahau-py",
// "xrpl": "xahau",
// "xrp": "xah",
// "XRP ledger": "Xahau Ledger",
// };
// await replaceTextInFile(filePath, replacements);
// // Handle authors separately
// content = await fs.readFile(filePath, 'utf-8');
// const authorsRegex = /^authors\s*=\s*\[(.*?)\]/ms;
// const match = authorsRegex.exec(content);
// if (match) {
// const existingAuthors = match[1]
// .split(',')
// .map(author => author.trim().replace(/"/g, ''))
// .filter(author => author);
// const combinedAuthors = [...existingAuthors, ...newAuthors.map(author => author.trim())];
// const newAuthorsList = combinedAuthors.map(author => ` "${author}"`).join(',\n ');
// const newAuthorsSection = `authors = [\n${newAuthorsList}\n]`;
// content = content.replace(authorsRegex, newAuthorsSection);
// await fs.writeFile(filePath, content, 'utf-8');
// console.log(`Updated authors in: ${filePath}`);
// } else {
// console.warn(`Authors section not found in: ${filePath}`);
// }
// } catch (error) {
// console.error(`Error processing file ${filePath}: ${(error as Error).message}`);
// }
// }
/**
* Replace text in README.md.
* @param filePath - Path to README.md.
*/
async function replaceInReadme(filePath: string): Promise<void> {
const replacements: { [key: string]: string } = {
"from xrpl": "from xahau",
"xrpl-py": "xahau-py",
"xrpl.": "xahau.",
"xrpl-announce": "xahau-announce",
"xrpl-keypairs": "xahau-keypairs",
"XRP Ledger": "Xahau Ledger",
"https://s.altnet.rippletest.net:51234": "https://xahau-test.net",
};
await replaceTextInFile(filePath, replacements);
}
async function replaceInUnique(filePath: string): Promise<void> {
const replacements: { [key: string]: string } = {
"Xrpl.js": "Xahau.js",
xrpl: "xahau",
"wss://s.altnet.rippletest.net:51233": "wss://xahau-test.net",
};
await replaceTextInFile(filePath, replacements);
}
/**
* Replace text in CONTRIBUTING.md or other contributing files.
* @param filePath - Path to the contributing file.
*/
async function replaceInContrib(filePath: string): Promise<void> {
const replacements: { [key: string]: string } = {
"xrpl.js": "xahau.js",
"xrpl-announce": "xahau-announce",
[rippleDocker]: xahauDocker,
"/opt/ripple/bin/rippled": "/opt/xahau/bin/xahaud",
"/opt/ripple/etc/rippled.cfg": "/opt/xahau/etc/xahaud.cfg",
ripple: "xahau",
rippled: "xahaud",
RIPPLED: "XAHAUD",
getXRPBalance: "getXAHBalance",
"/packages/xrpl": "/packages/xahau",
"`xrpl`": "`xahau`",
"-w xrpl": "-w xahau",
"xrpl-py": "xahau-py",
"xrpl@beta": "xahau@beta",
"`xrpl@2.1.1`": "`xahau@2.1.1`",
"xrpl libraries": "xahau libraries",
"XRP Ledger": "Xahau Ledger",
"XRPL Discord": "Xahau Discord",
"https://discord.com/channels/886050993802985492/886053111179915295":
"https://discord.com/channels/1085202760548499486/1085203623111295068",
};
await replaceTextInFile(filePath, replacements);
}
/**
* Replace text in CONTRIBUTING.md or other contributing files.
* @param filePath - Path to the contributing file.
*/
async function replaceInConfig(filePath: string): Promise<void> {
const replacements: { [key: string]: string } = {
"[validators_file]": "# [validators_file]",
"validators.txt": "# validators.txt",
};
await replaceTextInFile(filePath, replacements);
}
/**
* Replace text in GitHub workflow and config files.
* @param filePath - Path to the GitHub-related file.
*/
async function replaceInGitHub(filePath: string): Promise<void> {
const replacements: { [key: string]: string } = {
"[xahau]": "[main, xahau]",
"flake8 xrpl": "flake8 xahau",
"reexport xrpl": "reexport xahau",
"xrpl/": "xahau/",
"source xrpl": "source xahau",
};
await replaceTextInFile(filePath, replacements);
}
/**
* Replace text in generic Python or JSON files.
* @param filePath - Path to the file.
*/
async function replaceInPackage(filePath: string): Promise<void> {
const replacements: { [key: string]: string } = {
'"xrpl.js"': '"xahau.js"',
'"xrpl"': '"xahau"',
'"ripple-address-codec"': '"xahau-address-codec"',
'"ripple-binary-codec"': '"xahau-binary-codec"',
'"ripple-keypairs"': '"xahau-keypairs"',
'"file:packages/ripple-address-codec"':
'"file:packages/xahau-address-codec"',
'"file:packages/ripple-binary-codec"': '"file:packages/xahau-binary-codec"',
'"file:packages/ripple-keypairs"': '"file:packages/xahau-keypairs"',
'"file:packages/xrpl"': '"file:packages/xahau"',
};
await replaceTextInFile(filePath, replacements);
}
/**
* Replace text in generic Python or JSON files.
* @param filePath - Path to the file.
*/
async function replaceInIsomorphic(filePath: string): Promise<void> {
const replacements: { [key: string]: string } = {
'"git@github.com:XRPLF/xrpl.js.git"':
'"git@github.com:Xahaud/xahau.js.git"',
'"xrpl.js"': '"xahau.js"',
};
await replaceTextInFile(filePath, replacements);
}
/**
* Replace text in generic Python or JSON files.
* @param filePath - Path to the file.
*/
async function replaceInFile(filePath: string): Promise<void> {
const replacements: { [key: string]: string } = {
"from 'xrpl'": "from 'xahau'",
'"xrpl"': '"xahau"',
'"ripple-address-codec"': '"xahau-address-codec"',
'"ripple-binary-codec"': '"xahau-binary-codec"',
'"ripple-keypairs"': '"xahau-keypairs"',
"from xrpl": "from xahau",
"from './xrp-codec'": "from './xah-codec'",
"from './enums/xrpl-definitions'": "from './enums/xahau-definitions'",
"from '../src/enums/xrpl-definitions'":
"from '../src/enums/xahau-definitions'",
"from './xrpl-definitions-base'": "from './xahau-definitions-base'",
"from './fixtures/rippled'": "from './fixtures/xahaud'",
"`fixtures/rippled/": "`fixtures/xahaud/",
"from 'ripple-address-codec'": "from 'xahau-address-codec'",
"from 'ripple-binary-codec'": "from 'xahau-binary-codec'",
"from 'ripple-binary-codec/dist/types'":
"from 'xahau-binary-codec/dist/types'",
"from 'ripple-keypairs'": "from 'xahau-keypairs'",
"from '../fixtures/rippled'": "from '../fixtures/xahaud'",
"from '../fixtures/rippled/accountLines'":
"from '../fixtures/xahaud/accountLines'",
'"rootDir": "../../xrpl"': '"rootDir": "../../xahau"',
"../ripple-address-codec/tsconfig.json":
"../xahau-address-codec/tsconfig.json",
"../ripple-binary-codec/tsconfig.json":
"../xahau-binary-codec/tsconfig.json",
"../ripple-keypairs/tsconfig.json": "../xahau-keypairs/tsconfig.json",
"../ripple-address-codec/tsconfig.build.json":
"../xahau-address-codec/tsconfig.build.json",
"../ripple-binary-codec/tsconfig.build.json":
"../xahau-binary-codec/tsconfig.build.json",
"../ripple-keypairs/tsconfig.build.json":
"../xahau-keypairs/tsconfig.build.json",
"./getFeeXrp": "./getFeeXah",
"../../src/sugar/getFeeXrp": "../../src/sugar/getFeeXah",
"xrpl-announce": "xahau-announce",
"wss://s.altnet.rippletest.net:51233": "wss://xahau-test.net",
"wss://s.devnet.rippletest.net": "wss://jshooks.xahau-test.net",
"wss://testnet.xrpl-labs.com": "wss://xahau-test.net",
// "XRP": "XAH",
xrpToDrops: "xahToDrops",
dropsToXrp: "dropsToXah",
xrpConversion: "xahConversion",
XrplError: "XahlError",
RippledError: "XahaudError",
RippledNotInitializedError: "XahaudNotInitializedError",
XRPLFaucetError: "XAHLFaucetError",
'"xrp"': '"xah"',
'"xrpl-ledger"': '"xahau-ledger"',
'"xrp ledger"': '"xahau ledger"',
'"ripple",': '"xahau",',
"faucet.altnet.rippletest.net": "xahau-test.net/accounts",
"faucet.devnet.rippletest.net": "jshooks.xahau-test.net/accounts",
"0000000000000000000000005852500000000000":
"0000000000000000000000005841480000000000",
RIPPLED_API_V2: "XAHAUD_API_V2",
RIPPLED_API_V1: "XAHAUD_API_V1",
"export const DEFAULT_API_VERSION = XAHAUD_API_V2":
"export const DEFAULT_API_VERSION = XAHAUD_API_V1",
"api_version: 2,": "api_version: 1,",
"'XRP'": "'XAH'",
};
// const replacements: { [key: string]: string } = {
// "from xrpl": "from xahau",
// "import xrpl": "import xahau",
// "xrpl.utils": "xahau.utils",
// "xrpl.models.": "xahau.models.",
// "xrpl.core.": "xahau.core.",
// "flake8 xrpl": "flake8 xahau",
// "xrpl-announce": "xahau-announce",
// "../xrpl": "../xahau",
// "xrpllabsofficial/xrpld:1.12.0": "xahaulabsofficial/xahaud:1.12.0",
// "xrpl-py": "xahau-py",
// "https://s.altnet.rippletest.net:51234": "https://xahau-test.net",
// "https://xrplcluster.com/": "https://xahau.network",
// '_TEST_FAUCET_URL: Final[str] = "https://faucet.altnet.rippletest.net/accounts"':
// '_TEST_FAUCET_URL: Final[str] = "https://xahau-test.net/accounts"',
// '_DEV_FAUCET_URL: Final[str] = "https://faucet.devnet.rippletest.net/accounts"':
// '_DEV_FAUCET_URL: Final[str] = "https://xahau-test.net/accounts"',
// 'if "altnet" in url or "testnet" in url:':
// 'if "xahau-test" in url or "testnet" in url:',
// "https://s.devnet.rippletest.net:51234": "https://xahau-test.net",
// "wss://s.altnet.rippletest.net:51233": "wss://xahau-test.net",
// "wss://s.devnet.rippletest.net": "wss://xahau-test.net",
// "https://testnet.xrpl-labs.com": "https://xahau-test.net",
// "wss://testnet.xrpl-labs.com": "wss://xahau-test.net",
// "faucet.devnet.rippletest.net": "xahau-test.net",
// "wss://xahau-test.net:51233": "wss://xahau-test.net",
// '_DEFAULT_API_VERSION: Final[int] = 2': '_DEFAULT_API_VERSION: Final[int] = 1',
// '"xrpl.': '"xahau.',
// "XRP": "XAH",
// "xrp_to_drops": "xah_to_drops",
// "drops_to_xrp": "drops_to_xah",
// "xrp_conversions": "xah_conversions",
// // "XAHLModelException": "XRPLModelException", // Commented out as in Python
// "XRPLModelException": "XAHLModelException",
// "xahau.models.currencies.xrp": "xahau.models.currencies.xah",
// '"xrp"': '"xah"',
// "0000000000000000000000005852500000000000": "0000000000000000000000005841480000000000",
// "def test_does_account_exist_throws_for_invalid_account":
// "def _test_does_account_exist_throws_for_invalid_account",
// "def test_run_faucet_tests": "def _test_run_faucet_tests",
// // Additional replacements commented out as in Python
// // "TestAccountDelete": "NoTestAccountDelete",
// // "TestAMM": "NoTestAMM",
// // "TestClawback": "NoTestClawback",
// // "TestDeleteOracle": "NoTestDeleteOracle",
// // "TestDID": "NoTestDID",
// // "TestSetOracle": "NoTestSetOracle",
// // "TestXChain": "NoTestXChain",
// // "TestFeature": "NoTestFeature",
// };
await replaceTextInFile(filePath, replacements);
}
/**
* Search for Python and JSON files in the given folders and perform replacements.
* @param folderPaths - Array of folder paths to search.
*/
async function searchAndReplaceInFolders(folderPaths: string[]): Promise<void> {
for (const folderPath of folderPaths) {
try {
const entries = await fs.readdir(folderPath, { withFileTypes: true });
for (const entry of entries) {
const fullPath = path.join(folderPath, entry.name);
if (entry.isDirectory()) {
await searchAndReplaceInFolders([fullPath]);
} else if (
entry.isFile() &&
(fullPath.endsWith(".ts") ||
fullPath.endsWith(".js") ||
fullPath.endsWith(".json"))
) {
await replaceInFile(fullPath);
}
}
} catch (error) {
console.error(
`Error reading folder ${folderPath}: ${(error as Error).message}`
);
}
}
}
/**
* Rename a folder or file.
* @param oldName - Current name/path.
* @param newName - New name/path.
*/
async function renameItem(oldName: string, newName: string): Promise<void> {
try {
await fs.rename(oldName, newName);
console.log(`Renamed ${oldName} to ${newName}`);
} catch (error) {
console.error(
`Error renaming ${oldName} to ${newName}: ${(error as Error).message}`
);
}
}
/**
* Delete a file.
* @param fileName - Path to the file to delete.
*/
async function deleteFile(fileName: string): Promise<void> {
try {
await fs.unlink(fileName);
console.log(`Deleted file: ${fileName}`);
} catch (error) {
console.error(
`Error deleting file ${fileName}: ${(error as Error).message}`
);
}
}
/**
* Main function to execute all operations.
*/
async function main() {
// Delete Files
// await deleteFile("APPLICATIONS.md")
// Renaming folders/files
// await renameItem("packages/xrpl", "packages/xahau");
// await renameItem("packages/ripple-address-codec", "packages/xahau-address-codec");
// await renameItem("packages/ripple-binary-codec", "packages/xahau-binary-codec");
// await renameItem("packages/ripple-keypairs", "packages/xahau-keypairs");
// await renameItem(".ci-config/rippled.cfg", ".ci-config/xahaud.cfg");
// await renameItem("packages/xahau/src/utils/xrpConversion.ts", "packages/xahau/src/utils/xahConversion.ts");
// await renameItem("packages/xahau/test/utils/xrpToDrops.ts", "packages/xahau/test/utils/xahToDrops.ts");
// await renameItem("packages/xrpl/test/client/getFeeXrp.test.ts", "packages/xrpl/test/client/getFeeXah.test.ts");
// await renameItem("packages/xrpl/test/client/getXahBalance.test.ts", "packages/xrpl/test/client/getXahBalance.test.ts")
// await renameItem("packages/xahau/src/sugar/getFeeXrp.ts", "packages/xahau/src/sugar/getFeeXah.ts")
// await renameItem("packages/xahau/test/fixtures/rippled", "packages/xahau/test/fixtures/xahaud")
// // Address Codec
// await renameItem("packages/xahau-address-codec/src/xrp-codec.ts", "packages/xahau-address-codec/src/xah-codec.ts");
// await renameItem("packages/xahau-address-codec/test/xrp-codec.test.ts", "packages/xahau-address-codec/test/xah-codec.test.ts");
// // Binary Codec
// await renameItem("packages/xahau-binary-codec/src/enums/xrpl-definitions-base.ts", "packages/xahau-binary-codec/src/enums/xahau-definitions-base.ts");
// await renameItem("packages/xahau-binary-codec/src/enums/xrpl-definitions.ts", "packages/xahau-binary-codec/src/enums/xahau-definitions.ts");
await replaceInIsomorphic("package.json");
await replaceInPackage("package.json");
// // Search and replace in specified folders
const folderList: string[] = ["packages"];
await searchAndReplaceInFolders(folderList);
// await replaceInUnique("UNIQUE_SETUPS.md");
// // Perform replacements in specific files
await replaceInConfig(".ci-config/xahaud.cfg");
await replaceInContrib("CONTRIBUTING.md");
// await replaceInGitHub(".github/workflows/integration_test.yml");
// await replaceInGitHub(".github/workflows/unit_test.yml");
// await replaceInGitHub(".pre-commit-config.yaml");
// // Uncomment and use if needed
// // await replaceInPoetry(
// // "pyproject.toml",
// // ["Denis Angell <denis@xrpl-labs.com>", "Tequ <tequ@xrplf.com>"],
// // );
// await replaceInReadme("README.md");
// // Delete a specific file
// await deleteFile(".github/workflows/snippet_test.yml");
}
// Execute the main function
main().catch((error) => {
console.error(`Unexpected error: ${(error as Error).message}`);
});

11139
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
{
"name": "xahau.js",
"name": "xrpl.js",
"private": true,
"scripts": {
"analyze": "lerna run analyze --stream",
@@ -16,10 +16,10 @@
"dependencies": {
"@xrplf/isomorphic": "file:packages/isomorphic",
"@xrplf/secret-numbers": "file:packages/secret-numbers",
"xahau-address-codec": "file:packages/xahau-address-codec",
"xahau-binary-codec": "file:packages/xahau-binary-codec",
"xahau-keypairs": "file:packages/xahau-keypairs",
"xahau": "file:packages/xahau"
"ripple-address-codec": "file:packages/ripple-address-codec",
"ripple-binary-codec": "file:packages/ripple-binary-codec",
"ripple-keypairs": "file:packages/ripple-keypairs",
"xrpl": "file:packages/xrpl"
},
"devDependencies": {
"@types/chai": "^4.2.21",
@@ -58,13 +58,13 @@
"typescript": "^5.1.6",
"webpack": "^5.81.0",
"webpack-bundle-analyzer": "^4.1.0",
"webpack-cli": "^5.0.1"
"webpack-cli": "^6.0.1"
},
"workspaces": [
"./packages/*"
],
"engines": {
"node": ">=18.0.0",
"npm": ">=7.10.0 < 10.0.0"
"npm": ">=7.10.0"
}
}

View File

@@ -5,7 +5,7 @@
"keywords": [
"crypto",
"isomorphic",
"xahau"
"xrpl"
],
"scripts": {
"build": "tsc --build ./tsconfig.build.json",

View File

@@ -1,5 +1,5 @@
{
"name": "xahau-address-codec",
"name": "ripple-address-codec",
"version": "5.0.0",
"description": "encodes/decodes base58 encoded XRP Ledger identifiers",
"files": [
@@ -14,10 +14,10 @@
"@xrplf/isomorphic": "^1.0.0"
},
"keywords": [
"xahau",
"xah",
"xahau ledger",
"xahau"
"ripple",
"xrp",
"xrp ledger",
"xrpl"
],
"repository": {
"type": "git",

View File

@@ -11,7 +11,7 @@ import {
encodeAccountPublic,
decodeAccountPublic,
isValidClassicAddress,
} from './xah-codec'
} from './xrp-codec'
const PREFIX_BYTES = {
// 5, 68

View File

@@ -2,10 +2,22 @@
## Unreleased
## 2.3.0 (2025-2-13)
### Added
* Support for the AMMClawback amendment (XLS-73)
* Support for the Permissioned Domains amendment (XLS-80).
## 2.2.0 (2024-12-23)
### Added
* Support for the Multi-Purpose Token amendment (XLS-33)
## 2.1.0 (2024-06-03)
### Added
* Support for the Price Oracles amendment (XLS-47).
* Support for the `DynamicNFT` amendment (XLS-46)
### Fixed
* Better error handling/error messages for serialization/deserialization errors.

View File

@@ -1,6 +1,6 @@
{
"name": "xahau-binary-codec",
"version": "2.1.0",
"name": "ripple-binary-codec",
"version": "2.3.0",
"description": "XRP Ledger binary codec",
"files": [
"dist/*",
@@ -13,7 +13,7 @@
"dependencies": {
"@xrplf/isomorphic": "^1.0.1",
"bignumber.js": "^9.0.0",
"xahau-address-codec": "^5.0.0"
"ripple-address-codec": "^5.0.0"
},
"scripts": {
"build": "tsc --build tsconfig.build.json && copyfiles ./src/enums/definitions.json ./dist/enums/",
@@ -24,10 +24,10 @@
"lint": "eslint . --ext .ts --ext .test.js"
},
"keywords": [
"xahau",
"xah",
"xahau ledger",
"xahau"
"ripple",
"xrp",
"xrp ledger",
"xrpl"
],
"repository": {
"type": "git",

View File

@@ -3,7 +3,7 @@ import {
XrplDefinitionsBase,
FieldInstance,
Bytes,
} from './xahau-definitions-base'
} from './xrpl-definitions-base'
/**
* By default, coreTypes from the `types` folder is where known type definitions are initialized to avoid import cycles.
*/

View File

@@ -1,7 +1,7 @@
import {
type DefinitionsData,
XrplDefinitionsBase,
} from './xahau-definitions-base'
} from './xrpl-definitions-base'
import { coreTypes } from '../types'
import { SerializedType } from '../types/serialized-type'

View File

@@ -7,7 +7,7 @@ import {
TRANSACTION_TYPES,
DEFAULT_DEFINITIONS,
} from './enums'
import { XrplDefinitions } from './enums/xahau-definitions'
import { XrplDefinitions } from './enums/xrpl-definitions'
import { coreTypes } from './types'
import { bytesToHex } from '@xrplf/isomorphic/utils'

View File

@@ -3,7 +3,7 @@ import {
encodeAccountID,
isValidXAddress,
xAddressToClassicAddress,
} from 'xahau-address-codec'
} from 'ripple-address-codec'
import { Hash160 } from './hash-160'
import { hexToBytes } from '@xrplf/isomorphic/utils'

View File

@@ -6,6 +6,7 @@ import { JsonObject, SerializedType } from './serialized-type'
import BigNumber from 'bignumber.js'
import { bytesToHex, concat, hexToBytes } from '@xrplf/isomorphic/utils'
import { readUInt32BE, writeUInt32BE } from '../utils'
import { Hash192 } from './hash-192'
/**
* Constants for validating amounts
@@ -16,6 +17,7 @@ const MAX_IOU_PRECISION = 16
const MAX_DROPS = new BigNumber('1e17')
const MIN_XRP = new BigNumber('1e-6')
const mask = BigInt(0x00000000ffffffff)
const mptMask = BigInt(0x8000000000000000)
/**
* BigNumber configuration for Amount IOUs
@@ -27,20 +29,28 @@ BigNumber.config({
],
})
/**
* Interface for JSON objects that represent amounts
*/
interface AmountObject extends JsonObject {
interface AmountObjectIOU extends JsonObject {
value: string
currency: string
issuer: string
}
interface AmountObjectMPT extends JsonObject {
value: string
mpt_issuance_id: string
}
/**
* Type guard for AmountObject
* Interface for JSON objects that represent amounts
*/
function isAmountObject(arg): arg is AmountObject {
type AmountObject = AmountObjectIOU | AmountObjectMPT
/**
* Type guard for AmountObjectIOU
*/
function isAmountObjectIOU(arg): arg is AmountObjectIOU {
const keys = Object.keys(arg).sort()
return (
keys.length === 3 &&
keys[0] === 'currency' &&
@@ -49,6 +59,17 @@ function isAmountObject(arg): arg is AmountObject {
)
}
/**
* Type guard for AmountObjectMPT
*/
function isAmountObjectMPT(arg): arg is AmountObjectMPT {
const keys = Object.keys(arg).sort()
return (
keys.length === 2 && keys[0] === 'mpt_issuance_id' && keys[1] === 'value'
)
}
/**
* Class for serializing/Deserializing Amounts
*/
@@ -60,7 +81,7 @@ class Amount extends SerializedType {
}
/**
* Construct an amount from an IOU or string amount
* Construct an amount from an IOU, MPT or string amount
*
* @param value An Amount, object representing an IOU, or a string
* representing an integer amount
@@ -88,7 +109,7 @@ class Amount extends SerializedType {
return new Amount(amount)
}
if (isAmountObject(value)) {
if (isAmountObjectIOU(value)) {
const number = new BigNumber(value.value)
Amount.assertIouIsValid(number)
@@ -124,6 +145,24 @@ class Amount extends SerializedType {
return new Amount(concat([amount, currency, issuer]))
}
if (isAmountObjectMPT(value)) {
Amount.assertMptIsValid(value.value)
let leadingByte = new Uint8Array(1)
leadingByte[0] |= 0x60
const num = BigInt(value.value)
const intBuf = [new Uint8Array(4), new Uint8Array(4)]
writeUInt32BE(intBuf[0], Number(num >> BigInt(32)), 0)
writeUInt32BE(intBuf[1], Number(num & BigInt(mask)), 0)
amount = concat(intBuf)
const mptIssuanceID = Hash192.from(value.mpt_issuance_id).toBytes()
return new Amount(concat([leadingByte, amount, mptIssuanceID]))
}
throw new Error('Invalid type to construct an Amount')
}
@@ -134,8 +173,12 @@ class Amount extends SerializedType {
* @returns An Amount object
*/
static fromParser(parser: BinaryParser): Amount {
const isXRP = parser.peek() & 0x80
const numBytes = isXRP ? 48 : 8
const isIOU = parser.peek() & 0x80
if (isIOU) return new Amount(parser.read(48))
// the amount can be either MPT or XRP at this point
const isMPT = parser.peek() & 0x20
const numBytes = isMPT ? 33 : 8
return new Amount(parser.read(numBytes))
}
@@ -156,7 +199,9 @@ class Amount extends SerializedType {
const num = (msb << BigInt(32)) | lsb
return `${sign}${num.toString()}`
} else {
}
if (this.isIOU()) {
const parser = new BinaryParser(this.toString())
const mantissa = parser.read(8)
const currency = Currency.fromParser(parser) as Currency
@@ -182,6 +227,27 @@ class Amount extends SerializedType {
issuer: issuer.toJSON(),
}
}
if (this.isMPT()) {
const parser = new BinaryParser(this.toString())
const leadingByte = parser.read(1)
const amount = parser.read(8)
const mptID = Hash192.fromParser(parser) as Hash192
const isPositive = leadingByte[0] & 0x40
const sign = isPositive ? '' : '-'
const msb = BigInt(readUInt32BE(amount.slice(0, 4), 0))
const lsb = BigInt(readUInt32BE(amount.slice(4), 0))
const num = (msb << BigInt(32)) | lsb
return {
value: `${sign}${num.toString()}`,
mpt_issuance_id: mptID.toString(),
}
}
throw new Error('Invalid amount to construct JSON')
}
/**
@@ -224,6 +290,29 @@ class Amount extends SerializedType {
}
}
/**
* Validate MPT.value amount
*
* @param decimal BigNumber object representing MPT.value
* @returns void, but will throw if invalid amount
*/
private static assertMptIsValid(amount: string): void {
if (amount.indexOf('.') !== -1) {
throw new Error(`${amount.toString()} is an illegal amount`)
}
const decimal = new BigNumber(amount)
if (!decimal.isZero()) {
if (decimal < BigNumber(0)) {
throw new Error(`${amount.toString()} is an illegal amount`)
}
if (Number(BigInt(amount) & BigInt(mptMask)) != 0) {
throw new Error(`${amount.toString()} is an illegal amount`)
}
}
}
/**
* Ensure that the value after being multiplied by the exponent does not
* contain a decimal.
@@ -248,7 +337,25 @@ class Amount extends SerializedType {
* @returns true if Native (XRP)
*/
private isNative(): boolean {
return (this.bytes[0] & 0x80) === 0
return (this.bytes[0] & 0x80) === 0 && (this.bytes[0] & 0x20) === 0
}
/**
* Test if this amount is in units of MPT
*
* @returns true if MPT
*/
private isMPT(): boolean {
return (this.bytes[0] & 0x80) === 0 && (this.bytes[0] & 0x20) !== 0
}
/**
* Test if this amount is in units of IOU
*
* @returns true if IOU
*/
private isIOU(): boolean {
return (this.bytes[0] & 0x80) !== 0
}
}

View File

@@ -12,7 +12,7 @@ const STANDARD_FORMAT_HEX_REGEX = /^0{24}[\x00-\x7F]{6}0{10}$/
*/
function isoToBytes(iso: string): Uint8Array {
const bytes = new Uint8Array(20)
if (iso !== 'XAH') {
if (iso !== 'XRP') {
const isoBytes = iso.split('').map((c) => c.charCodeAt(0))
bytes.set(isoBytes, 12)
}
@@ -28,7 +28,7 @@ function isIsoCode(iso: string): boolean {
function isoCodeFromHex(code: Uint8Array): string | null {
const iso = hexToString(bytesToHex(code))
if (iso === 'XAH') {
if (iso === 'XRP') {
return null
}
if (isIsoCode(iso)) {
@@ -89,7 +89,7 @@ class Currency extends Hash160 {
const hex = bytesToHex(this.bytes)
if (XRP_HEX_REGEX.test(hex)) {
this._iso = 'XAH'
this._iso = 'XRP'
} else if (STANDARD_FORMAT_HEX_REGEX.test(hex)) {
this._iso = isoCodeFromHex(this.bytes.slice(12, 15))
} else {

View File

@@ -0,0 +1,19 @@
import { Hash } from './hash'
/**
* Hash with a width of 192 bits
*/
class Hash192 extends Hash {
static readonly width = 24
static readonly ZERO_192: Hash192 = new Hash192(new Uint8Array(Hash192.width))
constructor(bytes?: Uint8Array) {
if (bytes && bytes.byteLength === 0) {
bytes = Hash192.ZERO_192.bytes
}
super(bytes ?? Hash192.ZERO_192.bytes)
}
}
export { Hash192 }

View File

@@ -4,6 +4,7 @@ import { Blob } from './blob'
import { Currency } from './currency'
import { Hash128 } from './hash-128'
import { Hash160 } from './hash-160'
import { Hash192 } from './hash-192'
import { Hash256 } from './hash-256'
import { Issue } from './issue'
import { PathSet } from './path-set'
@@ -25,6 +26,7 @@ const coreTypes: Record<string, typeof SerializedType> = {
Currency,
Hash128,
Hash160,
Hash192,
Hash256,
Issue,
PathSet,
@@ -51,6 +53,7 @@ export {
Currency,
Hash128,
Hash160,
Hash192,
Hash256,
PathSet,
STArray,

View File

@@ -66,7 +66,7 @@ class Issue extends SerializedType {
*/
static fromParser(parser: BinaryParser): Issue {
const currency = parser.read(20)
if (new Currency(currency).toJSON() === 'XAH') {
if (new Currency(currency).toJSON() === 'XRP') {
return new Issue(currency)
}
const currencyAndIssuer = [currency, parser.read(20)]
@@ -81,7 +81,7 @@ class Issue extends SerializedType {
toJSON(): IssueObject {
const parser = new BinaryParser(this.toString())
const currency = Currency.fromParser(parser) as Currency
if (currency.toJSON() === 'XAH') {
if (currency.toJSON() === 'XRP') {
return { currency: currency.toJSON() }
}
const issuer = AccountID.fromParser(parser) as AccountID

View File

@@ -67,7 +67,7 @@ class SerializedType {
* Can be customized for sidechains and amendments.
* @returns any type, if not overloaded returns hexString representation of bytes
*/
toJSON(_definitions?: XrplDefinitionsBase): JSON {
toJSON(_definitions?: XrplDefinitionsBase, _fieldName?: string): JSON {
return this.toHex()
}

View File

@@ -5,11 +5,12 @@ import {
XrplDefinitionsBase,
} from '../enums'
import { SerializedType, JsonObject } from './serialized-type'
import { xAddressToClassicAddress, isValidXAddress } from 'xahau-address-codec'
import { xAddressToClassicAddress, isValidXAddress } from 'ripple-address-codec'
import { BinaryParser } from '../serdes/binary-parser'
import { BinarySerializer, BytesList } from '../serdes/binary-serializer'
import { STArray } from './st-array'
import { UInt64 } from './uint-64'
const OBJECT_END_MARKER_BYTE = Uint8Array.from([0xe1])
const OBJECT_END_MARKER = 'ObjectEndMarker'
@@ -137,6 +138,8 @@ class STObject extends SerializedType {
? this.from(xAddressDecoded[field.name], undefined, definitions)
: field.type.name === 'STArray'
? STArray.from(xAddressDecoded[field.name], definitions)
: field.type.name === 'UInt64'
? UInt64.from(xAddressDecoded[field.name], field.name)
: field.associatedType.from(xAddressDecoded[field.name])
if (associatedValue == undefined) {
@@ -182,7 +185,7 @@ class STObject extends SerializedType {
accumulator[field.name] = objectParser
.readFieldValue(field)
.toJSON(definitions)
.toJSON(definitions, field.name)
}
return accumulator

View File

@@ -2,10 +2,20 @@ import { UInt } from './uint'
import { BinaryParser } from '../serdes/binary-parser'
import { bytesToHex, concat, hexToBytes } from '@xrplf/isomorphic/utils'
import { readUInt32BE, writeUInt32BE } from '../utils'
import { DEFAULT_DEFINITIONS, XrplDefinitionsBase } from '../enums'
const HEX_REGEX = /^[a-fA-F0-9]{1,16}$/
const BASE10_REGEX = /^[0-9]{1,20}$/
const mask = BigInt(0x00000000ffffffff)
function useBase10(fieldName: string): boolean {
return (
fieldName === 'MaximumAmount' ||
fieldName === 'OutstandingAmount' ||
fieldName === 'MPTAmount'
)
}
/**
* Derived UInt class for serializing/deserializing 64 bit UInt
*/
@@ -29,7 +39,10 @@ class UInt64 extends UInt {
* @param val A UInt64, hex-string, bigInt, or number
* @returns A UInt64 object
*/
static from<T extends UInt64 | string | bigint | number>(val: T): UInt64 {
static from<T extends UInt64 | string | bigint | number>(
val: T,
fieldName = '',
): UInt64 {
if (val instanceof UInt64) {
return val
}
@@ -51,11 +64,18 @@ class UInt64 extends UInt {
}
if (typeof val === 'string') {
if (!HEX_REGEX.test(val)) {
if (useBase10(fieldName)) {
if (!BASE10_REGEX.test(val)) {
throw new Error(`${fieldName} ${val} is not a valid base 10 string`)
}
val = BigInt(val).toString(16) as T
}
if (typeof val === 'string' && !HEX_REGEX.test(val)) {
throw new Error(`${val} is not a valid hex-string`)
}
const strBuf = val.padStart(16, '0')
const strBuf = (val as string).padStart(16, '0')
buf = hexToBytes(strBuf)
return new UInt64(buf)
}
@@ -76,8 +96,16 @@ class UInt64 extends UInt {
*
* @returns a hex-string
*/
toJSON(): string {
return bytesToHex(this.bytes)
toJSON(
_definitions: XrplDefinitionsBase = DEFAULT_DEFINITIONS,
fieldName = '',
): string {
const hexString = bytesToHex(this.bytes)
if (useBase10(fieldName)) {
return BigInt('0x' + hexString).toString(10)
}
return hexString
}
/**

View File

@@ -0,0 +1,84 @@
import { coreTypes } from '../src/types'
import fixtures from './fixtures/data-driven-tests.json'
import { makeParser } from '../src/binary'
const { Amount } = coreTypes
function amountErrorTests() {
fixtures.values_tests
.filter((obj) => obj.type === 'Amount')
.forEach((f) => {
// We only want these with errors
if (!f.error) {
return
}
const testName =
`${JSON.stringify(f.test_json)}\n\tis invalid ` + `because: ${f.error}`
it(testName, () => {
expect(() => {
Amount.from(f.test_json)
JSON.stringify(f.test_json)
}).toThrow()
})
})
}
describe('Amount', function () {
it('can be parsed from', function () {
expect(Amount.from('1000000') instanceof Amount).toBe(true)
expect(Amount.from('1000000').toJSON()).toEqual('1000000')
// it not valid to have negative XRP. But we test it anyways
// to ensure logic correctness for toJSON of the Amount class
{
const parser = makeParser('0000000000000001')
const value = parser.readType(Amount)
const json = value.toJSON()
expect(json).toEqual('-1')
}
const fixture = {
value: '1',
issuer: '0000000000000000000000000000000000000000',
currency: 'USD',
}
const amt = Amount.from(fixture)
const rewritten = {
value: '1',
issuer: 'rrrrrrrrrrrrrrrrrrrrrhoLvTp',
currency: 'USD',
}
expect(amt.toJSON()).toEqual(rewritten)
})
it('can be parsed from MPT', function () {
let fixture = {
value: '100',
mpt_issuance_id: '00002403C84A0A28E0190E208E982C352BBD5006600555CF',
}
let amt = Amount.from(fixture)
expect(amt.toJSON()).toEqual(fixture)
fixture = {
value: '9223372036854775807',
mpt_issuance_id: '00002403C84A0A28E0190E208E982C352BBD5006600555CF',
}
amt = Amount.from(fixture)
expect(amt.toJSON()).toEqual(fixture)
// it not valid to have negative MPT. But we test it anyways
// to ensure logic correctness for toJSON of the Amount class
{
const parser = makeParser(
'20000000000000006400002403C84A0A28E0190E208E982C352BBD5006600555CF',
)
const value = parser.readType(Amount)
const json = value.toJSON()
expect(json).toEqual({
mpt_issuance_id: '00002403C84A0A28E0190E208E982C352BBD5006600555CF',
value: '-100',
})
}
})
amountErrorTests()
})

View File

@@ -1,6 +1,5 @@
import fixtures from './fixtures/codec-fixtures.json'
// import { decode, encode, decodeLedgerData } from '../src'
import { decode, encode } from '../src'
import { decode, encode, decodeLedgerData } from '../src'
function json(object) {
return JSON.stringify(object)
@@ -31,17 +30,16 @@ describe('ripple-binary-codec', function () {
makeSuite('transactions', fixtures.transactions)
makeSuite('accountState', fixtures.accountState)
// describe('ledgerData', function () {
// console.log(fixtures)
// if (fixtures.ledgerData) {
// fixtures.ledgerData.forEach((t, testN) => {
// it(`ledgerData[${testN}] can decode ${t.binary} to ${json(
// t.json,
// )}`, () => {
// const decoded = decodeLedgerData(t.binary)
// expect(t.json).toEqual(decoded)
// })
// })
// }
// })
describe('ledgerData', function () {
if (fixtures.ledgerData) {
fixtures.ledgerData.forEach((t, testN) => {
it(`ledgerData[${testN}] can decode ${t.binary} to ${json(
t.json,
)}`, () => {
const decoded = decodeLedgerData(t.binary)
expect(t.json).toEqual(decoded)
})
})
}
})
})

View File

@@ -2,7 +2,7 @@ import { hexOnly } from './utils'
import { coreTypes, Amount, Hash160 } from '../src/types'
import BigNumber from 'bignumber.js'
import { encodeAccountID } from 'xahau-address-codec'
import { encodeAccountID } from 'ripple-address-codec'
import { Field, TransactionType } from '../src/enums'
import { makeParser, readJSON } from '../src/binary'
import { BytesList } from '../src/serdes/binary-serializer'
@@ -22,6 +22,7 @@ function assertEqualAmountJSON(actual, expected) {
}
expect(actual.currency).toEqual(expected.currency)
expect(actual.issuer).toEqual(expected.issuer)
expect(actual.mpt_issuance_id).toEqual(expected.mpt_issuance_id)
expect(
actual.value === expected.value ||
new BigNumber(actual.value).eq(new BigNumber(expected.value)),
@@ -207,12 +208,12 @@ function amountParsingTests() {
return
}
const parser = makeParser(f.expected_hex)
const testName = `values_tests[${i}] parses ${f.expected_hex.slice(
const hexToJsonTestName = `values_tests[${i}] parses ${f.expected_hex.slice(
0,
16,
)}...
as ${JSON.stringify(f.test_json)}`
it(testName, () => {
it(hexToJsonTestName, () => {
const value = parser.readType(Amount)
// May not actually be in canonical form. The fixtures are to be used
// also for json -> binary;
@@ -223,6 +224,15 @@ function amountParsingTests() {
expect((exponent.e ?? 0) - 15).toEqual(f?.exponent)
}
})
const jsonToHexTestName = `values_tests[${i}] parses ${JSON.stringify(
f.test_json,
)}...
as ${f.expected_hex.slice(0, 16)}`
it(jsonToHexTestName, () => {
const amt = Amount.from(f.test_json)
expect(amt.toHex()).toEqual(f.expected_hex)
})
})
}
@@ -387,7 +397,7 @@ function pathSetBinaryTests() {
currency: 'BTC',
issuer: 'r3AWbdp2jQLXLywJypdoNwVSvr81xs3uhn',
},
{ currency: 'XAH' },
{ currency: 'XRP' },
{
currency: 'USD',
issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B',

View File

@@ -4449,6 +4449,469 @@
"Flags": 0,
"Sequence": 62
}
},
{
"binary": "1200302200000000240000000168400000000000000A601D40000000000003E8601E400000000000271073210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020744630440220101BCA4B5B5A37C6F44480F9A34752C9AA8B2CDF5AD47E3CB424DEDC21C06DB702206EEB257E82A89B1F46A0A2C7F070B0BD181D980FF86FE4269E369F6FC7A270918114B5F762798A53D543A014CAF8B297CFF8F2F937E8011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000",
"json": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"XChainBridge": {
"LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL",
"LockingChainIssue": {"currency": "XRP"},
"IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
"IssuingChainIssue": {"currency": "XRP"}
},
"Fee": "10",
"Flags": 0,
"MinAccountCreateAmount": "10000",
"Sequence": 1,
"SignatureReward": "1000",
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType": "XChainCreateBridge",
"TxnSignature": "30440220101BCA4B5B5A37C6F44480F9A34752C9AA8B2CDF5AD47E3CB424DEDC21C06DB702206EEB257E82A89B1F46A0A2C7F070B0BD181D980FF86FE4269E369F6FC7A27091"
}
},
{
"binary": "12002F2200000000240000000168400000000000000A601D40000000000003E8601E400000000000271073210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074473045022100D2CABC1B0E0635A8EE2E6554F6D474C49BC292C995C5C9F83179F4A60634B04C02205D1DB569D9593136F2FBEA7140010C8F46794D653AFDBEA8D30B8750BA4805E58114B5F762798A53D543A014CAF8B297CFF8F2F937E8011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000",
"json": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"XChainBridge": {
"LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL",
"LockingChainIssue": {"currency": "XRP"},
"IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
"IssuingChainIssue": {"currency": "XRP"}
},
"Fee": "10",
"Flags": 0,
"MinAccountCreateAmount": "10000",
"Sequence": 1,
"SignatureReward": "1000",
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType": "XChainModifyBridge",
"TxnSignature": "3045022100D2CABC1B0E0635A8EE2E6554F6D474C49BC292C995C5C9F83179F4A60634B04C02205D1DB569D9593136F2FBEA7140010C8F46794D653AFDBEA8D30B8750BA4805E5"
}
},
{
"binary": "1200292280000000240000000168400000000000000A601D400000000000271073210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020744630440220247B20A1B9C48E21A374CB9B3E1FE2A7C528151868DF8D307E9FBE15237E531A02207C20C092DDCC525E583EF4AB7CB91E862A6DED19426997D3F0A2C84E2BE8C5DD8114B5F762798A53D543A014CAF8B297CFF8F2F937E8801214AF80285F637EE4AF3C20378F9DFB12511ACB8D27011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000",
"json": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"XChainBridge": {
"LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL",
"LockingChainIssue": {"currency": "XRP"},
"IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
"IssuingChainIssue": {"currency": "XRP"}
},
"Fee": "10",
"Flags": 2147483648,
"OtherChainSource": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL",
"Sequence": 1,
"SignatureReward": "10000",
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType": "XChainCreateClaimID",
"TxnSignature": "30440220247B20A1B9C48E21A374CB9B3E1FE2A7C528151868DF8D307E9FBE15237E531A02207C20C092DDCC525E583EF4AB7CB91E862A6DED19426997D3F0A2C84E2BE8C5DD"
}
},
{
"binary": "12002A228000000024000000013014000000000000000161400000000000271068400000000000000A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074453043021F177323F0D93612C82A4393A99B23905A7E675753FD80C52997AFAB13F5F9D002203BFFAF457E90BDA65AABE8F8762BD96162FAD98A0C030CCD69B06EE9B12BBFFE8114B5F762798A53D543A014CAF8B297CFF8F2F937E8011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000",
"json": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Amount": "10000",
"XChainBridge": {
"LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL",
"LockingChainIssue": {"currency": "XRP"},
"IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
"IssuingChainIssue": {"currency": "XRP"}
},
"Fee": "10",
"Flags": 2147483648,
"Sequence": 1,
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType": "XChainCommit",
"TxnSignature": "3043021F177323F0D93612C82A4393A99B23905A7E675753FD80C52997AFAB13F5F9D002203BFFAF457E90BDA65AABE8F8762BD96162FAD98A0C030CCD69B06EE9B12BBFFE",
"XChainClaimID": "0000000000000001"
}
},
{
"binary": "12002B228000000024000000013014000000000000000161400000000000271068400000000000000A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020744630440220445F7469FDA401787D9EE8A9B6E24DFF81E94F4C09FD311D2C0A58FCC02C684A022029E2EF34A5EA35F50D5BB57AC6320AD3AE12C13C8D1379B255A486D72CED142E8114B5F762798A53D543A014CAF8B297CFF8F2F937E88314550FC62003E785DC231A1058A05E56E3F09CF4E6011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000",
"json": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Amount": "10000",
"XChainBridge": {
"LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL",
"LockingChainIssue": {"currency": "XRP"},
"IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
"IssuingChainIssue": {"currency": "XRP"}
},
"Destination": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
"Fee": "10",
"Flags": 2147483648,
"Sequence": 1,
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType": "XChainClaim",
"TxnSignature": "30440220445F7469FDA401787D9EE8A9B6E24DFF81E94F4C09FD311D2C0A58FCC02C684A022029E2EF34A5EA35F50D5BB57AC6320AD3AE12C13C8D1379B255A486D72CED142E",
"XChainClaimID": "0000000000000001"
}
},
{
"binary": "12002C228000000024000000016140000000000F424068400000000000000A601D400000000000271073210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD0207446304402202984DDE7F0B566F081F7953D7212BF031ACBF8860FE114102E9512C4C8768C77022070113F4630B1DC3045E4A98DDD648CEBC31B12774F7B44A1B8123CD2C9F5CF188114B5F762798A53D543A014CAF8B297CFF8F2F937E88314AF80285F637EE4AF3C20378F9DFB12511ACB8D27011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000",
"json": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"XChainBridge": {
"LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL",
"LockingChainIssue": {"currency": "XRP"},
"IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV",
"IssuingChainIssue": {"currency": "XRP"}
},
"Amount": "1000000",
"Fee": "10",
"Flags": 2147483648,
"Destination": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL",
"Sequence": 1,
"SignatureReward": "10000",
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType": "XChainAccountCreateCommit",
"TxnSignature": "304402202984DDE7F0B566F081F7953D7212BF031ACBF8860FE114102E9512C4C8768C77022070113F4630B1DC3045E4A98DDD648CEBC31B12774F7B44A1B8123CD2C9F5CF18"
}
},
{
"binary": "12002E2400000005201B0000000D30150000000000000006614000000000989680684000000000000014601D40000000000000647121ED1F4A024ACFEBDB6C7AA88DEDE3364E060487EA31B14CC9E0D610D152B31AADC27321EDF54108BA2E0A0D3DC2AE3897F8BE0EFE776AE8D0F9FB0D0B9D64233084A8DDD1744003E74AEF1F585F156786429D2FC87A89E5C6B5A56D68BFC9A6A329F3AC67CBF2B6958283C663A4522278CA162C69B23CF75149AF022B410EA0508C16F42058007640EEFCFA3DC2AB4AB7C4D2EBBC168CB621A11B82BABD86534DFC8EFA72439A49662D744073CD848E7A587A95B35162CDF9A69BB237E72C9537A987F5B8C394F30D81145E7A3E3D7200A794FA801C66CE3775B6416EE4128314C15F113E49BCC4B9FFF43CD0366C23ACD82F75638012143FD9ED9A79DEA67CB5D585111FEF0A29203FA0408014145E7A3E3D7200A794FA801C66CE3775B6416EE4128015145E7A3E3D7200A794FA801C66CE3775B6416EE4120010130101191486F0B1126CE1205E59FDFDD2661A9FB7505CA70F000000000000000000000000000000000000000014B5F762798A53D543A014CAF8B297CFF8F2F937E80000000000000000000000000000000000000000",
"json": {
"Account": "r9cYxdjQsoXAEz3qQJc961SNLaXRkWXCvT",
"Amount": "10000000",
"AttestationRewardAccount": "r9cYxdjQsoXAEz3qQJc961SNLaXRkWXCvT",
"AttestationSignerAccount": "r9cYxdjQsoXAEz3qQJc961SNLaXRkWXCvT",
"Destination": "rJdTJRJZ6GXCCRaamHJgEqVzB7Zy4557Pi",
"Fee": "20",
"LastLedgerSequence": 13,
"OtherChainSource": "raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym",
"PublicKey": "ED1F4A024ACFEBDB6C7AA88DEDE3364E060487EA31B14CC9E0D610D152B31AADC2",
"Sequence": 5,
"Signature": "EEFCFA3DC2AB4AB7C4D2EBBC168CB621A11B82BABD86534DFC8EFA72439A49662D744073CD848E7A587A95B35162CDF9A69BB237E72C9537A987F5B8C394F30D",
"SignatureReward": "100",
"SigningPubKey": "EDF54108BA2E0A0D3DC2AE3897F8BE0EFE776AE8D0F9FB0D0B9D64233084A8DDD1",
"TransactionType": "XChainAddAccountCreateAttestation",
"TxnSignature": "03E74AEF1F585F156786429D2FC87A89E5C6B5A56D68BFC9A6A329F3AC67CBF2B6958283C663A4522278CA162C69B23CF75149AF022B410EA0508C16F4205800",
"WasLockingChainSend": 1,
"XChainAccountCreateCount": "0000000000000006",
"XChainBridge": {
"IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"IssuingChainIssue": {
"currency": "XRP"
},
"LockingChainDoor": "rDJVtEuDKr4rj1B3qtW7R5TVWdXV2DY7Qg",
"LockingChainIssue": {
"currency": "XRP"
}
}
}
},
{
"binary": "12002D2400000009201B00000013301400000000000000016140000000009896806840000000000000147121ED7541DEC700470F54276C90C333A13CDBB5D341FD43C60CEA12170F6D6D4E11367321ED0406B134786FE0751717226657F7BF8AFE96442C05D28ACEC66FB64852BA604C7440D0423649E48A44F181262CF5FC08A68E7FA5CD9E55843E4F09014B76E602574741E8553383A4B43CABD194BB96713647FC0B885BE248E4FFA068FA3E6994CF0476407C175050B08000AD35EEB2D87E16CD3F95A0AEEBF2A049474275153D9D4DD44528FE99AA50E71660A15B0B768E1B90E609BBD5DC7AFAFD45D9705D72D40EA10C81141F30A4D728AB98B0950EC3B9815E6C8D43A7D5598314C15F113E49BCC4B9FFF43CD0366C23ACD82F75638012143FD9ED9A79DEA67CB5D585111FEF0A29203FA0408014141F30A4D728AB98B0950EC3B9815E6C8D43A7D5598015141F30A4D728AB98B0950EC3B9815E6C8D43A7D5590010130101191486F0B1126CE1205E59FDFDD2661A9FB7505CA70F000000000000000000000000000000000000000014B5F762798A53D543A014CAF8B297CFF8F2F937E80000000000000000000000000000000000000000",
"json": {
"Account": "rsqvD8WFFEBBv4nztpoW9YYXJ7eRzLrtc3",
"Amount": "10000000",
"AttestationRewardAccount": "rsqvD8WFFEBBv4nztpoW9YYXJ7eRzLrtc3",
"AttestationSignerAccount": "rsqvD8WFFEBBv4nztpoW9YYXJ7eRzLrtc3",
"Destination": "rJdTJRJZ6GXCCRaamHJgEqVzB7Zy4557Pi",
"Fee": "20",
"LastLedgerSequence": 19,
"OtherChainSource": "raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym",
"PublicKey": "ED7541DEC700470F54276C90C333A13CDBB5D341FD43C60CEA12170F6D6D4E1136",
"Sequence": 9,
"Signature": "7C175050B08000AD35EEB2D87E16CD3F95A0AEEBF2A049474275153D9D4DD44528FE99AA50E71660A15B0B768E1B90E609BBD5DC7AFAFD45D9705D72D40EA10C",
"SigningPubKey": "ED0406B134786FE0751717226657F7BF8AFE96442C05D28ACEC66FB64852BA604C",
"TransactionType": "XChainAddClaimAttestation",
"TxnSignature": "D0423649E48A44F181262CF5FC08A68E7FA5CD9E55843E4F09014B76E602574741E8553383A4B43CABD194BB96713647FC0B885BE248E4FFA068FA3E6994CF04",
"WasLockingChainSend": 1,
"XChainBridge": {
"IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"IssuingChainIssue": {
"currency": "XRP"
},
"LockingChainDoor": "rDJVtEuDKr4rj1B3qtW7R5TVWdXV2DY7Qg",
"LockingChainIssue": {
"currency": "XRP"
}
},
"XChainClaimID": "0000000000000001"
}
},
{
"binary": "12002315000A2200000000240015DAE161400000000000271068400000000000000A6BD5838D7EA4C680000000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C7321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B87440B3154D968314FCEB58001E1B0C3A4CFB33DF9FF6C73207E5EAEB9BD07E2747672168E1A2786D950495C38BD8DEE3391BF45F3008DD36F4B12E7C07D82CA5250E8114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A",
"json": {
"Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw",
"TransactionType": "AMMCreate",
"TxnSignature": "B3154D968314FCEB58001E1B0C3A4CFB33DF9FF6C73207E5EAEB9BD07E2747672168E1A2786D950495C38BD8DEE3391BF45F3008DD36F4B12E7C07D82CA5250E",
"Amount": "10000",
"Amount2": {
"currency": "ETH",
"issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9",
"value": "10000"
},
"TradingFee": 10,
"Fee": "10",
"Flags": 0,
"Sequence": 1432289,
"SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8"
}
},
{
"binary": "1200242200010000240015DAE168400000000000000A6019D5438D7EA4C68000B3813FCAB4EE68B3D0D735D6849465A9113EE048B3813FCAB4EE68B3D0D735D6849465A9113EE0487321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B874408073C588E7EF672DD171E414638D9AF8DBE9A1359E030DE3E1C9AA6A38A2CE9E138CB56482BB844F7228D48B1E4AD7D09BB7E9F639C115958EEEA374749CA00B8114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C",
"json": {
"Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw",
"TransactionType": "AMMDeposit",
"TxnSignature": "8073C588E7EF672DD171E414638D9AF8DBE9A1359E030DE3E1C9AA6A38A2CE9E138CB56482BB844F7228D48B1E4AD7D09BB7E9F639C115958EEEA374749CA00B",
"Asset": {"currency": "XRP"},
"Asset2": {"currency": "ETH", "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9"},
"LPTokenOut": {"currency": "B3813FCAB4EE68B3D0D735D6849465A9113EE048", "issuer": "rH438jEAzTs5PYtV6CHZqpDpwCKQmPW9Cg", "value": "1000"},
"Fee": "10",
"Flags": 65536,
"Sequence": 1432289,
"SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8"
}
},
{
"binary": "1200242200080000240015DAE16140000000000003E868400000000000000A7321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8744096CA066F42871C55088D2758D64148921B1ACAA5C6C648D0F7D675BBF47F87DF711F17C5BD172666D5AEC257520C587A849A6E063345609D91E121A78816EB048114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C",
"json": {
"Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw",
"TransactionType": "AMMDeposit",
"Asset": {"currency": "XRP"},
"Asset2": {"currency": "ETH", "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9"},
"Amount": "1000",
"Fee": "10",
"Flags": 524288,
"Sequence": 1432289,
"SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8",
"TxnSignature": "96CA066F42871C55088D2758D64148921B1ACAA5C6C648D0F7D675BBF47F87DF711F17C5BD172666D5AEC257520C587A849A6E063345609D91E121A78816EB04"
}
},
{
"binary": "1200242200100000240015DAE16140000000000003E868400000000000000A6BD511C37937E080000000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C7321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B87440FC22B16A098C236ED7EDB3EBC983026DFD218A03C8BAA848F3E1D5389D5B8B00473C1178C5BA257BFA2DCD433C414690A430A5CFD71C1C0A7F7BF725EC1759018114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C",
"json": {
"Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw",
"TransactionType": "AMMDeposit",
"Asset": {"currency": "XRP"},
"Asset2": {"currency": "ETH", "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9"},
"Amount": "1000",
"Amount2": {"currency": "ETH", "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9", "value": "500"},
"Fee": "10",
"Flags": 1048576,
"Sequence": 1432289,
"SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8",
"TxnSignature": "FC22B16A098C236ED7EDB3EBC983026DFD218A03C8BAA848F3E1D5389D5B8B00473C1178C5BA257BFA2DCD433C414690A430A5CFD71C1C0A7F7BF725EC175901"
}
},
{
"binary": "1200242200200000240015DAE16140000000000003E868400000000000000A6019D5438D7EA4C68000B3813FCAB4EE68B3D0D735D6849465A9113EE048B3813FCAB4EE68B3D0D735D6849465A9113EE0487321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B87440117CF90F9B113AD3BD638B6DB63562B37C287D5180F278B3CCF58FC14A5BAEE98307EA0F6DFE19E2FBA887C92955BA5D1A04F92ADAAEB309DE89C3610D074C098114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C",
"json": {
"Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw",
"TransactionType": "AMMDeposit",
"Asset": {"currency": "XRP"},
"Asset2": {"currency": "ETH", "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9"},
"Amount": "1000",
"LPTokenOut": {"currency": "B3813FCAB4EE68B3D0D735D6849465A9113EE048", "issuer": "rH438jEAzTs5PYtV6CHZqpDpwCKQmPW9Cg", "value": "1000"},
"Fee": "10",
"Flags": 2097152,
"Sequence": 1432289,
"SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8",
"TxnSignature": "117CF90F9B113AD3BD638B6DB63562B37C287D5180F278B3CCF58FC14A5BAEE98307EA0F6DFE19E2FBA887C92955BA5D1A04F92ADAAEB309DE89C3610D074C09"
}
},
{
"binary": "1200242200400000240015DAE16140000000000003E868400000000000000A601B40000000000000197321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B874405E51EBC6B52A7C3BA5D0AE2FC8F62E779B80182009B3108A87AB6D770D68F56053C193DB0640128E4765565970625B1E2878E116AC854E6DED412202CCDE0B0D8114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C",
"json": {
"Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw",
"TransactionType": "AMMDeposit",
"Asset": {"currency": "XRP"},
"Asset2": {"currency": "ETH", "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9"},
"Amount": "1000",
"EPrice": "25",
"Fee": "10",
"Flags": 4194304,
"Sequence": 1432289,
"SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8",
"TxnSignature": "5E51EBC6B52A7C3BA5D0AE2FC8F62E779B80182009B3108A87AB6D770D68F56053C193DB0640128E4765565970625B1E2878E116AC854E6DED412202CCDE0B0D"
}
},
{
"binary": "1200252200010000240015DAE168400000000000000A601AD5438D7EA4C68000B3813FCAB4EE68B3D0D735D6849465A9113EE048B3813FCAB4EE68B3D0D735D6849465A9113EE0487321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B874409D4F41FC452526C0AD17191959D9B6D04A3C73B3A6C29E0F34C8459675A83A7A7D6E3021390EC8C9BE6C93E11C167E12016465E523F64F9EB3194B0A52E418028114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C",
"json": {
"Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw",
"TransactionType": "AMMWithdraw",
"Asset": {"currency": "XRP"},
"Asset2": {"currency": "ETH", "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9"},
"LPTokenIn": {"currency": "B3813FCAB4EE68B3D0D735D6849465A9113EE048", "issuer": "rH438jEAzTs5PYtV6CHZqpDpwCKQmPW9Cg", "value": "1000"},
"Fee": "10",
"Flags": 65536,
"Sequence": 1432289,
"SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8",
"TxnSignature": "9D4F41FC452526C0AD17191959D9B6D04A3C73B3A6C29E0F34C8459675A83A7A7D6E3021390EC8C9BE6C93E11C167E12016465E523F64F9EB3194B0A52E41802"
}
},
{
"binary": "1200252200080000240015DAE16140000000000003E868400000000000000A7321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B87440E2C60D56C337D6D73E4B7D53579C93C666605494E82A89DD58CFDE79E2A4866BCF52370A2146877A2EF748E98168373710001133A51B645D89491849079035018114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C",
"json": {
"Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw",
"TransactionType": "AMMWithdraw",
"Asset": {"currency": "XRP"},
"Asset2": {"currency": "ETH", "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9"},
"Amount": "1000",
"Fee": "10",
"Flags": 524288,
"Sequence": 1432289,
"SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8",
"TxnSignature": "E2C60D56C337D6D73E4B7D53579C93C666605494E82A89DD58CFDE79E2A4866BCF52370A2146877A2EF748E98168373710001133A51B645D8949184907903501"
}
},
{
"binary": "1200252200100000240015DAE16140000000000003E868400000000000000A6BD511C37937E080000000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C7321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B87440D2FCD7D03E53358BC6188BA88A7BA4FF2519B639C3B5C0EBCBDCB704426CA2837111430E92A6003D1CD0D81C63682C74839320539EC4F89B82AA5607714952028114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C",
"json": {
"Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw",
"TransactionType": "AMMWithdraw",
"Asset": {"currency": "XRP"},
"Asset2": {"currency": "ETH", "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9"},
"Amount": "1000",
"Amount2": {"currency": "ETH", "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9", "value": "500"},
"Fee": "10",
"Flags": 1048576,
"Sequence": 1432289,
"SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8",
"TxnSignature": "D2FCD7D03E53358BC6188BA88A7BA4FF2519B639C3B5C0EBCBDCB704426CA2837111430E92A6003D1CD0D81C63682C74839320539EC4F89B82AA560771495202"
}
},
{
"binary": "1200252200200000240015DAE16140000000000003E868400000000000000A601AD5438D7EA4C68000B3813FCAB4EE68B3D0D735D6849465A9113EE048B3813FCAB4EE68B3D0D735D6849465A9113EE0487321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8744042DA5620E924E2D2059BBB4E0C4F03244140ACED93B543136FEEDF802165F814D09F45C7E2A4618468442516F4712A23B1D3332D5DBDBAE830337F39F259C90F8114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C",
"json": {
"Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw",
"TransactionType": "AMMWithdraw",
"Asset": {"currency": "XRP"},
"Asset2": {"currency": "ETH", "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9"},
"Amount": "1000",
"LPTokenIn": {"currency": "B3813FCAB4EE68B3D0D735D6849465A9113EE048", "issuer": "rH438jEAzTs5PYtV6CHZqpDpwCKQmPW9Cg", "value": "1000"},
"Fee": "10",
"Flags": 2097152,
"Sequence": 1432289,
"SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8",
"TxnSignature": "42DA5620E924E2D2059BBB4E0C4F03244140ACED93B543136FEEDF802165F814D09F45C7E2A4618468442516F4712A23B1D3332D5DBDBAE830337F39F259C90F"
}
},
{
"binary": "1200252200400000240015DAE16140000000000003E868400000000000000A601B40000000000000197321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8744045BCEE5A12E5F5F1FB085A24F2F7FD962BBCB0D89A44A5319E3F7E3799E1870341880B6F684132971DDDF2E6B15356B3F407962D6D4E8DE10989F3B16E3CB90D8114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C",
"json": {
"Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw",
"TransactionType": "AMMWithdraw",
"Asset": {"currency": "XRP"},
"Asset2": {"currency": "ETH", "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9"},
"Amount": "1000",
"EPrice": "25",
"Fee": "10",
"Flags": 4194304,
"Sequence": 1432289,
"SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8",
"TxnSignature": "45BCEE5A12E5F5F1FB085A24F2F7FD962BBCB0D89A44A5319E3F7E3799E1870341880B6F684132971DDDF2E6B15356B3F407962D6D4E8DE10989F3B16E3CB90D"
}
},
{
"binary": "1200272200000000240015DAE168400000000000000A6CD4C8E1BC9BF04000B3813FCAB4EE68B3D0D735D6849465A9113EE048B3813FCAB4EE68B3D0D735D6849465A9113EE0486DD4CC6F3B40B6C000B3813FCAB4EE68B3D0D735D6849465A9113EE048B3813FCAB4EE68B3D0D735D6849465A9113EE0487321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B87440F8EAAFB5EC1A69275167589969F0B9764BACE6BC8CC81482C2FC5ACCE691EDBD0D88D141137B1253BB1B9AC90A8A52CB37F5B6F7E1028B06DD06F91BE06F5A0F8114F92F27CC5EE2F2760278FE096D0CBE32BDD3653AF019E01B81149A91957F8F16BC57F3F200CD8C98375BF1791586E1F10318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C",
"json": {
"Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw",
"TransactionType": "AMMBid",
"Asset": {"currency": "XRP"},
"Asset2": {"currency": "ETH", "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9"},
"AuthAccounts": [{"AuthAccount": {"Account": "rEaHTti4HZsMBpxTAF4ncWxkcdqDh1h6P7"}}],
"BidMax": {"currency": "B3813FCAB4EE68B3D0D735D6849465A9113EE048", "issuer": "rH438jEAzTs5PYtV6CHZqpDpwCKQmPW9Cg", "value": "35"},
"BidMin": {"currency": "B3813FCAB4EE68B3D0D735D6849465A9113EE048", "issuer": "rH438jEAzTs5PYtV6CHZqpDpwCKQmPW9Cg", "value": "25"},
"Fee": "10",
"Flags": 0,
"Sequence": 1432289,
"SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8",
"TxnSignature": "F8EAAFB5EC1A69275167589969F0B9764BACE6BC8CC81482C2FC5ACCE691EDBD0D88D141137B1253BB1B9AC90A8A52CB37F5B6F7E1028B06DD06F91BE06F5A0F"
}
},
{
"binary": "1200261500EA2200000000240015DAE168400000000000000A7321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B87440BC2F6E76969E3747E9BDE183C97573B086212F09D5387460E6EE2F32953E85EAEB9618FBBEF077276E30E59D619FCF7C7BDCDDDD9EB94D7CE1DD5CE9246B21078114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C",
"json": {
"Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw",
"TransactionType": "AMMVote",
"Asset": {"currency": "XRP"},
"Asset2": {"currency": "ETH", "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9"},
"TradingFee": 234,
"Fee": "10",
"Flags": 0,
"Sequence": 1432289,
"SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8",
"TxnSignature": "BC2F6E76969E3747E9BDE183C97573B086212F09D5387460E6EE2F32953E85EAEB9618FBBEF077276E30E59D619FCF7C7BDCDDDD9EB94D7CE1DD5CE9246B2107"
}
},
{
"binary": "1200322280000000240000000468400000000000000A7321ED9861C4CB029C0DA737B823D7D3459A70F227958D5C0C111CC7CF947FC5A93347744071E28B12465A1B47162C22E121DF61089DCD9AAF5773704B76179E771666886C8AAD5A33A87E34CC381A7D924E3FE3645F0BF98D565DE42C81E1A7A7E7981802811401476926B590BA3245F63C829116A0A3AF7F382D",
"json": {
"Account": "rfmDuhDyLGgx94qiwf3YF8BUV5j6KSvE8",
"Fee": "10",
"Flags": 2147483648,
"Sequence": 4,
"SigningPubKey": "ED9861C4CB029C0DA737B823D7D3459A70F227958D5C0C111CC7CF947FC5A93347",
"TransactionType": "DIDDelete",
"TxnSignature": "71E28B12465A1B47162C22E121DF61089DCD9AAF5773704B76179E771666886C8AAD5A33A87E34CC381A7D924E3FE3645F0BF98D565DE42C81E1A7A7E7981802"
}
},
{
"binary": "1200312280000000240000000368400000000000000A7321ED9861C4CB029C0DA737B823D7D3459A70F227958D5C0C111CC7CF947FC5A933477440AACD31A04CAE14670FC483A1382F393AA96B49C84479B58067F049FBD772999325667A6AA2520A63756EE84F3657298815019DD56A1AECE796B08535C4009C08750B6469645F6578616D706C65701A03646F63701B06617474657374811401476926B590BA3245F63C829116A0A3AF7F382D",
"json": {
"Account": "rfmDuhDyLGgx94qiwf3YF8BUV5j6KSvE8",
"Data": "617474657374",
"DIDDocument": "646F63",
"Fee": "10",
"Flags": 2147483648,
"Sequence": 3,
"SigningPubKey": "ED9861C4CB029C0DA737B823D7D3459A70F227958D5C0C111CC7CF947FC5A93347",
"TransactionType": "DIDSet",
"TxnSignature": "AACD31A04CAE14670FC483A1382F393AA96B49C84479B58067F049FBD772999325667A6AA2520A63756EE84F3657298815019DD56A1AECE796B08535C4009C08",
"URI": "6469645F6578616D706C65"
}
},
{
"binary": "1200332FFFFFFFFF2033000004D2750B6469645F6578616D706C65701C0863757272656E6379701D0870726F7669646572811401476926B590BA3245F63C829116A0A3AF7F382DF018E020301700000000000001E2041003011A0000000000000000000000000000000000000000021A0000000000000000000000005553440000000000E1F1",
"json": {
"TransactionType": "OracleSet",
"Account": "rfmDuhDyLGgx94qiwf3YF8BUV5j6KSvE8",
"OracleDocumentID": 1234,
"LastUpdateTime": 4294967295,
"PriceDataSeries": [
{
"PriceData": {
"BaseAsset": "XRP",
"QuoteAsset": "USD",
"AssetPrice": "00000000000001E2",
"Scale": 3
}
}
],
"Provider": "70726F7669646572",
"URI": "6469645F6578616D706C65",
"AssetClass": "63757272656E6379"
}
},
{
"binary": "1200342033000004D2811401476926B590BA3245F63C829116A0A3AF7F382D",
"json": {
"TransactionType": "OracleDelete",
"Account": "rfmDuhDyLGgx94qiwf3YF8BUV5j6KSvE8",
"OracleDocumentID": 1234
}
}
]
],
"ledgerData": [{
"binary": "01E91435016340767BF1C4A3EACEB081770D8ADE216C85445DD6FB002C6B5A2930F2DECE006DA18150CB18F6DD33F6F0990754C962A7CCE62F332FF9C13939B03B864117F0BDA86B6E9B4F873B5C3E520634D343EF5D9D9A4246643D64DAD278BA95DC0EAC6EB5350CF970D521276CDE21276CE60A00",
"json": {
"account_hash": "3B5C3E520634D343EF5D9D9A4246643D64DAD278BA95DC0EAC6EB5350CF970D5",
"close_flags": 0,
"close_time": 556231910,
"close_time_resolution": 10,
"ledger_index": 32052277,
"parent_close_time": 556231902,
"parent_hash": "EACEB081770D8ADE216C85445DD6FB002C6B5A2930F2DECE006DA18150CB18F6",
"total_coins": "99994494362043555",
"transaction_hash": "DD33F6F0990754C962A7CCE62F332FF9C13939B03B864117F0BDA86B6E9B4F87"
}
}]
}

View File

@@ -2499,7 +2499,7 @@
"type_id": 6,
"is_native": true,
"type": "Amount",
"expected_hex": "0000000000000001",
"error": "Value is negative",
"is_negative": true
},
{
@@ -2914,6 +2914,170 @@
"type": "Amount",
"error": "10000000000000000000 absolute XRP is bigger than max native value 100000000000.0",
"is_negative": true
},
{
"test_json": {
"mpt_issuance_id": "00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "9223372036854775808"
},
"type": "Amount",
"error": "Value is too large"
},
{
"test_json": {
"mpt_issuance_id": "00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "18446744073709551615"
},
"type": "Amount",
"error": "Value is too large"
},
{
"test_json": {
"mpt_issuance_id": "00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "-1"
},
"type": "Amount",
"error": "Value is negative"
},
{
"test_json": {
"mpt_issuance_id": "00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "10.1"
},
"type": "Amount",
"error": "Value has decimal point"
},
{
"test_json": {
"mpt_issuance_id": "10",
"value": "10"
},
"type": "Amount",
"error": "mpt_issuance_id has invalid hash length"
},
{
"test_json": {
"mpt_issuance_id": "00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "10",
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji"
},
"type": "Amount",
"error": "Issuer not valid for MPT"
},
{
"test_json": {
"mpt_issuance_id": "00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "10",
"currency": "USD"
},
"type": "Amount",
"error": "Currency not valid for MPT"
},
{
"test_json": {
"mpt_issuance_id": "00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "a"
},
"type": "Amount",
"error": "Value has incorrect hex format"
},
{
"test_json": {
"mpt_issuance_id": "00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "0xy"
},
"type": "Amount",
"error": "Value has bad hex character"
},
{
"test_json": {
"mpt_issuance_id": "00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "/"
},
"type": "Amount",
"error": "Value has bad character"
},
{
"test_json": {
"mpt_issuance_id": "00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "0x8000000000000000"
},
"type": "Amount",
"error": "Hex value out of range"
},
{
"test_json": {
"mpt_issuance_id": "00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "0xFFFFFFFFFFFFFFFF"
},
"type": "Amount",
"error": "Hex value out of range"
},
{
"test_json": {
"mpt_issuance_id":"00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "9223372036854775807"
},
"type_id": 6,
"is_native": false,
"type": "Amount",
"expected_hex": "607FFFFFFFFFFFFFFF00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"is_negative": false
},
{
"test_json": {
"mpt_issuance_id":"00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "0"
},
"type_id": 6,
"is_native": false,
"type": "Amount",
"expected_hex": "60000000000000000000002403C84A0A28E0190E208E982C352BBD5006600555CF",
"is_negative": false
},
{
"test_json": {
"mpt_issuance_id":"00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "-0"
},
"type_id": 6,
"is_native": false,
"type": "Amount",
"expected_hex": "60000000000000000000002403C84A0A28E0190E208E982C352BBD5006600555CF",
"is_negative": false
},
{
"test_json": {
"mpt_issuance_id":"00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "100"
},
"type_id": 6,
"is_native": false,
"type": "Amount",
"expected_hex": "60000000000000006400002403C84A0A28E0190E208E982C352BBD5006600555CF",
"is_negative": false
},
{
"test_json": {
"mpt_issuance_id":"00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "0xa"
},
"type_id": 6,
"is_native": false,
"type": "Amount",
"expected_hex": "60000000000000000A00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"is_negative": false
},
{
"test_json": {
"mpt_issuance_id":"00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"value": "0x7FFFFFFFFFFFFFFF"
},
"type_id": 6,
"is_native": false,
"type": "Amount",
"expected_hex": "607FFFFFFFFFFFFFFF00002403C84A0A28E0190E208E982C352BBD5006600555CF",
"is_negative": false
}
]
}

Some files were not shown because too many files have changed in this diff Show More