- 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>
- 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.
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>
- 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
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`.
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.
fix: source-maps find their designate source
We weren't including the `src` folder in the files published too npm.
This caused errors such as the following seen in the sandbox and by
users on discord.
```
WARNING in ./node_modules/xrpl/dist/npm/utils/xrpConversion.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/sandbox/node_modules/xrpl/src/utils/xrpConversion.ts' file: Error: ENOENT: no such file or directory, open '/sandbox/node_modules/xrpl/src/utils/xrpConversion.ts'
```
* Polyfill with "buffer" and "assert" for browser environments
* Instead of relying on webpack to make this library browser compatible, we now use a buffer library that provides a polyfill when used in the browser