xrpl 2.12.0 → 2.14.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 +5920 -6205
- package/build/xrpl-latest.js.map +1 -1
- package/dist/npm/Wallet/defaultFaucets.d.ts +1 -3
- package/dist/npm/Wallet/defaultFaucets.d.ts.map +1 -1
- package/dist/npm/Wallet/defaultFaucets.js +0 -10
- package/dist/npm/Wallet/defaultFaucets.js.map +1 -1
- package/dist/npm/client/index.d.ts +2 -1
- package/dist/npm/client/index.d.ts.map +1 -1
- package/dist/npm/client/index.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/ledger/AMM.d.ts +2 -4
- package/dist/npm/models/ledger/AMM.d.ts.map +1 -1
- package/dist/npm/models/ledger/AccountRoot.d.ts +2 -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 +3 -5
- 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/DID.d.ts +11 -0
- package/dist/npm/models/ledger/DID.d.ts.map +1 -0
- package/dist/npm/models/ledger/DID.js +3 -0
- package/dist/npm/models/ledger/DID.js.map +1 -0
- 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 +2 -4
- package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts.map +1 -1
- package/dist/npm/models/ledger/XChainOwnedCreateAccountClaimID.d.ts +2 -4
- 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/index.d.ts +4 -3
- package/dist/npm/models/methods/index.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 +3 -2
- package/dist/npm/models/methods/ledgerEntry.d.ts.map +1 -1
- package/dist/npm/models/methods/serverDefinitions.d.ts +32 -0
- package/dist/npm/models/methods/serverDefinitions.d.ts.map +1 -0
- package/dist/npm/models/methods/serverDefinitions.js +3 -0
- package/dist/npm/models/methods/serverDefinitions.js.map +1 -0
- package/dist/npm/models/methods/tx.d.ts +5 -2
- package/dist/npm/models/methods/tx.d.ts.map +1 -1
- package/dist/npm/models/transactions/DIDDelete.d.ts +6 -0
- package/dist/npm/models/transactions/DIDDelete.d.ts.map +1 -0
- package/dist/npm/models/transactions/DIDDelete.js +9 -0
- package/dist/npm/models/transactions/DIDDelete.js.map +1 -0
- package/dist/npm/models/transactions/DIDSet.d.ts +9 -0
- package/dist/npm/models/transactions/DIDSet.d.ts.map +1 -0
- package/dist/npm/models/transactions/DIDSet.js +18 -0
- package/dist/npm/models/transactions/DIDSet.js.map +1 -0
- 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 +1 -2
- 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 +4 -4
- 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 +4 -4
- 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 +1 -1
- 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 +1 -1
- package/dist/npm/models/transactions/XChainCommit.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 +1 -1
- package/dist/npm/models/transactions/XChainCreateClaimID.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/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 +3 -1
- package/dist/npm/models/transactions/common.d.ts.map +1 -1
- package/dist/npm/models/transactions/common.js +7 -1
- package/dist/npm/models/transactions/common.js.map +1 -1
- package/dist/npm/models/transactions/escrowCancel.d.ts +2 -2
- package/dist/npm/models/transactions/escrowCancel.d.ts.map +1 -1
- package/dist/npm/models/transactions/escrowCancel.js +1 -6
- 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 +2 -2
- package/dist/npm/models/transactions/escrowFinish.d.ts.map +1 -1
- package/dist/npm/models/transactions/escrowFinish.js +1 -6
- package/dist/npm/models/transactions/escrowFinish.js.map +1 -1
- package/dist/npm/models/transactions/index.d.ts +3 -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/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/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/transaction.d.ts +7 -1
- package/dist/npm/models/transactions/transaction.d.ts.map +1 -1
- package/dist/npm/models/transactions/transaction.js +20 -12
- 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 +2 -2
- package/dist/npm/snippets/src/bridgeTransfer.js.map +1 -1
- package/dist/npm/snippets/tsconfig.tsbuildinfo +1 -0
- package/dist/npm/src/Wallet/defaultFaucets.d.ts +1 -3
- package/dist/npm/src/Wallet/defaultFaucets.d.ts.map +1 -1
- package/dist/npm/src/Wallet/defaultFaucets.js +0 -10
- package/dist/npm/src/Wallet/defaultFaucets.js.map +1 -1
- package/dist/npm/src/client/index.d.ts +2 -1
- package/dist/npm/src/client/index.d.ts.map +1 -1
- package/dist/npm/src/client/index.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/ledger/AMM.d.ts +2 -4
- package/dist/npm/src/models/ledger/AMM.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/AccountRoot.d.ts +2 -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 +3 -5
- 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/DID.d.ts +11 -0
- package/dist/npm/src/models/ledger/DID.d.ts.map +1 -0
- package/dist/npm/src/models/ledger/DID.js +3 -0
- package/dist/npm/src/models/ledger/DID.js.map +1 -0
- 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 +2 -4
- package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/XChainOwnedCreateAccountClaimID.d.ts +2 -4
- 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/index.d.ts +4 -3
- package/dist/npm/src/models/methods/index.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 +3 -2
- package/dist/npm/src/models/methods/ledgerEntry.d.ts.map +1 -1
- package/dist/npm/src/models/methods/serverDefinitions.d.ts +32 -0
- package/dist/npm/src/models/methods/serverDefinitions.d.ts.map +1 -0
- package/dist/npm/src/models/methods/serverDefinitions.js +3 -0
- package/dist/npm/src/models/methods/serverDefinitions.js.map +1 -0
- package/dist/npm/src/models/methods/tx.d.ts +5 -2
- package/dist/npm/src/models/methods/tx.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/DIDDelete.d.ts +6 -0
- package/dist/npm/src/models/transactions/DIDDelete.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/DIDDelete.js +9 -0
- package/dist/npm/src/models/transactions/DIDDelete.js.map +1 -0
- package/dist/npm/src/models/transactions/DIDSet.d.ts +9 -0
- package/dist/npm/src/models/transactions/DIDSet.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/DIDSet.js +18 -0
- package/dist/npm/src/models/transactions/DIDSet.js.map +1 -0
- 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 +1 -2
- 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 +4 -4
- 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 +4 -4
- 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 +1 -1
- 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 +1 -1
- package/dist/npm/src/models/transactions/XChainCommit.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 +1 -1
- package/dist/npm/src/models/transactions/XChainCreateClaimID.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/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 +3 -1
- package/dist/npm/src/models/transactions/common.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/common.js +7 -1
- package/dist/npm/src/models/transactions/common.js.map +1 -1
- package/dist/npm/src/models/transactions/escrowCancel.d.ts +2 -2
- package/dist/npm/src/models/transactions/escrowCancel.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/escrowCancel.js +1 -6
- 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 +2 -2
- package/dist/npm/src/models/transactions/escrowFinish.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/escrowFinish.js +1 -6
- package/dist/npm/src/models/transactions/escrowFinish.js.map +1 -1
- package/dist/npm/src/models/transactions/index.d.ts +3 -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/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/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/transaction.d.ts +7 -1
- package/dist/npm/src/models/transactions/transaction.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/transaction.js +20 -12
- 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/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/parseNFTokenID.d.ts.map +1 -1
- package/dist/npm/src/utils/parseNFTokenID.js +10 -1
- package/dist/npm/src/utils/parseNFTokenID.js.map +1 -1
- 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/parseNFTokenID.d.ts.map +1 -1
- package/dist/npm/utils/parseNFTokenID.js +10 -1
- package/dist/npm/utils/parseNFTokenID.js.map +1 -1
- package/package.json +13 -4
- package/src/Wallet/defaultFaucets.ts +0 -12
- package/src/Wallet/fundWallet.ts +1 -1
- package/src/client/index.ts +5 -0
- package/src/client/partialPayment.ts +6 -2
- package/src/models/ledger/AMM.ts +2 -10
- package/src/models/ledger/AccountRoot.ts +2 -12
- package/src/models/ledger/Amendments.ts +4 -2
- package/src/models/ledger/BaseLedgerEntry.ts +25 -1
- package/src/models/ledger/Bridge.ts +9 -21
- package/src/models/ledger/Check.ts +2 -2
- package/src/models/ledger/DID.ts +22 -0
- 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 +23 -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 +4 -12
- package/src/models/ledger/XChainOwnedCreateAccountClaimID.ts +3 -12
- package/src/models/ledger/index.ts +4 -1
- package/src/models/methods/accountObjects.ts +10 -44
- package/src/models/methods/index.ts +8 -0
- package/src/models/methods/ledger.ts +5 -0
- package/src/models/methods/ledgerData.ts +5 -1
- package/src/models/methods/ledgerEntry.ts +8 -2
- package/src/models/methods/nftInfo.ts +1 -1
- package/src/models/methods/serverDefinitions.ts +61 -0
- package/src/models/methods/subscribe.ts +1 -1
- package/src/models/methods/tx.ts +16 -3
- package/src/models/transactions/DIDDelete.ts +20 -0
- package/src/models/transactions/DIDSet.ts +49 -0
- 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 +5 -5
- package/src/models/transactions/XChainAddAccountCreateAttestation.ts +10 -8
- package/src/models/transactions/XChainAddClaimAttestation.ts +10 -8
- package/src/models/transactions/XChainClaim.ts +4 -2
- package/src/models/transactions/XChainCommit.ts +4 -2
- package/src/models/transactions/XChainCreateClaimID.ts +4 -3
- package/src/models/transactions/accountDelete.ts +12 -18
- package/src/models/transactions/accountSet.ts +10 -11
- package/src/models/transactions/checkCreate.ts +8 -15
- package/src/models/transactions/common.ts +20 -1
- package/src/models/transactions/escrowCancel.ts +9 -9
- package/src/models/transactions/escrowCreate.ts +12 -16
- package/src/models/transactions/escrowFinish.ts +9 -9
- package/src/models/transactions/index.ts +8 -1
- package/src/models/transactions/payment.ts +8 -14
- package/src/models/transactions/paymentChannelCreate.ts +12 -21
- package/src/models/transactions/transaction.ts +37 -20
- package/src/models/utils/flags.ts +18 -28
- package/src/utils/hashes/hashLedger.ts +4 -1
- package/src/utils/parseNFTokenID.ts +11 -1
@@ -1,6 +1,12 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
1
|
+
import {
|
2
|
+
Account,
|
3
|
+
BaseTransaction,
|
4
|
+
isAccount,
|
5
|
+
isNumber,
|
6
|
+
validateBaseTransaction,
|
7
|
+
validateOptionalField,
|
8
|
+
validateRequiredField,
|
9
|
+
} from './common'
|
4
10
|
|
5
11
|
/**
|
6
12
|
* An AccountDelete transaction deletes an account and any objects it owns in
|
@@ -16,7 +22,7 @@ export interface AccountDelete extends BaseTransaction {
|
|
16
22
|
* sending account. Must be a funded account in the ledger, and must not be.
|
17
23
|
* the sending account.
|
18
24
|
*/
|
19
|
-
Destination:
|
25
|
+
Destination: Account
|
20
26
|
/**
|
21
27
|
* Arbitrary destination tag that identifies a hosted recipient or other.
|
22
28
|
* information for the recipient of the deleted account's leftover XRP.
|
@@ -33,18 +39,6 @@ export interface AccountDelete extends BaseTransaction {
|
|
33
39
|
export function validateAccountDelete(tx: Record<string, unknown>): void {
|
34
40
|
validateBaseTransaction(tx)
|
35
41
|
|
36
|
-
|
37
|
-
|
38
|
-
}
|
39
|
-
|
40
|
-
if (typeof tx.Destination !== 'string') {
|
41
|
-
throw new ValidationError('AccountDelete: invalid Destination')
|
42
|
-
}
|
43
|
-
|
44
|
-
if (
|
45
|
-
tx.DestinationTag !== undefined &&
|
46
|
-
typeof tx.DestinationTag !== 'number'
|
47
|
-
) {
|
48
|
-
throw new ValidationError('AccountDelete: invalid DestinationTag')
|
49
|
-
}
|
42
|
+
validateRequiredField(tx, 'Destination', isAccount)
|
43
|
+
validateOptionalField(tx, 'DestinationTag', isNumber)
|
50
44
|
}
|
@@ -1,8 +1,12 @@
|
|
1
|
-
import { isValidClassicAddress } from 'ripple-address-codec'
|
2
|
-
|
3
1
|
import { ValidationError } from '../../errors'
|
4
2
|
|
5
|
-
import {
|
3
|
+
import {
|
4
|
+
Account,
|
5
|
+
BaseTransaction,
|
6
|
+
isAccount,
|
7
|
+
validateBaseTransaction,
|
8
|
+
validateOptionalField,
|
9
|
+
} from './common'
|
6
10
|
|
7
11
|
/**
|
8
12
|
* Enum for AccountSet Flags.
|
@@ -155,7 +159,7 @@ export interface AccountSet extends BaseTransaction {
|
|
155
159
|
* Sets an alternate account that is allowed to mint NFTokens on this
|
156
160
|
* account's behalf using NFTokenMint's `Issuer` field.
|
157
161
|
*/
|
158
|
-
NFTokenMinter?:
|
162
|
+
NFTokenMinter?: Account
|
159
163
|
}
|
160
164
|
|
161
165
|
const MIN_TICK_SIZE = 3
|
@@ -167,16 +171,11 @@ const MAX_TICK_SIZE = 15
|
|
167
171
|
* @param tx - An AccountSet Transaction.
|
168
172
|
* @throws When the AccountSet is Malformed.
|
169
173
|
*/
|
170
|
-
// eslint-disable-next-line max-lines-per-function
|
174
|
+
// eslint-disable-next-line max-lines-per-function -- okay for this method, only a little over
|
171
175
|
export function validateAccountSet(tx: Record<string, unknown>): void {
|
172
176
|
validateBaseTransaction(tx)
|
173
177
|
|
174
|
-
|
175
|
-
tx.NFTokenMinter !== undefined &&
|
176
|
-
!isValidClassicAddress(String(tx.NFTokenMinter))
|
177
|
-
) {
|
178
|
-
throw new ValidationError('AccountSet: invalid NFTokenMinter')
|
179
|
-
}
|
178
|
+
validateOptionalField(tx, 'NFTokenMinter', isAccount)
|
180
179
|
|
181
180
|
if (tx.ClearFlag !== undefined) {
|
182
181
|
if (typeof tx.ClearFlag !== 'number') {
|
@@ -5,6 +5,11 @@ import {
|
|
5
5
|
BaseTransaction,
|
6
6
|
validateBaseTransaction,
|
7
7
|
isIssuedCurrency,
|
8
|
+
isAccount,
|
9
|
+
validateRequiredField,
|
10
|
+
validateOptionalField,
|
11
|
+
isNumber,
|
12
|
+
Account,
|
8
13
|
} from './common'
|
9
14
|
|
10
15
|
/**
|
@@ -17,7 +22,7 @@ import {
|
|
17
22
|
export interface CheckCreate extends BaseTransaction {
|
18
23
|
TransactionType: 'CheckCreate'
|
19
24
|
/** The unique address of the account that can cash the Check. */
|
20
|
-
Destination:
|
25
|
+
Destination: Account
|
21
26
|
/**
|
22
27
|
* Maximum amount of source currency the Check is allowed to debit the
|
23
28
|
* sender, including transfer fees on non-XRP currencies. The Check can only
|
@@ -56,9 +61,8 @@ export function validateCheckCreate(tx: Record<string, unknown>): void {
|
|
56
61
|
throw new ValidationError('CheckCreate: missing field SendMax')
|
57
62
|
}
|
58
63
|
|
59
|
-
|
60
|
-
|
61
|
-
}
|
64
|
+
validateRequiredField(tx, 'Destination', isAccount)
|
65
|
+
validateOptionalField(tx, 'DestinationTag', isNumber)
|
62
66
|
|
63
67
|
if (
|
64
68
|
typeof tx.SendMax !== 'string' &&
|
@@ -68,17 +72,6 @@ export function validateCheckCreate(tx: Record<string, unknown>): void {
|
|
68
72
|
throw new ValidationError('CheckCreate: invalid SendMax')
|
69
73
|
}
|
70
74
|
|
71
|
-
if (typeof tx.Destination !== 'string') {
|
72
|
-
throw new ValidationError('CheckCreate: invalid Destination')
|
73
|
-
}
|
74
|
-
|
75
|
-
if (
|
76
|
-
tx.DestinationTag !== undefined &&
|
77
|
-
typeof tx.DestinationTag !== 'number'
|
78
|
-
) {
|
79
|
-
throw new ValidationError('CheckCreate: invalid DestinationTag')
|
80
|
-
}
|
81
|
-
|
82
75
|
if (tx.Expiration !== undefined && typeof tx.Expiration !== 'number') {
|
83
76
|
throw new ValidationError('CheckCreate: invalid Expiration')
|
84
77
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { isValidClassicAddress, isValidXAddress } from 'ripple-address-codec'
|
1
2
|
import { TRANSACTION_TYPES } from 'ripple-binary-codec'
|
2
3
|
|
3
4
|
import { ValidationError } from '../../errors'
|
@@ -118,6 +119,24 @@ export function isIssuedCurrency(
|
|
118
119
|
)
|
119
120
|
}
|
120
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
|
+
|
121
140
|
/**
|
122
141
|
* Verify the form and type of an Amount at runtime.
|
123
142
|
*
|
@@ -203,7 +222,7 @@ export interface GlobalFlags {}
|
|
203
222
|
*/
|
204
223
|
export interface BaseTransaction {
|
205
224
|
/** The unique address of the transaction sender. */
|
206
|
-
Account:
|
225
|
+
Account: Account
|
207
226
|
/**
|
208
227
|
* The type of transaction. Valid types include: `Payment`, `OfferCreate`,
|
209
228
|
* `TrustSet`, and many others.
|
@@ -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,7 +16,7 @@ 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.
|
@@ -27,13 +33,7 @@ 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
38
|
if (tx.OfferSequence == null) {
|
39
39
|
throw new ValidationError('EscrowCancel: missing OfferSequence')
|
@@ -1,6 +1,14 @@
|
|
1
1
|
import { ValidationError } from '../../errors'
|
2
2
|
|
3
|
-
import {
|
3
|
+
import {
|
4
|
+
Account,
|
5
|
+
BaseTransaction,
|
6
|
+
isAccount,
|
7
|
+
isNumber,
|
8
|
+
validateBaseTransaction,
|
9
|
+
validateOptionalField,
|
10
|
+
validateRequiredField,
|
11
|
+
} from './common'
|
4
12
|
|
5
13
|
/**
|
6
14
|
* Sequester XRP until the escrow process either finishes or is canceled.
|
@@ -16,7 +24,7 @@ export interface EscrowCreate extends BaseTransaction {
|
|
16
24
|
*/
|
17
25
|
Amount: string
|
18
26
|
/** Address to receive escrowed XRP. */
|
19
|
-
Destination:
|
27
|
+
Destination: Account
|
20
28
|
/**
|
21
29
|
* The time, in seconds since the Ripple Epoch, when this escrow expires.
|
22
30
|
* This value is immutable; the funds can only be returned the sender after.
|
@@ -58,13 +66,8 @@ export function validateEscrowCreate(tx: Record<string, unknown>): void {
|
|
58
66
|
throw new ValidationError('EscrowCreate: Amount must be a string')
|
59
67
|
}
|
60
68
|
|
61
|
-
|
62
|
-
|
63
|
-
}
|
64
|
-
|
65
|
-
if (typeof tx.Destination !== 'string') {
|
66
|
-
throw new ValidationError('EscrowCreate: Destination must be a string')
|
67
|
-
}
|
69
|
+
validateRequiredField(tx, 'Destination', isAccount)
|
70
|
+
validateOptionalField(tx, 'DestinationTag', isNumber)
|
68
71
|
|
69
72
|
if (tx.CancelAfter === undefined && tx.FinishAfter === undefined) {
|
70
73
|
throw new ValidationError(
|
@@ -89,11 +92,4 @@ export function validateEscrowCreate(tx: Record<string, unknown>): void {
|
|
89
92
|
if (tx.Condition !== undefined && typeof tx.Condition !== 'string') {
|
90
93
|
throw new ValidationError('EscrowCreate: Condition must be a string')
|
91
94
|
}
|
92
|
-
|
93
|
-
if (
|
94
|
-
tx.DestinationTag !== undefined &&
|
95
|
-
typeof tx.DestinationTag !== 'number'
|
96
|
-
) {
|
97
|
-
throw new ValidationError('EscrowCreate: DestinationTag must be a number')
|
98
|
-
}
|
99
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,7 +16,7 @@ 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.
|
@@ -37,13 +43,7 @@ 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
48
|
if (tx.OfferSequence == null) {
|
49
49
|
throw new ValidationError('EscrowFinish: missing field OfferSequence')
|
@@ -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,
|
@@ -26,6 +31,8 @@ export { CheckCancel } from './checkCancel'
|
|
26
31
|
export { CheckCash } from './checkCash'
|
27
32
|
export { CheckCreate } from './checkCreate'
|
28
33
|
export { Clawback } from './clawback'
|
34
|
+
export { DIDDelete } from './DIDDelete'
|
35
|
+
export { DIDSet } from './DIDSet'
|
29
36
|
export { DepositPreauth } from './depositPreauth'
|
30
37
|
export { EscrowCancel } from './escrowCancel'
|
31
38
|
export { EscrowCreate } from './escrowCreate'
|
@@ -7,6 +7,11 @@ import {
|
|
7
7
|
isAmount,
|
8
8
|
GlobalFlags,
|
9
9
|
validateBaseTransaction,
|
10
|
+
isAccount,
|
11
|
+
validateRequiredField,
|
12
|
+
validateOptionalField,
|
13
|
+
isNumber,
|
14
|
+
Account,
|
10
15
|
} from './common'
|
11
16
|
|
12
17
|
/**
|
@@ -112,7 +117,7 @@ export interface Payment extends BaseTransaction {
|
|
112
117
|
*/
|
113
118
|
Amount: Amount
|
114
119
|
/** The unique address of the account receiving the payment. */
|
115
|
-
Destination:
|
120
|
+
Destination: Account
|
116
121
|
/**
|
117
122
|
* Arbitrary tag that identifies the reason for the payment to the
|
118
123
|
* destination, or a hosted recipient to pay.
|
@@ -163,19 +168,8 @@ export function validatePayment(tx: Record<string, unknown>): void {
|
|
163
168
|
throw new ValidationError('PaymentTransaction: invalid Amount')
|
164
169
|
}
|
165
170
|
|
166
|
-
|
167
|
-
|
168
|
-
}
|
169
|
-
|
170
|
-
if (!isAmount(tx.Destination)) {
|
171
|
-
throw new ValidationError('PaymentTransaction: invalid Destination')
|
172
|
-
}
|
173
|
-
|
174
|
-
if (tx.DestinationTag != null && typeof tx.DestinationTag !== 'number') {
|
175
|
-
throw new ValidationError(
|
176
|
-
'PaymentTransaction: DestinationTag must be a number',
|
177
|
-
)
|
178
|
-
}
|
171
|
+
validateRequiredField(tx, 'Destination', isAccount)
|
172
|
+
validateOptionalField(tx, 'DestinationTag', isNumber)
|
179
173
|
|
180
174
|
if (tx.InvoiceID !== undefined && typeof tx.InvoiceID !== 'string') {
|
181
175
|
throw new ValidationError('PaymentTransaction: InvoiceID must be a string')
|
@@ -1,6 +1,14 @@
|
|
1
1
|
import { ValidationError } from '../../errors'
|
2
2
|
|
3
|
-
import {
|
3
|
+
import {
|
4
|
+
Account,
|
5
|
+
BaseTransaction,
|
6
|
+
isAccount,
|
7
|
+
isNumber,
|
8
|
+
validateBaseTransaction,
|
9
|
+
validateOptionalField,
|
10
|
+
validateRequiredField,
|
11
|
+
} from './common'
|
4
12
|
|
5
13
|
/**
|
6
14
|
* Create a unidirectional channel and fund it with XRP. The address sending
|
@@ -21,7 +29,7 @@ export interface PaymentChannelCreate extends BaseTransaction {
|
|
21
29
|
* Address to receive XRP claims against this channel. This is also known as
|
22
30
|
* the "destination address" for the channel.
|
23
31
|
*/
|
24
|
-
Destination:
|
32
|
+
Destination: Account
|
25
33
|
/**
|
26
34
|
* Amount of time the source address must wait before closing the channel if
|
27
35
|
* it has unclaimed XRP.
|
@@ -54,7 +62,6 @@ export interface PaymentChannelCreate extends BaseTransaction {
|
|
54
62
|
* @param tx - An PaymentChannelCreate Transaction.
|
55
63
|
* @throws When the PaymentChannelCreate is Malformed.
|
56
64
|
*/
|
57
|
-
// eslint-disable-next-line max-lines-per-function -- okay for this function, there's a lot of things to check
|
58
65
|
export function validatePaymentChannelCreate(
|
59
66
|
tx: Record<string, unknown>,
|
60
67
|
): void {
|
@@ -68,15 +75,8 @@ export function validatePaymentChannelCreate(
|
|
68
75
|
throw new ValidationError('PaymentChannelCreate: Amount must be a string')
|
69
76
|
}
|
70
77
|
|
71
|
-
|
72
|
-
|
73
|
-
}
|
74
|
-
|
75
|
-
if (typeof tx.Destination !== 'string') {
|
76
|
-
throw new ValidationError(
|
77
|
-
'PaymentChannelCreate: Destination must be a string',
|
78
|
-
)
|
79
|
-
}
|
78
|
+
validateRequiredField(tx, 'Destination', isAccount)
|
79
|
+
validateOptionalField(tx, 'DestinationTag', isNumber)
|
80
80
|
|
81
81
|
if (tx.SettleDelay === undefined) {
|
82
82
|
throw new ValidationError('PaymentChannelCreate: missing SettleDelay')
|
@@ -103,13 +103,4 @@ export function validatePaymentChannelCreate(
|
|
103
103
|
'PaymentChannelCreate: CancelAfter must be a number',
|
104
104
|
)
|
105
105
|
}
|
106
|
-
|
107
|
-
if (
|
108
|
-
tx.DestinationTag !== undefined &&
|
109
|
-
typeof tx.DestinationTag !== 'number'
|
110
|
-
) {
|
111
|
-
throw new ValidationError(
|
112
|
-
'PaymentChannelCreate: DestinationTag must be a number',
|
113
|
-
)
|
114
|
-
}
|
115
106
|
}
|
@@ -20,6 +20,9 @@ import { CheckCreate, validateCheckCreate } from './checkCreate'
|
|
20
20
|
import { Clawback, validateClawback } from './clawback'
|
21
21
|
import { isIssuedCurrency } from './common'
|
22
22
|
import { DepositPreauth, validateDepositPreauth } from './depositPreauth'
|
23
|
+
import { DIDDelete, validateDIDDelete } from './DIDDelete'
|
24
|
+
import { DIDSet, validateDIDSet } from './DIDSet'
|
25
|
+
import { EnableAmendment } from './enableAmendment'
|
23
26
|
import { EscrowCancel, validateEscrowCancel } from './escrowCancel'
|
24
27
|
import { EscrowCreate, validateEscrowCreate } from './escrowCreate'
|
25
28
|
import { EscrowFinish, validateEscrowFinish } from './escrowFinish'
|
@@ -53,10 +56,12 @@ import {
|
|
53
56
|
PaymentChannelFund,
|
54
57
|
validatePaymentChannelFund,
|
55
58
|
} from './paymentChannelFund'
|
59
|
+
import { SetFee } from './setFee'
|
56
60
|
import { SetRegularKey, validateSetRegularKey } from './setRegularKey'
|
57
61
|
import { SignerListSet, validateSignerListSet } from './signerListSet'
|
58
62
|
import { TicketCreate, validateTicketCreate } from './ticketCreate'
|
59
63
|
import { TrustSet, validateTrustSet } from './trustSet'
|
64
|
+
import { UNLModify } from './UNLModify'
|
60
65
|
import {
|
61
66
|
XChainAccountCreateCommit,
|
62
67
|
validateXChainAccountCreateCommit,
|
@@ -88,18 +93,20 @@ import {
|
|
88
93
|
* @category Transaction Models
|
89
94
|
*/
|
90
95
|
export type Transaction =
|
91
|
-
| AccountDelete
|
92
|
-
| AccountSet
|
93
96
|
| AMMBid
|
97
|
+
| AMMCreate
|
94
98
|
| AMMDelete
|
95
99
|
| AMMDeposit
|
96
|
-
| AMMCreate
|
97
100
|
| AMMVote
|
98
101
|
| AMMWithdraw
|
102
|
+
| AccountDelete
|
103
|
+
| AccountSet
|
99
104
|
| CheckCancel
|
100
105
|
| CheckCash
|
101
106
|
| CheckCreate
|
102
107
|
| Clawback
|
108
|
+
| DIDDelete
|
109
|
+
| DIDSet
|
103
110
|
| DepositPreauth
|
104
111
|
| EscrowCancel
|
105
112
|
| EscrowCreate
|
@@ -119,15 +126,17 @@ export type Transaction =
|
|
119
126
|
| SignerListSet
|
120
127
|
| TicketCreate
|
121
128
|
| TrustSet
|
129
|
+
| XChainAccountCreateCommit
|
122
130
|
| XChainAddAccountCreateAttestation
|
123
131
|
| XChainAddClaimAttestation
|
124
132
|
| XChainClaim
|
125
133
|
| XChainCommit
|
126
134
|
| XChainCreateBridge
|
127
135
|
| XChainCreateClaimID
|
128
|
-
| XChainAccountCreateCommit
|
129
136
|
| XChainModifyBridge
|
130
137
|
|
138
|
+
export type PseudoTransaction = EnableAmendment | SetFee | UNLModify
|
139
|
+
|
131
140
|
/**
|
132
141
|
* @category Transaction Models
|
133
142
|
*/
|
@@ -205,18 +214,14 @@ export function validate(transaction: Record<string, unknown>): void {
|
|
205
214
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- okay here
|
206
215
|
setTransactionFlagsToNumber(tx as unknown as Transaction)
|
207
216
|
switch (tx.TransactionType) {
|
208
|
-
case 'AccountDelete':
|
209
|
-
validateAccountDelete(tx)
|
210
|
-
break
|
211
|
-
|
212
|
-
case 'AccountSet':
|
213
|
-
validateAccountSet(tx)
|
214
|
-
break
|
215
|
-
|
216
217
|
case 'AMMBid':
|
217
218
|
validateAMMBid(tx)
|
218
219
|
break
|
219
220
|
|
221
|
+
case 'AMMCreate':
|
222
|
+
validateAMMCreate(tx)
|
223
|
+
break
|
224
|
+
|
220
225
|
case 'AMMDelete':
|
221
226
|
validateAMMDelete(tx)
|
222
227
|
break
|
@@ -225,10 +230,6 @@ export function validate(transaction: Record<string, unknown>): void {
|
|
225
230
|
validateAMMDeposit(tx)
|
226
231
|
break
|
227
232
|
|
228
|
-
case 'AMMCreate':
|
229
|
-
validateAMMCreate(tx)
|
230
|
-
break
|
231
|
-
|
232
233
|
case 'AMMVote':
|
233
234
|
validateAMMVote(tx)
|
234
235
|
break
|
@@ -237,6 +238,14 @@ export function validate(transaction: Record<string, unknown>): void {
|
|
237
238
|
validateAMMWithdraw(tx)
|
238
239
|
break
|
239
240
|
|
241
|
+
case 'AccountDelete':
|
242
|
+
validateAccountDelete(tx)
|
243
|
+
break
|
244
|
+
|
245
|
+
case 'AccountSet':
|
246
|
+
validateAccountSet(tx)
|
247
|
+
break
|
248
|
+
|
240
249
|
case 'CheckCancel':
|
241
250
|
validateCheckCancel(tx)
|
242
251
|
break
|
@@ -253,6 +262,14 @@ export function validate(transaction: Record<string, unknown>): void {
|
|
253
262
|
validateClawback(tx)
|
254
263
|
break
|
255
264
|
|
265
|
+
case 'DIDDelete':
|
266
|
+
validateDIDDelete(tx)
|
267
|
+
break
|
268
|
+
|
269
|
+
case 'DIDSet':
|
270
|
+
validateDIDSet(tx)
|
271
|
+
break
|
272
|
+
|
256
273
|
case 'DepositPreauth':
|
257
274
|
validateDepositPreauth(tx)
|
258
275
|
break
|
@@ -329,6 +346,10 @@ export function validate(transaction: Record<string, unknown>): void {
|
|
329
346
|
validateTrustSet(tx)
|
330
347
|
break
|
331
348
|
|
349
|
+
case 'XChainAccountCreateCommit':
|
350
|
+
validateXChainAccountCreateCommit(tx)
|
351
|
+
break
|
352
|
+
|
332
353
|
case 'XChainAddAccountCreateAttestation':
|
333
354
|
validateXChainAddAccountCreateAttestation(tx)
|
334
355
|
break
|
@@ -353,10 +374,6 @@ export function validate(transaction: Record<string, unknown>): void {
|
|
353
374
|
validateXChainCreateClaimID(tx)
|
354
375
|
break
|
355
376
|
|
356
|
-
case 'XChainAccountCreateCommit':
|
357
|
-
validateXChainAccountCreateCommit(tx)
|
358
|
-
break
|
359
|
-
|
360
377
|
case 'XChainModifyBridge':
|
361
378
|
validateXChainModifyBridge(tx)
|
362
379
|
break
|
@@ -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,6 +45,19 @@ 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
|
*
|
@@ -57,34 +72,9 @@ export function setTransactionFlagsToNumber(tx: Transaction): void {
|
|
57
72
|
return
|
58
73
|
}
|
59
74
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
return
|
64
|
-
case 'AMMDeposit':
|
65
|
-
tx.Flags = convertFlagsToNumber(tx.Flags, AMMDepositFlags)
|
66
|
-
return
|
67
|
-
case 'AMMWithdraw':
|
68
|
-
tx.Flags = convertFlagsToNumber(tx.Flags, AMMWithdrawFlags)
|
69
|
-
return
|
70
|
-
case 'OfferCreate':
|
71
|
-
tx.Flags = convertFlagsToNumber(tx.Flags, OfferCreateFlags)
|
72
|
-
return
|
73
|
-
case 'PaymentChannelClaim':
|
74
|
-
tx.Flags = convertFlagsToNumber(tx.Flags, PaymentChannelClaimFlags)
|
75
|
-
return
|
76
|
-
case 'Payment':
|
77
|
-
tx.Flags = convertFlagsToNumber(tx.Flags, PaymentFlags)
|
78
|
-
return
|
79
|
-
case 'TrustSet':
|
80
|
-
tx.Flags = convertFlagsToNumber(tx.Flags, TrustSetFlags)
|
81
|
-
return
|
82
|
-
case 'XChainModifyBridge':
|
83
|
-
tx.Flags = convertFlagsToNumber(tx.Flags, XChainModifyBridgeFlags)
|
84
|
-
return
|
85
|
-
default:
|
86
|
-
tx.Flags = 0
|
87
|
-
}
|
75
|
+
tx.Flags = txToFlag[tx.TransactionType]
|
76
|
+
? convertFlagsToNumber(tx.Flags, txToFlag[tx.TransactionType])
|
77
|
+
: 0
|
88
78
|
}
|
89
79
|
|
90
80
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- added ValidationError check for flagEnum
|
@@ -10,6 +10,7 @@ import { ValidationError, XrplError } from '../../errors'
|
|
10
10
|
import type { Ledger } from '../../models/ledger'
|
11
11
|
import { LedgerEntry } from '../../models/ledger'
|
12
12
|
import { Transaction, TransactionMetadata } from '../../models/transactions'
|
13
|
+
import { PseudoTransaction } from '../../models/transactions/transaction'
|
13
14
|
|
14
15
|
import HashPrefix from './HashPrefix'
|
15
16
|
import sha512Half from './sha512Half'
|
@@ -124,7 +125,9 @@ export function hashLedgerHeader(ledgerHeader: Ledger): string {
|
|
124
125
|
* @category Utilities
|
125
126
|
*/
|
126
127
|
export function hashTxTree(
|
127
|
-
transactions: Array<
|
128
|
+
transactions: Array<
|
129
|
+
(Transaction | PseudoTransaction) & { metaData?: TransactionMetadata }
|
130
|
+
>,
|
128
131
|
): string {
|
129
132
|
const shamap = new SHAMap()
|
130
133
|
for (const txJSON of transactions) {
|