Jackson Mills
a0e53ac9e1
fix: Fix invariant assertion in binary-codec ( #2429 )
...
* Fix assertion
* Add a test
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
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
Jackson Mills
e7e5a3a506
Add a CONTRIBUTING.md to ripple-binary-codec ( #2617 )
...
Add binary-codec-contributing doc
2024-01-23 15:44:44 -08:00
Mayukha Vadari
c8f25a6347
feat: add support for XLS-40d + add script to auto-generate models from rippled code ( #2491 )
...
Add support for XLS-40 and adds a script to automatically
generate transaction models from rippled source code.
### Context of Change
https://github.com/XRPLF/XRPL-Standards/pull/136
https://github.com/XRPLF/rippled/pull/4636
2023-11-15 16:19:50 -06:00
Mayukha Vadari
68beac73d1
test: add integration tests for sidechain transactions ( #2301 )
...
* add XChainCreateBridge integration test
* add XChainCreateClaimID integration test
* add XChainCommit integration test
* add XChainAccountCreateCommit integration test
* simplify tests
* add XChainModifyBridge integration test
* add XChainAddAccountCreateAttestation integration test
* add XChainAddClaimAttestation integration test
* improve SignerListSet integration test
* rename variable to match
* add XChainClaim integration test
* clean up
* add IOU attestation test
* fix integration tests issues
* minor refactors
* fix bug
* [WIP] switch to one bridge for all integration tests
* clean up
* fix tests
* fix + clean up tests
2023-10-25 10:08:58 -04:00
Mayukha Vadari
91e7369f1b
feat: add support for current sidechain design ( #2039 )
...
* Update definitions.json
* add new st types
* add tests
* add XChainClaim tx
* add XChainCommit tx
* add XChainCreateBridge tx
* add XChainCreateClaimID tx
* update definitions.json
* rename Bridge -> XChainBridge in binary codec, fix tests
* rename Bridge -> XChainBridge in models
* add codec support for XChainAddAttestation
* add XChainAddAttestation model
* undo debugging change
* fix linting issues
* update definitions.json for new rippled code, add new tests/update old tests
* add/update models
* update history
* update binary-codec
* add XChainModifyBridge model
* update RPCs
* update to latest rippled
* more fixes
* fix definitions.json
* fix spacing
* update definitions.json to avoid conflict with amm
* update definitions.json to resolve amm conflicts
* audit code
* more updates
* update rpcs
* switch to beta version
* add destination tag to XChainClaim
* rename IssuedCurrency -> Issue to match rippled
* update Issue form
* fix account object filters
* fix issue from typing
* fix LedgerEntry types
* fix attestation destination type
* Update definitions.json
* rename XChainAddAttestation -> XChainAddAttestationBatch
* add XChainAddClaimAttestation
* add XChainAddAccountCreateAttestation
* remove XChainAddAttestationBatch
* update definitions
* fix attestation txns
* fix attestation object
* add validate for new txs
* add Bridge ledger object
* add XChainOwnedClaimID ledger object
* add XChainOwnedCreateAccountClaimID ledger object
* update account_objects
* update models to latest rippled
* fix minor issues
* fix bridge ledger_entry
* add XChainModifyBridge flag
* Update definitions.json
* add rbc tests for the new txs
* update validateXChainModifyBridge
* add validate methods to other xchain txs
* fix isXChainBridge
* fix isIssue typing
* fix model types
* update changelog
* switch prepare to prepublishOnly
* add docs
* fix AccountObjectsType filter
* export common types
* fix account_objects filter
* update LedgerEntry
* add sidechain faucet info
* add snippet
* improve snippet
* fix spacing issues
* update ledger_entry
* remove AMMDelete tests for now
* Update definitions.json
* fix unit tests
* convert createValidate script to JS
* remove unneeded linter ignores
* respond to comments
* more snippet fixes
* make validate functions more readable
* add getXChainClaimID method to parse metadata
* re-add linter rules
* clean up common
* fix getXChainClaimID test
* return undefined for failed tx
* test: add model tests for new sidechain transactions (#2059 )
* add XChainAddAttestation tests, fix model
* add XChainClaim model tests
* add XChainCommit model tests, fix typo
* add XChainCreateBridge model tests
* add XChainCreateClaimID model tests
* add XChainModifyBridge tests
* update to most recent version of code
* remove XChainAddAttestationBatch tests
* add more validation tests
* switch createValidateTests to JS
2023-09-26 10:01:21 -04:00
Omar Khan
5581474627
feat: add AMM support ( #2071 )
...
* update definitions.json
* add AMMInstanceCreate
* renamed LPTokens to LPToken in definitions.json
* update HISTORY.md
* add amm_info RPC command
* add AMMDeposit
* use null check for missing fields
* add AMMWithdraw
* add AMMVote
* fix lint error
* add max trading fee check to AMMVote
* refactor MAX_TRADING_FEE to be in one place
* add AMMBid
* add AuthAccount interface to AMMBid
* refactor tests
* add AMMID to AMMInfoResponse
* update amm_info docstrings
* fix EPrice type to be Amount
* update EPrice validation error message and add missing tests
* update definitions to fix AMM in LEDGER_ENTRY_TYPES
* add missing test case Asset1In and Asset2In valid
* add missing test case Asset1Out and Asset2Out valid
* add negative FeeVal check
* update HISTORY.md to specify XLS-30
* update wording on AMMDeposit & AMMWithdraw validation errors
* add negative TradingFee check
* fix ammInfo response
* add AMMID as optional param in ammInfo response
* fix EPrice validation checks in AMMDeposit & AMMWithdraw
* add VoteSlots as optional param in AMMInfoResponse
* update VoteEntry interface
* fix deposit and withdraw tests
* fix AMMBid ValidationError
* update definitions.json with different AuthAccounts number
* Change amm_info asset parameters to Currency type
* API name changes with updated definitions.json
* rename amm_info param asset1 -> asset
* fix typo
* change AMM_MAX_TRADING_FEE to 1%
* Use Asset/Asset2 instead of AMMID for Deposit/Withdraw/Bid/Vote
* add Deposit/Withdraw flags
* rename FeeVal -> TradingFee in VoteEntry
* rename MinBidPrice -> BidMin and MaxBidPrice -> BidMax
* update definitions to change Asset & Asset2 nth values to 3 & 4
* update definitions
* add Issue type and tests for Asset/Asset2
* remove AMMID from amm_info and use Issue type
* update amm_info fields
* fix lint errors
* update unit tests
* add AMM codec-fixtures
* update Issue type
* add one asset and withdraw all tests
* refactor amm_info response fields to match AMMDevnet
* update definitions.json with refactored error codes
* update ammInfo.ts response model
* remove invalid fields from ammInfo.ts response model
* update time_interval description
* rename test model names and fix lint errors
* add Owner Reserve Fee for AMMCreate transaction
* add missing asset_frozen field
* replace Issue with IssuedCurrency
* refactor: convert flags to number
* update asset pair to use Currency type
* refactor isIssue to isCurrency
* add AMM ledger entry object, lsfAMM flag, amm fields to LedgerEntryRequest
* update definitions.json
* WIP defintions
* update codec-fixtures
* fix definitions test
* update DiscountedFee definition
* update definitions
* update codec-fixtures
* update definitions
* update unit tests
* update amm_info response
* sort imports/exports
* update jsdoc
* update amm_info jsdoc
* update jsdoc
* convert caution to all caps
* add validation for AuthAccounts
* refactor and export interfaces
* use Currency type
* update definitions
* add AMMDelete
* rename Issue to Currency in error message
* mark asset frozen as optional fields
* refactor isAuthAccounts
* add AMMDelete jsdoc
* rename to validateAuthAccounts
* fix typo
* fix typo in unit test
---------
Co-authored-by: Caleb Kniffen <ckniffen@ripple.com >
2023-08-17 22:42:32 -04:00
Shawn Xie
63ea6e8c9b
feat: add Clawback amendment support ( #2353 )
...
* Add Clawback transaction
* Account flag lsfAllowTrustLineClawback
* Support bitwise flag checking of 64 bit flags
2023-07-19 14:39:48 -05:00
Wietse Wind
d47a277e25
Fix #2361 - Custom definitions in STArray»STObject ( #2362 )
...
Custom binary codec fixes xrpl.js#2361 - missed param def
2023-07-14 09:45:31 -05:00
Denis Angell
5b0989df51
feature NetworkID ( #2216 )
...
Added network id to the base transaction
Added network id to the server_info response
Added network id to the binary codec
Added network id to client and modify on client.connect()
Added network id to autofill when rippled_version is 1.11.0 or later or network is hooks testnet
Co-authored-by: Phu Pham <ppham@ripple.com >
Co-authored-by: pdp2121 <71317875+pdp2121@users.noreply.github.com >
Co-authored-by: Jackson Mills <aim4math@gmail.com >
Co-authored-by: Mayukha Vadari <mvadari@gmail.com >
2023-06-14 15:15:18 -04:00
Mayukha Vadari
be2aa32542
fix: don't run ripple-binary-codec tests on install ( #2260 )
...
fix rbc scripts
2023-04-06 13:03:23 -04:00
Jackson Mills
0c6ea2afe2
feat: modifiable definitions.json values at runtime via encode/decode parameter ( #2127 )
2023-03-16 10:35:50 -07:00
Jackson Mills
bef2f79fee
Update linter peer dependencies ( #2168 )
2023-02-07 15:00:55 -08:00
justinr1234
5fe480ece4
feat: Jest Test Runner ( #2170 )
2023-02-03 17:03:07 -06:00
pdp2121
c74ffddf59
fix: unset hash128 fields using AccountSet ( #2156 )
2023-02-01 12:27:02 -05:00
Mayukha Vadari
d7c3583a8f
refactor: use xrpl-codec-gen for definitions.json ( #2037 )
...
* Update definitions.json
* update CONTRIBUTING
* fix tests
* fix UNL
2022-07-19 21:01:19 +01:00
Jackson Mills
89240eae62
Handle edge cases for standard currency code signing ( #2009 )
...
* Allow decoding symbols + lowercase standard codes
* Standardize the treatment of standard codes and hex codes for verifying transaction equivalence
2022-06-17 14:27:47 -07:00
Jackson Mills
c994ac7b65
Add better error for trying to encode invalid transactions ( #2001 )
2022-05-24 15:57:08 -07:00
Omar Khan
9d94f4a8ab
rename XLS-20 fields ( #1966 )
...
* rename TokenTaxon -> NFTokenTaxon
* rename MintedTokens -> MintedNFTokens
* rename BurnedTokens -> BurnedNFTokens
* update binary for NFTokenID rename
* rename TokenID -> NFTokenID
* rename TokenOffers -> NFTokenOffers
* rename BrokerFee -> NFTokenBrokerFee
* rename Minter -> NFTokenMinter
* rename NonFungibleToken -> NFToken
* rename NonFungibleTokens -> NFTokens
* rename BuyOffer -> NFTokenBuyOffer
* rename SellOffer -> NFTokenSellOffer
* rename OfferNode -> NFTokenOfferNode
* fix binary for serialize tests
* Add missing MintedNFTokens def + fix tests
* nftokenid -> nft_id
* asfAuthorizedMinter -> asfAuthorizedNFTokenMinter
* Update tec/tem error codes
* Add new definitions
* Update HISTORY.md
* Change to 1.4.0 for binary-codec
* Docgen
* Update HISTORY.md
Co-authored-by: Jackson Mills <jmills@ripple.com >
2022-04-19 10:02:18 -07:00
Jackson Mills
b0e0f9f329
Remove exception from decoding issued currencies which evaluate to 'XRP' ( #1920 )
...
* Remove throw and revise tests
* Update chai dependency
* Disabling linter error about extraneous import
* Fix typo in test description
* Revert unnecessary test changes
* Remove unnecessary comments
* Revert chai change
* Add HISTORY.md
* Revert chai change in package-lock as well
* Fix typo
* Check the result of the decoding
* Update tests with correct expected behavior.
* Fix tests and update currency.js
* Update currency.ts
2022-02-02 18:05:42 -05:00
Omar Khan
8f79c51c7c
[ripple-binary-codec] fix ISO when parsing currency code ( #1921 )
2022-02-02 17:52:08 -05:00
ledhed2222
46a8adcac9
feat: NFT support ( #1829 )
...
* add NFTokenBurn and NFTokenMint
* add NFTokenCreateOffer
* add NFTokenCancelOffer
* add NFTokenAcceptOffer
* add requests and responses
* make a beta 2.1.0
* rename TokenIDs to TokenOffers
* add validations and fixup docs
* add tests
* add missing error codes to binary codec
* adds history changes
2021-12-17 18:26:47 -05:00
Mayukha Vadari
fe845de884
fix: encoding issue with encoding non-traditional currency codes ( #1857 )
...
* add test
* fix decoding issue
2021-12-02 14:43:26 -05:00
Mayukha Vadari
fc101c6733
fix: add workaround for rippled UNLModify encoding bug ( #1830 )
...
* initial patch
* clean up
* make ts happy
* fix typing
* respond to comments
* Revert "respond to comments"
This reverts commit 689768bbf1 .
* Publish
- ripple-address-codec@4.2.1-beta.0
- ripple-binary-codec@1.2.1-beta.0
- ripple-keypairs@1.1.1-beta.0
- xrpl@2.0.3-beta.0
* add helper comments
Co-authored-by: Nathan Nichols <natenichols@cox.net >
2021-11-30 17:16:03 -05:00
ledhed2222
ff9bdbdc4c
initial pass at linting ripple-address-codec ( #1798 )
...
* initial pass at linting ripple-address-codec
* refix doc changes autofixed by eslint
2021-11-30 04:18:35 -05:00
ledhed2222
7cb38591ac
add support for nfts in binary codec ( #1797 )
2021-11-15 17:08:37 -05:00
Greg Weisbrod
afd6aadaf1
run prettier on all packages
2021-11-12 02:41:28 -05:00
Greg Weisbrod
43b55ab598
run 'npx lerna link convert' to hoist common devDependencies to top
2021-11-08 18:19:45 -05:00
Greg Weisbrod
99c817ca8a
fix all errors resulting from running 'npx lerna bootstrap', hoist github actions to top, hoist vscode config to top
2021-11-08 18:19:44 -05:00
Mayukha Vadari
332102a523
use null instead of undefined
2021-06-30 14:43:13 -04:00
Mayukha Vadari
7448142ee4
only first byte is 0
2021-06-30 14:41:48 -04:00
Mayukha Vadari
a23ba65322
fix code to pass tests
2021-06-25 11:22:26 -04:00
Mayukha Vadari
5520b81038
attempted test fix
2021-06-25 10:59:47 -04:00
Mayukha Vadari
8cc6f40c6f
fix typo
2021-06-25 10:27:13 -04:00
Mayukha Vadari
32dcd3070a
clean up code
2021-06-24 17:36:19 -04:00
Mayukha Vadari
f25aecd853
fix encoding problems
2021-06-24 17:35:49 -04:00
Nathan Nichols
c149ec87ea
fix: allow lowercase hex in Uint64 ( #135 )
2021-06-11 10:58:15 -07:00
Nathan Nichols
7e7f47cc20
fix: change sfValidatorToReEnable to field code 21 ( #130 )
2021-06-08 16:41:01 -07:00
Nathan Nichols
c63c235a05
fix: Encode hex strings length <16 to match rippled ( #133 )
2021-06-08 16:40:48 -07:00
Nathan Nichols
761121eba2
fix: Order HopObject ( #122 )
...
* fix: orders HopObject fields correctly
2021-03-10 16:53:27 -06:00
Nathan Nichols
53c72b7045
fix: edge case constructing from string '0' ( #121 )
...
* fix: edge case constructing from string '0'
2021-03-10 11:36:01 -06:00
Nathan Nichols
6c537c0dc3
X-Address Encoding in Issued Currencies ( #113 )
...
* feat(account): allow issued currency to use x-address
2021-02-04 14:24:34 -06:00
golobitch
b1f78b7bea
fix(path-set): do not return undefined values in toJSON function ( #118 )
2021-01-28 18:41:23 +01:00
Andrey Rezvov
b59c5002ed
fix typo in the text of exception ( #114 )
2020-12-10 20:21:28 +03:00
Nathan Nichols
5a711afb7e
fix: polyfill Buffer for browser compatibility ( #112 )
...
* 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
2020-12-03 21:38:57 -06:00
elmurci
b023e9b35b
fix(tickets): Field codes for TicketCount and TicketSequence ( #111 )
...
* fix(tickets): Field codes for TicketCount and TicketSequence
BeginLedgerSeq was taking the place of TicketCount (40) in definitions.
From a8d481c2a5/src/ripple/protocol/impl/SField.cpp
TicketCount should be 40 and TicketSequence 41.
BeginLedgerSeq doesn't seem to be used, so removing it
* fix(ci): fix tests ci
2020-11-23 21:51:03 +01:00
elmurci
479ade8a76
Tickets support ( #110 )
...
* feat(tickets): add TicketCount definition
* feat(tickets): add TicketSequence definition
* fix(tests): unit tests
2020-11-17 17:33:20 +01:00
Nathan Nichols
b43e79a9af
Browser Compatibility Updates ( #107 )
...
* BigInt -> big-integer to support older browsers
* Buffer read/write BigUInt64 removed for browser compatibility.
2020-10-22 15:36:45 -05:00
Nathan Nichols
b197897227
Encode any 3 character ASCII currency code ( #106 )
...
* Encode all 3 character ASCII codes
2020-09-14 13:09:38 -05:00