xrpl 2.12.0-beta.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +114 -5
- package/build/xrpl-latest-min.js +1 -1
- package/build/xrpl-latest-min.js.map +1 -1
- package/build/xrpl-latest.js +7248 -7657
- package/build/xrpl-latest.js.map +1 -1
- package/dist/npm/Wallet/defaultFaucets.d.ts.map +1 -1
- package/dist/npm/Wallet/defaultFaucets.js +0 -3
- package/dist/npm/Wallet/defaultFaucets.js.map +1 -1
- package/dist/npm/client/partialPayment.d.ts.map +1 -1
- package/dist/npm/client/partialPayment.js.map +1 -1
- package/dist/npm/models/common/index.d.ts +2 -1
- package/dist/npm/models/common/index.d.ts.map +1 -1
- package/dist/npm/models/ledger/AMM.d.ts +5 -5
- package/dist/npm/models/ledger/AMM.d.ts.map +1 -1
- package/dist/npm/models/ledger/AccountRoot.d.ts +3 -4
- package/dist/npm/models/ledger/AccountRoot.d.ts.map +1 -1
- package/dist/npm/models/ledger/AccountRoot.js.map +1 -1
- package/dist/npm/models/ledger/Amendments.d.ts +2 -2
- package/dist/npm/models/ledger/Amendments.d.ts.map +1 -1
- package/dist/npm/models/ledger/BaseLedgerEntry.d.ts +9 -1
- package/dist/npm/models/ledger/BaseLedgerEntry.d.ts.map +1 -1
- package/dist/npm/models/ledger/Bridge.d.ts +2 -4
- package/dist/npm/models/ledger/Bridge.d.ts.map +1 -1
- package/dist/npm/models/ledger/Check.d.ts +2 -2
- package/dist/npm/models/ledger/Check.d.ts.map +1 -1
- package/dist/npm/models/ledger/DepositPreauth.d.ts +2 -4
- package/dist/npm/models/ledger/DepositPreauth.d.ts.map +1 -1
- package/dist/npm/models/ledger/DirectoryNode.d.ts +2 -2
- package/dist/npm/models/ledger/DirectoryNode.d.ts.map +1 -1
- package/dist/npm/models/ledger/Escrow.d.ts +2 -4
- package/dist/npm/models/ledger/Escrow.d.ts.map +1 -1
- package/dist/npm/models/ledger/FeeSettings.d.ts +2 -2
- package/dist/npm/models/ledger/FeeSettings.d.ts.map +1 -1
- package/dist/npm/models/ledger/Ledger.d.ts +3 -3
- package/dist/npm/models/ledger/Ledger.d.ts.map +1 -1
- package/dist/npm/models/ledger/LedgerEntry.d.ts +2 -1
- package/dist/npm/models/ledger/LedgerEntry.d.ts.map +1 -1
- package/dist/npm/models/ledger/LedgerHashes.d.ts +2 -2
- package/dist/npm/models/ledger/LedgerHashes.d.ts.map +1 -1
- package/dist/npm/models/ledger/NFTokenOffer.d.ts +2 -4
- package/dist/npm/models/ledger/NFTokenOffer.d.ts.map +1 -1
- package/dist/npm/models/ledger/NFTokenPage.d.ts +2 -4
- package/dist/npm/models/ledger/NFTokenPage.d.ts.map +1 -1
- package/dist/npm/models/ledger/NegativeUNL.d.ts +2 -2
- package/dist/npm/models/ledger/NegativeUNL.d.ts.map +1 -1
- package/dist/npm/models/ledger/Offer.d.ts +2 -4
- package/dist/npm/models/ledger/Offer.d.ts.map +1 -1
- package/dist/npm/models/ledger/Offer.js.map +1 -1
- package/dist/npm/models/ledger/PayChannel.d.ts +2 -4
- package/dist/npm/models/ledger/PayChannel.d.ts.map +1 -1
- package/dist/npm/models/ledger/RippleState.d.ts +2 -4
- package/dist/npm/models/ledger/RippleState.d.ts.map +1 -1
- package/dist/npm/models/ledger/RippleState.js.map +1 -1
- package/dist/npm/models/ledger/SignerList.d.ts +2 -4
- package/dist/npm/models/ledger/SignerList.d.ts.map +1 -1
- package/dist/npm/models/ledger/SignerList.js.map +1 -1
- package/dist/npm/models/ledger/Ticket.d.ts +2 -4
- package/dist/npm/models/ledger/Ticket.d.ts.map +1 -1
- package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts +13 -5
- package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts.map +1 -1
- package/dist/npm/models/ledger/XChainOwnedCreateAccountClaimID.d.ts +12 -5
- package/dist/npm/models/ledger/XChainOwnedCreateAccountClaimID.d.ts.map +1 -1
- package/dist/npm/models/ledger/index.d.ts +3 -2
- package/dist/npm/models/ledger/index.d.ts.map +1 -1
- package/dist/npm/models/ledger/index.js.map +1 -1
- package/dist/npm/models/methods/accountObjects.d.ts +4 -3
- package/dist/npm/models/methods/accountObjects.d.ts.map +1 -1
- package/dist/npm/models/methods/ammInfo.d.ts +4 -3
- package/dist/npm/models/methods/ammInfo.d.ts.map +1 -1
- package/dist/npm/models/methods/ledger.d.ts +2 -0
- package/dist/npm/models/methods/ledger.d.ts.map +1 -1
- package/dist/npm/models/methods/ledgerData.d.ts +2 -1
- package/dist/npm/models/methods/ledgerData.d.ts.map +1 -1
- package/dist/npm/models/methods/ledgerEntry.d.ts +6 -6
- package/dist/npm/models/methods/ledgerEntry.d.ts.map +1 -1
- package/dist/npm/models/methods/serverInfo.d.ts +6 -0
- package/dist/npm/models/methods/serverInfo.d.ts.map +1 -1
- package/dist/npm/models/methods/tx.d.ts +2 -1
- package/dist/npm/models/methods/tx.d.ts.map +1 -1
- package/dist/npm/models/transactions/AMMBid.d.ts +3 -3
- package/dist/npm/models/transactions/AMMBid.d.ts.map +1 -1
- package/dist/npm/models/transactions/AMMBid.js.map +1 -1
- package/dist/npm/models/transactions/AMMDeposit.d.ts.map +1 -1
- package/dist/npm/models/transactions/AMMDeposit.js.map +1 -1
- package/dist/npm/models/transactions/AMMWithdraw.d.ts.map +1 -1
- package/dist/npm/models/transactions/AMMWithdraw.js.map +1 -1
- package/dist/npm/models/transactions/NFTokenBurn.d.ts +3 -3
- package/dist/npm/models/transactions/NFTokenBurn.d.ts.map +1 -1
- package/dist/npm/models/transactions/NFTokenBurn.js +2 -4
- package/dist/npm/models/transactions/NFTokenBurn.js.map +1 -1
- package/dist/npm/models/transactions/NFTokenCreateOffer.d.ts +3 -3
- package/dist/npm/models/transactions/NFTokenCreateOffer.d.ts.map +1 -1
- package/dist/npm/models/transactions/NFTokenCreateOffer.js +2 -0
- package/dist/npm/models/transactions/NFTokenCreateOffer.js.map +1 -1
- package/dist/npm/models/transactions/NFTokenMint.d.ts +2 -2
- package/dist/npm/models/transactions/NFTokenMint.d.ts.map +1 -1
- package/dist/npm/models/transactions/NFTokenMint.js +1 -0
- package/dist/npm/models/transactions/NFTokenMint.js.map +1 -1
- package/dist/npm/models/transactions/UNLModify.d.ts +2 -1
- package/dist/npm/models/transactions/UNLModify.d.ts.map +1 -1
- package/dist/npm/models/transactions/XChainAccountCreateCommit.d.ts +2 -2
- package/dist/npm/models/transactions/XChainAccountCreateCommit.d.ts.map +1 -1
- package/dist/npm/models/transactions/XChainAccountCreateCommit.js +4 -26
- package/dist/npm/models/transactions/XChainAccountCreateCommit.js.map +1 -1
- package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.d.ts +5 -5
- package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.d.ts.map +1 -1
- package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.js +11 -68
- package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.js.map +1 -1
- package/dist/npm/models/transactions/XChainAddClaimAttestation.d.ts +5 -5
- package/dist/npm/models/transactions/XChainAddClaimAttestation.d.ts.map +1 -1
- package/dist/npm/models/transactions/XChainAddClaimAttestation.js +10 -59
- package/dist/npm/models/transactions/XChainAddClaimAttestation.js.map +1 -1
- package/dist/npm/models/transactions/XChainClaim.d.ts +2 -2
- package/dist/npm/models/transactions/XChainClaim.d.ts.map +1 -1
- package/dist/npm/models/transactions/XChainClaim.js +5 -30
- package/dist/npm/models/transactions/XChainClaim.js.map +1 -1
- package/dist/npm/models/transactions/XChainCommit.d.ts +2 -2
- package/dist/npm/models/transactions/XChainCommit.d.ts.map +1 -1
- package/dist/npm/models/transactions/XChainCommit.js +4 -24
- package/dist/npm/models/transactions/XChainCommit.js.map +1 -1
- package/dist/npm/models/transactions/XChainCreateBridge.d.ts.map +1 -1
- package/dist/npm/models/transactions/XChainCreateBridge.js +3 -17
- package/dist/npm/models/transactions/XChainCreateBridge.js.map +1 -1
- package/dist/npm/models/transactions/XChainCreateClaimID.d.ts +2 -2
- package/dist/npm/models/transactions/XChainCreateClaimID.d.ts.map +1 -1
- package/dist/npm/models/transactions/XChainCreateClaimID.js +3 -19
- package/dist/npm/models/transactions/XChainCreateClaimID.js.map +1 -1
- package/dist/npm/models/transactions/XChainModifyBridge.d.ts.map +1 -1
- package/dist/npm/models/transactions/XChainModifyBridge.js +3 -14
- package/dist/npm/models/transactions/XChainModifyBridge.js.map +1 -1
- package/dist/npm/models/transactions/accountDelete.d.ts +2 -2
- package/dist/npm/models/transactions/accountDelete.d.ts.map +1 -1
- package/dist/npm/models/transactions/accountDelete.js +2 -11
- package/dist/npm/models/transactions/accountDelete.js.map +1 -1
- package/dist/npm/models/transactions/accountSet.d.ts +2 -2
- package/dist/npm/models/transactions/accountSet.d.ts.map +1 -1
- package/dist/npm/models/transactions/accountSet.js +1 -5
- package/dist/npm/models/transactions/accountSet.js.map +1 -1
- package/dist/npm/models/transactions/checkCash.d.ts.map +1 -1
- package/dist/npm/models/transactions/checkCash.js.map +1 -1
- package/dist/npm/models/transactions/checkCreate.d.ts +2 -2
- package/dist/npm/models/transactions/checkCreate.d.ts.map +1 -1
- package/dist/npm/models/transactions/checkCreate.js +2 -10
- package/dist/npm/models/transactions/checkCreate.js.map +1 -1
- package/dist/npm/models/transactions/common.d.ts +7 -1
- package/dist/npm/models/transactions/common.d.ts.map +1 -1
- package/dist/npm/models/transactions/common.js +39 -38
- package/dist/npm/models/transactions/common.js.map +1 -1
- package/dist/npm/models/transactions/depositPreauth.d.ts.map +1 -1
- package/dist/npm/models/transactions/depositPreauth.js.map +1 -1
- package/dist/npm/models/transactions/escrowCancel.d.ts +3 -3
- package/dist/npm/models/transactions/escrowCancel.d.ts.map +1 -1
- package/dist/npm/models/transactions/escrowCancel.js +5 -8
- package/dist/npm/models/transactions/escrowCancel.js.map +1 -1
- package/dist/npm/models/transactions/escrowCreate.d.ts +2 -2
- package/dist/npm/models/transactions/escrowCreate.d.ts.map +1 -1
- package/dist/npm/models/transactions/escrowCreate.js +2 -10
- package/dist/npm/models/transactions/escrowCreate.js.map +1 -1
- package/dist/npm/models/transactions/escrowFinish.d.ts +3 -3
- package/dist/npm/models/transactions/escrowFinish.d.ts.map +1 -1
- package/dist/npm/models/transactions/escrowFinish.js +5 -8
- package/dist/npm/models/transactions/escrowFinish.js.map +1 -1
- package/dist/npm/models/transactions/index.d.ts +1 -1
- package/dist/npm/models/transactions/index.d.ts.map +1 -1
- package/dist/npm/models/transactions/index.js.map +1 -1
- package/dist/npm/models/transactions/offerCreate.d.ts.map +1 -1
- package/dist/npm/models/transactions/offerCreate.js.map +1 -1
- package/dist/npm/models/transactions/payment.d.ts +2 -2
- package/dist/npm/models/transactions/payment.d.ts.map +1 -1
- package/dist/npm/models/transactions/payment.js +2 -9
- package/dist/npm/models/transactions/payment.js.map +1 -1
- package/dist/npm/models/transactions/paymentChannelClaim.d.ts.map +1 -1
- package/dist/npm/models/transactions/paymentChannelClaim.js.map +1 -1
- package/dist/npm/models/transactions/paymentChannelCreate.d.ts +2 -2
- package/dist/npm/models/transactions/paymentChannelCreate.d.ts.map +1 -1
- package/dist/npm/models/transactions/paymentChannelCreate.js +2 -10
- package/dist/npm/models/transactions/paymentChannelCreate.js.map +1 -1
- package/dist/npm/models/transactions/signerListSet.d.ts.map +1 -1
- package/dist/npm/models/transactions/signerListSet.js.map +1 -1
- package/dist/npm/models/transactions/transaction.d.ts +4 -0
- package/dist/npm/models/transactions/transaction.d.ts.map +1 -1
- package/dist/npm/models/transactions/transaction.js.map +1 -1
- package/dist/npm/models/utils/flags.d.ts.map +1 -1
- package/dist/npm/models/utils/flags.js +17 -28
- package/dist/npm/models/utils/flags.js.map +1 -1
- package/dist/npm/snippets/src/bridgeTransfer.js +16 -13
- package/dist/npm/snippets/src/bridgeTransfer.js.map +1 -1
- package/dist/npm/snippets/tsconfig.tsbuildinfo +1 -1
- package/dist/npm/src/Wallet/defaultFaucets.d.ts.map +1 -1
- package/dist/npm/src/Wallet/defaultFaucets.js +0 -3
- package/dist/npm/src/Wallet/defaultFaucets.js.map +1 -1
- package/dist/npm/src/client/partialPayment.d.ts.map +1 -1
- package/dist/npm/src/client/partialPayment.js.map +1 -1
- package/dist/npm/src/models/common/index.d.ts +2 -1
- package/dist/npm/src/models/common/index.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/AMM.d.ts +5 -5
- package/dist/npm/src/models/ledger/AMM.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/AccountRoot.d.ts +3 -4
- package/dist/npm/src/models/ledger/AccountRoot.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/AccountRoot.js.map +1 -1
- package/dist/npm/src/models/ledger/Amendments.d.ts +2 -2
- package/dist/npm/src/models/ledger/Amendments.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/BaseLedgerEntry.d.ts +9 -1
- package/dist/npm/src/models/ledger/BaseLedgerEntry.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/Bridge.d.ts +2 -4
- package/dist/npm/src/models/ledger/Bridge.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/Check.d.ts +2 -2
- package/dist/npm/src/models/ledger/Check.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/DepositPreauth.d.ts +2 -4
- package/dist/npm/src/models/ledger/DepositPreauth.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/DirectoryNode.d.ts +2 -2
- package/dist/npm/src/models/ledger/DirectoryNode.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/Escrow.d.ts +2 -4
- package/dist/npm/src/models/ledger/Escrow.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/FeeSettings.d.ts +2 -2
- package/dist/npm/src/models/ledger/FeeSettings.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/Ledger.d.ts +3 -3
- package/dist/npm/src/models/ledger/Ledger.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/LedgerEntry.d.ts +2 -1
- package/dist/npm/src/models/ledger/LedgerEntry.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/LedgerHashes.d.ts +2 -2
- package/dist/npm/src/models/ledger/LedgerHashes.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/NFTokenOffer.d.ts +2 -4
- package/dist/npm/src/models/ledger/NFTokenOffer.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/NFTokenPage.d.ts +2 -4
- package/dist/npm/src/models/ledger/NFTokenPage.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/NegativeUNL.d.ts +2 -2
- package/dist/npm/src/models/ledger/NegativeUNL.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/Offer.d.ts +2 -4
- package/dist/npm/src/models/ledger/Offer.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/Offer.js.map +1 -1
- package/dist/npm/src/models/ledger/PayChannel.d.ts +2 -4
- package/dist/npm/src/models/ledger/PayChannel.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/RippleState.d.ts +2 -4
- package/dist/npm/src/models/ledger/RippleState.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/RippleState.js.map +1 -1
- package/dist/npm/src/models/ledger/SignerList.d.ts +2 -4
- package/dist/npm/src/models/ledger/SignerList.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/SignerList.js.map +1 -1
- package/dist/npm/src/models/ledger/Ticket.d.ts +2 -4
- package/dist/npm/src/models/ledger/Ticket.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts +13 -5
- package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/XChainOwnedCreateAccountClaimID.d.ts +12 -5
- package/dist/npm/src/models/ledger/XChainOwnedCreateAccountClaimID.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/index.d.ts +3 -2
- package/dist/npm/src/models/ledger/index.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/index.js.map +1 -1
- package/dist/npm/src/models/methods/accountObjects.d.ts +4 -3
- package/dist/npm/src/models/methods/accountObjects.d.ts.map +1 -1
- package/dist/npm/src/models/methods/ammInfo.d.ts +4 -3
- package/dist/npm/src/models/methods/ammInfo.d.ts.map +1 -1
- package/dist/npm/src/models/methods/ledger.d.ts +2 -0
- package/dist/npm/src/models/methods/ledger.d.ts.map +1 -1
- package/dist/npm/src/models/methods/ledgerData.d.ts +2 -1
- package/dist/npm/src/models/methods/ledgerData.d.ts.map +1 -1
- package/dist/npm/src/models/methods/ledgerEntry.d.ts +6 -6
- package/dist/npm/src/models/methods/ledgerEntry.d.ts.map +1 -1
- package/dist/npm/src/models/methods/serverInfo.d.ts +6 -0
- package/dist/npm/src/models/methods/serverInfo.d.ts.map +1 -1
- package/dist/npm/src/models/methods/tx.d.ts +2 -1
- package/dist/npm/src/models/methods/tx.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/AMMBid.d.ts +3 -3
- package/dist/npm/src/models/transactions/AMMBid.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/AMMBid.js.map +1 -1
- package/dist/npm/src/models/transactions/AMMDeposit.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/AMMDeposit.js.map +1 -1
- package/dist/npm/src/models/transactions/AMMWithdraw.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/AMMWithdraw.js.map +1 -1
- package/dist/npm/src/models/transactions/NFTokenBurn.d.ts +3 -3
- package/dist/npm/src/models/transactions/NFTokenBurn.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/NFTokenBurn.js +2 -4
- package/dist/npm/src/models/transactions/NFTokenBurn.js.map +1 -1
- package/dist/npm/src/models/transactions/NFTokenCreateOffer.d.ts +3 -3
- package/dist/npm/src/models/transactions/NFTokenCreateOffer.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/NFTokenCreateOffer.js +2 -0
- package/dist/npm/src/models/transactions/NFTokenCreateOffer.js.map +1 -1
- package/dist/npm/src/models/transactions/NFTokenMint.d.ts +2 -2
- package/dist/npm/src/models/transactions/NFTokenMint.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/NFTokenMint.js +1 -0
- package/dist/npm/src/models/transactions/NFTokenMint.js.map +1 -1
- package/dist/npm/src/models/transactions/UNLModify.d.ts +2 -1
- package/dist/npm/src/models/transactions/UNLModify.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/XChainAccountCreateCommit.d.ts +2 -2
- package/dist/npm/src/models/transactions/XChainAccountCreateCommit.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/XChainAccountCreateCommit.js +4 -26
- package/dist/npm/src/models/transactions/XChainAccountCreateCommit.js.map +1 -1
- package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.d.ts +5 -5
- package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.js +11 -68
- package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.js.map +1 -1
- package/dist/npm/src/models/transactions/XChainAddClaimAttestation.d.ts +5 -5
- package/dist/npm/src/models/transactions/XChainAddClaimAttestation.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/XChainAddClaimAttestation.js +10 -59
- package/dist/npm/src/models/transactions/XChainAddClaimAttestation.js.map +1 -1
- package/dist/npm/src/models/transactions/XChainClaim.d.ts +2 -2
- package/dist/npm/src/models/transactions/XChainClaim.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/XChainClaim.js +5 -30
- package/dist/npm/src/models/transactions/XChainClaim.js.map +1 -1
- package/dist/npm/src/models/transactions/XChainCommit.d.ts +2 -2
- package/dist/npm/src/models/transactions/XChainCommit.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/XChainCommit.js +4 -24
- package/dist/npm/src/models/transactions/XChainCommit.js.map +1 -1
- package/dist/npm/src/models/transactions/XChainCreateBridge.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/XChainCreateBridge.js +3 -17
- package/dist/npm/src/models/transactions/XChainCreateBridge.js.map +1 -1
- package/dist/npm/src/models/transactions/XChainCreateClaimID.d.ts +2 -2
- package/dist/npm/src/models/transactions/XChainCreateClaimID.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/XChainCreateClaimID.js +3 -19
- package/dist/npm/src/models/transactions/XChainCreateClaimID.js.map +1 -1
- package/dist/npm/src/models/transactions/XChainModifyBridge.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/XChainModifyBridge.js +3 -14
- package/dist/npm/src/models/transactions/XChainModifyBridge.js.map +1 -1
- package/dist/npm/src/models/transactions/accountDelete.d.ts +2 -2
- package/dist/npm/src/models/transactions/accountDelete.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/accountDelete.js +2 -11
- package/dist/npm/src/models/transactions/accountDelete.js.map +1 -1
- package/dist/npm/src/models/transactions/accountSet.d.ts +2 -2
- package/dist/npm/src/models/transactions/accountSet.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/accountSet.js +1 -5
- package/dist/npm/src/models/transactions/accountSet.js.map +1 -1
- package/dist/npm/src/models/transactions/checkCash.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/checkCash.js.map +1 -1
- package/dist/npm/src/models/transactions/checkCreate.d.ts +2 -2
- package/dist/npm/src/models/transactions/checkCreate.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/checkCreate.js +2 -10
- package/dist/npm/src/models/transactions/checkCreate.js.map +1 -1
- package/dist/npm/src/models/transactions/common.d.ts +7 -1
- package/dist/npm/src/models/transactions/common.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/common.js +39 -38
- package/dist/npm/src/models/transactions/common.js.map +1 -1
- package/dist/npm/src/models/transactions/depositPreauth.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/depositPreauth.js.map +1 -1
- package/dist/npm/src/models/transactions/escrowCancel.d.ts +3 -3
- package/dist/npm/src/models/transactions/escrowCancel.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/escrowCancel.js +5 -8
- package/dist/npm/src/models/transactions/escrowCancel.js.map +1 -1
- package/dist/npm/src/models/transactions/escrowCreate.d.ts +2 -2
- package/dist/npm/src/models/transactions/escrowCreate.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/escrowCreate.js +2 -10
- package/dist/npm/src/models/transactions/escrowCreate.js.map +1 -1
- package/dist/npm/src/models/transactions/escrowFinish.d.ts +3 -3
- package/dist/npm/src/models/transactions/escrowFinish.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/escrowFinish.js +5 -8
- package/dist/npm/src/models/transactions/escrowFinish.js.map +1 -1
- package/dist/npm/src/models/transactions/index.d.ts +1 -1
- package/dist/npm/src/models/transactions/index.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/index.js.map +1 -1
- package/dist/npm/src/models/transactions/offerCreate.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/offerCreate.js.map +1 -1
- package/dist/npm/src/models/transactions/payment.d.ts +2 -2
- package/dist/npm/src/models/transactions/payment.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/payment.js +2 -9
- package/dist/npm/src/models/transactions/payment.js.map +1 -1
- package/dist/npm/src/models/transactions/paymentChannelClaim.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/paymentChannelClaim.js.map +1 -1
- package/dist/npm/src/models/transactions/paymentChannelCreate.d.ts +2 -2
- package/dist/npm/src/models/transactions/paymentChannelCreate.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/paymentChannelCreate.js +2 -10
- package/dist/npm/src/models/transactions/paymentChannelCreate.js.map +1 -1
- package/dist/npm/src/models/transactions/signerListSet.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/signerListSet.js.map +1 -1
- package/dist/npm/src/models/transactions/transaction.d.ts +4 -0
- package/dist/npm/src/models/transactions/transaction.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/transaction.js.map +1 -1
- package/dist/npm/src/models/utils/flags.d.ts.map +1 -1
- package/dist/npm/src/models/utils/flags.js +17 -28
- package/dist/npm/src/models/utils/flags.js.map +1 -1
- package/dist/npm/src/sugar/autofill.d.ts.map +1 -1
- package/dist/npm/src/sugar/autofill.js.map +1 -1
- package/dist/npm/src/utils/getXChainClaimID.d.ts +3 -0
- package/dist/npm/src/utils/getXChainClaimID.d.ts.map +1 -0
- package/dist/npm/src/utils/getXChainClaimID.js +29 -0
- package/dist/npm/src/utils/getXChainClaimID.js.map +1 -0
- package/dist/npm/src/utils/hashes/hashLedger.d.ts +2 -1
- package/dist/npm/src/utils/hashes/hashLedger.d.ts.map +1 -1
- package/dist/npm/src/utils/hashes/hashLedger.js.map +1 -1
- package/dist/npm/src/utils/index.d.ts +2 -1
- package/dist/npm/src/utils/index.d.ts.map +1 -1
- package/dist/npm/src/utils/index.js +3 -1
- package/dist/npm/src/utils/index.js.map +1 -1
- package/dist/npm/src/utils/signPaymentChannelClaim.d.ts +1 -1
- package/dist/npm/src/utils/signPaymentChannelClaim.d.ts.map +1 -1
- package/dist/npm/src/utils/signPaymentChannelClaim.js +2 -2
- package/dist/npm/src/utils/signPaymentChannelClaim.js.map +1 -1
- package/dist/npm/src/utils/verifyPaymentChannelClaim.d.ts +1 -1
- package/dist/npm/src/utils/verifyPaymentChannelClaim.d.ts.map +1 -1
- package/dist/npm/src/utils/verifyPaymentChannelClaim.js +2 -2
- package/dist/npm/src/utils/verifyPaymentChannelClaim.js.map +1 -1
- package/dist/npm/sugar/autofill.d.ts.map +1 -1
- package/dist/npm/sugar/autofill.js.map +1 -1
- package/dist/npm/utils/getXChainClaimID.d.ts +3 -0
- package/dist/npm/utils/getXChainClaimID.d.ts.map +1 -0
- package/dist/npm/utils/getXChainClaimID.js +29 -0
- package/dist/npm/utils/getXChainClaimID.js.map +1 -0
- package/dist/npm/utils/hashes/hashLedger.d.ts +2 -1
- package/dist/npm/utils/hashes/hashLedger.d.ts.map +1 -1
- package/dist/npm/utils/hashes/hashLedger.js.map +1 -1
- package/dist/npm/utils/index.d.ts +2 -1
- package/dist/npm/utils/index.d.ts.map +1 -1
- package/dist/npm/utils/index.js +3 -1
- package/dist/npm/utils/index.js.map +1 -1
- package/dist/npm/utils/signPaymentChannelClaim.d.ts +1 -1
- package/dist/npm/utils/signPaymentChannelClaim.d.ts.map +1 -1
- package/dist/npm/utils/signPaymentChannelClaim.js +2 -2
- package/dist/npm/utils/signPaymentChannelClaim.js.map +1 -1
- package/dist/npm/utils/verifyPaymentChannelClaim.d.ts +1 -1
- package/dist/npm/utils/verifyPaymentChannelClaim.d.ts.map +1 -1
- package/dist/npm/utils/verifyPaymentChannelClaim.js +2 -2
- package/dist/npm/utils/verifyPaymentChannelClaim.js.map +1 -1
- package/package.json +14 -6
- package/src/Wallet/defaultFaucets.ts +0 -4
- package/src/client/partialPayment.ts +6 -2
- package/src/models/common/index.ts +2 -1
- package/src/models/ledger/AMM.ts +5 -5
- package/src/models/ledger/AccountRoot.ts +8 -12
- package/src/models/ledger/Amendments.ts +4 -2
- package/src/models/ledger/BaseLedgerEntry.ts +25 -1
- package/src/models/ledger/Bridge.ts +2 -14
- package/src/models/ledger/Check.ts +2 -2
- package/src/models/ledger/DepositPreauth.ts +4 -12
- package/src/models/ledger/DirectoryNode.ts +4 -2
- package/src/models/ledger/Escrow.ts +2 -12
- package/src/models/ledger/FeeSettings.ts +2 -2
- package/src/models/ledger/Ledger.ts +9 -3
- package/src/models/ledger/LedgerEntry.ts +22 -1
- package/src/models/ledger/LedgerHashes.ts +4 -2
- package/src/models/ledger/NFTokenOffer.ts +2 -4
- package/src/models/ledger/NFTokenPage.ts +2 -4
- package/src/models/ledger/NegativeUNL.ts +4 -2
- package/src/models/ledger/Offer.ts +2 -12
- package/src/models/ledger/PayChannel.ts +2 -12
- package/src/models/ledger/RippleState.ts +2 -12
- package/src/models/ledger/SignerList.ts +2 -12
- package/src/models/ledger/Ticket.ts +2 -12
- package/src/models/ledger/XChainOwnedClaimID.ts +22 -14
- package/src/models/ledger/XChainOwnedCreateAccountClaimID.ts +19 -14
- package/src/models/ledger/index.ts +5 -1
- package/src/models/methods/accountObjects.ts +10 -41
- package/src/models/methods/ammInfo.ts +8 -3
- package/src/models/methods/ledger.ts +5 -0
- package/src/models/methods/ledgerData.ts +5 -1
- package/src/models/methods/ledgerEntry.ts +6 -6
- package/src/models/methods/serverInfo.ts +21 -0
- package/src/models/methods/tx.ts +4 -2
- package/src/models/transactions/AMMBid.ts +5 -6
- package/src/models/transactions/AMMDeposit.ts +0 -1
- package/src/models/transactions/AMMWithdraw.ts +0 -1
- package/src/models/transactions/NFTokenBurn.ts +13 -9
- package/src/models/transactions/NFTokenCreateOffer.ts +8 -2
- package/src/models/transactions/NFTokenMint.ts +11 -2
- package/src/models/transactions/UNLModify.ts +3 -1
- package/src/models/transactions/XChainAccountCreateCommit.ts +10 -48
- package/src/models/transactions/XChainAddAccountCreateAttestation.ts +40 -142
- package/src/models/transactions/XChainAddClaimAttestation.ts +39 -120
- package/src/models/transactions/XChainClaim.ts +18 -42
- package/src/models/transactions/XChainCommit.ts +17 -36
- package/src/models/transactions/XChainCreateBridge.ts +7 -29
- package/src/models/transactions/XChainCreateClaimID.ts +9 -33
- package/src/models/transactions/XChainModifyBridge.ts +7 -23
- package/src/models/transactions/accountDelete.ts +12 -18
- package/src/models/transactions/accountSet.ts +10 -13
- package/src/models/transactions/checkCash.ts +0 -1
- package/src/models/transactions/checkCreate.ts +8 -16
- package/src/models/transactions/common.ts +102 -54
- package/src/models/transactions/depositPreauth.ts +0 -1
- package/src/models/transactions/escrowCancel.ts +16 -12
- package/src/models/transactions/escrowCreate.ts +12 -17
- package/src/models/transactions/escrowFinish.ts +16 -12
- package/src/models/transactions/index.ts +6 -1
- package/src/models/transactions/offerCreate.ts +0 -1
- package/src/models/transactions/payment.ts +8 -15
- package/src/models/transactions/paymentChannelClaim.ts +0 -1
- package/src/models/transactions/paymentChannelCreate.ts +12 -22
- package/src/models/transactions/signerListSet.ts +0 -1
- package/src/models/transactions/transaction.ts +5 -1
- package/src/models/utils/flags.ts +18 -29
- package/src/sugar/autofill.ts +0 -2
- package/src/utils/getXChainClaimID.ts +64 -0
- package/src/utils/hashes/hashLedger.ts +4 -1
- package/src/utils/index.ts +2 -0
- package/src/utils/signPaymentChannelClaim.ts +3 -3
- package/src/utils/verifyPaymentChannelClaim.ts +3 -3
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
/* eslint-disable complexity -- Necessary for validateBaseTransaction */
|
3
|
-
/* eslint-disable max-statements -- Necessary for validateBaseTransaction */
|
1
|
+
import { isValidClassicAddress, isValidXAddress } from 'ripple-address-codec'
|
4
2
|
import { TRANSACTION_TYPES } from 'ripple-binary-codec'
|
5
3
|
|
6
4
|
import { ValidationError } from '../../errors'
|
@@ -66,6 +64,26 @@ function isRecord(value: unknown): value is Record<string, unknown> {
|
|
66
64
|
return value !== null && typeof value === 'object'
|
67
65
|
}
|
68
66
|
|
67
|
+
/**
|
68
|
+
* Verify the form and type of a string at runtime.
|
69
|
+
*
|
70
|
+
* @param str - The object to check the form and type of.
|
71
|
+
* @returns Whether the string is properly formed.
|
72
|
+
*/
|
73
|
+
export function isString(str: unknown): str is string {
|
74
|
+
return typeof str === 'string'
|
75
|
+
}
|
76
|
+
|
77
|
+
/**
|
78
|
+
* Verify the form and type of a number at runtime.
|
79
|
+
*
|
80
|
+
* @param num - The object to check the form and type of.
|
81
|
+
* @returns Whether the number is properly formed.
|
82
|
+
*/
|
83
|
+
export function isNumber(num: unknown): num is number {
|
84
|
+
return typeof num === 'number'
|
85
|
+
}
|
86
|
+
|
69
87
|
/**
|
70
88
|
* Verify the form and type of an IssuedCurrency at runtime.
|
71
89
|
*
|
@@ -101,6 +119,24 @@ export function isIssuedCurrency(
|
|
101
119
|
)
|
102
120
|
}
|
103
121
|
|
122
|
+
/**
|
123
|
+
* Must be a valid account address
|
124
|
+
*/
|
125
|
+
export type Account = string
|
126
|
+
|
127
|
+
/**
|
128
|
+
* Verify a string is in fact a valid account address.
|
129
|
+
*
|
130
|
+
* @param account - The object to check the form and type of.
|
131
|
+
* @returns Whether the account is properly formed account for a transaction.
|
132
|
+
*/
|
133
|
+
export function isAccount(account: unknown): account is Account {
|
134
|
+
return (
|
135
|
+
typeof account === 'string' &&
|
136
|
+
(isValidClassicAddress(account) || isValidXAddress(account))
|
137
|
+
)
|
138
|
+
}
|
139
|
+
|
104
140
|
/**
|
105
141
|
* Verify the form and type of an Amount at runtime.
|
106
142
|
*
|
@@ -128,6 +164,56 @@ export function isXChainBridge(input: unknown): input is XChainBridge {
|
|
128
164
|
)
|
129
165
|
}
|
130
166
|
|
167
|
+
/* eslint-disable @typescript-eslint/restrict-template-expressions -- tx.TransactionType is checked before any calls */
|
168
|
+
|
169
|
+
/**
|
170
|
+
* Verify the form and type of a required type for a transaction at runtime.
|
171
|
+
*
|
172
|
+
* @param tx - The transaction input to check the form and type of.
|
173
|
+
* @param paramName - The name of the transaction parameter.
|
174
|
+
* @param checkValidity - The function to use to check the type.
|
175
|
+
* @throws
|
176
|
+
*/
|
177
|
+
export function validateRequiredField(
|
178
|
+
tx: Record<string, unknown>,
|
179
|
+
paramName: string,
|
180
|
+
checkValidity: (inp: unknown) => boolean,
|
181
|
+
): void {
|
182
|
+
if (tx[paramName] == null) {
|
183
|
+
throw new ValidationError(
|
184
|
+
`${tx.TransactionType}: missing field ${paramName}`,
|
185
|
+
)
|
186
|
+
}
|
187
|
+
|
188
|
+
if (!checkValidity(tx[paramName])) {
|
189
|
+
throw new ValidationError(
|
190
|
+
`${tx.TransactionType}: invalid field ${paramName}`,
|
191
|
+
)
|
192
|
+
}
|
193
|
+
}
|
194
|
+
|
195
|
+
/**
|
196
|
+
* Verify the form and type of an optional type for a transaction at runtime.
|
197
|
+
*
|
198
|
+
* @param tx - The transaction input to check the form and type of.
|
199
|
+
* @param paramName - The name of the transaction parameter.
|
200
|
+
* @param checkValidity - The function to use to check the type.
|
201
|
+
* @throws
|
202
|
+
*/
|
203
|
+
export function validateOptionalField(
|
204
|
+
tx: Record<string, unknown>,
|
205
|
+
paramName: string,
|
206
|
+
checkValidity: (inp: unknown) => boolean,
|
207
|
+
): void {
|
208
|
+
if (tx[paramName] !== undefined && !checkValidity(tx[paramName])) {
|
209
|
+
throw new ValidationError(
|
210
|
+
`${tx.TransactionType}: invalid field ${paramName}`,
|
211
|
+
)
|
212
|
+
}
|
213
|
+
}
|
214
|
+
|
215
|
+
/* eslint-enable @typescript-eslint/restrict-template-expressions -- checked before */
|
216
|
+
|
131
217
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface -- no global flags right now, so this is fine
|
132
218
|
export interface GlobalFlags {}
|
133
219
|
|
@@ -136,7 +222,7 @@ export interface GlobalFlags {}
|
|
136
222
|
*/
|
137
223
|
export interface BaseTransaction {
|
138
224
|
/** The unique address of the transaction sender. */
|
139
|
-
Account:
|
225
|
+
Account: Account
|
140
226
|
/**
|
141
227
|
* The type of transaction. Valid types include: `Payment`, `OfferCreate`,
|
142
228
|
* `TrustSet`, and many others.
|
@@ -216,14 +302,6 @@ export interface BaseTransaction {
|
|
216
302
|
* @throws When the common param is malformed.
|
217
303
|
*/
|
218
304
|
export function validateBaseTransaction(common: Record<string, unknown>): void {
|
219
|
-
if (common.Account === undefined) {
|
220
|
-
throw new ValidationError('BaseTransaction: missing field Account')
|
221
|
-
}
|
222
|
-
|
223
|
-
if (typeof common.Account !== 'string') {
|
224
|
-
throw new ValidationError('BaseTransaction: Account not string')
|
225
|
-
}
|
226
|
-
|
227
305
|
if (common.TransactionType === undefined) {
|
228
306
|
throw new ValidationError('BaseTransaction: missing field TransactionType')
|
229
307
|
}
|
@@ -236,27 +314,15 @@ export function validateBaseTransaction(common: Record<string, unknown>): void {
|
|
236
314
|
throw new ValidationError('BaseTransaction: Unknown TransactionType')
|
237
315
|
}
|
238
316
|
|
239
|
-
|
240
|
-
throw new ValidationError('BaseTransaction: invalid Fee')
|
241
|
-
}
|
317
|
+
validateRequiredField(common, 'Account', isString)
|
242
318
|
|
243
|
-
|
244
|
-
throw new ValidationError('BaseTransaction: invalid Sequence')
|
245
|
-
}
|
319
|
+
validateOptionalField(common, 'Fee', isString)
|
246
320
|
|
247
|
-
|
248
|
-
common.AccountTxnID !== undefined &&
|
249
|
-
typeof common.AccountTxnID !== 'string'
|
250
|
-
) {
|
251
|
-
throw new ValidationError('BaseTransaction: invalid AccountTxnID')
|
252
|
-
}
|
321
|
+
validateOptionalField(common, 'Sequence', isNumber)
|
253
322
|
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
) {
|
258
|
-
throw new ValidationError('BaseTransaction: invalid LastLedgerSequence')
|
259
|
-
}
|
323
|
+
validateOptionalField(common, 'AccountTxnID', isString)
|
324
|
+
|
325
|
+
validateOptionalField(common, 'LastLedgerSequence', isNumber)
|
260
326
|
|
261
327
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Only used by JS
|
262
328
|
const memos = common.Memos as Array<{ Memo?: unknown }> | undefined
|
@@ -274,33 +340,15 @@ export function validateBaseTransaction(common: Record<string, unknown>): void {
|
|
274
340
|
throw new ValidationError('BaseTransaction: invalid Signers')
|
275
341
|
}
|
276
342
|
|
277
|
-
|
278
|
-
throw new ValidationError('BaseTransaction: invalid SourceTag')
|
279
|
-
}
|
343
|
+
validateOptionalField(common, 'SourceTag', isNumber)
|
280
344
|
|
281
|
-
|
282
|
-
common.SigningPubKey !== undefined &&
|
283
|
-
typeof common.SigningPubKey !== 'string'
|
284
|
-
) {
|
285
|
-
throw new ValidationError('BaseTransaction: invalid SigningPubKey')
|
286
|
-
}
|
345
|
+
validateOptionalField(common, 'SigningPubKey', isString)
|
287
346
|
|
288
|
-
|
289
|
-
common.TicketSequence !== undefined &&
|
290
|
-
typeof common.TicketSequence !== 'number'
|
291
|
-
) {
|
292
|
-
throw new ValidationError('BaseTransaction: invalid TicketSequence')
|
293
|
-
}
|
347
|
+
validateOptionalField(common, 'TicketSequence', isNumber)
|
294
348
|
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
) {
|
299
|
-
throw new ValidationError('BaseTransaction: invalid TxnSignature')
|
300
|
-
}
|
301
|
-
if (common.NetworkID !== undefined && typeof common.NetworkID !== 'number') {
|
302
|
-
throw new ValidationError('BaseTransaction: invalid NetworkID')
|
303
|
-
}
|
349
|
+
validateOptionalField(common, 'TxnSignature', isString)
|
350
|
+
|
351
|
+
validateOptionalField(common, 'NetworkID', isNumber)
|
304
352
|
}
|
305
353
|
|
306
354
|
/**
|
@@ -1,6 +1,12 @@
|
|
1
1
|
import { ValidationError } from '../../errors'
|
2
2
|
|
3
|
-
import {
|
3
|
+
import {
|
4
|
+
Account,
|
5
|
+
BaseTransaction,
|
6
|
+
isAccount,
|
7
|
+
validateBaseTransaction,
|
8
|
+
validateRequiredField,
|
9
|
+
} from './common'
|
4
10
|
|
5
11
|
/**
|
6
12
|
* Return escrowed XRP to the sender.
|
@@ -10,12 +16,12 @@ import { BaseTransaction, validateBaseTransaction } from './common'
|
|
10
16
|
export interface EscrowCancel extends BaseTransaction {
|
11
17
|
TransactionType: 'EscrowCancel'
|
12
18
|
/** Address of the source account that funded the escrow payment. */
|
13
|
-
Owner:
|
19
|
+
Owner: Account
|
14
20
|
/**
|
15
21
|
* Transaction sequence (or Ticket number) of EscrowCreate transaction that.
|
16
22
|
* created the escrow to cancel.
|
17
23
|
*/
|
18
|
-
OfferSequence: number
|
24
|
+
OfferSequence: number | string
|
19
25
|
}
|
20
26
|
|
21
27
|
/**
|
@@ -27,19 +33,17 @@ export interface EscrowCancel extends BaseTransaction {
|
|
27
33
|
export function validateEscrowCancel(tx: Record<string, unknown>): void {
|
28
34
|
validateBaseTransaction(tx)
|
29
35
|
|
30
|
-
|
31
|
-
throw new ValidationError('EscrowCancel: missing Owner')
|
32
|
-
}
|
33
|
-
|
34
|
-
if (typeof tx.Owner !== 'string') {
|
35
|
-
throw new ValidationError('EscrowCancel: Owner must be a string')
|
36
|
-
}
|
36
|
+
validateRequiredField(tx, 'Owner', isAccount)
|
37
37
|
|
38
|
-
if (tx.OfferSequence
|
38
|
+
if (tx.OfferSequence == null) {
|
39
39
|
throw new ValidationError('EscrowCancel: missing OfferSequence')
|
40
40
|
}
|
41
41
|
|
42
|
-
if (
|
42
|
+
if (
|
43
|
+
(typeof tx.OfferSequence !== 'number' &&
|
44
|
+
typeof tx.OfferSequence !== 'string') ||
|
45
|
+
Number.isNaN(Number(tx.OfferSequence))
|
46
|
+
) {
|
43
47
|
throw new ValidationError('EscrowCancel: OfferSequence must be a number')
|
44
48
|
}
|
45
49
|
}
|
@@ -1,7 +1,14 @@
|
|
1
|
-
/* eslint-disable complexity -- Necessary for validateEscrowCreate */
|
2
1
|
import { ValidationError } from '../../errors'
|
3
2
|
|
4
|
-
import {
|
3
|
+
import {
|
4
|
+
Account,
|
5
|
+
BaseTransaction,
|
6
|
+
isAccount,
|
7
|
+
isNumber,
|
8
|
+
validateBaseTransaction,
|
9
|
+
validateOptionalField,
|
10
|
+
validateRequiredField,
|
11
|
+
} from './common'
|
5
12
|
|
6
13
|
/**
|
7
14
|
* Sequester XRP until the escrow process either finishes or is canceled.
|
@@ -17,7 +24,7 @@ export interface EscrowCreate extends BaseTransaction {
|
|
17
24
|
*/
|
18
25
|
Amount: string
|
19
26
|
/** Address to receive escrowed XRP. */
|
20
|
-
Destination:
|
27
|
+
Destination: Account
|
21
28
|
/**
|
22
29
|
* The time, in seconds since the Ripple Epoch, when this escrow expires.
|
23
30
|
* This value is immutable; the funds can only be returned the sender after.
|
@@ -59,13 +66,8 @@ export function validateEscrowCreate(tx: Record<string, unknown>): void {
|
|
59
66
|
throw new ValidationError('EscrowCreate: Amount must be a string')
|
60
67
|
}
|
61
68
|
|
62
|
-
|
63
|
-
|
64
|
-
}
|
65
|
-
|
66
|
-
if (typeof tx.Destination !== 'string') {
|
67
|
-
throw new ValidationError('EscrowCreate: Destination must be a string')
|
68
|
-
}
|
69
|
+
validateRequiredField(tx, 'Destination', isAccount)
|
70
|
+
validateOptionalField(tx, 'DestinationTag', isNumber)
|
69
71
|
|
70
72
|
if (tx.CancelAfter === undefined && tx.FinishAfter === undefined) {
|
71
73
|
throw new ValidationError(
|
@@ -90,11 +92,4 @@ export function validateEscrowCreate(tx: Record<string, unknown>): void {
|
|
90
92
|
if (tx.Condition !== undefined && typeof tx.Condition !== 'string') {
|
91
93
|
throw new ValidationError('EscrowCreate: Condition must be a string')
|
92
94
|
}
|
93
|
-
|
94
|
-
if (
|
95
|
-
tx.DestinationTag !== undefined &&
|
96
|
-
typeof tx.DestinationTag !== 'number'
|
97
|
-
) {
|
98
|
-
throw new ValidationError('EscrowCreate: DestinationTag must be a number')
|
99
|
-
}
|
100
95
|
}
|
@@ -1,6 +1,12 @@
|
|
1
1
|
import { ValidationError } from '../../errors'
|
2
2
|
|
3
|
-
import {
|
3
|
+
import {
|
4
|
+
Account,
|
5
|
+
BaseTransaction,
|
6
|
+
isAccount,
|
7
|
+
validateBaseTransaction,
|
8
|
+
validateRequiredField,
|
9
|
+
} from './common'
|
4
10
|
|
5
11
|
/**
|
6
12
|
* Deliver XRP from a held payment to the recipient.
|
@@ -10,12 +16,12 @@ import { BaseTransaction, validateBaseTransaction } from './common'
|
|
10
16
|
export interface EscrowFinish extends BaseTransaction {
|
11
17
|
TransactionType: 'EscrowFinish'
|
12
18
|
/** Address of the source account that funded the held payment. */
|
13
|
-
Owner:
|
19
|
+
Owner: Account
|
14
20
|
/**
|
15
21
|
* Transaction sequence of EscrowCreate transaction that created the held.
|
16
22
|
* payment to finish.
|
17
23
|
*/
|
18
|
-
OfferSequence: number
|
24
|
+
OfferSequence: number | string
|
19
25
|
/**
|
20
26
|
* Hex value matching the previously-supplied PREIMAGE-SHA-256.
|
21
27
|
* crypto-condition of the held payment.
|
@@ -37,19 +43,17 @@ export interface EscrowFinish extends BaseTransaction {
|
|
37
43
|
export function validateEscrowFinish(tx: Record<string, unknown>): void {
|
38
44
|
validateBaseTransaction(tx)
|
39
45
|
|
40
|
-
|
41
|
-
throw new ValidationError('EscrowFinish: missing field Owner')
|
42
|
-
}
|
43
|
-
|
44
|
-
if (typeof tx.Owner !== 'string') {
|
45
|
-
throw new ValidationError('EscrowFinish: Owner must be a string')
|
46
|
-
}
|
46
|
+
validateRequiredField(tx, 'Owner', isAccount)
|
47
47
|
|
48
|
-
if (tx.OfferSequence
|
48
|
+
if (tx.OfferSequence == null) {
|
49
49
|
throw new ValidationError('EscrowFinish: missing field OfferSequence')
|
50
50
|
}
|
51
51
|
|
52
|
-
if (
|
52
|
+
if (
|
53
|
+
(typeof tx.OfferSequence !== 'number' &&
|
54
|
+
typeof tx.OfferSequence !== 'string') ||
|
55
|
+
Number.isNaN(Number(tx.OfferSequence))
|
56
|
+
) {
|
53
57
|
throw new ValidationError('EscrowFinish: OfferSequence must be a number')
|
54
58
|
}
|
55
59
|
|
@@ -1,5 +1,10 @@
|
|
1
1
|
export { BaseTransaction } from './common'
|
2
|
-
export {
|
2
|
+
export {
|
3
|
+
validate,
|
4
|
+
PseudoTransaction,
|
5
|
+
TransactionAndMetadata,
|
6
|
+
Transaction,
|
7
|
+
} from './transaction'
|
3
8
|
export * from './metadata'
|
4
9
|
export {
|
5
10
|
AccountSetAsfFlags,
|
@@ -1,4 +1,3 @@
|
|
1
|
-
/* eslint-disable complexity -- Necessary for validatePayment */
|
2
1
|
import { ValidationError } from '../../errors'
|
3
2
|
import { Amount, Path } from '../common'
|
4
3
|
import { isFlagEnabled } from '../utils'
|
@@ -8,6 +7,11 @@ import {
|
|
8
7
|
isAmount,
|
9
8
|
GlobalFlags,
|
10
9
|
validateBaseTransaction,
|
10
|
+
isAccount,
|
11
|
+
validateRequiredField,
|
12
|
+
validateOptionalField,
|
13
|
+
isNumber,
|
14
|
+
Account,
|
11
15
|
} from './common'
|
12
16
|
|
13
17
|
/**
|
@@ -113,7 +117,7 @@ export interface Payment extends BaseTransaction {
|
|
113
117
|
*/
|
114
118
|
Amount: Amount
|
115
119
|
/** The unique address of the account receiving the payment. */
|
116
|
-
Destination:
|
120
|
+
Destination: Account
|
117
121
|
/**
|
118
122
|
* Arbitrary tag that identifies the reason for the payment to the
|
119
123
|
* destination, or a hosted recipient to pay.
|
@@ -164,19 +168,8 @@ export function validatePayment(tx: Record<string, unknown>): void {
|
|
164
168
|
throw new ValidationError('PaymentTransaction: invalid Amount')
|
165
169
|
}
|
166
170
|
|
167
|
-
|
168
|
-
|
169
|
-
}
|
170
|
-
|
171
|
-
if (!isAmount(tx.Destination)) {
|
172
|
-
throw new ValidationError('PaymentTransaction: invalid Destination')
|
173
|
-
}
|
174
|
-
|
175
|
-
if (tx.DestinationTag != null && typeof tx.DestinationTag !== 'number') {
|
176
|
-
throw new ValidationError(
|
177
|
-
'PaymentTransaction: DestinationTag must be a number',
|
178
|
-
)
|
179
|
-
}
|
171
|
+
validateRequiredField(tx, 'Destination', isAccount)
|
172
|
+
validateOptionalField(tx, 'DestinationTag', isNumber)
|
180
173
|
|
181
174
|
if (tx.InvoiceID !== undefined && typeof tx.InvoiceID !== 'string') {
|
182
175
|
throw new ValidationError('PaymentTransaction: InvoiceID must be a string')
|
@@ -1,7 +1,14 @@
|
|
1
|
-
/* eslint-disable complexity -- Necessary for validatePaymentChannelCreate */
|
2
1
|
import { ValidationError } from '../../errors'
|
3
2
|
|
4
|
-
import {
|
3
|
+
import {
|
4
|
+
Account,
|
5
|
+
BaseTransaction,
|
6
|
+
isAccount,
|
7
|
+
isNumber,
|
8
|
+
validateBaseTransaction,
|
9
|
+
validateOptionalField,
|
10
|
+
validateRequiredField,
|
11
|
+
} from './common'
|
5
12
|
|
6
13
|
/**
|
7
14
|
* Create a unidirectional channel and fund it with XRP. The address sending
|
@@ -22,7 +29,7 @@ export interface PaymentChannelCreate extends BaseTransaction {
|
|
22
29
|
* Address to receive XRP claims against this channel. This is also known as
|
23
30
|
* the "destination address" for the channel.
|
24
31
|
*/
|
25
|
-
Destination:
|
32
|
+
Destination: Account
|
26
33
|
/**
|
27
34
|
* Amount of time the source address must wait before closing the channel if
|
28
35
|
* it has unclaimed XRP.
|
@@ -55,7 +62,6 @@ export interface PaymentChannelCreate extends BaseTransaction {
|
|
55
62
|
* @param tx - An PaymentChannelCreate Transaction.
|
56
63
|
* @throws When the PaymentChannelCreate is Malformed.
|
57
64
|
*/
|
58
|
-
// eslint-disable-next-line max-lines-per-function -- okay for this function, there's a lot of things to check
|
59
65
|
export function validatePaymentChannelCreate(
|
60
66
|
tx: Record<string, unknown>,
|
61
67
|
): void {
|
@@ -69,15 +75,8 @@ export function validatePaymentChannelCreate(
|
|
69
75
|
throw new ValidationError('PaymentChannelCreate: Amount must be a string')
|
70
76
|
}
|
71
77
|
|
72
|
-
|
73
|
-
|
74
|
-
}
|
75
|
-
|
76
|
-
if (typeof tx.Destination !== 'string') {
|
77
|
-
throw new ValidationError(
|
78
|
-
'PaymentChannelCreate: Destination must be a string',
|
79
|
-
)
|
80
|
-
}
|
78
|
+
validateRequiredField(tx, 'Destination', isAccount)
|
79
|
+
validateOptionalField(tx, 'DestinationTag', isNumber)
|
81
80
|
|
82
81
|
if (tx.SettleDelay === undefined) {
|
83
82
|
throw new ValidationError('PaymentChannelCreate: missing SettleDelay')
|
@@ -104,13 +103,4 @@ export function validatePaymentChannelCreate(
|
|
104
103
|
'PaymentChannelCreate: CancelAfter must be a number',
|
105
104
|
)
|
106
105
|
}
|
107
|
-
|
108
|
-
if (
|
109
|
-
tx.DestinationTag !== undefined &&
|
110
|
-
typeof tx.DestinationTag !== 'number'
|
111
|
-
) {
|
112
|
-
throw new ValidationError(
|
113
|
-
'PaymentChannelCreate: DestinationTag must be a number',
|
114
|
-
)
|
115
|
-
}
|
116
106
|
}
|
@@ -36,7 +36,6 @@ const HEX_WALLET_LOCATOR_REGEX = /^[0-9A-Fa-f]{64}$/u
|
|
36
36
|
* @param tx - An SignerListSet Transaction.
|
37
37
|
* @throws When the SignerListSet is Malformed.
|
38
38
|
*/
|
39
|
-
// eslint-disable-next-line complexity -- validation can be complex
|
40
39
|
export function validateSignerListSet(tx: Record<string, unknown>): void {
|
41
40
|
validateBaseTransaction(tx)
|
42
41
|
|
@@ -1,5 +1,4 @@
|
|
1
1
|
/* eslint-disable max-lines -- need to work with a lot of transactions in a switch statement */
|
2
|
-
/* eslint-disable complexity -- verifies many tx types hence a lot of checks needed */
|
3
2
|
/* eslint-disable max-lines-per-function -- need to work with a lot of Tx verifications */
|
4
3
|
|
5
4
|
import { ValidationError } from '../../errors'
|
@@ -21,6 +20,7 @@ import { CheckCreate, validateCheckCreate } from './checkCreate'
|
|
21
20
|
import { Clawback, validateClawback } from './clawback'
|
22
21
|
import { isIssuedCurrency } from './common'
|
23
22
|
import { DepositPreauth, validateDepositPreauth } from './depositPreauth'
|
23
|
+
import { EnableAmendment } from './enableAmendment'
|
24
24
|
import { EscrowCancel, validateEscrowCancel } from './escrowCancel'
|
25
25
|
import { EscrowCreate, validateEscrowCreate } from './escrowCreate'
|
26
26
|
import { EscrowFinish, validateEscrowFinish } from './escrowFinish'
|
@@ -54,10 +54,12 @@ import {
|
|
54
54
|
PaymentChannelFund,
|
55
55
|
validatePaymentChannelFund,
|
56
56
|
} from './paymentChannelFund'
|
57
|
+
import { SetFee } from './setFee'
|
57
58
|
import { SetRegularKey, validateSetRegularKey } from './setRegularKey'
|
58
59
|
import { SignerListSet, validateSignerListSet } from './signerListSet'
|
59
60
|
import { TicketCreate, validateTicketCreate } from './ticketCreate'
|
60
61
|
import { TrustSet, validateTrustSet } from './trustSet'
|
62
|
+
import { UNLModify } from './UNLModify'
|
61
63
|
import {
|
62
64
|
XChainAccountCreateCommit,
|
63
65
|
validateXChainAccountCreateCommit,
|
@@ -129,6 +131,8 @@ export type Transaction =
|
|
129
131
|
| XChainAccountCreateCommit
|
130
132
|
| XChainModifyBridge
|
131
133
|
|
134
|
+
export type PseudoTransaction = EnableAmendment | SetFee | UNLModify
|
135
|
+
|
132
136
|
/**
|
133
137
|
* @category Transaction Models
|
134
138
|
*/
|
@@ -10,6 +10,8 @@ import { AccountSetTfFlags } from '../transactions/accountSet'
|
|
10
10
|
import { AMMDepositFlags } from '../transactions/AMMDeposit'
|
11
11
|
import { AMMWithdrawFlags } from '../transactions/AMMWithdraw'
|
12
12
|
import { GlobalFlags } from '../transactions/common'
|
13
|
+
import { NFTokenCreateOfferFlags } from '../transactions/NFTokenCreateOffer'
|
14
|
+
import { NFTokenMintFlags } from '../transactions/NFTokenMint'
|
13
15
|
import { OfferCreateFlags } from '../transactions/offerCreate'
|
14
16
|
import { PaymentFlags } from '../transactions/payment'
|
15
17
|
import { PaymentChannelClaimFlags } from '../transactions/paymentChannelClaim'
|
@@ -43,12 +45,24 @@ export function parseAccountRootFlags(
|
|
43
45
|
return flagsInterface
|
44
46
|
}
|
45
47
|
|
48
|
+
const txToFlag = {
|
49
|
+
AccountSet: AccountSetTfFlags,
|
50
|
+
AMMDeposit: AMMDepositFlags,
|
51
|
+
AMMWithdraw: AMMWithdrawFlags,
|
52
|
+
NFTokenCreateOffer: NFTokenCreateOfferFlags,
|
53
|
+
NFTokenMint: NFTokenMintFlags,
|
54
|
+
OfferCreate: OfferCreateFlags,
|
55
|
+
PaymentChannelClaim: PaymentChannelClaimFlags,
|
56
|
+
Payment: PaymentFlags,
|
57
|
+
TrustSet: TrustSetFlags,
|
58
|
+
XChainModifyBridge: XChainModifyBridgeFlags,
|
59
|
+
}
|
60
|
+
|
46
61
|
/**
|
47
62
|
* Sets a transaction's flags to its numeric representation.
|
48
63
|
*
|
49
64
|
* @param tx - A transaction to set its flags to its numeric representation.
|
50
65
|
*/
|
51
|
-
// eslint-disable-next-line complexity -- there's a lot of txs with flags
|
52
66
|
export function setTransactionFlagsToNumber(tx: Transaction): void {
|
53
67
|
if (tx.Flags == null) {
|
54
68
|
tx.Flags = 0
|
@@ -58,34 +72,9 @@ export function setTransactionFlagsToNumber(tx: Transaction): void {
|
|
58
72
|
return
|
59
73
|
}
|
60
74
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
return
|
65
|
-
case 'AMMDeposit':
|
66
|
-
tx.Flags = convertFlagsToNumber(tx.Flags, AMMDepositFlags)
|
67
|
-
return
|
68
|
-
case 'AMMWithdraw':
|
69
|
-
tx.Flags = convertFlagsToNumber(tx.Flags, AMMWithdrawFlags)
|
70
|
-
return
|
71
|
-
case 'OfferCreate':
|
72
|
-
tx.Flags = convertFlagsToNumber(tx.Flags, OfferCreateFlags)
|
73
|
-
return
|
74
|
-
case 'PaymentChannelClaim':
|
75
|
-
tx.Flags = convertFlagsToNumber(tx.Flags, PaymentChannelClaimFlags)
|
76
|
-
return
|
77
|
-
case 'Payment':
|
78
|
-
tx.Flags = convertFlagsToNumber(tx.Flags, PaymentFlags)
|
79
|
-
return
|
80
|
-
case 'TrustSet':
|
81
|
-
tx.Flags = convertFlagsToNumber(tx.Flags, TrustSetFlags)
|
82
|
-
return
|
83
|
-
case 'XChainModifyBridge':
|
84
|
-
tx.Flags = convertFlagsToNumber(tx.Flags, XChainModifyBridgeFlags)
|
85
|
-
return
|
86
|
-
default:
|
87
|
-
tx.Flags = 0
|
88
|
-
}
|
75
|
+
tx.Flags = txToFlag[tx.TransactionType]
|
76
|
+
? convertFlagsToNumber(tx.Flags, txToFlag[tx.TransactionType])
|
77
|
+
: 0
|
89
78
|
}
|
90
79
|
|
91
80
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- added ValidationError check for flagEnum
|
package/src/sugar/autofill.ts
CHANGED
@@ -176,8 +176,6 @@ function txNeedsNetworkID(client: Client): boolean {
|
|
176
176
|
client.networkID !== undefined &&
|
177
177
|
client.networkID > RESTRICTED_NETWORKS
|
178
178
|
) {
|
179
|
-
// TODO: remove the buildVersion logic when 1.11.0 is out and widely used.
|
180
|
-
// Issue: https://github.com/XRPLF/xrpl.js/issues/2339
|
181
179
|
if (
|
182
180
|
(client.buildVersion &&
|
183
181
|
isNotLaterRippledVersion(
|