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,344 @@
|
|
1
|
+
import { IncomingMessage } from 'http'
|
2
|
+
import { request as httpsRequest, RequestOptions } from 'https'
|
3
|
+
|
4
|
+
import { isValidClassicAddress } from 'ripple-address-codec'
|
5
|
+
|
6
|
+
import type { Client } from '../client'
|
7
|
+
import { RippledError, XRPLFaucetError } from '../errors'
|
8
|
+
|
9
|
+
import {
|
10
|
+
FaucetWallet,
|
11
|
+
getFaucetHost,
|
12
|
+
getDefaultFaucetPath,
|
13
|
+
} from './defaultFaucets'
|
14
|
+
|
15
|
+
import { Wallet } from '.'
|
16
|
+
|
17
|
+
// Interval to check an account balance
|
18
|
+
const INTERVAL_SECONDS = 1
|
19
|
+
// Maximum attempts to retrieve a balance
|
20
|
+
const MAX_ATTEMPTS = 20
|
21
|
+
|
22
|
+
/**
|
23
|
+
* The fundWallet() method is used to send an amount of XRP (usually 1000) to a new (randomly generated)
|
24
|
+
* or existing XRP Ledger wallet.
|
25
|
+
*
|
26
|
+
* @example
|
27
|
+
*
|
28
|
+
* Example 1: Fund a randomly generated wallet
|
29
|
+
* const { Client, Wallet } = require('xrpl')
|
30
|
+
*
|
31
|
+
* const client = new Client('wss://s.altnet.rippletest.net:51233')
|
32
|
+
* await client.connect()
|
33
|
+
* const { balance, wallet } = await client.fundWallet()
|
34
|
+
*
|
35
|
+
* Under the hood, this will use `Wallet.generate()` to create a new random wallet, then ask a testnet faucet
|
36
|
+
* To send it XRP on ledger to make it a real account. If successful, this will return the new account balance in XRP
|
37
|
+
* Along with the Wallet object to track the keys for that account. If you'd like, you can also re-fill an existing
|
38
|
+
* Account by passing in a Wallet you already have.
|
39
|
+
* ```ts
|
40
|
+
* const api = new xrpl.Client("wss://s.altnet.rippletest.net:51233")
|
41
|
+
* await api.connect()
|
42
|
+
* const { wallet, balance } = await api.fundWallet()
|
43
|
+
* ```
|
44
|
+
*
|
45
|
+
* Example 2: Fund wallet using a custom faucet host and known wallet address
|
46
|
+
*
|
47
|
+
* `fundWallet` will try to infer the url of a faucet API from the network your client is connected to.
|
48
|
+
* There are hardcoded default faucets for popular test networks like testnet and devnet.
|
49
|
+
* However, if you're working with a newer or more obscure network, you may have to specify the faucetHost
|
50
|
+
* And faucetPath so `fundWallet` can ask that faucet to fund your wallet.
|
51
|
+
*
|
52
|
+
* ```ts
|
53
|
+
* const newWallet = Wallet.generate()
|
54
|
+
* const { balance, wallet } = await client.fundWallet(newWallet, {
|
55
|
+
* amount: '10',
|
56
|
+
* faucetHost: 'https://custom-faucet.example.com',
|
57
|
+
* faucetPath: '/accounts'
|
58
|
+
* })
|
59
|
+
* console.log(`Sent 10 XRP to wallet: ${address} from the given faucet. Resulting balance: ${balance} XRP`)
|
60
|
+
* } catch (error) {
|
61
|
+
* console.error(`Failed to fund wallet: ${error}`)
|
62
|
+
* }
|
63
|
+
* }
|
64
|
+
* ```
|
65
|
+
*
|
66
|
+
* @param this - Client.
|
67
|
+
* @param wallet - An existing XRPL Wallet to fund. If undefined or null, a new Wallet will be created.
|
68
|
+
* @param options - See below.
|
69
|
+
* @param options.faucetHost - A custom host for a faucet server. On devnet,
|
70
|
+
* testnet, AMM devnet, and HooksV3 testnet, `fundWallet` will
|
71
|
+
* attempt to determine the correct server automatically. In other environments,
|
72
|
+
* or if you would like to customize the faucet host in devnet or testnet,
|
73
|
+
* you should provide the host using this option.
|
74
|
+
* @param options.faucetPath - A custom path for a faucet server. On devnet,
|
75
|
+
* testnet, AMM devnet, and HooksV3 testnet, `fundWallet` will
|
76
|
+
* attempt to determine the correct path automatically. In other environments,
|
77
|
+
* or if you would like to customize the faucet path in devnet or testnet,
|
78
|
+
* you should provide the path using this option.
|
79
|
+
* Ex: client.fundWallet(null,{'faucet.altnet.rippletest.net', '/accounts'})
|
80
|
+
* specifies a request to 'faucet.altnet.rippletest.net/accounts' to fund a new wallet.
|
81
|
+
* @param options.amount - A custom amount to fund, if undefined or null, the default amount will be 1000.
|
82
|
+
* @param options.usageContext - An optional field to indicate the use case context of the faucet transaction
|
83
|
+
* Ex: integration test, code snippets.
|
84
|
+
* @returns A Wallet on the Testnet or Devnet that contains some amount of XRP,
|
85
|
+
* and that wallet's balance in XRP.
|
86
|
+
* @throws When either Client isn't connected or unable to fund wallet address.
|
87
|
+
*/
|
88
|
+
// eslint-disable-next-line max-lines-per-function -- All lines necessary
|
89
|
+
async function fundWallet(
|
90
|
+
this: Client,
|
91
|
+
wallet?: Wallet | null,
|
92
|
+
options?: {
|
93
|
+
faucetHost?: string
|
94
|
+
faucetPath?: string
|
95
|
+
amount?: string
|
96
|
+
usageContext?: string
|
97
|
+
},
|
98
|
+
): Promise<{
|
99
|
+
wallet: Wallet
|
100
|
+
balance: number
|
101
|
+
}> {
|
102
|
+
if (!this.isConnected()) {
|
103
|
+
throw new RippledError('Client not connected, cannot call faucet')
|
104
|
+
}
|
105
|
+
|
106
|
+
// Generate a new Wallet if no existing Wallet is provided or its address is invalid to fund
|
107
|
+
const walletToFund =
|
108
|
+
wallet && isValidClassicAddress(wallet.classicAddress)
|
109
|
+
? wallet
|
110
|
+
: Wallet.generate()
|
111
|
+
|
112
|
+
// Create the POST request body
|
113
|
+
const postBody = Buffer.from(
|
114
|
+
new TextEncoder().encode(
|
115
|
+
JSON.stringify({
|
116
|
+
destination: walletToFund.classicAddress,
|
117
|
+
xrpAmount: options?.amount,
|
118
|
+
userAgent: 'xrpl.js',
|
119
|
+
usageContext: options?.usageContext,
|
120
|
+
}),
|
121
|
+
),
|
122
|
+
)
|
123
|
+
|
124
|
+
let startingBalance = 0
|
125
|
+
try {
|
126
|
+
startingBalance = Number(
|
127
|
+
await this.getXrpBalance(walletToFund.classicAddress),
|
128
|
+
)
|
129
|
+
} catch {
|
130
|
+
/* startingBalance remains '0' */
|
131
|
+
}
|
132
|
+
// Options to pass to https.request
|
133
|
+
const httpOptions = getHTTPOptions(this, postBody, {
|
134
|
+
hostname: options?.faucetHost,
|
135
|
+
pathname: options?.faucetPath,
|
136
|
+
})
|
137
|
+
|
138
|
+
return returnPromise(
|
139
|
+
httpOptions,
|
140
|
+
this,
|
141
|
+
startingBalance,
|
142
|
+
walletToFund,
|
143
|
+
postBody,
|
144
|
+
)
|
145
|
+
}
|
146
|
+
|
147
|
+
// eslint-disable-next-line max-params -- Helper function created for organizational purposes
|
148
|
+
async function returnPromise(
|
149
|
+
options: RequestOptions,
|
150
|
+
client: Client,
|
151
|
+
startingBalance: number,
|
152
|
+
walletToFund: Wallet,
|
153
|
+
postBody: Buffer,
|
154
|
+
): Promise<{
|
155
|
+
wallet: Wallet
|
156
|
+
balance: number
|
157
|
+
}> {
|
158
|
+
return new Promise((resolve, reject) => {
|
159
|
+
const request = httpsRequest(options, (response) => {
|
160
|
+
const chunks: Uint8Array[] = []
|
161
|
+
response.on('data', (data) => chunks.push(data))
|
162
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises -- not actually misused, different resolve/reject
|
163
|
+
response.on('end', async () =>
|
164
|
+
onEnd(
|
165
|
+
response,
|
166
|
+
chunks,
|
167
|
+
client,
|
168
|
+
startingBalance,
|
169
|
+
walletToFund,
|
170
|
+
resolve,
|
171
|
+
reject,
|
172
|
+
),
|
173
|
+
)
|
174
|
+
})
|
175
|
+
// POST the body
|
176
|
+
request.write(postBody)
|
177
|
+
|
178
|
+
request.on('error', (error) => {
|
179
|
+
reject(error)
|
180
|
+
})
|
181
|
+
|
182
|
+
request.end()
|
183
|
+
})
|
184
|
+
}
|
185
|
+
|
186
|
+
function getHTTPOptions(
|
187
|
+
client: Client,
|
188
|
+
postBody: Uint8Array,
|
189
|
+
options?: {
|
190
|
+
hostname?: string
|
191
|
+
pathname?: string
|
192
|
+
},
|
193
|
+
): RequestOptions {
|
194
|
+
const finalHostname = options?.hostname ?? getFaucetHost(client)
|
195
|
+
const finalPathname = options?.pathname ?? getDefaultFaucetPath(finalHostname)
|
196
|
+
return {
|
197
|
+
hostname: finalHostname,
|
198
|
+
port: 443,
|
199
|
+
path: finalPathname,
|
200
|
+
method: 'POST',
|
201
|
+
headers: {
|
202
|
+
'Content-Type': 'application/json',
|
203
|
+
'Content-Length': postBody.length,
|
204
|
+
},
|
205
|
+
}
|
206
|
+
}
|
207
|
+
|
208
|
+
// eslint-disable-next-line max-params -- Helper function created for organizational purposes
|
209
|
+
async function onEnd(
|
210
|
+
response: IncomingMessage,
|
211
|
+
chunks: Uint8Array[],
|
212
|
+
client: Client,
|
213
|
+
startingBalance: number,
|
214
|
+
walletToFund: Wallet,
|
215
|
+
resolve: (response: { wallet: Wallet; balance: number }) => void,
|
216
|
+
reject: (err: ErrorConstructor | Error | unknown) => void,
|
217
|
+
): Promise<void> {
|
218
|
+
const body = Buffer.concat(chunks).toString()
|
219
|
+
|
220
|
+
// "application/json; charset=utf-8"
|
221
|
+
if (response.headers['content-type']?.startsWith('application/json')) {
|
222
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- We know this is safe and correct
|
223
|
+
const faucetWallet: FaucetWallet = JSON.parse(body)
|
224
|
+
const classicAddress = faucetWallet.account.classicAddress
|
225
|
+
await processSuccessfulResponse(
|
226
|
+
client,
|
227
|
+
classicAddress,
|
228
|
+
walletToFund,
|
229
|
+
startingBalance,
|
230
|
+
resolve,
|
231
|
+
reject,
|
232
|
+
)
|
233
|
+
} else {
|
234
|
+
reject(
|
235
|
+
new XRPLFaucetError(
|
236
|
+
`Content type is not \`application/json\`: ${JSON.stringify({
|
237
|
+
statusCode: response.statusCode,
|
238
|
+
contentType: response.headers['content-type'],
|
239
|
+
body,
|
240
|
+
})}`,
|
241
|
+
),
|
242
|
+
)
|
243
|
+
}
|
244
|
+
}
|
245
|
+
|
246
|
+
// eslint-disable-next-line max-params, max-lines-per-function -- Only used as a helper function, lines inc due to added balance.
|
247
|
+
async function processSuccessfulResponse(
|
248
|
+
client: Client,
|
249
|
+
classicAddress: string | undefined,
|
250
|
+
walletToFund: Wallet,
|
251
|
+
startingBalance: number,
|
252
|
+
resolve: (response: { wallet: Wallet; balance: number }) => void,
|
253
|
+
reject: (err: ErrorConstructor | Error | unknown) => void,
|
254
|
+
): Promise<void> {
|
255
|
+
if (!classicAddress) {
|
256
|
+
reject(new XRPLFaucetError(`The faucet account is undefined`))
|
257
|
+
return
|
258
|
+
}
|
259
|
+
try {
|
260
|
+
// Check at regular interval if the address is enabled on the XRPL and funded
|
261
|
+
const updatedBalance = await getUpdatedBalance(
|
262
|
+
client,
|
263
|
+
classicAddress,
|
264
|
+
startingBalance,
|
265
|
+
)
|
266
|
+
|
267
|
+
if (updatedBalance > startingBalance) {
|
268
|
+
resolve({
|
269
|
+
wallet: walletToFund,
|
270
|
+
balance: await getUpdatedBalance(
|
271
|
+
client,
|
272
|
+
walletToFund.classicAddress,
|
273
|
+
startingBalance,
|
274
|
+
),
|
275
|
+
})
|
276
|
+
} else {
|
277
|
+
reject(
|
278
|
+
new XRPLFaucetError(
|
279
|
+
`Unable to fund address with faucet after waiting ${
|
280
|
+
INTERVAL_SECONDS * MAX_ATTEMPTS
|
281
|
+
} seconds`,
|
282
|
+
),
|
283
|
+
)
|
284
|
+
}
|
285
|
+
} catch (err) {
|
286
|
+
if (err instanceof Error) {
|
287
|
+
reject(new XRPLFaucetError(err.message))
|
288
|
+
}
|
289
|
+
reject(err)
|
290
|
+
}
|
291
|
+
}
|
292
|
+
|
293
|
+
/**
|
294
|
+
* Check at regular interval if the address is enabled on the XRPL and funded.
|
295
|
+
*
|
296
|
+
* @param client - Client.
|
297
|
+
* @param address - The account address to check.
|
298
|
+
* @param originalBalance - The initial balance before the funding.
|
299
|
+
* @returns A Promise boolean.
|
300
|
+
*/
|
301
|
+
async function getUpdatedBalance(
|
302
|
+
client: Client,
|
303
|
+
address: string,
|
304
|
+
originalBalance: number,
|
305
|
+
): Promise<number> {
|
306
|
+
return new Promise((resolve, reject) => {
|
307
|
+
let attempts = MAX_ATTEMPTS
|
308
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises -- Not actually misused here, different resolve
|
309
|
+
const interval = setInterval(async () => {
|
310
|
+
if (attempts < 0) {
|
311
|
+
clearInterval(interval)
|
312
|
+
resolve(originalBalance)
|
313
|
+
} else {
|
314
|
+
attempts -= 1
|
315
|
+
}
|
316
|
+
|
317
|
+
try {
|
318
|
+
let newBalance
|
319
|
+
try {
|
320
|
+
newBalance = Number(await client.getXrpBalance(address))
|
321
|
+
} catch {
|
322
|
+
/* newBalance remains undefined */
|
323
|
+
}
|
324
|
+
|
325
|
+
if (newBalance > originalBalance) {
|
326
|
+
clearInterval(interval)
|
327
|
+
resolve(newBalance)
|
328
|
+
}
|
329
|
+
} catch (err) {
|
330
|
+
clearInterval(interval)
|
331
|
+
if (err instanceof Error) {
|
332
|
+
reject(
|
333
|
+
new XRPLFaucetError(
|
334
|
+
`Unable to check if the address ${address} balance has increased. Error: ${err.message}`,
|
335
|
+
),
|
336
|
+
)
|
337
|
+
}
|
338
|
+
reject(err)
|
339
|
+
}
|
340
|
+
}, INTERVAL_SECONDS * 1000)
|
341
|
+
})
|
342
|
+
}
|
343
|
+
|
344
|
+
export default fundWallet
|