Commit Graph

832 Commits

Author SHA1 Message Date
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]
a528d6632a build(deps-dev): bump typedoc from 0.25.0 to 0.26.2 (#2712) 2024-06-25 13:59:07 +00: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
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
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
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
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
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
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
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
Caleb Kniffen
a09084289b release: xrpl.js 3.0 (#2633)
- @xrplf/isomorphic@1.0.0
 - ripple-address-codec@5.0.0
 - ripple-binary-codec@2.0.0
 - ripple-keypairs@2.0.0
 - @xrplf/secret-numbers@1.0.0
 - xrpl@3.0.0
2024-02-01 15:48:48 -06:00
Caleb Kniffen
63c71a162d release: xrpl@3.0.0-beta.1 and friends (#2592)
Release beta versions of all the packages and fix history file version numbers for first beta.
2024-02-01 13:54:11 -06:00
Caleb Kniffen
38b385969b feat: remove Buffer support and bundle polyfill (#2526)
- Removes need for bundlers to polyfill the `Buffer` class. `UInt8Array` are used instead which are native to the browser and node.
- Reduces bundle size 7.1kb gzipped and eliminates 4 runtime dependencies: `base-x`, `base64-js`, `buffer`, and `ieee754`.

BREAKING CHANGE: All methods that previously took a `Buffer` now accept a `UInt8Array`.

---------

Co-authored-by: Jackson Mills <jmills@ripple.com>
2024-02-01 13:53:41 -06:00
Mayukha Vadari
eefb52a9cb fix: add support for pseudo-transactions to hashSignedTx (#2588)
* add support for pseudo-transactions to hashSignedTx

* update changelog

* fix tests

* fix linter + tests
2024-02-01 13:53:41 -06:00
Caleb Kniffen
e2433101cb test: run binary-codec tests in the browser (#2566)
- Convert tests to typescript
- Update type definitions causing errors in tests
  - `makeParser` to accept a `Buffer` in addition to `string`
  - `SerializedType` constructor allows not passing in a byte array
  - `Comparable` is now a generic type so that it allows `compareTo`
methods to take more that the type itself. Example: `Uint64.compareTo`
can accept `number`
- Update tests to use jasmine compatible functions
  - Switching from `test` to `it`.
  - Updated test checking if coretypes all implement SerializedType
  - Import fixtures directly instead of using `loadFixture` utility
- Remove importing of `buffer/` explicitly.  It was throwing off type
checking in tests.  Buffer is going away in a future PR anyway.
- Fixed `npm run clean` not clearing `.tsbuildinfo` files for keypairs
- Remove unused account-tx-transactions.db. It was likely used in the
past to test historical ledgers.
2024-02-01 13:53:40 -06:00
Caleb Kniffen
4c7f46c111 feat: getXrpBalance and dropsToXRP return number (#2574)
BREAKING CHANGE: `dropsToXRP` and `Client.getXrpBalance` now return a `number` instead of a `string`
2024-02-01 13:53:40 -06:00
Caleb Kniffen
960182ecc3 feat: add unit tests for collection utils (#2564)
Closes #2406
2024-02-01 13:53:40 -06:00
Caleb Kniffen
134924c395 feat: remove assert library as a testing dep (#2563)
Right now we have 5 testing library dependencies. This eliminates
`assert`. `jest`, `jasmine`, `chai` and `karma` are the remaining ones.
2024-02-01 13:53:40 -06:00
Caleb Kniffen
e8f89db00c test: run ripple-keypairs tests in the browser (#2558)
- Update tests to use jasmine compatible functions. This means removing `toThrowErrorMatchingInlineSnapshot` and manually removing indention to compare some of the complexly formatted error messages.
- Remove usages of `assert` library in keypairs tests.
2024-02-01 13:53:40 -06:00
Caleb Kniffen
88d8a7b73e fix: faucet errors not showing returned body (#2452)
fetch only lets you read the body once so we need to save the variable

Before it would throw TypeError: body used already for: https://faucet.devnet.rippletest.net/accounts
2024-02-01 13:53:40 -06:00
Caleb Kniffen
83b9780b5b refactor: remove import * where able (#2550)
refactor: remove `import *` where able to

BREAKING CHANGE: Moved all methods that were on `Utils` in
`@xrplf/secret-numbers` are now individually exported. This affects:
- Utils.randomEntropy,
- Utils.randomSecret
- Utils.entropyToSecret
- Utils.secretToEntropy
- Utils.calculateChecksum
- Utils.checkChecksum
- Utils.parseSecretString
2024-02-01 13:53:40 -06:00
Caleb Kniffen
3f1739895a refactor: type Transaction to include all tx (#2547)
refactor: type Transaction to include all tx

BREAKING CHANGE: `Transaction` type has been redefined to include all
transactions and `SubmittableTransaction` was created to define the old
value. The following functions which only handle transactions to be
submitted now use `SubmittableTransaction`:
  * `Client.autofill`
  * `Client.submit`
  * `Client.submitAndWait`
  * `Client.prepareTransaction`
  * `getSignedTx`
  * `isAccountDelete`
2024-02-01 13:53:40 -06:00
Caleb Kniffen
fa4eabef0e chore(lint): apply prettier to secret-numbers (#2549)
The config was not applied when it was moved to the monorepo
2024-02-01 13:53:40 -06:00
Caleb Kniffen
c5fc25efc2 release: 3.0.0-beta.0 (#2533) 2024-02-01 13:53:39 -06:00
Caleb Kniffen
294509cf79 feat: isomorphic sockets and use eventemitter3 (#2514)
Reduces filesize by 3kb minified and gzipped or 2.8% and reduces bundler
config steps.

- Move `WSWrapper` to `@xrpl/isomorphic` to remove the need to add
mapping of `ws` to `WSWrapper` file in bundler configs
- Switch to `eventemitter3` which is smaller than `events` by almost
1kb and will not require a mapping to node's `events` in `vite`
bundling. `webpack` always automatically maps it.
    - max listeners is not a thing for `eventemitter3` so we do not
need to set it to `Infinity`. `ws` uses the native event emitter which
does still need that to be set.
- Remove `eventemitter2` which was only used in tests and was replaced
with `eventemitter3`

BREAKING CHANGE: Config for frontend bundlers has changed for `ws`.
2024-02-01 13:52:15 -06:00
Caleb Kniffen
3c8a990e6a docs: End of Life ripple-lib (#2433)
With `xrpl@3.0` coming out we are fully ending support for ripple-lib
2024-02-01 13:50:22 -06:00
Nicholas Dudfield
217b111ef2 feat: use @noble and @scure libraries for cryptography (#2273)
Switch to using `@noble/hashes`, `@noble/curves`, `@scure/base`,
`@scure/bip32`, and `@scure/bip39`. This replaces `crypto` polyfills
(such as `crypto-browserify`), `create-hash`, `elliptic`, `hash.js`,
`bn.js` (both versions), and their many dependencies.  This also means
there are 33 less dependencies downloaded when running a fresh
`npm install` and will make the project much easier to maintain.

This reduces the bundle size by 44% (82kb minified and gzipped) over
the current 3.0 branch as well as reducing the amount of configuration
required to bundle.

Closes #1814, #1817, #2272, and #2306

Co-authored-by: Caleb Kniffen <ckniffen@ripple.com>
2024-02-01 13:50:19 -06:00
Caleb Kniffen
5607320ce2 cleanup: remove dupe tests, update lock and docs (#2505)
- Remove tests from `ripple-keypairs` that exclusively tested
`rippled-address-codec`. The tests in `codec.test.ts` and
`xrp-codec.test.ts` are all present and accounted for in
`packages/ripple-address-codec/test/xrp-codec.test.ts`.
- Update `package-lock.json` after the rebase with main
- Remove references to `decimal.js` in the documentation
* add missing entry for `bignumber.js` to `ripple-binary-codec`

This will clean up the diff for #2273
2024-02-01 13:45:11 -06:00
Caleb Kniffen
c143dc3e99 test: run address-codec tests in the browser (#2466)
Update tests to use jasmine compatible functions.

This means changing `test` to `it`, `toStrictEqual` to `toEqual` (which
is still strict), `toThrowError` to `toError`, and updating the param
for toError to pass an `Error` object.

Remove the need to specify --single-run.
2024-02-01 13:45:11 -06:00
Caleb Kniffen
83870acbfb fix: remove need to --force builds + cleanup (#2468)
This is done by properly deleting all build files.

Package-lock was due to it not reflecting the license of
@xrplf/secret-numbers.  This was fixed by running `npm i`.
2024-02-01 13:45:11 -06:00
tequ
83442b18ba Add nftoken_id, nftoken_ids, offer_id to meta fields (#2450)
Add type for metadata for specific transactions(`Payment`, `NFTokenMint`, `NFTokenCreateOffer`, `NFTokenAcceptOffer`, `NFTokenCancelOffer`)

Closes #2316
2024-02-01 13:45:11 -06:00
Caleb Kniffen
1a83997e49 feat: add xrpl-secret-numbers to the monorepo (#2445)
- Add `xrpl-secret-numbers` by @WietseWind  to the mono repo.
- `unpkg` and `jsdelivr` support was simplified by adding fields to package.json.
- Unit tests run in a browser and node.

BREAKING CHANGES:
- `xrpl-secret-numbers` is now `@xrplf/secret-numbers`.
- Changed 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.
- If using CDN instructions in README will need to update to `https://cdn.jsdelivr.net/npm/@xrplf/secret-numbers`

Making this library part of the monorepo was discussed in #1788.  This solves several problems with the upcoming `xrpl.js@3.0`.

`xrpl-secret-numbers` has a dependency of `ripple-keypairs` and `xrpl` has a depenendecy on `xrpl-secret-numbers`.  This means that any change would require a separate release of `ripple-keypairs`, then a release of `xrpl-secret-numbers`, followed by `xrpl`.  Now they can be released all at once

In 3.0 we eliminated the need for many polyfills like `util`, `assert`, and soon to be `buffer` (after noble libs PR is merged).  `xrpl-secret-numbers` still needs those.  This will also eliminate them and anytime similar changes in the future will be much easier.  This further reduces the bundle size of 3.0 branch by over 10% as well as reducing bundler setup.
2024-02-01 13:45:11 -06:00
Caleb Kniffen
3d86318195 test: update address-codec tests to typescript (#2447)
- Switch files to typescript
- Add missing types in test files
- Change how the codec functions were imported. They now count towards the "% Funcs" calculation, increasing it from 75% to 100%.
- Lint test files
2024-02-01 13:45:11 -06:00
Jackson Mills
9676b218b7 Re-add the walletFromSecretNumbers custom algorithm test (#2437)
Re-add test
2024-02-01 13:45:11 -06:00
Caleb Kniffen
cddb048588 feat: remove util polyfill and fix HISTORY.md (#2432)
- Remove `util` from bundle by switching `inspect` to `JSON.stringify`
- Update `HISTORY.md` with latest 3.0 changes
2024-02-01 13:45:09 -06:00
justinr1234
3b70a3b919 fix: make docs not output confusing information in xrpl client (#2337)
* fix: make docs not output confusing information in xrpl client

---------

Co-authored-by: Jackson Mills <jmills@ripple.com>
Co-authored-by: Caleb Kniffen <ckniffen@ripple.com>
2024-02-01 13:43:55 -06:00
Caleb Kniffen
21c2423bac test: remove extra polyfills only for testing (#2428)
Removes the testing polyfills by using jasmine and not jest in the
browser. We were already using jasmine but where overriding those
methods with jest versions which was not needed.

The previous karma setup also used a single entrypoint which meant that
not all integration tests were running because all files were not
imported in integrations/index.ts.

This also eliminates 79 dev dependencies.
2024-02-01 13:43:55 -06:00
Jackson Mills
a0e53ac9e1 fix: Fix invariant assertion in binary-codec (#2429)
* Fix assertion

* Add a test
2024-02-01 13:43:55 -06:00
Jackson Mills
041055082a BREAKING CHANGE(fix): deriveKeypair ignoring a manual algorithm being specified (#2376) 2024-02-01 13:43:55 -06:00
Caleb Kniffen
07afcea97d feat: remove BroadcastClient (#2408)
BREAKING CHANGE: `BroadcastClient` was removed. It was deprecated in 2.2
2024-02-01 13:43:55 -06:00
Caleb Kniffen
328987a0a3 feat(deps): remove assert-browserify (#2389)
Use if statements and manually error throwing to save 20kb gzipped.

BREAKING CHANGE: If you were catching AssertionError you need to change to Error.
2024-02-01 13:43:55 -06:00
Caleb Kniffen
0050b2f75e feat: remove 3 http related polyfills (#2375)
Switch to using fetch for browser and `node-fetch` for node for the faucet calls.  This reduces the webpack bundle by 3.2% or 16.5kb gzipped.

The fundWallet code has been refactored to be much more straight forward due to not having to do such low level operations.

This improves the frontend setup process by no longer requiring several polyfills such as `url`, `stream-http`, and `https-browserify`.
2024-02-01 13:43:55 -06:00
Caleb Kniffen
3b7dd4ea87 feat(deps): make https-proxy-agent optional (#2388)
Bump https-proxy-agent to v7 and a dev dependency. This makes
configuring bundlers easier to configure and removes a direct
dependency of `https-proxy-agent`.

BREAKING CHANGE: Configuring a proxy is done by specifying the
`agent` parameter on the ConnectionOptions config. This can use be
created by libraries such as `https-proxy-agent` or any that
implements `http.Agent`.
2024-02-01 13:43:55 -06:00
Caleb Kniffen
8caf2e45bb feat: remove decimal.js and big-integer (#2379)
Reduces the bundle size by 8% (41kb)

BigInteger is now well supported so the library is no longer needed.

BigNumber was already being used by xrpl and they had almost identical
interfaces as they are both based on Java.
2024-02-01 13:43:55 -06:00