xrpl 2.10.0 → 2.12.0-beta.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/build/xrpl-latest-min.js +1 -1
- package/build/xrpl-latest-min.js.map +1 -1
- package/build/xrpl-latest.js +1308 -33
- package/build/xrpl-latest.js.map +1 -1
- package/dist/npm/Wallet/walletFromSecretNumbers.d.ts +7 -0
- package/dist/npm/Wallet/walletFromSecretNumbers.d.ts.map +1 -0
- package/dist/npm/Wallet/walletFromSecretNumbers.js +27 -0
- package/dist/npm/Wallet/walletFromSecretNumbers.js.map +1 -0
- 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/index.d.ts +1 -0
- package/dist/npm/index.d.ts.map +1 -1
- package/dist/npm/index.js +3 -1
- package/dist/npm/index.js.map +1 -1
- package/dist/npm/models/common/index.d.ts +11 -0
- package/dist/npm/models/common/index.d.ts.map +1 -1
- package/dist/npm/models/ledger/AMM.d.ts +27 -0
- package/dist/npm/models/ledger/AMM.d.ts.map +1 -0
- package/dist/npm/models/ledger/AMM.js +3 -0
- package/dist/npm/models/ledger/AMM.js.map +1 -0
- package/dist/npm/models/ledger/AccountRoot.d.ts +2 -0
- package/dist/npm/models/ledger/AccountRoot.d.ts.map +1 -1
- package/dist/npm/models/ledger/AccountRoot.js +1 -0
- package/dist/npm/models/ledger/AccountRoot.js.map +1 -1
- package/dist/npm/models/ledger/Bridge.d.ts +17 -0
- package/dist/npm/models/ledger/Bridge.d.ts.map +1 -0
- package/dist/npm/models/ledger/Bridge.js +3 -0
- package/dist/npm/models/ledger/Bridge.js.map +1 -0
- package/dist/npm/models/ledger/LedgerEntry.d.ts +5 -1
- package/dist/npm/models/ledger/LedgerEntry.d.ts.map +1 -1
- package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts +16 -0
- package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts.map +1 -0
- package/dist/npm/models/ledger/XChainOwnedClaimID.js +3 -0
- package/dist/npm/models/ledger/XChainOwnedClaimID.js.map +1 -0
- package/dist/npm/models/ledger/XChainOwnedCreateAccountClaimID.d.ts +14 -0
- package/dist/npm/models/ledger/XChainOwnedCreateAccountClaimID.d.ts.map +1 -0
- package/dist/npm/models/ledger/XChainOwnedCreateAccountClaimID.js +3 -0
- package/dist/npm/models/ledger/XChainOwnedCreateAccountClaimID.js.map +1 -0
- package/dist/npm/models/ledger/index.d.ts +4 -1
- 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 +3 -3
- package/dist/npm/models/methods/accountObjects.d.ts.map +1 -1
- package/dist/npm/models/methods/ammInfo.d.ts +39 -0
- package/dist/npm/models/methods/ammInfo.d.ts.map +1 -0
- package/dist/npm/models/methods/ammInfo.js +3 -0
- package/dist/npm/models/methods/ammInfo.js.map +1 -0
- 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/ledgerEntry.d.ts +27 -0
- package/dist/npm/models/methods/ledgerEntry.d.ts.map +1 -1
- package/dist/npm/models/transactions/AMMBid.d.ts +12 -0
- package/dist/npm/models/transactions/AMMBid.d.ts.map +1 -0
- package/dist/npm/models/transactions/AMMBid.js +56 -0
- package/dist/npm/models/transactions/AMMBid.js.map +1 -0
- package/dist/npm/models/transactions/AMMCreate.d.ts +11 -0
- package/dist/npm/models/transactions/AMMCreate.d.ts.map +1 -0
- package/dist/npm/models/transactions/AMMCreate.js +32 -0
- package/dist/npm/models/transactions/AMMCreate.js.map +1 -0
- package/dist/npm/models/transactions/AMMDelete.d.ts +9 -0
- package/dist/npm/models/transactions/AMMDelete.d.ts.map +1 -0
- package/dist/npm/models/transactions/AMMDelete.js +22 -0
- package/dist/npm/models/transactions/AMMDelete.js.map +1 -0
- package/dist/npm/models/transactions/AMMDeposit.d.ts +27 -0
- package/dist/npm/models/transactions/AMMDeposit.d.ts.map +1 -0
- package/dist/npm/models/transactions/AMMDeposit.js +51 -0
- package/dist/npm/models/transactions/AMMDeposit.js.map +1 -0
- package/dist/npm/models/transactions/AMMVote.d.ts +10 -0
- package/dist/npm/models/transactions/AMMVote.d.ts.map +1 -0
- package/dist/npm/models/transactions/AMMVote.js +32 -0
- package/dist/npm/models/transactions/AMMVote.js.map +1 -0
- package/dist/npm/models/transactions/AMMWithdraw.d.ts +31 -0
- package/dist/npm/models/transactions/AMMWithdraw.d.ts.map +1 -0
- package/dist/npm/models/transactions/AMMWithdraw.js +50 -0
- package/dist/npm/models/transactions/AMMWithdraw.js.map +1 -0
- package/dist/npm/models/transactions/XChainAccountCreateCommit.d.ts +11 -0
- package/dist/npm/models/transactions/XChainAccountCreateCommit.d.ts.map +1 -0
- package/dist/npm/models/transactions/XChainAccountCreateCommit.js +35 -0
- package/dist/npm/models/transactions/XChainAccountCreateCommit.js.map +1 -0
- package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.d.ts +18 -0
- package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.d.ts.map +1 -0
- package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.js +77 -0
- package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.js.map +1 -0
- package/dist/npm/models/transactions/XChainAddClaimAttestation.d.ts +17 -0
- package/dist/npm/models/transactions/XChainAddClaimAttestation.d.ts.map +1 -0
- package/dist/npm/models/transactions/XChainAddClaimAttestation.js +68 -0
- package/dist/npm/models/transactions/XChainAddClaimAttestation.js.map +1 -0
- package/dist/npm/models/transactions/XChainClaim.d.ts +12 -0
- package/dist/npm/models/transactions/XChainClaim.d.ts.map +1 -0
- package/dist/npm/models/transactions/XChainClaim.js +39 -0
- package/dist/npm/models/transactions/XChainClaim.js.map +1 -0
- package/dist/npm/models/transactions/XChainCommit.d.ts +11 -0
- package/dist/npm/models/transactions/XChainCommit.d.ts.map +1 -0
- package/dist/npm/models/transactions/XChainCommit.js +33 -0
- package/dist/npm/models/transactions/XChainCommit.js.map +1 -0
- package/dist/npm/models/transactions/XChainCreateBridge.d.ts +10 -0
- package/dist/npm/models/transactions/XChainCreateBridge.d.ts.map +1 -0
- package/dist/npm/models/transactions/XChainCreateBridge.js +26 -0
- package/dist/npm/models/transactions/XChainCreateBridge.js.map +1 -0
- package/dist/npm/models/transactions/XChainCreateClaimID.d.ts +10 -0
- package/dist/npm/models/transactions/XChainCreateClaimID.d.ts.map +1 -0
- package/dist/npm/models/transactions/XChainCreateClaimID.js +28 -0
- package/dist/npm/models/transactions/XChainCreateClaimID.js.map +1 -0
- package/dist/npm/models/transactions/XChainModifyBridge.d.ts +17 -0
- package/dist/npm/models/transactions/XChainModifyBridge.d.ts.map +1 -0
- package/dist/npm/models/transactions/XChainModifyBridge.js +27 -0
- package/dist/npm/models/transactions/XChainModifyBridge.js.map +1 -0
- 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 +22 -1
- package/dist/npm/models/transactions/common.js.map +1 -1
- package/dist/npm/models/transactions/index.d.ts +15 -1
- package/dist/npm/models/transactions/index.d.ts.map +1 -1
- package/dist/npm/models/transactions/index.js +7 -1
- package/dist/npm/models/transactions/index.js.map +1 -1
- package/dist/npm/models/transactions/transaction.d.ts +15 -1
- package/dist/npm/models/transactions/transaction.d.ts.map +1 -1
- package/dist/npm/models/transactions/transaction.js +56 -0
- 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 +18 -21
- package/dist/npm/models/utils/flags.js.map +1 -1
- package/dist/npm/snippets/src/bridgeTransfer.d.ts +2 -0
- package/dist/npm/snippets/src/bridgeTransfer.d.ts.map +1 -0
- package/dist/npm/snippets/src/bridgeTransfer.js +124 -0
- package/dist/npm/snippets/src/bridgeTransfer.js.map +1 -0
- package/dist/npm/snippets/tsconfig.tsbuildinfo +1 -1
- package/dist/npm/src/Wallet/walletFromSecretNumbers.d.ts +7 -0
- package/dist/npm/src/Wallet/walletFromSecretNumbers.d.ts.map +1 -0
- package/dist/npm/src/Wallet/walletFromSecretNumbers.js +27 -0
- package/dist/npm/src/Wallet/walletFromSecretNumbers.js.map +1 -0
- 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/index.d.ts +1 -0
- package/dist/npm/src/index.d.ts.map +1 -1
- package/dist/npm/src/index.js +3 -1
- package/dist/npm/src/index.js.map +1 -1
- package/dist/npm/src/models/common/index.d.ts +11 -0
- package/dist/npm/src/models/common/index.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/AMM.d.ts +27 -0
- package/dist/npm/src/models/ledger/AMM.d.ts.map +1 -0
- package/dist/npm/src/models/ledger/AMM.js +3 -0
- package/dist/npm/src/models/ledger/AMM.js.map +1 -0
- package/dist/npm/src/models/ledger/AccountRoot.d.ts +2 -0
- package/dist/npm/src/models/ledger/AccountRoot.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/AccountRoot.js +1 -0
- package/dist/npm/src/models/ledger/AccountRoot.js.map +1 -1
- package/dist/npm/src/models/ledger/Bridge.d.ts +17 -0
- package/dist/npm/src/models/ledger/Bridge.d.ts.map +1 -0
- package/dist/npm/src/models/ledger/Bridge.js +3 -0
- package/dist/npm/src/models/ledger/Bridge.js.map +1 -0
- package/dist/npm/src/models/ledger/LedgerEntry.d.ts +5 -1
- package/dist/npm/src/models/ledger/LedgerEntry.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts +16 -0
- package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts.map +1 -0
- package/dist/npm/src/models/ledger/XChainOwnedClaimID.js +3 -0
- package/dist/npm/src/models/ledger/XChainOwnedClaimID.js.map +1 -0
- package/dist/npm/src/models/ledger/XChainOwnedCreateAccountClaimID.d.ts +14 -0
- package/dist/npm/src/models/ledger/XChainOwnedCreateAccountClaimID.d.ts.map +1 -0
- package/dist/npm/src/models/ledger/XChainOwnedCreateAccountClaimID.js +3 -0
- package/dist/npm/src/models/ledger/XChainOwnedCreateAccountClaimID.js.map +1 -0
- package/dist/npm/src/models/ledger/index.d.ts +4 -1
- 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 +3 -3
- package/dist/npm/src/models/methods/accountObjects.d.ts.map +1 -1
- package/dist/npm/src/models/methods/ammInfo.d.ts +39 -0
- package/dist/npm/src/models/methods/ammInfo.d.ts.map +1 -0
- package/dist/npm/src/models/methods/ammInfo.js +3 -0
- package/dist/npm/src/models/methods/ammInfo.js.map +1 -0
- 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/ledgerEntry.d.ts +27 -0
- package/dist/npm/src/models/methods/ledgerEntry.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/AMMBid.d.ts +12 -0
- package/dist/npm/src/models/transactions/AMMBid.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/AMMBid.js +56 -0
- package/dist/npm/src/models/transactions/AMMBid.js.map +1 -0
- package/dist/npm/src/models/transactions/AMMCreate.d.ts +11 -0
- package/dist/npm/src/models/transactions/AMMCreate.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/AMMCreate.js +32 -0
- package/dist/npm/src/models/transactions/AMMCreate.js.map +1 -0
- package/dist/npm/src/models/transactions/AMMDelete.d.ts +9 -0
- package/dist/npm/src/models/transactions/AMMDelete.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/AMMDelete.js +22 -0
- package/dist/npm/src/models/transactions/AMMDelete.js.map +1 -0
- package/dist/npm/src/models/transactions/AMMDeposit.d.ts +27 -0
- package/dist/npm/src/models/transactions/AMMDeposit.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/AMMDeposit.js +51 -0
- package/dist/npm/src/models/transactions/AMMDeposit.js.map +1 -0
- package/dist/npm/src/models/transactions/AMMVote.d.ts +10 -0
- package/dist/npm/src/models/transactions/AMMVote.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/AMMVote.js +32 -0
- package/dist/npm/src/models/transactions/AMMVote.js.map +1 -0
- package/dist/npm/src/models/transactions/AMMWithdraw.d.ts +31 -0
- package/dist/npm/src/models/transactions/AMMWithdraw.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/AMMWithdraw.js +50 -0
- package/dist/npm/src/models/transactions/AMMWithdraw.js.map +1 -0
- package/dist/npm/src/models/transactions/XChainAccountCreateCommit.d.ts +11 -0
- package/dist/npm/src/models/transactions/XChainAccountCreateCommit.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/XChainAccountCreateCommit.js +35 -0
- package/dist/npm/src/models/transactions/XChainAccountCreateCommit.js.map +1 -0
- package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.d.ts +18 -0
- package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.js +77 -0
- package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.js.map +1 -0
- package/dist/npm/src/models/transactions/XChainAddClaimAttestation.d.ts +17 -0
- package/dist/npm/src/models/transactions/XChainAddClaimAttestation.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/XChainAddClaimAttestation.js +68 -0
- package/dist/npm/src/models/transactions/XChainAddClaimAttestation.js.map +1 -0
- package/dist/npm/src/models/transactions/XChainClaim.d.ts +12 -0
- package/dist/npm/src/models/transactions/XChainClaim.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/XChainClaim.js +39 -0
- package/dist/npm/src/models/transactions/XChainClaim.js.map +1 -0
- package/dist/npm/src/models/transactions/XChainCommit.d.ts +11 -0
- package/dist/npm/src/models/transactions/XChainCommit.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/XChainCommit.js +33 -0
- package/dist/npm/src/models/transactions/XChainCommit.js.map +1 -0
- package/dist/npm/src/models/transactions/XChainCreateBridge.d.ts +10 -0
- package/dist/npm/src/models/transactions/XChainCreateBridge.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/XChainCreateBridge.js +26 -0
- package/dist/npm/src/models/transactions/XChainCreateBridge.js.map +1 -0
- package/dist/npm/src/models/transactions/XChainCreateClaimID.d.ts +10 -0
- package/dist/npm/src/models/transactions/XChainCreateClaimID.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/XChainCreateClaimID.js +28 -0
- package/dist/npm/src/models/transactions/XChainCreateClaimID.js.map +1 -0
- package/dist/npm/src/models/transactions/XChainModifyBridge.d.ts +17 -0
- package/dist/npm/src/models/transactions/XChainModifyBridge.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/XChainModifyBridge.js +27 -0
- package/dist/npm/src/models/transactions/XChainModifyBridge.js.map +1 -0
- 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 +22 -1
- package/dist/npm/src/models/transactions/common.js.map +1 -1
- package/dist/npm/src/models/transactions/index.d.ts +15 -1
- package/dist/npm/src/models/transactions/index.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/index.js +7 -1
- package/dist/npm/src/models/transactions/index.js.map +1 -1
- package/dist/npm/src/models/transactions/transaction.d.ts +15 -1
- package/dist/npm/src/models/transactions/transaction.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/transaction.js +56 -0
- 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 +18 -21
- 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 +4 -3
- package/dist/npm/src/sugar/autofill.js.map +1 -1
- package/dist/npm/sugar/autofill.d.ts.map +1 -1
- package/dist/npm/sugar/autofill.js +4 -3
- package/dist/npm/sugar/autofill.js.map +1 -1
- package/package.json +8 -6
- package/src/ECDSA.ts +6 -0
- package/src/Wallet/defaultFaucets.ts +82 -0
- package/src/Wallet/fundWallet.ts +344 -0
- package/src/Wallet/index.ts +504 -0
- package/src/Wallet/rfc1751.ts +190 -0
- package/src/Wallet/rfc1751Words.json +243 -0
- package/src/Wallet/signer.ts +173 -0
- package/src/Wallet/walletFromSecretNumbers.ts +37 -0
- package/src/client/BroadcastClient.ts +84 -0
- package/src/client/ConnectionManager.ts +40 -0
- package/src/client/ExponentialBackoff.ts +71 -0
- package/src/client/RequestManager.ts +194 -0
- package/src/client/WSWrapper.ts +106 -0
- package/src/client/connection.ts +593 -0
- package/src/client/index.ts +712 -0
- package/src/client/partialPayment.ts +153 -0
- package/src/errors.ts +161 -0
- package/src/index.ts +20 -0
- package/src/models/common/index.ts +156 -0
- package/src/models/index.ts +16 -0
- package/src/models/ledger/AMM.ts +78 -0
- package/src/models/ledger/AccountRoot.ts +217 -0
- package/src/models/ledger/Amendments.ts +45 -0
- package/src/models/ledger/BaseLedgerEntry.ts +3 -0
- package/src/models/ledger/Bridge.ts +84 -0
- package/src/models/ledger/Check.ts +70 -0
- package/src/models/ledger/DepositPreauth.ts +35 -0
- package/src/models/ledger/DirectoryNode.ts +46 -0
- package/src/models/ledger/Escrow.ts +74 -0
- package/src/models/ledger/FeeSettings.ts +52 -0
- package/src/models/ledger/Ledger.ts +65 -0
- package/src/models/ledger/LedgerEntry.ts +40 -0
- package/src/models/ledger/LedgerHashes.ts +24 -0
- package/src/models/ledger/NFTokenOffer.ts +16 -0
- package/src/models/ledger/NFTokenPage.ts +20 -0
- package/src/models/ledger/NegativeUNL.ts +34 -0
- package/src/models/ledger/Offer.ts +52 -0
- package/src/models/ledger/PayChannel.ts +107 -0
- package/src/models/ledger/RippleState.ts +88 -0
- package/src/models/ledger/SignerList.ts +56 -0
- package/src/models/ledger/Ticket.ts +36 -0
- package/src/models/ledger/XChainOwnedClaimID.ts +73 -0
- package/src/models/ledger/XChainOwnedCreateAccountClaimID.ts +60 -0
- package/src/models/ledger/index.ts +64 -0
- package/src/models/methods/accountChannels.ts +93 -0
- package/src/models/methods/accountCurrencies.ts +45 -0
- package/src/models/methods/accountInfo.ts +182 -0
- package/src/models/methods/accountLines.ts +137 -0
- package/src/models/methods/accountNFTs.ts +72 -0
- package/src/models/methods/accountObjects.ts +129 -0
- package/src/models/methods/accountOffers.ts +100 -0
- package/src/models/methods/accountTx.ts +109 -0
- package/src/models/methods/ammInfo.ts +145 -0
- package/src/models/methods/baseMethod.ts +58 -0
- package/src/models/methods/bookOffers.ts +96 -0
- package/src/models/methods/channelVerify.ts +41 -0
- package/src/models/methods/depositAuthorized.ts +56 -0
- package/src/models/methods/fee.ts +91 -0
- package/src/models/methods/gatewayBalances.ts +85 -0
- package/src/models/methods/index.ts +391 -0
- package/src/models/methods/ledger.ts +125 -0
- package/src/models/methods/ledgerClosed.ts +32 -0
- package/src/models/methods/ledgerCurrent.ts +31 -0
- package/src/models/methods/ledgerData.ts +78 -0
- package/src/models/methods/ledgerEntry.ts +202 -0
- package/src/models/methods/manifest.ts +54 -0
- package/src/models/methods/nftBuyOffers.ts +37 -0
- package/src/models/methods/nftHistory.ts +113 -0
- package/src/models/methods/nftInfo.ts +25 -0
- package/src/models/methods/nftSellOffers.ts +37 -0
- package/src/models/methods/norippleCheck.ts +82 -0
- package/src/models/methods/pathFind.ts +116 -0
- package/src/models/methods/ping.ts +21 -0
- package/src/models/methods/random.ts +23 -0
- package/src/models/methods/ripplePathFind.ts +81 -0
- package/src/models/methods/serverInfo.ts +257 -0
- package/src/models/methods/serverState.ts +77 -0
- package/src/models/methods/submit.ts +94 -0
- package/src/models/methods/submitMultisigned.ts +51 -0
- package/src/models/methods/subscribe.ts +435 -0
- package/src/models/methods/transactionEntry.ts +47 -0
- package/src/models/methods/tx.ts +69 -0
- package/src/models/methods/unsubscribe.ts +49 -0
- package/src/models/transactions/AMMBid.ts +140 -0
- package/src/models/transactions/AMMCreate.ts +80 -0
- package/src/models/transactions/AMMDelete.ts +55 -0
- package/src/models/transactions/AMMDeposit.ts +130 -0
- package/src/models/transactions/AMMVote.ts +71 -0
- package/src/models/transactions/AMMWithdraw.ts +126 -0
- package/src/models/transactions/NFTokenAcceptOffer.ts +104 -0
- package/src/models/transactions/NFTokenBurn.ts +48 -0
- package/src/models/transactions/NFTokenCancelOffer.ts +45 -0
- package/src/models/transactions/NFTokenCreateOffer.ts +145 -0
- package/src/models/transactions/NFTokenMint.ts +123 -0
- package/src/models/transactions/UNLModify.ts +20 -0
- package/src/models/transactions/XChainAccountCreateCommit.ts +107 -0
- package/src/models/transactions/XChainAddAccountCreateAttestation.ts +225 -0
- package/src/models/transactions/XChainAddClaimAttestation.ts +198 -0
- package/src/models/transactions/XChainClaim.ts +103 -0
- package/src/models/transactions/XChainCommit.ts +95 -0
- package/src/models/transactions/XChainCreateBridge.ts +78 -0
- package/src/models/transactions/XChainCreateClaimID.ts +78 -0
- package/src/models/transactions/XChainModifyBridge.ts +93 -0
- package/src/models/transactions/accountDelete.ts +50 -0
- package/src/models/transactions/accountSet.ts +228 -0
- package/src/models/transactions/checkCancel.ts +34 -0
- package/src/models/transactions/checkCash.ts +73 -0
- package/src/models/transactions/checkCreate.ts +90 -0
- package/src/models/transactions/clawback.ts +49 -0
- package/src/models/transactions/common.ts +320 -0
- package/src/models/transactions/depositPreauth.ts +68 -0
- package/src/models/transactions/enableAmendment.ts +26 -0
- package/src/models/transactions/escrowCancel.ts +45 -0
- package/src/models/transactions/escrowCreate.ts +100 -0
- package/src/models/transactions/escrowFinish.ts +63 -0
- package/src/models/transactions/index.ts +78 -0
- package/src/models/transactions/metadata.ts +69 -0
- package/src/models/transactions/offerCancel.ts +37 -0
- package/src/models/transactions/offerCreate.ts +144 -0
- package/src/models/transactions/payment.ts +278 -0
- package/src/models/transactions/paymentChannelClaim.ts +165 -0
- package/src/models/transactions/paymentChannelCreate.ts +116 -0
- package/src/models/transactions/paymentChannelFund.ts +65 -0
- package/src/models/transactions/setFee.ts +48 -0
- package/src/models/transactions/setRegularKey.ts +33 -0
- package/src/models/transactions/signerListSet.ts +89 -0
- package/src/models/transactions/ticketCreate.ts +50 -0
- package/src/models/transactions/transaction.ts +370 -0
- package/src/models/transactions/trustSet.ts +146 -0
- package/src/models/utils/flags.ts +103 -0
- package/src/models/utils/index.ts +37 -0
- package/src/sugar/autofill.ts +373 -0
- package/src/sugar/balances.ts +123 -0
- package/src/sugar/getFeeXrp.ts +45 -0
- package/src/sugar/getLedgerIndex.ts +15 -0
- package/src/sugar/getOrderbook.ts +152 -0
- package/src/sugar/index.ts +11 -0
- package/src/sugar/submit.ts +305 -0
- package/src/sugar/utils.ts +29 -0
- package/src/utils/derive.ts +23 -0
- package/src/utils/getBalanceChanges.ts +186 -0
- package/src/utils/getNFTokenID.ts +97 -0
- package/src/utils/hashes/HashPrefix.ts +40 -0
- package/src/utils/hashes/README.md +65 -0
- package/src/utils/hashes/SHAMap/InnerNode.ts +124 -0
- package/src/utils/hashes/SHAMap/LeafNode.ts +69 -0
- package/src/utils/hashes/SHAMap/index.ts +41 -0
- package/src/utils/hashes/SHAMap/node.ts +14 -0
- package/src/utils/hashes/hashLedger.ts +236 -0
- package/src/utils/hashes/index.ts +187 -0
- package/src/utils/hashes/ledgerSpaces.ts +34 -0
- package/src/utils/hashes/sha512Half.ts +19 -0
- package/src/utils/index.ts +223 -0
- package/src/utils/parseNFTokenID.ts +84 -0
- package/src/utils/quality.ts +169 -0
- package/src/utils/signPaymentChannelClaim.ts +27 -0
- package/src/utils/stringConversion.ts +27 -0
- package/src/utils/timeConversion.ts +53 -0
- package/src/utils/verifyPaymentChannelClaim.ts +30 -0
- package/src/utils/xrpConversion.ts +104 -0
@@ -0,0 +1,104 @@
|
|
1
|
+
import { ValidationError } from '../../errors'
|
2
|
+
import { Amount } from '../common'
|
3
|
+
|
4
|
+
import {
|
5
|
+
BaseTransaction,
|
6
|
+
parseAmountValue,
|
7
|
+
validateBaseTransaction,
|
8
|
+
} from './common'
|
9
|
+
|
10
|
+
/**
|
11
|
+
* The NFTokenOfferAccept transaction is used to accept offers
|
12
|
+
* to buy or sell an NFToken. It can either:
|
13
|
+
*
|
14
|
+
* 1. Allow one offer to be accepted. This is called direct
|
15
|
+
* mode.
|
16
|
+
* 2. Allow two distinct offers, one offering to buy a
|
17
|
+
* given NFToken and the other offering to sell the same
|
18
|
+
* NFToken, to be accepted in an atomic fashion. This is
|
19
|
+
* called brokered mode.
|
20
|
+
*
|
21
|
+
* To indicate direct mode, use either the `sell_offer` or
|
22
|
+
* `buy_offer` fields, but not both. To indicate brokered mode,
|
23
|
+
* use both the `sell_offer` and `buy_offer` fields. If you use
|
24
|
+
* neither `sell_offer` nor `buy_offer`, the transaction is invalid.
|
25
|
+
*/
|
26
|
+
export interface NFTokenAcceptOffer extends BaseTransaction {
|
27
|
+
TransactionType: 'NFTokenAcceptOffer'
|
28
|
+
/**
|
29
|
+
* Identifies the NFTokenOffer that offers to sell the NFToken.
|
30
|
+
*
|
31
|
+
* In direct mode this field is optional, but either NFTokenSellOffer or
|
32
|
+
* NFTokenBuyOffer must be specified. In brokered mode, both NFTokenSellOffer
|
33
|
+
* and NFTokenBuyOffer must be specified.
|
34
|
+
*/
|
35
|
+
NFTokenSellOffer?: string
|
36
|
+
/**
|
37
|
+
* Identifies the NFTokenOffer that offers to buy the NFToken.
|
38
|
+
*
|
39
|
+
* In direct mode this field is optional, but either NFTokenSellOffer or
|
40
|
+
* NFTokenBuyOffer must be specified. In brokered mode, both NFTokenSellOffer
|
41
|
+
* and NFTokenBuyOffer must be specified.
|
42
|
+
*/
|
43
|
+
NFTokenBuyOffer?: string
|
44
|
+
/**
|
45
|
+
* This field is only valid in brokered mode. It specifies the
|
46
|
+
* amount that the broker will keep as part of their fee for
|
47
|
+
* bringing the two offers together; the remaining amount will
|
48
|
+
* be sent to the seller of the NFToken being bought. If
|
49
|
+
* specified, the fee must be such that, prior to accounting
|
50
|
+
* for the transfer fee charged by the issuer, the amount that
|
51
|
+
* the seller would receive is at least as much as the amount
|
52
|
+
* indicated in the sell offer.
|
53
|
+
*
|
54
|
+
* This functionality is intended to allow the owner of an
|
55
|
+
* NFToken to offer their token for sale to a third party
|
56
|
+
* broker, who may then attempt to sell the NFToken on for a
|
57
|
+
* larger amount, without the broker having to own the NFToken
|
58
|
+
* or custody funds.
|
59
|
+
*
|
60
|
+
* Note: in brokered mode, the offers referenced by NFTokenBuyOffer
|
61
|
+
* and NFTokenSellOffer must both specify the same NFTokenID; that is,
|
62
|
+
* both must be for the same NFToken.
|
63
|
+
*/
|
64
|
+
NFTokenBrokerFee?: Amount
|
65
|
+
}
|
66
|
+
|
67
|
+
function validateNFTokenBrokerFee(tx: Record<string, unknown>): void {
|
68
|
+
const value = parseAmountValue(tx.NFTokenBrokerFee)
|
69
|
+
if (Number.isNaN(value)) {
|
70
|
+
throw new ValidationError('NFTokenAcceptOffer: invalid NFTokenBrokerFee')
|
71
|
+
}
|
72
|
+
|
73
|
+
if (value <= 0) {
|
74
|
+
throw new ValidationError(
|
75
|
+
'NFTokenAcceptOffer: NFTokenBrokerFee must be greater than 0; omit if there is no fee',
|
76
|
+
)
|
77
|
+
}
|
78
|
+
|
79
|
+
if (tx.NFTokenSellOffer == null || tx.NFTokenBuyOffer == null) {
|
80
|
+
throw new ValidationError(
|
81
|
+
'NFTokenAcceptOffer: both NFTokenSellOffer and NFTokenBuyOffer must be set if using brokered mode',
|
82
|
+
)
|
83
|
+
}
|
84
|
+
}
|
85
|
+
|
86
|
+
/**
|
87
|
+
* Verify the form and type of an NFTokenAcceptOffer at runtime.
|
88
|
+
*
|
89
|
+
* @param tx - An NFTokenAcceptOffer Transaction.
|
90
|
+
* @throws When the NFTokenAcceptOffer is Malformed.
|
91
|
+
*/
|
92
|
+
export function validateNFTokenAcceptOffer(tx: Record<string, unknown>): void {
|
93
|
+
validateBaseTransaction(tx)
|
94
|
+
|
95
|
+
if (tx.NFTokenBrokerFee != null) {
|
96
|
+
validateNFTokenBrokerFee(tx)
|
97
|
+
}
|
98
|
+
|
99
|
+
if (tx.NFTokenSellOffer == null && tx.NFTokenBuyOffer == null) {
|
100
|
+
throw new ValidationError(
|
101
|
+
'NFTokenAcceptOffer: must set either NFTokenSellOffer or NFTokenBuyOffer',
|
102
|
+
)
|
103
|
+
}
|
104
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { ValidationError } from '../../errors'
|
2
|
+
|
3
|
+
import { BaseTransaction, validateBaseTransaction } from './common'
|
4
|
+
|
5
|
+
/**
|
6
|
+
* The NFTokenBurn transaction is used to remove an NFToken object from the
|
7
|
+
* NFTokenPage in which it is being held, effectively removing the token from
|
8
|
+
* the ledger ("burning" it).
|
9
|
+
*
|
10
|
+
* If this operation succeeds, the corresponding NFToken is removed. If this
|
11
|
+
* operation empties the NFTokenPage holding the NFToken or results in the
|
12
|
+
* consolidation, thus removing an NFTokenPage, the owner’s reserve requirement
|
13
|
+
* is reduced by one.
|
14
|
+
*/
|
15
|
+
export interface NFTokenBurn extends BaseTransaction {
|
16
|
+
TransactionType: 'NFTokenBurn'
|
17
|
+
/**
|
18
|
+
* Indicates the AccountID that submitted this transaction. The account MUST
|
19
|
+
* be either the present owner of the token or, if the lsfBurnable flag is set
|
20
|
+
* in the NFToken, either the issuer account or an account authorized by the
|
21
|
+
* issuer, i.e. MintAccount.
|
22
|
+
*/
|
23
|
+
Account: string
|
24
|
+
/**
|
25
|
+
* Identifies the NFToken object to be removed by the transaction.
|
26
|
+
*/
|
27
|
+
NFTokenID: string
|
28
|
+
/**
|
29
|
+
* Indicates which account currently owns the token if it is different than
|
30
|
+
* Account. Only used to burn tokens which have the lsfBurnable flag enabled
|
31
|
+
* and are not owned by the signing account.
|
32
|
+
*/
|
33
|
+
Owner?: string
|
34
|
+
}
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Verify the form and type of an NFTokenBurn at runtime.
|
38
|
+
*
|
39
|
+
* @param tx - An NFTokenBurn Transaction.
|
40
|
+
* @throws When the NFTokenBurn is Malformed.
|
41
|
+
*/
|
42
|
+
export function validateNFTokenBurn(tx: Record<string, unknown>): void {
|
43
|
+
validateBaseTransaction(tx)
|
44
|
+
|
45
|
+
if (tx.NFTokenID == null) {
|
46
|
+
throw new ValidationError('NFTokenBurn: missing field NFTokenID')
|
47
|
+
}
|
48
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { ValidationError } from '../../errors'
|
2
|
+
|
3
|
+
import { BaseTransaction, validateBaseTransaction } from './common'
|
4
|
+
|
5
|
+
/**
|
6
|
+
* The NFTokenCancelOffer transaction deletes existing NFTokenOffer objects.
|
7
|
+
* It is useful if you want to free up space on your account to lower your
|
8
|
+
* reserve requirement.
|
9
|
+
*
|
10
|
+
* The transaction can be executed by the account that originally created
|
11
|
+
* the NFTokenOffer, the account in the `Recipient` field of the NFTokenOffer
|
12
|
+
* (if present), or any account if the NFTokenOffer has an `Expiration` and
|
13
|
+
* the NFTokenOffer has already expired.
|
14
|
+
*/
|
15
|
+
export interface NFTokenCancelOffer extends BaseTransaction {
|
16
|
+
TransactionType: 'NFTokenCancelOffer'
|
17
|
+
/**
|
18
|
+
* An array of identifiers of NFTokenOffer objects that should be cancelled
|
19
|
+
* by this transaction.
|
20
|
+
*
|
21
|
+
* It is an error if an entry in this list points to an
|
22
|
+
* object that is not an NFTokenOffer object. It is not an
|
23
|
+
* error if an entry in this list points to an object that
|
24
|
+
* does not exist. This field is required.
|
25
|
+
*/
|
26
|
+
NFTokenOffers: string[]
|
27
|
+
}
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Verify the form and type of an NFTokenCancelOffer at runtime.
|
31
|
+
*
|
32
|
+
* @param tx - An NFTokenCancelOffer Transaction.
|
33
|
+
* @throws When the NFTokenCancelOffer is Malformed.
|
34
|
+
*/
|
35
|
+
export function validateNFTokenCancelOffer(tx: Record<string, unknown>): void {
|
36
|
+
validateBaseTransaction(tx)
|
37
|
+
|
38
|
+
if (!Array.isArray(tx.NFTokenOffers)) {
|
39
|
+
throw new ValidationError('NFTokenCancelOffer: missing field NFTokenOffers')
|
40
|
+
}
|
41
|
+
|
42
|
+
if (tx.NFTokenOffers.length < 1) {
|
43
|
+
throw new ValidationError('NFTokenCancelOffer: empty field NFTokenOffers')
|
44
|
+
}
|
45
|
+
}
|
@@ -0,0 +1,145 @@
|
|
1
|
+
import { ValidationError } from '../../errors'
|
2
|
+
import { Amount } from '../common'
|
3
|
+
import { isFlagEnabled } from '../utils'
|
4
|
+
|
5
|
+
import {
|
6
|
+
BaseTransaction,
|
7
|
+
GlobalFlags,
|
8
|
+
validateBaseTransaction,
|
9
|
+
isAmount,
|
10
|
+
parseAmountValue,
|
11
|
+
} from './common'
|
12
|
+
|
13
|
+
/**
|
14
|
+
* Transaction Flags for an NFTokenCreateOffer Transaction.
|
15
|
+
*
|
16
|
+
* @category Transaction Flags
|
17
|
+
*/
|
18
|
+
export enum NFTokenCreateOfferFlags {
|
19
|
+
/**
|
20
|
+
* If set, indicates that the offer is a sell offer.
|
21
|
+
* Otherwise, it is a buy offer.
|
22
|
+
*/
|
23
|
+
tfSellNFToken = 0x00000001,
|
24
|
+
}
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Map of flags to boolean values representing {@link NFTokenCreateOffer} transaction
|
28
|
+
* flags.
|
29
|
+
*
|
30
|
+
* @category Transaction Flags
|
31
|
+
*/
|
32
|
+
export interface NFTokenCreateOfferFlagsInterface extends GlobalFlags {
|
33
|
+
tfSellNFToken?: boolean
|
34
|
+
}
|
35
|
+
|
36
|
+
/**
|
37
|
+
* The NFTokenCreateOffer transaction creates either an offer to buy an
|
38
|
+
* NFT the submitting account does not own, or an offer to sell an NFT
|
39
|
+
* the submitting account does own.
|
40
|
+
*/
|
41
|
+
export interface NFTokenCreateOffer extends BaseTransaction {
|
42
|
+
TransactionType: 'NFTokenCreateOffer'
|
43
|
+
/**
|
44
|
+
* Identifies the NFTokenID of the NFToken object that the
|
45
|
+
* offer references.
|
46
|
+
*/
|
47
|
+
NFTokenID: string
|
48
|
+
/**
|
49
|
+
* Indicates the amount expected or offered for the Token.
|
50
|
+
*
|
51
|
+
* The amount must be non-zero, except when this is a sell
|
52
|
+
* offer and the asset is XRP. This would indicate that the current
|
53
|
+
* owner of the token is giving it away free, either to anyone at all,
|
54
|
+
* or to the account identified by the Destination field.
|
55
|
+
*/
|
56
|
+
Amount: Amount
|
57
|
+
/**
|
58
|
+
* Indicates the AccountID of the account that owns the
|
59
|
+
* corresponding NFToken.
|
60
|
+
*
|
61
|
+
* If the offer is to buy a token, this field must be present
|
62
|
+
* and it must be different than Account (since an offer to
|
63
|
+
* buy a token one already holds is meaningless).
|
64
|
+
*
|
65
|
+
* If the offer is to sell a token, this field must not be
|
66
|
+
* present, as the owner is, implicitly, the same as Account
|
67
|
+
* (since an offer to sell a token one doesn't already hold
|
68
|
+
* is meaningless).
|
69
|
+
*/
|
70
|
+
Owner?: string
|
71
|
+
/**
|
72
|
+
* Indicates the time after which the offer will no longer
|
73
|
+
* be valid. The value is the number of seconds since the
|
74
|
+
* Ripple Epoch.
|
75
|
+
*/
|
76
|
+
Expiration?: number
|
77
|
+
/**
|
78
|
+
* If present, indicates that this offer may only be
|
79
|
+
* accepted by the specified account. Attempts by other
|
80
|
+
* accounts to accept this offer MUST fail.
|
81
|
+
*/
|
82
|
+
Destination?: string
|
83
|
+
Flags?: number | NFTokenCreateOfferFlagsInterface
|
84
|
+
}
|
85
|
+
|
86
|
+
function validateNFTokenSellOfferCases(tx: Record<string, unknown>): void {
|
87
|
+
if (tx.Owner != null) {
|
88
|
+
throw new ValidationError(
|
89
|
+
'NFTokenCreateOffer: Owner must not be present for sell offers',
|
90
|
+
)
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
function validateNFTokenBuyOfferCases(tx: Record<string, unknown>): void {
|
95
|
+
if (tx.Owner == null) {
|
96
|
+
throw new ValidationError(
|
97
|
+
'NFTokenCreateOffer: Owner must be present for buy offers',
|
98
|
+
)
|
99
|
+
}
|
100
|
+
|
101
|
+
if (parseAmountValue(tx.Amount) <= 0) {
|
102
|
+
throw new ValidationError(
|
103
|
+
'NFTokenCreateOffer: Amount must be greater than 0 for buy offers',
|
104
|
+
)
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
/**
|
109
|
+
* Verify the form and type of an NFTokenCreateOffer at runtime.
|
110
|
+
*
|
111
|
+
* @param tx - An NFTokenCreateOffer Transaction.
|
112
|
+
* @throws When the NFTokenCreateOffer is Malformed.
|
113
|
+
*/
|
114
|
+
export function validateNFTokenCreateOffer(tx: Record<string, unknown>): void {
|
115
|
+
validateBaseTransaction(tx)
|
116
|
+
|
117
|
+
if (tx.Account === tx.Owner) {
|
118
|
+
throw new ValidationError(
|
119
|
+
'NFTokenCreateOffer: Owner and Account must not be equal',
|
120
|
+
)
|
121
|
+
}
|
122
|
+
|
123
|
+
if (tx.Account === tx.Destination) {
|
124
|
+
throw new ValidationError(
|
125
|
+
'NFTokenCreateOffer: Destination and Account must not be equal',
|
126
|
+
)
|
127
|
+
}
|
128
|
+
|
129
|
+
if (tx.NFTokenID == null) {
|
130
|
+
throw new ValidationError('NFTokenCreateOffer: missing field NFTokenID')
|
131
|
+
}
|
132
|
+
|
133
|
+
if (!isAmount(tx.Amount)) {
|
134
|
+
throw new ValidationError('NFTokenCreateOffer: invalid Amount')
|
135
|
+
}
|
136
|
+
|
137
|
+
if (
|
138
|
+
typeof tx.Flags === 'number' &&
|
139
|
+
isFlagEnabled(tx.Flags, NFTokenCreateOfferFlags.tfSellNFToken)
|
140
|
+
) {
|
141
|
+
validateNFTokenSellOfferCases(tx)
|
142
|
+
} else {
|
143
|
+
validateNFTokenBuyOfferCases(tx)
|
144
|
+
}
|
145
|
+
}
|
@@ -0,0 +1,123 @@
|
|
1
|
+
import { ValidationError } from '../../errors'
|
2
|
+
import { isHex } from '../utils'
|
3
|
+
|
4
|
+
import { BaseTransaction, GlobalFlags, validateBaseTransaction } from './common'
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Transaction Flags for an NFTokenMint Transaction.
|
8
|
+
*
|
9
|
+
* @category Transaction Flags
|
10
|
+
*/
|
11
|
+
export enum NFTokenMintFlags {
|
12
|
+
/**
|
13
|
+
* If set, indicates that the minted token may be burned by the issuer even
|
14
|
+
* if the issuer does not currently hold the token. The current holder of
|
15
|
+
* the token may always burn it.
|
16
|
+
*/
|
17
|
+
tfBurnable = 0x00000001,
|
18
|
+
/**
|
19
|
+
* If set, indicates that the token may only be offered or sold for XRP.
|
20
|
+
*/
|
21
|
+
tfOnlyXRP = 0x00000002,
|
22
|
+
/**
|
23
|
+
* If set, indicates that the issuer wants a trustline to be automatically
|
24
|
+
* created.
|
25
|
+
*/
|
26
|
+
tfTrustLine = 0x00000004,
|
27
|
+
/**
|
28
|
+
* If set, indicates that this NFT can be transferred. This flag has no
|
29
|
+
* effect if the token is being transferred from the issuer or to the
|
30
|
+
* issuer.
|
31
|
+
*/
|
32
|
+
tfTransferable = 0x00000008,
|
33
|
+
}
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Map of flags to boolean values representing {@link NFTokenMint} transaction
|
37
|
+
* flags.
|
38
|
+
*
|
39
|
+
* @category Transaction Flags
|
40
|
+
*/
|
41
|
+
export interface NFTokenMintFlagsInterface extends GlobalFlags {
|
42
|
+
tfBurnable?: boolean
|
43
|
+
tfOnlyXRP?: boolean
|
44
|
+
tfTrustLine?: boolean
|
45
|
+
tfTransferable?: boolean
|
46
|
+
}
|
47
|
+
|
48
|
+
/**
|
49
|
+
* The NFTokenMint transaction creates an NFToken object and adds it to the
|
50
|
+
* relevant NFTokenPage object of the minter. If the transaction is
|
51
|
+
* successful, the newly minted token will be owned by the minter account
|
52
|
+
* specified by the transaction.
|
53
|
+
*/
|
54
|
+
export interface NFTokenMint extends BaseTransaction {
|
55
|
+
TransactionType: 'NFTokenMint'
|
56
|
+
/**
|
57
|
+
* Indicates the taxon associated with this token. The taxon is generally a
|
58
|
+
* value chosen by the minter of the token and a given taxon may be used for
|
59
|
+
* multiple tokens. The implementation reserves taxon identifiers greater
|
60
|
+
* than or equal to 2147483648 (0x80000000). If you have no use for this
|
61
|
+
* field, set it to 0.
|
62
|
+
*/
|
63
|
+
NFTokenTaxon: number
|
64
|
+
/**
|
65
|
+
* Indicates the account that should be the issuer of this token. This value
|
66
|
+
* is optional and should only be specified if the account executing the
|
67
|
+
* transaction is not the `Issuer` of the `NFToken` object. If it is
|
68
|
+
* present, the `MintAccount` field in the `AccountRoot` of the `Issuer`
|
69
|
+
* field must match the `Account`, otherwise the transaction will fail.
|
70
|
+
*/
|
71
|
+
Issuer?: string
|
72
|
+
/**
|
73
|
+
* Specifies the fee charged by the issuer for secondary sales of the Token,
|
74
|
+
* if such sales are allowed. Valid values for this field are between 0 and
|
75
|
+
* 50000 inclusive, allowing transfer rates between 0.000% and 50.000% in
|
76
|
+
* increments of 0.001%. This field must NOT be present if the
|
77
|
+
* `tfTransferable` flag is not set.
|
78
|
+
*/
|
79
|
+
TransferFee?: number
|
80
|
+
/**
|
81
|
+
* URI that points to the data and/or metadata associated with the NFT.
|
82
|
+
* This field need not be an HTTP or HTTPS URL; it could be an IPFS URI, a
|
83
|
+
* magnet link, immediate data encoded as an RFC2379 "data" URL, or even an
|
84
|
+
* opaque issuer-specific encoding. The URI is NOT checked for validity, but
|
85
|
+
* the field is limited to a maximum length of 256 bytes.
|
86
|
+
*
|
87
|
+
* This field must be hex-encoded. You can use `convertStringToHex` to
|
88
|
+
* convert this field to the proper encoding.
|
89
|
+
*
|
90
|
+
* This field must not be an empty string. Omit it from the transaction or
|
91
|
+
* set to `undefined` value if you do not use it.
|
92
|
+
*/
|
93
|
+
URI?: string | null
|
94
|
+
Flags?: number | NFTokenMintFlagsInterface
|
95
|
+
}
|
96
|
+
|
97
|
+
/**
|
98
|
+
* Verify the form and type of an NFTokenMint at runtime.
|
99
|
+
*
|
100
|
+
* @param tx - An NFTokenMint Transaction.
|
101
|
+
* @throws When the NFTokenMint is Malformed.
|
102
|
+
*/
|
103
|
+
export function validateNFTokenMint(tx: Record<string, unknown>): void {
|
104
|
+
validateBaseTransaction(tx)
|
105
|
+
|
106
|
+
if (tx.Account === tx.Issuer) {
|
107
|
+
throw new ValidationError(
|
108
|
+
'NFTokenMint: Issuer must not be equal to Account',
|
109
|
+
)
|
110
|
+
}
|
111
|
+
|
112
|
+
if (typeof tx.URI === 'string' && tx.URI === '') {
|
113
|
+
throw new ValidationError('NFTokenMint: URI must not be empty string')
|
114
|
+
}
|
115
|
+
|
116
|
+
if (typeof tx.URI === 'string' && !isHex(tx.URI)) {
|
117
|
+
throw new ValidationError('NFTokenMint: URI must be in hex format')
|
118
|
+
}
|
119
|
+
|
120
|
+
if (tx.NFTokenTaxon == null) {
|
121
|
+
throw new ValidationError('NFTokenMint: missing field NFTokenTaxon')
|
122
|
+
}
|
123
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/**
|
2
|
+
* Mark a change to the Negative UNL.
|
3
|
+
*
|
4
|
+
* @category Pseudo Transaction Models
|
5
|
+
*/
|
6
|
+
export interface UNLModify {
|
7
|
+
TransactionType: 'UNLModify'
|
8
|
+
/**
|
9
|
+
* The ledger index where this pseudo-transaction appears.
|
10
|
+
* This distinguishes the pseudo-transaction from other occurrences of the same change.
|
11
|
+
*/
|
12
|
+
LedgerSequence: number
|
13
|
+
/**
|
14
|
+
* If 0, this change represents removing a validator from the Negative UNL.
|
15
|
+
* If 1, this change represents adding a validator to the Negative UNL.
|
16
|
+
*/
|
17
|
+
UNLModifyDisabling: 0 | 1
|
18
|
+
/** The validator to add or remove, as identified by its master public key. */
|
19
|
+
UNLModifyValidator: string
|
20
|
+
}
|
@@ -0,0 +1,107 @@
|
|
1
|
+
import { ValidationError } from '../../errors'
|
2
|
+
import { Amount, XChainBridge } from '../common'
|
3
|
+
|
4
|
+
import {
|
5
|
+
BaseTransaction,
|
6
|
+
isAmount,
|
7
|
+
isXChainBridge,
|
8
|
+
validateBaseTransaction,
|
9
|
+
} from './common'
|
10
|
+
|
11
|
+
/**
|
12
|
+
* The XChainAccountCreateCommit transaction creates a new account on one of the
|
13
|
+
* chains a bridge connects, which serves as the bridge entrance for that chain.
|
14
|
+
*
|
15
|
+
* Warning: This transaction should only be executed if the witness attestations
|
16
|
+
* will be reliably delivered to the destination chain. If the signatures aren't
|
17
|
+
* delivered, then account creation will be blocked until attestations are received.
|
18
|
+
* This can be used maliciously; to disable this transaction on XRP-XRP bridges,
|
19
|
+
* the bridge's MinAccountCreateAmount shouldn't be present.
|
20
|
+
*
|
21
|
+
* @category Transaction Models
|
22
|
+
*/
|
23
|
+
export interface XChainAccountCreateCommit extends BaseTransaction {
|
24
|
+
TransactionType: 'XChainAccountCreateCommit'
|
25
|
+
|
26
|
+
/**
|
27
|
+
* The bridge to create accounts for.
|
28
|
+
*/
|
29
|
+
XChainBridge: XChainBridge
|
30
|
+
|
31
|
+
/**
|
32
|
+
* The amount, in XRP, to be used to reward the witness servers for providing
|
33
|
+
* signatures. This must match the amount on the {@link Bridge} ledger object.
|
34
|
+
*/
|
35
|
+
SignatureReward: Amount
|
36
|
+
|
37
|
+
/**
|
38
|
+
* The destination account on the destination chain.
|
39
|
+
*/
|
40
|
+
Destination: string
|
41
|
+
|
42
|
+
/**
|
43
|
+
* The amount, in XRP, to use for account creation. This must be greater than or
|
44
|
+
* equal to the MinAccountCreateAmount specified in the {@link Bridge} ledger object.
|
45
|
+
*/
|
46
|
+
Amount: Amount
|
47
|
+
}
|
48
|
+
|
49
|
+
/**
|
50
|
+
* Verify the form and type of a XChainAccountCreateCommit at runtime.
|
51
|
+
*
|
52
|
+
* @param tx - A XChainAccountCreateCommit Transaction.
|
53
|
+
* @throws When the XChainAccountCreateCommit is malformed.
|
54
|
+
*/
|
55
|
+
// eslint-disable-next-line max-lines-per-function -- okay for this function, there's a lot of things to check
|
56
|
+
export function validateXChainAccountCreateCommit(
|
57
|
+
tx: Record<string, unknown>,
|
58
|
+
): void {
|
59
|
+
validateBaseTransaction(tx)
|
60
|
+
|
61
|
+
if (tx.XChainBridge == null) {
|
62
|
+
throw new ValidationError(
|
63
|
+
'XChainAccountCreateCommit: missing field XChainBridge',
|
64
|
+
)
|
65
|
+
}
|
66
|
+
|
67
|
+
if (!isXChainBridge(tx.XChainBridge)) {
|
68
|
+
throw new ValidationError(
|
69
|
+
'XChainAccountCreateCommit: invalid field XChainBridge',
|
70
|
+
)
|
71
|
+
}
|
72
|
+
|
73
|
+
if (tx.SignatureReward == null) {
|
74
|
+
throw new ValidationError(
|
75
|
+
'XChainAccountCreateCommit: missing field SignatureReward',
|
76
|
+
)
|
77
|
+
}
|
78
|
+
|
79
|
+
if (
|
80
|
+
typeof tx.SignatureReward !== 'number' &&
|
81
|
+
typeof tx.SignatureReward !== 'string'
|
82
|
+
) {
|
83
|
+
throw new ValidationError(
|
84
|
+
'XChainAccountCreateCommit: invalid field SignatureReward',
|
85
|
+
)
|
86
|
+
}
|
87
|
+
|
88
|
+
if (tx.Destination == null) {
|
89
|
+
throw new ValidationError(
|
90
|
+
'XChainAccountCreateCommit: missing field Destination',
|
91
|
+
)
|
92
|
+
}
|
93
|
+
|
94
|
+
if (typeof tx.Destination !== 'string') {
|
95
|
+
throw new ValidationError(
|
96
|
+
'XChainAccountCreateCommit: invalid field Destination',
|
97
|
+
)
|
98
|
+
}
|
99
|
+
|
100
|
+
if (tx.Amount == null) {
|
101
|
+
throw new ValidationError('XChainAccountCreateCommit: missing field Amount')
|
102
|
+
}
|
103
|
+
|
104
|
+
if (!isAmount(tx.Amount)) {
|
105
|
+
throw new ValidationError('XChainAccountCreateCommit: invalid field Amount')
|
106
|
+
}
|
107
|
+
}
|