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,169 @@
|
|
1
|
+
import BigNumber from 'bignumber.js'
|
2
|
+
|
3
|
+
import { ValidationError } from '../errors'
|
4
|
+
|
5
|
+
const BASE_TEN = 10
|
6
|
+
const ONE_BILLION = '1000000000'
|
7
|
+
const TWO_BILLION = '2000000000'
|
8
|
+
|
9
|
+
function percentToDecimal(percent: string): string {
|
10
|
+
if (!percent.endsWith('%')) {
|
11
|
+
throw new ValidationError(`Value ${percent} must end with %`)
|
12
|
+
}
|
13
|
+
|
14
|
+
// Split the string on % and filter out any empty strings
|
15
|
+
const split = percent.split('%').filter((str) => str !== '')
|
16
|
+
if (split.length !== 1) {
|
17
|
+
throw new ValidationError(`Value ${percent} contains too many % signs`)
|
18
|
+
}
|
19
|
+
|
20
|
+
return new BigNumber(split[0]).dividedBy('100').toString(BASE_TEN)
|
21
|
+
}
|
22
|
+
|
23
|
+
/**
|
24
|
+
* Converts a string decimal to "billionths" format for use with TransferRate.
|
25
|
+
*
|
26
|
+
* @param decimal - A string decimal between 0 and 1.00
|
27
|
+
* @returns A number in the "billionths" format.
|
28
|
+
* @throws ValidationError when the parameter is not convertible to
|
29
|
+
* "billionths" format.
|
30
|
+
* @category Utilities
|
31
|
+
*/
|
32
|
+
export function decimalToTransferRate(decimal: string): number {
|
33
|
+
const rate = new BigNumber(decimal).times(ONE_BILLION).plus(ONE_BILLION)
|
34
|
+
|
35
|
+
if (rate.isLessThan(ONE_BILLION) || rate.isGreaterThan(TWO_BILLION)) {
|
36
|
+
throw new ValidationError(`Decimal value must be between 0 and 1.00.`)
|
37
|
+
}
|
38
|
+
|
39
|
+
const billionths = rate.toString(BASE_TEN)
|
40
|
+
|
41
|
+
if (billionths === ONE_BILLION) {
|
42
|
+
return 0
|
43
|
+
}
|
44
|
+
|
45
|
+
if (billionths === 'NaN') {
|
46
|
+
throw new ValidationError(`Value is not a number`)
|
47
|
+
}
|
48
|
+
|
49
|
+
if (billionths.includes('.')) {
|
50
|
+
throw new ValidationError(`Decimal exceeds maximum precision.`)
|
51
|
+
}
|
52
|
+
|
53
|
+
return Number(billionths)
|
54
|
+
}
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Converts a string percent to "billionths" format for use with TransferRate.
|
58
|
+
*
|
59
|
+
* @param percent - A string percent between 0% and 100%.
|
60
|
+
* @returns A number in the "billionths" format.
|
61
|
+
* @throws ValidationError when the percent parameter is not convertible to
|
62
|
+
* "billionths" format.
|
63
|
+
* @category Utilities
|
64
|
+
*/
|
65
|
+
export function percentToTransferRate(percent: string): number {
|
66
|
+
return decimalToTransferRate(percentToDecimal(percent))
|
67
|
+
}
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Converts a string decimal to the "billionths" format for use with QualityIn/
|
71
|
+
* QualityOut
|
72
|
+
*
|
73
|
+
* @param decimal - A string decimal (i.e. ".00034").
|
74
|
+
* @returns A number in the "billionths" format.
|
75
|
+
* @throws ValidationError when the parameter is not convertible to
|
76
|
+
* "billionths" format.
|
77
|
+
* @category Utilities
|
78
|
+
*/
|
79
|
+
export function decimalToQuality(decimal: string): number {
|
80
|
+
const rate = new BigNumber(decimal).times(ONE_BILLION)
|
81
|
+
|
82
|
+
const billionths = rate.toString(BASE_TEN)
|
83
|
+
|
84
|
+
if (billionths === 'NaN') {
|
85
|
+
throw new ValidationError(`Value is not a number`)
|
86
|
+
}
|
87
|
+
|
88
|
+
if (billionths.includes('-')) {
|
89
|
+
throw new ValidationError('Cannot have negative Quality')
|
90
|
+
}
|
91
|
+
|
92
|
+
if (billionths === ONE_BILLION) {
|
93
|
+
return 0
|
94
|
+
}
|
95
|
+
|
96
|
+
if (billionths.includes('.')) {
|
97
|
+
throw new ValidationError(`Decimal exceeds maximum precision.`)
|
98
|
+
}
|
99
|
+
|
100
|
+
return Number(billionths)
|
101
|
+
}
|
102
|
+
|
103
|
+
/**
|
104
|
+
* Converts a quality in "billionths" format to a decimal.
|
105
|
+
*
|
106
|
+
* @param quality - Quality to convert to decimal.
|
107
|
+
* @returns decimal representation of quality.
|
108
|
+
* @throws ValidationError when quality is not convertible to decimal format.
|
109
|
+
* @category Utilities
|
110
|
+
*/
|
111
|
+
export function qualityToDecimal(quality: number): string {
|
112
|
+
if (!Number.isInteger(quality)) {
|
113
|
+
throw new ValidationError('Quality must be an integer')
|
114
|
+
}
|
115
|
+
|
116
|
+
if (quality < 0) {
|
117
|
+
throw new ValidationError('Negative quality not allowed')
|
118
|
+
}
|
119
|
+
|
120
|
+
if (quality === 0) {
|
121
|
+
return '1'
|
122
|
+
}
|
123
|
+
|
124
|
+
const decimal = new BigNumber(quality).dividedBy(ONE_BILLION)
|
125
|
+
|
126
|
+
return decimal.toString(BASE_TEN)
|
127
|
+
}
|
128
|
+
|
129
|
+
/**
|
130
|
+
* Converts a transfer rate in "billionths" format to a decimal.
|
131
|
+
*
|
132
|
+
* @param rate - TransferRate to convert to decimal.
|
133
|
+
* @returns decimal representation of transfer Rate.
|
134
|
+
* @throws ValidationError when it cannot convert from billionths format.
|
135
|
+
* @category Utilities
|
136
|
+
*/
|
137
|
+
export function transferRateToDecimal(rate: number): string {
|
138
|
+
if (!Number.isInteger(rate)) {
|
139
|
+
throw new ValidationError(
|
140
|
+
'Error decoding, transfer Rate must be an integer',
|
141
|
+
)
|
142
|
+
}
|
143
|
+
|
144
|
+
if (rate === 0) {
|
145
|
+
return '0'
|
146
|
+
}
|
147
|
+
|
148
|
+
const decimal = new BigNumber(rate).minus(ONE_BILLION).dividedBy(ONE_BILLION)
|
149
|
+
|
150
|
+
if (decimal.isLessThan(0)) {
|
151
|
+
throw new ValidationError('Error decoding, negative transfer rate')
|
152
|
+
}
|
153
|
+
|
154
|
+
return decimal.toString(BASE_TEN)
|
155
|
+
}
|
156
|
+
|
157
|
+
/**
|
158
|
+
* Converts a string percent to the "billionths" format for use with QualityIn/
|
159
|
+
* QualityOut
|
160
|
+
*
|
161
|
+
* @param percent - A string percent (i.e. ".034%").
|
162
|
+
* @returns A number in the "billionths" format.
|
163
|
+
* @throws ValidationError when the percent parameter is not convertible to
|
164
|
+
* "billionths" format.
|
165
|
+
* @category Utilities
|
166
|
+
*/
|
167
|
+
export function percentToQuality(percent: string): number {
|
168
|
+
return decimalToQuality(percentToDecimal(percent))
|
169
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { encodeForSigningClaim } from 'ripple-binary-codec'
|
2
|
+
import { sign } from 'ripple-keypairs'
|
3
|
+
|
4
|
+
import { xrpToDrops } from './xrpConversion'
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Sign a payment channel claim.
|
8
|
+
*
|
9
|
+
* @param channel - Channel identifier specified by the paymentChannelClaim.
|
10
|
+
* @param amount - Amount specified by the paymentChannelClaim.
|
11
|
+
* @param privateKey - Private Key to sign paymentChannelClaim with.
|
12
|
+
* @returns True if the channel is valid.
|
13
|
+
* @category Utilities
|
14
|
+
*/
|
15
|
+
function signPaymentChannelClaim(
|
16
|
+
channel: string,
|
17
|
+
amount: string,
|
18
|
+
privateKey: string,
|
19
|
+
): string {
|
20
|
+
const signingData = encodeForSigningClaim({
|
21
|
+
channel,
|
22
|
+
amount: xrpToDrops(amount),
|
23
|
+
})
|
24
|
+
return sign(signingData, privateKey)
|
25
|
+
}
|
26
|
+
|
27
|
+
export default signPaymentChannelClaim
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/**
|
2
|
+
* Converts a string to its hex equivalent. Useful for Memos.
|
3
|
+
*
|
4
|
+
* @param string - The string to convert to Hex.
|
5
|
+
* @returns The Hex equivalent of the string.
|
6
|
+
* @category Utilities
|
7
|
+
*/
|
8
|
+
function convertStringToHex(string: string): string {
|
9
|
+
return Buffer.from(string, 'utf8').toString('hex').toUpperCase()
|
10
|
+
}
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Converts hex to its string equivalent. Useful to read the Domain field and some Memos.
|
14
|
+
*
|
15
|
+
* @param hex - The hex to convert to a string.
|
16
|
+
* @param encoding - The encoding to use. Defaults to 'utf8' (UTF-8). 'ascii' is also allowed.
|
17
|
+
* @returns The converted string.
|
18
|
+
* @category Utilities
|
19
|
+
*/
|
20
|
+
function convertHexToString(
|
21
|
+
hex: string,
|
22
|
+
encoding: BufferEncoding = 'utf8',
|
23
|
+
): string {
|
24
|
+
return Buffer.from(hex, 'hex').toString(encoding)
|
25
|
+
}
|
26
|
+
|
27
|
+
export { convertHexToString, convertStringToHex }
|
@@ -0,0 +1,53 @@
|
|
1
|
+
const RIPPLE_EPOCH_DIFF = 0x386d4380
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Convert a ripple timestamp to a unix timestamp.
|
5
|
+
*
|
6
|
+
* @param rpepoch - (seconds since 1/1/2000 GMT).
|
7
|
+
* @returns Milliseconds since unix epoch.
|
8
|
+
* @category Utilities
|
9
|
+
*/
|
10
|
+
function rippleTimeToUnixTime(rpepoch: number): number {
|
11
|
+
return (rpepoch + RIPPLE_EPOCH_DIFF) * 1000
|
12
|
+
}
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Convert a unix timestamp to a ripple timestamp.
|
16
|
+
*
|
17
|
+
* @param timestamp - (ms since unix epoch).
|
18
|
+
* @returns Seconds since Ripple Epoch (1/1/2000 GMT).
|
19
|
+
* @category Utilities
|
20
|
+
*/
|
21
|
+
function unixTimeToRippleTime(timestamp: number): number {
|
22
|
+
return Math.round(timestamp / 1000) - RIPPLE_EPOCH_DIFF
|
23
|
+
}
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Convert a ripple timestamp to an Iso8601 timestamp.
|
27
|
+
*
|
28
|
+
* @param rippleTime - Is the number of seconds since Ripple Epoch (1/1/2000 GMT).
|
29
|
+
* @returns Iso8601 international standard date format.
|
30
|
+
* @category Utilities
|
31
|
+
*/
|
32
|
+
function rippleTimeToISOTime(rippleTime: number): string {
|
33
|
+
return new Date(rippleTimeToUnixTime(rippleTime)).toISOString()
|
34
|
+
}
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Convert an ISO8601 timestmap to a ripple timestamp.
|
38
|
+
*
|
39
|
+
* @param iso8601 - International standard date format.
|
40
|
+
* @returns Seconds since ripple epoch (1/1/2000 GMT).
|
41
|
+
* @category Utilities
|
42
|
+
*/
|
43
|
+
function isoTimeToRippleTime(iso8601: string | Date): number {
|
44
|
+
const isoDate = typeof iso8601 === 'string' ? new Date(iso8601) : iso8601
|
45
|
+
return unixTimeToRippleTime(isoDate.getTime())
|
46
|
+
}
|
47
|
+
|
48
|
+
export {
|
49
|
+
rippleTimeToUnixTime,
|
50
|
+
unixTimeToRippleTime,
|
51
|
+
rippleTimeToISOTime,
|
52
|
+
isoTimeToRippleTime,
|
53
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { encodeForSigningClaim } from 'ripple-binary-codec'
|
2
|
+
import { verify } from 'ripple-keypairs'
|
3
|
+
|
4
|
+
import { xrpToDrops } from './xrpConversion'
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Verify the signature of a payment channel claim.
|
8
|
+
*
|
9
|
+
* @param channel - Channel identifier specified by the paymentChannelClaim.
|
10
|
+
* @param amount - Amount specified by the paymentChannelClaim.
|
11
|
+
* @param signature - Signature produced from signing paymentChannelClaim.
|
12
|
+
* @param publicKey - Public key that signed the paymentChannelClaim.
|
13
|
+
* @returns True if the channel is valid.
|
14
|
+
* @category Utilities
|
15
|
+
*/
|
16
|
+
// eslint-disable-next-line max-params -- Needs 4 params
|
17
|
+
function verifyPaymentChannelClaim(
|
18
|
+
channel: string,
|
19
|
+
amount: string,
|
20
|
+
signature: string,
|
21
|
+
publicKey: string,
|
22
|
+
): boolean {
|
23
|
+
const signingData = encodeForSigningClaim({
|
24
|
+
channel,
|
25
|
+
amount: xrpToDrops(amount),
|
26
|
+
})
|
27
|
+
return verify(signingData, signature, publicKey)
|
28
|
+
}
|
29
|
+
|
30
|
+
export default verifyPaymentChannelClaim
|
@@ -0,0 +1,104 @@
|
|
1
|
+
import BigNumber from 'bignumber.js'
|
2
|
+
|
3
|
+
import { ValidationError } from '../errors'
|
4
|
+
|
5
|
+
const DROPS_PER_XRP = 1000000.0
|
6
|
+
const MAX_FRACTION_LENGTH = 6
|
7
|
+
const BASE_TEN = 10
|
8
|
+
const SANITY_CHECK = /^-?[0-9.]+$/u
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Convert Drops to XRP.
|
12
|
+
*
|
13
|
+
* @param dropsToConvert - Drops to convert to XRP. This can be a string, number, or BigNumber.
|
14
|
+
* @returns Amount in XRP.
|
15
|
+
* @throws When drops amount is invalid.
|
16
|
+
* @category Utilities
|
17
|
+
*/
|
18
|
+
export function dropsToXrp(dropsToConvert: BigNumber.Value): string {
|
19
|
+
/*
|
20
|
+
* Converting to BigNumber and then back to string should remove any
|
21
|
+
* decimal point followed by zeros, e.g. '1.00'.
|
22
|
+
* Important: specify base BASE_10 to avoid exponential notation, e.g. '1e-7'.
|
23
|
+
*/
|
24
|
+
const drops = new BigNumber(dropsToConvert).toString(BASE_TEN)
|
25
|
+
|
26
|
+
// check that the value is valid and actually a number
|
27
|
+
if (typeof dropsToConvert === 'string' && drops === 'NaN') {
|
28
|
+
throw new ValidationError(
|
29
|
+
`dropsToXrp: invalid value '${dropsToConvert}', should be a BigNumber or string-encoded number.`,
|
30
|
+
)
|
31
|
+
}
|
32
|
+
|
33
|
+
// drops are only whole units
|
34
|
+
if (drops.includes('.')) {
|
35
|
+
throw new ValidationError(
|
36
|
+
`dropsToXrp: value '${drops}' has too many decimal places.`,
|
37
|
+
)
|
38
|
+
}
|
39
|
+
|
40
|
+
/*
|
41
|
+
* This should never happen; the value has already been
|
42
|
+
* validated above. This just ensures BigNumber did not do
|
43
|
+
* something unexpected.
|
44
|
+
*/
|
45
|
+
if (!SANITY_CHECK.exec(drops)) {
|
46
|
+
throw new ValidationError(
|
47
|
+
`dropsToXrp: failed sanity check -` +
|
48
|
+
` value '${drops}',` +
|
49
|
+
` does not match (^-?[0-9]+$).`,
|
50
|
+
)
|
51
|
+
}
|
52
|
+
|
53
|
+
return new BigNumber(drops).dividedBy(DROPS_PER_XRP).toString(BASE_TEN)
|
54
|
+
}
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Convert an amount in XRP to an amount in drops.
|
58
|
+
*
|
59
|
+
* @param xrpToConvert - Amount in XRP.
|
60
|
+
* @returns Amount in drops.
|
61
|
+
* @throws When amount in xrp is invalid.
|
62
|
+
* @category Utilities
|
63
|
+
*/
|
64
|
+
export function xrpToDrops(xrpToConvert: BigNumber.Value): string {
|
65
|
+
// Important: specify base BASE_TEN to avoid exponential notation, e.g. '1e-7'.
|
66
|
+
const xrp = new BigNumber(xrpToConvert).toString(BASE_TEN)
|
67
|
+
|
68
|
+
// check that the value is valid and actually a number
|
69
|
+
if (typeof xrpToConvert === 'string' && xrp === 'NaN') {
|
70
|
+
throw new ValidationError(
|
71
|
+
`xrpToDrops: invalid value '${xrpToConvert}', should be a BigNumber or string-encoded number.`,
|
72
|
+
)
|
73
|
+
}
|
74
|
+
|
75
|
+
/*
|
76
|
+
* This should never happen; the value has already been
|
77
|
+
* validated above. This just ensures BigNumber did not do
|
78
|
+
* something unexpected.
|
79
|
+
*/
|
80
|
+
if (!SANITY_CHECK.exec(xrp)) {
|
81
|
+
throw new ValidationError(
|
82
|
+
`xrpToDrops: failed sanity check - value '${xrp}', does not match (^-?[0-9.]+$).`,
|
83
|
+
)
|
84
|
+
}
|
85
|
+
|
86
|
+
const components = xrp.split('.')
|
87
|
+
if (components.length > 2) {
|
88
|
+
throw new ValidationError(
|
89
|
+
`xrpToDrops: failed sanity check - value '${xrp}' has too many decimal points.`,
|
90
|
+
)
|
91
|
+
}
|
92
|
+
|
93
|
+
const fraction = components[1] || '0'
|
94
|
+
if (fraction.length > MAX_FRACTION_LENGTH) {
|
95
|
+
throw new ValidationError(
|
96
|
+
`xrpToDrops: value '${xrp}' has too many decimal places.`,
|
97
|
+
)
|
98
|
+
}
|
99
|
+
|
100
|
+
return new BigNumber(xrp)
|
101
|
+
.times(DROPS_PER_XRP)
|
102
|
+
.integerValue(BigNumber.ROUND_FLOOR)
|
103
|
+
.toString(BASE_TEN)
|
104
|
+
}
|