Commit Graph

861 Commits

Author SHA1 Message Date
Caleb Kniffen
65bf5d40ea fix: tx fields for accounts allowing empty string (#2525)
Fields that were encoded as STAccounts were turning '' into rrrrrrrrrrrrrrrrrrrrrhoLvTp the ACCOUNT_ZERO account. They will now throw a ValidationError.

Invalid addresses on a transaction now throws a ValidationError when submitting a transaction instead of Error('checksum_invalid').

This change updates some error messages for fields a few fields that aren't accounts, DestinationTag or NFTokenID. They will still be of type ValidationError.

Fixes: #2517 and #2475

---------

Co-authored-by: Elliot Lee <github.public@intelliot.com>
2023-10-18 10:25:57 -05:00
Mayukha Vadari
8e929c5a57 chore: remove sidechain-devnet faucet (#2518)
Removes faucet support for the sidechain devnet since the bridge has been moved to Devnet, which already has a faucet.
2023-10-17 12:30:52 -05:00
Mayukha Vadari
032b5b7c5a fix: add type param to ledger & ledger_data (#2503)
- Add missing `type` param
- Clean up typing of `type` param and the response property
`account_objects` of the `account_objects` request
- Create interfaces `HasPreviousTxnID` and `MissingPreviousTxnID`. This
helps clean up type checking with regard to the presence of
`PreviousTxnID` and `MissingPreviousTxnID`

Co-authored-by: Mayukha Vadari <mvadari@ripple.com>
Co-authored-by: Caleb Kniffen <ckniffen@ripple.com>
2023-10-16 09:44:54 -05:00
pdp2121
8b03c995b0 fix: pseudo-transactions for ledger and tx (#2515)
* Add pseudo transactions as types returned by `tx` and `ledger`
* Make` LedgerEntryResponse` generic to allow custom ledger entries
* Update UNLModify to extend BaseTransaction
* Create type `PseudoTransaction`

Co-authored-by: Caleb Kniffen <ckniffen@ripple.com>
2023-10-13 15:58:10 -05:00
Mayukha Vadari
e51526ae8c fix: move a tool and remove a lodash dependency (#2492)
This PR moves createValidateTests.js to xrpl/tools instead of being in the top-level tools folder, and fixes an isString import (changes it from lodash to the in-package version).
2023-10-04 17:30:25 -05:00
Caleb Kniffen
ec72f9ac8e fix: allow flag maps when submitting NFToken txs (#2490)
You can now `NFTokenMint` and `NFTokenCreateOffer` transactions with
`Flags` set to a map like other transactions with flags do.

ex. `{ tfSellNFToken: true }`
2023-10-04 16:37:56 -05:00
Jackson Mills
60b600faea docs: update keywords for all packages (#2502)
Update keywords for all packages to make the easier to find
2023-10-04 16:19:51 -05:00
Omar Khan
62cea624f8 2.12 release (#2488)
* update HISTORY

* docgen

* update HISTORY again

* update package.json files
2023-09-27 11:50:21 -04:00
Caleb Kniffen
b9ef0de2df fix: rename AMMAccount to Account on AMM (#2487)
The `AMM` ledger object had the wrong property name
2023-09-26 16:02:07 -05: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
Jackson Mills
cad0a2a163 feat: Add ports field to server_info RPC (#2476) 2023-09-15 13:52:38 -07:00
tequ
7679df4551 fix: paychan utils arguments name (#2463) 2023-09-15 13:39:07 -05:00
Mayukha Vadari
556addff64 fix: fix escrow OfferSequence validation (#2474)
* Fix escrow validation

* update .nvmrc

* fix tests

* fix EscrowFinish too

* fix test

* update HISTORY

* fix validation

* fix linter issues

* forgot to save

* change test string
2023-09-14 17:21:18 -04:00
Omar Khan
f6f5f6b09a fix: request model fields related to AMM (#2473)
* fix AuthAccount model

* fix AuctionSlot.Price field to be IssuedCurrencyAmount

* fix AMMBid BidMin & BidMan to IssuedCurrencyAmount

* update HISTORY
2023-09-11 17:18:03 -04:00
Jackson Mills
87da37a0db docs: Remove TODO with rippled version check (#2469)
Remove TODO
2023-09-08 09:24:53 -07:00
Omar Khan
e52b27e097 fix: add AMM to BaseLedgerEntry and AccountObject types (#2449)
- Add AMM to BaseLedgerEntry and AccountObject types.
- Add amm_account to amm_info request
- Add AMMID to AccountRoot

Co-authored-by: Caleb Kniffen <ckniffen@ripple.com>
2023-09-07 16:35:15 -05:00
Caleb Kniffen
8e5aa9df99 doc: update HISTORY.md with source-map fix (#2467)
This was missed when I did #2435 which led to `ripple-address-codec` and
`ripple-keypairs` not being released.
2023-09-06 17:26:59 -05:00
dependabot[bot]
ca60b76939 build(deps-dev): bump typedoc from 0.24.8 to 0.25.0 (#2460)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.24.8 to 0.25.0.
- [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.24.8...v0.25.0)

---
updated-dependencies:
- dependency-name: typedoc
  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>
2023-09-01 14:44:37 -05:00
Jackson Mills
c912abeede fix: Avoid casting when using Currency type for AMM objects (#2451)
Set issuer to never
2023-08-29 15:48:44 -07:00
Omar Khan
37fbc03584 2.11 release (#2442)
* update HISTORY

* update docgen

* update package versions
2023-08-24 13:44:29 -04:00
Jackson Mills
49447a9beb ci: Add a script to generate changes to ci-config (#2431)
* Add basic lookup for amendments
2023-08-18 15:24:48 -07: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
Caleb Kniffen
2192e11267 fix: source-maps find their designated source (#2435)
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'
```
2023-08-15 10:37:05 -05:00
Caleb Kniffen
352abae003 chore: remove extra files for git, nyc, and mocha (#2422)
- Remove `.gitignore` from individual packages.
- Remove `nyc.config.js` and `.nycrc` since `nyc` is no longer in use
- Remove `.mocharc` and `localIntegrationRunner.html` since `mocha` is
no longer in use.
2023-08-15 10:19:15 -05:00
Daniel
aa75806f2f [Feature] Generate Wallet from secret numbers (#1799)
* add the possibility to create a wallet from Secret Numbers

* Move it off the Wallet class
2023-08-14 17:39:35 -07:00
Mo Morsi
6856dec466 docs: Fix typo in documentation: on('transactions') -> on('transaction') (#2430) 2023-08-09 13:42:54 -07:00
Jackson Mills
002ec77218 release: Update package.json files (#2425)
Update package.json files
2023-08-07 14:50:14 -07:00
Jackson Mills
c4097935a9 release: Update HISTORY.md (#2424)
* Update HISTORY.md

* Run docgen
2023-08-07 14:31:24 -07:00
Caleb Kniffen
f760b2e56f chore: remove extra lock files and nyc (#2403)
nyc is not a direct dependency any more and nested lock files are unused
2023-07-20 15:03:17 -05: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
pdp2121
5ec6729c61 release 2.9.1 (#2391) 2023-07-18 15:29:32 -05:00
Shawn Xie
d158770c24 Update docker to xrpllabsofficial/xrpld:1.12.0-b1 (#2381) 2023-07-18 14:09:32 -05:00
justinr1234
e760a4898d fix: escrow finish and cancel integration (#2382)
* fix: escrow finish and cancel integration

* add docs
2023-07-17 16:56:06 -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
Caleb Kniffen
c523a7c80b release: xrpl@2.9.0 and ripple-binary-codec@1.7.0 (#2380) 2023-07-12 16:52:06 -05:00
Wo Jake
6a31d4d254 fix: enable the removal of a signer list (#2377)
`SignerQuorum` field has to be 0 and the `SignerEntrys` field has to be `undefined`

Co-authored-by: Caleb Kniffen <ckniffen@ripple.com>
2023-07-12 16:05:07 -05:00
Caleb Kniffen
f07e2c7108 feat: export Balance type (#2374)
Closes #1823
2023-07-10 16:54:22 -05:00
Caleb Kniffen
dbd5852ba6 feat(types): Export most of the types (#2360)
Expose most of the types in the `xrpl` package. Some renames will only
affect you if you were deep importing these types previously.

Renames of deep importable types:
- `methods/bookOffers`: `TakerAmount` -> `BookOfferCurrency`
- `methods/accountLines`: `Trustline` -> `AccountLinesTrustline`
2023-07-03 17:03:51 -05:00
Caleb Kniffen
5925ad2f00 feat: expose LedgerEntry singletons (#2358)
Adds the new fields for `XRPFees` amendment and id for the `FeeSettings`
singleton ledger entry.

Closes #2219
2023-07-03 16:34:42 -05:00
Caleb Kniffen
9b0c1e53e3 fix(types): SignerList was missing WalletLocator (#2359)
`SignerEntry` on `SignerList` (LedgerEntry) was missing `WalletLocator`.

This was found while trying to use types on the xrpl.org explorer.
2023-07-03 11:08:07 -05:00
Caleb Kniffen
23256aed5d feat(types): Update FeeSettings and add id (#2357)
Adds the new fields for `XRPFees` amendment and id for the `FeeSettings`
singleton ledger entry.

Closes #2219
2023-06-29 16:27:00 -05:00
Caleb Kniffen
70500dcc15 feat(types): Add pseudo transactions (#2351)
Add types for `EnableAmendment`, `SetFee`, and `UNLModify` transactions.
2023-06-29 14:20:36 -05:00
Caleb Kniffen
fd0b2275c1 feat: enable 1.10.0 amendments for tests (#2356)
- `NFTokenMint` needs `NonFungibleTokensV1_1` enabled instead of `NonFungibleTokensV1` .  
- `fee_ref` is no longer returned after `XRPFees` amendment is enabled.
2023-06-29 13:10:52 -05:00
Caleb Kniffen
97552cc1a5 feat(types): define new account_flags field (#2352)
The `account_flags` field was added to the `account_info` response for `rippled@1.11.0`
2023-06-27 15:14:48 -05:00
Caleb Kniffen
b152ebc4ce feat: add ledger entry types for NFTokens (#2349)
Add `NFToken`, `NFTokenPage`, and `NFTokenOffer`
2023-06-26 12:57:47 -05:00
Caleb Kniffen
b6d6fafebc feat: cleanup types and add missing request fields (#2346)
- Add `ledger_hash` and `ledger_index` to `account_nfts`,
`nft_buy_offers`, and `nft_sell_offers` requests.
- Add `nft_page` to `ledger_entry` request.
- Create `LookupByLedgerRequest` to clean up `ledger_hash` and
`ledger_index` which are optional on most request objects.

Closes #2135
2023-06-26 12:47:15 -05:00
Jackson Mills
dc51e3a704 Update getNFTokenID to properly handle binary blob (#2247)
* Update NFTokenMint test

* Ensure the binary version works as well

* Remove meta being undefined in txResponse

* Remove error test

* Re-add test, error, and lint

* Add meta to test, and add string to allowed type

* Re-add meta being undefined with proper docs
2023-06-23 16:17:29 -07:00
Mayukha Vadari
6228f91c00 test: run snippets in CI (#2345)
* run snippets in CI

* add name, try to avoid building

* better printing

* refactors

* fix getTransaction test
2023-06-22 13:26:16 -04:00
Caleb Kniffen
fa98bd8d26 feat: add missing AccountRoot fields (#2347)
Add `BurnedNFTokens`, `FirstNFTSequence`, `MintedNFTokens`,
`NFTokenMinter`, and `WalletLocator` to `AccountRoot`.
2023-06-21 12:49:34 -05:00
justinr1234
6fa3eacd19 fix: CJS default exports (#2340) 2023-06-20 20:55:47 -05:00