Compare commits

...

81 Commits

Author SHA1 Message Date
Denis Angell
7916a14be2 refactor 2025-03-11 14:31:34 +01:00
dependabot[bot]
92eb809397 build(deps): bump @noble/hashes from 1.4.0 to 1.5.0 (#2814)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: justinr1234 <justinr1234@gmail.com>
Co-authored-by: anissa-ripple <165064424+anissa-ripple@users.noreply.github.com>
2024-11-04 11:15:03 -06:00
dependabot[bot]
799cd65386 build(deps): bump @scure/bip39 from 1.3.0 to 1.4.0 (#2813)
Bumps [@scure/bip39](https://github.com/paulmillr/scure-bip39) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/paulmillr/scure-bip39/releases)
- [Commits](https://github.com/paulmillr/scure-bip39/compare/1.3.0...1.4.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: anissa-ripple <165064424+anissa-ripple@users.noreply.github.com>
Co-authored-by: justinr1234 <justinr1234@gmail.com>
2024-11-04 08:28:33 -08:00
dependabot[bot]
29d145138b build(deps-dev): bump eslint-plugin-import from 2.29.1 to 2.31.0 (#2799)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: anissa-ripple <165064424+anissa-ripple@users.noreply.github.com>
2024-11-04 10:10:51 -06:00
Mayukha Vadari
496f774154 fix: resolve TransactionStream and Ledger model issues (#2779)
* update TransactionStream model

* fix everywhere else

* add close_time_iso

* add close_time_iso to TransactionStream

* update HISTORY

* fix tests

* fix import

* Update packages/xrpl/src/client/partialPayment.ts
2024-11-04 10:55:47 -05:00
dependabot[bot]
0395c14392 build(deps-dev): bump @types/lodash from 4.17.7 to 4.17.12 (#2810) 2024-10-21 16:23:46 +00:00
dependabot[bot]
2a77e2cd91 build(deps-dev): bump typedoc from 0.26.9 to 0.26.10 (#2809) 2024-10-21 16:17:27 +00:00
dependabot[bot]
619c9ae13a build(deps-dev): bump typedoc from 0.26.7 to 0.26.9 (#2803) 2024-10-16 14:30:07 +00:00
Mayukha Vadari
8beb1292b5 fix: make transaction-generating scripts more robust (#2690)
* improve scripts

* Update settings.json

* update file locations after refactor
2024-10-11 14:40:19 -07:00
dependabot[bot]
649bf7d277 build(deps): bump @scure/bip32 from 1.4.0 to 1.5.0 (#2791) 2024-10-02 00:37:54 +00:00
dependabot[bot]
e0d368791b build(deps-dev): bump eslint from 8.57.0 to 8.57.1 (#2792) 2024-10-01 21:01:32 +00:00
Zhiyuan Wang
be9b48b071 Add include_deleted param to ledger_entry API (#2725)
* add nfts_by_issuer data type

* update HISTORY.md

* update HISTORY.md

* added to index and change field name

* change to added in history

* reformat change in history

* reformat history on bfts_by_issuer

* add include_deleted field

* update history

* fix an error in histroy

* changed comments

---------

Authored-by: Kassaking <kassaking7@gmail.com>
2024-10-01 16:54:00 -04:00
dependabot[bot]
55892c8b89 build(deps-dev): bump webpack from 5.93.0 to 5.95.0 (#2785) 2024-09-26 19:34:40 +00:00
dependabot[bot]
b1b4995047 build(deps): bump @noble/curves from 1.4.0 to 1.6.0 (#2769)
Bumps [@noble/curves](https://github.com/paulmillr/noble-curves) from 1.4.0 to 1.6.0.
- [Release notes](https://github.com/paulmillr/noble-curves/releases)
- [Commits](https://github.com/paulmillr/noble-curves/compare/1.4.0...1.6.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-09-26 15:21:25 -04:00
dependabot[bot]
a726a5a4f9 build(deps-dev): bump typedoc from 0.26.4 to 0.26.7 (#2772)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.26.4 to 0.26.7.
- [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.4...v0.26.7)

---
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>
2024-09-26 15:08:41 -04:00
Chenna Keshava B S
8992d3914e remove bridge snippet test, the sidechain has been shut down (#2773)
* update Paths snippet test: perform prerequisite test setup within the test, remove dependence on theexternal state of testnet

* remove bridge snippet test, the sidechain has been shut down

* [FIX] Update paths snippet. Replace RipplePathFind with PathFind RPC (fixes #2385)
2024-09-26 14:07:56 -04:00
justinr1234
c2e01b3d10 feat: coderabbit.ai config (#2781) 2024-09-19 16:07:23 -05:00
Mayukha Vadari
8bfe5b42b8 chore: fix CodeQL issue (#2727)
fix CodeQL issue
2024-09-19 15:00:06 -04:00
Chenna Keshava B S
385a56a1f7 update Paths snippet test (#2765)
* update Paths snippet test: perform prerequisite test setup within the test, remove dependence on theexternal state of testnet

* fix lint errors

* remove bridge snippet test, the sidechain has been shut down

* [FIX] Update paths snippet. Replace RipplePathFind with PathFind RPC (fixes #2385)
2024-09-19 13:23:55 -05:00
achowdhry-ripple
f3960c3ccc Parse transaction flags into map of names:booleans (#2734)
* overview logic of parsetransactionflags

* parse transaction flags works

* basic tests

* eslint and docs

* linting

* lint

* fix typing

* test fix

* revert import delete

* lint

* integration fix

* lint

* imports

* added numeric test

* add history log

* history update
2024-08-07 11:44:57 -04:00
dependabot[bot]
a46e86f17e build(deps-dev): bump @types/lodash from 4.17.1 to 4.17.7 (#2745) 2024-07-24 15:49:13 +00:00
dependabot[bot]
8f5d210806 build(deps-dev): bump webpack from 5.92.1 to 5.93.0 (#2731)
Bumps [webpack](https://github.com/webpack/webpack) from 5.92.1 to 5.93.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.92.1...v5.93.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  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-07-17 14:01:09 -07:00
dependabot[bot]
17c91cdd3a build(deps-dev): bump typedoc from 0.26.3 to 0.26.4 (#2732)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.26.3 to 0.26.4.
- [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.3...v0.26.4)

---
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: Chenna Keshava B S <21219765+ckeshava@users.noreply.github.com>
2024-07-17 13:54:08 -07:00
dependabot[bot]
74a41832ce build(deps-dev): bump ts-jest from 29.2.0 to 29.2.2 (#2733)
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 29.2.0 to 29.2.2.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.2.0...v29.2.2)

---
updated-dependencies:
- dependency-name: ts-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>
2024-07-17 13:47:00 -07:00
Omar Khan
275c95752b release: v4.0.0 (#2739)
* update HISTORY

* update package.json
2024-07-16 14:20:55 -04:00
Chenna Keshava B S
3bc3c2029b feat: Upgrade to Node 18 and remove cross-fetch (#2678) (#2737)
* feat: Upgrade to Node 18 and remove cross-fetch (#2678)

BREAKING CHANGE: fetch now relies on the native javascript environment in browsers and node.js

Co-authored-by: justinr1234 <justinr1234@gmail.com>
2024-07-16 11:04:47 -07:00
tequ
c9ef96e0a2 Add transaction hash to ledger command response (#2717)
* add transaction hash to ledger command response

* Update packages/xrpl/src/models/ledger/Ledger.ts

* Update HISTORY.md

* delete unnesessary space
2024-07-12 09:57:24 -04:00
Mayukha Vadari
00f1a6bcdd feat: add feature RPC (#2719)
* add feature RPC

* export, add tests

* update history

* fix test

* update models

* update feature models to correctly handle both cases

* fix models/tests

* fix test, improve type

* undo type change

* fix test
2024-07-10 13:18:16 -04:00
dependabot[bot]
3858a09e1f build(deps-dev): bump ts-jest from 29.1.5 to 29.2.0 (#2729) 2024-07-09 15:25:33 +00:00
dependabot[bot]
3aaf526107 build(deps): bump ws from 8.17.1 to 8.18.0 (#2730) 2024-07-09 15:15:50 +00:00
Mayukha Vadari
1460cf5026 feat: add support for the fixPreviousTxnID amendment (#2720)
* add support for fixPreviousTxnID

* update history
2024-07-08 17:24:38 -04:00
dependabot[bot]
7e733c4446 build(deps-dev): bump @types/lodash from 4.17.4 to 4.17.6 (#2718)
Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.17.4 to 4.17.6.
- [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>
2024-07-08 08:45:32 -05:00
dependabot[bot]
735ac2eb07 build(deps): bump @noble/curves from 1.4.0 to 1.4.2 (#2723) 2024-07-03 17:27:31 +00:00
dependabot[bot]
c79a5db8f2 build(deps-dev): bump typedoc from 0.26.2 to 0.26.3 (#2722)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.26.2 to 0.26.3.
- [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.2...v0.26.3)

---
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>
2024-07-03 11:02:18 -05:00
Omar Khan
8e2aba3b78 feat: add rippled API v2 support and use as default (#2656)
* add apiVersion support to requests and AccountInfoResponse v1/v2 types

* fix submitAndWait signature

* update docker container README

* update tests

* fix apiVersion param in wrong position of Client.request

* add integ tests

* update HISTORY.md

* fix request.api_version

* update RIPPLED_DOCKER_IMAGE to use v2.1.0

* refactor Client.request signature

* update rippled docker image

* fix Client.requestAll

* update rippled docker image to use v2.1.1

* update README

* use import type

* fix faucet; unrelated to PR

* add api_version v2 support and set as default while providing support for v1

* refactor: add apiVersion to Client

* resolve errors

* use DeliverMax for isPartialPayment check

* update fixtures

* resolve lint errors

* add API v1 support for isPartialPayment

* update CONTRIBUTING

* update accountTx JSDoc

* revert deleted JSDoc comments in accountTx

* update JSDoc for account_info response

* only use client.apiVersion in Client.request()

* add ledger_hash

* remove API v1 comment from v2 model

* update meta_blob JSDoc

* delete second AccountTxRequest matching

* add close_time_iso

* set close_time_iso as optional field

* add meta_blob to BaseResponse

* Revert "add meta_blob to BaseResponse"

This reverts commit 89794c629dc515915e28752d7c2552bfeab266a3.

* use DEFAULT_API_VERSION throughout call stack

* improve JSDoc explanation of ledger_index

* remove this.apiVersion from getLedgerIndex

* refactor Client.request()

* refactor RequestManger.resolve()

* add TODO to fix TxResponse type assertion

* use @category ResponsesV1 for API v1 types

* refactor accountTxHasPartialPayment()

* remove TODO
2024-06-28 08:26:21 -04:00
Chenna Keshava B S
39fed49654 Aliter: Implement DeliverMax alias in Payment transactions, through autofill method (#2689)
Co-authored-by: Omar Khan <khancodegt@gmail.com>
2024-06-27 09:46:49 -07:00
dependabot[bot]
a0678857a1 build(deps-dev): bump webpack from 5.91.0 to 5.92.1 (#2713) 2024-06-25 14:18:08 +00:00
dependabot[bot]
38e2091fd2 build(deps-dev): bump ts-jest from 29.1.4 to 29.1.5 (#2709) 2024-06-25 14:11:44 +00:00
dependabot[bot]
a528d6632a build(deps-dev): bump typedoc from 0.25.0 to 0.26.2 (#2712) 2024-06-25 13:59:07 +00:00
dependabot[bot]
ab081e7db9 build(deps): bump @scure/base from 1.1.6 to 1.1.7 (#2708)
Bumps [@scure/base](https://github.com/paulmillr/scure-base) from 1.1.6 to 1.1.7.
- [Release notes](https://github.com/paulmillr/scure-base/releases)
- [Commits](https://github.com/paulmillr/scure-base/compare/1.1.6...1.1.7)

---
updated-dependencies:
- dependency-name: "@scure/base"
  dependency-type: direct:production
  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: Chenna Keshava B S <21219765+ckeshava@users.noreply.github.com>
2024-06-24 19:03:54 -04:00
dependabot[bot]
493c56c0fa build(deps): bump ws from 8.17.0 to 8.17.1 (#2707)
Bumps [ws](https://github.com/websockets/ws) from 8.17.0 to 8.17.1.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/8.17.0...8.17.1)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: direct:production
  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: Chenna Keshava B S <21219765+ckeshava@users.noreply.github.com>
Co-authored-by: justinr1234 <justinr1234@gmail.com>
2024-06-24 15:07:04 -07:00
dependabot[bot]
c73b2c5a86 build(deps-dev): bump braces from 3.0.2 to 3.0.3 (#2706)
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

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-06-24 17:59:39 -04:00
Chenna Keshava B S
02e2b0e48e remove references to the hooks testnet faucet in xrpl.js codebase (#2711) 2024-06-20 17:18:11 -07:00
Zhiyuan Wang
d3b03a536d Add nfts_by_issuer data type (#2694)
* add nfts_by_issuer data type

* update HISTORY.md

* update HISTORY.md

* added to index and change field name

* change to added in history

* reformat change in history

* reformat history on bfts_by_issuer

---------

Authored-by: Kassaking <kassaking7@gmail.com>
2024-06-11 14:43:47 -04:00
dependabot[bot]
036f1f9850 build(deps-dev): bump @types/lodash from 4.17.1 to 4.17.4 (#2697) 2024-06-05 16:30:17 +00:00
Omar Khan
92849e57ce release 3.1.0 (#2703)
* update HISTORYs

* update HISTORY for isomorphic

* update package.json
2024-06-03 16:33:06 -04:00
dependabot[bot]
32f0d7b121 build(deps-dev): bump ts-jest from 29.1.2 to 29.1.4 (#2702) 2024-06-03 19:19:48 +00:00
Omar Khan
b27bbb49b3 feat: add input check for OracleSet params AssetPrice and Scale (#2699)
* add input check for AssetPrice and Scale being either both present or excluded
2024-05-23 17:32:36 -04:00
Omar Khan
23adb4924b feat: add Price Oracles support (#2688) 2024-05-23 12:10:00 -04:00
Mayukha Vadari
9b3bb9c14b fix: throw error if hexToBytes or hexToString is provided a string that is not in hex (#2657)
* better error handling

* fix browser tests

* add shared variable

* re-add test case
2024-05-08 13:02:34 -04:00
dependabot[bot]
d441361999 build(deps-dev): bump @types/lodash from 4.17.0 to 4.17.1 (#2691) 2024-05-08 16:46:07 +00:00
dependabot[bot]
fb94f2a020 build(deps): bump ws from 8.16.0 to 8.17.0 (#2685) 2024-05-08 16:39:03 +00:00
dependabot[bot]
7b56a49dae build(deps-dev): bump react from 18.2.0 to 18.3.1 (#2686) 2024-05-08 16:31:33 +00:00
Mayukha Vadari
212686baae fix: better error handling for the binary codec (#2693)
* better error handling

* respond to comments

* remove --watch
2024-05-08 12:20:43 -04:00
dependabot[bot]
4d6fef597c build(deps-dev): bump webpack-bundle-analyzer from 4.10.1 to 4.10.2 (#2681)
* build(deps-dev): bump webpack-bundle-analyzer from 4.10.1 to 4.10.2

Bumps [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) from 4.10.1 to 4.10.2.
- [Release notes](https://github.com/webpack-contrib/webpack-bundle-analyzer/releases)
- [Changelog](https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/webpack-bundle-analyzer/compare/v4.10.1...v4.10.2)

---
updated-dependencies:
- dependency-name: webpack-bundle-analyzer
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: fund wallet test

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Reynolds <justinr1234@gmail.com>
2024-05-08 11:00:47 -05:00
Chenna Keshava B S
8b596a6687 update Migration guide: info about the changed behavior (#2659)
* generateSeed() update: If no algorithm is specified, use ed25519 algorithm by default.

This causes breakge in downstream dependencies such as Account class. Account.familySeed makes use of generateSeed

* update Migration guide: info about the changed behavior

* updates to MIGRATION guide -- suggestions from jackson mills

---------

Co-authored-by: Mayukha Vadari <mvadari@gmail.com>
2024-04-09 09:59:35 -07:00
dependabot[bot]
8afc9ad506 build(deps-dev): bump eslint from 8.56.0 to 8.57.0 (#2655)
Bumps [eslint](https://github.com/eslint/eslint) from 8.56.0 to 8.57.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.56.0...v8.57.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  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: Kausty Saxena <ksaxena@ripple.com>
2024-04-08 14:26:21 -05:00
dependabot[bot]
3b08d7d379 build(deps-dev): bump karma from 6.4.2 to 6.4.3 (#2654)
Bumps [karma](https://github.com/karma-runner/karma) from 6.4.2 to 6.4.3.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.4.2...v6.4.3)

---
updated-dependencies:
- dependency-name: karma
  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: justinr1234 <justinr1234@gmail.com>
2024-04-08 12:12:50 -05:00
Mayukha Vadari
616ad4af60 fix: add PreviousFields to DeletedNode metadata type (#2668) 2024-04-08 11:05:37 +02:00
Chenna Keshava B S
dbdb35abb5 rectify the flag name tfNoRippleDirect (#2647)
* rectify the flag name tfNoRippleDirect

* Update th History.md file

* use "Breaking Changes" heading in the API Changelog

* Update HISTORY.md

---------
2024-04-02 14:54:02 -04:00
Omar Khan
445a05e6ef fix: add missing lsfAMMNode flag (#2674)
* add missing lsfAMMNode flag

* update HISTORY

* update HISTORY
2024-03-28 19:03:30 -04:00
dependabot[bot]
ccad092fc2 build(deps-dev): bump webpack from 5.90.3 to 5.91.0 (#2673)
Bumps [webpack](https://github.com/webpack/webpack) from 5.90.3 to 5.91.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.90.3...v5.91.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  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-03-25 14:21:51 -07:00
dependabot[bot]
faa23b430e build(deps): bump @scure/bip39 from 1.2.2 to 1.3.0 (#2672)
Bumps [@scure/bip39](https://github.com/paulmillr/scure-bip39) from 1.2.2 to 1.3.0.
- [Release notes](https://github.com/paulmillr/scure-bip39/releases)
- [Commits](https://github.com/paulmillr/scure-bip39/compare/1.2.2...1.3.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>
2024-03-25 14:10:55 -07:00
dependabot[bot]
923e5d16ac build(deps): bump @scure/bip32 from 1.3.3 to 1.4.0 (#2670)
Bumps [@scure/bip32](https://github.com/paulmillr/scure-bip32) from 1.3.3 to 1.4.0.
- [Release notes](https://github.com/paulmillr/scure-bip32/releases)
- [Commits](https://github.com/paulmillr/scure-bip32/compare/1.3.3...1.4.0)

---
updated-dependencies:
- dependency-name: "@scure/bip32"
  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-03-25 13:50:33 -07:00
dependabot[bot]
602ac481d7 build(deps-dev): bump follow-redirects from 1.15.4 to 1.15.6 (#2662)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.4...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

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-03-21 16:22:51 -04:00
Chenna Keshava B S
b322396a99 additional amm flags are introduced (#2667)
* additional amm flags are introduced

Co-authored-by: Mayukha Vadari <mvadari@gmail.com>

---------

Co-authored-by: Mayukha Vadari <mvadari@gmail.com>
2024-03-21 10:27:30 -07:00
dependabot[bot]
b9af7bdb6c build(deps): bump @noble/curves from 1.3.0 to 1.4.0 (#2664) 2024-03-19 00:43:05 +00:00
dependabot[bot]
bdb3ad7f3e build(deps-dev): bump @types/lodash from 4.14.202 to 4.17.0 (#2663)
Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.14.202 to 4.17.0.
- [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-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-18 15:50:06 -07:00
dependabot[bot]
1fdbf85d47 build(deps): bump @noble/hashes from 1.3.3 to 1.4.0 (#2665)
Bumps [@noble/hashes](https://github.com/paulmillr/noble-hashes) from 1.3.3 to 1.4.0.
- [Release notes](https://github.com/paulmillr/noble-hashes/releases)
- [Commits](https://github.com/paulmillr/noble-hashes/compare/1.3.3...1.4.0)

---
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-03-18 15:38:57 -07:00
zgrguric
3e3911464f Update APPLICATIONS.md - Add XRPLWin to the list (#2619)
Update APPLICATIONS.md

Co-authored-by: Jackson Mills <jmills@ripple.com>
Co-authored-by: Caleb Kniffen <ckniffen@ripple.com>
Co-authored-by: Chenna Keshava B S <21219765+ckeshava@users.noreply.github.com>
2024-03-14 17:14:01 -04:00
Jackson Mills
be732a4a6b Update docs for Channel, ClientOptions, and ConnectionUserOptions (#2630)
* Update docs for three objects

* Fix my updated Channel type

* Fix docs wording in client

* Export channel again

* Update HISTORY.md

* Lint
2024-02-26 17:37:58 -05:00
dependabot[bot]
e505843dc6 build(deps-dev): bump ip from 2.0.0 to 2.0.1 (#2652) 2024-02-21 17:08:35 +00:00
dependabot[bot]
ff9489ba10 build(deps-dev): bump webpack from 5.90.1 to 5.90.3 (#2651) 2024-02-20 17:29:34 +00:00
Mayukha Vadari
365763d6f7 fix: get client.requestAll to handle filters better (#2649)
* fix requestAll issue

* update changelog

* fix typo
2024-02-15 19:20:22 -05:00
dependabot[bot]
9349a6ba1a build(deps-dev): bump webpack from 5.90.0 to 5.90.1 (#2646)
Bumps [webpack](https://github.com/webpack/webpack) from 5.90.0 to 5.90.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.90.0...v5.90.1)

---
updated-dependencies:
- dependency-name: webpack
  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>
2024-02-12 13:21:28 -05:00
dependabot[bot]
34f35a5912 build(deps): bump ws from 8.14.2 to 8.16.0 (#2638)
Bumps [ws](https://github.com/websockets/ws) from 8.14.2 to 8.16.0.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/8.14.2...8.16.0)

---
updated-dependencies:
- dependency-name: ws
  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-02-12 13:14:56 -05:00
dependabot[bot]
05f16068ff build(deps-dev): bump karma-webpack from 5.0.0 to 5.0.1 (#2644)
Bumps [karma-webpack](https://github.com/webpack-contrib/karma-webpack) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/webpack-contrib/karma-webpack/releases)
- [Changelog](https://github.com/codymikol/karma-webpack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/karma-webpack/compare/v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: karma-webpack
  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-02-12 12:42:08 -05:00
Jackson Mills
ddda7f4552 Fix: Migration guide package version formatting (#2635)
Update MIGRATION.md with better formatting on package versions

Co-authored-by: Omar Khan <khancodegt@gmail.com>
2024-02-12 12:29:00 -05:00
dependabot[bot]
38406212c3 build(deps-dev): bump @types/jest from 29.5.11 to 29.5.12 (#2641)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.5.11 to 29.5.12.
- [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>
2024-02-12 12:17:39 -05:00
dependabot[bot]
62a0d39ac3 build(deps): bump @scure/bip39 from 1.2.1 to 1.2.2 (#2640)
Bumps [@scure/bip39](https://github.com/paulmillr/scure-bip39) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/paulmillr/scure-bip39/releases)
- [Commits](https://github.com/paulmillr/scure-bip39/compare/1.2.1...1.2.2)

---
updated-dependencies:
- dependency-name: "@scure/bip39"
  dependency-type: direct:production
  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>
2024-02-12 12:07:13 -05:00
dependabot[bot]
0e6ab4e4ee build(deps): bump @scure/bip32 from 1.3.2 to 1.3.3 (#2639)
Bumps [@scure/bip32](https://github.com/paulmillr/scure-bip32) from 1.3.2 to 1.3.3.
- [Release notes](https://github.com/paulmillr/scure-bip32/releases)
- [Commits](https://github.com/paulmillr/scure-bip32/compare/1.3.2...1.3.3)

---
updated-dependencies:
- dependency-name: "@scure/bip32"
  dependency-type: direct:production
  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>
2024-02-12 11:56:04 -05:00
624 changed files with 7661 additions and 10661 deletions

View File

@@ -43,7 +43,7 @@ small
[node_db]
type=NuDB
path=/var/lib/rippled/db/nudb
path=/var/lib/xahaud/db/nudb
advisory_delete=0
# How many ledgers do we want to keep (history)?
@@ -58,10 +58,10 @@ online_delete=256
256
[database_path]
/var/lib/rippled/db
/var/lib/xahaud/db
[debug_logfile]
/var/log/rippled/debug.log
/var/log/xahaud/debug.log
[sntp_servers]
time.windows.com
@@ -70,10 +70,10 @@ time.nist.gov
pool.ntp.org
[ips]
r.ripple.com 51235
r.xahau.com 51235
[validators_file]
validators.txt
# # # # # [validators_file]
# # # # # validators.txt
[rpc_startup]
{ "command": "log_level", "severity": "info" }
@@ -92,81 +92,18 @@ validators.txt
# 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:
# 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 rippled which are not already in the list below
# 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 rippled all at once.
# 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 xrpl.js's CONTRIBUTING.md for "Updating the Docker container".
# https://github.com/XRPLF/xrpl.js/blob/main/CONTRIBUTING.md
# 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 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
# 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
[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
[network_id]
63456

28
.coderabbit.yaml Normal file
View File

@@ -0,0 +1,28 @@
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
language: "en-US"
reviews:
# Set the profile for reviews. Assertive profile yields more feedback, that may be considered nitpicky.
profile: "chill"
# Approve the review once CodeRabbit's comments are resolved. Note: In GitLab, all discussions must be resolved.
request_changes_workflow: false
# Generate a high level summary of the changes in the PR/MR description.
high_level_summary: false
# Generate a poem in the walkthrough comment.
poem: true
# Post review details on each review. Additionally, post a review status when a review is skipped in certain cases.
review_status: true
# Generate walkthrough in a markdown collapsible section.
collapse_walkthrough: false
# Abort the in-progress review if the pull request is closed or merged.
abort_on_close: true
auto_review:
# Automatic Review | Automatic code review
enabled: true
# Review draft PRs/MRs.
drafts: false
# Ignore reviewing if the title of the pull request contains any of these keywords (case-insensitive).
ignore_title_keywords:
- build(
chat:
# Enable the bot to reply automatically without requiring the user to tag it.
auto_reply: true

View File

@@ -12,13 +12,11 @@
name: "CodeQL"
on:
push:
branches: [ main, 1.x ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
branches: [main]
schedule:
- cron: '44 5 * * 6'
- cron: "44 5 * * 6"
jobs:
analyze:
@@ -28,40 +26,40 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# 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
# 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
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

View File

@@ -4,11 +4,11 @@
name: Node.js CI
env:
RIPPLED_DOCKER_IMAGE: rippleci/rippled:2.0.0-b4
XAHAUD_DOCKER_IMAGE: xahauci/xahaud:2025.2.6
on:
push:
branches: [main, 1.x]
branches: [main-xahau, 1.x]
pull_request:
workflow_dispatch:
@@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
@@ -60,7 +60,7 @@ jobs:
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v3
@@ -101,14 +101,14 @@ jobs:
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v3
- name: Run docker in background
run: |
docker run --detach --rm --name rippled-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.RIPPLED_DOCKER_IMAGE }} /opt/ripple/bin/rippled -a --conf /opt/ripple/etc/rippled.cfg
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
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
@@ -145,7 +145,7 @@ jobs:
- name: Stop docker container
if: always()
run: docker stop rippled-service
run: docker stop xahaud-service
browser:
runs-on: ubuntu-latest
@@ -153,7 +153,7 @@ jobs:
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v3
@@ -165,7 +165,7 @@ jobs:
- name: Run docker in background
run: |
docker run --detach --rm --name rippled-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.RIPPLED_DOCKER_IMAGE }} /opt/ripple/bin/rippled -a --conf /opt/ripple/etc/rippled.cfg
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
- name: Setup npm version 9
run: |
@@ -197,7 +197,7 @@ jobs:
- name: Stop docker container
if: always()
run: docker stop rippled-service
run: docker stop xahaud-service
snippets:
runs-on: ubuntu-latest
@@ -205,7 +205,7 @@ jobs:
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v3

View File

@@ -39,7 +39,7 @@
"enable": true
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,

View File

@@ -1,171 +0,0 @@
# 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.
## 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

@@ -12,7 +12,7 @@
### Requirements
We use Node v16 for development - that is the version that our linters require.
We use Node v18 for development - that is the version that our linters require.
You must also use `npm` v7. You can check your `npm` version with:
```bash
@@ -47,7 +47,7 @@ npm run lint
## Running Tests
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/).
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/).
### Unit Tests
@@ -59,12 +59,12 @@ npm test
### Integration Tests
From the top-level xrpl.js folder (one level above `packages`), run the following commands:
From the top-level xahau.js folder (one level above `packages`), run the following commands:
```bash
npm install
# sets up the rippled 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/ripple/etc/ --platform linux/amd64 rippleci/rippled:2.0.0-b4 /opt/ripple/bin/rippled -a --conf /opt/ripple/etc/rippled.cfg
# 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
npm run build
npm run test:integration
```
@@ -73,9 +73,9 @@ 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 `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
* `/opt/ripple/bin/rippled -a --conf /opt/ripple/etc/rippled.cfg` starts `rippled` in standalone mode
* `--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
### Browser Tests
@@ -85,12 +85,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 `xrpl.js` top level folder (one above the `packages` folder).
This should be run from the `xahau.js` top level folder (one above the `packages` folder).
```bash
npm run build
# sets up the rippled 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/ripple/etc/ --platform linux/amd64 rippleci/rippled:2.0.0-b3 /opt/ripple/bin/rippled -a --conf /opt/ripple/etc/rippled.cfg
# 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
npm run test:browser
```
@@ -100,45 +100,47 @@ This is a monorepo, which means that there are multiple packages in a single Git
The 4 packages currently here are:
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.
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.
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 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.
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.
Let's dive a bit into how xrpl.js is structured!
Let's dive a bit into how xahau.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 rippled servers.
**Client** - This contains logic for handling the websocket connection to xahaud 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 `getXRPBalance` amongst others.
**Sugar** - This is where handy helper functions end up, like `submit`, `autofill`, and `getXAHBalance` 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 xrpl.js
**Wallet** - This logic handles managing keys, addresses, and signing within xahau.js
### Writing Tests for xrpl.js
### Writing Tests for xahau.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/xrpl/test/client/autofill.ts).
For an example of a unit test, check out the [autofill tests here](./packages/xahau/test/client/autofill.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 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.
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.
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 `xrpl.js`, you can look at the [Payment integration test](./packages/xrpl/test/integration/transactions/payment.ts).
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).
## Generate reference docs
You can see the complete reference documentation at [`xrpl.js` docs](https://js.xrpl.org). You can also generate them locally using `typedoc`:
You can see the complete reference documentation at [`xahau.js` docs](https://js.xrpl.org). You can also generate them locally using `typedoc`:
```bash
npm run docgen
@@ -148,17 +150,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 rippled 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 xahaud source code. Instructions are available in that README.
## Adding and removing packages
`xrpl.js` uses `lerna` and `npm`'s workspaces features to manage a monorepo.
`xahau.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
`xrpl.js` strives to use the same development dependencies in all packages.
`xahau.js` strives to use the same development dependencies in all packages.
You may add and remove dev dependencies like normal:
```bash
@@ -173,38 +175,38 @@ npm uninstall --save-dev abbrev
You need to specify which package is changing using the `-w` flag:
```bash
### adding a new dependency to `xrpl`
npm install abbrev -w xrpl
### adding a new dependency to `ripple-keypairs`
npm install abbrev -w ripple-keypairs
### adding a new dependency to `xahau`
npm install abbrev -w xahau
### adding a new dependency to `xahau-keypairs`
npm install abbrev -w xahau-keypairs
### removing a dependency
npm uninstall abbrev -w xrpl
npm uninstall abbrev -w xahau
```
## 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/rippled.cfg` file with the hashes and names of new amendments.
This requires updating the `/.ci-config/xahaud.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/rippled.cfg` with the date
2. If there are any new amendment hashes, add a comment to the end of `/.ci-config/xahaud.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 xrpl-py's CI as well.
Note: The same updated config can be used to update xahau-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 [rippled](https://github.com/XRPLF/rippled) - Specifically the `develop` branch is usually the right one.
1. Clone / pull the latest changes from [xahaud](https://github.com/XRPLF/xahaud) - 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 `ripple-binary-codec` with the newly generated file.
4. Replace the `definitions.json` file in the `xahau-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.
@@ -244,13 +246,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 xrpl@beta`
Notice this allows developers to install the package with `npm add xahau@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. `xrpl@2.1.1`), for each version released.
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 push --follow-tags`, to push the tags to Github.
1. On GitHub, click the "Releases" link on the right-hand side of the page.
@@ -260,19 +262,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 [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. 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. 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 `xrpl.js` releases. (About 1 email every couple of weeks)
We have a low-traffic mailing list for announcements of new `xahau.js` releases. (About 1 email every couple of weeks)
- [Subscribe to xrpl-announce](https://groups.google.com/g/xrpl-announce)
- [Subscribe to xahau-announce](https://groups.google.com/g/xahau-announce)
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.
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.
- [Subscribe to ripple-server](https://groups.google.com/g/ripple-server)
- [Subscribe to xahau-server](https://groups.google.com/g/xahau-server)

View File

@@ -2,12 +2,15 @@
In xrpl.js 3.0, we've made significant improvements that result in a 60% reduction in bundle size for browser applications. We've also eliminated the need for polyfills with minimal disruption to existing code. This was achieved by replacing node-specific dependencies with ones that are compatible with browsers.
The main change you'll notice is the update replacing `Buffer` with `Uint8Array` across the board. This was done since browsers don't support `Buffer`. Fortunately, this transition is relatively straightforward, as `Buffer` is a subclass of `Uint8Array`, meaning in many circumstances `Buffer` can be directly replaced by `Uint8Array`. The primary difference is that `Buffer` has additional helper functions. We've listed the affected client library functions below in the `Uint8Array` section for your reference.
The two main changes you'll notice are:
* A breaking change to `Wallet` object creation, to use a more performant algorithm by default. See [here](#8-wallet-functions-default-to-ed25519-instead-of-secp256k1-signing-algorithm) for details.
* Replacing `Buffer` with `Uint8Array` across the board. This was done since browsers don't support `Buffer`. Fortunately, this transition is relatively straightforward, as `Buffer` is a subclass of `Uint8Array`, meaning in many circumstances `Buffer` can be directly replaced by `Uint8Array`. The primary difference is that `Buffer` has additional helper functions. We've listed the affected client library functions below in the `Uint8Array` section for your reference.
This migration guide also applies to:
`ripple-address-codec` 4.3.1 -> 5.0.0
`ripple-binary-codec` 1.11.0 -> 2.0.0
`ripple-keypairs` 1.3.1 -> 2.0.0
- `ripple-address-codec` 4.3.1 -> 5.0.0
- `ripple-binary-codec` 1.11.0 -> 2.0.0
- `ripple-keypairs` 1.3.1 -> 2.0.0
- `xrpl-secret-numbers` 0.3.4 -> `@xrplf/secret-numbers` 1.0.0
# Why update to 3.0?
@@ -229,9 +232,27 @@ This was done to remove a hard dependency on `https-proxy-agent` when running
authorization: 'authorization'
}`
### 8. Bug fix: Setting an explicit `algorithm` when generating a wallet works now
### 8. `Wallet` functions default to `ed25519` instead of `secp256k1` signing algorithm
`Wallet.generate()` and `Wallet.fromSeed` were ignoring the `algorithm` parameter. This means that if you were manually specifying `algorithm` in any `Wallet` constructors, you may generate a different `Wallet` keypair when upgrading to 3.0. In that case to get the same generated wallets as before, dont specify the `algorithm` parameter.
In previous releases of this library, `Wallet.generate()` and `Wallet.fromSeed` were ignoring the `algorithm` parameter. Instead, the algorithm was assumed from the seed provided; if it started with `sEd`, it would use `ed25519`, and otherwise it would use `secp256k1`. However, seeds do not actually have algorithms; a seed starting with `s...` can still use the `ed25519` algorithm.
With 3.0, we updated the default signing algorithm used by the `Wallet` object to always be `ed25519` in order to default to the higher-performance algorithm. This is a breaking change to all functions used to generate a Wallet, so if you have a pre-existing XRPL account that you're using to generate a specific Wallet using older versions of xrpl.js, you may need to specify that you are using `secp256k1` as the algorithm to decode your private key / seed / etc to get the same behavior as before. See below for specifically how to update your code.
If you are creating new accounts each time (ex. via `Client.fundWallet` or `Wallet.generate`), you do not need to specify the signing algorithm.
**Before**
```
Wallet.fromSeed('s...')
Wallet.fromEntropy(entropy)
deriveKeyPair(seed="s...")
```
**After**
```
Wallet.fromSeed(seed='s...',algorithm: 'ecdsa-secp256k1')
Wallet.fromEntropy(entropy, opts={algorithm: 'ecdsa-secp256k1'})
deriveKeypair(seed='s...', opts={ algorithm: 'ecdsa-secp256k1' }) (ripple-keypairs)
```
### 9. `AssertionError` → `Error`

View File

@@ -19,13 +19,13 @@ See the full reference documentation for all classes, methods, and utilities.
4. Subscribing to changes in the ledger ([Ex. ledger, transactions, & more...](https://xrpl.org/subscribe.html))
5. Parsing ledger data into more convenient formats ([`xrpToDrops`](https://js.xrpl.org/functions/xrpToDrops.html) and [`rippleTimeToISOTime`](https://js.xrpl.org/functions/rippleTimeToISOTime.html))
All of which works in Node.js (tested for v16+) & web browsers (tested for Chrome).
All of which works in Node.js (tested for v18+) & web browsers (tested for Chrome).
# Quickstart
### Requirements
+ **[Node.js v16](https://nodejs.org/)** is recommended. We also support v18 and v20. Other versions may work but are not frequently tested.
+ **[Node.js v18](https://nodejs.org/)** is recommended. We also support v20. Other versions may work but are not frequently tested.
### Installing xrpl.js
@@ -56,7 +56,7 @@ async function main() {
});
console.log(response);
client.disconnect();
await client.disconnect();
}
main();
```

View File

@@ -1,31 +1,31 @@
# Unique Setup Steps for Xrpl.js
# Unique Setup Steps for Xahau.js
Starting in 3.0 xrpl and all the packages in this repo no longer require custom configurations (ex. polyfills) to run.
Starting in 3.0 xahau and all the packages in this repo no longer require custom configurations (ex. polyfills) to run.
### Using xrpl.js from a CDN
### Using xahau.js from a CDN
You can avoid setting up your build system to handle `xrpl.js` by using a cdn version that is prebuilt for the browser.
You can avoid setting up your build system to handle `xahau.js` by using a cdn version that is prebuilt for the browser.
- 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>`
- 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>`
Ensure that the full path is provided so the browser can find the sourcemaps.
### Using xrpl.js with `create-react-app`
### Using xahau.js with `create-react-app`
Starting in 3.0 xrpl and its related packages no longer require custom configurations (ex. polyfills) to run.
Starting in 3.0 xahau and its related packages no longer require custom configurations (ex. polyfills) to run.
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
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
### Using xrpl.js with React Native
### Using xahau.js with React Native
If you want to use `xrpl.js` with React Native you will need to install polyfills for core NodeJS modules.
If you want to use `xahau.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 xrpl \
npm install xahau \
fast-text-encoding \
react-native-get-random-values
```
@@ -36,7 +36,7 @@ If you want to use `xrpl.js` with React Native you will need to install polyfill
# 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 xrpl.js with Vite React
### Using xahau.js with Vite React
Starting in 3.0 xrpl and all the packages in this repo no longer require custom configurations (ex. polyfills) to run.
Starting in 3.0 xahau and all the packages in this repo no longer require custom configurations (ex. polyfills) to run.
### Using xrpl.js with Deno
### Using 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:
Until official support for [Deno](https://deno.land) is added, you can use the following work-around to use `xahau.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 xrpl from 'https://dev.jspm.io/npm:xrpl';
import xahau from 'https://dev.jspm.io/npm:xahau';
(async () => {
const api = new (xrpl as any).Client('wss://s.altnet.rippletest.net:51233');
const api = new (xahau as any).Client('wss://xahau-test.net');
const address = 'rH8NxV12EuV...khfJ5uw9kT';
api.connect().then(() => {

View File

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

440
migrate.ts Normal file
View File

@@ -0,0 +1,440 @@
// 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}`);
});

9656
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
{
"name": "xrpl.js",
"name": "xahau.js",
"private": true,
"scripts": {
"analyze": "lerna run analyze --stream",
@@ -16,16 +16,16 @@
"dependencies": {
"@xrplf/isomorphic": "file:packages/isomorphic",
"@xrplf/secret-numbers": "file:packages/secret-numbers",
"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"
"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"
},
"devDependencies": {
"@types/chai": "^4.2.21",
"@types/jest": "^29.2.2",
"@types/lodash": "^4.14.136",
"@types/node": "^16.18.38",
"@types/node": "^18.19.29",
"@types/ws": "^8.2.0",
"@typescript-eslint/eslint-plugin": "^5.28.0",
"@typescript-eslint/parser": "^5.28.0",
@@ -64,7 +64,7 @@
"./packages/*"
],
"engines": {
"node": ">=16.0.0",
"node": ">=18.0.0",
"npm": ">=7.10.0 < 10.0.0"
}
}

View File

@@ -1,5 +1,13 @@
# @xrplf/isomorphic Release History
## Unreleased
## 1.0.1 (2024-06-03)
### Fixed
* Throw error if `hexToBytes` or `hexToString` is provided a string that is not in hex
## 1.0.0 (2024-02-01)
Initial release providing isomorphic and tree-shakable implementations of:
@@ -14,21 +22,3 @@ Initial release providing isomorphic and tree-shakable implementations of:
* randomBytes
* stringToHex
* ws
## 1.0.0 Beta 1 (2023-11-30)
## Added
* hexToString
* stringToHex
## 1.0.0 Beta 0 (2023-10-19)
Initial release providing isomorphic and tree-shakable implementations of:
* ripemd160
* sha256
* sha512
* bytesToHash
* hashToBytes
* randomBytes
* ws_

View File

@@ -1,11 +1,11 @@
{
"name": "@xrplf/isomorphic",
"version": "1.0.0",
"version": "1.0.1",
"description": "A collection of isomorphic and tree-shakeable crypto hashes and utils for xrpl.js",
"keywords": [
"crypto",
"isomorphic",
"xrpl"
"xahau"
],
"scripts": {
"build": "tsc --build ./tsconfig.build.json",
@@ -33,7 +33,7 @@
"ws": "^8.13.0"
},
"devDependencies": {
"@types/node": "^16.18.38",
"@types/node": "^18.18.38",
"@types/ws": "^8.5.6"
},
"repository": {
@@ -43,6 +43,6 @@
"license": "ISC",
"prettier": "@xrplf/prettier-config",
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
}
}

View File

@@ -9,6 +9,7 @@ import type {
RandomBytesFn,
StringToHexFn,
} from './types'
import { HEX_REGEX } from './shared'
/* eslint-disable func-style -- Typed to ensure uniformity between node and browser implementations and docs */
export const bytesToHex: typeof BytesToHexFn = (bytes) => {
@@ -22,6 +23,9 @@ export const bytesToHex: typeof BytesToHexFn = (bytes) => {
export const hexToBytes: typeof HexToBytesFn = (hex): Uint8Array => {
const len = hex.length
const array = new Uint8Array(len / 2)
if (!HEX_REGEX.test(hex)) {
throw new Error('Invalid hex string')
}
for (let i = 0; i < array.length; i++) {
const j = i * 2
const hexByte = hex.slice(j, j + 2)

View File

@@ -1,6 +1,7 @@
import { randomBytes as cryptoRandomBytes } from 'crypto'
import type { BytesToHexFn, HexToBytesFn, RandomBytesFn } from './types'
import { HexToStringFn, StringToHexFn } from './types'
import { HEX_REGEX } from './shared'
const OriginalBuffer = Symbol('OriginalBuffer')
@@ -64,6 +65,9 @@ export const bytesToHex: typeof BytesToHexFn = (bytes) => {
}
export const hexToBytes: typeof HexToBytesFn = (hex) => {
if (!HEX_REGEX.test(hex)) {
throw new Error('Invalid hex string')
}
return toUint8Array(Buffer.from(hex, 'hex'))
}
@@ -75,6 +79,9 @@ export const hexToString: typeof HexToStringFn = (
hex: string,
encoding = 'utf8',
): string => {
if (!HEX_REGEX.test(hex)) {
throw new Error('Invalid hex string')
}
return new TextDecoder(encoding).decode(hexToBytes(hex))
}

View File

@@ -1,5 +1,7 @@
import { concatBytes } from '@noble/hashes/utils'
export const HEX_REGEX = /^[A-F0-9]*$/iu
export function concat(views: Uint8Array[]): Uint8Array {
return concatBytes(...views)
}

View File

@@ -23,10 +23,18 @@ describe('utils', function () {
expect(hexToBytes('DEADBEEF')).toEqual(new Uint8Array([222, 173, 190, 239]))
})
it('hexToBytes - DEADBEEF', () => {
expect(hexToBytes('DEADBEEF')).toEqual(new Uint8Array([222, 173, 190, 239]))
})
it('bytesToHex - DEADBEEF', () => {
expect(bytesToHex([222, 173, 190, 239])).toEqual('DEADBEEF')
})
it('bytesToHex - bad hex', () => {
expect(() => hexToBytes('hello')).toThrow(new Error('Invalid hex string'))
})
it('bytesToHex - 010203', () => {
expect(bytesToHex([1, 2, 3])).toEqual('010203')
})
@@ -43,6 +51,10 @@ describe('utils', function () {
expect(hexToString('6465616462656566D68D')).toEqual('deadbeef֍')
})
it('hexToString - bad hex', () => {
expect(() => hexToString('hello')).toThrow(new Error('Invalid hex string'))
})
it('stringToHex - deadbeef+infinity symbol (utf8)', () => {
expect(stringToHex('deadbeef֍')).toEqual('6465616462656566D68D')
})

View File

@@ -19,24 +19,3 @@ Subscribe to [the **xrpl-announce** mailing list](https://groups.google.com/g/xr
* Unit tests run in a browser and node.
* Remove `brorand` as a dependency and use `@xrplf/isomorphic` instead.
* Eliminates 4 runtime dependencies: `base-x`, `base64-js`, `buffer`, and `ieee754`.
## 1.0.0 Beta 1 (2023-11-30)
### BREAKING CHANGES:
* Moved all methods that were on `Utils` are now individually exported.
* `Buffer` has been replaced with `UInt8Array` for both params and return values. `Buffer` may continue to work with params since they extend `UInt8Arrays`.
### Changes
* Eliminates 4 runtime dependencies: `base-x`, `base64-js`, `buffer`, and `ieee754`.
## 1.0.0 Beta 0 (2023-10-19)
* Add `xrpl-secret-numbers` by @WietseWind to the mono repo.
* `unpkg` and `jsdelivr` support was simplified.
* Unit tests run in a browser and node.
* Remove `brorand` as a dependency and use `@xrplf/isomorphic` instead.
### BREAKING CHANGES:
* `xrpl-secret-numbers` is now `@xrplf/secret-numbers`.
* The bundled file produced changed from `dist/browerified.js` to `build/xrplf-secret-numbers-latest.js`.
* Bundle variable is `xrplf_secret_numbers` instead of using browserify's loader.

View File

@@ -30,7 +30,7 @@
},
"dependencies": {
"@xrplf/isomorphic": "^1.0.0",
"ripple-keypairs": "^2.0.0"
"xahau-keypairs": "^2.0.0"
},
"prettier": "@xrplf/prettier-config",
"repository": {
@@ -40,8 +40,8 @@
"license": "ISC",
"readmeFilename": "README.md",
"keywords": [
"xrp",
"xrpl-ledger",
"xah",
"xahau-ledger",
"multi sign",
"sign"
]

View File

@@ -1,4 +1,4 @@
import { deriveAddress, deriveKeypair, generateSeed } from 'ripple-keypairs'
import { deriveAddress, deriveKeypair, generateSeed } from 'xahau-keypairs'
import {
entropyToSecret,

View File

@@ -1,5 +1,5 @@
import { hexToBytes } from '@xrplf/isomorphic/utils'
import { deriveAddress, deriveKeypair, generateSeed } from 'ripple-keypairs'
import { deriveAddress, deriveKeypair, generateSeed } from 'xahau-keypairs'
import { Account, secretToEntropy } from '../src'

View File

@@ -6,7 +6,7 @@
"include": ["./src/**/*.ts", "./src/**/*.json"],
"references": [
{
"path": "../ripple-keypairs/tsconfig.json"
"path": "../xahau-keypairs/tsconfig.json"
}
]
}

View File

@@ -15,25 +15,6 @@
* Eliminates 4 runtime dependencies: `base-x`, `base64-js`, `buffer`, and `ieee754`.
* Execute test in a browser in addition to node
## 5.0.0 Beta 1 (2023-11-30)
### Breaking Changes
* `Buffer` has been replaced with `UInt8Array` for both params and return values. `Buffer` may continue to work with params since they extend `UInt8Arrays`.
### Changes
* Eliminates 4 runtime dependencies: `base-x`, `base64-js`, `buffer`, and `ieee754`.
## 5.0.0 Beta 0 (2023-10-19)
### Breaking Changes
* Bump typescript to 5.x
* Remove Node 14 support
* Remove `assert` dependency. If you were catching `AssertionError` you need to change to `Error`.
* Remove `create-hash` in favor of `@noble/hashes`
### Changes
* Execute test in a browser in addition to node
## 4.3.1 (2023-09-27)
### Fixed
* Fix source-maps not finding their designated source

View File

@@ -1,5 +1,5 @@
{
"name": "ripple-address-codec",
"name": "xahau-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": [
"ripple",
"xrp",
"xrp ledger",
"xrpl"
"xahau",
"xah",
"xahau ledger",
"xahau"
],
"repository": {
"type": "git",
@@ -34,6 +34,6 @@
},
"prettier": "@xrplf/prettier-config",
"engines": {
"node": ">= 16"
"node": ">= 18"
}
}

View File

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

View File

@@ -2,6 +2,14 @@
## Unreleased
## 2.1.0 (2024-06-03)
### Added
* Support for the Price Oracles amendment (XLS-47).
### Fixed
* Better error handling/error messages for serialization/deserialization errors.
## 2.0.0 (2024-02-01)
### BREAKING CHANGES
@@ -19,23 +27,6 @@
* `Comparable` is now a generic type so that it allows `compareTo` methods to take more that the type itself.
* Eliminates 4 runtime dependencies: `base-x`, `base64-js`, `buffer`, and `ieee754`.
## 2.0.0 Beta 1 (2023-11-30)
### Breaking Changes
* `Buffer` has been replaced with `UInt8Array` for both params and return values. `Buffer` may continue to work with params since they extend `UInt8Arrays`.
### Changes
* Eliminates 4 runtime dependencies: `base-x`, `base64-js`, `buffer`, and `ieee754`.
## 2.0.0 Beta 0 (2023-10-19)
### Breaking Changes
* Bump typescript to 5.x
* Remove Node 14 support
* Remove decimal.js and big-integer. Use `BigNumber` from `bignumber.js` instead of `Decimal` and the native `BigInt` instead of `bigInt`.
* Remove `assert` dependency. If you were catching `AssertionError` you need to change to `Error`.
* Remove `create-hash` in favor of `@noble/hashes`
### Changes
* Update type definitions which causing errors in tests that the code already supported
* `makeParser` to accept a `Buffer` in addition to `string`

View File

@@ -1,6 +1,6 @@
{
"name": "ripple-binary-codec",
"version": "2.0.0",
"name": "xahau-binary-codec",
"version": "2.1.0",
"description": "XRP Ledger binary codec",
"files": [
"dist/*",
@@ -11,9 +11,9 @@
"test": "test"
},
"dependencies": {
"@xrplf/isomorphic": "^1.0.0",
"@xrplf/isomorphic": "^1.0.1",
"bignumber.js": "^9.0.0",
"ripple-address-codec": "^5.0.0"
"xahau-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": [
"ripple",
"xrp",
"xrp ledger",
"xrpl"
"xahau",
"xah",
"xahau ledger",
"xahau"
],
"repository": {
"type": "git",
@@ -41,6 +41,6 @@
"readmeFilename": "README.md",
"prettier": "@xrplf/prettier-config",
"engines": {
"node": ">= 16"
"node": ">= 18"
}
}

View File

@@ -23,6 +23,7 @@
"UInt512": 23,
"Issue": 24,
"XChainBridge": 25,
"Currency": 26,
"Transaction": 10001,
"LedgerEntry": 10002,
"Validation": 10003,
@@ -51,6 +52,7 @@
"NFTokenOffer": 55,
"AMM": 121,
"DID": 73,
"Oracle": 128,
"Any": -3,
"Child": -2,
"Nickname": 110,
@@ -208,6 +210,16 @@
"type": "UInt8"
}
],
[
"Scale",
{
"nth": 4,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "UInt8"
}
],
[
"TickSize",
{
@@ -498,6 +510,16 @@
"type": "UInt32"
}
],
[
"LastUpdateTime",
{
"nth": 15,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "UInt32"
}
],
[
"HighQualityIn",
{
@@ -828,6 +850,16 @@
"type": "UInt32"
}
],
[
"OracleDocumentID",
{
"nth": 51,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "UInt32"
}
],
[
"IndexNext",
{
@@ -1028,6 +1060,16 @@
"type": "UInt64"
}
],
[
"AssetPrice",
{
"nth": 23,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "UInt64"
}
],
[
"EmailHash",
{
@@ -1918,6 +1960,26 @@
"type": "Blob"
}
],
[
"AssetClass",
{
"nth": 28,
"isVLEncoded": true,
"isSerialized": true,
"isSigningField": true,
"type": "Blob"
}
],
[
"Provider",
{
"nth": 29,
"isVLEncoded": true,
"isSerialized": true,
"isSigningField": true,
"type": "Blob"
}
],
[
"Account",
{
@@ -2128,6 +2190,26 @@
"type": "PathSet"
}
],
[
"BaseAsset",
{
"nth": 1,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "Currency"
}
],
[
"QuoteAsset",
{
"nth": 2,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "Currency"
}
],
[
"LockingChainIssue",
{
@@ -2458,6 +2540,16 @@
"type": "STObject"
}
],
[
"PriceData",
{
"nth": 32,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "STObject"
}
],
[
"Signers",
{
@@ -2628,6 +2720,16 @@
"type": "STArray"
}
],
[
"PriceDataSeries",
{
"nth": 24,
"isVLEncoded": false,
"isSerialized": true,
"isSigningField": true,
"type": "STArray"
}
],
[
"AuthAccounts",
{
@@ -2656,6 +2758,7 @@
"telWRONG_NETWORK": -386,
"telREQUIRES_NETWORK_ID": -385,
"telNETWORK_ID_MAKES_TX_NON_CANONICAL": -384,
"telENV_RPC_FAILED": -383,
"temMALFORMED": -299,
"temBAD_AMOUNT": -298,
@@ -2703,6 +2806,8 @@
"temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT": -256,
"temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT": -255,
"temEMPTY_DID": -254,
"temARRAY_EMPTY": -253,
"temARRAY_TOO_LARGE": -252,
"tefFAILURE": -199,
"tefALREADY": -198,
@@ -2739,7 +2844,6 @@
"terQUEUED": -89,
"terPRE_TICKET": -88,
"terNO_AMM": -87,
"terSUBMITTED": -86,
"tesSUCCESS": 0,
@@ -2815,7 +2919,11 @@
"tecXCHAIN_SELF_COMMIT": 184,
"tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR": 185,
"tecXCHAIN_CREATE_ACCOUNT_DISABLED": 186,
"tecEMPTY_DID": 187
"tecEMPTY_DID": 187,
"tecINVALID_UPDATE_TIME": 188,
"tecTOKEN_PAIR_NOT_FOUND": 189,
"tecARRAY_EMPTY": 190,
"tecARRAY_TOO_LARGE": 191
},
"TRANSACTION_TYPES": {
"Invalid": -1,
@@ -2864,6 +2972,8 @@
"XChainCreateBridge": 48,
"DIDSet": 49,
"DIDDelete": 50,
"OracleSet": 51,
"OracleDelete": 52,
"EnableAmendment": 100,
"SetFee": 101,
"UNLModify": 102

View File

@@ -3,7 +3,7 @@ import {
XrplDefinitionsBase,
FieldInstance,
Bytes,
} from './xrpl-definitions-base'
} from './xahau-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 './xrpl-definitions-base'
} from './xahau-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/xrpl-definitions'
import { XrplDefinitions } from './enums/xahau-definitions'
import { coreTypes } from './types'
import { bytesToHex } from '@xrplf/isomorphic/utils'

View File

@@ -144,14 +144,18 @@ class BinaryParser {
if (type === 0) {
type = this.readUInt8()
if (type === 0 || type < 16) {
throw new Error('Cannot read FieldOrdinal, type_code out of range')
throw new Error(
`Cannot read FieldOrdinal, type_code ${type} out of range`,
)
}
}
if (nth === 0) {
nth = this.readUInt8()
if (nth === 0 || nth < 16) {
throw new Error('Cannot read FieldOrdinal, field_code out of range')
throw new Error(
`Cannot read FieldOrdinal, field_code ${nth} out of range`,
)
}
}

View File

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

View File

@@ -33,6 +33,9 @@ class Blob extends SerializedType {
}
if (typeof value === 'string') {
if (!/^[A-F0-9]*$/iu.test(value)) {
throw new Error('Cannot construct Blob from a non-hex string')
}
return new Blob(hexToBytes(value))
}

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 !== 'XRP') {
if (iso !== 'XAH') {
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 === 'XRP') {
if (iso === 'XAH') {
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 = 'XRP'
this._iso = 'XAH'
} else if (STANDARD_FORMAT_HEX_REGEX.test(hex)) {
this._iso = isoCodeFromHex(this.bytes.slice(12, 15))
} else {

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() === 'XRP') {
if (new Currency(currency).toJSON() === 'XAH') {
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() === 'XRP') {
if (currency.toJSON() === 'XAH') {
return { currency: currency.toJSON() }
}
const issuer = AccountID.fromParser(parser) as AccountID

View File

@@ -14,7 +14,13 @@ const OBJECT_END_MARKER = Uint8Array.from([0xe1])
*/
function isObjects(args): args is Array<JsonObject> {
return (
Array.isArray(args) && (args.length === 0 || typeof args[0] === 'object')
Array.isArray(args) &&
args.every(
(arg) =>
typeof arg === 'object' &&
Object.keys(arg).length === 1 &&
typeof Object.values(arg)[0] === 'object',
)
)
}

View File

@@ -5,7 +5,7 @@ import {
XrplDefinitionsBase,
} from '../enums'
import { SerializedType, JsonObject } from './serialized-type'
import { xAddressToClassicAddress, isValidXAddress } from 'ripple-address-codec'
import { xAddressToClassicAddress, isValidXAddress } from 'xahau-address-codec'
import { BinaryParser } from '../serdes/binary-parser'
import { BinarySerializer, BytesList } from '../serdes/binary-serializer'

View File

@@ -1,5 +1,6 @@
import fixtures from './fixtures/codec-fixtures.json'
import { decode, encode, decodeLedgerData } from '../src'
// import { decode, encode, decodeLedgerData } from '../src'
import { decode, encode } from '../src'
function json(object) {
return JSON.stringify(object)
@@ -30,16 +31,17 @@ describe('ripple-binary-codec', function () {
makeSuite('transactions', fixtures.transactions)
makeSuite('accountState', fixtures.accountState)
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)
})
})
}
})
// 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)
// })
// })
// }
// })
})

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 'ripple-address-codec'
import { encodeAccountID } from 'xahau-address-codec'
import { Field, TransactionType } from '../src/enums'
import { makeParser, readJSON } from '../src/binary'
import { BytesList } from '../src/serdes/binary-serializer'
@@ -238,19 +238,19 @@ function fieldParsingTests() {
it('Field throws when type code out of range', () => {
const parser = makeParser('0101')
expect(() => parser.readField()).toThrow(
new Error('Cannot read FieldOrdinal, type_code out of range'),
new Error('Cannot read FieldOrdinal, type_code 1 out of range'),
)
})
it('Field throws when field code out of range', () => {
const parser = makeParser('1001')
expect(() => parser.readFieldOrdinal()).toThrow(
new Error('Cannot read FieldOrdinal, field_code out of range'),
new Error('Cannot read FieldOrdinal, field_code 1 out of range'),
)
})
it('Field throws when both type and field code out of range', () => {
const parser = makeParser('000101')
expect(() => parser.readFieldOrdinal()).toThrow(
new Error('Cannot read FieldOrdinal, type_code out of range'),
new Error('Cannot read FieldOrdinal, type_code 1 out of range'),
)
})
it('readUIntN', () => {
@@ -387,7 +387,7 @@ function pathSetBinaryTests() {
currency: 'BTC',
issuer: 'r3AWbdp2jQLXLywJypdoNwVSvr81xs3uhn',
},
{ currency: 'XRP' },
{ currency: 'XAH' },
{
currency: 'USD',
issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B',

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