xrpl 4.3.0-smartescrow.3 → 4.4.0-smartescrow.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/build/xrpl-latest-min.js +3 -0
- package/build/xrpl-latest-min.js.map +1 -0
- package/build/xrpl-latest.js +1457 -1505
- package/build/xrpl-latest.js.map +1 -1
- package/dist/npm/Wallet/batchSigner.d.ts +8 -0
- package/dist/npm/Wallet/batchSigner.d.ts.map +1 -0
- package/dist/npm/Wallet/batchSigner.js +111 -0
- package/dist/npm/Wallet/batchSigner.js.map +1 -0
- package/dist/npm/Wallet/defaultFaucets.d.ts +3 -2
- package/dist/npm/Wallet/defaultFaucets.d.ts.map +1 -1
- package/dist/npm/Wallet/defaultFaucets.js +16 -15
- package/dist/npm/Wallet/defaultFaucets.js.map +1 -1
- package/dist/npm/Wallet/fundWallet.d.ts.map +1 -1
- package/dist/npm/Wallet/fundWallet.js +8 -16
- package/dist/npm/Wallet/fundWallet.js.map +1 -1
- package/dist/npm/Wallet/index.d.ts.map +1 -1
- package/dist/npm/Wallet/index.js +10 -4
- package/dist/npm/Wallet/index.js.map +1 -1
- package/dist/npm/Wallet/signer.d.ts.map +1 -1
- package/dist/npm/Wallet/signer.js +4 -20
- package/dist/npm/Wallet/signer.js.map +1 -1
- package/dist/npm/Wallet/utils.d.ts +9 -0
- package/dist/npm/Wallet/utils.d.ts.map +1 -0
- package/dist/npm/Wallet/utils.js +28 -0
- package/dist/npm/Wallet/utils.js.map +1 -0
- package/dist/npm/client/RequestManager.d.ts.map +1 -1
- package/dist/npm/client/RequestManager.js +3 -3
- package/dist/npm/client/RequestManager.js.map +1 -1
- package/dist/npm/client/connection.d.ts.map +1 -1
- package/dist/npm/client/connection.js.map +1 -1
- package/dist/npm/client/index.d.ts +3 -3
- package/dist/npm/client/index.d.ts.map +1 -1
- package/dist/npm/client/index.js +14 -14
- package/dist/npm/client/index.js.map +1 -1
- package/dist/npm/client/partialPayment.d.ts.map +1 -1
- package/dist/npm/client/partialPayment.js +2 -2
- package/dist/npm/client/partialPayment.js.map +1 -1
- package/dist/npm/models/common/index.d.ts +1 -0
- package/dist/npm/models/common/index.d.ts.map +1 -1
- package/dist/npm/models/ledger/AccountRoot.d.ts +1 -1
- package/dist/npm/models/ledger/AccountRoot.d.ts.map +1 -1
- package/dist/npm/models/ledger/Credential.d.ts +2 -2
- package/dist/npm/models/ledger/Credential.d.ts.map +1 -1
- package/dist/npm/models/ledger/LedgerEntry.d.ts +3 -2
- package/dist/npm/models/ledger/LedgerEntry.d.ts.map +1 -1
- package/dist/npm/models/ledger/Vault.d.ts +21 -0
- package/dist/npm/models/ledger/Vault.d.ts.map +1 -0
- package/dist/npm/models/ledger/Vault.js +3 -0
- package/dist/npm/models/ledger/Vault.js.map +1 -0
- package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts +1 -2
- package/dist/npm/models/ledger/XChainOwnedClaimID.d.ts.map +1 -1
- package/dist/npm/models/ledger/index.d.ts +2 -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/baseMethod.d.ts +1 -0
- package/dist/npm/models/methods/baseMethod.d.ts.map +1 -1
- package/dist/npm/models/methods/index.d.ts +5 -4
- package/dist/npm/models/methods/index.d.ts.map +1 -1
- package/dist/npm/models/methods/vaultInfo.d.ts +46 -0
- package/dist/npm/models/methods/vaultInfo.d.ts.map +1 -0
- package/dist/npm/models/methods/vaultInfo.js +3 -0
- package/dist/npm/models/methods/vaultInfo.js.map +1 -0
- package/dist/npm/models/transactions/AMMBid.d.ts.map +1 -1
- package/dist/npm/models/transactions/AMMBid.js +7 -5
- package/dist/npm/models/transactions/AMMBid.js.map +1 -1
- package/dist/npm/models/transactions/AMMClawback.d.ts +2 -2
- package/dist/npm/models/transactions/AMMClawback.d.ts.map +1 -1
- package/dist/npm/models/transactions/AMMClawback.js +5 -6
- package/dist/npm/models/transactions/AMMClawback.js.map +1 -1
- package/dist/npm/models/transactions/AMMDelete.d.ts.map +1 -1
- package/dist/npm/models/transactions/AMMDelete.js +2 -2
- package/dist/npm/models/transactions/AMMDelete.js.map +1 -1
- package/dist/npm/models/transactions/AMMDeposit.d.ts +2 -2
- package/dist/npm/models/transactions/AMMDeposit.d.ts.map +1 -1
- package/dist/npm/models/transactions/AMMDeposit.js +3 -3
- package/dist/npm/models/transactions/AMMDeposit.js.map +1 -1
- package/dist/npm/models/transactions/AMMVote.d.ts.map +1 -1
- package/dist/npm/models/transactions/AMMVote.js +2 -2
- package/dist/npm/models/transactions/AMMVote.js.map +1 -1
- package/dist/npm/models/transactions/AMMWithdraw.d.ts +2 -2
- package/dist/npm/models/transactions/AMMWithdraw.d.ts.map +1 -1
- package/dist/npm/models/transactions/AMMWithdraw.js +3 -3
- package/dist/npm/models/transactions/AMMWithdraw.js.map +1 -1
- package/dist/npm/models/transactions/MPTokenAuthorize.d.ts +2 -2
- package/dist/npm/models/transactions/MPTokenAuthorize.d.ts.map +1 -1
- package/dist/npm/models/transactions/MPTokenIssuanceCreate.d.ts +2 -2
- package/dist/npm/models/transactions/MPTokenIssuanceCreate.d.ts.map +1 -1
- package/dist/npm/models/transactions/MPTokenIssuanceCreate.js +3 -3
- package/dist/npm/models/transactions/MPTokenIssuanceCreate.js.map +1 -1
- package/dist/npm/models/transactions/MPTokenIssuanceSet.d.ts +2 -2
- package/dist/npm/models/transactions/MPTokenIssuanceSet.d.ts.map +1 -1
- package/dist/npm/models/transactions/MPTokenIssuanceSet.js +4 -4
- package/dist/npm/models/transactions/MPTokenIssuanceSet.js.map +1 -1
- package/dist/npm/models/transactions/NFTokenCancelOffer.d.ts.map +1 -1
- package/dist/npm/models/transactions/NFTokenCancelOffer.js +1 -1
- package/dist/npm/models/transactions/NFTokenCancelOffer.js.map +1 -1
- package/dist/npm/models/transactions/NFTokenCreateOffer.d.ts +2 -2
- package/dist/npm/models/transactions/NFTokenCreateOffer.d.ts.map +1 -1
- package/dist/npm/models/transactions/NFTokenCreateOffer.js +6 -2
- package/dist/npm/models/transactions/NFTokenCreateOffer.js.map +1 -1
- package/dist/npm/models/transactions/NFTokenMint.d.ts +2 -2
- package/dist/npm/models/transactions/NFTokenMint.d.ts.map +1 -1
- package/dist/npm/models/transactions/XChainAddAccountCreateAttestation.js.map +1 -1
- package/dist/npm/models/transactions/XChainAddClaimAttestation.js.map +1 -1
- package/dist/npm/models/transactions/XChainClaim.js.map +1 -1
- package/dist/npm/models/transactions/XChainCommit.js.map +1 -1
- package/dist/npm/models/transactions/XChainModifyBridge.d.ts +2 -2
- package/dist/npm/models/transactions/XChainModifyBridge.d.ts.map +1 -1
- package/dist/npm/models/transactions/accountDelete.d.ts.map +1 -1
- package/dist/npm/models/transactions/accountDelete.js.map +1 -1
- package/dist/npm/models/transactions/accountSet.d.ts +2 -2
- package/dist/npm/models/transactions/accountSet.d.ts.map +1 -1
- package/dist/npm/models/transactions/accountSet.js.map +1 -1
- package/dist/npm/models/transactions/batch.d.ts +39 -0
- package/dist/npm/models/transactions/batch.d.ts.map +1 -0
- package/dist/npm/models/transactions/batch.js +64 -0
- package/dist/npm/models/transactions/batch.js.map +1 -0
- package/dist/npm/models/transactions/checkCreate.d.ts.map +1 -1
- package/dist/npm/models/transactions/checkCreate.js +1 -2
- package/dist/npm/models/transactions/checkCreate.js.map +1 -1
- package/dist/npm/models/transactions/clawback.d.ts +2 -2
- package/dist/npm/models/transactions/clawback.d.ts.map +1 -1
- package/dist/npm/models/transactions/clawback.js +4 -6
- package/dist/npm/models/transactions/clawback.js.map +1 -1
- package/dist/npm/models/transactions/common.d.ts +30 -9
- package/dist/npm/models/transactions/common.d.ts.map +1 -1
- package/dist/npm/models/transactions/common.js +74 -36
- package/dist/npm/models/transactions/common.js.map +1 -1
- package/dist/npm/models/transactions/delegateSet.d.ts.map +1 -1
- package/dist/npm/models/transactions/delegateSet.js +1 -0
- package/dist/npm/models/transactions/delegateSet.js.map +1 -1
- package/dist/npm/models/transactions/depositPreauth.d.ts.map +1 -1
- package/dist/npm/models/transactions/depositPreauth.js.map +1 -1
- package/dist/npm/models/transactions/escrowFinish.d.ts.map +1 -1
- package/dist/npm/models/transactions/escrowFinish.js.map +1 -1
- package/dist/npm/models/transactions/index.d.ts +9 -2
- package/dist/npm/models/transactions/index.d.ts.map +1 -1
- package/dist/npm/models/transactions/index.js +4 -1
- package/dist/npm/models/transactions/index.js.map +1 -1
- package/dist/npm/models/transactions/metadata.d.ts +1 -0
- package/dist/npm/models/transactions/metadata.d.ts.map +1 -1
- package/dist/npm/models/transactions/offerCreate.d.ts +2 -2
- package/dist/npm/models/transactions/offerCreate.d.ts.map +1 -1
- package/dist/npm/models/transactions/oracleSet.d.ts.map +1 -1
- package/dist/npm/models/transactions/oracleSet.js +22 -21
- package/dist/npm/models/transactions/oracleSet.js.map +1 -1
- package/dist/npm/models/transactions/payment.d.ts +3 -2
- package/dist/npm/models/transactions/payment.d.ts.map +1 -1
- package/dist/npm/models/transactions/payment.js +9 -4
- package/dist/npm/models/transactions/payment.js.map +1 -1
- package/dist/npm/models/transactions/paymentChannelClaim.d.ts +2 -2
- package/dist/npm/models/transactions/paymentChannelClaim.d.ts.map +1 -1
- package/dist/npm/models/transactions/paymentChannelClaim.js.map +1 -1
- package/dist/npm/models/transactions/permissionedDomainSet.d.ts.map +1 -1
- package/dist/npm/models/transactions/permissionedDomainSet.js +1 -1
- package/dist/npm/models/transactions/permissionedDomainSet.js.map +1 -1
- package/dist/npm/models/transactions/signerListSet.d.ts.map +1 -1
- package/dist/npm/models/transactions/signerListSet.js +10 -16
- package/dist/npm/models/transactions/signerListSet.js.map +1 -1
- package/dist/npm/models/transactions/transaction.d.ts +8 -1
- package/dist/npm/models/transactions/transaction.d.ts.map +1 -1
- package/dist/npm/models/transactions/transaction.js +35 -35
- package/dist/npm/models/transactions/transaction.js.map +1 -1
- package/dist/npm/models/transactions/trustSet.d.ts +2 -2
- package/dist/npm/models/transactions/trustSet.d.ts.map +1 -1
- package/dist/npm/models/transactions/vaultClawback.d.ts +10 -0
- package/dist/npm/models/transactions/vaultClawback.d.ts.map +1 -0
- package/dist/npm/models/transactions/vaultClawback.js +12 -0
- package/dist/npm/models/transactions/vaultClawback.js.map +1 -0
- package/dist/npm/models/transactions/vaultCreate.d.ts +24 -0
- package/dist/npm/models/transactions/vaultCreate.d.ts.map +1 -0
- package/dist/npm/models/transactions/vaultCreate.js +51 -0
- package/dist/npm/models/transactions/vaultCreate.js.map +1 -0
- package/dist/npm/models/transactions/vaultDelete.d.ts +7 -0
- package/dist/npm/models/transactions/vaultDelete.d.ts.map +1 -0
- package/dist/npm/models/transactions/vaultDelete.js +10 -0
- package/dist/npm/models/transactions/vaultDelete.js.map +1 -0
- package/dist/npm/models/transactions/vaultDeposit.d.ts +9 -0
- package/dist/npm/models/transactions/vaultDeposit.d.ts.map +1 -0
- package/dist/npm/models/transactions/vaultDeposit.js +11 -0
- package/dist/npm/models/transactions/vaultDeposit.js.map +1 -0
- package/dist/npm/models/transactions/vaultSet.d.ts +10 -0
- package/dist/npm/models/transactions/vaultSet.d.ts.map +1 -0
- package/dist/npm/models/transactions/vaultSet.js +25 -0
- package/dist/npm/models/transactions/vaultSet.js.map +1 -0
- package/dist/npm/models/transactions/vaultWithdraw.d.ts +10 -0
- package/dist/npm/models/transactions/vaultWithdraw.d.ts.map +1 -0
- package/dist/npm/models/transactions/vaultWithdraw.js +12 -0
- package/dist/npm/models/transactions/vaultWithdraw.js.map +1 -0
- package/dist/npm/models/utils/flags.d.ts.map +1 -1
- package/dist/npm/models/utils/flags.js +26 -9
- package/dist/npm/models/utils/flags.js.map +1 -1
- package/dist/npm/models/utils/index.d.ts +2 -0
- package/dist/npm/models/utils/index.d.ts.map +1 -1
- package/dist/npm/models/utils/index.js +11 -1
- package/dist/npm/models/utils/index.js.map +1 -1
- package/dist/npm/snippets/tsconfig.tsbuildinfo +1 -1
- package/dist/npm/src/Wallet/batchSigner.d.ts +8 -0
- package/dist/npm/src/Wallet/batchSigner.d.ts.map +1 -0
- package/dist/npm/src/Wallet/batchSigner.js +111 -0
- package/dist/npm/src/Wallet/batchSigner.js.map +1 -0
- package/dist/npm/src/Wallet/defaultFaucets.d.ts +3 -2
- package/dist/npm/src/Wallet/defaultFaucets.d.ts.map +1 -1
- package/dist/npm/src/Wallet/defaultFaucets.js +16 -15
- package/dist/npm/src/Wallet/defaultFaucets.js.map +1 -1
- package/dist/npm/src/Wallet/fundWallet.d.ts.map +1 -1
- package/dist/npm/src/Wallet/fundWallet.js +8 -16
- package/dist/npm/src/Wallet/fundWallet.js.map +1 -1
- package/dist/npm/src/Wallet/index.d.ts.map +1 -1
- package/dist/npm/src/Wallet/index.js +10 -4
- package/dist/npm/src/Wallet/index.js.map +1 -1
- package/dist/npm/src/Wallet/signer.d.ts.map +1 -1
- package/dist/npm/src/Wallet/signer.js +4 -20
- package/dist/npm/src/Wallet/signer.js.map +1 -1
- package/dist/npm/src/Wallet/utils.d.ts +9 -0
- package/dist/npm/src/Wallet/utils.d.ts.map +1 -0
- package/dist/npm/src/Wallet/utils.js +28 -0
- package/dist/npm/src/Wallet/utils.js.map +1 -0
- package/dist/npm/src/client/RequestManager.d.ts.map +1 -1
- package/dist/npm/src/client/RequestManager.js +3 -3
- package/dist/npm/src/client/RequestManager.js.map +1 -1
- package/dist/npm/src/client/connection.d.ts.map +1 -1
- package/dist/npm/src/client/connection.js.map +1 -1
- package/dist/npm/src/client/index.d.ts +3 -3
- package/dist/npm/src/client/index.d.ts.map +1 -1
- package/dist/npm/src/client/index.js +14 -14
- package/dist/npm/src/client/index.js.map +1 -1
- package/dist/npm/src/client/partialPayment.d.ts.map +1 -1
- package/dist/npm/src/client/partialPayment.js +2 -2
- package/dist/npm/src/client/partialPayment.js.map +1 -1
- package/dist/npm/src/models/common/index.d.ts +1 -0
- package/dist/npm/src/models/common/index.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/AccountRoot.d.ts +1 -1
- package/dist/npm/src/models/ledger/AccountRoot.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/Credential.d.ts +2 -2
- package/dist/npm/src/models/ledger/Credential.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/LedgerEntry.d.ts +3 -2
- package/dist/npm/src/models/ledger/LedgerEntry.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/Vault.d.ts +21 -0
- package/dist/npm/src/models/ledger/Vault.d.ts.map +1 -0
- package/dist/npm/src/models/ledger/Vault.js +3 -0
- package/dist/npm/src/models/ledger/Vault.js.map +1 -0
- package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts +1 -2
- package/dist/npm/src/models/ledger/XChainOwnedClaimID.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/index.d.ts +2 -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/baseMethod.d.ts +1 -0
- package/dist/npm/src/models/methods/baseMethod.d.ts.map +1 -1
- package/dist/npm/src/models/methods/index.d.ts +5 -4
- package/dist/npm/src/models/methods/index.d.ts.map +1 -1
- package/dist/npm/src/models/methods/vaultInfo.d.ts +46 -0
- package/dist/npm/src/models/methods/vaultInfo.d.ts.map +1 -0
- package/dist/npm/src/models/methods/vaultInfo.js +3 -0
- package/dist/npm/src/models/methods/vaultInfo.js.map +1 -0
- package/dist/npm/src/models/transactions/AMMBid.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/AMMBid.js +7 -5
- package/dist/npm/src/models/transactions/AMMBid.js.map +1 -1
- package/dist/npm/src/models/transactions/AMMClawback.d.ts +2 -2
- package/dist/npm/src/models/transactions/AMMClawback.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/AMMClawback.js +5 -6
- package/dist/npm/src/models/transactions/AMMClawback.js.map +1 -1
- package/dist/npm/src/models/transactions/AMMDelete.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/AMMDelete.js +2 -2
- package/dist/npm/src/models/transactions/AMMDelete.js.map +1 -1
- package/dist/npm/src/models/transactions/AMMDeposit.d.ts +2 -2
- package/dist/npm/src/models/transactions/AMMDeposit.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/AMMDeposit.js +3 -3
- package/dist/npm/src/models/transactions/AMMDeposit.js.map +1 -1
- package/dist/npm/src/models/transactions/AMMVote.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/AMMVote.js +2 -2
- package/dist/npm/src/models/transactions/AMMVote.js.map +1 -1
- package/dist/npm/src/models/transactions/AMMWithdraw.d.ts +2 -2
- package/dist/npm/src/models/transactions/AMMWithdraw.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/AMMWithdraw.js +3 -3
- package/dist/npm/src/models/transactions/AMMWithdraw.js.map +1 -1
- package/dist/npm/src/models/transactions/MPTokenAuthorize.d.ts +2 -2
- package/dist/npm/src/models/transactions/MPTokenAuthorize.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/MPTokenIssuanceCreate.d.ts +2 -2
- package/dist/npm/src/models/transactions/MPTokenIssuanceCreate.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/MPTokenIssuanceCreate.js +3 -3
- package/dist/npm/src/models/transactions/MPTokenIssuanceCreate.js.map +1 -1
- package/dist/npm/src/models/transactions/MPTokenIssuanceSet.d.ts +2 -2
- package/dist/npm/src/models/transactions/MPTokenIssuanceSet.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/MPTokenIssuanceSet.js +4 -4
- package/dist/npm/src/models/transactions/MPTokenIssuanceSet.js.map +1 -1
- package/dist/npm/src/models/transactions/NFTokenCancelOffer.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/NFTokenCancelOffer.js +1 -1
- package/dist/npm/src/models/transactions/NFTokenCancelOffer.js.map +1 -1
- package/dist/npm/src/models/transactions/NFTokenCreateOffer.d.ts +2 -2
- package/dist/npm/src/models/transactions/NFTokenCreateOffer.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/NFTokenCreateOffer.js +6 -2
- package/dist/npm/src/models/transactions/NFTokenCreateOffer.js.map +1 -1
- package/dist/npm/src/models/transactions/NFTokenMint.d.ts +2 -2
- package/dist/npm/src/models/transactions/NFTokenMint.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/XChainAddAccountCreateAttestation.js.map +1 -1
- package/dist/npm/src/models/transactions/XChainAddClaimAttestation.js.map +1 -1
- package/dist/npm/src/models/transactions/XChainClaim.js.map +1 -1
- package/dist/npm/src/models/transactions/XChainCommit.js.map +1 -1
- package/dist/npm/src/models/transactions/XChainModifyBridge.d.ts +2 -2
- package/dist/npm/src/models/transactions/XChainModifyBridge.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/accountDelete.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/accountDelete.js.map +1 -1
- package/dist/npm/src/models/transactions/accountSet.d.ts +2 -2
- package/dist/npm/src/models/transactions/accountSet.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/accountSet.js.map +1 -1
- package/dist/npm/src/models/transactions/batch.d.ts +39 -0
- package/dist/npm/src/models/transactions/batch.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/batch.js +64 -0
- package/dist/npm/src/models/transactions/batch.js.map +1 -0
- package/dist/npm/src/models/transactions/checkCreate.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/checkCreate.js +1 -2
- package/dist/npm/src/models/transactions/checkCreate.js.map +1 -1
- package/dist/npm/src/models/transactions/clawback.d.ts +2 -2
- package/dist/npm/src/models/transactions/clawback.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/clawback.js +4 -6
- package/dist/npm/src/models/transactions/clawback.js.map +1 -1
- package/dist/npm/src/models/transactions/common.d.ts +30 -9
- package/dist/npm/src/models/transactions/common.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/common.js +74 -36
- package/dist/npm/src/models/transactions/common.js.map +1 -1
- package/dist/npm/src/models/transactions/delegateSet.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/delegateSet.js +1 -0
- package/dist/npm/src/models/transactions/delegateSet.js.map +1 -1
- package/dist/npm/src/models/transactions/depositPreauth.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/depositPreauth.js.map +1 -1
- package/dist/npm/src/models/transactions/escrowFinish.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/escrowFinish.js.map +1 -1
- package/dist/npm/src/models/transactions/index.d.ts +9 -2
- package/dist/npm/src/models/transactions/index.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/index.js +4 -1
- package/dist/npm/src/models/transactions/index.js.map +1 -1
- package/dist/npm/src/models/transactions/metadata.d.ts +1 -0
- package/dist/npm/src/models/transactions/metadata.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/offerCreate.d.ts +2 -2
- package/dist/npm/src/models/transactions/offerCreate.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/oracleSet.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/oracleSet.js +22 -21
- package/dist/npm/src/models/transactions/oracleSet.js.map +1 -1
- package/dist/npm/src/models/transactions/payment.d.ts +3 -2
- package/dist/npm/src/models/transactions/payment.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/payment.js +9 -4
- package/dist/npm/src/models/transactions/payment.js.map +1 -1
- package/dist/npm/src/models/transactions/paymentChannelClaim.d.ts +2 -2
- package/dist/npm/src/models/transactions/paymentChannelClaim.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/paymentChannelClaim.js.map +1 -1
- package/dist/npm/src/models/transactions/permissionedDomainSet.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/permissionedDomainSet.js +1 -1
- package/dist/npm/src/models/transactions/permissionedDomainSet.js.map +1 -1
- package/dist/npm/src/models/transactions/signerListSet.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/signerListSet.js +10 -16
- package/dist/npm/src/models/transactions/signerListSet.js.map +1 -1
- package/dist/npm/src/models/transactions/transaction.d.ts +8 -1
- package/dist/npm/src/models/transactions/transaction.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/transaction.js +35 -35
- package/dist/npm/src/models/transactions/transaction.js.map +1 -1
- package/dist/npm/src/models/transactions/trustSet.d.ts +2 -2
- package/dist/npm/src/models/transactions/trustSet.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/vaultClawback.d.ts +10 -0
- package/dist/npm/src/models/transactions/vaultClawback.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/vaultClawback.js +12 -0
- package/dist/npm/src/models/transactions/vaultClawback.js.map +1 -0
- package/dist/npm/src/models/transactions/vaultCreate.d.ts +24 -0
- package/dist/npm/src/models/transactions/vaultCreate.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/vaultCreate.js +51 -0
- package/dist/npm/src/models/transactions/vaultCreate.js.map +1 -0
- package/dist/npm/src/models/transactions/vaultDelete.d.ts +7 -0
- package/dist/npm/src/models/transactions/vaultDelete.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/vaultDelete.js +10 -0
- package/dist/npm/src/models/transactions/vaultDelete.js.map +1 -0
- package/dist/npm/src/models/transactions/vaultDeposit.d.ts +9 -0
- package/dist/npm/src/models/transactions/vaultDeposit.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/vaultDeposit.js +11 -0
- package/dist/npm/src/models/transactions/vaultDeposit.js.map +1 -0
- package/dist/npm/src/models/transactions/vaultSet.d.ts +10 -0
- package/dist/npm/src/models/transactions/vaultSet.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/vaultSet.js +25 -0
- package/dist/npm/src/models/transactions/vaultSet.js.map +1 -0
- package/dist/npm/src/models/transactions/vaultWithdraw.d.ts +10 -0
- package/dist/npm/src/models/transactions/vaultWithdraw.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/vaultWithdraw.js +12 -0
- package/dist/npm/src/models/transactions/vaultWithdraw.js.map +1 -0
- package/dist/npm/src/models/utils/flags.d.ts.map +1 -1
- package/dist/npm/src/models/utils/flags.js +26 -9
- package/dist/npm/src/models/utils/flags.js.map +1 -1
- package/dist/npm/src/models/utils/index.d.ts +2 -0
- package/dist/npm/src/models/utils/index.d.ts.map +1 -1
- package/dist/npm/src/models/utils/index.js +11 -1
- package/dist/npm/src/models/utils/index.js.map +1 -1
- package/dist/npm/src/sugar/autofill.d.ts +4 -2
- package/dist/npm/src/sugar/autofill.d.ts.map +1 -1
- package/dist/npm/src/sugar/autofill.js +109 -16
- package/dist/npm/src/sugar/autofill.js.map +1 -1
- package/dist/npm/src/sugar/submit.d.ts.map +1 -1
- package/dist/npm/src/sugar/submit.js.map +1 -1
- package/dist/npm/src/utils/hashes/hashLedger.d.ts.map +1 -1
- package/dist/npm/src/utils/hashes/hashLedger.js +4 -1
- package/dist/npm/src/utils/hashes/hashLedger.js.map +1 -1
- package/dist/npm/sugar/autofill.d.ts +4 -2
- package/dist/npm/sugar/autofill.d.ts.map +1 -1
- package/dist/npm/sugar/autofill.js +109 -16
- package/dist/npm/sugar/autofill.js.map +1 -1
- package/dist/npm/sugar/submit.d.ts.map +1 -1
- package/dist/npm/sugar/submit.js.map +1 -1
- package/dist/npm/utils/hashes/hashLedger.d.ts.map +1 -1
- package/dist/npm/utils/hashes/hashLedger.js +4 -1
- package/dist/npm/utils/hashes/hashLedger.js.map +1 -1
- package/package.json +7 -6
- package/src/Wallet/batchSigner.ts +198 -0
- package/src/Wallet/defaultFaucets.ts +20 -18
- package/src/Wallet/fundWallet.ts +17 -28
- package/src/Wallet/index.ts +9 -3
- package/src/Wallet/signer.ts +4 -39
- package/src/Wallet/utils.ts +58 -0
- package/src/client/RequestManager.ts +4 -1
- package/src/client/connection.ts +0 -1
- package/src/client/index.ts +50 -66
- package/src/client/partialPayment.ts +2 -4
- package/src/models/common/index.ts +2 -0
- package/src/models/ledger/AccountRoot.ts +1 -1
- package/src/models/ledger/Credential.ts +2 -2
- package/src/models/ledger/LedgerEntry.ts +3 -0
- package/src/models/ledger/Vault.ts +83 -0
- package/src/models/ledger/XChainOwnedClaimID.ts +1 -3
- package/src/models/ledger/index.ts +3 -1
- package/src/models/methods/baseMethod.ts +1 -0
- package/src/models/methods/index.ts +10 -0
- package/src/models/methods/vaultInfo.ts +193 -0
- package/src/models/transactions/AMMBid.ts +12 -21
- package/src/models/transactions/AMMClawback.ts +10 -13
- package/src/models/transactions/AMMDelete.ts +7 -3
- package/src/models/transactions/AMMDeposit.ts +6 -6
- package/src/models/transactions/AMMVote.ts +7 -3
- package/src/models/transactions/AMMWithdraw.ts +6 -6
- package/src/models/transactions/MPTokenAuthorize.ts +2 -2
- package/src/models/transactions/MPTokenIssuanceCreate.ts +6 -3
- package/src/models/transactions/MPTokenIssuanceSet.ts +3 -3
- package/src/models/transactions/NFTokenCancelOffer.ts +2 -2
- package/src/models/transactions/NFTokenCreateOffer.ts +10 -6
- package/src/models/transactions/NFTokenMint.ts +2 -2
- package/src/models/transactions/XChainAddAccountCreateAttestation.ts +2 -2
- package/src/models/transactions/XChainAddClaimAttestation.ts +2 -2
- package/src/models/transactions/XChainClaim.ts +1 -1
- package/src/models/transactions/XChainCommit.ts +1 -1
- package/src/models/transactions/XChainModifyBridge.ts +2 -2
- package/src/models/transactions/accountDelete.ts +1 -2
- package/src/models/transactions/accountSet.ts +2 -1
- package/src/models/transactions/batch.ts +151 -0
- package/src/models/transactions/checkCreate.ts +2 -6
- package/src/models/transactions/clawback.ts +9 -10
- package/src/models/transactions/common.ts +194 -69
- package/src/models/transactions/delegateSet.ts +1 -0
- package/src/models/transactions/depositPreauth.ts +2 -4
- package/src/models/transactions/escrowFinish.ts +1 -2
- package/src/models/transactions/index.ts +14 -3
- package/src/models/transactions/metadata.ts +2 -0
- package/src/models/transactions/offerCreate.ts +2 -2
- package/src/models/transactions/oracleSet.ts +88 -91
- package/src/models/transactions/payment.ts +21 -13
- package/src/models/transactions/paymentChannelClaim.ts +4 -4
- package/src/models/transactions/permissionedDomainSet.ts +3 -7
- package/src/models/transactions/signerListSet.ts +21 -21
- package/src/models/transactions/transaction.ts +61 -43
- package/src/models/transactions/trustSet.ts +2 -2
- package/src/models/transactions/vaultClawback.ts +55 -0
- package/src/models/transactions/vaultCreate.ts +142 -0
- package/src/models/transactions/vaultDelete.ts +32 -0
- package/src/models/transactions/vaultDeposit.ts +41 -0
- package/src/models/transactions/vaultSet.ts +71 -0
- package/src/models/transactions/vaultWithdraw.ts +50 -0
- package/src/models/utils/flags.ts +30 -10
- package/src/models/utils/index.ts +24 -0
- package/src/sugar/autofill.ts +165 -35
- package/src/sugar/submit.ts +1 -2
- package/src/utils/hashes/hashLedger.ts +5 -2
package/build/xrpl-latest.js
CHANGED
@@ -5454,6 +5454,107 @@ exports.crypto = void 0;
|
|
5454
5454
|
exports.crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;
|
5455
5455
|
|
5456
5456
|
|
5457
|
+
/***/ }),
|
5458
|
+
|
5459
|
+
/***/ "../../node_modules/@noble/hashes/hmac.js":
|
5460
|
+
/*!************************************************!*\
|
5461
|
+
!*** ../../node_modules/@noble/hashes/hmac.js ***!
|
5462
|
+
\************************************************/
|
5463
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
5464
|
+
|
5465
|
+
"use strict";
|
5466
|
+
|
5467
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
5468
|
+
exports.hmac = exports.HMAC = void 0;
|
5469
|
+
/**
|
5470
|
+
* HMAC: RFC2104 message authentication code.
|
5471
|
+
* @module
|
5472
|
+
*/
|
5473
|
+
const utils_ts_1 = __webpack_require__(/*! ./utils.js */ "../../node_modules/@noble/hashes/utils.js");
|
5474
|
+
class HMAC extends utils_ts_1.Hash {
|
5475
|
+
constructor(hash, _key) {
|
5476
|
+
super();
|
5477
|
+
this.finished = false;
|
5478
|
+
this.destroyed = false;
|
5479
|
+
(0, utils_ts_1.ahash)(hash);
|
5480
|
+
const key = (0, utils_ts_1.toBytes)(_key);
|
5481
|
+
this.iHash = hash.create();
|
5482
|
+
if (typeof this.iHash.update !== 'function')
|
5483
|
+
throw new Error('Expected instance of class which extends utils.Hash');
|
5484
|
+
this.blockLen = this.iHash.blockLen;
|
5485
|
+
this.outputLen = this.iHash.outputLen;
|
5486
|
+
const blockLen = this.blockLen;
|
5487
|
+
const pad = new Uint8Array(blockLen);
|
5488
|
+
// blockLen can be bigger than outputLen
|
5489
|
+
pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);
|
5490
|
+
for (let i = 0; i < pad.length; i++)
|
5491
|
+
pad[i] ^= 0x36;
|
5492
|
+
this.iHash.update(pad);
|
5493
|
+
// By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone
|
5494
|
+
this.oHash = hash.create();
|
5495
|
+
// Undo internal XOR && apply outer XOR
|
5496
|
+
for (let i = 0; i < pad.length; i++)
|
5497
|
+
pad[i] ^= 0x36 ^ 0x5c;
|
5498
|
+
this.oHash.update(pad);
|
5499
|
+
(0, utils_ts_1.clean)(pad);
|
5500
|
+
}
|
5501
|
+
update(buf) {
|
5502
|
+
(0, utils_ts_1.aexists)(this);
|
5503
|
+
this.iHash.update(buf);
|
5504
|
+
return this;
|
5505
|
+
}
|
5506
|
+
digestInto(out) {
|
5507
|
+
(0, utils_ts_1.aexists)(this);
|
5508
|
+
(0, utils_ts_1.abytes)(out, this.outputLen);
|
5509
|
+
this.finished = true;
|
5510
|
+
this.iHash.digestInto(out);
|
5511
|
+
this.oHash.update(out);
|
5512
|
+
this.oHash.digestInto(out);
|
5513
|
+
this.destroy();
|
5514
|
+
}
|
5515
|
+
digest() {
|
5516
|
+
const out = new Uint8Array(this.oHash.outputLen);
|
5517
|
+
this.digestInto(out);
|
5518
|
+
return out;
|
5519
|
+
}
|
5520
|
+
_cloneInto(to) {
|
5521
|
+
// Create new instance without calling constructor since key already in state and we don't know it.
|
5522
|
+
to || (to = Object.create(Object.getPrototypeOf(this), {}));
|
5523
|
+
const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;
|
5524
|
+
to = to;
|
5525
|
+
to.finished = finished;
|
5526
|
+
to.destroyed = destroyed;
|
5527
|
+
to.blockLen = blockLen;
|
5528
|
+
to.outputLen = outputLen;
|
5529
|
+
to.oHash = oHash._cloneInto(to.oHash);
|
5530
|
+
to.iHash = iHash._cloneInto(to.iHash);
|
5531
|
+
return to;
|
5532
|
+
}
|
5533
|
+
clone() {
|
5534
|
+
return this._cloneInto();
|
5535
|
+
}
|
5536
|
+
destroy() {
|
5537
|
+
this.destroyed = true;
|
5538
|
+
this.oHash.destroy();
|
5539
|
+
this.iHash.destroy();
|
5540
|
+
}
|
5541
|
+
}
|
5542
|
+
exports.HMAC = HMAC;
|
5543
|
+
/**
|
5544
|
+
* HMAC: RFC2104 message authentication code.
|
5545
|
+
* @param hash - function that would be used e.g. sha256
|
5546
|
+
* @param key - message key
|
5547
|
+
* @param message - message data
|
5548
|
+
* @example
|
5549
|
+
* import { hmac } from '@noble/hashes/hmac';
|
5550
|
+
* import { sha256 } from '@noble/hashes/sha2';
|
5551
|
+
* const mac1 = hmac(sha256, 'key', 'message');
|
5552
|
+
*/
|
5553
|
+
const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest();
|
5554
|
+
exports.hmac = hmac;
|
5555
|
+
exports.hmac.create = (hash, key) => new HMAC(hash, key);
|
5556
|
+
|
5557
|
+
|
5457
5558
|
/***/ }),
|
5458
5559
|
|
5459
5560
|
/***/ "../../node_modules/@noble/hashes/legacy.js":
|
@@ -5751,6 +5852,117 @@ exports.RIPEMD160 = RIPEMD160;
|
|
5751
5852
|
exports.ripemd160 = (0, utils_ts_1.createHasher)(() => new RIPEMD160());
|
5752
5853
|
|
5753
5854
|
|
5855
|
+
/***/ }),
|
5856
|
+
|
5857
|
+
/***/ "../../node_modules/@noble/hashes/pbkdf2.js":
|
5858
|
+
/*!**************************************************!*\
|
5859
|
+
!*** ../../node_modules/@noble/hashes/pbkdf2.js ***!
|
5860
|
+
\**************************************************/
|
5861
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
5862
|
+
|
5863
|
+
"use strict";
|
5864
|
+
|
5865
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
5866
|
+
exports.pbkdf2 = pbkdf2;
|
5867
|
+
exports.pbkdf2Async = pbkdf2Async;
|
5868
|
+
/**
|
5869
|
+
* PBKDF (RFC 2898). Can be used to create a key from password and salt.
|
5870
|
+
* @module
|
5871
|
+
*/
|
5872
|
+
const hmac_ts_1 = __webpack_require__(/*! ./hmac.js */ "../../node_modules/@noble/hashes/hmac.js");
|
5873
|
+
// prettier-ignore
|
5874
|
+
const utils_ts_1 = __webpack_require__(/*! ./utils.js */ "../../node_modules/@noble/hashes/utils.js");
|
5875
|
+
// Common prologue and epilogue for sync/async functions
|
5876
|
+
function pbkdf2Init(hash, _password, _salt, _opts) {
|
5877
|
+
(0, utils_ts_1.ahash)(hash);
|
5878
|
+
const opts = (0, utils_ts_1.checkOpts)({ dkLen: 32, asyncTick: 10 }, _opts);
|
5879
|
+
const { c, dkLen, asyncTick } = opts;
|
5880
|
+
(0, utils_ts_1.anumber)(c);
|
5881
|
+
(0, utils_ts_1.anumber)(dkLen);
|
5882
|
+
(0, utils_ts_1.anumber)(asyncTick);
|
5883
|
+
if (c < 1)
|
5884
|
+
throw new Error('iterations (c) should be >= 1');
|
5885
|
+
const password = (0, utils_ts_1.kdfInputToBytes)(_password);
|
5886
|
+
const salt = (0, utils_ts_1.kdfInputToBytes)(_salt);
|
5887
|
+
// DK = PBKDF2(PRF, Password, Salt, c, dkLen);
|
5888
|
+
const DK = new Uint8Array(dkLen);
|
5889
|
+
// U1 = PRF(Password, Salt + INT_32_BE(i))
|
5890
|
+
const PRF = hmac_ts_1.hmac.create(hash, password);
|
5891
|
+
const PRFSalt = PRF._cloneInto().update(salt);
|
5892
|
+
return { c, dkLen, asyncTick, DK, PRF, PRFSalt };
|
5893
|
+
}
|
5894
|
+
function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) {
|
5895
|
+
PRF.destroy();
|
5896
|
+
PRFSalt.destroy();
|
5897
|
+
if (prfW)
|
5898
|
+
prfW.destroy();
|
5899
|
+
(0, utils_ts_1.clean)(u);
|
5900
|
+
return DK;
|
5901
|
+
}
|
5902
|
+
/**
|
5903
|
+
* PBKDF2-HMAC: RFC 2898 key derivation function
|
5904
|
+
* @param hash - hash function that would be used e.g. sha256
|
5905
|
+
* @param password - password from which a derived key is generated
|
5906
|
+
* @param salt - cryptographic salt
|
5907
|
+
* @param opts - {c, dkLen} where c is work factor and dkLen is output message size
|
5908
|
+
* @example
|
5909
|
+
* const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) });
|
5910
|
+
*/
|
5911
|
+
function pbkdf2(hash, password, salt, opts) {
|
5912
|
+
const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);
|
5913
|
+
let prfW; // Working copy
|
5914
|
+
const arr = new Uint8Array(4);
|
5915
|
+
const view = (0, utils_ts_1.createView)(arr);
|
5916
|
+
const u = new Uint8Array(PRF.outputLen);
|
5917
|
+
// DK = T1 + T2 + ⋯ + Tdklen/hlen
|
5918
|
+
for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {
|
5919
|
+
// Ti = F(Password, Salt, c, i)
|
5920
|
+
const Ti = DK.subarray(pos, pos + PRF.outputLen);
|
5921
|
+
view.setInt32(0, ti, false);
|
5922
|
+
// F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc
|
5923
|
+
// U1 = PRF(Password, Salt + INT_32_BE(i))
|
5924
|
+
(prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);
|
5925
|
+
Ti.set(u.subarray(0, Ti.length));
|
5926
|
+
for (let ui = 1; ui < c; ui++) {
|
5927
|
+
// Uc = PRF(Password, Uc−1)
|
5928
|
+
PRF._cloneInto(prfW).update(u).digestInto(u);
|
5929
|
+
for (let i = 0; i < Ti.length; i++)
|
5930
|
+
Ti[i] ^= u[i];
|
5931
|
+
}
|
5932
|
+
}
|
5933
|
+
return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);
|
5934
|
+
}
|
5935
|
+
/**
|
5936
|
+
* PBKDF2-HMAC: RFC 2898 key derivation function. Async version.
|
5937
|
+
* @example
|
5938
|
+
* await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 });
|
5939
|
+
*/
|
5940
|
+
async function pbkdf2Async(hash, password, salt, opts) {
|
5941
|
+
const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);
|
5942
|
+
let prfW; // Working copy
|
5943
|
+
const arr = new Uint8Array(4);
|
5944
|
+
const view = (0, utils_ts_1.createView)(arr);
|
5945
|
+
const u = new Uint8Array(PRF.outputLen);
|
5946
|
+
// DK = T1 + T2 + ⋯ + Tdklen/hlen
|
5947
|
+
for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {
|
5948
|
+
// Ti = F(Password, Salt, c, i)
|
5949
|
+
const Ti = DK.subarray(pos, pos + PRF.outputLen);
|
5950
|
+
view.setInt32(0, ti, false);
|
5951
|
+
// F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc
|
5952
|
+
// U1 = PRF(Password, Salt + INT_32_BE(i))
|
5953
|
+
(prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);
|
5954
|
+
Ti.set(u.subarray(0, Ti.length));
|
5955
|
+
await (0, utils_ts_1.asyncLoop)(c - 1, asyncTick, () => {
|
5956
|
+
// Uc = PRF(Password, Uc−1)
|
5957
|
+
PRF._cloneInto(prfW).update(u).digestInto(u);
|
5958
|
+
for (let i = 0; i < Ti.length; i++)
|
5959
|
+
Ti[i] ^= u[i];
|
5960
|
+
});
|
5961
|
+
}
|
5962
|
+
return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);
|
5963
|
+
}
|
5964
|
+
|
5965
|
+
|
5754
5966
|
/***/ }),
|
5755
5967
|
|
5756
5968
|
/***/ "../../node_modules/@noble/hashes/ripemd160.js":
|
@@ -6578,10 +6790,17 @@ function randomBytes(bytesLength = 32) {
|
|
6578
6790
|
|
6579
6791
|
/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
6580
6792
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
6581
|
-
exports.bytes = exports.stringToBytes = exports.str = exports.bytesToString = exports.hex = exports.utf8 = exports.bech32m = exports.bech32 = exports.base58check = exports.createBase58check = exports.base58xmr = exports.base58xrp = exports.base58flickr = exports.base58 = exports.base64urlnopad = exports.base64url = exports.base64nopad = exports.base64 = exports.base32crockford = exports.base32hexnopad = exports.base32hex = exports.base32nopad = exports.base32 = exports.base16 = exports.utils =
|
6793
|
+
exports.bytes = exports.stringToBytes = exports.str = exports.bytesToString = exports.hex = exports.utf8 = exports.bech32m = exports.bech32 = exports.base58check = exports.createBase58check = exports.base58xmr = exports.base58xrp = exports.base58flickr = exports.base58 = exports.base64urlnopad = exports.base64url = exports.base64nopad = exports.base64 = exports.base32crockford = exports.base32hexnopad = exports.base32hex = exports.base32nopad = exports.base32 = exports.base16 = exports.utils = void 0;
|
6582
6794
|
function isBytes(a) {
|
6583
6795
|
return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');
|
6584
6796
|
}
|
6797
|
+
/** Asserts something is Uint8Array. */
|
6798
|
+
function abytes(b, ...lengths) {
|
6799
|
+
if (!isBytes(b))
|
6800
|
+
throw new Error('Uint8Array expected');
|
6801
|
+
if (lengths.length > 0 && !lengths.includes(b.length))
|
6802
|
+
throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);
|
6803
|
+
}
|
6585
6804
|
function isArrayOf(isString, arr) {
|
6586
6805
|
if (!Array.isArray(arr))
|
6587
6806
|
return false;
|
@@ -6609,7 +6828,6 @@ function anumber(n) {
|
|
6609
6828
|
if (!Number.isSafeInteger(n))
|
6610
6829
|
throw new Error(`invalid integer: ${n}`);
|
6611
6830
|
}
|
6612
|
-
exports.assertNumber = anumber;
|
6613
6831
|
function aArr(input) {
|
6614
6832
|
if (!Array.isArray(input))
|
6615
6833
|
throw new Error('array expected');
|
@@ -6906,41 +7124,172 @@ exports.utils = {
|
|
6906
7124
|
// RFC 4648 aka RFC 3548
|
6907
7125
|
// ---------------------
|
6908
7126
|
/**
|
6909
|
-
* base16 encoding.
|
7127
|
+
* base16 encoding from RFC 4648.
|
7128
|
+
* @example
|
7129
|
+
* ```js
|
7130
|
+
* base16.encode(Uint8Array.from([0x12, 0xab]));
|
7131
|
+
* // => '12AB'
|
7132
|
+
* ```
|
6910
7133
|
*/
|
6911
7134
|
exports.base16 = chain(radix2(4), alphabet('0123456789ABCDEF'), join(''));
|
7135
|
+
/**
|
7136
|
+
* base32 encoding from RFC 4648. Has padding.
|
7137
|
+
* Use `base32nopad` for unpadded version.
|
7138
|
+
* Also check out `base32hex`, `base32hexnopad`, `base32crockford`.
|
7139
|
+
* @example
|
7140
|
+
* ```js
|
7141
|
+
* base32.encode(Uint8Array.from([0x12, 0xab]));
|
7142
|
+
* // => 'CKVQ===='
|
7143
|
+
* base32.decode('CKVQ====');
|
7144
|
+
* // => Uint8Array.from([0x12, 0xab])
|
7145
|
+
* ```
|
7146
|
+
*/
|
6912
7147
|
exports.base32 = chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), padding(5), join(''));
|
7148
|
+
/**
|
7149
|
+
* base32 encoding from RFC 4648. No padding.
|
7150
|
+
* Use `base32` for padded version.
|
7151
|
+
* Also check out `base32hex`, `base32hexnopad`, `base32crockford`.
|
7152
|
+
* @example
|
7153
|
+
* ```js
|
7154
|
+
* base32nopad.encode(Uint8Array.from([0x12, 0xab]));
|
7155
|
+
* // => 'CKVQ'
|
7156
|
+
* base32nopad.decode('CKVQ');
|
7157
|
+
* // => Uint8Array.from([0x12, 0xab])
|
7158
|
+
* ```
|
7159
|
+
*/
|
6913
7160
|
exports.base32nopad = chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), join(''));
|
7161
|
+
/**
|
7162
|
+
* base32 encoding from RFC 4648. Padded. Compared to ordinary `base32`, slightly different alphabet.
|
7163
|
+
* Use `base32hexnopad` for unpadded version.
|
7164
|
+
* @example
|
7165
|
+
* ```js
|
7166
|
+
* base32hex.encode(Uint8Array.from([0x12, 0xab]));
|
7167
|
+
* // => '2ALG===='
|
7168
|
+
* base32hex.decode('2ALG====');
|
7169
|
+
* // => Uint8Array.from([0x12, 0xab])
|
7170
|
+
* ```
|
7171
|
+
*/
|
6914
7172
|
exports.base32hex = chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), padding(5), join(''));
|
7173
|
+
/**
|
7174
|
+
* base32 encoding from RFC 4648. No padding. Compared to ordinary `base32`, slightly different alphabet.
|
7175
|
+
* Use `base32hex` for padded version.
|
7176
|
+
* @example
|
7177
|
+
* ```js
|
7178
|
+
* base32hexnopad.encode(Uint8Array.from([0x12, 0xab]));
|
7179
|
+
* // => '2ALG'
|
7180
|
+
* base32hexnopad.decode('2ALG');
|
7181
|
+
* // => Uint8Array.from([0x12, 0xab])
|
7182
|
+
* ```
|
7183
|
+
*/
|
6915
7184
|
exports.base32hexnopad = chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), join(''));
|
7185
|
+
/**
|
7186
|
+
* base32 encoding from RFC 4648. Doug Crockford's version.
|
7187
|
+
* https://www.crockford.com/base32.html
|
7188
|
+
* @example
|
7189
|
+
* ```js
|
7190
|
+
* base32crockford.encode(Uint8Array.from([0x12, 0xab]));
|
7191
|
+
* // => '2ANG'
|
7192
|
+
* base32crockford.decode('2ANG');
|
7193
|
+
* // => Uint8Array.from([0x12, 0xab])
|
7194
|
+
* ```
|
7195
|
+
*/
|
6916
7196
|
exports.base32crockford = chain(radix2(5), alphabet('0123456789ABCDEFGHJKMNPQRSTVWXYZ'), join(''), normalize((s) => s.toUpperCase().replace(/O/g, '0').replace(/[IL]/g, '1')));
|
7197
|
+
// Built-in base64 conversion https://caniuse.com/mdn-javascript_builtins_uint8array_frombase64
|
7198
|
+
// prettier-ignore
|
7199
|
+
const hasBase64Builtin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toBase64 === 'function' &&
|
7200
|
+
typeof Uint8Array.fromBase64 === 'function')();
|
7201
|
+
const decodeBase64Builtin = (s, isUrl) => {
|
7202
|
+
astr('base64', s);
|
7203
|
+
const re = isUrl ? /^[A-Za-z0-9=_-]+$/ : /^[A-Za-z0-9=+/]+$/;
|
7204
|
+
const alphabet = isUrl ? 'base64url' : 'base64';
|
7205
|
+
if (s.length > 0 && !re.test(s))
|
7206
|
+
throw new Error('invalid base64');
|
7207
|
+
return Uint8Array.fromBase64(s, { alphabet, lastChunkHandling: 'strict' });
|
7208
|
+
};
|
6917
7209
|
/**
|
6918
|
-
* base64
|
7210
|
+
* base64 from RFC 4648. Padded.
|
7211
|
+
* Use `base64nopad` for unpadded version.
|
7212
|
+
* Also check out `base64url`, `base64urlnopad`.
|
7213
|
+
* Falls back to built-in function, when available.
|
6919
7214
|
* @example
|
6920
|
-
*
|
6921
|
-
* base64.encode(
|
7215
|
+
* ```js
|
7216
|
+
* base64.encode(Uint8Array.from([0x12, 0xab]));
|
7217
|
+
* // => 'Eqs='
|
7218
|
+
* base64.decode('Eqs=');
|
7219
|
+
* // => Uint8Array.from([0x12, 0xab])
|
7220
|
+
* ```
|
6922
7221
|
*/
|
6923
|
-
|
7222
|
+
// prettier-ignore
|
7223
|
+
exports.base64 = hasBase64Builtin ? {
|
7224
|
+
encode(b) { abytes(b); return b.toBase64(); },
|
7225
|
+
decode(s) { return decodeBase64Builtin(s, false); },
|
7226
|
+
} : chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), padding(6), join(''));
|
6924
7227
|
/**
|
6925
|
-
* base64
|
7228
|
+
* base64 from RFC 4648. No padding.
|
7229
|
+
* Use `base64` for padded version.
|
7230
|
+
* @example
|
7231
|
+
* ```js
|
7232
|
+
* base64nopad.encode(Uint8Array.from([0x12, 0xab]));
|
7233
|
+
* // => 'Eqs'
|
7234
|
+
* base64nopad.decode('Eqs');
|
7235
|
+
* // => Uint8Array.from([0x12, 0xab])
|
7236
|
+
* ```
|
6926
7237
|
*/
|
6927
7238
|
exports.base64nopad = chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), join(''));
|
6928
|
-
|
7239
|
+
/**
|
7240
|
+
* base64 from RFC 4648, using URL-safe alphabet. Padded.
|
7241
|
+
* Use `base64urlnopad` for unpadded version.
|
7242
|
+
* Falls back to built-in function, when available.
|
7243
|
+
* @example
|
7244
|
+
* ```js
|
7245
|
+
* base64url.encode(Uint8Array.from([0x12, 0xab]));
|
7246
|
+
* // => 'Eqs='
|
7247
|
+
* base64url.decode('Eqs=');
|
7248
|
+
* // => Uint8Array.from([0x12, 0xab])
|
7249
|
+
* ```
|
7250
|
+
*/
|
7251
|
+
// prettier-ignore
|
7252
|
+
exports.base64url = hasBase64Builtin ? {
|
7253
|
+
encode(b) { abytes(b); return b.toBase64({ alphabet: 'base64url' }); },
|
7254
|
+
decode(s) { return decodeBase64Builtin(s, true); },
|
7255
|
+
} : chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), padding(6), join(''));
|
7256
|
+
/**
|
7257
|
+
* base64 from RFC 4648, using URL-safe alphabet. No padding.
|
7258
|
+
* Use `base64url` for padded version.
|
7259
|
+
* @example
|
7260
|
+
* ```js
|
7261
|
+
* base64urlnopad.encode(Uint8Array.from([0x12, 0xab]));
|
7262
|
+
* // => 'Eqs'
|
7263
|
+
* base64urlnopad.decode('Eqs');
|
7264
|
+
* // => Uint8Array.from([0x12, 0xab])
|
7265
|
+
* ```
|
7266
|
+
*/
|
6929
7267
|
exports.base64urlnopad = chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), join(''));
|
6930
7268
|
// base58 code
|
6931
7269
|
// -----------
|
6932
7270
|
const genBase58 = /* @__NO_SIDE_EFFECTS__ */ (abc) => chain(radix(58), alphabet(abc), join(''));
|
6933
7271
|
/**
|
6934
|
-
*
|
7272
|
+
* base58: base64 without ambigous characters +, /, 0, O, I, l.
|
6935
7273
|
* Quadratic (O(n^2)) - so, can't be used on large inputs.
|
7274
|
+
* @example
|
7275
|
+
* ```js
|
7276
|
+
* base58.decode('01abcdef');
|
7277
|
+
* // => '3UhJW'
|
7278
|
+
* ```
|
6936
7279
|
*/
|
6937
7280
|
exports.base58 = genBase58('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz');
|
7281
|
+
/**
|
7282
|
+
* base58: flickr version. Check out `base58`.
|
7283
|
+
*/
|
6938
7284
|
exports.base58flickr = genBase58('123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ');
|
7285
|
+
/**
|
7286
|
+
* base58: XRP version. Check out `base58`.
|
7287
|
+
*/
|
6939
7288
|
exports.base58xrp = genBase58('rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz');
|
6940
7289
|
// Data len (index) -> encoded block len
|
6941
7290
|
const XMR_BLOCK_LEN = [0, 2, 3, 5, 6, 7, 9, 10, 11];
|
6942
7291
|
/**
|
6943
|
-
* XMR version
|
7292
|
+
* base58: XMR version. Check out `base58`.
|
6944
7293
|
* Done in 8-byte blocks (which equals 11 chars in decoding). Last (non-full) block padded with '1' to size in XMR_BLOCK_LEN.
|
6945
7294
|
* Block encoding significantly reduces quadratic complexity of base58.
|
6946
7295
|
*/
|
@@ -6968,6 +7317,10 @@ exports.base58xmr = {
|
|
6968
7317
|
return Uint8Array.from(res);
|
6969
7318
|
},
|
6970
7319
|
};
|
7320
|
+
/**
|
7321
|
+
* Method, which creates base58check encoder.
|
7322
|
+
* Requires function, calculating sha256.
|
7323
|
+
*/
|
6971
7324
|
const createBase58check = (sha256) => chain(checksum(4, (data) => sha256(sha256(data))), exports.base58);
|
6972
7325
|
exports.createBase58check = createBase58check;
|
6973
7326
|
/**
|
@@ -7071,36 +7424,60 @@ function genBech32(encoding) {
|
|
7071
7424
|
};
|
7072
7425
|
}
|
7073
7426
|
/**
|
7074
|
-
*
|
7427
|
+
* bech32 from BIP 173. Operates on words.
|
7428
|
+
* For high-level, check out scure-btc-signer:
|
7429
|
+
* https://github.com/paulmillr/scure-btc-signer.
|
7075
7430
|
*/
|
7076
7431
|
exports.bech32 = genBech32('bech32');
|
7432
|
+
/**
|
7433
|
+
* bech32m from BIP 350. Operates on words.
|
7434
|
+
* It was to mitigate `bech32` weaknesses.
|
7435
|
+
* For high-level, check out scure-btc-signer:
|
7436
|
+
* https://github.com/paulmillr/scure-btc-signer.
|
7437
|
+
*/
|
7077
7438
|
exports.bech32m = genBech32('bech32m');
|
7078
7439
|
/**
|
7079
7440
|
* UTF-8-to-byte decoder. Uses built-in TextDecoder / TextEncoder.
|
7080
7441
|
* @example
|
7442
|
+
* ```js
|
7081
7443
|
* const b = utf8.decode("hey"); // => new Uint8Array([ 104, 101, 121 ])
|
7082
7444
|
* const str = utf8.encode(b); // "hey"
|
7445
|
+
* ```
|
7083
7446
|
*/
|
7084
7447
|
exports.utf8 = {
|
7085
7448
|
encode: (data) => new TextDecoder().decode(data),
|
7086
7449
|
decode: (str) => new TextEncoder().encode(str),
|
7087
7450
|
};
|
7451
|
+
// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex
|
7452
|
+
// prettier-ignore
|
7453
|
+
const hasHexBuiltin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toHex === 'function' &&
|
7454
|
+
typeof Uint8Array.fromHex === 'function')();
|
7455
|
+
// prettier-ignore
|
7456
|
+
const hexBuiltin = {
|
7457
|
+
encode(data) { abytes(data); return data.toHex(); },
|
7458
|
+
decode(s) { astr('hex', s); return Uint8Array.fromHex(s); },
|
7459
|
+
};
|
7088
7460
|
/**
|
7089
|
-
* hex string decoder.
|
7461
|
+
* hex string decoder. Uses built-in function, when available.
|
7090
7462
|
* @example
|
7463
|
+
* ```js
|
7091
7464
|
* const b = hex.decode("0102ff"); // => new Uint8Array([ 1, 2, 255 ])
|
7092
7465
|
* const str = hex.encode(b); // "0102ff"
|
7466
|
+
* ```
|
7093
7467
|
*/
|
7094
|
-
exports.hex =
|
7095
|
-
|
7096
|
-
|
7097
|
-
|
7098
|
-
})
|
7468
|
+
exports.hex = hasHexBuiltin
|
7469
|
+
? hexBuiltin
|
7470
|
+
: chain(radix2(4), alphabet('0123456789abcdef'), join(''), normalize((s) => {
|
7471
|
+
if (typeof s !== 'string' || s.length % 2 !== 0)
|
7472
|
+
throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`);
|
7473
|
+
return s.toLowerCase();
|
7474
|
+
}));
|
7099
7475
|
// prettier-ignore
|
7100
7476
|
const CODERS = {
|
7101
7477
|
utf8: exports.utf8, hex: exports.hex, base16: exports.base16, base32: exports.base32, base64: exports.base64, base64url: exports.base64url, base58: exports.base58, base58xmr: exports.base58xmr
|
7102
7478
|
};
|
7103
7479
|
const coderTypeError = 'Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr';
|
7480
|
+
/** @deprecated */
|
7104
7481
|
const bytesToString = (type, bytes) => {
|
7105
7482
|
if (typeof type !== 'string' || !CODERS.hasOwnProperty(type))
|
7106
7483
|
throw new TypeError(coderTypeError);
|
@@ -7109,7 +7486,9 @@ const bytesToString = (type, bytes) => {
|
|
7109
7486
|
return CODERS[type].encode(bytes);
|
7110
7487
|
};
|
7111
7488
|
exports.bytesToString = bytesToString;
|
7489
|
+
/** @deprecated */
|
7112
7490
|
exports.str = exports.bytesToString; // as in python, but for bytes only
|
7491
|
+
/** @deprecated */
|
7113
7492
|
const stringToBytes = (type, str) => {
|
7114
7493
|
if (!CODERS.hasOwnProperty(type))
|
7115
7494
|
throw new TypeError(coderTypeError);
|
@@ -7118,6 +7497,7 @@ const stringToBytes = (type, str) => {
|
|
7118
7497
|
return CODERS[type].decode(str);
|
7119
7498
|
};
|
7120
7499
|
exports.stringToBytes = stringToBytes;
|
7500
|
+
/** @deprecated */
|
7121
7501
|
exports.bytes = exports.stringToBytes;
|
7122
7502
|
|
7123
7503
|
|
@@ -8664,11 +9044,9 @@ exports.validateMnemonic = validateMnemonic;
|
|
8664
9044
|
exports.mnemonicToSeed = mnemonicToSeed;
|
8665
9045
|
exports.mnemonicToSeedSync = mnemonicToSeedSync;
|
8666
9046
|
/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */
|
8667
|
-
const
|
8668
|
-
const
|
8669
|
-
const
|
8670
|
-
const sha512_1 = __webpack_require__(/*! @noble/hashes/sha512 */ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/sha512.js");
|
8671
|
-
const utils_1 = __webpack_require__(/*! @noble/hashes/utils */ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/utils.js");
|
9047
|
+
const pbkdf2_1 = __webpack_require__(/*! @noble/hashes/pbkdf2 */ "../../node_modules/@noble/hashes/pbkdf2.js");
|
9048
|
+
const sha2_1 = __webpack_require__(/*! @noble/hashes/sha2 */ "../../node_modules/@noble/hashes/sha2.js");
|
9049
|
+
const utils_1 = __webpack_require__(/*! @noble/hashes/utils */ "../../node_modules/@noble/hashes/utils.js");
|
8672
9050
|
const base_1 = __webpack_require__(/*! @scure/base */ "../../node_modules/@scure/base/lib/index.js");
|
8673
9051
|
// Japanese wordlist
|
8674
9052
|
const isJapanese = (wordlist) => wordlist[0] === '\u3042\u3044\u3053\u304f\u3057\u3093';
|
@@ -8689,7 +9067,7 @@ function normalize(str) {
|
|
8689
9067
|
return { nfkd: norm, words };
|
8690
9068
|
}
|
8691
9069
|
function aentropy(ent) {
|
8692
|
-
(0,
|
9070
|
+
(0, utils_1.abytes)(ent, 16, 20, 24, 28, 32);
|
8693
9071
|
}
|
8694
9072
|
/**
|
8695
9073
|
* Generate x random words. Uses Cryptographically-Secure Random Number Generator.
|
@@ -8700,7 +9078,7 @@ function aentropy(ent) {
|
|
8700
9078
|
* // 'legal winner thank year wave sausage worth useful legal winner thank yellow'
|
8701
9079
|
*/
|
8702
9080
|
function generateMnemonic(wordlist, strength = 128) {
|
8703
|
-
(0,
|
9081
|
+
(0, utils_1.anumber)(strength);
|
8704
9082
|
if (strength % 32 !== 0 || strength > 256)
|
8705
9083
|
throw new TypeError('Invalid entropy');
|
8706
9084
|
return entropyToMnemonic((0, utils_1.randomBytes)(strength / 8), wordlist);
|
@@ -8710,7 +9088,7 @@ const calcChecksum = (entropy) => {
|
|
8710
9088
|
const bitsLeft = 8 - entropy.length / 4;
|
8711
9089
|
// Zero rightmost "bitsLeft" bits in byte
|
8712
9090
|
// For example: bitsLeft=4 val=10111101 -> 10110000
|
8713
|
-
return new Uint8Array([((0,
|
9091
|
+
return new Uint8Array([((0, sha2_1.sha256)(entropy)[0] >> bitsLeft) << bitsLeft]);
|
8714
9092
|
};
|
8715
9093
|
function getCoder(wordlist) {
|
8716
9094
|
if (!Array.isArray(wordlist) || wordlist.length !== 2048 || typeof wordlist[0] !== 'string')
|
@@ -8759,1229 +9137,43 @@ function entropyToMnemonic(entropy, wordlist) {
|
|
8759
9137
|
return words.join(isJapanese(wordlist) ? '\u3000' : ' ');
|
8760
9138
|
}
|
8761
9139
|
/**
|
8762
|
-
* Validates mnemonic for being 12-24 words contained in `wordlist`.
|
8763
|
-
*/
|
8764
|
-
function validateMnemonic(mnemonic, wordlist) {
|
8765
|
-
try {
|
8766
|
-
mnemonicToEntropy(mnemonic, wordlist);
|
8767
|
-
}
|
8768
|
-
catch (e) {
|
8769
|
-
return false;
|
8770
|
-
}
|
8771
|
-
return true;
|
8772
|
-
}
|
8773
|
-
const psalt = (passphrase) => nfkd('mnemonic' + passphrase);
|
8774
|
-
/**
|
8775
|
-
* Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password.
|
8776
|
-
* @param mnemonic 12-24 words
|
8777
|
-
* @param passphrase string that will additionally protect the key
|
8778
|
-
* @returns 64 bytes of key data
|
8779
|
-
* @example
|
8780
|
-
* const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow';
|
8781
|
-
* await mnemonicToSeed(mnem, 'password');
|
8782
|
-
* // new Uint8Array([...64 bytes])
|
8783
|
-
*/
|
8784
|
-
function mnemonicToSeed(mnemonic, passphrase = '') {
|
8785
|
-
return (0, pbkdf2_1.pbkdf2Async)(sha512_1.sha512, normalize(mnemonic).nfkd, psalt(passphrase), { c: 2048, dkLen: 64 });
|
8786
|
-
}
|
8787
|
-
/**
|
8788
|
-
* Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password.
|
8789
|
-
* @param mnemonic 12-24 words
|
8790
|
-
* @param passphrase string that will additionally protect the key
|
8791
|
-
* @returns 64 bytes of key data
|
8792
|
-
* @example
|
8793
|
-
* const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow';
|
8794
|
-
* mnemonicToSeedSync(mnem, 'password');
|
8795
|
-
* // new Uint8Array([...64 bytes])
|
8796
|
-
*/
|
8797
|
-
function mnemonicToSeedSync(mnemonic, passphrase = '') {
|
8798
|
-
return (0, pbkdf2_1.pbkdf2)(sha512_1.sha512, normalize(mnemonic).nfkd, psalt(passphrase), { c: 2048, dkLen: 64 });
|
8799
|
-
}
|
8800
|
-
|
8801
|
-
|
8802
|
-
/***/ }),
|
8803
|
-
|
8804
|
-
/***/ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/_assert.js":
|
8805
|
-
/*!*****************************************************************************!*\
|
8806
|
-
!*** ../../node_modules/@scure/bip39/node_modules/@noble/hashes/_assert.js ***!
|
8807
|
-
\*****************************************************************************/
|
8808
|
-
/***/ ((__unused_webpack_module, exports) => {
|
8809
|
-
|
8810
|
-
"use strict";
|
8811
|
-
|
8812
|
-
/**
|
8813
|
-
* Internal assertion helpers.
|
8814
|
-
* @module
|
8815
|
-
*/
|
8816
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
8817
|
-
exports.anumber = anumber;
|
8818
|
-
exports.abytes = abytes;
|
8819
|
-
exports.ahash = ahash;
|
8820
|
-
exports.aexists = aexists;
|
8821
|
-
exports.aoutput = aoutput;
|
8822
|
-
/** Asserts something is positive integer. */
|
8823
|
-
function anumber(n) {
|
8824
|
-
if (!Number.isSafeInteger(n) || n < 0)
|
8825
|
-
throw new Error('positive integer expected, got ' + n);
|
8826
|
-
}
|
8827
|
-
/** Is number an Uint8Array? Copied from utils for perf. */
|
8828
|
-
function isBytes(a) {
|
8829
|
-
return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');
|
8830
|
-
}
|
8831
|
-
/** Asserts something is Uint8Array. */
|
8832
|
-
function abytes(b, ...lengths) {
|
8833
|
-
if (!isBytes(b))
|
8834
|
-
throw new Error('Uint8Array expected');
|
8835
|
-
if (lengths.length > 0 && !lengths.includes(b.length))
|
8836
|
-
throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);
|
8837
|
-
}
|
8838
|
-
/** Asserts something is hash */
|
8839
|
-
function ahash(h) {
|
8840
|
-
if (typeof h !== 'function' || typeof h.create !== 'function')
|
8841
|
-
throw new Error('Hash should be wrapped by utils.wrapConstructor');
|
8842
|
-
anumber(h.outputLen);
|
8843
|
-
anumber(h.blockLen);
|
8844
|
-
}
|
8845
|
-
/** Asserts a hash instance has not been destroyed / finished */
|
8846
|
-
function aexists(instance, checkFinished = true) {
|
8847
|
-
if (instance.destroyed)
|
8848
|
-
throw new Error('Hash instance has been destroyed');
|
8849
|
-
if (checkFinished && instance.finished)
|
8850
|
-
throw new Error('Hash#digest() has already been called');
|
8851
|
-
}
|
8852
|
-
/** Asserts output is properly-sized byte array */
|
8853
|
-
function aoutput(out, instance) {
|
8854
|
-
abytes(out);
|
8855
|
-
const min = instance.outputLen;
|
8856
|
-
if (out.length < min) {
|
8857
|
-
throw new Error('digestInto() expects output buffer of length at least ' + min);
|
8858
|
-
}
|
8859
|
-
}
|
8860
|
-
|
8861
|
-
|
8862
|
-
/***/ }),
|
8863
|
-
|
8864
|
-
/***/ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/_md.js":
|
8865
|
-
/*!*************************************************************************!*\
|
8866
|
-
!*** ../../node_modules/@scure/bip39/node_modules/@noble/hashes/_md.js ***!
|
8867
|
-
\*************************************************************************/
|
8868
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
8869
|
-
|
8870
|
-
"use strict";
|
8871
|
-
|
8872
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
8873
|
-
exports.HashMD = void 0;
|
8874
|
-
exports.setBigUint64 = setBigUint64;
|
8875
|
-
exports.Chi = Chi;
|
8876
|
-
exports.Maj = Maj;
|
8877
|
-
/**
|
8878
|
-
* Internal Merkle-Damgard hash utils.
|
8879
|
-
* @module
|
8880
|
-
*/
|
8881
|
-
const _assert_ts_1 = __webpack_require__(/*! ./_assert.js */ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/_assert.js");
|
8882
|
-
const utils_ts_1 = __webpack_require__(/*! ./utils.js */ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/utils.js");
|
8883
|
-
/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */
|
8884
|
-
function setBigUint64(view, byteOffset, value, isLE) {
|
8885
|
-
if (typeof view.setBigUint64 === 'function')
|
8886
|
-
return view.setBigUint64(byteOffset, value, isLE);
|
8887
|
-
const _32n = BigInt(32);
|
8888
|
-
const _u32_max = BigInt(0xffffffff);
|
8889
|
-
const wh = Number((value >> _32n) & _u32_max);
|
8890
|
-
const wl = Number(value & _u32_max);
|
8891
|
-
const h = isLE ? 4 : 0;
|
8892
|
-
const l = isLE ? 0 : 4;
|
8893
|
-
view.setUint32(byteOffset + h, wh, isLE);
|
8894
|
-
view.setUint32(byteOffset + l, wl, isLE);
|
8895
|
-
}
|
8896
|
-
/** Choice: a ? b : c */
|
8897
|
-
function Chi(a, b, c) {
|
8898
|
-
return (a & b) ^ (~a & c);
|
8899
|
-
}
|
8900
|
-
/** Majority function, true if any two inputs is true. */
|
8901
|
-
function Maj(a, b, c) {
|
8902
|
-
return (a & b) ^ (a & c) ^ (b & c);
|
8903
|
-
}
|
8904
|
-
/**
|
8905
|
-
* Merkle-Damgard hash construction base class.
|
8906
|
-
* Could be used to create MD5, RIPEMD, SHA1, SHA2.
|
8907
|
-
*/
|
8908
|
-
class HashMD extends utils_ts_1.Hash {
|
8909
|
-
constructor(blockLen, outputLen, padOffset, isLE) {
|
8910
|
-
super();
|
8911
|
-
this.finished = false;
|
8912
|
-
this.length = 0;
|
8913
|
-
this.pos = 0;
|
8914
|
-
this.destroyed = false;
|
8915
|
-
this.blockLen = blockLen;
|
8916
|
-
this.outputLen = outputLen;
|
8917
|
-
this.padOffset = padOffset;
|
8918
|
-
this.isLE = isLE;
|
8919
|
-
this.buffer = new Uint8Array(blockLen);
|
8920
|
-
this.view = (0, utils_ts_1.createView)(this.buffer);
|
8921
|
-
}
|
8922
|
-
update(data) {
|
8923
|
-
(0, _assert_ts_1.aexists)(this);
|
8924
|
-
const { view, buffer, blockLen } = this;
|
8925
|
-
data = (0, utils_ts_1.toBytes)(data);
|
8926
|
-
const len = data.length;
|
8927
|
-
for (let pos = 0; pos < len;) {
|
8928
|
-
const take = Math.min(blockLen - this.pos, len - pos);
|
8929
|
-
// Fast path: we have at least one block in input, cast it to view and process
|
8930
|
-
if (take === blockLen) {
|
8931
|
-
const dataView = (0, utils_ts_1.createView)(data);
|
8932
|
-
for (; blockLen <= len - pos; pos += blockLen)
|
8933
|
-
this.process(dataView, pos);
|
8934
|
-
continue;
|
8935
|
-
}
|
8936
|
-
buffer.set(data.subarray(pos, pos + take), this.pos);
|
8937
|
-
this.pos += take;
|
8938
|
-
pos += take;
|
8939
|
-
if (this.pos === blockLen) {
|
8940
|
-
this.process(view, 0);
|
8941
|
-
this.pos = 0;
|
8942
|
-
}
|
8943
|
-
}
|
8944
|
-
this.length += data.length;
|
8945
|
-
this.roundClean();
|
8946
|
-
return this;
|
8947
|
-
}
|
8948
|
-
digestInto(out) {
|
8949
|
-
(0, _assert_ts_1.aexists)(this);
|
8950
|
-
(0, _assert_ts_1.aoutput)(out, this);
|
8951
|
-
this.finished = true;
|
8952
|
-
// Padding
|
8953
|
-
// We can avoid allocation of buffer for padding completely if it
|
8954
|
-
// was previously not allocated here. But it won't change performance.
|
8955
|
-
const { buffer, view, blockLen, isLE } = this;
|
8956
|
-
let { pos } = this;
|
8957
|
-
// append the bit '1' to the message
|
8958
|
-
buffer[pos++] = 0b10000000;
|
8959
|
-
this.buffer.subarray(pos).fill(0);
|
8960
|
-
// we have less than padOffset left in buffer, so we cannot put length in
|
8961
|
-
// current block, need process it and pad again
|
8962
|
-
if (this.padOffset > blockLen - pos) {
|
8963
|
-
this.process(view, 0);
|
8964
|
-
pos = 0;
|
8965
|
-
}
|
8966
|
-
// Pad until full block byte with zeros
|
8967
|
-
for (let i = pos; i < blockLen; i++)
|
8968
|
-
buffer[i] = 0;
|
8969
|
-
// Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that
|
8970
|
-
// You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.
|
8971
|
-
// So we just write lowest 64 bits of that value.
|
8972
|
-
setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);
|
8973
|
-
this.process(view, 0);
|
8974
|
-
const oview = (0, utils_ts_1.createView)(out);
|
8975
|
-
const len = this.outputLen;
|
8976
|
-
// NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT
|
8977
|
-
if (len % 4)
|
8978
|
-
throw new Error('_sha2: outputLen should be aligned to 32bit');
|
8979
|
-
const outLen = len / 4;
|
8980
|
-
const state = this.get();
|
8981
|
-
if (outLen > state.length)
|
8982
|
-
throw new Error('_sha2: outputLen bigger than state');
|
8983
|
-
for (let i = 0; i < outLen; i++)
|
8984
|
-
oview.setUint32(4 * i, state[i], isLE);
|
8985
|
-
}
|
8986
|
-
digest() {
|
8987
|
-
const { buffer, outputLen } = this;
|
8988
|
-
this.digestInto(buffer);
|
8989
|
-
const res = buffer.slice(0, outputLen);
|
8990
|
-
this.destroy();
|
8991
|
-
return res;
|
8992
|
-
}
|
8993
|
-
_cloneInto(to) {
|
8994
|
-
to || (to = new this.constructor());
|
8995
|
-
to.set(...this.get());
|
8996
|
-
const { blockLen, buffer, length, finished, destroyed, pos } = this;
|
8997
|
-
to.length = length;
|
8998
|
-
to.pos = pos;
|
8999
|
-
to.finished = finished;
|
9000
|
-
to.destroyed = destroyed;
|
9001
|
-
if (length % blockLen)
|
9002
|
-
to.buffer.set(buffer);
|
9003
|
-
return to;
|
9004
|
-
}
|
9005
|
-
}
|
9006
|
-
exports.HashMD = HashMD;
|
9007
|
-
|
9008
|
-
|
9009
|
-
/***/ }),
|
9010
|
-
|
9011
|
-
/***/ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/_u64.js":
|
9012
|
-
/*!**************************************************************************!*\
|
9013
|
-
!*** ../../node_modules/@scure/bip39/node_modules/@noble/hashes/_u64.js ***!
|
9014
|
-
\**************************************************************************/
|
9015
|
-
/***/ ((__unused_webpack_module, exports) => {
|
9016
|
-
|
9017
|
-
"use strict";
|
9018
|
-
|
9019
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
9020
|
-
exports.add5L = exports.add5H = exports.add4H = exports.add4L = exports.add3H = exports.add3L = exports.rotlBL = exports.rotlBH = exports.rotlSL = exports.rotlSH = exports.rotr32L = exports.rotr32H = exports.rotrBL = exports.rotrBH = exports.rotrSL = exports.rotrSH = exports.shrSL = exports.shrSH = exports.toBig = void 0;
|
9021
|
-
exports.fromBig = fromBig;
|
9022
|
-
exports.split = split;
|
9023
|
-
exports.add = add;
|
9024
|
-
/**
|
9025
|
-
* Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array.
|
9026
|
-
* @todo re-check https://issues.chromium.org/issues/42212588
|
9027
|
-
* @module
|
9028
|
-
*/
|
9029
|
-
const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
9030
|
-
const _32n = /* @__PURE__ */ BigInt(32);
|
9031
|
-
function fromBig(n, le = false) {
|
9032
|
-
if (le)
|
9033
|
-
return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };
|
9034
|
-
return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
|
9035
|
-
}
|
9036
|
-
function split(lst, le = false) {
|
9037
|
-
let Ah = new Uint32Array(lst.length);
|
9038
|
-
let Al = new Uint32Array(lst.length);
|
9039
|
-
for (let i = 0; i < lst.length; i++) {
|
9040
|
-
const { h, l } = fromBig(lst[i], le);
|
9041
|
-
[Ah[i], Al[i]] = [h, l];
|
9042
|
-
}
|
9043
|
-
return [Ah, Al];
|
9044
|
-
}
|
9045
|
-
const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);
|
9046
|
-
exports.toBig = toBig;
|
9047
|
-
// for Shift in [0, 32)
|
9048
|
-
const shrSH = (h, _l, s) => h >>> s;
|
9049
|
-
exports.shrSH = shrSH;
|
9050
|
-
const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);
|
9051
|
-
exports.shrSL = shrSL;
|
9052
|
-
// Right rotate for Shift in [1, 32)
|
9053
|
-
const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));
|
9054
|
-
exports.rotrSH = rotrSH;
|
9055
|
-
const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);
|
9056
|
-
exports.rotrSL = rotrSL;
|
9057
|
-
// Right rotate for Shift in (32, 64), NOTE: 32 is special case.
|
9058
|
-
const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));
|
9059
|
-
exports.rotrBH = rotrBH;
|
9060
|
-
const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));
|
9061
|
-
exports.rotrBL = rotrBL;
|
9062
|
-
// Right rotate for shift===32 (just swaps l&h)
|
9063
|
-
const rotr32H = (_h, l) => l;
|
9064
|
-
exports.rotr32H = rotr32H;
|
9065
|
-
const rotr32L = (h, _l) => h;
|
9066
|
-
exports.rotr32L = rotr32L;
|
9067
|
-
// Left rotate for Shift in [1, 32)
|
9068
|
-
const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));
|
9069
|
-
exports.rotlSH = rotlSH;
|
9070
|
-
const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));
|
9071
|
-
exports.rotlSL = rotlSL;
|
9072
|
-
// Left rotate for Shift in (32, 64), NOTE: 32 is special case.
|
9073
|
-
const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));
|
9074
|
-
exports.rotlBH = rotlBH;
|
9075
|
-
const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));
|
9076
|
-
exports.rotlBL = rotlBL;
|
9077
|
-
// JS uses 32-bit signed integers for bitwise operations which means we cannot
|
9078
|
-
// simple take carry out of low bit sum by shift, we need to use division.
|
9079
|
-
function add(Ah, Al, Bh, Bl) {
|
9080
|
-
const l = (Al >>> 0) + (Bl >>> 0);
|
9081
|
-
return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };
|
9082
|
-
}
|
9083
|
-
// Addition with more than 2 elements
|
9084
|
-
const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
|
9085
|
-
exports.add3L = add3L;
|
9086
|
-
const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;
|
9087
|
-
exports.add3H = add3H;
|
9088
|
-
const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
|
9089
|
-
exports.add4L = add4L;
|
9090
|
-
const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;
|
9091
|
-
exports.add4H = add4H;
|
9092
|
-
const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
|
9093
|
-
exports.add5L = add5L;
|
9094
|
-
const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;
|
9095
|
-
exports.add5H = add5H;
|
9096
|
-
// prettier-ignore
|
9097
|
-
const u64 = {
|
9098
|
-
fromBig, split, toBig,
|
9099
|
-
shrSH, shrSL,
|
9100
|
-
rotrSH, rotrSL, rotrBH, rotrBL,
|
9101
|
-
rotr32H, rotr32L,
|
9102
|
-
rotlSH, rotlSL, rotlBH, rotlBL,
|
9103
|
-
add, add3L, add3H, add4L, add4H, add5H, add5L,
|
9104
|
-
};
|
9105
|
-
exports["default"] = u64;
|
9106
|
-
|
9107
|
-
|
9108
|
-
/***/ }),
|
9109
|
-
|
9110
|
-
/***/ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/crypto.js":
|
9111
|
-
/*!****************************************************************************!*\
|
9112
|
-
!*** ../../node_modules/@scure/bip39/node_modules/@noble/hashes/crypto.js ***!
|
9113
|
-
\****************************************************************************/
|
9114
|
-
/***/ ((__unused_webpack_module, exports) => {
|
9115
|
-
|
9116
|
-
"use strict";
|
9117
|
-
|
9118
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
9119
|
-
exports.crypto = void 0;
|
9120
|
-
exports.crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;
|
9121
|
-
|
9122
|
-
|
9123
|
-
/***/ }),
|
9124
|
-
|
9125
|
-
/***/ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/hmac.js":
|
9126
|
-
/*!**************************************************************************!*\
|
9127
|
-
!*** ../../node_modules/@scure/bip39/node_modules/@noble/hashes/hmac.js ***!
|
9128
|
-
\**************************************************************************/
|
9129
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
9130
|
-
|
9131
|
-
"use strict";
|
9132
|
-
|
9133
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
9134
|
-
exports.hmac = exports.HMAC = void 0;
|
9135
|
-
/**
|
9136
|
-
* HMAC: RFC2104 message authentication code.
|
9137
|
-
* @module
|
9138
|
-
*/
|
9139
|
-
const _assert_ts_1 = __webpack_require__(/*! ./_assert.js */ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/_assert.js");
|
9140
|
-
const utils_ts_1 = __webpack_require__(/*! ./utils.js */ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/utils.js");
|
9141
|
-
class HMAC extends utils_ts_1.Hash {
|
9142
|
-
constructor(hash, _key) {
|
9143
|
-
super();
|
9144
|
-
this.finished = false;
|
9145
|
-
this.destroyed = false;
|
9146
|
-
(0, _assert_ts_1.ahash)(hash);
|
9147
|
-
const key = (0, utils_ts_1.toBytes)(_key);
|
9148
|
-
this.iHash = hash.create();
|
9149
|
-
if (typeof this.iHash.update !== 'function')
|
9150
|
-
throw new Error('Expected instance of class which extends utils.Hash');
|
9151
|
-
this.blockLen = this.iHash.blockLen;
|
9152
|
-
this.outputLen = this.iHash.outputLen;
|
9153
|
-
const blockLen = this.blockLen;
|
9154
|
-
const pad = new Uint8Array(blockLen);
|
9155
|
-
// blockLen can be bigger than outputLen
|
9156
|
-
pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);
|
9157
|
-
for (let i = 0; i < pad.length; i++)
|
9158
|
-
pad[i] ^= 0x36;
|
9159
|
-
this.iHash.update(pad);
|
9160
|
-
// By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone
|
9161
|
-
this.oHash = hash.create();
|
9162
|
-
// Undo internal XOR && apply outer XOR
|
9163
|
-
for (let i = 0; i < pad.length; i++)
|
9164
|
-
pad[i] ^= 0x36 ^ 0x5c;
|
9165
|
-
this.oHash.update(pad);
|
9166
|
-
pad.fill(0);
|
9167
|
-
}
|
9168
|
-
update(buf) {
|
9169
|
-
(0, _assert_ts_1.aexists)(this);
|
9170
|
-
this.iHash.update(buf);
|
9171
|
-
return this;
|
9172
|
-
}
|
9173
|
-
digestInto(out) {
|
9174
|
-
(0, _assert_ts_1.aexists)(this);
|
9175
|
-
(0, _assert_ts_1.abytes)(out, this.outputLen);
|
9176
|
-
this.finished = true;
|
9177
|
-
this.iHash.digestInto(out);
|
9178
|
-
this.oHash.update(out);
|
9179
|
-
this.oHash.digestInto(out);
|
9180
|
-
this.destroy();
|
9181
|
-
}
|
9182
|
-
digest() {
|
9183
|
-
const out = new Uint8Array(this.oHash.outputLen);
|
9184
|
-
this.digestInto(out);
|
9185
|
-
return out;
|
9186
|
-
}
|
9187
|
-
_cloneInto(to) {
|
9188
|
-
// Create new instance without calling constructor since key already in state and we don't know it.
|
9189
|
-
to || (to = Object.create(Object.getPrototypeOf(this), {}));
|
9190
|
-
const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;
|
9191
|
-
to = to;
|
9192
|
-
to.finished = finished;
|
9193
|
-
to.destroyed = destroyed;
|
9194
|
-
to.blockLen = blockLen;
|
9195
|
-
to.outputLen = outputLen;
|
9196
|
-
to.oHash = oHash._cloneInto(to.oHash);
|
9197
|
-
to.iHash = iHash._cloneInto(to.iHash);
|
9198
|
-
return to;
|
9199
|
-
}
|
9200
|
-
destroy() {
|
9201
|
-
this.destroyed = true;
|
9202
|
-
this.oHash.destroy();
|
9203
|
-
this.iHash.destroy();
|
9204
|
-
}
|
9205
|
-
}
|
9206
|
-
exports.HMAC = HMAC;
|
9207
|
-
/**
|
9208
|
-
* HMAC: RFC2104 message authentication code.
|
9209
|
-
* @param hash - function that would be used e.g. sha256
|
9210
|
-
* @param key - message key
|
9211
|
-
* @param message - message data
|
9212
|
-
* @example
|
9213
|
-
* import { hmac } from '@noble/hashes/hmac';
|
9214
|
-
* import { sha256 } from '@noble/hashes/sha2';
|
9215
|
-
* const mac1 = hmac(sha256, 'key', 'message');
|
9216
|
-
*/
|
9217
|
-
const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest();
|
9218
|
-
exports.hmac = hmac;
|
9219
|
-
exports.hmac.create = (hash, key) => new HMAC(hash, key);
|
9220
|
-
|
9221
|
-
|
9222
|
-
/***/ }),
|
9223
|
-
|
9224
|
-
/***/ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/pbkdf2.js":
|
9225
|
-
/*!****************************************************************************!*\
|
9226
|
-
!*** ../../node_modules/@scure/bip39/node_modules/@noble/hashes/pbkdf2.js ***!
|
9227
|
-
\****************************************************************************/
|
9228
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
9229
|
-
|
9230
|
-
"use strict";
|
9231
|
-
|
9232
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
9233
|
-
exports.pbkdf2 = pbkdf2;
|
9234
|
-
exports.pbkdf2Async = pbkdf2Async;
|
9235
|
-
/**
|
9236
|
-
* PBKDF (RFC 2898). Can be used to create a key from password and salt.
|
9237
|
-
* @module
|
9238
|
-
*/
|
9239
|
-
const _assert_ts_1 = __webpack_require__(/*! ./_assert.js */ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/_assert.js");
|
9240
|
-
const hmac_ts_1 = __webpack_require__(/*! ./hmac.js */ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/hmac.js");
|
9241
|
-
const utils_ts_1 = __webpack_require__(/*! ./utils.js */ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/utils.js");
|
9242
|
-
// Common prologue and epilogue for sync/async functions
|
9243
|
-
function pbkdf2Init(hash, _password, _salt, _opts) {
|
9244
|
-
(0, _assert_ts_1.ahash)(hash);
|
9245
|
-
const opts = (0, utils_ts_1.checkOpts)({ dkLen: 32, asyncTick: 10 }, _opts);
|
9246
|
-
const { c, dkLen, asyncTick } = opts;
|
9247
|
-
(0, _assert_ts_1.anumber)(c);
|
9248
|
-
(0, _assert_ts_1.anumber)(dkLen);
|
9249
|
-
(0, _assert_ts_1.anumber)(asyncTick);
|
9250
|
-
if (c < 1)
|
9251
|
-
throw new Error('PBKDF2: iterations (c) should be >= 1');
|
9252
|
-
const password = (0, utils_ts_1.toBytes)(_password);
|
9253
|
-
const salt = (0, utils_ts_1.toBytes)(_salt);
|
9254
|
-
// DK = PBKDF2(PRF, Password, Salt, c, dkLen);
|
9255
|
-
const DK = new Uint8Array(dkLen);
|
9256
|
-
// U1 = PRF(Password, Salt + INT_32_BE(i))
|
9257
|
-
const PRF = hmac_ts_1.hmac.create(hash, password);
|
9258
|
-
const PRFSalt = PRF._cloneInto().update(salt);
|
9259
|
-
return { c, dkLen, asyncTick, DK, PRF, PRFSalt };
|
9260
|
-
}
|
9261
|
-
function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) {
|
9262
|
-
PRF.destroy();
|
9263
|
-
PRFSalt.destroy();
|
9264
|
-
if (prfW)
|
9265
|
-
prfW.destroy();
|
9266
|
-
u.fill(0);
|
9267
|
-
return DK;
|
9268
|
-
}
|
9269
|
-
/**
|
9270
|
-
* PBKDF2-HMAC: RFC 2898 key derivation function
|
9271
|
-
* @param hash - hash function that would be used e.g. sha256
|
9272
|
-
* @param password - password from which a derived key is generated
|
9273
|
-
* @param salt - cryptographic salt
|
9274
|
-
* @param opts - {c, dkLen} where c is work factor and dkLen is output message size
|
9275
|
-
* @example
|
9276
|
-
* const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: 2 ** 18 });
|
9277
|
-
*/
|
9278
|
-
function pbkdf2(hash, password, salt, opts) {
|
9279
|
-
const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);
|
9280
|
-
let prfW; // Working copy
|
9281
|
-
const arr = new Uint8Array(4);
|
9282
|
-
const view = (0, utils_ts_1.createView)(arr);
|
9283
|
-
const u = new Uint8Array(PRF.outputLen);
|
9284
|
-
// DK = T1 + T2 + ⋯ + Tdklen/hlen
|
9285
|
-
for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {
|
9286
|
-
// Ti = F(Password, Salt, c, i)
|
9287
|
-
const Ti = DK.subarray(pos, pos + PRF.outputLen);
|
9288
|
-
view.setInt32(0, ti, false);
|
9289
|
-
// F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc
|
9290
|
-
// U1 = PRF(Password, Salt + INT_32_BE(i))
|
9291
|
-
(prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);
|
9292
|
-
Ti.set(u.subarray(0, Ti.length));
|
9293
|
-
for (let ui = 1; ui < c; ui++) {
|
9294
|
-
// Uc = PRF(Password, Uc−1)
|
9295
|
-
PRF._cloneInto(prfW).update(u).digestInto(u);
|
9296
|
-
for (let i = 0; i < Ti.length; i++)
|
9297
|
-
Ti[i] ^= u[i];
|
9298
|
-
}
|
9299
|
-
}
|
9300
|
-
return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);
|
9301
|
-
}
|
9302
|
-
/**
|
9303
|
-
* PBKDF2-HMAC: RFC 2898 key derivation function. Async version.
|
9304
|
-
* @example
|
9305
|
-
* await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 });
|
9306
|
-
*/
|
9307
|
-
async function pbkdf2Async(hash, password, salt, opts) {
|
9308
|
-
const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);
|
9309
|
-
let prfW; // Working copy
|
9310
|
-
const arr = new Uint8Array(4);
|
9311
|
-
const view = (0, utils_ts_1.createView)(arr);
|
9312
|
-
const u = new Uint8Array(PRF.outputLen);
|
9313
|
-
// DK = T1 + T2 + ⋯ + Tdklen/hlen
|
9314
|
-
for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {
|
9315
|
-
// Ti = F(Password, Salt, c, i)
|
9316
|
-
const Ti = DK.subarray(pos, pos + PRF.outputLen);
|
9317
|
-
view.setInt32(0, ti, false);
|
9318
|
-
// F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc
|
9319
|
-
// U1 = PRF(Password, Salt + INT_32_BE(i))
|
9320
|
-
(prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);
|
9321
|
-
Ti.set(u.subarray(0, Ti.length));
|
9322
|
-
await (0, utils_ts_1.asyncLoop)(c - 1, asyncTick, () => {
|
9323
|
-
// Uc = PRF(Password, Uc−1)
|
9324
|
-
PRF._cloneInto(prfW).update(u).digestInto(u);
|
9325
|
-
for (let i = 0; i < Ti.length; i++)
|
9326
|
-
Ti[i] ^= u[i];
|
9327
|
-
});
|
9328
|
-
}
|
9329
|
-
return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);
|
9330
|
-
}
|
9331
|
-
|
9332
|
-
|
9333
|
-
/***/ }),
|
9334
|
-
|
9335
|
-
/***/ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/sha256.js":
|
9336
|
-
/*!****************************************************************************!*\
|
9337
|
-
!*** ../../node_modules/@scure/bip39/node_modules/@noble/hashes/sha256.js ***!
|
9338
|
-
\****************************************************************************/
|
9339
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
9340
|
-
|
9341
|
-
"use strict";
|
9342
|
-
|
9343
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
9344
|
-
exports.sha224 = exports.sha256 = exports.SHA256 = void 0;
|
9345
|
-
/**
|
9346
|
-
* SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3.
|
9347
|
-
*
|
9348
|
-
* To break sha256 using birthday attack, attackers need to try 2^128 hashes.
|
9349
|
-
* BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.
|
9350
|
-
*
|
9351
|
-
* Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).
|
9352
|
-
* @module
|
9353
|
-
*/
|
9354
|
-
const _md_ts_1 = __webpack_require__(/*! ./_md.js */ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/_md.js");
|
9355
|
-
const utils_ts_1 = __webpack_require__(/*! ./utils.js */ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/utils.js");
|
9356
|
-
/** Round constants: first 32 bits of fractional parts of the cube roots of the first 64 primes 2..311). */
|
9357
|
-
// prettier-ignore
|
9358
|
-
const SHA256_K = /* @__PURE__ */ new Uint32Array([
|
9359
|
-
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
9360
|
-
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
|
9361
|
-
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
9362
|
-
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
|
9363
|
-
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
|
9364
|
-
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
9365
|
-
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
|
9366
|
-
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
|
9367
|
-
]);
|
9368
|
-
/** Initial state: first 32 bits of fractional parts of the square roots of the first 8 primes 2..19. */
|
9369
|
-
// prettier-ignore
|
9370
|
-
const SHA256_IV = /* @__PURE__ */ new Uint32Array([
|
9371
|
-
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
|
9372
|
-
]);
|
9373
|
-
/**
|
9374
|
-
* Temporary buffer, not used to store anything between runs.
|
9375
|
-
* Named this way because it matches specification.
|
9376
|
-
*/
|
9377
|
-
const SHA256_W = /* @__PURE__ */ new Uint32Array(64);
|
9378
|
-
class SHA256 extends _md_ts_1.HashMD {
|
9379
|
-
constructor(outputLen = 32) {
|
9380
|
-
super(64, outputLen, 8, false);
|
9381
|
-
// We cannot use array here since array allows indexing by variable
|
9382
|
-
// which means optimizer/compiler cannot use registers.
|
9383
|
-
this.A = SHA256_IV[0] | 0;
|
9384
|
-
this.B = SHA256_IV[1] | 0;
|
9385
|
-
this.C = SHA256_IV[2] | 0;
|
9386
|
-
this.D = SHA256_IV[3] | 0;
|
9387
|
-
this.E = SHA256_IV[4] | 0;
|
9388
|
-
this.F = SHA256_IV[5] | 0;
|
9389
|
-
this.G = SHA256_IV[6] | 0;
|
9390
|
-
this.H = SHA256_IV[7] | 0;
|
9391
|
-
}
|
9392
|
-
get() {
|
9393
|
-
const { A, B, C, D, E, F, G, H } = this;
|
9394
|
-
return [A, B, C, D, E, F, G, H];
|
9395
|
-
}
|
9396
|
-
// prettier-ignore
|
9397
|
-
set(A, B, C, D, E, F, G, H) {
|
9398
|
-
this.A = A | 0;
|
9399
|
-
this.B = B | 0;
|
9400
|
-
this.C = C | 0;
|
9401
|
-
this.D = D | 0;
|
9402
|
-
this.E = E | 0;
|
9403
|
-
this.F = F | 0;
|
9404
|
-
this.G = G | 0;
|
9405
|
-
this.H = H | 0;
|
9406
|
-
}
|
9407
|
-
process(view, offset) {
|
9408
|
-
// Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array
|
9409
|
-
for (let i = 0; i < 16; i++, offset += 4)
|
9410
|
-
SHA256_W[i] = view.getUint32(offset, false);
|
9411
|
-
for (let i = 16; i < 64; i++) {
|
9412
|
-
const W15 = SHA256_W[i - 15];
|
9413
|
-
const W2 = SHA256_W[i - 2];
|
9414
|
-
const s0 = (0, utils_ts_1.rotr)(W15, 7) ^ (0, utils_ts_1.rotr)(W15, 18) ^ (W15 >>> 3);
|
9415
|
-
const s1 = (0, utils_ts_1.rotr)(W2, 17) ^ (0, utils_ts_1.rotr)(W2, 19) ^ (W2 >>> 10);
|
9416
|
-
SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;
|
9417
|
-
}
|
9418
|
-
// Compression function main loop, 64 rounds
|
9419
|
-
let { A, B, C, D, E, F, G, H } = this;
|
9420
|
-
for (let i = 0; i < 64; i++) {
|
9421
|
-
const sigma1 = (0, utils_ts_1.rotr)(E, 6) ^ (0, utils_ts_1.rotr)(E, 11) ^ (0, utils_ts_1.rotr)(E, 25);
|
9422
|
-
const T1 = (H + sigma1 + (0, _md_ts_1.Chi)(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;
|
9423
|
-
const sigma0 = (0, utils_ts_1.rotr)(A, 2) ^ (0, utils_ts_1.rotr)(A, 13) ^ (0, utils_ts_1.rotr)(A, 22);
|
9424
|
-
const T2 = (sigma0 + (0, _md_ts_1.Maj)(A, B, C)) | 0;
|
9425
|
-
H = G;
|
9426
|
-
G = F;
|
9427
|
-
F = E;
|
9428
|
-
E = (D + T1) | 0;
|
9429
|
-
D = C;
|
9430
|
-
C = B;
|
9431
|
-
B = A;
|
9432
|
-
A = (T1 + T2) | 0;
|
9433
|
-
}
|
9434
|
-
// Add the compressed chunk to the current hash value
|
9435
|
-
A = (A + this.A) | 0;
|
9436
|
-
B = (B + this.B) | 0;
|
9437
|
-
C = (C + this.C) | 0;
|
9438
|
-
D = (D + this.D) | 0;
|
9439
|
-
E = (E + this.E) | 0;
|
9440
|
-
F = (F + this.F) | 0;
|
9441
|
-
G = (G + this.G) | 0;
|
9442
|
-
H = (H + this.H) | 0;
|
9443
|
-
this.set(A, B, C, D, E, F, G, H);
|
9444
|
-
}
|
9445
|
-
roundClean() {
|
9446
|
-
SHA256_W.fill(0);
|
9447
|
-
}
|
9448
|
-
destroy() {
|
9449
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
9450
|
-
this.buffer.fill(0);
|
9451
|
-
}
|
9452
|
-
}
|
9453
|
-
exports.SHA256 = SHA256;
|
9454
|
-
/**
|
9455
|
-
* Constants taken from https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf.
|
9456
|
-
*/
|
9457
|
-
class SHA224 extends SHA256 {
|
9458
|
-
constructor() {
|
9459
|
-
super(28);
|
9460
|
-
this.A = 0xc1059ed8 | 0;
|
9461
|
-
this.B = 0x367cd507 | 0;
|
9462
|
-
this.C = 0x3070dd17 | 0;
|
9463
|
-
this.D = 0xf70e5939 | 0;
|
9464
|
-
this.E = 0xffc00b31 | 0;
|
9465
|
-
this.F = 0x68581511 | 0;
|
9466
|
-
this.G = 0x64f98fa7 | 0;
|
9467
|
-
this.H = 0xbefa4fa4 | 0;
|
9468
|
-
}
|
9469
|
-
}
|
9470
|
-
/** SHA2-256 hash function */
|
9471
|
-
exports.sha256 = (0, utils_ts_1.wrapConstructor)(() => new SHA256());
|
9472
|
-
/** SHA2-224 hash function */
|
9473
|
-
exports.sha224 = (0, utils_ts_1.wrapConstructor)(() => new SHA224());
|
9474
|
-
|
9475
|
-
|
9476
|
-
/***/ }),
|
9477
|
-
|
9478
|
-
/***/ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/sha512.js":
|
9479
|
-
/*!****************************************************************************!*\
|
9480
|
-
!*** ../../node_modules/@scure/bip39/node_modules/@noble/hashes/sha512.js ***!
|
9481
|
-
\****************************************************************************/
|
9482
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
9483
|
-
|
9484
|
-
"use strict";
|
9485
|
-
|
9486
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
9487
|
-
exports.sha384 = exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.SHA384 = exports.SHA512_256 = exports.SHA512_224 = exports.SHA512 = void 0;
|
9488
|
-
/**
|
9489
|
-
* SHA2-512 a.k.a. sha512 and sha384. It is slower than sha256 in js because u64 operations are slow.
|
9490
|
-
*
|
9491
|
-
* Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and
|
9492
|
-
* [the paper on truncated SHA512/256](https://eprint.iacr.org/2010/548.pdf).
|
9493
|
-
* @module
|
9494
|
-
*/
|
9495
|
-
const _md_ts_1 = __webpack_require__(/*! ./_md.js */ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/_md.js");
|
9496
|
-
const _u64_ts_1 = __webpack_require__(/*! ./_u64.js */ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/_u64.js");
|
9497
|
-
const utils_ts_1 = __webpack_require__(/*! ./utils.js */ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/utils.js");
|
9498
|
-
// Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409):
|
9499
|
-
// prettier-ignore
|
9500
|
-
const [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => _u64_ts_1.default.split([
|
9501
|
-
'0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',
|
9502
|
-
'0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',
|
9503
|
-
'0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',
|
9504
|
-
'0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',
|
9505
|
-
'0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',
|
9506
|
-
'0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',
|
9507
|
-
'0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',
|
9508
|
-
'0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',
|
9509
|
-
'0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',
|
9510
|
-
'0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',
|
9511
|
-
'0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',
|
9512
|
-
'0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',
|
9513
|
-
'0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',
|
9514
|
-
'0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',
|
9515
|
-
'0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',
|
9516
|
-
'0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',
|
9517
|
-
'0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',
|
9518
|
-
'0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',
|
9519
|
-
'0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',
|
9520
|
-
'0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'
|
9521
|
-
].map(n => BigInt(n))))();
|
9522
|
-
// Temporary buffer, not used to store anything between runs
|
9523
|
-
const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);
|
9524
|
-
const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);
|
9525
|
-
class SHA512 extends _md_ts_1.HashMD {
|
9526
|
-
constructor(outputLen = 64) {
|
9527
|
-
super(128, outputLen, 16, false);
|
9528
|
-
// We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers.
|
9529
|
-
// Also looks cleaner and easier to verify with spec.
|
9530
|
-
// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):
|
9531
|
-
// h -- high 32 bits, l -- low 32 bits
|
9532
|
-
this.Ah = 0x6a09e667 | 0;
|
9533
|
-
this.Al = 0xf3bcc908 | 0;
|
9534
|
-
this.Bh = 0xbb67ae85 | 0;
|
9535
|
-
this.Bl = 0x84caa73b | 0;
|
9536
|
-
this.Ch = 0x3c6ef372 | 0;
|
9537
|
-
this.Cl = 0xfe94f82b | 0;
|
9538
|
-
this.Dh = 0xa54ff53a | 0;
|
9539
|
-
this.Dl = 0x5f1d36f1 | 0;
|
9540
|
-
this.Eh = 0x510e527f | 0;
|
9541
|
-
this.El = 0xade682d1 | 0;
|
9542
|
-
this.Fh = 0x9b05688c | 0;
|
9543
|
-
this.Fl = 0x2b3e6c1f | 0;
|
9544
|
-
this.Gh = 0x1f83d9ab | 0;
|
9545
|
-
this.Gl = 0xfb41bd6b | 0;
|
9546
|
-
this.Hh = 0x5be0cd19 | 0;
|
9547
|
-
this.Hl = 0x137e2179 | 0;
|
9548
|
-
}
|
9549
|
-
// prettier-ignore
|
9550
|
-
get() {
|
9551
|
-
const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
|
9552
|
-
return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];
|
9553
|
-
}
|
9554
|
-
// prettier-ignore
|
9555
|
-
set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {
|
9556
|
-
this.Ah = Ah | 0;
|
9557
|
-
this.Al = Al | 0;
|
9558
|
-
this.Bh = Bh | 0;
|
9559
|
-
this.Bl = Bl | 0;
|
9560
|
-
this.Ch = Ch | 0;
|
9561
|
-
this.Cl = Cl | 0;
|
9562
|
-
this.Dh = Dh | 0;
|
9563
|
-
this.Dl = Dl | 0;
|
9564
|
-
this.Eh = Eh | 0;
|
9565
|
-
this.El = El | 0;
|
9566
|
-
this.Fh = Fh | 0;
|
9567
|
-
this.Fl = Fl | 0;
|
9568
|
-
this.Gh = Gh | 0;
|
9569
|
-
this.Gl = Gl | 0;
|
9570
|
-
this.Hh = Hh | 0;
|
9571
|
-
this.Hl = Hl | 0;
|
9572
|
-
}
|
9573
|
-
process(view, offset) {
|
9574
|
-
// Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array
|
9575
|
-
for (let i = 0; i < 16; i++, offset += 4) {
|
9576
|
-
SHA512_W_H[i] = view.getUint32(offset);
|
9577
|
-
SHA512_W_L[i] = view.getUint32((offset += 4));
|
9578
|
-
}
|
9579
|
-
for (let i = 16; i < 80; i++) {
|
9580
|
-
// s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)
|
9581
|
-
const W15h = SHA512_W_H[i - 15] | 0;
|
9582
|
-
const W15l = SHA512_W_L[i - 15] | 0;
|
9583
|
-
const s0h = _u64_ts_1.default.rotrSH(W15h, W15l, 1) ^ _u64_ts_1.default.rotrSH(W15h, W15l, 8) ^ _u64_ts_1.default.shrSH(W15h, W15l, 7);
|
9584
|
-
const s0l = _u64_ts_1.default.rotrSL(W15h, W15l, 1) ^ _u64_ts_1.default.rotrSL(W15h, W15l, 8) ^ _u64_ts_1.default.shrSL(W15h, W15l, 7);
|
9585
|
-
// s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)
|
9586
|
-
const W2h = SHA512_W_H[i - 2] | 0;
|
9587
|
-
const W2l = SHA512_W_L[i - 2] | 0;
|
9588
|
-
const s1h = _u64_ts_1.default.rotrSH(W2h, W2l, 19) ^ _u64_ts_1.default.rotrBH(W2h, W2l, 61) ^ _u64_ts_1.default.shrSH(W2h, W2l, 6);
|
9589
|
-
const s1l = _u64_ts_1.default.rotrSL(W2h, W2l, 19) ^ _u64_ts_1.default.rotrBL(W2h, W2l, 61) ^ _u64_ts_1.default.shrSL(W2h, W2l, 6);
|
9590
|
-
// SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];
|
9591
|
-
const SUMl = _u64_ts_1.default.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);
|
9592
|
-
const SUMh = _u64_ts_1.default.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);
|
9593
|
-
SHA512_W_H[i] = SUMh | 0;
|
9594
|
-
SHA512_W_L[i] = SUMl | 0;
|
9595
|
-
}
|
9596
|
-
let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
|
9597
|
-
// Compression function main loop, 80 rounds
|
9598
|
-
for (let i = 0; i < 80; i++) {
|
9599
|
-
// S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)
|
9600
|
-
const sigma1h = _u64_ts_1.default.rotrSH(Eh, El, 14) ^ _u64_ts_1.default.rotrSH(Eh, El, 18) ^ _u64_ts_1.default.rotrBH(Eh, El, 41);
|
9601
|
-
const sigma1l = _u64_ts_1.default.rotrSL(Eh, El, 14) ^ _u64_ts_1.default.rotrSL(Eh, El, 18) ^ _u64_ts_1.default.rotrBL(Eh, El, 41);
|
9602
|
-
//const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;
|
9603
|
-
const CHIh = (Eh & Fh) ^ (~Eh & Gh);
|
9604
|
-
const CHIl = (El & Fl) ^ (~El & Gl);
|
9605
|
-
// T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]
|
9606
|
-
// prettier-ignore
|
9607
|
-
const T1ll = _u64_ts_1.default.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);
|
9608
|
-
const T1h = _u64_ts_1.default.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);
|
9609
|
-
const T1l = T1ll | 0;
|
9610
|
-
// S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)
|
9611
|
-
const sigma0h = _u64_ts_1.default.rotrSH(Ah, Al, 28) ^ _u64_ts_1.default.rotrBH(Ah, Al, 34) ^ _u64_ts_1.default.rotrBH(Ah, Al, 39);
|
9612
|
-
const sigma0l = _u64_ts_1.default.rotrSL(Ah, Al, 28) ^ _u64_ts_1.default.rotrBL(Ah, Al, 34) ^ _u64_ts_1.default.rotrBL(Ah, Al, 39);
|
9613
|
-
const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);
|
9614
|
-
const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);
|
9615
|
-
Hh = Gh | 0;
|
9616
|
-
Hl = Gl | 0;
|
9617
|
-
Gh = Fh | 0;
|
9618
|
-
Gl = Fl | 0;
|
9619
|
-
Fh = Eh | 0;
|
9620
|
-
Fl = El | 0;
|
9621
|
-
({ h: Eh, l: El } = _u64_ts_1.default.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
|
9622
|
-
Dh = Ch | 0;
|
9623
|
-
Dl = Cl | 0;
|
9624
|
-
Ch = Bh | 0;
|
9625
|
-
Cl = Bl | 0;
|
9626
|
-
Bh = Ah | 0;
|
9627
|
-
Bl = Al | 0;
|
9628
|
-
const All = _u64_ts_1.default.add3L(T1l, sigma0l, MAJl);
|
9629
|
-
Ah = _u64_ts_1.default.add3H(All, T1h, sigma0h, MAJh);
|
9630
|
-
Al = All | 0;
|
9631
|
-
}
|
9632
|
-
// Add the compressed chunk to the current hash value
|
9633
|
-
({ h: Ah, l: Al } = _u64_ts_1.default.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));
|
9634
|
-
({ h: Bh, l: Bl } = _u64_ts_1.default.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));
|
9635
|
-
({ h: Ch, l: Cl } = _u64_ts_1.default.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));
|
9636
|
-
({ h: Dh, l: Dl } = _u64_ts_1.default.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));
|
9637
|
-
({ h: Eh, l: El } = _u64_ts_1.default.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));
|
9638
|
-
({ h: Fh, l: Fl } = _u64_ts_1.default.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));
|
9639
|
-
({ h: Gh, l: Gl } = _u64_ts_1.default.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));
|
9640
|
-
({ h: Hh, l: Hl } = _u64_ts_1.default.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));
|
9641
|
-
this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);
|
9642
|
-
}
|
9643
|
-
roundClean() {
|
9644
|
-
SHA512_W_H.fill(0);
|
9645
|
-
SHA512_W_L.fill(0);
|
9646
|
-
}
|
9647
|
-
destroy() {
|
9648
|
-
this.buffer.fill(0);
|
9649
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
9650
|
-
}
|
9651
|
-
}
|
9652
|
-
exports.SHA512 = SHA512;
|
9653
|
-
class SHA512_224 extends SHA512 {
|
9654
|
-
constructor() {
|
9655
|
-
super(28);
|
9656
|
-
// h -- high 32 bits, l -- low 32 bits
|
9657
|
-
this.Ah = 0x8c3d37c8 | 0;
|
9658
|
-
this.Al = 0x19544da2 | 0;
|
9659
|
-
this.Bh = 0x73e19966 | 0;
|
9660
|
-
this.Bl = 0x89dcd4d6 | 0;
|
9661
|
-
this.Ch = 0x1dfab7ae | 0;
|
9662
|
-
this.Cl = 0x32ff9c82 | 0;
|
9663
|
-
this.Dh = 0x679dd514 | 0;
|
9664
|
-
this.Dl = 0x582f9fcf | 0;
|
9665
|
-
this.Eh = 0x0f6d2b69 | 0;
|
9666
|
-
this.El = 0x7bd44da8 | 0;
|
9667
|
-
this.Fh = 0x77e36f73 | 0;
|
9668
|
-
this.Fl = 0x04c48942 | 0;
|
9669
|
-
this.Gh = 0x3f9d85a8 | 0;
|
9670
|
-
this.Gl = 0x6a1d36c8 | 0;
|
9671
|
-
this.Hh = 0x1112e6ad | 0;
|
9672
|
-
this.Hl = 0x91d692a1 | 0;
|
9673
|
-
}
|
9674
|
-
}
|
9675
|
-
exports.SHA512_224 = SHA512_224;
|
9676
|
-
class SHA512_256 extends SHA512 {
|
9677
|
-
constructor() {
|
9678
|
-
super(32);
|
9679
|
-
// h -- high 32 bits, l -- low 32 bits
|
9680
|
-
this.Ah = 0x22312194 | 0;
|
9681
|
-
this.Al = 0xfc2bf72c | 0;
|
9682
|
-
this.Bh = 0x9f555fa3 | 0;
|
9683
|
-
this.Bl = 0xc84c64c2 | 0;
|
9684
|
-
this.Ch = 0x2393b86b | 0;
|
9685
|
-
this.Cl = 0x6f53b151 | 0;
|
9686
|
-
this.Dh = 0x96387719 | 0;
|
9687
|
-
this.Dl = 0x5940eabd | 0;
|
9688
|
-
this.Eh = 0x96283ee2 | 0;
|
9689
|
-
this.El = 0xa88effe3 | 0;
|
9690
|
-
this.Fh = 0xbe5e1e25 | 0;
|
9691
|
-
this.Fl = 0x53863992 | 0;
|
9692
|
-
this.Gh = 0x2b0199fc | 0;
|
9693
|
-
this.Gl = 0x2c85b8aa | 0;
|
9694
|
-
this.Hh = 0x0eb72ddc | 0;
|
9695
|
-
this.Hl = 0x81c52ca2 | 0;
|
9696
|
-
}
|
9697
|
-
}
|
9698
|
-
exports.SHA512_256 = SHA512_256;
|
9699
|
-
class SHA384 extends SHA512 {
|
9700
|
-
constructor() {
|
9701
|
-
super(48);
|
9702
|
-
// h -- high 32 bits, l -- low 32 bits
|
9703
|
-
this.Ah = 0xcbbb9d5d | 0;
|
9704
|
-
this.Al = 0xc1059ed8 | 0;
|
9705
|
-
this.Bh = 0x629a292a | 0;
|
9706
|
-
this.Bl = 0x367cd507 | 0;
|
9707
|
-
this.Ch = 0x9159015a | 0;
|
9708
|
-
this.Cl = 0x3070dd17 | 0;
|
9709
|
-
this.Dh = 0x152fecd8 | 0;
|
9710
|
-
this.Dl = 0xf70e5939 | 0;
|
9711
|
-
this.Eh = 0x67332667 | 0;
|
9712
|
-
this.El = 0xffc00b31 | 0;
|
9713
|
-
this.Fh = 0x8eb44a87 | 0;
|
9714
|
-
this.Fl = 0x68581511 | 0;
|
9715
|
-
this.Gh = 0xdb0c2e0d | 0;
|
9716
|
-
this.Gl = 0x64f98fa7 | 0;
|
9717
|
-
this.Hh = 0x47b5481d | 0;
|
9718
|
-
this.Hl = 0xbefa4fa4 | 0;
|
9719
|
-
}
|
9720
|
-
}
|
9721
|
-
exports.SHA384 = SHA384;
|
9722
|
-
/** SHA2-512 hash function. */
|
9723
|
-
exports.sha512 = (0, utils_ts_1.wrapConstructor)(() => new SHA512());
|
9724
|
-
/** SHA2-512/224 "truncated" hash function, with improved resistance to length extension attacks. */
|
9725
|
-
exports.sha512_224 = (0, utils_ts_1.wrapConstructor)(() => new SHA512_224());
|
9726
|
-
/** SHA2-512/256 "truncated" hash function, with improved resistance to length extension attacks. */
|
9727
|
-
exports.sha512_256 = (0, utils_ts_1.wrapConstructor)(() => new SHA512_256());
|
9728
|
-
/** SHA2-384 hash function. */
|
9729
|
-
exports.sha384 = (0, utils_ts_1.wrapConstructor)(() => new SHA384());
|
9730
|
-
|
9731
|
-
|
9732
|
-
/***/ }),
|
9733
|
-
|
9734
|
-
/***/ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/utils.js":
|
9735
|
-
/*!***************************************************************************!*\
|
9736
|
-
!*** ../../node_modules/@scure/bip39/node_modules/@noble/hashes/utils.js ***!
|
9737
|
-
\***************************************************************************/
|
9738
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
9739
|
-
|
9740
|
-
"use strict";
|
9741
|
-
|
9742
|
-
/**
|
9743
|
-
* Utilities for hex, bytes, CSPRNG.
|
9744
|
-
* @module
|
9745
|
-
*/
|
9746
|
-
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
9747
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
9748
|
-
exports.Hash = exports.nextTick = exports.byteSwapIfBE = exports.isLE = void 0;
|
9749
|
-
exports.isBytes = isBytes;
|
9750
|
-
exports.u8 = u8;
|
9751
|
-
exports.u32 = u32;
|
9752
|
-
exports.createView = createView;
|
9753
|
-
exports.rotr = rotr;
|
9754
|
-
exports.rotl = rotl;
|
9755
|
-
exports.byteSwap = byteSwap;
|
9756
|
-
exports.byteSwap32 = byteSwap32;
|
9757
|
-
exports.bytesToHex = bytesToHex;
|
9758
|
-
exports.hexToBytes = hexToBytes;
|
9759
|
-
exports.asyncLoop = asyncLoop;
|
9760
|
-
exports.utf8ToBytes = utf8ToBytes;
|
9761
|
-
exports.toBytes = toBytes;
|
9762
|
-
exports.concatBytes = concatBytes;
|
9763
|
-
exports.checkOpts = checkOpts;
|
9764
|
-
exports.wrapConstructor = wrapConstructor;
|
9765
|
-
exports.wrapConstructorWithOpts = wrapConstructorWithOpts;
|
9766
|
-
exports.wrapXOFConstructorWithOpts = wrapXOFConstructorWithOpts;
|
9767
|
-
exports.randomBytes = randomBytes;
|
9768
|
-
// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.
|
9769
|
-
// node.js versions earlier than v19 don't declare it in global scope.
|
9770
|
-
// For node.js, package.json#exports field mapping rewrites import
|
9771
|
-
// from `crypto` to `cryptoNode`, which imports native module.
|
9772
|
-
// Makes the utils un-importable in browsers without a bundler.
|
9773
|
-
// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.
|
9774
|
-
const crypto_1 = __webpack_require__(/*! @noble/hashes/crypto */ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/crypto.js");
|
9775
|
-
const _assert_ts_1 = __webpack_require__(/*! ./_assert.js */ "../../node_modules/@scure/bip39/node_modules/@noble/hashes/_assert.js");
|
9776
|
-
// export { isBytes } from './_assert.ts';
|
9777
|
-
// We can't reuse isBytes from _assert, because somehow this causes huge perf issues
|
9778
|
-
function isBytes(a) {
|
9779
|
-
return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');
|
9780
|
-
}
|
9781
|
-
// Cast array to different type
|
9782
|
-
function u8(arr) {
|
9783
|
-
return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
|
9784
|
-
}
|
9785
|
-
function u32(arr) {
|
9786
|
-
return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
9787
|
-
}
|
9788
|
-
// Cast array to view
|
9789
|
-
function createView(arr) {
|
9790
|
-
return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
9791
|
-
}
|
9792
|
-
/** The rotate right (circular right shift) operation for uint32 */
|
9793
|
-
function rotr(word, shift) {
|
9794
|
-
return (word << (32 - shift)) | (word >>> shift);
|
9795
|
-
}
|
9796
|
-
/** The rotate left (circular left shift) operation for uint32 */
|
9797
|
-
function rotl(word, shift) {
|
9798
|
-
return (word << shift) | ((word >>> (32 - shift)) >>> 0);
|
9799
|
-
}
|
9800
|
-
/** Is current platform little-endian? Most are. Big-Endian platform: IBM */
|
9801
|
-
exports.isLE = (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();
|
9802
|
-
// The byte swap operation for uint32
|
9803
|
-
function byteSwap(word) {
|
9804
|
-
return (((word << 24) & 0xff000000) |
|
9805
|
-
((word << 8) & 0xff0000) |
|
9806
|
-
((word >>> 8) & 0xff00) |
|
9807
|
-
((word >>> 24) & 0xff));
|
9808
|
-
}
|
9809
|
-
/** Conditionally byte swap if on a big-endian platform */
|
9810
|
-
exports.byteSwapIfBE = exports.isLE
|
9811
|
-
? (n) => n
|
9812
|
-
: (n) => byteSwap(n);
|
9813
|
-
/** In place byte swap for Uint32Array */
|
9814
|
-
function byteSwap32(arr) {
|
9815
|
-
for (let i = 0; i < arr.length; i++) {
|
9816
|
-
arr[i] = byteSwap(arr[i]);
|
9817
|
-
}
|
9818
|
-
}
|
9819
|
-
// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex
|
9820
|
-
const hasHexBuiltin =
|
9821
|
-
// @ts-ignore
|
9822
|
-
typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function';
|
9823
|
-
// Array where index 0xf0 (240) is mapped to string 'f0'
|
9824
|
-
const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));
|
9825
|
-
/**
|
9826
|
-
* Convert byte array to hex string. Uses built-in function, when available.
|
9827
|
-
* @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'
|
9828
|
-
*/
|
9829
|
-
function bytesToHex(bytes) {
|
9830
|
-
(0, _assert_ts_1.abytes)(bytes);
|
9831
|
-
// @ts-ignore
|
9832
|
-
if (hasHexBuiltin)
|
9833
|
-
return bytes.toHex();
|
9834
|
-
// pre-caching improves the speed 6x
|
9835
|
-
let hex = '';
|
9836
|
-
for (let i = 0; i < bytes.length; i++) {
|
9837
|
-
hex += hexes[bytes[i]];
|
9838
|
-
}
|
9839
|
-
return hex;
|
9840
|
-
}
|
9841
|
-
// We use optimized technique to convert hex string to byte array
|
9842
|
-
const asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
9843
|
-
function asciiToBase16(ch) {
|
9844
|
-
if (ch >= asciis._0 && ch <= asciis._9)
|
9845
|
-
return ch - asciis._0; // '2' => 50-48
|
9846
|
-
if (ch >= asciis.A && ch <= asciis.F)
|
9847
|
-
return ch - (asciis.A - 10); // 'B' => 66-(65-10)
|
9848
|
-
if (ch >= asciis.a && ch <= asciis.f)
|
9849
|
-
return ch - (asciis.a - 10); // 'b' => 98-(97-10)
|
9850
|
-
return;
|
9851
|
-
}
|
9852
|
-
/**
|
9853
|
-
* Convert hex string to byte array. Uses built-in function, when available.
|
9854
|
-
* @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])
|
9855
|
-
*/
|
9856
|
-
function hexToBytes(hex) {
|
9857
|
-
if (typeof hex !== 'string')
|
9858
|
-
throw new Error('hex string expected, got ' + typeof hex);
|
9859
|
-
// @ts-ignore
|
9860
|
-
if (hasHexBuiltin)
|
9861
|
-
return Uint8Array.fromHex(hex);
|
9862
|
-
const hl = hex.length;
|
9863
|
-
const al = hl / 2;
|
9864
|
-
if (hl % 2)
|
9865
|
-
throw new Error('hex string expected, got unpadded hex of length ' + hl);
|
9866
|
-
const array = new Uint8Array(al);
|
9867
|
-
for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {
|
9868
|
-
const n1 = asciiToBase16(hex.charCodeAt(hi));
|
9869
|
-
const n2 = asciiToBase16(hex.charCodeAt(hi + 1));
|
9870
|
-
if (n1 === undefined || n2 === undefined) {
|
9871
|
-
const char = hex[hi] + hex[hi + 1];
|
9872
|
-
throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi);
|
9873
|
-
}
|
9874
|
-
array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163
|
9875
|
-
}
|
9876
|
-
return array;
|
9877
|
-
}
|
9878
|
-
/**
|
9879
|
-
* There is no setImmediate in browser and setTimeout is slow.
|
9880
|
-
* Call of async fn will return Promise, which will be fullfiled only on
|
9881
|
-
* next scheduler queue processing step and this is exactly what we need.
|
9882
|
-
*/
|
9883
|
-
const nextTick = async () => { };
|
9884
|
-
exports.nextTick = nextTick;
|
9885
|
-
/** Returns control to thread each 'tick' ms to avoid blocking. */
|
9886
|
-
async function asyncLoop(iters, tick, cb) {
|
9887
|
-
let ts = Date.now();
|
9888
|
-
for (let i = 0; i < iters; i++) {
|
9889
|
-
cb(i);
|
9890
|
-
// Date.now() is not monotonic, so in case if clock goes backwards we return return control too
|
9891
|
-
const diff = Date.now() - ts;
|
9892
|
-
if (diff >= 0 && diff < tick)
|
9893
|
-
continue;
|
9894
|
-
await (0, exports.nextTick)();
|
9895
|
-
ts += diff;
|
9896
|
-
}
|
9897
|
-
}
|
9898
|
-
/**
|
9899
|
-
* Convert JS string to byte array.
|
9900
|
-
* @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])
|
9140
|
+
* Validates mnemonic for being 12-24 words contained in `wordlist`.
|
9901
9141
|
*/
|
9902
|
-
function
|
9903
|
-
|
9904
|
-
|
9905
|
-
|
9142
|
+
function validateMnemonic(mnemonic, wordlist) {
|
9143
|
+
try {
|
9144
|
+
mnemonicToEntropy(mnemonic, wordlist);
|
9145
|
+
}
|
9146
|
+
catch (e) {
|
9147
|
+
return false;
|
9148
|
+
}
|
9149
|
+
return true;
|
9906
9150
|
}
|
9151
|
+
const psalt = (passphrase) => nfkd('mnemonic' + passphrase);
|
9907
9152
|
/**
|
9908
|
-
*
|
9909
|
-
*
|
9910
|
-
*
|
9153
|
+
* Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password.
|
9154
|
+
* @param mnemonic 12-24 words
|
9155
|
+
* @param passphrase string that will additionally protect the key
|
9156
|
+
* @returns 64 bytes of key data
|
9157
|
+
* @example
|
9158
|
+
* const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow';
|
9159
|
+
* await mnemonicToSeed(mnem, 'password');
|
9160
|
+
* // new Uint8Array([...64 bytes])
|
9911
9161
|
*/
|
9912
|
-
function
|
9913
|
-
|
9914
|
-
data = utf8ToBytes(data);
|
9915
|
-
(0, _assert_ts_1.abytes)(data);
|
9916
|
-
return data;
|
9162
|
+
function mnemonicToSeed(mnemonic, passphrase = '') {
|
9163
|
+
return (0, pbkdf2_1.pbkdf2Async)(sha2_1.sha512, normalize(mnemonic).nfkd, psalt(passphrase), { c: 2048, dkLen: 64 });
|
9917
9164
|
}
|
9918
9165
|
/**
|
9919
|
-
*
|
9166
|
+
* Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password.
|
9167
|
+
* @param mnemonic 12-24 words
|
9168
|
+
* @param passphrase string that will additionally protect the key
|
9169
|
+
* @returns 64 bytes of key data
|
9170
|
+
* @example
|
9171
|
+
* const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow';
|
9172
|
+
* mnemonicToSeedSync(mnem, 'password');
|
9173
|
+
* // new Uint8Array([...64 bytes])
|
9920
9174
|
*/
|
9921
|
-
function
|
9922
|
-
|
9923
|
-
for (let i = 0; i < arrays.length; i++) {
|
9924
|
-
const a = arrays[i];
|
9925
|
-
(0, _assert_ts_1.abytes)(a);
|
9926
|
-
sum += a.length;
|
9927
|
-
}
|
9928
|
-
const res = new Uint8Array(sum);
|
9929
|
-
for (let i = 0, pad = 0; i < arrays.length; i++) {
|
9930
|
-
const a = arrays[i];
|
9931
|
-
res.set(a, pad);
|
9932
|
-
pad += a.length;
|
9933
|
-
}
|
9934
|
-
return res;
|
9935
|
-
}
|
9936
|
-
/** For runtime check if class implements interface */
|
9937
|
-
class Hash {
|
9938
|
-
// Safe version that clones internal state
|
9939
|
-
clone() {
|
9940
|
-
return this._cloneInto();
|
9941
|
-
}
|
9942
|
-
}
|
9943
|
-
exports.Hash = Hash;
|
9944
|
-
function checkOpts(defaults, opts) {
|
9945
|
-
if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')
|
9946
|
-
throw new Error('Options should be object or undefined');
|
9947
|
-
const merged = Object.assign(defaults, opts);
|
9948
|
-
return merged;
|
9949
|
-
}
|
9950
|
-
/** Wraps hash function, creating an interface on top of it */
|
9951
|
-
function wrapConstructor(hashCons) {
|
9952
|
-
const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
|
9953
|
-
const tmp = hashCons();
|
9954
|
-
hashC.outputLen = tmp.outputLen;
|
9955
|
-
hashC.blockLen = tmp.blockLen;
|
9956
|
-
hashC.create = () => hashCons();
|
9957
|
-
return hashC;
|
9958
|
-
}
|
9959
|
-
function wrapConstructorWithOpts(hashCons) {
|
9960
|
-
const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
|
9961
|
-
const tmp = hashCons({});
|
9962
|
-
hashC.outputLen = tmp.outputLen;
|
9963
|
-
hashC.blockLen = tmp.blockLen;
|
9964
|
-
hashC.create = (opts) => hashCons(opts);
|
9965
|
-
return hashC;
|
9966
|
-
}
|
9967
|
-
function wrapXOFConstructorWithOpts(hashCons) {
|
9968
|
-
const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();
|
9969
|
-
const tmp = hashCons({});
|
9970
|
-
hashC.outputLen = tmp.outputLen;
|
9971
|
-
hashC.blockLen = tmp.blockLen;
|
9972
|
-
hashC.create = (opts) => hashCons(opts);
|
9973
|
-
return hashC;
|
9974
|
-
}
|
9975
|
-
/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */
|
9976
|
-
function randomBytes(bytesLength = 32) {
|
9977
|
-
if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === 'function') {
|
9978
|
-
return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));
|
9979
|
-
}
|
9980
|
-
// Legacy Node.js compatibility
|
9981
|
-
if (crypto_1.crypto && typeof crypto_1.crypto.randomBytes === 'function') {
|
9982
|
-
return Uint8Array.from(crypto_1.crypto.randomBytes(bytesLength));
|
9983
|
-
}
|
9984
|
-
throw new Error('crypto.getRandomValues must be defined');
|
9175
|
+
function mnemonicToSeedSync(mnemonic, passphrase = '') {
|
9176
|
+
return (0, pbkdf2_1.pbkdf2)(sha2_1.sha512, normalize(mnemonic).nfkd, psalt(passphrase), { c: 2048, dkLen: 64 });
|
9985
9177
|
}
|
9986
9178
|
|
9987
9179
|
|
@@ -15481,7 +14673,8 @@ var __WEBPACK_AMD_DEFINE_RESULT__;;(function (globalObject) {
|
|
15481
14673
|
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
15482
14674
|
|
15483
14675
|
// Node.js and other environments that support module.exports.
|
15484
|
-
} else
|
14676
|
+
} else // removed by dead control flow
|
14677
|
+
{}
|
15485
14678
|
})(this);
|
15486
14679
|
|
15487
14680
|
|
@@ -16243,7 +15436,7 @@ function checkByteLength(bytes, expectedLength) {
|
|
16243
15436
|
|
16244
15437
|
/* eslint-disable func-style */
|
16245
15438
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
16246
|
-
exports.transactionID = exports.sha512Half = exports.binaryToJSON = exports.signingClaimData = exports.signingData = exports.multiSigningData = exports.readJSON = exports.serializeObject = exports.makeParser = exports.BytesList = exports.BinarySerializer = exports.BinaryParser = void 0;
|
15439
|
+
exports.signingBatchData = exports.transactionID = exports.sha512Half = exports.binaryToJSON = exports.signingClaimData = exports.signingData = exports.multiSigningData = exports.readJSON = exports.serializeObject = exports.makeParser = exports.BytesList = exports.BinarySerializer = exports.BinaryParser = void 0;
|
16247
15440
|
const utils_1 = __webpack_require__(/*! @xrplf/isomorphic/utils */ "../../node_modules/@xrplf/isomorphic/dist/utils/browser.js");
|
16248
15441
|
const types_1 = __webpack_require__(/*! ./types */ "../../node_modules/ripple-binary-codec/dist/types/index.js");
|
16249
15442
|
const binary_parser_1 = __webpack_require__(/*! ./serdes/binary-parser */ "../../node_modules/ripple-binary-codec/dist/serdes/binary-parser.js");
|
@@ -16367,6 +15560,32 @@ function multiSigningData(transaction, signingAccount, opts = {
|
|
16367
15560
|
});
|
16368
15561
|
}
|
16369
15562
|
exports.multiSigningData = multiSigningData;
|
15563
|
+
/**
|
15564
|
+
* Serialize a signingClaim
|
15565
|
+
*
|
15566
|
+
* @param batch A Batch object to serialize.
|
15567
|
+
* @returns the serialized object with appropriate prefix
|
15568
|
+
*/
|
15569
|
+
function signingBatchData(batch) {
|
15570
|
+
if (batch.flags == null) {
|
15571
|
+
throw Error("No field `flags'");
|
15572
|
+
}
|
15573
|
+
if (batch.txIDs == null) {
|
15574
|
+
throw Error('No field `txIDs`');
|
15575
|
+
}
|
15576
|
+
const prefix = hash_prefixes_1.HashPrefix.batch;
|
15577
|
+
const flags = types_1.coreTypes.UInt32.from(batch.flags).toBytes();
|
15578
|
+
const txIDsLength = types_1.coreTypes.UInt32.from(batch.txIDs.length).toBytes();
|
15579
|
+
const bytesList = new binary_serializer_1.BytesList();
|
15580
|
+
bytesList.put(prefix);
|
15581
|
+
bytesList.put(flags);
|
15582
|
+
bytesList.put(txIDsLength);
|
15583
|
+
batch.txIDs.forEach((txID) => {
|
15584
|
+
bytesList.put(types_1.coreTypes.Hash256.from(txID).toBytes());
|
15585
|
+
});
|
15586
|
+
return bytesList.toBytes();
|
15587
|
+
}
|
15588
|
+
exports.signingBatchData = signingBatchData;
|
16370
15589
|
|
16371
15590
|
|
16372
15591
|
/***/ }),
|
@@ -16528,7 +15747,7 @@ exports.DELEGATABLE_PERMISSIONS_WIDTH = 4; // UInt32
|
|
16528
15747
|
/***/ ((module) => {
|
16529
15748
|
|
16530
15749
|
"use strict";
|
16531
|
-
module.exports = /*#__PURE__*/JSON.parse('{"FIELDS":[["Generic",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":0,"type":"Unknown"}],["Invalid",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":-1,"type":"Unknown"}],["ObjectEndMarker",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"STObject"}],["ArrayEndMarker",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"STArray"}],["taker_gets_funded",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":258,"type":"Amount"}],["taker_pays_funded",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":259,"type":"Amount"}],["LedgerEntryType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt16"}],["TransactionType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt16"}],["SignerWeight",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt16"}],["TransferFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt16"}],["TradingFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt16"}],["DiscountedFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"UInt16"}],["Version",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt16"}],["HookStateChangeCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt16"}],["HookEmitCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt16"}],["HookExecutionIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt16"}],["HookApiVersion",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt16"}],["LedgerFixType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"UInt16"}],["NetworkID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt32"}],["Flags",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt32"}],["SourceTag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt32"}],["Sequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt32"}],["PreviousTxnLgrSeq",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt32"}],["LedgerSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"UInt32"}],["CloseTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"UInt32"}],["ParentCloseTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"UInt32"}],["SigningTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"UInt32"}],["Expiration",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"UInt32"}],["TransferRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"UInt32"}],["WalletSize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"UInt32"}],["OwnerCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"UInt32"}],["DestinationTag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"UInt32"}],["LastUpdateTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":15,"type":"UInt32"}],["HighQualityIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt32"}],["HighQualityOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt32"}],["LowQualityIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt32"}],["LowQualityOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt32"}],["QualityIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt32"}],["QualityOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"UInt32"}],["StampEscrow",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"UInt32"}],["BondAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"UInt32"}],["LoadFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"UInt32"}],["OfferSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"UInt32"}],["FirstLedgerSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"UInt32"}],["LastLedgerSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"UInt32"}],["TransactionIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"UInt32"}],["OperationLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"UInt32"}],["ReferenceFeeUnits",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"UInt32"}],["ReserveBase",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"UInt32"}],["ReserveIncrement",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":32,"type":"UInt32"}],["SetFlag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":33,"type":"UInt32"}],["ClearFlag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":34,"type":"UInt32"}],["SignerQuorum",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":35,"type":"UInt32"}],["CancelAfter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":36,"type":"UInt32"}],["FinishAfter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":37,"type":"UInt32"}],["SignerListID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":38,"type":"UInt32"}],["SettleDelay",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":39,"type":"UInt32"}],["TicketCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":40,"type":"UInt32"}],["TicketSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":41,"type":"UInt32"}],["NFTokenTaxon",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":42,"type":"UInt32"}],["MintedNFTokens",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":43,"type":"UInt32"}],["BurnedNFTokens",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":44,"type":"UInt32"}],["HookStateCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":45,"type":"UInt32"}],["EmitGeneration",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":46,"type":"UInt32"}],["VoteWeight",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":48,"type":"UInt32"}],["FirstNFTokenSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":50,"type":"UInt32"}],["OracleDocumentID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":51,"type":"UInt32"}],["PermissionValue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":52,"type":"UInt32"}],["ExtensionComputeLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":53,"type":"UInt32"}],["ExtensionSizeLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":54,"type":"UInt32"}],["GasPrice",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":55,"type":"UInt32"}],["ComputationAllowance",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":56,"type":"UInt32"}],["GasUsed",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":57,"type":"UInt32"}],["IndexNext",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt64"}],["IndexPrevious",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt64"}],["BookNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt64"}],["OwnerNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt64"}],["BaseFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt64"}],["ExchangeRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"UInt64"}],["LowNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"UInt64"}],["HighNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"UInt64"}],["DestinationNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"UInt64"}],["Cookie",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"UInt64"}],["ServerVersion",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"UInt64"}],["NFTokenOfferNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"UInt64"}],["EmitBurden",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"UInt64"}],["HookOn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt64"}],["HookInstructionCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt64"}],["HookReturnCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt64"}],["ReferenceCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt64"}],["XChainClaimID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt64"}],["XChainAccountCreateCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"UInt64"}],["XChainAccountClaimCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"UInt64"}],["AssetPrice",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"UInt64"}],["MaximumAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"UInt64"}],["OutstandingAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"UInt64"}],["MPTAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"UInt64"}],["IssuerNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"UInt64"}],["SubjectNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"UInt64"}],["EmailHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash128"}],["LedgerHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash256"}],["ParentHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Hash256"}],["TransactionHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Hash256"}],["AccountHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Hash256"}],["PreviousTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"Hash256"}],["LedgerIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"Hash256"}],["WalletLocator",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"Hash256"}],["RootIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"Hash256"}],["AccountTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"Hash256"}],["NFTokenID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"Hash256"}],["EmitParentTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"Hash256"}],["EmitNonce",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"Hash256"}],["EmitHookHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"Hash256"}],["AMMID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"Hash256"}],["BookDirectory",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"Hash256"}],["InvoiceID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"Hash256"}],["Nickname",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"Hash256"}],["Amendment",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"Hash256"}],["Digest",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"Hash256"}],["Channel",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"Hash256"}],["ConsensusHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"Hash256"}],["CheckID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"Hash256"}],["ValidatedHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"Hash256"}],["PreviousPageMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"Hash256"}],["NextPageMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"Hash256"}],["NFTokenBuyOffer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"Hash256"}],["NFTokenSellOffer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"Hash256"}],["HookStateKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"Hash256"}],["HookHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"Hash256"}],["HookNamespace",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":32,"type":"Hash256"}],["HookSetTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":33,"type":"Hash256"}],["DomainID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":34,"type":"Hash256"}],["VaultID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":35,"type":"Hash256"}],["ParentBatchID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":36,"type":"Hash256"}],["hash",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Hash256"}],["index",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":258,"type":"Hash256"}],["Amount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Amount"}],["Balance",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Amount"}],["LimitAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Amount"}],["TakerPays",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Amount"}],["TakerGets",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"Amount"}],["LowLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"Amount"}],["HighLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"Amount"}],["Fee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"Amount"}],["SendMax",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"Amount"}],["DeliverMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"Amount"}],["Amount2",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"Amount"}],["BidMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"Amount"}],["BidMax",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"Amount"}],["MinimumOffer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"Amount"}],["RippleEscrow",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"Amount"}],["DeliveredAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"Amount"}],["NFTokenBrokerFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"Amount"}],["BaseFeeDrops",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"Amount"}],["ReserveBaseDrops",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"Amount"}],["ReserveIncrementDrops",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"Amount"}],["LPTokenOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"Amount"}],["LPTokenIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"Amount"}],["EPrice",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"Amount"}],["Price",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"Amount"}],["SignatureReward",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"Amount"}],["MinAccountCreateAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"Amount"}],["LPTokenBalance",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"Amount"}],["PublicKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":1,"type":"Blob"}],["MessageKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":2,"type":"Blob"}],["SigningPubKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":3,"type":"Blob"}],["TxnSignature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":true,"nth":4,"type":"Blob"}],["URI",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":5,"type":"Blob"}],["Signature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":true,"nth":6,"type":"Blob"}],["Domain",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":7,"type":"Blob"}],["FundCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":8,"type":"Blob"}],["RemoveCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":9,"type":"Blob"}],["ExpireCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":10,"type":"Blob"}],["CreateCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":11,"type":"Blob"}],["MemoType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":12,"type":"Blob"}],["MemoData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":13,"type":"Blob"}],["MemoFormat",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":14,"type":"Blob"}],["Fulfillment",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":16,"type":"Blob"}],["Condition",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":17,"type":"Blob"}],["MasterSignature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":true,"nth":18,"type":"Blob"}],["UNLModifyValidator",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":19,"type":"Blob"}],["ValidatorToDisable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":20,"type":"Blob"}],["ValidatorToReEnable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":21,"type":"Blob"}],["HookStateData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":22,"type":"Blob"}],["HookReturnString",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":23,"type":"Blob"}],["HookParameterName",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":24,"type":"Blob"}],["HookParameterValue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":25,"type":"Blob"}],["DIDDocument",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":26,"type":"Blob"}],["Data",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":27,"type":"Blob"}],["AssetClass",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":28,"type":"Blob"}],["Provider",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":29,"type":"Blob"}],["MPTokenMetadata",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":30,"type":"Blob"}],["CredentialType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":31,"type":"Blob"}],["FinishFunction",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":32,"type":"Blob"}],["Account",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":1,"type":"AccountID"}],["Owner",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":2,"type":"AccountID"}],["Destination",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":3,"type":"AccountID"}],["Issuer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":4,"type":"AccountID"}],["Authorize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":5,"type":"AccountID"}],["Unauthorize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":6,"type":"AccountID"}],["RegularKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":8,"type":"AccountID"}],["NFTokenMinter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":9,"type":"AccountID"}],["EmitCallback",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":10,"type":"AccountID"}],["Holder",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":11,"type":"AccountID"}],["Delegate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":12,"type":"AccountID"}],["HookAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":16,"type":"AccountID"}],["OtherChainSource",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":18,"type":"AccountID"}],["OtherChainDestination",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":19,"type":"AccountID"}],["AttestationSignerAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":20,"type":"AccountID"}],["AttestationRewardAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":21,"type":"AccountID"}],["LockingChainDoor",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":22,"type":"AccountID"}],["IssuingChainDoor",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":23,"type":"AccountID"}],["Subject",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":24,"type":"AccountID"}],["Number",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Number"}],["AssetsAvailable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Number"}],["AssetsMaximum",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Number"}],["AssetsTotal",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Number"}],["LossUnrealized",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"Number"}],["TransactionMetaData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"STObject"}],["CreatedNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"STObject"}],["DeletedNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"STObject"}],["ModifiedNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"STObject"}],["PreviousFields",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"STObject"}],["FinalFields",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"STObject"}],["NewFields",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"STObject"}],["TemplateEntry",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"STObject"}],["Memo",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"STObject"}],["SignerEntry",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"STObject"}],["NFToken",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"STObject"}],["EmitDetails",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"STObject"}],["Hook",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"STObject"}],["Permission",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":15,"type":"STObject"}],["Signer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"STObject"}],["Majority",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"STObject"}],["DisabledValidator",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"STObject"}],["EmittedTxn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"STObject"}],["HookExecution",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"STObject"}],["HookDefinition",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"STObject"}],["HookParameter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"STObject"}],["HookGrant",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"STObject"}],["VoteEntry",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"STObject"}],["AuctionSlot",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"STObject"}],["AuthAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"STObject"}],["XChainClaimProofSig",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"STObject"}],["XChainCreateAccountProofSig",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"STObject"}],["XChainClaimAttestationCollectionElement",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"STObject"}],["XChainCreateAccountAttestationCollectionElement",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"STObject"}],["PriceData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":32,"type":"STObject"}],["Credential",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":33,"type":"STObject"}],["RawTransaction",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":34,"type":"STObject"}],["BatchSigner",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":35,"type":"STObject"}],["Signers",{"isSerialized":true,"isSigningField":false,"isVLEncoded":false,"nth":3,"type":"STArray"}],["SignerEntries",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"STArray"}],["Template",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"STArray"}],["Necessary",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"STArray"}],["Sufficient",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"STArray"}],["AffectedNodes",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"STArray"}],["Memos",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"STArray"}],["NFTokens",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"STArray"}],["Hooks",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"STArray"}],["VoteSlots",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"STArray"}],["Majorities",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"STArray"}],["DisabledValidators",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"STArray"}],["HookExecutions",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"STArray"}],["HookParameters",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"STArray"}],["HookGrants",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"STArray"}],["XChainClaimAttestations",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"STArray"}],["XChainCreateAccountAttestations",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"STArray"}],["PriceDataSeries",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"STArray"}],["AuthAccounts",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"STArray"}],["AuthorizeCredentials",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"STArray"}],["UnauthorizeCredentials",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"STArray"}],["AcceptedCredentials",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"STArray"}],["Permissions",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"STArray"}],["RawTransactions",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"STArray"}],["BatchSigners",{"isSerialized":true,"isSigningField":false,"isVLEncoded":false,"nth":31,"type":"STArray"}],["CloseResolution",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt8"}],["Method",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt8"}],["TransactionResult",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt8"}],["Scale",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt8"}],["AssetScale",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt8"}],["TickSize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt8"}],["UNLModifyDisabling",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt8"}],["HookResult",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt8"}],["WasLockingChainSend",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt8"}],["WithdrawalPolicy",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt8"}],["TakerPaysCurrency",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash160"}],["TakerPaysIssuer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Hash160"}],["TakerGetsCurrency",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Hash160"}],["TakerGetsIssuer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Hash160"}],["Paths",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"PathSet"}],["Indexes",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":1,"type":"Vector256"}],["Hashes",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":2,"type":"Vector256"}],["Amendments",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":3,"type":"Vector256"}],["NFTokenOffers",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":4,"type":"Vector256"}],["CredentialIDs",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":5,"type":"Vector256"}],["MPTokenIssuanceID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash192"}],["ShareMPTID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Hash192"}],["LockingChainIssue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Issue"}],["IssuingChainIssue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Issue"}],["Asset",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Issue"}],["Asset2",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Issue"}],["XChainBridge",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"XChainBridge"}],["BaseAsset",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Currency"}],["QuoteAsset",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Currency"}],["Transaction",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Transaction"}],["LedgerEntry",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"LedgerEntry"}],["Validation",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Validation"}],["Metadata",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Metadata"}]],"LEDGER_ENTRY_TYPES":{"AMM":121,"AccountRoot":97,"Amendments":102,"Bridge":105,"Check":67,"Credential":129,"DID":73,"Delegate":131,"DepositPreauth":112,"DirectoryNode":100,"Escrow":117,"FeeSettings":115,"Invalid":-1,"LedgerHashes":104,"MPToken":127,"MPTokenIssuance":126,"NFTokenOffer":55,"NFTokenPage":80,"NegativeUNL":78,"Offer":111,"Oracle":128,"PayChannel":120,"PermissionedDomain":130,"RippleState":114,"SignerList":83,"Ticket":84,"Vault":132,"XChainOwnedClaimID":113,"XChainOwnedCreateAccountClaimID":116},"TRANSACTION_RESULTS":{"tecAMM_ACCOUNT":168,"tecAMM_BALANCE":163,"tecAMM_EMPTY":166,"tecAMM_FAILED":164,"tecAMM_INVALID_TOKENS":165,"tecAMM_NOT_EMPTY":167,"tecARRAY_EMPTY":190,"tecARRAY_TOO_LARGE":191,"tecBAD_CREDENTIALS":193,"tecCANT_ACCEPT_OWN_NFTOKEN_OFFER":158,"tecCLAIM":100,"tecCRYPTOCONDITION_ERROR":146,"tecDIR_FULL":121,"tecDST_TAG_NEEDED":143,"tecDUPLICATE":149,"tecEMPTY_DID":187,"tecEXPIRED":148,"tecFAILED_PROCESSING":105,"tecFROZEN":137,"tecHAS_OBLIGATIONS":151,"tecHOOK_REJECTED":153,"tecINCOMPLETE":169,"tecINSUFFICIENT_FUNDS":159,"tecINSUFFICIENT_PAYMENT":161,"tecINSUFFICIENT_RESERVE":141,"tecINSUFF_FEE":136,"tecINSUF_RESERVE_LINE":122,"tecINSUF_RESERVE_OFFER":123,"tecINTERNAL":144,"tecINVALID_UPDATE_TIME":188,"tecINVARIANT_FAILED":147,"tecKILLED":150,"tecLIMIT_EXCEEDED":195,"tecLOCKED":192,"tecMAX_SEQUENCE_REACHED":154,"tecNEED_MASTER_KEY":142,"tecNFTOKEN_BUY_SELL_MISMATCH":156,"tecNFTOKEN_OFFER_TYPE_MISMATCH":157,"tecNO_ALTERNATIVE_KEY":130,"tecNO_AUTH":134,"tecNO_DST":124,"tecNO_DST_INSUF_XRP":125,"tecNO_ENTRY":140,"tecNO_ISSUER":133,"tecNO_LINE":135,"tecNO_LINE_INSUF_RESERVE":126,"tecNO_LINE_REDUNDANT":127,"tecNO_PERMISSION":139,"tecNO_REGULAR_KEY":131,"tecNO_SUITABLE_NFTOKEN_PAGE":155,"tecNO_TARGET":138,"tecOBJECT_NOT_FOUND":160,"tecOVERSIZE":145,"tecOWNERS":132,"tecPATH_DRY":128,"tecPATH_PARTIAL":101,"tecPSEUDO_ACCOUNT":196,"tecTOKEN_PAIR_NOT_FOUND":189,"tecTOO_SOON":152,"tecUNFUNDED":129,"tecUNFUNDED_ADD":102,"tecUNFUNDED_AMM":162,"tecUNFUNDED_OFFER":103,"tecUNFUNDED_PAYMENT":104,"tecWASM_REJECTED":197,"tecWRONG_ASSET":194,"tecXCHAIN_ACCOUNT_CREATE_PAST":181,"tecXCHAIN_ACCOUNT_CREATE_TOO_MANY":182,"tecXCHAIN_BAD_CLAIM_ID":172,"tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR":185,"tecXCHAIN_BAD_TRANSFER_ISSUE":170,"tecXCHAIN_CLAIM_NO_QUORUM":173,"tecXCHAIN_CREATE_ACCOUNT_DISABLED":186,"tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE":175,"tecXCHAIN_INSUFF_CREATE_AMOUNT":180,"tecXCHAIN_NO_CLAIM_ID":171,"tecXCHAIN_NO_SIGNERS_LIST":178,"tecXCHAIN_PAYMENT_FAILED":183,"tecXCHAIN_PROOF_UNKNOWN_KEY":174,"tecXCHAIN_REWARD_MISMATCH":177,"tecXCHAIN_SELF_COMMIT":184,"tecXCHAIN_SENDING_ACCOUNT_MISMATCH":179,"tecXCHAIN_WRONG_CHAIN":176,"tefALREADY":-198,"tefBAD_ADD_AUTH":-197,"tefBAD_AUTH":-196,"tefBAD_AUTH_MASTER":-183,"tefBAD_LEDGER":-195,"tefBAD_QUORUM":-185,"tefBAD_SIGNATURE":-186,"tefCREATED":-194,"tefEXCEPTION":-193,"tefFAILURE":-199,"tefINTERNAL":-192,"tefINVALID_LEDGER_FIX_TYPE":-178,"tefINVARIANT_FAILED":-182,"tefMASTER_DISABLED":-188,"tefMAX_LEDGER":-187,"tefNFTOKEN_IS_NOT_TRANSFERABLE":-179,"tefNOT_MULTI_SIGNING":-184,"tefNO_AUTH_REQUIRED":-191,"tefNO_TICKET":-180,"tefNO_WASM":-177,"tefPAST_SEQ":-190,"tefTOO_BIG":-181,"tefWASM_FIELD_NOT_INCLUDED":-176,"tefWRONG_PRIOR":-189,"telBAD_DOMAIN":-398,"telBAD_PATH_COUNT":-397,"telBAD_PUBLIC_KEY":-396,"telCAN_NOT_QUEUE":-392,"telCAN_NOT_QUEUE_BALANCE":-391,"telCAN_NOT_QUEUE_BLOCKED":-389,"telCAN_NOT_QUEUE_BLOCKS":-390,"telCAN_NOT_QUEUE_FEE":-388,"telCAN_NOT_QUEUE_FULL":-387,"telENV_RPC_FAILED":-383,"telFAILED_PROCESSING":-395,"telINSUF_FEE_P":-394,"telLOCAL_ERROR":-399,"telNETWORK_ID_MAKES_TX_NON_CANONICAL":-384,"telNO_DST_PARTIAL":-393,"telREQUIRES_NETWORK_ID":-385,"telWRONG_NETWORK":-386,"temARRAY_EMPTY":-253,"temARRAY_TOO_LARGE":-252,"temBAD_AMM_TOKENS":-261,"temBAD_AMOUNT":-298,"temBAD_CURRENCY":-297,"temBAD_EXPIRATION":-296,"temBAD_FEE":-295,"temBAD_ISSUER":-294,"temBAD_LIMIT":-293,"temBAD_NFTOKEN_TRANSFER_FEE":-262,"temBAD_OFFER":-292,"temBAD_PATH":-291,"temBAD_PATH_LOOP":-290,"temBAD_QUORUM":-271,"temBAD_REGKEY":-289,"temBAD_SEND_XRP_LIMIT":-288,"temBAD_SEND_XRP_MAX":-287,"temBAD_SEND_XRP_NO_DIRECT":-286,"temBAD_SEND_XRP_PARTIAL":-285,"temBAD_SEND_XRP_PATHS":-284,"temBAD_SEQUENCE":-283,"temBAD_SIGNATURE":-282,"temBAD_SIGNER":-272,"temBAD_SRC_ACCOUNT":-281,"temBAD_TICK_SIZE":-269,"temBAD_TRANSFER_FEE":-251,"temBAD_TRANSFER_RATE":-280,"temBAD_WEIGHT":-270,"temCANNOT_PREAUTH_SELF":-267,"temDISABLED":-273,"temDST_IS_SRC":-279,"temDST_NEEDED":-278,"temEMPTY_DID":-254,"temINVALID":-277,"temINVALID_ACCOUNT_ID":-268,"temINVALID_COUNT":-266,"temINVALID_FLAG":-276,"temINVALID_INNER_BATCH":-250,"temMALFORMED":-299,"temREDUNDANT":-275,"temRIPPLE_EMPTY":-274,"temSEQ_AND_TICKET":-263,"temUNCERTAIN":-265,"temUNKNOWN":-264,"temXCHAIN_BAD_PROOF":-259,"temXCHAIN_BRIDGE_BAD_ISSUES":-258,"temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT":-256,"temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT":-255,"temXCHAIN_BRIDGE_NONDOOR_OWNER":-257,"temXCHAIN_EQUAL_DOOR_ACCOUNTS":-260,"terADDRESS_COLLISION":-86,"terFUNDS_SPENT":-98,"terINSUF_FEE_B":-97,"terLAST":-91,"terNO_ACCOUNT":-96,"terNO_AMM":-87,"terNO_AUTH":-95,"terNO_LINE":-94,"terNO_RIPPLE":-90,"terOWNERS":-93,"terPRE_SEQ":-92,"terPRE_TICKET":-88,"terQUEUED":-89,"terRETRY":-99,"tesSUCCESS":0},"TRANSACTION_TYPES":{"AMMBid":39,"AMMClawback":31,"AMMCreate":35,"AMMDelete":40,"AMMDeposit":36,"AMMVote":38,"AMMWithdraw":37,"AccountDelete":21,"AccountSet":3,"Batch":71,"CheckCancel":18,"CheckCash":17,"CheckCreate":16,"Clawback":30,"CredentialAccept":59,"CredentialCreate":58,"CredentialDelete":60,"DIDDelete":50,"DIDSet":49,"DelegateSet":64,"DepositPreauth":19,"EnableAmendment":100,"EscrowCancel":4,"EscrowCreate":1,"EscrowFinish":2,"Invalid":-1,"LedgerStateFix":53,"MPTokenAuthorize":57,"MPTokenIssuanceCreate":54,"MPTokenIssuanceDestroy":55,"MPTokenIssuanceSet":56,"NFTokenAcceptOffer":29,"NFTokenBurn":26,"NFTokenCancelOffer":28,"NFTokenCreateOffer":27,"NFTokenMint":25,"NFTokenModify":61,"OfferCancel":8,"OfferCreate":7,"OracleDelete":52,"OracleSet":51,"Payment":0,"PaymentChannelClaim":15,"PaymentChannelCreate":13,"PaymentChannelFund":14,"PermissionedDomainDelete":63,"PermissionedDomainSet":62,"SetFee":101,"SetRegularKey":5,"SignerListSet":12,"TicketCreate":10,"TrustSet":20,"UNLModify":102,"VaultClawback":70,"VaultCreate":65,"VaultDelete":67,"VaultDeposit":68,"VaultSet":66,"VaultWithdraw":69,"XChainAccountCreateCommit":44,"XChainAddAccountCreateAttestation":46,"XChainAddClaimAttestation":45,"XChainClaim":43,"XChainCommit":42,"XChainCreateBridge":48,"XChainCreateClaimID":41,"XChainModifyBridge":47},"TYPES":{"AccountID":8,"Amount":6,"Blob":7,"Currency":26,"Done":-1,"Hash128":4,"Hash160":17,"Hash192":21,"Hash256":5,"Issue":24,"LedgerEntry":10002,"Metadata":10004,"NotPresent":0,"Number":9,"PathSet":18,"STArray":15,"STObject":14,"Transaction":10001,"UInt16":1,"UInt32":2,"UInt384":22,"UInt512":23,"UInt64":3,"UInt8":16,"UInt96":20,"Unknown":-2,"Validation":10003,"Vector256":19,"XChainBridge":25}}');
|
15750
|
+
module.exports = /*#__PURE__*/JSON.parse('{"FIELDS":[["Generic",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":0,"type":"Unknown"}],["Invalid",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":-1,"type":"Unknown"}],["ObjectEndMarker",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"STObject"}],["ArrayEndMarker",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"STArray"}],["taker_gets_funded",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":258,"type":"Amount"}],["taker_pays_funded",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":259,"type":"Amount"}],["LedgerEntryType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt16"}],["TransactionType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt16"}],["SignerWeight",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt16"}],["TransferFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt16"}],["TradingFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt16"}],["DiscountedFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"UInt16"}],["Version",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt16"}],["HookStateChangeCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt16"}],["HookEmitCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt16"}],["HookExecutionIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt16"}],["HookApiVersion",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt16"}],["LedgerFixType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"UInt16"}],["NetworkID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt32"}],["Flags",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt32"}],["SourceTag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt32"}],["Sequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt32"}],["PreviousTxnLgrSeq",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt32"}],["LedgerSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"UInt32"}],["CloseTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"UInt32"}],["ParentCloseTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"UInt32"}],["SigningTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"UInt32"}],["Expiration",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"UInt32"}],["TransferRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"UInt32"}],["WalletSize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"UInt32"}],["OwnerCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"UInt32"}],["DestinationTag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"UInt32"}],["LastUpdateTime",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":15,"type":"UInt32"}],["HighQualityIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt32"}],["HighQualityOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt32"}],["LowQualityIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt32"}],["LowQualityOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt32"}],["QualityIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt32"}],["QualityOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"UInt32"}],["StampEscrow",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"UInt32"}],["BondAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"UInt32"}],["LoadFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"UInt32"}],["OfferSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"UInt32"}],["FirstLedgerSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"UInt32"}],["LastLedgerSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"UInt32"}],["TransactionIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"UInt32"}],["OperationLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"UInt32"}],["ReferenceFeeUnits",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"UInt32"}],["ReserveBase",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"UInt32"}],["ReserveIncrement",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":32,"type":"UInt32"}],["SetFlag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":33,"type":"UInt32"}],["ClearFlag",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":34,"type":"UInt32"}],["SignerQuorum",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":35,"type":"UInt32"}],["CancelAfter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":36,"type":"UInt32"}],["FinishAfter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":37,"type":"UInt32"}],["SignerListID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":38,"type":"UInt32"}],["SettleDelay",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":39,"type":"UInt32"}],["TicketCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":40,"type":"UInt32"}],["TicketSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":41,"type":"UInt32"}],["NFTokenTaxon",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":42,"type":"UInt32"}],["MintedNFTokens",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":43,"type":"UInt32"}],["BurnedNFTokens",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":44,"type":"UInt32"}],["HookStateCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":45,"type":"UInt32"}],["EmitGeneration",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":46,"type":"UInt32"}],["VoteWeight",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":48,"type":"UInt32"}],["FirstNFTokenSequence",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":50,"type":"UInt32"}],["OracleDocumentID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":51,"type":"UInt32"}],["PermissionValue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":52,"type":"UInt32"}],["ExtensionComputeLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":53,"type":"UInt32"}],["ExtensionSizeLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":54,"type":"UInt32"}],["GasPrice",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":55,"type":"UInt32"}],["ComputationAllowance",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":56,"type":"UInt32"}],["GasUsed",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":57,"type":"UInt32"}],["IndexNext",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt64"}],["IndexPrevious",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt64"}],["BookNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt64"}],["OwnerNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt64"}],["BaseFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt64"}],["ExchangeRate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"UInt64"}],["LowNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"UInt64"}],["HighNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"UInt64"}],["DestinationNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"UInt64"}],["Cookie",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"UInt64"}],["ServerVersion",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"UInt64"}],["NFTokenOfferNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"UInt64"}],["EmitBurden",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"UInt64"}],["HookOn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt64"}],["HookInstructionCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt64"}],["HookReturnCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt64"}],["ReferenceCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt64"}],["XChainClaimID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt64"}],["XChainAccountCreateCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"UInt64"}],["XChainAccountClaimCount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"UInt64"}],["AssetPrice",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"UInt64"}],["MaximumAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"UInt64"}],["OutstandingAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"UInt64"}],["MPTAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"UInt64"}],["IssuerNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"UInt64"}],["SubjectNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"UInt64"}],["EmailHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash128"}],["LedgerHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash256"}],["ParentHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Hash256"}],["TransactionHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Hash256"}],["AccountHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Hash256"}],["PreviousTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"Hash256"}],["LedgerIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"Hash256"}],["WalletLocator",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"Hash256"}],["RootIndex",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"Hash256"}],["AccountTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"Hash256"}],["NFTokenID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"Hash256"}],["EmitParentTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"Hash256"}],["EmitNonce",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"Hash256"}],["EmitHookHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"Hash256"}],["AMMID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"Hash256"}],["BookDirectory",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"Hash256"}],["InvoiceID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"Hash256"}],["Nickname",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"Hash256"}],["Amendment",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"Hash256"}],["Digest",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"Hash256"}],["Channel",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"Hash256"}],["ConsensusHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"Hash256"}],["CheckID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"Hash256"}],["ValidatedHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"Hash256"}],["PreviousPageMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"Hash256"}],["NextPageMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"Hash256"}],["NFTokenBuyOffer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"Hash256"}],["NFTokenSellOffer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"Hash256"}],["HookStateKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"Hash256"}],["HookHash",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"Hash256"}],["HookNamespace",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":32,"type":"Hash256"}],["HookSetTxnID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":33,"type":"Hash256"}],["DomainID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":34,"type":"Hash256"}],["VaultID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":35,"type":"Hash256"}],["ParentBatchID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":36,"type":"Hash256"}],["hash",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Hash256"}],["index",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":258,"type":"Hash256"}],["Amount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Amount"}],["Balance",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Amount"}],["LimitAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Amount"}],["TakerPays",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Amount"}],["TakerGets",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"Amount"}],["LowLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"Amount"}],["HighLimit",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"Amount"}],["Fee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"Amount"}],["SendMax",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"Amount"}],["DeliverMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"Amount"}],["Amount2",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"Amount"}],["BidMin",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"Amount"}],["BidMax",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"Amount"}],["MinimumOffer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"Amount"}],["RippleEscrow",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"Amount"}],["DeliveredAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"Amount"}],["NFTokenBrokerFee",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"Amount"}],["BaseFeeDrops",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"Amount"}],["ReserveBaseDrops",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"Amount"}],["ReserveIncrementDrops",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"Amount"}],["LPTokenOut",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"Amount"}],["LPTokenIn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"Amount"}],["EPrice",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"Amount"}],["Price",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"Amount"}],["SignatureReward",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"Amount"}],["MinAccountCreateAmount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"Amount"}],["LPTokenBalance",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"Amount"}],["PublicKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":1,"type":"Blob"}],["MessageKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":2,"type":"Blob"}],["SigningPubKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":3,"type":"Blob"}],["TxnSignature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":true,"nth":4,"type":"Blob"}],["URI",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":5,"type":"Blob"}],["Signature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":true,"nth":6,"type":"Blob"}],["Domain",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":7,"type":"Blob"}],["FundCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":8,"type":"Blob"}],["RemoveCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":9,"type":"Blob"}],["ExpireCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":10,"type":"Blob"}],["CreateCode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":11,"type":"Blob"}],["MemoType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":12,"type":"Blob"}],["MemoData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":13,"type":"Blob"}],["MemoFormat",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":14,"type":"Blob"}],["Fulfillment",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":16,"type":"Blob"}],["Condition",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":17,"type":"Blob"}],["MasterSignature",{"isSerialized":true,"isSigningField":false,"isVLEncoded":true,"nth":18,"type":"Blob"}],["UNLModifyValidator",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":19,"type":"Blob"}],["ValidatorToDisable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":20,"type":"Blob"}],["ValidatorToReEnable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":21,"type":"Blob"}],["HookStateData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":22,"type":"Blob"}],["HookReturnString",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":23,"type":"Blob"}],["HookParameterName",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":24,"type":"Blob"}],["HookParameterValue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":25,"type":"Blob"}],["DIDDocument",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":26,"type":"Blob"}],["Data",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":27,"type":"Blob"}],["AssetClass",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":28,"type":"Blob"}],["Provider",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":29,"type":"Blob"}],["MPTokenMetadata",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":30,"type":"Blob"}],["CredentialType",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":31,"type":"Blob"}],["FinishFunction",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":32,"type":"Blob"}],["Account",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":1,"type":"AccountID"}],["Owner",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":2,"type":"AccountID"}],["Destination",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":3,"type":"AccountID"}],["Issuer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":4,"type":"AccountID"}],["Authorize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":5,"type":"AccountID"}],["Unauthorize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":6,"type":"AccountID"}],["RegularKey",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":8,"type":"AccountID"}],["NFTokenMinter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":9,"type":"AccountID"}],["EmitCallback",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":10,"type":"AccountID"}],["Holder",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":11,"type":"AccountID"}],["Delegate",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":12,"type":"AccountID"}],["HookAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":16,"type":"AccountID"}],["OtherChainSource",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":18,"type":"AccountID"}],["OtherChainDestination",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":19,"type":"AccountID"}],["AttestationSignerAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":20,"type":"AccountID"}],["AttestationRewardAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":21,"type":"AccountID"}],["LockingChainDoor",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":22,"type":"AccountID"}],["IssuingChainDoor",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":23,"type":"AccountID"}],["Subject",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":24,"type":"AccountID"}],["Number",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Number"}],["AssetsAvailable",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Number"}],["AssetsMaximum",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Number"}],["AssetsTotal",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Number"}],["LossUnrealized",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"Number"}],["TransactionMetaData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"STObject"}],["CreatedNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"STObject"}],["DeletedNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"STObject"}],["ModifiedNode",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"STObject"}],["PreviousFields",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"STObject"}],["FinalFields",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"STObject"}],["NewFields",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"STObject"}],["TemplateEntry",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"STObject"}],["Memo",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"STObject"}],["SignerEntry",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"STObject"}],["NFToken",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"STObject"}],["EmitDetails",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":13,"type":"STObject"}],["Hook",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":14,"type":"STObject"}],["Permission",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":15,"type":"STObject"}],["Signer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"STObject"}],["Majority",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"STObject"}],["DisabledValidator",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"STObject"}],["EmittedTxn",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"STObject"}],["HookExecution",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"STObject"}],["HookDefinition",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"STObject"}],["HookParameter",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":23,"type":"STObject"}],["HookGrant",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"STObject"}],["VoteEntry",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"STObject"}],["AuctionSlot",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"STObject"}],["AuthAccount",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"STObject"}],["XChainClaimProofSig",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"STObject"}],["XChainCreateAccountProofSig",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"STObject"}],["XChainClaimAttestationCollectionElement",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"STObject"}],["XChainCreateAccountAttestationCollectionElement",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":31,"type":"STObject"}],["PriceData",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":32,"type":"STObject"}],["Credential",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":33,"type":"STObject"}],["RawTransaction",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":34,"type":"STObject"}],["BatchSigner",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":35,"type":"STObject"}],["Signers",{"isSerialized":true,"isSigningField":false,"isVLEncoded":false,"nth":3,"type":"STArray"}],["SignerEntries",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"STArray"}],["Template",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"STArray"}],["Necessary",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":6,"type":"STArray"}],["Sufficient",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":7,"type":"STArray"}],["AffectedNodes",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":8,"type":"STArray"}],["Memos",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":9,"type":"STArray"}],["NFTokens",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":10,"type":"STArray"}],["Hooks",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":11,"type":"STArray"}],["VoteSlots",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":12,"type":"STArray"}],["Majorities",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"STArray"}],["DisabledValidators",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"STArray"}],["HookExecutions",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"STArray"}],["HookParameters",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"STArray"}],["HookGrants",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"STArray"}],["XChainClaimAttestations",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":21,"type":"STArray"}],["XChainCreateAccountAttestations",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":22,"type":"STArray"}],["PriceDataSeries",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":24,"type":"STArray"}],["AuthAccounts",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":25,"type":"STArray"}],["AuthorizeCredentials",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":26,"type":"STArray"}],["UnauthorizeCredentials",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":27,"type":"STArray"}],["AcceptedCredentials",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":28,"type":"STArray"}],["Permissions",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":29,"type":"STArray"}],["RawTransactions",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":30,"type":"STArray"}],["BatchSigners",{"isSerialized":true,"isSigningField":false,"isVLEncoded":false,"nth":31,"type":"STArray"}],["CloseResolution",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"UInt8"}],["Method",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"UInt8"}],["TransactionResult",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"UInt8"}],["Scale",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"UInt8"}],["AssetScale",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":5,"type":"UInt8"}],["TickSize",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":16,"type":"UInt8"}],["UNLModifyDisabling",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":17,"type":"UInt8"}],["HookResult",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":18,"type":"UInt8"}],["WasLockingChainSend",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":19,"type":"UInt8"}],["WithdrawalPolicy",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":20,"type":"UInt8"}],["TakerPaysCurrency",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash160"}],["TakerPaysIssuer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Hash160"}],["TakerGetsCurrency",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Hash160"}],["TakerGetsIssuer",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Hash160"}],["Paths",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"PathSet"}],["Indexes",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":1,"type":"Vector256"}],["Hashes",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":2,"type":"Vector256"}],["Amendments",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":3,"type":"Vector256"}],["NFTokenOffers",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":4,"type":"Vector256"}],["CredentialIDs",{"isSerialized":true,"isSigningField":true,"isVLEncoded":true,"nth":5,"type":"Vector256"}],["MPTokenIssuanceID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Hash192"}],["ShareMPTID",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Hash192"}],["LockingChainIssue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Issue"}],["IssuingChainIssue",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Issue"}],["Asset",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":3,"type":"Issue"}],["Asset2",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":4,"type":"Issue"}],["XChainBridge",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"XChainBridge"}],["BaseAsset",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":1,"type":"Currency"}],["QuoteAsset",{"isSerialized":true,"isSigningField":true,"isVLEncoded":false,"nth":2,"type":"Currency"}],["Transaction",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Transaction"}],["LedgerEntry",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"LedgerEntry"}],["Validation",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Validation"}],["Metadata",{"isSerialized":false,"isSigningField":false,"isVLEncoded":false,"nth":257,"type":"Metadata"}]],"LEDGER_ENTRY_TYPES":{"AMM":121,"AccountRoot":97,"Amendments":102,"Bridge":105,"Check":67,"Credential":129,"DID":73,"Delegate":131,"DepositPreauth":112,"DirectoryNode":100,"Escrow":117,"FeeSettings":115,"Invalid":-1,"LedgerHashes":104,"MPToken":127,"MPTokenIssuance":126,"NFTokenOffer":55,"NFTokenPage":80,"NegativeUNL":78,"Offer":111,"Oracle":128,"PayChannel":120,"PermissionedDomain":130,"RippleState":114,"SignerList":83,"Ticket":84,"Vault":132,"XChainOwnedClaimID":113,"XChainOwnedCreateAccountClaimID":116},"TRANSACTION_RESULTS":{"tecAMM_ACCOUNT":168,"tecAMM_BALANCE":163,"tecAMM_EMPTY":166,"tecAMM_FAILED":164,"tecAMM_INVALID_TOKENS":165,"tecAMM_NOT_EMPTY":167,"tecARRAY_EMPTY":190,"tecARRAY_TOO_LARGE":191,"tecBAD_CREDENTIALS":193,"tecCANT_ACCEPT_OWN_NFTOKEN_OFFER":158,"tecCLAIM":100,"tecCRYPTOCONDITION_ERROR":146,"tecDIR_FULL":121,"tecDST_TAG_NEEDED":143,"tecDUPLICATE":149,"tecEMPTY_DID":187,"tecEXPIRED":148,"tecFAILED_PROCESSING":105,"tecFROZEN":137,"tecHAS_OBLIGATIONS":151,"tecHOOK_REJECTED":153,"tecINCOMPLETE":169,"tecINSUFFICIENT_FUNDS":159,"tecINSUFFICIENT_PAYMENT":161,"tecINSUFFICIENT_RESERVE":141,"tecINSUFF_FEE":136,"tecINSUF_RESERVE_LINE":122,"tecINSUF_RESERVE_OFFER":123,"tecINTERNAL":144,"tecINVALID_UPDATE_TIME":188,"tecINVARIANT_FAILED":147,"tecKILLED":150,"tecLIMIT_EXCEEDED":195,"tecLOCKED":192,"tecMAX_SEQUENCE_REACHED":154,"tecNEED_MASTER_KEY":142,"tecNFTOKEN_BUY_SELL_MISMATCH":156,"tecNFTOKEN_OFFER_TYPE_MISMATCH":157,"tecNO_ALTERNATIVE_KEY":130,"tecNO_AUTH":134,"tecNO_DST":124,"tecNO_DST_INSUF_XRP":125,"tecNO_ENTRY":140,"tecNO_ISSUER":133,"tecNO_LINE":135,"tecNO_LINE_INSUF_RESERVE":126,"tecNO_LINE_REDUNDANT":127,"tecNO_PERMISSION":139,"tecNO_REGULAR_KEY":131,"tecNO_SUITABLE_NFTOKEN_PAGE":155,"tecNO_TARGET":138,"tecOBJECT_NOT_FOUND":160,"tecOVERSIZE":145,"tecOWNERS":132,"tecPATH_DRY":128,"tecPATH_PARTIAL":101,"tecPSEUDO_ACCOUNT":196,"tecTOKEN_PAIR_NOT_FOUND":189,"tecTOO_SOON":152,"tecUNFUNDED":129,"tecUNFUNDED_ADD":102,"tecUNFUNDED_AMM":162,"tecUNFUNDED_OFFER":103,"tecUNFUNDED_PAYMENT":104,"tecWASM_REJECTED":197,"tecWRONG_ASSET":194,"tecXCHAIN_ACCOUNT_CREATE_PAST":181,"tecXCHAIN_ACCOUNT_CREATE_TOO_MANY":182,"tecXCHAIN_BAD_CLAIM_ID":172,"tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR":185,"tecXCHAIN_BAD_TRANSFER_ISSUE":170,"tecXCHAIN_CLAIM_NO_QUORUM":173,"tecXCHAIN_CREATE_ACCOUNT_DISABLED":186,"tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE":175,"tecXCHAIN_INSUFF_CREATE_AMOUNT":180,"tecXCHAIN_NO_CLAIM_ID":171,"tecXCHAIN_NO_SIGNERS_LIST":178,"tecXCHAIN_PAYMENT_FAILED":183,"tecXCHAIN_PROOF_UNKNOWN_KEY":174,"tecXCHAIN_REWARD_MISMATCH":177,"tecXCHAIN_SELF_COMMIT":184,"tecXCHAIN_SENDING_ACCOUNT_MISMATCH":179,"tecXCHAIN_WRONG_CHAIN":176,"tefALREADY":-198,"tefBAD_ADD_AUTH":-197,"tefBAD_AUTH":-196,"tefBAD_AUTH_MASTER":-183,"tefBAD_LEDGER":-195,"tefBAD_QUORUM":-185,"tefBAD_SIGNATURE":-186,"tefCREATED":-194,"tefEXCEPTION":-193,"tefFAILURE":-199,"tefINTERNAL":-192,"tefINVALID_LEDGER_FIX_TYPE":-178,"tefINVARIANT_FAILED":-182,"tefMASTER_DISABLED":-188,"tefMAX_LEDGER":-187,"tefNFTOKEN_IS_NOT_TRANSFERABLE":-179,"tefNOT_MULTI_SIGNING":-184,"tefNO_AUTH_REQUIRED":-191,"tefNO_TICKET":-180,"tefNO_WASM":-177,"tefPAST_SEQ":-190,"tefTOO_BIG":-181,"tefWASM_FIELD_NOT_INCLUDED":-176,"tefWRONG_PRIOR":-189,"telBAD_DOMAIN":-398,"telBAD_PATH_COUNT":-397,"telBAD_PUBLIC_KEY":-396,"telCAN_NOT_QUEUE":-392,"telCAN_NOT_QUEUE_BALANCE":-391,"telCAN_NOT_QUEUE_BLOCKED":-389,"telCAN_NOT_QUEUE_BLOCKS":-390,"telCAN_NOT_QUEUE_FEE":-388,"telCAN_NOT_QUEUE_FULL":-387,"telENV_RPC_FAILED":-383,"telFAILED_PROCESSING":-395,"telINSUF_FEE_P":-394,"telLOCAL_ERROR":-399,"telNETWORK_ID_MAKES_TX_NON_CANONICAL":-384,"telNO_DST_PARTIAL":-393,"telREQUIRES_NETWORK_ID":-385,"telWRONG_NETWORK":-386,"temARRAY_EMPTY":-253,"temARRAY_TOO_LARGE":-252,"temBAD_AMM_TOKENS":-261,"temBAD_AMOUNT":-298,"temBAD_CURRENCY":-297,"temBAD_EXPIRATION":-296,"temBAD_FEE":-295,"temBAD_ISSUER":-294,"temBAD_LIMIT":-293,"temBAD_NFTOKEN_TRANSFER_FEE":-262,"temBAD_OFFER":-292,"temBAD_PATH":-291,"temBAD_PATH_LOOP":-290,"temBAD_QUORUM":-271,"temBAD_REGKEY":-289,"temBAD_SEND_XRP_LIMIT":-288,"temBAD_SEND_XRP_MAX":-287,"temBAD_SEND_XRP_NO_DIRECT":-286,"temBAD_SEND_XRP_PARTIAL":-285,"temBAD_SEND_XRP_PATHS":-284,"temBAD_SEQUENCE":-283,"temBAD_SIGNATURE":-282,"temBAD_SIGNER":-272,"temBAD_SRC_ACCOUNT":-281,"temBAD_TICK_SIZE":-269,"temBAD_TRANSFER_FEE":-251,"temBAD_TRANSFER_RATE":-280,"temBAD_WASM":-249,"temBAD_WEIGHT":-270,"temCANNOT_PREAUTH_SELF":-267,"temDISABLED":-273,"temDST_IS_SRC":-279,"temDST_NEEDED":-278,"temEMPTY_DID":-254,"temINVALID":-277,"temINVALID_ACCOUNT_ID":-268,"temINVALID_COUNT":-266,"temINVALID_FLAG":-276,"temINVALID_INNER_BATCH":-250,"temMALFORMED":-299,"temREDUNDANT":-275,"temRIPPLE_EMPTY":-274,"temSEQ_AND_TICKET":-263,"temUNCERTAIN":-265,"temUNKNOWN":-264,"temXCHAIN_BAD_PROOF":-259,"temXCHAIN_BRIDGE_BAD_ISSUES":-258,"temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT":-256,"temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT":-255,"temXCHAIN_BRIDGE_NONDOOR_OWNER":-257,"temXCHAIN_EQUAL_DOOR_ACCOUNTS":-260,"terADDRESS_COLLISION":-86,"terFUNDS_SPENT":-98,"terINSUF_FEE_B":-97,"terLAST":-91,"terNO_ACCOUNT":-96,"terNO_AMM":-87,"terNO_AUTH":-95,"terNO_LINE":-94,"terNO_RIPPLE":-90,"terOWNERS":-93,"terPRE_SEQ":-92,"terPRE_TICKET":-88,"terQUEUED":-89,"terRETRY":-99,"tesSUCCESS":0},"TRANSACTION_TYPES":{"AMMBid":39,"AMMClawback":31,"AMMCreate":35,"AMMDelete":40,"AMMDeposit":36,"AMMVote":38,"AMMWithdraw":37,"AccountDelete":21,"AccountSet":3,"Batch":71,"CheckCancel":18,"CheckCash":17,"CheckCreate":16,"Clawback":30,"CredentialAccept":59,"CredentialCreate":58,"CredentialDelete":60,"DIDDelete":50,"DIDSet":49,"DelegateSet":64,"DepositPreauth":19,"EnableAmendment":100,"EscrowCancel":4,"EscrowCreate":1,"EscrowFinish":2,"Invalid":-1,"LedgerStateFix":53,"MPTokenAuthorize":57,"MPTokenIssuanceCreate":54,"MPTokenIssuanceDestroy":55,"MPTokenIssuanceSet":56,"NFTokenAcceptOffer":29,"NFTokenBurn":26,"NFTokenCancelOffer":28,"NFTokenCreateOffer":27,"NFTokenMint":25,"NFTokenModify":61,"OfferCancel":8,"OfferCreate":7,"OracleDelete":52,"OracleSet":51,"Payment":0,"PaymentChannelClaim":15,"PaymentChannelCreate":13,"PaymentChannelFund":14,"PermissionedDomainDelete":63,"PermissionedDomainSet":62,"SetFee":101,"SetRegularKey":5,"SignerListSet":12,"TicketCreate":10,"TrustSet":20,"UNLModify":102,"VaultClawback":70,"VaultCreate":65,"VaultDelete":67,"VaultDeposit":68,"VaultSet":66,"VaultWithdraw":69,"XChainAccountCreateCommit":44,"XChainAddAccountCreateAttestation":46,"XChainAddClaimAttestation":45,"XChainClaim":43,"XChainCommit":42,"XChainCreateBridge":48,"XChainCreateClaimID":41,"XChainModifyBridge":47},"TYPES":{"AccountID":8,"Amount":6,"Blob":7,"Currency":26,"Done":-1,"Hash128":4,"Hash160":17,"Hash192":21,"Hash256":5,"Issue":24,"LedgerEntry":10002,"Metadata":10004,"NotPresent":0,"Number":9,"PathSet":18,"STArray":15,"STObject":14,"Transaction":10001,"UInt16":1,"UInt32":2,"UInt384":22,"UInt512":23,"UInt64":3,"UInt8":16,"UInt96":20,"Unknown":-2,"Validation":10003,"Vector256":19,"XChainBridge":25}}');
|
16532
15751
|
|
16533
15752
|
/***/ }),
|
16534
15753
|
|
@@ -16721,7 +15940,9 @@ class XrplDefinitionsBase {
|
|
16721
15940
|
this.field['TransactionType'].associatedType = this.transactionType;
|
16722
15941
|
this.field['TransactionResult'].associatedType = this.transactionResult;
|
16723
15942
|
this.field['LedgerEntryType'].associatedType = this.ledgerEntryType;
|
16724
|
-
this.field['PermissionValue']
|
15943
|
+
if (this.field['PermissionValue']) {
|
15944
|
+
this.field['PermissionValue'].associatedType = this.delegatablePermissions;
|
15945
|
+
}
|
16725
15946
|
}
|
16726
15947
|
getAssociatedTypes() {
|
16727
15948
|
return this.dataTypes;
|
@@ -16817,6 +16038,8 @@ const HashPrefix = {
|
|
16817
16038
|
proposal: bytes(0x50525000),
|
16818
16039
|
// payment channel claim
|
16819
16040
|
paymentChannelClaim: bytes(0x434c4d00),
|
16041
|
+
// batch
|
16042
|
+
batch: bytes(0x42434800),
|
16820
16043
|
};
|
16821
16044
|
exports.HashPrefix = HashPrefix;
|
16822
16045
|
|
@@ -16918,7 +16141,7 @@ exports.transactionID = transactionID;
|
|
16918
16141
|
"use strict";
|
16919
16142
|
|
16920
16143
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
16921
|
-
exports.coreTypes = exports.DEFAULT_DEFINITIONS = exports.XrplDefinitionsBase = exports.XrplDefinitions = exports.TRANSACTION_TYPES = exports.decodeLedgerData = exports.decodeQuality = exports.encodeQuality = exports.encodeForMultisigning = exports.encodeForSigningClaim = exports.encodeForSigning = exports.encode = exports.decode = void 0;
|
16144
|
+
exports.coreTypes = exports.DEFAULT_DEFINITIONS = exports.XrplDefinitionsBase = exports.XrplDefinitions = exports.TRANSACTION_TYPES = exports.decodeLedgerData = exports.decodeQuality = exports.encodeQuality = exports.encodeForSigningBatch = exports.encodeForMultisigning = exports.encodeForSigningClaim = exports.encodeForSigning = exports.encode = exports.decode = void 0;
|
16922
16145
|
const coretypes_1 = __webpack_require__(/*! ./coretypes */ "../../node_modules/ripple-binary-codec/dist/coretypes.js");
|
16923
16146
|
const ledger_hashes_1 = __webpack_require__(/*! ./ledger-hashes */ "../../node_modules/ripple-binary-codec/dist/ledger-hashes.js");
|
16924
16147
|
Object.defineProperty(exports, "decodeLedgerData", ({ enumerable: true, get: function () { return ledger_hashes_1.decodeLedgerData; } }));
|
@@ -16931,7 +16154,7 @@ Object.defineProperty(exports, "XrplDefinitions", ({ enumerable: true, get: func
|
|
16931
16154
|
const types_1 = __webpack_require__(/*! ./types */ "../../node_modules/ripple-binary-codec/dist/types/index.js");
|
16932
16155
|
Object.defineProperty(exports, "coreTypes", ({ enumerable: true, get: function () { return types_1.coreTypes; } }));
|
16933
16156
|
const utils_1 = __webpack_require__(/*! @xrplf/isomorphic/utils */ "../../node_modules/@xrplf/isomorphic/dist/utils/browser.js");
|
16934
|
-
const { signingData, signingClaimData, multiSigningData, binaryToJSON, serializeObject, } = coretypes_1.binary;
|
16157
|
+
const { signingData, signingClaimData, multiSigningData, signingBatchData, binaryToJSON, serializeObject, } = coretypes_1.binary;
|
16935
16158
|
/**
|
16936
16159
|
* Decode a transaction
|
16937
16160
|
*
|
@@ -16979,12 +16202,10 @@ function encodeForSigning(json, definitions) {
|
|
16979
16202
|
}
|
16980
16203
|
exports.encodeForSigning = encodeForSigning;
|
16981
16204
|
/**
|
16982
|
-
* Encode a
|
16205
|
+
* Encode a payment channel claim for signing.
|
16983
16206
|
*
|
16984
|
-
* @param json JSON object representing the
|
16985
|
-
* @
|
16986
|
-
* @param definitions Custom rippled types to use instead of the default. Used for sidechains and amendments.
|
16987
|
-
* @returns a hex string of the encoded transaction
|
16207
|
+
* @param json JSON object representing the claim.
|
16208
|
+
* @returns a hex string of the encoded claim.
|
16988
16209
|
*/
|
16989
16210
|
function encodeForSigningClaim(json) {
|
16990
16211
|
if (typeof json !== 'object') {
|
@@ -16994,12 +16215,12 @@ function encodeForSigningClaim(json) {
|
|
16994
16215
|
}
|
16995
16216
|
exports.encodeForSigningClaim = encodeForSigningClaim;
|
16996
16217
|
/**
|
16997
|
-
* Encode a transaction and prepare for multi-signing
|
16218
|
+
* Encode a transaction and prepare for multi-signing.
|
16998
16219
|
*
|
16999
|
-
* @param json JSON object representing the transaction
|
17000
|
-
* @param signer string representing the account to sign the transaction with
|
16220
|
+
* @param json JSON object representing the transaction.
|
16221
|
+
* @param signer string representing the account to sign the transaction with.
|
17001
16222
|
* @param definitions Custom rippled types to use instead of the default. Used for sidechains and amendments.
|
17002
|
-
* @returns a hex string of the encoded transaction
|
16223
|
+
* @returns a hex string of the encoded transaction.
|
17003
16224
|
*/
|
17004
16225
|
function encodeForMultisigning(json, signer, definitions) {
|
17005
16226
|
if (typeof json !== 'object') {
|
@@ -17012,6 +16233,19 @@ function encodeForMultisigning(json, signer, definitions) {
|
|
17012
16233
|
return (0, utils_1.bytesToHex)(multiSigningData(json, signer, definitionsOpt));
|
17013
16234
|
}
|
17014
16235
|
exports.encodeForMultisigning = encodeForMultisigning;
|
16236
|
+
/**
|
16237
|
+
* Encode a Batch transaction for signing.
|
16238
|
+
*
|
16239
|
+
* @param json JSON object representing the transaction.
|
16240
|
+
* @returns a hex string of the encoded transaction.
|
16241
|
+
*/
|
16242
|
+
function encodeForSigningBatch(json) {
|
16243
|
+
if (typeof json !== 'object') {
|
16244
|
+
throw new Error('Need an object to encode a Batch transaction');
|
16245
|
+
}
|
16246
|
+
return (0, utils_1.bytesToHex)(signingBatchData(json));
|
16247
|
+
}
|
16248
|
+
exports.encodeForSigningBatch = encodeForSigningBatch;
|
17015
16249
|
/**
|
17016
16250
|
* Encode a quality value
|
17017
16251
|
*
|
@@ -18517,6 +17751,9 @@ class Hash extends serialized_type_1.Comparable {
|
|
18517
17751
|
return value;
|
18518
17752
|
}
|
18519
17753
|
if (typeof value === 'string') {
|
17754
|
+
if (!utils_1.HEX_REGEX.test(value)) {
|
17755
|
+
throw new Error(`Invalid hash string ${value}`);
|
17756
|
+
}
|
18520
17757
|
return new this((0, utils_1.hexToBytes)(value));
|
18521
17758
|
}
|
18522
17759
|
throw new Error('Cannot construct Hash from given value');
|
@@ -18594,6 +17831,7 @@ Object.defineProperty(exports, "Hash192", ({ enumerable: true, get: function ()
|
|
18594
17831
|
const hash_256_1 = __webpack_require__(/*! ./hash-256 */ "../../node_modules/ripple-binary-codec/dist/types/hash-256.js");
|
18595
17832
|
Object.defineProperty(exports, "Hash256", ({ enumerable: true, get: function () { return hash_256_1.Hash256; } }));
|
18596
17833
|
const issue_1 = __webpack_require__(/*! ./issue */ "../../node_modules/ripple-binary-codec/dist/types/issue.js");
|
17834
|
+
const st_number_1 = __webpack_require__(/*! ./st-number */ "../../node_modules/ripple-binary-codec/dist/types/st-number.js");
|
18597
17835
|
const path_set_1 = __webpack_require__(/*! ./path-set */ "../../node_modules/ripple-binary-codec/dist/types/path-set.js");
|
18598
17836
|
Object.defineProperty(exports, "PathSet", ({ enumerable: true, get: function () { return path_set_1.PathSet; } }));
|
18599
17837
|
const st_array_1 = __webpack_require__(/*! ./st-array */ "../../node_modules/ripple-binary-codec/dist/types/st-array.js");
|
@@ -18622,6 +17860,7 @@ const coreTypes = {
|
|
18622
17860
|
Hash192: hash_192_1.Hash192,
|
18623
17861
|
Hash256: hash_256_1.Hash256,
|
18624
17862
|
Issue: issue_1.Issue,
|
17863
|
+
Number: st_number_1.STNumber,
|
18625
17864
|
PathSet: path_set_1.PathSet,
|
18626
17865
|
STArray: st_array_1.STArray,
|
18627
17866
|
STObject: st_object_1.STObject,
|
@@ -19020,11 +18259,13 @@ class SerializedType {
|
|
19020
18259
|
}
|
19021
18260
|
static fromParser(parser, hint) {
|
19022
18261
|
throw new Error('fromParser not implemented');
|
19023
|
-
|
18262
|
+
// removed by dead control flow
|
18263
|
+
{}
|
19024
18264
|
}
|
19025
18265
|
static from(value) {
|
19026
18266
|
throw new Error('from not implemented');
|
19027
|
-
|
18267
|
+
// removed by dead control flow
|
18268
|
+
{}
|
19028
18269
|
}
|
19029
18270
|
/**
|
19030
18271
|
* Write the bytes representation of a SerializedType to a BytesList
|
@@ -19207,6 +18448,224 @@ class STArray extends serialized_type_1.SerializedType {
|
|
19207
18448
|
exports.STArray = STArray;
|
19208
18449
|
|
19209
18450
|
|
18451
|
+
/***/ }),
|
18452
|
+
|
18453
|
+
/***/ "../../node_modules/ripple-binary-codec/dist/types/st-number.js":
|
18454
|
+
/*!**********************************************************************!*\
|
18455
|
+
!*** ../../node_modules/ripple-binary-codec/dist/types/st-number.js ***!
|
18456
|
+
\**********************************************************************/
|
18457
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
18458
|
+
|
18459
|
+
"use strict";
|
18460
|
+
|
18461
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
18462
|
+
exports.STNumber = void 0;
|
18463
|
+
const serialized_type_1 = __webpack_require__(/*! ./serialized-type */ "../../node_modules/ripple-binary-codec/dist/types/serialized-type.js");
|
18464
|
+
const utils_1 = __webpack_require__(/*! ../utils */ "../../node_modules/ripple-binary-codec/dist/utils.js");
|
18465
|
+
/**
|
18466
|
+
* Constants for mantissa and exponent normalization per XRPL Number spec.
|
18467
|
+
* These define allowed magnitude for mantissa and exponent after normalization.
|
18468
|
+
*/
|
18469
|
+
const MIN_MANTISSA = BigInt('1000000000000000');
|
18470
|
+
const MAX_MANTISSA = BigInt('9999999999999999');
|
18471
|
+
const MIN_EXPONENT = -32768;
|
18472
|
+
const MAX_EXPONENT = 32768;
|
18473
|
+
const DEFAULT_VALUE_EXPONENT = -2147483648;
|
18474
|
+
/**
|
18475
|
+
* Extract mantissa, exponent, and sign from a number string.
|
18476
|
+
*
|
18477
|
+
* @param val - The string representing the number (may be integer, decimal, or scientific notation).
|
18478
|
+
* @returns Object containing mantissa (BigInt), exponent (number), and isNegative (boolean).
|
18479
|
+
* @throws Error if the string cannot be parsed as a valid number.
|
18480
|
+
*
|
18481
|
+
* Examples:
|
18482
|
+
* '123' -> { mantissa: 123n, exponent: 0, isNegative: false }
|
18483
|
+
* '-00123.45' -> { mantissa: -12345n, exponent: -2, isNegative: true }
|
18484
|
+
* '+7.1e2' -> { mantissa: 71n, exponent: -1 + 2 = 1, isNegative: false }
|
18485
|
+
*/
|
18486
|
+
function extractNumberPartsFromString(val) {
|
18487
|
+
/**
|
18488
|
+
* Regex for parsing decimal/float/scientific number strings with optional sign, integer, decimal, and exponent parts.
|
18489
|
+
*
|
18490
|
+
* Pattern: /^([-+]?)([0-9]+)(?:\.([0-9]+))?(?:[eE]([+-]?[0-9]+))?$/
|
18491
|
+
*
|
18492
|
+
* Breakdown:
|
18493
|
+
* 1. ([-+]?) - Optional '+' or '-' sign at the start.
|
18494
|
+
* 2. ([0-9]+) - Integer part: one or more digits (leading zeros allowed).
|
18495
|
+
* 3. (?:\.([0-9]+))? - Optional decimal point followed by one or more digits.
|
18496
|
+
* 4. (?:[eE]([+-]?[0-9]+))? - Optional exponent, starting with 'e' or 'E', optional sign, and digits.
|
18497
|
+
*
|
18498
|
+
* Notes:
|
18499
|
+
* - Leading zeros are accepted and normalized by code after parsing.
|
18500
|
+
* - Empty decimal ('123.') and missing integer ('.456') are NOT matched—must be fully specified.
|
18501
|
+
*/
|
18502
|
+
const regex = /^([-+]?)([0-9]+)(?:\.([0-9]+))?(?:[eE]([+-]?[0-9]+))?$/;
|
18503
|
+
const match = regex.exec(val);
|
18504
|
+
if (!match)
|
18505
|
+
throw new Error(`Unable to parse number from string: ${val}`);
|
18506
|
+
const [, sign, intPart, fracPart, expPart] = match;
|
18507
|
+
// Remove leading zeros (unless the entire intPart is zeros)
|
18508
|
+
const cleanIntPart = intPart.replace(/^0+(?=\d)/, '') || '0';
|
18509
|
+
let mantissaStr = cleanIntPart;
|
18510
|
+
let exponent = 0;
|
18511
|
+
if (fracPart) {
|
18512
|
+
mantissaStr += fracPart;
|
18513
|
+
exponent -= fracPart.length;
|
18514
|
+
}
|
18515
|
+
if (expPart)
|
18516
|
+
exponent += parseInt(expPart, 10);
|
18517
|
+
let mantissa = BigInt(mantissaStr);
|
18518
|
+
if (sign === '-')
|
18519
|
+
mantissa = -mantissa;
|
18520
|
+
const isNegative = mantissa < BigInt(0);
|
18521
|
+
return { mantissa, exponent, isNegative };
|
18522
|
+
}
|
18523
|
+
/**
|
18524
|
+
* Normalize the mantissa and exponent to XRPL constraints.
|
18525
|
+
*
|
18526
|
+
* Ensures that after normalization, the mantissa is between MIN_MANTISSA and MAX_MANTISSA (unless zero).
|
18527
|
+
* Adjusts the exponent as needed by shifting the mantissa left/right (multiplying/dividing by 10).
|
18528
|
+
*
|
18529
|
+
* @param mantissa - The unnormalized mantissa (BigInt).
|
18530
|
+
* @param exponent - The unnormalized exponent (number).
|
18531
|
+
* @returns An object with normalized mantissa and exponent.
|
18532
|
+
* @throws Error if the number cannot be normalized within allowed exponent range.
|
18533
|
+
*/
|
18534
|
+
function normalize(mantissa, exponent) {
|
18535
|
+
let m = mantissa < BigInt(0) ? -mantissa : mantissa;
|
18536
|
+
const isNegative = mantissa < BigInt(0);
|
18537
|
+
while (m !== BigInt(0) && m < MIN_MANTISSA && exponent > MIN_EXPONENT) {
|
18538
|
+
exponent -= 1;
|
18539
|
+
m *= BigInt(10);
|
18540
|
+
}
|
18541
|
+
while (m > MAX_MANTISSA) {
|
18542
|
+
if (exponent >= MAX_EXPONENT)
|
18543
|
+
throw new Error('Mantissa and exponent are too large');
|
18544
|
+
exponent += 1;
|
18545
|
+
m /= BigInt(10);
|
18546
|
+
}
|
18547
|
+
if (isNegative)
|
18548
|
+
m = -m;
|
18549
|
+
return { mantissa: m, exponent };
|
18550
|
+
}
|
18551
|
+
/**
|
18552
|
+
* STNumber: Encodes XRPL's "Number" type.
|
18553
|
+
*
|
18554
|
+
* - Always encoded as 12 bytes: 8-byte signed mantissa, 4-byte signed exponent, both big-endian.
|
18555
|
+
* - Can only be constructed from a valid number string or another STNumber instance.
|
18556
|
+
*
|
18557
|
+
* Usage:
|
18558
|
+
* STNumber.from("1.2345e5")
|
18559
|
+
* STNumber.from("-123")
|
18560
|
+
* STNumber.fromParser(parser)
|
18561
|
+
*/
|
18562
|
+
class STNumber extends serialized_type_1.SerializedType {
|
18563
|
+
/**
|
18564
|
+
* Construct a STNumber from 12 bytes (8 for mantissa, 4 for exponent).
|
18565
|
+
* @param bytes - 12-byte Uint8Array
|
18566
|
+
* @throws Error if input is not a Uint8Array of length 12.
|
18567
|
+
*/
|
18568
|
+
constructor(bytes) {
|
18569
|
+
const used = bytes !== null && bytes !== void 0 ? bytes : STNumber.defaultBytes;
|
18570
|
+
if (!(used instanceof Uint8Array) || used.length !== 12) {
|
18571
|
+
throw new Error(`STNumber must be constructed from a 12-byte Uint8Array, got ${used === null || used === void 0 ? void 0 : used.length}`);
|
18572
|
+
}
|
18573
|
+
super(used);
|
18574
|
+
}
|
18575
|
+
/**
|
18576
|
+
* Construct from a number string (or another STNumber).
|
18577
|
+
*
|
18578
|
+
* @param value - A string, or STNumber instance.
|
18579
|
+
* @returns STNumber instance.
|
18580
|
+
* @throws Error if not a string or STNumber.
|
18581
|
+
*/
|
18582
|
+
static from(value) {
|
18583
|
+
if (value instanceof STNumber) {
|
18584
|
+
return value;
|
18585
|
+
}
|
18586
|
+
if (typeof value === 'string') {
|
18587
|
+
return STNumber.fromValue(value);
|
18588
|
+
}
|
18589
|
+
throw new Error('STNumber.from: Only string or STNumber instance is supported');
|
18590
|
+
}
|
18591
|
+
/**
|
18592
|
+
* Construct from a number string (integer, decimal, or scientific notation).
|
18593
|
+
* Handles normalization to XRPL Number constraints.
|
18594
|
+
*
|
18595
|
+
* @param val - The number as a string (e.g. '1.23', '-123e5').
|
18596
|
+
* @returns STNumber instance
|
18597
|
+
* @throws Error if val is not a valid number string.
|
18598
|
+
*/
|
18599
|
+
static fromValue(val) {
|
18600
|
+
const { mantissa, exponent, isNegative } = extractNumberPartsFromString(val);
|
18601
|
+
let normalizedMantissa;
|
18602
|
+
let normalizedExponent;
|
18603
|
+
if (mantissa === BigInt(0) && exponent === 0 && !isNegative) {
|
18604
|
+
normalizedMantissa = BigInt(0);
|
18605
|
+
normalizedExponent = DEFAULT_VALUE_EXPONENT;
|
18606
|
+
}
|
18607
|
+
else {
|
18608
|
+
;
|
18609
|
+
({ mantissa: normalizedMantissa, exponent: normalizedExponent } =
|
18610
|
+
normalize(mantissa, exponent));
|
18611
|
+
}
|
18612
|
+
const bytes = new Uint8Array(12);
|
18613
|
+
(0, utils_1.writeInt64BE)(bytes, normalizedMantissa, 0);
|
18614
|
+
(0, utils_1.writeInt32BE)(bytes, normalizedExponent, 8);
|
18615
|
+
return new STNumber(bytes);
|
18616
|
+
}
|
18617
|
+
/**
|
18618
|
+
* Read a STNumber from a BinaryParser stream (12 bytes).
|
18619
|
+
* @param parser - BinaryParser positioned at the start of a number
|
18620
|
+
* @returns STNumber instance
|
18621
|
+
*/
|
18622
|
+
static fromParser(parser) {
|
18623
|
+
return new STNumber(parser.read(12));
|
18624
|
+
}
|
18625
|
+
/**
|
18626
|
+
* Convert this STNumber to a normalized string representation.
|
18627
|
+
* The output is decimal or scientific notation, depending on exponent range.
|
18628
|
+
* Follows XRPL convention: zero is "0", other values are normalized to a canonical string.
|
18629
|
+
*
|
18630
|
+
* @returns String representation of the value
|
18631
|
+
*/
|
18632
|
+
// eslint-disable-next-line complexity -- required
|
18633
|
+
toJSON() {
|
18634
|
+
const b = this.bytes;
|
18635
|
+
if (!b || b.length !== 12)
|
18636
|
+
throw new Error('STNumber internal bytes not set or wrong length');
|
18637
|
+
// Signed 64-bit mantissa
|
18638
|
+
const mantissa = (0, utils_1.readInt64BE)(b, 0);
|
18639
|
+
// Signed 32-bit exponent
|
18640
|
+
const exponent = (0, utils_1.readInt32BE)(b, 8);
|
18641
|
+
// Special zero: XRPL encodes canonical zero as mantissa=0, exponent=DEFAULT_VALUE_EXPONENT.
|
18642
|
+
if (mantissa === BigInt(0) && exponent === DEFAULT_VALUE_EXPONENT) {
|
18643
|
+
return '0';
|
18644
|
+
}
|
18645
|
+
if (exponent === 0)
|
18646
|
+
return mantissa.toString();
|
18647
|
+
// Use scientific notation for small/large exponents, decimal otherwise
|
18648
|
+
if (exponent < -25 || exponent > -5) {
|
18649
|
+
return `${mantissa}e${exponent}`;
|
18650
|
+
}
|
18651
|
+
// Decimal rendering for -25 <= exp <= -5
|
18652
|
+
const isNegative = mantissa < BigInt(0);
|
18653
|
+
const mantissaAbs = mantissa < BigInt(0) ? -mantissa : mantissa;
|
18654
|
+
const padPrefix = 27;
|
18655
|
+
const padSuffix = 23;
|
18656
|
+
const mantissaStr = mantissaAbs.toString();
|
18657
|
+
const rawValue = '0'.repeat(padPrefix) + mantissaStr + '0'.repeat(padSuffix);
|
18658
|
+
const OFFSET = exponent + 43;
|
18659
|
+
const integerPart = rawValue.slice(0, OFFSET).replace(/^0+/, '') || '0';
|
18660
|
+
const fractionPart = rawValue.slice(OFFSET).replace(/0+$/, '');
|
18661
|
+
return `${isNegative ? '-' : ''}${integerPart}${fractionPart ? '.' + fractionPart : ''}`;
|
18662
|
+
}
|
18663
|
+
}
|
18664
|
+
exports.STNumber = STNumber;
|
18665
|
+
/** 12 zero bytes, represents canonical zero. */
|
18666
|
+
STNumber.defaultBytes = new Uint8Array(12);
|
18667
|
+
|
18668
|
+
|
19210
18669
|
/***/ }),
|
19211
18670
|
|
19212
18671
|
/***/ "../../node_modules/ripple-binary-codec/dist/types/st-object.js":
|
@@ -19336,13 +18795,18 @@ class STObject extends serialized_type_1.SerializedType {
|
|
19336
18795
|
sorted = sorted.filter(filter);
|
19337
18796
|
}
|
19338
18797
|
sorted.forEach((field) => {
|
18798
|
+
var _a;
|
19339
18799
|
const associatedValue = field.type.name === ST_OBJECT
|
19340
18800
|
? this.from(xAddressDecoded[field.name], undefined, definitions)
|
19341
18801
|
: field.type.name === 'STArray'
|
19342
18802
|
? st_array_1.STArray.from(xAddressDecoded[field.name], definitions)
|
19343
18803
|
: field.type.name === 'UInt64'
|
19344
18804
|
? uint_64_1.UInt64.from(xAddressDecoded[field.name], field.name)
|
19345
|
-
: field.associatedType.from
|
18805
|
+
: ((_a = field.associatedType) === null || _a === void 0 ? void 0 : _a.from)
|
18806
|
+
? field.associatedType.from(xAddressDecoded[field.name])
|
18807
|
+
: (() => {
|
18808
|
+
throw new Error(`Type ${field.type.name} for field ${field.name} is missing associatedType.from`);
|
18809
|
+
})();
|
19346
18810
|
if (associatedValue == undefined) {
|
19347
18811
|
throw new TypeError(`Unable to interpret "${field.name}: ${xAddressDecoded[field.name]}".`);
|
19348
18812
|
}
|
@@ -19932,7 +19396,7 @@ XChainBridge.TYPE_ORDER = [
|
|
19932
19396
|
"use strict";
|
19933
19397
|
|
19934
19398
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
19935
|
-
exports.compare = exports.equal = exports.readUInt32BE = exports.readUInt16BE = exports.writeUInt32BE = exports.writeUInt16BE = exports.writeUInt8 = void 0;
|
19399
|
+
exports.compare = exports.equal = exports.readInt64BE = exports.readInt32BE = exports.readUInt32BE = exports.readUInt16BE = exports.writeInt64BE = exports.writeInt32BE = exports.writeUInt32BE = exports.writeUInt16BE = exports.writeUInt8 = void 0;
|
19936
19400
|
/**
|
19937
19401
|
* Writes value to array at the specified offset. The value must be a valid unsigned 8-bit integer.
|
19938
19402
|
* @param array Uint8Array to be written to
|
@@ -19969,6 +19433,28 @@ function writeUInt32BE(array, value, offset) {
|
|
19969
19433
|
array[offset + 3] = value & 0xff;
|
19970
19434
|
}
|
19971
19435
|
exports.writeUInt32BE = writeUInt32BE;
|
19436
|
+
/**
|
19437
|
+
* Writes a signed 32-bit integer to a Uint8Array at the specified offset (big-endian).
|
19438
|
+
*
|
19439
|
+
* @param array - The Uint8Array to write to.
|
19440
|
+
* @param value - The signed 32-bit integer to write.
|
19441
|
+
* @param offset - The offset at which to write.
|
19442
|
+
*/
|
19443
|
+
function writeInt32BE(array, value, offset) {
|
19444
|
+
new DataView(array.buffer, array.byteOffset, array.byteLength).setInt32(offset, value, false);
|
19445
|
+
}
|
19446
|
+
exports.writeInt32BE = writeInt32BE;
|
19447
|
+
/**
|
19448
|
+
* Writes a signed 64-bit integer (BigInt) to a Uint8Array at the specified offset (big-endian).
|
19449
|
+
*
|
19450
|
+
* @param array - The Uint8Array to write to.
|
19451
|
+
* @param value - The signed 64-bit integer (BigInt) to write.
|
19452
|
+
* @param offset - The offset at which to write.
|
19453
|
+
*/
|
19454
|
+
function writeInt64BE(array, value, offset) {
|
19455
|
+
new DataView(array.buffer, array.byteOffset, array.byteLength).setBigInt64(offset, value, false);
|
19456
|
+
}
|
19457
|
+
exports.writeInt64BE = writeInt64BE;
|
19972
19458
|
/**
|
19973
19459
|
* Reads an unsigned, big-endian 16-bit integer from the array at the specified offset.
|
19974
19460
|
* @param array Uint8Array to read
|
@@ -19987,6 +19473,28 @@ function readUInt32BE(array, offset) {
|
|
19987
19473
|
return new DataView(array.buffer).getUint32(offset, false).toString(10);
|
19988
19474
|
}
|
19989
19475
|
exports.readUInt32BE = readUInt32BE;
|
19476
|
+
/**
|
19477
|
+
* Reads a signed 32-bit integer from a Uint8Array at the specified offset (big-endian).
|
19478
|
+
*
|
19479
|
+
* @param array - The Uint8Array to read from.
|
19480
|
+
* @param offset - The offset at which to start reading.
|
19481
|
+
* @returns The signed 32-bit integer.
|
19482
|
+
*/
|
19483
|
+
function readInt32BE(array, offset) {
|
19484
|
+
return new DataView(array.buffer, array.byteOffset, array.byteLength).getInt32(offset, false);
|
19485
|
+
}
|
19486
|
+
exports.readInt32BE = readInt32BE;
|
19487
|
+
/**
|
19488
|
+
* Reads a signed 64-bit integer (BigInt) from a Uint8Array at the specified offset (big-endian).
|
19489
|
+
*
|
19490
|
+
* @param array - The Uint8Array to read from.
|
19491
|
+
* @param offset - The offset at which to start reading.
|
19492
|
+
* @returns The signed 64-bit integer (BigInt).
|
19493
|
+
*/
|
19494
|
+
function readInt64BE(array, offset) {
|
19495
|
+
return new DataView(array.buffer, array.byteOffset, array.byteLength).getBigInt64(offset, false);
|
19496
|
+
}
|
19497
|
+
exports.readInt64BE = readInt64BE;
|
19990
19498
|
/**
|
19991
19499
|
* Compares two Uint8Array or ArrayBuffers
|
19992
19500
|
* @param a first array to compare
|
@@ -20542,7 +20050,7 @@ exports["default"] = ECDSA;
|
|
20542
20050
|
"use strict";
|
20543
20051
|
|
20544
20052
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
20545
|
-
exports.
|
20053
|
+
exports.getFaucetPath = exports.getFaucetHost = exports.faucetNetworkIDs = exports.faucetNetworkPaths = exports.FaucetNetwork = void 0;
|
20546
20054
|
const errors_1 = __webpack_require__(/*! ../errors */ "./dist/npm/errors.js");
|
20547
20055
|
var FaucetNetwork;
|
20548
20056
|
(function (FaucetNetwork) {
|
@@ -20550,35 +20058,36 @@ var FaucetNetwork;
|
|
20550
20058
|
FaucetNetwork["Devnet"] = "faucet.devnet.rippletest.net";
|
20551
20059
|
FaucetNetwork["WasmDevnet"] = "wasmfaucet.devnet.rippletest.net";
|
20552
20060
|
})(FaucetNetwork || (exports.FaucetNetwork = FaucetNetwork = {}));
|
20553
|
-
exports.
|
20061
|
+
exports.faucetNetworkPaths = {
|
20554
20062
|
[FaucetNetwork.Testnet]: '/accounts',
|
20555
20063
|
[FaucetNetwork.Devnet]: '/accounts',
|
20556
20064
|
[FaucetNetwork.WasmDevnet]: '/accounts',
|
20557
20065
|
};
|
20066
|
+
exports.faucetNetworkIDs = new Map([
|
20067
|
+
[1, FaucetNetwork.Testnet],
|
20068
|
+
[2, FaucetNetwork.Devnet],
|
20069
|
+
[2002, FaucetNetwork.WasmDevnet],
|
20070
|
+
]);
|
20558
20071
|
function getFaucetHost(client) {
|
20559
|
-
|
20560
|
-
|
20561
|
-
return FaucetNetwork.Testnet;
|
20562
|
-
}
|
20563
|
-
if (connectionUrl.includes('sidechain-net2')) {
|
20564
|
-
throw new errors_1.XRPLFaucetError('Cannot fund an account on an issuing chain. Accounts must be created via the bridge.');
|
20072
|
+
if (client.networkID == null) {
|
20073
|
+
throw new errors_1.XRPLFaucetError('Cannot create faucet URL without networkID or the faucetHost information');
|
20565
20074
|
}
|
20566
|
-
if (
|
20567
|
-
return
|
20075
|
+
if (exports.faucetNetworkIDs.has(client.networkID)) {
|
20076
|
+
return exports.faucetNetworkIDs.get(client.networkID);
|
20568
20077
|
}
|
20569
|
-
if (
|
20570
|
-
|
20078
|
+
if (client.networkID === 0) {
|
20079
|
+
throw new errors_1.XRPLFaucetError('Faucet is not available for mainnet.');
|
20571
20080
|
}
|
20572
20081
|
throw new errors_1.XRPLFaucetError('Faucet URL is not defined or inferrable.');
|
20573
20082
|
}
|
20574
20083
|
exports.getFaucetHost = getFaucetHost;
|
20575
|
-
function
|
20084
|
+
function getFaucetPath(hostname) {
|
20576
20085
|
if (hostname === undefined) {
|
20577
20086
|
return '/accounts';
|
20578
20087
|
}
|
20579
|
-
return exports.
|
20088
|
+
return exports.faucetNetworkPaths[hostname] || '/accounts';
|
20580
20089
|
}
|
20581
|
-
exports.
|
20090
|
+
exports.getFaucetPath = getFaucetPath;
|
20582
20091
|
|
20583
20092
|
|
20584
20093
|
/***/ }),
|
@@ -20634,7 +20143,7 @@ function requestFunding(options, client, startingBalance, walletToFund, postBody
|
|
20634
20143
|
if (!hostname) {
|
20635
20144
|
throw new errors_1.XRPLFaucetError('No faucet hostname could be derived');
|
20636
20145
|
}
|
20637
|
-
const pathname = (_b = options.faucetPath) !== null && _b !== void 0 ? _b : (0, defaultFaucets_1.
|
20146
|
+
const pathname = (_b = options.faucetPath) !== null && _b !== void 0 ? _b : (0, defaultFaucets_1.getFaucetPath)(hostname);
|
20638
20147
|
const response = yield fetch(`https://${hostname}${pathname}`, {
|
20639
20148
|
method: 'POST',
|
20640
20149
|
headers: {
|
@@ -20657,22 +20166,14 @@ function processSuccessfulResponse(client, classicAddress, walletToFund, startin
|
|
20657
20166
|
if (!classicAddress) {
|
20658
20167
|
return Promise.reject(new errors_1.XRPLFaucetError(`The faucet account is undefined`));
|
20659
20168
|
}
|
20660
|
-
|
20661
|
-
|
20662
|
-
|
20663
|
-
|
20664
|
-
|
20665
|
-
|
20666
|
-
};
|
20667
|
-
}
|
20668
|
-
throw new errors_1.XRPLFaucetError(`Unable to fund address with faucet after waiting ${INTERVAL_SECONDS * MAX_ATTEMPTS} seconds`);
|
20669
|
-
}
|
20670
|
-
catch (err) {
|
20671
|
-
if (err instanceof Error) {
|
20672
|
-
throw new errors_1.XRPLFaucetError(err.message);
|
20673
|
-
}
|
20674
|
-
throw err;
|
20169
|
+
const updatedBalance = yield getUpdatedBalance(client, classicAddress, startingBalance);
|
20170
|
+
if (updatedBalance > startingBalance) {
|
20171
|
+
return {
|
20172
|
+
wallet: walletToFund,
|
20173
|
+
balance: updatedBalance,
|
20174
|
+
};
|
20675
20175
|
}
|
20176
|
+
throw new errors_1.XRPLFaucetError(`Unable to fund address with faucet after waiting ${INTERVAL_SECONDS * MAX_ATTEMPTS} seconds`);
|
20676
20177
|
});
|
20677
20178
|
}
|
20678
20179
|
function processError(response, body) {
|
@@ -20747,7 +20248,9 @@ const ripple_keypairs_1 = __webpack_require__(/*! ripple-keypairs */ "../../node
|
|
20747
20248
|
const ECDSA_1 = __importDefault(__webpack_require__(/*! ../ECDSA */ "./dist/npm/ECDSA.js"));
|
20748
20249
|
const errors_1 = __webpack_require__(/*! ../errors */ "./dist/npm/errors.js");
|
20749
20250
|
const transactions_1 = __webpack_require__(/*! ../models/transactions */ "./dist/npm/models/transactions/index.js");
|
20750
|
-
const
|
20251
|
+
const common_1 = __webpack_require__(/*! ../models/transactions/common */ "./dist/npm/models/transactions/common.js");
|
20252
|
+
const utils_2 = __webpack_require__(/*! ../models/utils */ "./dist/npm/models/utils/index.js");
|
20253
|
+
const utils_3 = __webpack_require__(/*! ../sugar/utils */ "./dist/npm/sugar/utils.js");
|
20751
20254
|
const collections_1 = __webpack_require__(/*! ../utils/collections */ "./dist/npm/utils/collections.js");
|
20752
20255
|
const hashLedger_1 = __webpack_require__(/*! ../utils/hashes/hashLedger */ "./dist/npm/utils/hashes/hashLedger.js");
|
20753
20256
|
const rfc1751_1 = __webpack_require__(/*! ./rfc1751 */ "./dist/npm/Wallet/rfc1751.js");
|
@@ -20767,7 +20270,7 @@ class Wallet {
|
|
20767
20270
|
this.publicKey = publicKey;
|
20768
20271
|
this.privateKey = privateKey;
|
20769
20272
|
this.classicAddress = opts.masterAddress
|
20770
|
-
? (0,
|
20273
|
+
? (0, utils_3.ensureClassicAddress)(opts.masterAddress)
|
20771
20274
|
: (0, ripple_keypairs_1.deriveAddress)(publicKey);
|
20772
20275
|
this.seed = opts.seed;
|
20773
20276
|
}
|
@@ -20848,7 +20351,7 @@ class Wallet {
|
|
20848
20351
|
}
|
20849
20352
|
sign(transaction, multisign) {
|
20850
20353
|
let multisignAddress = false;
|
20851
|
-
if (typeof multisign === 'string'
|
20354
|
+
if (typeof multisign === 'string') {
|
20852
20355
|
multisignAddress = multisign;
|
20853
20356
|
}
|
20854
20357
|
else if (multisign) {
|
@@ -20860,9 +20363,12 @@ class Wallet {
|
|
20860
20363
|
}
|
20861
20364
|
removeTrailingZeros(tx);
|
20862
20365
|
(0, transactions_1.validate)(tx);
|
20366
|
+
if ((0, utils_2.hasFlag)(tx, common_1.GlobalFlags.tfInnerBatchTxn, 'tfInnerBatchTxn')) {
|
20367
|
+
throw new errors_1.ValidationError('Cannot sign a Batch inner transaction.');
|
20368
|
+
}
|
20863
20369
|
const txToSignAndEncode = Object.assign({}, tx);
|
20864
|
-
txToSignAndEncode.SigningPubKey = multisignAddress ? '' : this.publicKey;
|
20865
20370
|
if (multisignAddress) {
|
20371
|
+
txToSignAndEncode.SigningPubKey = '';
|
20866
20372
|
const signer = {
|
20867
20373
|
Account: multisignAddress,
|
20868
20374
|
SigningPubKey: this.publicKey,
|
@@ -20871,6 +20377,7 @@ class Wallet {
|
|
20871
20377
|
txToSignAndEncode.Signers = [{ Signer: signer }];
|
20872
20378
|
}
|
20873
20379
|
else {
|
20380
|
+
txToSignAndEncode.SigningPubKey = this.publicKey;
|
20874
20381
|
txToSignAndEncode.TxnSignature = computeSignature(txToSignAndEncode, this.privateKey);
|
20875
20382
|
}
|
20876
20383
|
const serialized = (0, ripple_binary_codec_1.encode)(txToSignAndEncode);
|
@@ -21070,19 +20577,17 @@ module.exports = /*#__PURE__*/JSON.parse('["A","ABE","ACE","ACT","AD","ADA","ADD
|
|
21070
20577
|
|
21071
20578
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
21072
20579
|
exports.multisign = exports.verifySignature = void 0;
|
21073
|
-
const utils_1 = __webpack_require__(/*! @xrplf/isomorphic/utils */ "../../node_modules/@xrplf/isomorphic/dist/utils/browser.js");
|
21074
|
-
const bignumber_js_1 = __webpack_require__(/*! bignumber.js */ "../../node_modules/bignumber.js/bignumber.js");
|
21075
|
-
const ripple_address_codec_1 = __webpack_require__(/*! ripple-address-codec */ "../../node_modules/ripple-address-codec/dist/index.js");
|
21076
20580
|
const ripple_binary_codec_1 = __webpack_require__(/*! ripple-binary-codec */ "../../node_modules/ripple-binary-codec/dist/index.js");
|
21077
20581
|
const ripple_keypairs_1 = __webpack_require__(/*! ripple-keypairs */ "../../node_modules/ripple-keypairs/dist/index.js");
|
21078
20582
|
const errors_1 = __webpack_require__(/*! ../errors */ "./dist/npm/errors.js");
|
21079
20583
|
const transactions_1 = __webpack_require__(/*! ../models/transactions */ "./dist/npm/models/transactions/index.js");
|
20584
|
+
const utils_1 = __webpack_require__(/*! ./utils */ "./dist/npm/Wallet/utils.js");
|
21080
20585
|
function multisign(transactions) {
|
21081
20586
|
if (transactions.length === 0) {
|
21082
20587
|
throw new errors_1.ValidationError('There were 0 transactions to multisign');
|
21083
20588
|
}
|
21084
20589
|
const decodedTransactions = transactions.map((txOrBlob) => {
|
21085
|
-
return getDecodedTransaction(txOrBlob);
|
20590
|
+
return (0, utils_1.getDecodedTransaction)(txOrBlob);
|
21086
20591
|
});
|
21087
20592
|
decodedTransactions.forEach((tx) => {
|
21088
20593
|
(0, transactions_1.validate)(tx);
|
@@ -21098,7 +20603,7 @@ function multisign(transactions) {
|
|
21098
20603
|
}
|
21099
20604
|
exports.multisign = multisign;
|
21100
20605
|
function verifySignature(tx, publicKey) {
|
21101
|
-
const decodedTx = getDecodedTransaction(tx);
|
20606
|
+
const decodedTx = (0, utils_1.getDecodedTransaction)(tx);
|
21102
20607
|
let key = publicKey;
|
21103
20608
|
if (typeof decodedTx.TxnSignature !== 'string' || !decodedTx.TxnSignature) {
|
21104
20609
|
throw new Error('Transaction is missing a signature, TxnSignature');
|
@@ -21124,23 +20629,47 @@ function validateTransactionEquivalence(transactions) {
|
|
21124
20629
|
function getTransactionWithAllSigners(transactions) {
|
21125
20630
|
const sortedSigners = transactions
|
21126
20631
|
.flatMap((tx) => { var _a; return (_a = tx.Signers) !== null && _a !== void 0 ? _a : []; })
|
21127
|
-
.sort(compareSigners);
|
20632
|
+
.sort((signer1, signer2) => (0, utils_1.compareSigners)(signer1.Signer, signer2.Signer));
|
21128
20633
|
return Object.assign(Object.assign({}, transactions[0]), { Signers: sortedSigners });
|
21129
20634
|
}
|
20635
|
+
|
20636
|
+
|
20637
|
+
/***/ }),
|
20638
|
+
|
20639
|
+
/***/ "./dist/npm/Wallet/utils.js":
|
20640
|
+
/*!**********************************!*\
|
20641
|
+
!*** ./dist/npm/Wallet/utils.js ***!
|
20642
|
+
\**********************************/
|
20643
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
20644
|
+
|
20645
|
+
"use strict";
|
20646
|
+
|
20647
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
20648
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
20649
|
+
};
|
20650
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
20651
|
+
exports.getDecodedTransaction = exports.addressToBigNumber = exports.NUM_BITS_IN_HEX = exports.compareSigners = void 0;
|
20652
|
+
const utils_1 = __webpack_require__(/*! @xrplf/isomorphic/utils */ "../../node_modules/@xrplf/isomorphic/dist/utils/browser.js");
|
20653
|
+
const bignumber_js_1 = __importDefault(__webpack_require__(/*! bignumber.js */ "../../node_modules/bignumber.js/bignumber.js"));
|
20654
|
+
const ripple_address_codec_1 = __webpack_require__(/*! ripple-address-codec */ "../../node_modules/ripple-address-codec/dist/index.js");
|
20655
|
+
const ripple_binary_codec_1 = __webpack_require__(/*! ripple-binary-codec */ "../../node_modules/ripple-binary-codec/dist/index.js");
|
21130
20656
|
function compareSigners(left, right) {
|
21131
|
-
return addressToBigNumber(left.
|
20657
|
+
return addressToBigNumber(left.Account).comparedTo(addressToBigNumber(right.Account));
|
21132
20658
|
}
|
21133
|
-
|
20659
|
+
exports.compareSigners = compareSigners;
|
20660
|
+
exports.NUM_BITS_IN_HEX = 16;
|
21134
20661
|
function addressToBigNumber(address) {
|
21135
20662
|
const hex = (0, utils_1.bytesToHex)((0, ripple_address_codec_1.decodeAccountID)(address));
|
21136
|
-
return new bignumber_js_1.
|
20663
|
+
return new bignumber_js_1.default(hex, exports.NUM_BITS_IN_HEX);
|
21137
20664
|
}
|
20665
|
+
exports.addressToBigNumber = addressToBigNumber;
|
21138
20666
|
function getDecodedTransaction(txOrBlob) {
|
21139
20667
|
if (typeof txOrBlob === 'object') {
|
21140
20668
|
return (0, ripple_binary_codec_1.decode)((0, ripple_binary_codec_1.encode)(txOrBlob));
|
21141
20669
|
}
|
21142
20670
|
return (0, ripple_binary_codec_1.decode)(txOrBlob);
|
21143
20671
|
}
|
20672
|
+
exports.getDecodedTransaction = getDecodedTransaction;
|
21144
20673
|
|
21145
20674
|
|
21146
20675
|
/***/ }),
|
@@ -21357,7 +20886,7 @@ class RequestManager {
|
|
21357
20886
|
return [newId, newRequest, newPromise];
|
21358
20887
|
}
|
21359
20888
|
handleResponse(response) {
|
21360
|
-
var _a, _b;
|
20889
|
+
var _a, _b, _c;
|
21361
20890
|
if (response.id == null ||
|
21362
20891
|
!(typeof response.id === 'string' || typeof response.id === 'number')) {
|
21363
20892
|
throw new errors_1.ResponseFormatError('valid id not found in response', response);
|
@@ -21371,12 +20900,12 @@ class RequestManager {
|
|
21371
20900
|
}
|
21372
20901
|
if (response.status === 'error') {
|
21373
20902
|
const errorResponse = response;
|
21374
|
-
const error = new errors_1.RippledError((_a = errorResponse.error_message) !== null && _a !== void 0 ? _a : errorResponse.error, errorResponse);
|
20903
|
+
const error = new errors_1.RippledError((_b = (_a = errorResponse.error_message) !== null && _a !== void 0 ? _a : errorResponse.error_exception) !== null && _b !== void 0 ? _b : errorResponse.error, errorResponse);
|
21375
20904
|
this.reject(response.id, error);
|
21376
20905
|
return;
|
21377
20906
|
}
|
21378
20907
|
if (response.status !== 'success') {
|
21379
|
-
const error = new errors_1.ResponseFormatError(`unrecognized response.status: ${(
|
20908
|
+
const error = new errors_1.ResponseFormatError(`unrecognized response.status: ${(_c = response.status) !== null && _c !== void 0 ? _c : ''}`, response);
|
21380
20909
|
this.reject(response.id, error);
|
21381
20910
|
return;
|
21382
20911
|
}
|
@@ -21905,7 +21434,7 @@ class Client extends eventemitter3_1.EventEmitter {
|
|
21905
21434
|
promises.push((0, autofill_1.setNextValidSequenceNumber)(this, tx));
|
21906
21435
|
}
|
21907
21436
|
if (tx.Fee == null) {
|
21908
|
-
promises.push((0, autofill_1.
|
21437
|
+
promises.push((0, autofill_1.getTransactionFee)(this, tx, signersCount));
|
21909
21438
|
}
|
21910
21439
|
if (tx.LastLedgerSequence == null) {
|
21911
21440
|
promises.push((0, autofill_1.setLatestValidatedLedgerSequence)(this, tx));
|
@@ -21913,24 +21442,15 @@ class Client extends eventemitter3_1.EventEmitter {
|
|
21913
21442
|
if (tx.TransactionType === 'AccountDelete') {
|
21914
21443
|
promises.push((0, autofill_1.checkAccountDeleteBlockers)(this, tx));
|
21915
21444
|
}
|
21445
|
+
if (tx.TransactionType === 'Batch') {
|
21446
|
+
promises.push((0, autofill_1.autofillBatchTxn)(this, tx));
|
21447
|
+
}
|
21916
21448
|
if (tx.TransactionType === 'Payment' && tx.DeliverMax != null) {
|
21917
|
-
|
21918
|
-
tx.Amount = tx.DeliverMax;
|
21919
|
-
}
|
21920
|
-
if (tx.Amount != null && tx.Amount !== tx.DeliverMax) {
|
21921
|
-
return Promise.reject(new errors_1.ValidationError('PaymentTransaction: Amount and DeliverMax fields must be identical when both are provided'));
|
21922
|
-
}
|
21923
|
-
delete tx.DeliverMax;
|
21449
|
+
(0, autofill_1.handleDeliverMax)(tx);
|
21924
21450
|
}
|
21925
21451
|
return Promise.all(promises).then(() => tx);
|
21926
21452
|
});
|
21927
21453
|
}
|
21928
|
-
submit(transaction, opts) {
|
21929
|
-
return __awaiter(this, void 0, void 0, function* () {
|
21930
|
-
const signedTx = yield (0, sugar_1.getSignedTx)(this, transaction, opts);
|
21931
|
-
return (0, sugar_1.submitRequest)(this, signedTx, opts === null || opts === void 0 ? void 0 : opts.failHard);
|
21932
|
-
});
|
21933
|
-
}
|
21934
21454
|
simulate(transaction, opts) {
|
21935
21455
|
var _a;
|
21936
21456
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -21941,6 +21461,12 @@ class Client extends eventemitter3_1.EventEmitter {
|
|
21941
21461
|
return this.request(request);
|
21942
21462
|
});
|
21943
21463
|
}
|
21464
|
+
submit(transaction, opts) {
|
21465
|
+
return __awaiter(this, void 0, void 0, function* () {
|
21466
|
+
const signedTx = yield (0, sugar_1.getSignedTx)(this, transaction, opts);
|
21467
|
+
return (0, sugar_1.submitRequest)(this, signedTx, opts === null || opts === void 0 ? void 0 : opts.failHard);
|
21468
|
+
});
|
21469
|
+
}
|
21944
21470
|
submitAndWait(transaction, opts) {
|
21945
21471
|
return __awaiter(this, void 0, void 0, function* () {
|
21946
21472
|
const signedTx = yield (0, sugar_1.getSignedTx)(this, transaction, opts);
|
@@ -21949,6 +21475,9 @@ class Client extends eventemitter3_1.EventEmitter {
|
|
21949
21475
|
throw new errors_1.ValidationError('Transaction must contain a LastLedgerSequence value for reliable submission.');
|
21950
21476
|
}
|
21951
21477
|
const response = yield (0, sugar_1.submitRequest)(this, signedTx, opts === null || opts === void 0 ? void 0 : opts.failHard);
|
21478
|
+
if (response.result.engine_result.startsWith('tem')) {
|
21479
|
+
throw new errors_1.XrplError(`Transaction failed, ${response.result.engine_result}: ${response.result.engine_result_message}`);
|
21480
|
+
}
|
21952
21481
|
const txHash = utils_1.hashes.hashSignedTx(signedTx);
|
21953
21482
|
return (0, sugar_1.waitForFinalTransactionOutcome)(this, txHash, lastLedger, response.result.engine_result);
|
21954
21483
|
});
|
@@ -22098,7 +21627,7 @@ function amountsEqual(amt1, amt2) {
|
|
22098
21627
|
aValue.isEqualTo(bValue));
|
22099
21628
|
}
|
22100
21629
|
function isPartialPayment(tx, metadata) {
|
22101
|
-
var _a;
|
21630
|
+
var _a, _b;
|
22102
21631
|
if (tx == null || metadata == null || tx.TransactionType !== 'Payment') {
|
22103
21632
|
return false;
|
22104
21633
|
}
|
@@ -22116,7 +21645,7 @@ function isPartialPayment(tx, metadata) {
|
|
22116
21645
|
return false;
|
22117
21646
|
}
|
22118
21647
|
const delivered = meta.delivered_amount;
|
22119
|
-
const amount = tx.DeliverMax;
|
21648
|
+
const amount = (_b = tx.DeliverMax) !== null && _b !== void 0 ? _b : tx.Amount;
|
22120
21649
|
if (delivered === undefined) {
|
22121
21650
|
return false;
|
22122
21651
|
}
|
@@ -22569,13 +22098,13 @@ function validateAMMBid(tx) {
|
|
22569
22098
|
if (tx.Asset == null) {
|
22570
22099
|
throw new errors_1.ValidationError('AMMBid: missing field Asset');
|
22571
22100
|
}
|
22572
|
-
if (!(0, common_1.
|
22101
|
+
if (!(0, common_1.isIssuedCurrency)(tx.Asset)) {
|
22573
22102
|
throw new errors_1.ValidationError('AMMBid: Asset must be a Currency');
|
22574
22103
|
}
|
22575
22104
|
if (tx.Asset2 == null) {
|
22576
22105
|
throw new errors_1.ValidationError('AMMBid: missing field Asset2');
|
22577
22106
|
}
|
22578
|
-
if (!(0, common_1.
|
22107
|
+
if (!(0, common_1.isIssuedCurrency)(tx.Asset2)) {
|
22579
22108
|
throw new errors_1.ValidationError('AMMBid: Asset2 must be a Currency');
|
22580
22109
|
}
|
22581
22110
|
if (tx.BidMin != null && !(0, common_1.isAmount)(tx.BidMin)) {
|
@@ -22585,7 +22114,7 @@ function validateAMMBid(tx) {
|
|
22585
22114
|
throw new errors_1.ValidationError('AMMBid: BidMax must be an Amount');
|
22586
22115
|
}
|
22587
22116
|
if (tx.AuthAccounts != null) {
|
22588
|
-
if (!
|
22117
|
+
if (!(0, common_1.isArray)(tx.AuthAccounts)) {
|
22589
22118
|
throw new errors_1.ValidationError(`AMMBid: AuthAccounts must be an AuthAccount array`);
|
22590
22119
|
}
|
22591
22120
|
if (tx.AuthAccounts.length > MAX_AUTH_ACCOUNTS) {
|
@@ -22597,8 +22126,10 @@ function validateAMMBid(tx) {
|
|
22597
22126
|
exports.validateAMMBid = validateAMMBid;
|
22598
22127
|
function validateAuthAccounts(senderAddress, authAccounts) {
|
22599
22128
|
for (const authAccount of authAccounts) {
|
22600
|
-
if (authAccount
|
22601
|
-
|
22129
|
+
if (!(0, common_1.isRecord)(authAccount)) {
|
22130
|
+
throw new errors_1.ValidationError(`AMMBid: invalid AuthAccounts`);
|
22131
|
+
}
|
22132
|
+
if (!(0, common_1.isRecord)(authAccount.AuthAccount)) {
|
22602
22133
|
throw new errors_1.ValidationError(`AMMBid: invalid AuthAccounts`);
|
22603
22134
|
}
|
22604
22135
|
if (authAccount.AuthAccount.Account == null) {
|
@@ -22636,22 +22167,21 @@ var AMMClawbackFlags;
|
|
22636
22167
|
function validateAMMClawback(tx) {
|
22637
22168
|
(0, common_1.validateBaseTransaction)(tx);
|
22638
22169
|
(0, common_1.validateRequiredField)(tx, 'Holder', common_1.isAccount);
|
22639
|
-
(0, common_1.validateRequiredField)(tx, 'Asset', common_1.
|
22170
|
+
(0, common_1.validateRequiredField)(tx, 'Asset', common_1.isIssuedCurrency);
|
22640
22171
|
const asset = tx.Asset;
|
22641
|
-
const amount = tx.Amount;
|
22642
22172
|
if (tx.Holder === asset.issuer) {
|
22643
22173
|
throw new errors_1.ValidationError('AMMClawback: Holder and Asset.issuer must be distinct');
|
22644
22174
|
}
|
22645
22175
|
if (tx.Account !== asset.issuer) {
|
22646
22176
|
throw new errors_1.ValidationError('AMMClawback: Account must be the same as Asset.issuer');
|
22647
22177
|
}
|
22648
|
-
(0, common_1.validateRequiredField)(tx, 'Asset2', common_1.
|
22649
|
-
(0, common_1.validateOptionalField)(tx, 'Amount', common_1.
|
22178
|
+
(0, common_1.validateRequiredField)(tx, 'Asset2', common_1.isIssuedCurrency);
|
22179
|
+
(0, common_1.validateOptionalField)(tx, 'Amount', common_1.isIssuedCurrencyAmount);
|
22650
22180
|
if (tx.Amount != null) {
|
22651
|
-
if (
|
22181
|
+
if (tx.Amount.currency !== asset.currency) {
|
22652
22182
|
throw new errors_1.ValidationError('AMMClawback: Amount.currency must match Asset.currency');
|
22653
22183
|
}
|
22654
|
-
if (
|
22184
|
+
if (tx.Amount.issuer !== asset.issuer) {
|
22655
22185
|
throw new errors_1.ValidationError('AMMClawback: Amount.issuer must match Amount.issuer');
|
22656
22186
|
}
|
22657
22187
|
}
|
@@ -22720,13 +22250,13 @@ function validateAMMDelete(tx) {
|
|
22720
22250
|
if (tx.Asset == null) {
|
22721
22251
|
throw new errors_1.ValidationError('AMMDelete: missing field Asset');
|
22722
22252
|
}
|
22723
|
-
if (!(0, common_1.
|
22253
|
+
if (!(0, common_1.isIssuedCurrency)(tx.Asset)) {
|
22724
22254
|
throw new errors_1.ValidationError('AMMDelete: Asset must be a Currency');
|
22725
22255
|
}
|
22726
22256
|
if (tx.Asset2 == null) {
|
22727
22257
|
throw new errors_1.ValidationError('AMMDelete: missing field Asset2');
|
22728
22258
|
}
|
22729
|
-
if (!(0, common_1.
|
22259
|
+
if (!(0, common_1.isIssuedCurrency)(tx.Asset2)) {
|
22730
22260
|
throw new errors_1.ValidationError('AMMDelete: Asset2 must be a Currency');
|
22731
22261
|
}
|
22732
22262
|
}
|
@@ -22761,13 +22291,13 @@ function validateAMMDeposit(tx) {
|
|
22761
22291
|
if (tx.Asset == null) {
|
22762
22292
|
throw new errors_1.ValidationError('AMMDeposit: missing field Asset');
|
22763
22293
|
}
|
22764
|
-
if (!(0, common_1.
|
22294
|
+
if (!(0, common_1.isIssuedCurrency)(tx.Asset)) {
|
22765
22295
|
throw new errors_1.ValidationError('AMMDeposit: Asset must be a Currency');
|
22766
22296
|
}
|
22767
22297
|
if (tx.Asset2 == null) {
|
22768
22298
|
throw new errors_1.ValidationError('AMMDeposit: missing field Asset2');
|
22769
22299
|
}
|
22770
|
-
if (!(0, common_1.
|
22300
|
+
if (!(0, common_1.isIssuedCurrency)(tx.Asset2)) {
|
22771
22301
|
throw new errors_1.ValidationError('AMMDeposit: Asset2 must be a Currency');
|
22772
22302
|
}
|
22773
22303
|
if (tx.Amount2 != null && tx.Amount == null) {
|
@@ -22779,7 +22309,7 @@ function validateAMMDeposit(tx) {
|
|
22779
22309
|
else if (tx.LPTokenOut == null && tx.Amount == null) {
|
22780
22310
|
throw new errors_1.ValidationError('AMMDeposit: must set at least LPTokenOut or Amount');
|
22781
22311
|
}
|
22782
|
-
if (tx.LPTokenOut != null && !(0, common_1.
|
22312
|
+
if (tx.LPTokenOut != null && !(0, common_1.isIssuedCurrencyAmount)(tx.LPTokenOut)) {
|
22783
22313
|
throw new errors_1.ValidationError('AMMDeposit: LPTokenOut must be an IssuedCurrencyAmount');
|
22784
22314
|
}
|
22785
22315
|
if (tx.Amount != null && !(0, common_1.isAmount)(tx.Amount)) {
|
@@ -22815,13 +22345,13 @@ function validateAMMVote(tx) {
|
|
22815
22345
|
if (tx.Asset == null) {
|
22816
22346
|
throw new errors_1.ValidationError('AMMVote: missing field Asset');
|
22817
22347
|
}
|
22818
|
-
if (!(0, common_1.
|
22348
|
+
if (!(0, common_1.isIssuedCurrency)(tx.Asset)) {
|
22819
22349
|
throw new errors_1.ValidationError('AMMVote: Asset must be a Currency');
|
22820
22350
|
}
|
22821
22351
|
if (tx.Asset2 == null) {
|
22822
22352
|
throw new errors_1.ValidationError('AMMVote: missing field Asset2');
|
22823
22353
|
}
|
22824
|
-
if (!(0, common_1.
|
22354
|
+
if (!(0, common_1.isIssuedCurrency)(tx.Asset2)) {
|
22825
22355
|
throw new errors_1.ValidationError('AMMVote: Asset2 must be a Currency');
|
22826
22356
|
}
|
22827
22357
|
if (tx.TradingFee == null) {
|
@@ -22866,13 +22396,13 @@ function validateAMMWithdraw(tx) {
|
|
22866
22396
|
if (tx.Asset == null) {
|
22867
22397
|
throw new errors_1.ValidationError('AMMWithdraw: missing field Asset');
|
22868
22398
|
}
|
22869
|
-
if (!(0, common_1.
|
22399
|
+
if (!(0, common_1.isIssuedCurrency)(tx.Asset)) {
|
22870
22400
|
throw new errors_1.ValidationError('AMMWithdraw: Asset must be a Currency');
|
22871
22401
|
}
|
22872
22402
|
if (tx.Asset2 == null) {
|
22873
22403
|
throw new errors_1.ValidationError('AMMWithdraw: missing field Asset2');
|
22874
22404
|
}
|
22875
|
-
if (!(0, common_1.
|
22405
|
+
if (!(0, common_1.isIssuedCurrency)(tx.Asset2)) {
|
22876
22406
|
throw new errors_1.ValidationError('AMMWithdraw: Asset2 must be a Currency');
|
22877
22407
|
}
|
22878
22408
|
if (tx.Amount2 != null && tx.Amount == null) {
|
@@ -22881,7 +22411,7 @@ function validateAMMWithdraw(tx) {
|
|
22881
22411
|
else if (tx.EPrice != null && tx.Amount == null) {
|
22882
22412
|
throw new errors_1.ValidationError('AMMWithdraw: must set Amount with EPrice');
|
22883
22413
|
}
|
22884
|
-
if (tx.LPTokenIn != null && !(0, common_1.
|
22414
|
+
if (tx.LPTokenIn != null && !(0, common_1.isIssuedCurrencyAmount)(tx.LPTokenIn)) {
|
22885
22415
|
throw new errors_1.ValidationError('AMMWithdraw: LPTokenIn must be an IssuedCurrencyAmount');
|
22886
22416
|
}
|
22887
22417
|
if (tx.Amount != null && !(0, common_1.isAmount)(tx.Amount)) {
|
@@ -23089,7 +22619,7 @@ var MPTokenIssuanceCreateFlags;
|
|
23089
22619
|
MPTokenIssuanceCreateFlags[MPTokenIssuanceCreateFlags["tfMPTCanClawback"] = 64] = "tfMPTCanClawback";
|
23090
22620
|
})(MPTokenIssuanceCreateFlags || (exports.MPTokenIssuanceCreateFlags = MPTokenIssuanceCreateFlags = {}));
|
23091
22621
|
function validateMPTokenIssuanceCreate(tx) {
|
23092
|
-
var _a;
|
22622
|
+
var _a, _b;
|
23093
22623
|
(0, common_1.validateBaseTransaction)(tx);
|
23094
22624
|
(0, common_1.validateOptionalField)(tx, 'MaximumAmount', common_1.isString);
|
23095
22625
|
(0, common_1.validateOptionalField)(tx, 'MPTokenMetadata', common_1.isString);
|
@@ -23111,10 +22641,10 @@ function validateMPTokenIssuanceCreate(tx) {
|
|
23111
22641
|
}
|
23112
22642
|
}
|
23113
22643
|
if (typeof tx.TransferFee === 'number') {
|
23114
|
-
const flags = tx.Flags;
|
22644
|
+
const flags = ((_a = tx.Flags) !== null && _a !== void 0 ? _a : 0);
|
23115
22645
|
const isTfMPTCanTransfer = typeof flags === 'number'
|
23116
22646
|
? (0, utils_1.isFlagEnabled)(flags, MPTokenIssuanceCreateFlags.tfMPTCanTransfer)
|
23117
|
-
: (
|
22647
|
+
: (_b = flags.tfMPTCanTransfer) !== null && _b !== void 0 ? _b : false;
|
23118
22648
|
if (tx.TransferFee < 0 || tx.TransferFee > MAX_TRANSFER_FEE) {
|
23119
22649
|
throw new errors_1.ValidationError(`MPTokenIssuanceCreate: TransferFee must be between 0 and ${MAX_TRANSFER_FEE}`);
|
23120
22650
|
}
|
@@ -23167,17 +22697,17 @@ var MPTokenIssuanceSetFlags;
|
|
23167
22697
|
MPTokenIssuanceSetFlags[MPTokenIssuanceSetFlags["tfMPTUnlock"] = 2] = "tfMPTUnlock";
|
23168
22698
|
})(MPTokenIssuanceSetFlags || (exports.MPTokenIssuanceSetFlags = MPTokenIssuanceSetFlags = {}));
|
23169
22699
|
function validateMPTokenIssuanceSet(tx) {
|
23170
|
-
var _a, _b;
|
22700
|
+
var _a, _b, _c;
|
23171
22701
|
(0, common_1.validateBaseTransaction)(tx);
|
23172
22702
|
(0, common_1.validateRequiredField)(tx, 'MPTokenIssuanceID', common_1.isString);
|
23173
22703
|
(0, common_1.validateOptionalField)(tx, 'Holder', common_1.isAccount);
|
23174
|
-
const flags = tx.Flags;
|
22704
|
+
const flags = ((_a = tx.Flags) !== null && _a !== void 0 ? _a : 0);
|
23175
22705
|
const isTfMPTLock = typeof flags === 'number'
|
23176
22706
|
? (0, utils_1.isFlagEnabled)(flags, MPTokenIssuanceSetFlags.tfMPTLock)
|
23177
|
-
: (
|
22707
|
+
: (_b = flags.tfMPTLock) !== null && _b !== void 0 ? _b : false;
|
23178
22708
|
const isTfMPTUnlock = typeof flags === 'number'
|
23179
22709
|
? (0, utils_1.isFlagEnabled)(flags, MPTokenIssuanceSetFlags.tfMPTUnlock)
|
23180
|
-
: (
|
22710
|
+
: (_c = flags.tfMPTUnlock) !== null && _c !== void 0 ? _c : false;
|
23181
22711
|
if (isTfMPTLock && isTfMPTUnlock) {
|
23182
22712
|
throw new errors_1.ValidationError('MPTokenIssuanceSet: flag conflict');
|
23183
22713
|
}
|
@@ -23260,7 +22790,7 @@ const errors_1 = __webpack_require__(/*! ../../errors */ "./dist/npm/errors.js")
|
|
23260
22790
|
const common_1 = __webpack_require__(/*! ./common */ "./dist/npm/models/transactions/common.js");
|
23261
22791
|
function validateNFTokenCancelOffer(tx) {
|
23262
22792
|
(0, common_1.validateBaseTransaction)(tx);
|
23263
|
-
if (!
|
22793
|
+
if (!(0, common_1.isArray)(tx.NFTokenOffers)) {
|
23264
22794
|
throw new errors_1.ValidationError('NFTokenCancelOffer: missing field NFTokenOffers');
|
23265
22795
|
}
|
23266
22796
|
if (tx.NFTokenOffers.length < 1) {
|
@@ -23303,6 +22833,7 @@ function validateNFTokenBuyOfferCases(tx) {
|
|
23303
22833
|
}
|
23304
22834
|
}
|
23305
22835
|
function validateNFTokenCreateOffer(tx) {
|
22836
|
+
var _a, _b;
|
23306
22837
|
(0, common_1.validateBaseTransaction)(tx);
|
23307
22838
|
if (tx.Account === tx.Owner) {
|
23308
22839
|
throw new errors_1.ValidationError('NFTokenCreateOffer: Owner and Account must not be equal');
|
@@ -23318,8 +22849,11 @@ function validateNFTokenCreateOffer(tx) {
|
|
23318
22849
|
if (!(0, common_1.isAmount)(tx.Amount)) {
|
23319
22850
|
throw new errors_1.ValidationError('NFTokenCreateOffer: invalid Amount');
|
23320
22851
|
}
|
23321
|
-
|
23322
|
-
|
22852
|
+
const flags = ((_a = tx.Flags) !== null && _a !== void 0 ? _a : 0);
|
22853
|
+
const isTfSellNFToken = typeof flags === 'number'
|
22854
|
+
? (0, utils_1.isFlagEnabled)(flags, NFTokenCreateOfferFlags.tfSellNFToken)
|
22855
|
+
: (_b = flags.tfSellNFToken) !== null && _b !== void 0 ? _b : false;
|
22856
|
+
if (isTfSellNFToken) {
|
23323
22857
|
validateNFTokenSellOfferCases(tx);
|
23324
22858
|
}
|
23325
22859
|
else {
|
@@ -23719,6 +23253,80 @@ function validateAccountSet(tx) {
|
|
23719
23253
|
exports.validateAccountSet = validateAccountSet;
|
23720
23254
|
|
23721
23255
|
|
23256
|
+
/***/ }),
|
23257
|
+
|
23258
|
+
/***/ "./dist/npm/models/transactions/batch.js":
|
23259
|
+
/*!***********************************************!*\
|
23260
|
+
!*** ./dist/npm/models/transactions/batch.js ***!
|
23261
|
+
\***********************************************/
|
23262
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
23263
|
+
|
23264
|
+
"use strict";
|
23265
|
+
|
23266
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
23267
|
+
exports.validateBatch = exports.BatchFlags = void 0;
|
23268
|
+
const errors_1 = __webpack_require__(/*! ../../errors */ "./dist/npm/errors.js");
|
23269
|
+
const utils_1 = __webpack_require__(/*! ../utils */ "./dist/npm/models/utils/index.js");
|
23270
|
+
const common_1 = __webpack_require__(/*! ./common */ "./dist/npm/models/transactions/common.js");
|
23271
|
+
var BatchFlags;
|
23272
|
+
(function (BatchFlags) {
|
23273
|
+
BatchFlags[BatchFlags["tfAllOrNothing"] = 65536] = "tfAllOrNothing";
|
23274
|
+
BatchFlags[BatchFlags["tfOnlyOne"] = 131072] = "tfOnlyOne";
|
23275
|
+
BatchFlags[BatchFlags["tfUntilFailure"] = 262144] = "tfUntilFailure";
|
23276
|
+
BatchFlags[BatchFlags["tfIndependent"] = 524288] = "tfIndependent";
|
23277
|
+
})(BatchFlags || (exports.BatchFlags = BatchFlags = {}));
|
23278
|
+
function validateBatch(tx) {
|
23279
|
+
var _a;
|
23280
|
+
(0, common_1.validateBaseTransaction)(tx);
|
23281
|
+
(0, common_1.validateRequiredField)(tx, 'RawTransactions', common_1.isArray);
|
23282
|
+
tx.RawTransactions.forEach((rawTxObj, index) => {
|
23283
|
+
if (!(0, common_1.isRecord)(rawTxObj)) {
|
23284
|
+
throw new errors_1.ValidationError(`Batch: RawTransactions[${index}] is not object.`);
|
23285
|
+
}
|
23286
|
+
(0, common_1.validateRequiredField)(rawTxObj, 'RawTransaction', common_1.isRecord, {
|
23287
|
+
paramName: `RawTransactions[${index}].RawTransaction`,
|
23288
|
+
txType: 'Batch',
|
23289
|
+
});
|
23290
|
+
const rawTx = rawTxObj.RawTransaction;
|
23291
|
+
if (rawTx.TransactionType === 'Batch') {
|
23292
|
+
throw new errors_1.ValidationError(`Batch: RawTransactions[${index}] is a Batch transaction. Cannot nest Batch transactions.`);
|
23293
|
+
}
|
23294
|
+
if (!(0, utils_1.hasFlag)(rawTx, common_1.GlobalFlags.tfInnerBatchTxn, 'tfInnerBatchTxn')) {
|
23295
|
+
throw new errors_1.ValidationError(`Batch: RawTransactions[${index}] must contain the \`tfInnerBatchTxn\` flag.`);
|
23296
|
+
}
|
23297
|
+
});
|
23298
|
+
(0, common_1.validateOptionalField)(tx, 'BatchSigners', common_1.isArray);
|
23299
|
+
(_a = tx.BatchSigners) === null || _a === void 0 ? void 0 : _a.forEach((signerObj, index) => {
|
23300
|
+
if (!(0, common_1.isRecord)(signerObj)) {
|
23301
|
+
throw new errors_1.ValidationError(`Batch: BatchSigners[${index}] is not object.`);
|
23302
|
+
}
|
23303
|
+
const signerRecord = signerObj;
|
23304
|
+
(0, common_1.validateRequiredField)(signerRecord, 'BatchSigner', common_1.isRecord, {
|
23305
|
+
paramName: `BatchSigners[${index}].BatchSigner`,
|
23306
|
+
txType: 'Batch',
|
23307
|
+
});
|
23308
|
+
const signer = signerRecord.BatchSigner;
|
23309
|
+
(0, common_1.validateRequiredField)(signer, 'Account', common_1.isString, {
|
23310
|
+
paramName: `BatchSigners[${index}].Account`,
|
23311
|
+
txType: 'Batch',
|
23312
|
+
});
|
23313
|
+
(0, common_1.validateOptionalField)(signer, 'SigningPubKey', common_1.isString, {
|
23314
|
+
paramName: `BatchSigners[${index}].SigningPubKey`,
|
23315
|
+
txType: 'Batch',
|
23316
|
+
});
|
23317
|
+
(0, common_1.validateOptionalField)(signer, 'TxnSignature', common_1.isString, {
|
23318
|
+
paramName: `BatchSigners[${index}].TxnSignature`,
|
23319
|
+
txType: 'Batch',
|
23320
|
+
});
|
23321
|
+
(0, common_1.validateOptionalField)(signer, 'Signers', common_1.isArray, {
|
23322
|
+
paramName: `BatchSigners[${index}].Signers`,
|
23323
|
+
txType: 'Batch',
|
23324
|
+
});
|
23325
|
+
});
|
23326
|
+
}
|
23327
|
+
exports.validateBatch = validateBatch;
|
23328
|
+
|
23329
|
+
|
23722
23330
|
/***/ }),
|
23723
23331
|
|
23724
23332
|
/***/ "./dist/npm/models/transactions/checkCancel.js":
|
@@ -23800,8 +23408,7 @@ function validateCheckCreate(tx) {
|
|
23800
23408
|
}
|
23801
23409
|
(0, common_1.validateRequiredField)(tx, 'Destination', common_1.isAccount);
|
23802
23410
|
(0, common_1.validateOptionalField)(tx, 'DestinationTag', common_1.isNumber);
|
23803
|
-
if (typeof tx.SendMax !== 'string' &&
|
23804
|
-
!(0, common_1.isIssuedCurrency)(tx.SendMax)) {
|
23411
|
+
if (typeof tx.SendMax !== 'string' && !(0, common_1.isIssuedCurrencyAmount)(tx.SendMax)) {
|
23805
23412
|
throw new errors_1.ValidationError('CheckCreate: invalid SendMax');
|
23806
23413
|
}
|
23807
23414
|
if (tx.Expiration !== undefined && typeof tx.Expiration !== 'number') {
|
@@ -23830,20 +23437,18 @@ const errors_1 = __webpack_require__(/*! ../../errors */ "./dist/npm/errors.js")
|
|
23830
23437
|
const common_1 = __webpack_require__(/*! ./common */ "./dist/npm/models/transactions/common.js");
|
23831
23438
|
function validateClawback(tx) {
|
23832
23439
|
(0, common_1.validateBaseTransaction)(tx);
|
23440
|
+
(0, common_1.validateRequiredField)(tx, 'Amount', common_1.isClawbackAmount);
|
23833
23441
|
(0, common_1.validateOptionalField)(tx, 'Holder', common_1.isAccount);
|
23834
|
-
if (tx.Amount
|
23835
|
-
throw new errors_1.ValidationError('Clawback: missing field Amount');
|
23836
|
-
}
|
23837
|
-
if (!(0, common_1.isIssuedCurrency)(tx.Amount) && !(0, common_1.isMPTAmount)(tx.Amount)) {
|
23442
|
+
if (!(0, common_1.isIssuedCurrencyAmount)(tx.Amount) && !(0, common_1.isMPTAmount)(tx.Amount)) {
|
23838
23443
|
throw new errors_1.ValidationError('Clawback: invalid Amount');
|
23839
23444
|
}
|
23840
|
-
if ((0, common_1.
|
23445
|
+
if ((0, common_1.isIssuedCurrencyAmount)(tx.Amount) && tx.Account === tx.Amount.issuer) {
|
23841
23446
|
throw new errors_1.ValidationError('Clawback: invalid holder Account');
|
23842
23447
|
}
|
23843
23448
|
if ((0, common_1.isMPTAmount)(tx.Amount) && tx.Account === tx.Holder) {
|
23844
23449
|
throw new errors_1.ValidationError('Clawback: invalid holder Account');
|
23845
23450
|
}
|
23846
|
-
if ((0, common_1.
|
23451
|
+
if ((0, common_1.isIssuedCurrencyAmount)(tx.Amount) && tx.Holder) {
|
23847
23452
|
throw new errors_1.ValidationError('Clawback: cannot have Holder for currency');
|
23848
23453
|
}
|
23849
23454
|
if ((0, common_1.isMPTAmount)(tx.Amount) && !tx.Holder) {
|
@@ -23864,7 +23469,7 @@ exports.validateClawback = validateClawback;
|
|
23864
23469
|
"use strict";
|
23865
23470
|
|
23866
23471
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
23867
|
-
exports.containsDuplicates = exports.validateCredentialsList = exports.validateCredentialType = exports.parseAmountValue = exports.validateBaseTransaction = exports.validateOptionalField = exports.validateRequiredField = exports.isXChainBridge = exports.isAmount = exports.isAccount = exports.isMPTAmount = exports.isAuthorizeCredential = exports.isIssuedCurrency = exports.isCurrency = exports.isNumber = exports.isString = exports.MAX_AUTHORIZED_CREDENTIALS = void 0;
|
23472
|
+
exports.containsDuplicates = exports.validateCredentialsList = exports.validateCredentialType = exports.parseAmountValue = exports.validateBaseTransaction = exports.GlobalFlags = exports.validateOptionalField = exports.validateRequiredField = exports.isArray = exports.isXChainBridge = exports.isAmount = exports.isAccount = exports.isClawbackAmount = exports.isMPTAmount = exports.isAuthorizeCredential = exports.isIssuedCurrencyAmount = exports.isIssuedCurrency = exports.isCurrency = exports.isXRPLNumber = exports.isNumber = exports.isString = exports.isRecord = exports.VAULT_DATA_MAX_BYTE_LENGTH = exports.MAX_AUTHORIZED_CREDENTIALS = void 0;
|
23868
23473
|
const utils_1 = __webpack_require__(/*! @xrplf/isomorphic/utils */ "../../node_modules/@xrplf/isomorphic/dist/utils/browser.js");
|
23869
23474
|
const ripple_address_codec_1 = __webpack_require__(/*! ripple-address-codec */ "../../node_modules/ripple-address-codec/dist/index.js");
|
23870
23475
|
const ripple_binary_codec_1 = __webpack_require__(/*! ripple-binary-codec */ "../../node_modules/ripple-binary-codec/dist/index.js");
|
@@ -23874,15 +23479,20 @@ const MEMO_SIZE = 3;
|
|
23874
23479
|
exports.MAX_AUTHORIZED_CREDENTIALS = 8;
|
23875
23480
|
const MAX_CREDENTIAL_BYTE_LENGTH = 64;
|
23876
23481
|
const MAX_CREDENTIAL_TYPE_LENGTH = MAX_CREDENTIAL_BYTE_LENGTH * 2;
|
23482
|
+
exports.VAULT_DATA_MAX_BYTE_LENGTH = 256;
|
23877
23483
|
function isMemo(obj) {
|
23878
|
-
if (obj
|
23484
|
+
if (!isRecord(obj)) {
|
23879
23485
|
return false;
|
23880
23486
|
}
|
23881
23487
|
const memo = obj.Memo;
|
23488
|
+
if (!isRecord(memo)) {
|
23489
|
+
return false;
|
23490
|
+
}
|
23882
23491
|
const size = Object.keys(memo).length;
|
23883
|
-
const validData = memo.MemoData == null ||
|
23884
|
-
const validFormat = memo.MemoFormat == null ||
|
23885
|
-
|
23492
|
+
const validData = memo.MemoData == null || (isString(memo.MemoData) && (0, utils_2.isHex)(memo.MemoData));
|
23493
|
+
const validFormat = memo.MemoFormat == null ||
|
23494
|
+
(isString(memo.MemoFormat) && (0, utils_2.isHex)(memo.MemoFormat));
|
23495
|
+
const validType = memo.MemoType == null || (isString(memo.MemoType) && (0, utils_2.isHex)(memo.MemoType));
|
23886
23496
|
return (size >= 1 &&
|
23887
23497
|
size <= MEMO_SIZE &&
|
23888
23498
|
validData &&
|
@@ -23892,15 +23502,17 @@ function isMemo(obj) {
|
|
23892
23502
|
}
|
23893
23503
|
const SIGNER_SIZE = 3;
|
23894
23504
|
function isSigner(obj) {
|
23895
|
-
|
23896
|
-
|
23505
|
+
if (!isRecord(obj)) {
|
23506
|
+
return false;
|
23507
|
+
}
|
23508
|
+
const signer = obj.Signer;
|
23509
|
+
if (!isRecord(signer)) {
|
23897
23510
|
return false;
|
23898
23511
|
}
|
23899
|
-
const signer = signerWrapper.Signer;
|
23900
23512
|
return (Object.keys(signer).length === SIGNER_SIZE &&
|
23901
|
-
|
23902
|
-
|
23903
|
-
|
23513
|
+
isString(signer.Account) &&
|
23514
|
+
isString(signer.TxnSignature) &&
|
23515
|
+
isString(signer.SigningPubKey));
|
23904
23516
|
}
|
23905
23517
|
const XRP_CURRENCY_SIZE = 1;
|
23906
23518
|
const ISSUE_SIZE = 2;
|
@@ -23909,8 +23521,9 @@ const XCHAIN_BRIDGE_SIZE = 4;
|
|
23909
23521
|
const MPTOKEN_SIZE = 2;
|
23910
23522
|
const AUTHORIZE_CREDENTIAL_SIZE = 1;
|
23911
23523
|
function isRecord(value) {
|
23912
|
-
return value !== null && typeof value === 'object';
|
23524
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
23913
23525
|
}
|
23526
|
+
exports.isRecord = isRecord;
|
23914
23527
|
function isString(str) {
|
23915
23528
|
return typeof str === 'string';
|
23916
23529
|
}
|
@@ -23919,23 +23532,32 @@ function isNumber(num) {
|
|
23919
23532
|
return typeof num === 'number';
|
23920
23533
|
}
|
23921
23534
|
exports.isNumber = isNumber;
|
23535
|
+
function isXRPLNumber(value) {
|
23536
|
+
return (typeof value === 'string' &&
|
23537
|
+
/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/u.test(value.trim()));
|
23538
|
+
}
|
23539
|
+
exports.isXRPLNumber = isXRPLNumber;
|
23922
23540
|
function isCurrency(input) {
|
23541
|
+
return isString(input) || isIssuedCurrency(input);
|
23542
|
+
}
|
23543
|
+
exports.isCurrency = isCurrency;
|
23544
|
+
function isIssuedCurrency(input) {
|
23923
23545
|
return (isRecord(input) &&
|
23924
23546
|
((Object.keys(input).length === ISSUE_SIZE &&
|
23925
|
-
|
23926
|
-
|
23547
|
+
isString(input.issuer) &&
|
23548
|
+
isString(input.currency)) ||
|
23927
23549
|
(Object.keys(input).length === XRP_CURRENCY_SIZE &&
|
23928
23550
|
input.currency === 'XRP')));
|
23929
23551
|
}
|
23930
|
-
exports.
|
23931
|
-
function
|
23552
|
+
exports.isIssuedCurrency = isIssuedCurrency;
|
23553
|
+
function isIssuedCurrencyAmount(input) {
|
23932
23554
|
return (isRecord(input) &&
|
23933
23555
|
Object.keys(input).length === ISSUED_CURRENCY_SIZE &&
|
23934
|
-
|
23935
|
-
|
23936
|
-
|
23556
|
+
isString(input.value) &&
|
23557
|
+
isString(input.issuer) &&
|
23558
|
+
isString(input.currency));
|
23937
23559
|
}
|
23938
|
-
exports.
|
23560
|
+
exports.isIssuedCurrencyAmount = isIssuedCurrencyAmount;
|
23939
23561
|
function isAuthorizeCredential(input) {
|
23940
23562
|
return (isRecord(input) &&
|
23941
23563
|
isRecord(input.Credential) &&
|
@@ -23951,6 +23573,10 @@ function isMPTAmount(input) {
|
|
23951
23573
|
typeof input.mpt_issuance_id === 'string');
|
23952
23574
|
}
|
23953
23575
|
exports.isMPTAmount = isMPTAmount;
|
23576
|
+
function isClawbackAmount(input) {
|
23577
|
+
return isIssuedCurrencyAmount(input) || isMPTAmount(input);
|
23578
|
+
}
|
23579
|
+
exports.isClawbackAmount = isClawbackAmount;
|
23954
23580
|
function isAccount(account) {
|
23955
23581
|
return (typeof account === 'string' &&
|
23956
23582
|
((0, ripple_address_codec_1.isValidClassicAddress)(account) || (0, ripple_address_codec_1.isValidXAddress)(account)));
|
@@ -23958,7 +23584,7 @@ function isAccount(account) {
|
|
23958
23584
|
exports.isAccount = isAccount;
|
23959
23585
|
function isAmount(amount) {
|
23960
23586
|
return (typeof amount === 'string' ||
|
23961
|
-
|
23587
|
+
isIssuedCurrencyAmount(amount) ||
|
23962
23588
|
isMPTAmount(amount));
|
23963
23589
|
}
|
23964
23590
|
exports.isAmount = isAmount;
|
@@ -23966,27 +23592,44 @@ function isXChainBridge(input) {
|
|
23966
23592
|
return (isRecord(input) &&
|
23967
23593
|
Object.keys(input).length === XCHAIN_BRIDGE_SIZE &&
|
23968
23594
|
typeof input.LockingChainDoor === 'string' &&
|
23969
|
-
|
23595
|
+
isIssuedCurrency(input.LockingChainIssue) &&
|
23970
23596
|
typeof input.IssuingChainDoor === 'string' &&
|
23971
|
-
|
23597
|
+
isIssuedCurrency(input.IssuingChainIssue));
|
23972
23598
|
}
|
23973
23599
|
exports.isXChainBridge = isXChainBridge;
|
23974
|
-
function
|
23975
|
-
|
23976
|
-
|
23600
|
+
function isArray(input) {
|
23601
|
+
return input != null && Array.isArray(input);
|
23602
|
+
}
|
23603
|
+
exports.isArray = isArray;
|
23604
|
+
function validateRequiredField(tx, param, checkValidity, errorOpts = {}) {
|
23605
|
+
var _a, _b;
|
23606
|
+
const paramNameStr = (_a = errorOpts.paramName) !== null && _a !== void 0 ? _a : param;
|
23607
|
+
const txType = (_b = errorOpts.txType) !== null && _b !== void 0 ? _b : tx.TransactionType;
|
23608
|
+
if (tx[param] == null) {
|
23609
|
+
throw new errors_1.ValidationError(`${txType}: missing field ${String(paramNameStr)}`);
|
23977
23610
|
}
|
23978
|
-
if (!checkValidity(tx[
|
23979
|
-
throw new errors_1.ValidationError(`${
|
23611
|
+
if (!checkValidity(tx[param])) {
|
23612
|
+
throw new errors_1.ValidationError(`${txType}: invalid field ${String(paramNameStr)}`);
|
23980
23613
|
}
|
23981
23614
|
}
|
23982
23615
|
exports.validateRequiredField = validateRequiredField;
|
23983
|
-
function validateOptionalField(tx,
|
23984
|
-
|
23985
|
-
|
23616
|
+
function validateOptionalField(tx, param, checkValidity, errorOpts = {}) {
|
23617
|
+
var _a, _b;
|
23618
|
+
const paramNameStr = (_a = errorOpts.paramName) !== null && _a !== void 0 ? _a : param;
|
23619
|
+
const txType = (_b = errorOpts.txType) !== null && _b !== void 0 ? _b : tx.TransactionType;
|
23620
|
+
if (tx[param] !== undefined && !checkValidity(tx[param])) {
|
23621
|
+
throw new errors_1.ValidationError(`${txType}: invalid field ${String(paramNameStr)}`);
|
23986
23622
|
}
|
23987
23623
|
}
|
23988
23624
|
exports.validateOptionalField = validateOptionalField;
|
23625
|
+
var GlobalFlags;
|
23626
|
+
(function (GlobalFlags) {
|
23627
|
+
GlobalFlags[GlobalFlags["tfInnerBatchTxn"] = 1073741824] = "tfInnerBatchTxn";
|
23628
|
+
})(GlobalFlags || (exports.GlobalFlags = GlobalFlags = {}));
|
23989
23629
|
function validateBaseTransaction(common) {
|
23630
|
+
if (!isRecord(common)) {
|
23631
|
+
throw new errors_1.ValidationError('BaseTransaction: invalid, expected a valid object');
|
23632
|
+
}
|
23990
23633
|
if (common.TransactionType === undefined) {
|
23991
23634
|
throw new errors_1.ValidationError('BaseTransaction: missing field TransactionType');
|
23992
23635
|
}
|
@@ -23994,7 +23637,7 @@ function validateBaseTransaction(common) {
|
|
23994
23637
|
throw new errors_1.ValidationError('BaseTransaction: TransactionType not string');
|
23995
23638
|
}
|
23996
23639
|
if (!ripple_binary_codec_1.TRANSACTION_TYPES.includes(common.TransactionType)) {
|
23997
|
-
throw new errors_1.ValidationError(
|
23640
|
+
throw new errors_1.ValidationError(`BaseTransaction: Unknown TransactionType ${common.TransactionType}`);
|
23998
23641
|
}
|
23999
23642
|
validateRequiredField(common, 'Account', isString);
|
24000
23643
|
validateOptionalField(common, 'Fee', isString);
|
@@ -24002,12 +23645,12 @@ function validateBaseTransaction(common) {
|
|
24002
23645
|
validateOptionalField(common, 'AccountTxnID', isString);
|
24003
23646
|
validateOptionalField(common, 'LastLedgerSequence', isNumber);
|
24004
23647
|
const memos = common.Memos;
|
24005
|
-
if (memos
|
23648
|
+
if (memos != null && (!isArray(memos) || !memos.every(isMemo))) {
|
24006
23649
|
throw new errors_1.ValidationError('BaseTransaction: invalid Memos');
|
24007
23650
|
}
|
24008
23651
|
const signers = common.Signers;
|
24009
|
-
if (signers
|
24010
|
-
(signers.length === 0 || !signers.every(isSigner))) {
|
23652
|
+
if (signers != null &&
|
23653
|
+
(!isArray(signers) || signers.length === 0 || !signers.every(isSigner))) {
|
24011
23654
|
throw new errors_1.ValidationError('BaseTransaction: invalid Signers');
|
24012
23655
|
}
|
24013
23656
|
validateOptionalField(common, 'SourceTag', isNumber);
|
@@ -24057,7 +23700,7 @@ function validateCredentialsList(credentials, transactionType, isStringID, maxCr
|
|
24057
23700
|
if (credentials == null) {
|
24058
23701
|
return;
|
24059
23702
|
}
|
24060
|
-
if (!
|
23703
|
+
if (!isArray(credentials)) {
|
24061
23704
|
throw new errors_1.ValidationError(`${transactionType}: Credentials must be an array`);
|
24062
23705
|
}
|
24063
23706
|
if (credentials.length > maxCredentials) {
|
@@ -24125,6 +23768,7 @@ const NON_DELEGATABLE_TRANSACTIONS = new Set([
|
|
24125
23768
|
'SignerListSet',
|
24126
23769
|
'DelegateSet',
|
24127
23770
|
'AccountDelete',
|
23771
|
+
'Batch',
|
24128
23772
|
'EnableAmendment',
|
24129
23773
|
'SetFee',
|
24130
23774
|
'UNLModify',
|
@@ -24376,7 +24020,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
24376
24020
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
24377
24021
|
};
|
24378
24022
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
24379
|
-
exports.XChainModifyBridgeFlags = exports.TrustSetFlags = exports.PaymentChannelClaimFlags = exports.PaymentFlags = exports.OfferCreateFlags = exports.validateNFTokenModify = exports.NFTokenMintFlags = exports.NFTokenCreateOfferFlags = exports.MPTokenIssuanceSetFlags = exports.MPTokenIssuanceCreateFlags = exports.MPTokenAuthorizeFlags = exports.EnableAmendmentFlags = exports.AMMWithdrawFlags = exports.AMMDepositFlags = exports.AMMClawbackFlags = exports.AccountSetTfFlags = exports.AccountSetAsfFlags = exports.validate = exports.isMPTAmount = void 0;
|
24023
|
+
exports.XChainModifyBridgeFlags = exports.VaultWithdrawalPolicy = exports.VaultCreateFlags = exports.TrustSetFlags = exports.PaymentChannelClaimFlags = exports.PaymentFlags = exports.OfferCreateFlags = exports.validateNFTokenModify = exports.NFTokenMintFlags = exports.NFTokenCreateOfferFlags = exports.MPTokenIssuanceSetFlags = exports.MPTokenIssuanceCreateFlags = exports.MPTokenAuthorizeFlags = exports.EnableAmendmentFlags = exports.AMMWithdrawFlags = exports.AMMDepositFlags = exports.AMMClawbackFlags = exports.AccountSetTfFlags = exports.AccountSetAsfFlags = exports.validate = exports.isMPTAmount = void 0;
|
24380
24024
|
var common_1 = __webpack_require__(/*! ./common */ "./dist/npm/models/transactions/common.js");
|
24381
24025
|
Object.defineProperty(exports, "isMPTAmount", ({ enumerable: true, get: function () { return common_1.isMPTAmount; } }));
|
24382
24026
|
var transaction_1 = __webpack_require__(/*! ./transaction */ "./dist/npm/models/transactions/transaction.js");
|
@@ -24413,6 +24057,9 @@ var paymentChannelClaim_1 = __webpack_require__(/*! ./paymentChannelClaim */ "./
|
|
24413
24057
|
Object.defineProperty(exports, "PaymentChannelClaimFlags", ({ enumerable: true, get: function () { return paymentChannelClaim_1.PaymentChannelClaimFlags; } }));
|
24414
24058
|
var trustSet_1 = __webpack_require__(/*! ./trustSet */ "./dist/npm/models/transactions/trustSet.js");
|
24415
24059
|
Object.defineProperty(exports, "TrustSetFlags", ({ enumerable: true, get: function () { return trustSet_1.TrustSetFlags; } }));
|
24060
|
+
var vaultCreate_1 = __webpack_require__(/*! ./vaultCreate */ "./dist/npm/models/transactions/vaultCreate.js");
|
24061
|
+
Object.defineProperty(exports, "VaultCreateFlags", ({ enumerable: true, get: function () { return vaultCreate_1.VaultCreateFlags; } }));
|
24062
|
+
Object.defineProperty(exports, "VaultWithdrawalPolicy", ({ enumerable: true, get: function () { return vaultCreate_1.VaultWithdrawalPolicy; } }));
|
24416
24063
|
var XChainModifyBridge_1 = __webpack_require__(/*! ./XChainModifyBridge */ "./dist/npm/models/transactions/XChainModifyBridge.js");
|
24417
24064
|
Object.defineProperty(exports, "XChainModifyBridgeFlags", ({ enumerable: true, get: function () { return XChainModifyBridge_1.XChainModifyBridgeFlags; } }));
|
24418
24065
|
|
@@ -24561,54 +24208,55 @@ function validateOracleSet(tx) {
|
|
24561
24208
|
(0, common_1.validateOptionalField)(tx, 'URI', common_1.isString);
|
24562
24209
|
(0, common_1.validateOptionalField)(tx, 'AssetClass', common_1.isString);
|
24563
24210
|
(0, common_1.validateRequiredField)(tx, 'PriceDataSeries', (value) => {
|
24564
|
-
if (!
|
24211
|
+
if (!(0, common_1.isArray)(value)) {
|
24565
24212
|
throw new errors_1.ValidationError('OracleSet: PriceDataSeries must be an array');
|
24566
24213
|
}
|
24567
24214
|
if (value.length > PRICE_DATA_SERIES_MAX_LENGTH) {
|
24568
24215
|
throw new errors_1.ValidationError(`OracleSet: PriceDataSeries must have at most ${PRICE_DATA_SERIES_MAX_LENGTH} PriceData objects`);
|
24569
24216
|
}
|
24570
24217
|
for (const priceData of value) {
|
24571
|
-
if (
|
24218
|
+
if (!(0, common_1.isRecord)(priceData)) {
|
24572
24219
|
throw new errors_1.ValidationError('OracleSet: PriceDataSeries must be an array of objects');
|
24573
24220
|
}
|
24574
|
-
|
24221
|
+
const priceDataInner = priceData.PriceData;
|
24222
|
+
if (!(0, common_1.isRecord)(priceDataInner)) {
|
24575
24223
|
throw new errors_1.ValidationError('OracleSet: PriceDataSeries must have a `PriceData` object');
|
24576
24224
|
}
|
24577
24225
|
if (Object.keys(priceData).length !== 1) {
|
24578
24226
|
throw new errors_1.ValidationError('OracleSet: PriceDataSeries must only have a single PriceData object');
|
24579
24227
|
}
|
24580
|
-
if (
|
24228
|
+
if (priceDataInner.BaseAsset == null ||
|
24229
|
+
typeof priceDataInner.BaseAsset !== 'string') {
|
24581
24230
|
throw new errors_1.ValidationError('OracleSet: PriceDataSeries must have a `BaseAsset` string');
|
24582
24231
|
}
|
24583
|
-
if (typeof
|
24232
|
+
if (typeof priceDataInner.QuoteAsset !== 'string') {
|
24584
24233
|
throw new errors_1.ValidationError('OracleSet: PriceDataSeries must have a `QuoteAsset` string');
|
24585
24234
|
}
|
24586
|
-
if ((
|
24587
|
-
(
|
24235
|
+
if ((priceDataInner.AssetPrice == null) !==
|
24236
|
+
(priceDataInner.Scale == null)) {
|
24588
24237
|
throw new errors_1.ValidationError('OracleSet: PriceDataSeries must have both `AssetPrice` and `Scale` if any are present');
|
24589
24238
|
}
|
24590
|
-
if ('AssetPrice' in
|
24591
|
-
if (!(0, common_1.isNumber)(
|
24592
|
-
if (typeof
|
24239
|
+
if ('AssetPrice' in priceDataInner) {
|
24240
|
+
if (!(0, common_1.isNumber)(priceDataInner.AssetPrice)) {
|
24241
|
+
if (typeof priceDataInner.AssetPrice !== 'string') {
|
24593
24242
|
throw new errors_1.ValidationError('OracleSet: Field AssetPrice must be a string or a number');
|
24594
24243
|
}
|
24595
|
-
if (!(0, utils_1.isHex)(
|
24244
|
+
if (!(0, utils_1.isHex)(priceDataInner.AssetPrice)) {
|
24596
24245
|
throw new errors_1.ValidationError('OracleSet: Field AssetPrice must be a valid hex string');
|
24597
24246
|
}
|
24598
|
-
if (
|
24599
|
-
|
24600
|
-
priceData.PriceData.AssetPrice.length > MAXIMUM_ASSET_PRICE_LENGTH) {
|
24247
|
+
if (priceDataInner.AssetPrice.length < MINIMUM_ASSET_PRICE_LENGTH ||
|
24248
|
+
priceDataInner.AssetPrice.length > MAXIMUM_ASSET_PRICE_LENGTH) {
|
24601
24249
|
throw new errors_1.ValidationError(`OracleSet: Length of AssetPrice field must be between ${MINIMUM_ASSET_PRICE_LENGTH} and ${MAXIMUM_ASSET_PRICE_LENGTH} characters long`);
|
24602
24250
|
}
|
24603
24251
|
}
|
24604
24252
|
}
|
24605
|
-
if ('Scale' in
|
24606
|
-
!(0, common_1.isNumber)(
|
24607
|
-
|
24608
|
-
|
24609
|
-
|
24610
|
-
|
24611
|
-
|
24253
|
+
if ('Scale' in priceDataInner) {
|
24254
|
+
if (!(0, common_1.isNumber)(priceDataInner.Scale)) {
|
24255
|
+
throw new errors_1.ValidationError('OracleSet: invalid field Scale');
|
24256
|
+
}
|
24257
|
+
if (priceDataInner.Scale < 0 || priceDataInner.Scale > SCALE_MAX) {
|
24258
|
+
throw new errors_1.ValidationError(`OracleSet: Scale must be in range 0-${SCALE_MAX}`);
|
24259
|
+
}
|
24612
24260
|
}
|
24613
24261
|
}
|
24614
24262
|
return true;
|
@@ -24652,14 +24300,16 @@ function validatePayment(tx) {
|
|
24652
24300
|
if (tx.InvoiceID !== undefined && typeof tx.InvoiceID !== 'string') {
|
24653
24301
|
throw new errors_1.ValidationError('PaymentTransaction: InvoiceID must be a string');
|
24654
24302
|
}
|
24655
|
-
if (tx.Paths !== undefined &&
|
24656
|
-
!isPaths(tx.Paths)) {
|
24303
|
+
if (tx.Paths !== undefined && !isPaths(tx.Paths)) {
|
24657
24304
|
throw new errors_1.ValidationError('PaymentTransaction: invalid Paths');
|
24658
24305
|
}
|
24659
24306
|
if (tx.SendMax !== undefined && !(0, common_1.isAmount)(tx.SendMax)) {
|
24660
24307
|
throw new errors_1.ValidationError('PaymentTransaction: invalid SendMax');
|
24661
24308
|
}
|
24662
24309
|
checkPartialPayment(tx);
|
24310
|
+
if (tx.DeliverMax != null) {
|
24311
|
+
throw new errors_1.ValidationError('PaymentTransaction: Cannot have DeliverMax in a submitted transaction');
|
24312
|
+
}
|
24663
24313
|
}
|
24664
24314
|
exports.validatePayment = validatePayment;
|
24665
24315
|
function checkPartialPayment(tx) {
|
@@ -24702,6 +24352,9 @@ function isPathStep(pathStep) {
|
|
24702
24352
|
return false;
|
24703
24353
|
}
|
24704
24354
|
function isPath(path) {
|
24355
|
+
if (!Array.isArray(path) || path.length === 0) {
|
24356
|
+
return false;
|
24357
|
+
}
|
24705
24358
|
for (const pathStep of path) {
|
24706
24359
|
if (!isPathStep(pathStep)) {
|
24707
24360
|
return false;
|
@@ -24710,11 +24363,11 @@ function isPath(path) {
|
|
24710
24363
|
return true;
|
24711
24364
|
}
|
24712
24365
|
function isPaths(paths) {
|
24713
|
-
if (!
|
24366
|
+
if (!(0, common_1.isArray)(paths) || paths.length === 0) {
|
24714
24367
|
return false;
|
24715
24368
|
}
|
24716
24369
|
for (const path of paths) {
|
24717
|
-
if (!
|
24370
|
+
if (!(0, common_1.isArray)(path) || path.length === 0) {
|
24718
24371
|
return false;
|
24719
24372
|
}
|
24720
24373
|
if (!isPath(path)) {
|
@@ -24884,7 +24537,7 @@ const MAX_ACCEPTED_CREDENTIALS = 10;
|
|
24884
24537
|
function validatePermissionedDomainSet(tx) {
|
24885
24538
|
(0, common_1.validateBaseTransaction)(tx);
|
24886
24539
|
(0, common_1.validateOptionalField)(tx, 'DomainID', common_1.isString);
|
24887
|
-
(0, common_1.validateRequiredField)(tx, 'AcceptedCredentials',
|
24540
|
+
(0, common_1.validateRequiredField)(tx, 'AcceptedCredentials', common_1.isArray);
|
24888
24541
|
(0, common_1.validateCredentialsList)(tx.AcceptedCredentials, tx.TransactionType, false, MAX_ACCEPTED_CREDENTIALS);
|
24889
24542
|
}
|
24890
24543
|
exports.validatePermissionedDomainSet = validatePermissionedDomainSet;
|
@@ -24931,21 +24584,11 @@ const MAX_SIGNERS = 32;
|
|
24931
24584
|
const HEX_WALLET_LOCATOR_REGEX = /^[0-9A-Fa-f]{64}$/u;
|
24932
24585
|
function validateSignerListSet(tx) {
|
24933
24586
|
(0, common_1.validateBaseTransaction)(tx);
|
24934
|
-
|
24935
|
-
throw new errors_1.ValidationError('SignerListSet: missing field SignerQuorum');
|
24936
|
-
}
|
24937
|
-
if (typeof tx.SignerQuorum !== 'number') {
|
24938
|
-
throw new errors_1.ValidationError('SignerListSet: invalid SignerQuorum');
|
24939
|
-
}
|
24587
|
+
(0, common_1.validateRequiredField)(tx, 'SignerQuorum', common_1.isNumber);
|
24940
24588
|
if (tx.SignerQuorum === 0) {
|
24941
24589
|
return;
|
24942
24590
|
}
|
24943
|
-
|
24944
|
-
throw new errors_1.ValidationError('SignerListSet: missing field SignerEntries');
|
24945
|
-
}
|
24946
|
-
if (!Array.isArray(tx.SignerEntries)) {
|
24947
|
-
throw new errors_1.ValidationError('SignerListSet: invalid SignerEntries');
|
24948
|
-
}
|
24591
|
+
(0, common_1.validateRequiredField)(tx, 'SignerEntries', common_1.isArray);
|
24949
24592
|
if (tx.SignerEntries.length === 0) {
|
24950
24593
|
throw new errors_1.ValidationError('SignerListSet: need at least 1 member in SignerEntries');
|
24951
24594
|
}
|
@@ -24953,10 +24596,14 @@ function validateSignerListSet(tx) {
|
|
24953
24596
|
throw new errors_1.ValidationError(`SignerListSet: maximum of ${MAX_SIGNERS} members allowed in SignerEntries`);
|
24954
24597
|
}
|
24955
24598
|
for (const entry of tx.SignerEntries) {
|
24956
|
-
|
24957
|
-
|
24958
|
-
|
24959
|
-
|
24599
|
+
if (!(0, common_1.isRecord)(entry) || !(0, common_1.isRecord)(entry.SignerEntry)) {
|
24600
|
+
throw new errors_1.ValidationError('SignerListSet: SignerEntries must be an array of SignerEntry objects');
|
24601
|
+
}
|
24602
|
+
const signerEntry = entry.SignerEntry;
|
24603
|
+
const { WalletLocator } = signerEntry;
|
24604
|
+
if (WalletLocator != null &&
|
24605
|
+
(!(0, common_1.isString)(WalletLocator) ||
|
24606
|
+
!HEX_WALLET_LOCATOR_REGEX.test(WalletLocator))) {
|
24960
24607
|
throw new errors_1.ValidationError(`SignerListSet: WalletLocator in SignerEntry must be a 256-bit (32-byte) hexadecimal value`);
|
24961
24608
|
}
|
24962
24609
|
}
|
@@ -25010,7 +24657,6 @@ exports.validateTicketCreate = validateTicketCreate;
|
|
25010
24657
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
25011
24658
|
exports.validate = void 0;
|
25012
24659
|
const errors_1 = __webpack_require__(/*! ../../errors */ "./dist/npm/errors.js");
|
25013
|
-
const utils_1 = __webpack_require__(/*! ../utils */ "./dist/npm/models/utils/index.js");
|
25014
24660
|
const flags_1 = __webpack_require__(/*! ../utils/flags */ "./dist/npm/models/utils/flags.js");
|
25015
24661
|
const accountDelete_1 = __webpack_require__(/*! ./accountDelete */ "./dist/npm/models/transactions/accountDelete.js");
|
25016
24662
|
const accountSet_1 = __webpack_require__(/*! ./accountSet */ "./dist/npm/models/transactions/accountSet.js");
|
@@ -25021,6 +24667,7 @@ const AMMDelete_1 = __webpack_require__(/*! ./AMMDelete */ "./dist/npm/models/tr
|
|
25021
24667
|
const AMMDeposit_1 = __webpack_require__(/*! ./AMMDeposit */ "./dist/npm/models/transactions/AMMDeposit.js");
|
25022
24668
|
const AMMVote_1 = __webpack_require__(/*! ./AMMVote */ "./dist/npm/models/transactions/AMMVote.js");
|
25023
24669
|
const AMMWithdraw_1 = __webpack_require__(/*! ./AMMWithdraw */ "./dist/npm/models/transactions/AMMWithdraw.js");
|
24670
|
+
const batch_1 = __webpack_require__(/*! ./batch */ "./dist/npm/models/transactions/batch.js");
|
25024
24671
|
const checkCancel_1 = __webpack_require__(/*! ./checkCancel */ "./dist/npm/models/transactions/checkCancel.js");
|
25025
24672
|
const checkCash_1 = __webpack_require__(/*! ./checkCash */ "./dist/npm/models/transactions/checkCash.js");
|
25026
24673
|
const checkCreate_1 = __webpack_require__(/*! ./checkCreate */ "./dist/npm/models/transactions/checkCreate.js");
|
@@ -25060,6 +24707,12 @@ const setRegularKey_1 = __webpack_require__(/*! ./setRegularKey */ "./dist/npm/m
|
|
25060
24707
|
const signerListSet_1 = __webpack_require__(/*! ./signerListSet */ "./dist/npm/models/transactions/signerListSet.js");
|
25061
24708
|
const ticketCreate_1 = __webpack_require__(/*! ./ticketCreate */ "./dist/npm/models/transactions/ticketCreate.js");
|
25062
24709
|
const trustSet_1 = __webpack_require__(/*! ./trustSet */ "./dist/npm/models/transactions/trustSet.js");
|
24710
|
+
const vaultClawback_1 = __webpack_require__(/*! ./vaultClawback */ "./dist/npm/models/transactions/vaultClawback.js");
|
24711
|
+
const vaultCreate_1 = __webpack_require__(/*! ./vaultCreate */ "./dist/npm/models/transactions/vaultCreate.js");
|
24712
|
+
const vaultDelete_1 = __webpack_require__(/*! ./vaultDelete */ "./dist/npm/models/transactions/vaultDelete.js");
|
24713
|
+
const vaultDeposit_1 = __webpack_require__(/*! ./vaultDeposit */ "./dist/npm/models/transactions/vaultDeposit.js");
|
24714
|
+
const vaultSet_1 = __webpack_require__(/*! ./vaultSet */ "./dist/npm/models/transactions/vaultSet.js");
|
24715
|
+
const vaultWithdraw_1 = __webpack_require__(/*! ./vaultWithdraw */ "./dist/npm/models/transactions/vaultWithdraw.js");
|
25063
24716
|
const XChainAccountCreateCommit_1 = __webpack_require__(/*! ./XChainAccountCreateCommit */ "./dist/npm/models/transactions/XChainAccountCreateCommit.js");
|
25064
24717
|
const XChainAddAccountCreateAttestation_1 = __webpack_require__(/*! ./XChainAddAccountCreateAttestation */ "./dist/npm/models/transactions/XChainAddAccountCreateAttestation.js");
|
25065
24718
|
const XChainAddClaimAttestation_1 = __webpack_require__(/*! ./XChainAddClaimAttestation */ "./dist/npm/models/transactions/XChainAddClaimAttestation.js");
|
@@ -25070,42 +24723,12 @@ const XChainCreateClaimID_1 = __webpack_require__(/*! ./XChainCreateClaimID */ "
|
|
25070
24723
|
const XChainModifyBridge_1 = __webpack_require__(/*! ./XChainModifyBridge */ "./dist/npm/models/transactions/XChainModifyBridge.js");
|
25071
24724
|
function validate(transaction) {
|
25072
24725
|
const tx = Object.assign({}, transaction);
|
25073
|
-
|
25074
|
-
throw new errors_1.ValidationError('Object does not have a `TransactionType`');
|
25075
|
-
}
|
25076
|
-
if (typeof tx.TransactionType !== 'string') {
|
25077
|
-
throw new errors_1.ValidationError("Object's `TransactionType` is not a string");
|
25078
|
-
}
|
25079
|
-
if (tx.Memos != null && typeof tx.Memos !== 'object') {
|
25080
|
-
throw new errors_1.ValidationError('Memo must be array');
|
25081
|
-
}
|
25082
|
-
if (tx.Memos != null) {
|
25083
|
-
;
|
25084
|
-
tx.Memos.forEach((memo) => {
|
25085
|
-
if ((memo === null || memo === void 0 ? void 0 : memo.Memo) == null) {
|
25086
|
-
throw new errors_1.ValidationError('Memo data must be in a `Memo` field');
|
25087
|
-
}
|
25088
|
-
if (memo.Memo.MemoData) {
|
25089
|
-
if (!(0, utils_1.isHex)(memo.Memo.MemoData)) {
|
25090
|
-
throw new errors_1.ValidationError('MemoData field must be a hex value');
|
25091
|
-
}
|
25092
|
-
}
|
25093
|
-
if (memo.Memo.MemoType) {
|
25094
|
-
if (!(0, utils_1.isHex)(memo.Memo.MemoType)) {
|
25095
|
-
throw new errors_1.ValidationError('MemoType field must be a hex value');
|
25096
|
-
}
|
25097
|
-
}
|
25098
|
-
if (memo.Memo.MemoFormat) {
|
25099
|
-
if (!(0, utils_1.isHex)(memo.Memo.MemoFormat)) {
|
25100
|
-
throw new errors_1.ValidationError('MemoFormat field must be a hex value');
|
25101
|
-
}
|
25102
|
-
}
|
25103
|
-
});
|
25104
|
-
}
|
24726
|
+
(0, common_1.validateBaseTransaction)(tx);
|
25105
24727
|
Object.keys(tx).forEach((key) => {
|
25106
24728
|
const standard_currency_code_len = 3;
|
25107
|
-
|
25108
|
-
|
24729
|
+
const value = tx[key];
|
24730
|
+
if (value && (0, common_1.isIssuedCurrencyAmount)(value)) {
|
24731
|
+
const txCurrency = value.currency;
|
25109
24732
|
if (txCurrency.length === standard_currency_code_len &&
|
25110
24733
|
txCurrency.toUpperCase() === 'XRP') {
|
25111
24734
|
throw new errors_1.ValidationError(`Cannot have an issued currency with a similar standard code to XRP (received '${txCurrency}'). XRP is not an issued currency.`);
|
@@ -25141,6 +24764,12 @@ function validate(transaction) {
|
|
25141
24764
|
case 'AccountSet':
|
25142
24765
|
(0, accountSet_1.validateAccountSet)(tx);
|
25143
24766
|
break;
|
24767
|
+
case 'Batch':
|
24768
|
+
(0, batch_1.validateBatch)(tx);
|
24769
|
+
tx.RawTransactions.forEach((innerTx) => {
|
24770
|
+
validate(innerTx.RawTransaction);
|
24771
|
+
});
|
24772
|
+
break;
|
25144
24773
|
case 'CheckCancel':
|
25145
24774
|
(0, checkCancel_1.validateCheckCancel)(tx);
|
25146
24775
|
break;
|
@@ -25255,6 +24884,24 @@ function validate(transaction) {
|
|
25255
24884
|
case 'TrustSet':
|
25256
24885
|
(0, trustSet_1.validateTrustSet)(tx);
|
25257
24886
|
break;
|
24887
|
+
case 'VaultClawback':
|
24888
|
+
(0, vaultClawback_1.validateVaultClawback)(tx);
|
24889
|
+
break;
|
24890
|
+
case 'VaultCreate':
|
24891
|
+
(0, vaultCreate_1.validateVaultCreate)(tx);
|
24892
|
+
break;
|
24893
|
+
case 'VaultDelete':
|
24894
|
+
(0, vaultDelete_1.validateVaultDelete)(tx);
|
24895
|
+
break;
|
24896
|
+
case 'VaultDeposit':
|
24897
|
+
(0, vaultDeposit_1.validateVaultDeposit)(tx);
|
24898
|
+
break;
|
24899
|
+
case 'VaultSet':
|
24900
|
+
(0, vaultSet_1.validateVaultSet)(tx);
|
24901
|
+
break;
|
24902
|
+
case 'VaultWithdraw':
|
24903
|
+
(0, vaultWithdraw_1.validateVaultWithdraw)(tx);
|
24904
|
+
break;
|
25258
24905
|
case 'XChainAccountCreateCommit':
|
25259
24906
|
(0, XChainAccountCreateCommit_1.validateXChainAccountCreateCommit)(tx);
|
25260
24907
|
break;
|
@@ -25329,6 +24976,187 @@ function validateTrustSet(tx) {
|
|
25329
24976
|
exports.validateTrustSet = validateTrustSet;
|
25330
24977
|
|
25331
24978
|
|
24979
|
+
/***/ }),
|
24980
|
+
|
24981
|
+
/***/ "./dist/npm/models/transactions/vaultClawback.js":
|
24982
|
+
/*!*******************************************************!*\
|
24983
|
+
!*** ./dist/npm/models/transactions/vaultClawback.js ***!
|
24984
|
+
\*******************************************************/
|
24985
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
24986
|
+
|
24987
|
+
"use strict";
|
24988
|
+
|
24989
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
24990
|
+
exports.validateVaultClawback = void 0;
|
24991
|
+
const common_1 = __webpack_require__(/*! ./common */ "./dist/npm/models/transactions/common.js");
|
24992
|
+
function validateVaultClawback(tx) {
|
24993
|
+
(0, common_1.validateBaseTransaction)(tx);
|
24994
|
+
(0, common_1.validateRequiredField)(tx, 'VaultID', common_1.isString);
|
24995
|
+
(0, common_1.validateRequiredField)(tx, 'Holder', common_1.isAccount);
|
24996
|
+
(0, common_1.validateOptionalField)(tx, 'Amount', common_1.isClawbackAmount);
|
24997
|
+
}
|
24998
|
+
exports.validateVaultClawback = validateVaultClawback;
|
24999
|
+
|
25000
|
+
|
25001
|
+
/***/ }),
|
25002
|
+
|
25003
|
+
/***/ "./dist/npm/models/transactions/vaultCreate.js":
|
25004
|
+
/*!*****************************************************!*\
|
25005
|
+
!*** ./dist/npm/models/transactions/vaultCreate.js ***!
|
25006
|
+
\*****************************************************/
|
25007
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
25008
|
+
|
25009
|
+
"use strict";
|
25010
|
+
|
25011
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
25012
|
+
exports.validateVaultCreate = exports.VaultCreateFlags = exports.VaultWithdrawalPolicy = void 0;
|
25013
|
+
const errors_1 = __webpack_require__(/*! ../../errors */ "./dist/npm/errors.js");
|
25014
|
+
const utils_1 = __webpack_require__(/*! ../utils */ "./dist/npm/models/utils/index.js");
|
25015
|
+
const common_1 = __webpack_require__(/*! ./common */ "./dist/npm/models/transactions/common.js");
|
25016
|
+
const META_MAX_BYTE_LENGTH = 1024;
|
25017
|
+
var VaultWithdrawalPolicy;
|
25018
|
+
(function (VaultWithdrawalPolicy) {
|
25019
|
+
VaultWithdrawalPolicy[VaultWithdrawalPolicy["vaultStrategyFirstComeFirstServe"] = 1] = "vaultStrategyFirstComeFirstServe";
|
25020
|
+
})(VaultWithdrawalPolicy || (exports.VaultWithdrawalPolicy = VaultWithdrawalPolicy = {}));
|
25021
|
+
var VaultCreateFlags;
|
25022
|
+
(function (VaultCreateFlags) {
|
25023
|
+
VaultCreateFlags[VaultCreateFlags["tfVaultPrivate"] = 65536] = "tfVaultPrivate";
|
25024
|
+
VaultCreateFlags[VaultCreateFlags["tfVaultShareNonTransferable"] = 131072] = "tfVaultShareNonTransferable";
|
25025
|
+
})(VaultCreateFlags || (exports.VaultCreateFlags = VaultCreateFlags = {}));
|
25026
|
+
function validateVaultCreate(tx) {
|
25027
|
+
(0, common_1.validateBaseTransaction)(tx);
|
25028
|
+
(0, common_1.validateRequiredField)(tx, 'Asset', common_1.isCurrency);
|
25029
|
+
(0, common_1.validateOptionalField)(tx, 'Data', common_1.isString);
|
25030
|
+
(0, common_1.validateOptionalField)(tx, 'AssetsMaximum', common_1.isXRPLNumber);
|
25031
|
+
(0, common_1.validateOptionalField)(tx, 'MPTokenMetadata', common_1.isString);
|
25032
|
+
(0, common_1.validateOptionalField)(tx, 'WithdrawalPolicy', common_1.isNumber);
|
25033
|
+
(0, common_1.validateOptionalField)(tx, 'DomainID', common_1.isString);
|
25034
|
+
if (tx.Data !== undefined) {
|
25035
|
+
const dataHex = tx.Data;
|
25036
|
+
if (!(0, utils_1.isHex)(dataHex)) {
|
25037
|
+
throw new errors_1.ValidationError('VaultCreate: Data must be a valid hex string');
|
25038
|
+
}
|
25039
|
+
const dataByteLength = dataHex.length / 2;
|
25040
|
+
if (dataByteLength > common_1.VAULT_DATA_MAX_BYTE_LENGTH) {
|
25041
|
+
throw new errors_1.ValidationError(`VaultCreate: Data exceeds ${common_1.VAULT_DATA_MAX_BYTE_LENGTH} bytes (actual: ${dataByteLength})`);
|
25042
|
+
}
|
25043
|
+
}
|
25044
|
+
if (tx.MPTokenMetadata !== undefined) {
|
25045
|
+
const metaHex = tx.MPTokenMetadata;
|
25046
|
+
if (!(0, utils_1.isHex)(metaHex)) {
|
25047
|
+
throw new errors_1.ValidationError('VaultCreate: MPTokenMetadata must be a valid hex string');
|
25048
|
+
}
|
25049
|
+
const metaByteLength = metaHex.length / 2;
|
25050
|
+
if (metaByteLength > META_MAX_BYTE_LENGTH) {
|
25051
|
+
throw new errors_1.ValidationError(`VaultCreate: MPTokenMetadata exceeds ${META_MAX_BYTE_LENGTH} bytes (actual: ${metaByteLength})`);
|
25052
|
+
}
|
25053
|
+
}
|
25054
|
+
if (tx.DomainID !== undefined &&
|
25055
|
+
!(0, utils_1.hasFlag)(tx, VaultCreateFlags.tfVaultPrivate, 'tfVaultPrivate')) {
|
25056
|
+
throw new errors_1.ValidationError('VaultCreate: Cannot set DomainID unless tfVaultPrivate flag is set.');
|
25057
|
+
}
|
25058
|
+
}
|
25059
|
+
exports.validateVaultCreate = validateVaultCreate;
|
25060
|
+
|
25061
|
+
|
25062
|
+
/***/ }),
|
25063
|
+
|
25064
|
+
/***/ "./dist/npm/models/transactions/vaultDelete.js":
|
25065
|
+
/*!*****************************************************!*\
|
25066
|
+
!*** ./dist/npm/models/transactions/vaultDelete.js ***!
|
25067
|
+
\*****************************************************/
|
25068
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
25069
|
+
|
25070
|
+
"use strict";
|
25071
|
+
|
25072
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
25073
|
+
exports.validateVaultDelete = void 0;
|
25074
|
+
const common_1 = __webpack_require__(/*! ./common */ "./dist/npm/models/transactions/common.js");
|
25075
|
+
function validateVaultDelete(tx) {
|
25076
|
+
(0, common_1.validateBaseTransaction)(tx);
|
25077
|
+
(0, common_1.validateRequiredField)(tx, 'VaultID', common_1.isString);
|
25078
|
+
}
|
25079
|
+
exports.validateVaultDelete = validateVaultDelete;
|
25080
|
+
|
25081
|
+
|
25082
|
+
/***/ }),
|
25083
|
+
|
25084
|
+
/***/ "./dist/npm/models/transactions/vaultDeposit.js":
|
25085
|
+
/*!******************************************************!*\
|
25086
|
+
!*** ./dist/npm/models/transactions/vaultDeposit.js ***!
|
25087
|
+
\******************************************************/
|
25088
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
25089
|
+
|
25090
|
+
"use strict";
|
25091
|
+
|
25092
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
25093
|
+
exports.validateVaultDeposit = void 0;
|
25094
|
+
const common_1 = __webpack_require__(/*! ./common */ "./dist/npm/models/transactions/common.js");
|
25095
|
+
function validateVaultDeposit(tx) {
|
25096
|
+
(0, common_1.validateBaseTransaction)(tx);
|
25097
|
+
(0, common_1.validateRequiredField)(tx, 'VaultID', common_1.isString);
|
25098
|
+
(0, common_1.validateRequiredField)(tx, 'Amount', common_1.isAmount);
|
25099
|
+
}
|
25100
|
+
exports.validateVaultDeposit = validateVaultDeposit;
|
25101
|
+
|
25102
|
+
|
25103
|
+
/***/ }),
|
25104
|
+
|
25105
|
+
/***/ "./dist/npm/models/transactions/vaultSet.js":
|
25106
|
+
/*!**************************************************!*\
|
25107
|
+
!*** ./dist/npm/models/transactions/vaultSet.js ***!
|
25108
|
+
\**************************************************/
|
25109
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
25110
|
+
|
25111
|
+
"use strict";
|
25112
|
+
|
25113
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
25114
|
+
exports.validateVaultSet = void 0;
|
25115
|
+
const errors_1 = __webpack_require__(/*! ../../errors */ "./dist/npm/errors.js");
|
25116
|
+
const utils_1 = __webpack_require__(/*! ../utils */ "./dist/npm/models/utils/index.js");
|
25117
|
+
const common_1 = __webpack_require__(/*! ./common */ "./dist/npm/models/transactions/common.js");
|
25118
|
+
function validateVaultSet(tx) {
|
25119
|
+
(0, common_1.validateBaseTransaction)(tx);
|
25120
|
+
(0, common_1.validateRequiredField)(tx, 'VaultID', common_1.isString);
|
25121
|
+
(0, common_1.validateOptionalField)(tx, 'Data', common_1.isString);
|
25122
|
+
(0, common_1.validateOptionalField)(tx, 'AssetsMaximum', common_1.isXRPLNumber);
|
25123
|
+
(0, common_1.validateOptionalField)(tx, 'DomainID', common_1.isString);
|
25124
|
+
if (tx.Data !== undefined) {
|
25125
|
+
const dataHex = tx.Data;
|
25126
|
+
if (!(0, utils_1.isHex)(dataHex)) {
|
25127
|
+
throw new errors_1.ValidationError('VaultSet: Data must be a valid hex string');
|
25128
|
+
}
|
25129
|
+
const dataByteLength = dataHex.length / 2;
|
25130
|
+
if (dataByteLength > common_1.VAULT_DATA_MAX_BYTE_LENGTH) {
|
25131
|
+
throw new errors_1.ValidationError(`VaultSet: Data exceeds ${common_1.VAULT_DATA_MAX_BYTE_LENGTH} bytes (actual: ${dataByteLength})`);
|
25132
|
+
}
|
25133
|
+
}
|
25134
|
+
}
|
25135
|
+
exports.validateVaultSet = validateVaultSet;
|
25136
|
+
|
25137
|
+
|
25138
|
+
/***/ }),
|
25139
|
+
|
25140
|
+
/***/ "./dist/npm/models/transactions/vaultWithdraw.js":
|
25141
|
+
/*!*******************************************************!*\
|
25142
|
+
!*** ./dist/npm/models/transactions/vaultWithdraw.js ***!
|
25143
|
+
\*******************************************************/
|
25144
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
25145
|
+
|
25146
|
+
"use strict";
|
25147
|
+
|
25148
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
25149
|
+
exports.validateVaultWithdraw = void 0;
|
25150
|
+
const common_1 = __webpack_require__(/*! ./common */ "./dist/npm/models/transactions/common.js");
|
25151
|
+
function validateVaultWithdraw(tx) {
|
25152
|
+
(0, common_1.validateBaseTransaction)(tx);
|
25153
|
+
(0, common_1.validateRequiredField)(tx, 'VaultID', common_1.isString);
|
25154
|
+
(0, common_1.validateRequiredField)(tx, 'Amount', common_1.isAmount);
|
25155
|
+
(0, common_1.validateOptionalField)(tx, 'Destination', common_1.isAccount);
|
25156
|
+
}
|
25157
|
+
exports.validateVaultWithdraw = validateVaultWithdraw;
|
25158
|
+
|
25159
|
+
|
25332
25160
|
/***/ }),
|
25333
25161
|
|
25334
25162
|
/***/ "./dist/npm/models/utils/flags.js":
|
@@ -25347,6 +25175,8 @@ const accountSet_1 = __webpack_require__(/*! ../transactions/accountSet */ "./di
|
|
25347
25175
|
const AMMClawback_1 = __webpack_require__(/*! ../transactions/AMMClawback */ "./dist/npm/models/transactions/AMMClawback.js");
|
25348
25176
|
const AMMDeposit_1 = __webpack_require__(/*! ../transactions/AMMDeposit */ "./dist/npm/models/transactions/AMMDeposit.js");
|
25349
25177
|
const AMMWithdraw_1 = __webpack_require__(/*! ../transactions/AMMWithdraw */ "./dist/npm/models/transactions/AMMWithdraw.js");
|
25178
|
+
const batch_1 = __webpack_require__(/*! ../transactions/batch */ "./dist/npm/models/transactions/batch.js");
|
25179
|
+
const common_1 = __webpack_require__(/*! ../transactions/common */ "./dist/npm/models/transactions/common.js");
|
25350
25180
|
const MPTokenAuthorize_1 = __webpack_require__(/*! ../transactions/MPTokenAuthorize */ "./dist/npm/models/transactions/MPTokenAuthorize.js");
|
25351
25181
|
const MPTokenIssuanceCreate_1 = __webpack_require__(/*! ../transactions/MPTokenIssuanceCreate */ "./dist/npm/models/transactions/MPTokenIssuanceCreate.js");
|
25352
25182
|
const MPTokenIssuanceSet_1 = __webpack_require__(/*! ../transactions/MPTokenIssuanceSet */ "./dist/npm/models/transactions/MPTokenIssuanceSet.js");
|
@@ -25356,6 +25186,7 @@ const offerCreate_1 = __webpack_require__(/*! ../transactions/offerCreate */ "./
|
|
25356
25186
|
const payment_1 = __webpack_require__(/*! ../transactions/payment */ "./dist/npm/models/transactions/payment.js");
|
25357
25187
|
const paymentChannelClaim_1 = __webpack_require__(/*! ../transactions/paymentChannelClaim */ "./dist/npm/models/transactions/paymentChannelClaim.js");
|
25358
25188
|
const trustSet_1 = __webpack_require__(/*! ../transactions/trustSet */ "./dist/npm/models/transactions/trustSet.js");
|
25189
|
+
const vaultCreate_1 = __webpack_require__(/*! ../transactions/vaultCreate */ "./dist/npm/models/transactions/vaultCreate.js");
|
25359
25190
|
const XChainModifyBridge_1 = __webpack_require__(/*! ../transactions/XChainModifyBridge */ "./dist/npm/models/transactions/XChainModifyBridge.js");
|
25360
25191
|
const _1 = __webpack_require__(/*! . */ "./dist/npm/models/utils/index.js");
|
25361
25192
|
function parseAccountRootFlags(flags) {
|
@@ -25374,6 +25205,7 @@ const txToFlag = {
|
|
25374
25205
|
AMMClawback: AMMClawback_1.AMMClawbackFlags,
|
25375
25206
|
AMMDeposit: AMMDeposit_1.AMMDepositFlags,
|
25376
25207
|
AMMWithdraw: AMMWithdraw_1.AMMWithdrawFlags,
|
25208
|
+
Batch: batch_1.BatchFlags,
|
25377
25209
|
MPTokenAuthorize: MPTokenAuthorize_1.MPTokenAuthorizeFlags,
|
25378
25210
|
MPTokenIssuanceCreate: MPTokenIssuanceCreate_1.MPTokenIssuanceCreateFlags,
|
25379
25211
|
MPTokenIssuanceSet: MPTokenIssuanceSet_1.MPTokenIssuanceSetFlags,
|
@@ -25383,6 +25215,7 @@ const txToFlag = {
|
|
25383
25215
|
PaymentChannelClaim: paymentChannelClaim_1.PaymentChannelClaimFlags,
|
25384
25216
|
Payment: payment_1.PaymentFlags,
|
25385
25217
|
TrustSet: trustSet_1.TrustSetFlags,
|
25218
|
+
VaultCreate: vaultCreate_1.VaultCreateFlags,
|
25386
25219
|
XChainModifyBridge: XChainModifyBridge_1.XChainModifyBridgeFlags,
|
25387
25220
|
};
|
25388
25221
|
function isTxToFlagKey(transactionType) {
|
@@ -25396,23 +25229,30 @@ function setTransactionFlagsToNumber(tx) {
|
|
25396
25229
|
}
|
25397
25230
|
exports.setTransactionFlagsToNumber = setTransactionFlagsToNumber;
|
25398
25231
|
function convertTxFlagsToNumber(tx) {
|
25399
|
-
|
25232
|
+
const txFlags = tx.Flags;
|
25233
|
+
if (txFlags == null) {
|
25400
25234
|
return 0;
|
25401
25235
|
}
|
25402
|
-
if (typeof
|
25403
|
-
return
|
25236
|
+
if (typeof txFlags === 'number') {
|
25237
|
+
return txFlags;
|
25404
25238
|
}
|
25405
25239
|
if (isTxToFlagKey(tx.TransactionType)) {
|
25406
25240
|
const flagEnum = txToFlag[tx.TransactionType];
|
25407
|
-
return Object.keys(
|
25408
|
-
|
25409
|
-
|
25410
|
-
throw new errors_1.ValidationError(`Invalid flag ${flag}. Valid flags are ${JSON.stringify(flagEnum)}`);
|
25241
|
+
return Object.keys(txFlags).reduce((resultFlags, flag) => {
|
25242
|
+
if (flagEnum[flag] == null && common_1.GlobalFlags[flag] == null) {
|
25243
|
+
throw new errors_1.ValidationError(`Invalid flag ${flag}.`);
|
25411
25244
|
}
|
25412
|
-
return
|
25245
|
+
return txFlags[flag]
|
25246
|
+
? resultFlags | (flagEnum[flag] || common_1.GlobalFlags[flag])
|
25247
|
+
: resultFlags;
|
25413
25248
|
}, 0);
|
25414
25249
|
}
|
25415
|
-
return
|
25250
|
+
return Object.keys(txFlags).reduce((resultFlags, flag) => {
|
25251
|
+
if (common_1.GlobalFlags[flag] == null) {
|
25252
|
+
throw new errors_1.ValidationError(`Invalid flag ${flag}. Valid flags are ${JSON.stringify(common_1.GlobalFlags)}`);
|
25253
|
+
}
|
25254
|
+
return txFlags[flag] ? resultFlags | common_1.GlobalFlags[flag] : resultFlags;
|
25255
|
+
}, 0);
|
25416
25256
|
}
|
25417
25257
|
exports.convertTxFlagsToNumber = convertTxFlagsToNumber;
|
25418
25258
|
function parseTransactionFlags(tx) {
|
@@ -25430,6 +25270,11 @@ function parseTransactionFlags(tx) {
|
|
25430
25270
|
}
|
25431
25271
|
});
|
25432
25272
|
}
|
25273
|
+
Object.values(common_1.GlobalFlags).forEach((flag) => {
|
25274
|
+
if (typeof flag === 'string' && (0, _1.isFlagEnabled)(flags, common_1.GlobalFlags[flag])) {
|
25275
|
+
booleanFlagMap[flag] = true;
|
25276
|
+
}
|
25277
|
+
});
|
25433
25278
|
return booleanFlagMap;
|
25434
25279
|
}
|
25435
25280
|
exports.parseTransactionFlags = parseTransactionFlags;
|
@@ -25446,7 +25291,7 @@ exports.parseTransactionFlags = parseTransactionFlags;
|
|
25446
25291
|
"use strict";
|
25447
25292
|
|
25448
25293
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
25449
|
-
exports.isHex = exports.isFlagEnabled = exports.onlyHasFields = exports.INTEGER_SANITY_CHECK = void 0;
|
25294
|
+
exports.isHex = exports.hasFlag = exports.isFlagEnabled = exports.onlyHasFields = exports.INTEGER_SANITY_CHECK = void 0;
|
25450
25295
|
const HEX_REGEX = /^[0-9A-Fa-f]+$/u;
|
25451
25296
|
exports.INTEGER_SANITY_CHECK = /^[0-9]+$/u;
|
25452
25297
|
function onlyHasFields(obj, fields) {
|
@@ -25457,6 +25302,16 @@ function isFlagEnabled(Flags, checkFlag) {
|
|
25457
25302
|
return (BigInt(checkFlag) & BigInt(Flags)) === BigInt(checkFlag);
|
25458
25303
|
}
|
25459
25304
|
exports.isFlagEnabled = isFlagEnabled;
|
25305
|
+
function hasFlag(tx, flag, flagName) {
|
25306
|
+
if (tx.Flags == null) {
|
25307
|
+
return false;
|
25308
|
+
}
|
25309
|
+
if (typeof tx.Flags === 'number') {
|
25310
|
+
return isFlagEnabled(tx.Flags, flag);
|
25311
|
+
}
|
25312
|
+
return tx.Flags[flagName] === true;
|
25313
|
+
}
|
25314
|
+
exports.hasFlag = hasFlag;
|
25460
25315
|
function isHex(str) {
|
25461
25316
|
return HEX_REGEX.test(str);
|
25462
25317
|
}
|
@@ -25482,11 +25337,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
25482
25337
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
25483
25338
|
});
|
25484
25339
|
};
|
25340
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
25341
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
25342
|
+
var m = o[Symbol.asyncIterator], i;
|
25343
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
25344
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
25345
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
25346
|
+
};
|
25485
25347
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
25486
25348
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
25487
25349
|
};
|
25488
25350
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
25489
|
-
exports.checkAccountDeleteBlockers = exports.setLatestValidatedLedgerSequence = exports.
|
25351
|
+
exports.autofillBatchTxn = exports.handleDeliverMax = exports.checkAccountDeleteBlockers = exports.setLatestValidatedLedgerSequence = exports.getTransactionFee = exports.setNextValidSequenceNumber = exports.setValidAddresses = exports.txNeedsNetworkID = void 0;
|
25490
25352
|
const bignumber_js_1 = __importDefault(__webpack_require__(/*! bignumber.js */ "../../node_modules/bignumber.js/bignumber.js"));
|
25491
25353
|
const ripple_address_codec_1 = __webpack_require__(/*! ripple-address-codec */ "../../node_modules/ripple-address-codec/dist/index.js");
|
25492
25354
|
const errors_1 = __webpack_require__(/*! ../errors */ "./dist/npm/errors.js");
|
@@ -25567,9 +25429,9 @@ function validateAccountAddress(tx, accountField, tagField) {
|
|
25567
25429
|
tx[tagField] = tag;
|
25568
25430
|
}
|
25569
25431
|
}
|
25570
|
-
function getClassicAccountAndTag(
|
25571
|
-
if ((0, ripple_address_codec_1.isValidXAddress)(
|
25572
|
-
const classic = (0, ripple_address_codec_1.xAddressToClassicAddress)(
|
25432
|
+
function getClassicAccountAndTag(account, expectedTag) {
|
25433
|
+
if ((0, ripple_address_codec_1.isValidXAddress)(account)) {
|
25434
|
+
const classic = (0, ripple_address_codec_1.xAddressToClassicAddress)(account);
|
25573
25435
|
if (expectedTag != null && classic.tag !== expectedTag) {
|
25574
25436
|
throw new errors_1.ValidationError('address includes a tag that does not match the tag specified in the transaction');
|
25575
25437
|
}
|
@@ -25579,7 +25441,7 @@ function getClassicAccountAndTag(Account, expectedTag) {
|
|
25579
25441
|
};
|
25580
25442
|
}
|
25581
25443
|
return {
|
25582
|
-
classicAccount:
|
25444
|
+
classicAccount: account,
|
25583
25445
|
tag: expectedTag,
|
25584
25446
|
};
|
25585
25447
|
}
|
@@ -25590,15 +25452,20 @@ function convertToClassicAddress(tx, fieldName) {
|
|
25590
25452
|
tx[fieldName] = classicAccount;
|
25591
25453
|
}
|
25592
25454
|
}
|
25593
|
-
function
|
25455
|
+
function getNextValidSequenceNumber(client, account) {
|
25594
25456
|
return __awaiter(this, void 0, void 0, function* () {
|
25595
25457
|
const request = {
|
25596
25458
|
command: 'account_info',
|
25597
|
-
account
|
25459
|
+
account,
|
25598
25460
|
ledger_index: 'current',
|
25599
25461
|
};
|
25600
25462
|
const data = yield client.request(request);
|
25601
|
-
|
25463
|
+
return data.result.account_data.Sequence;
|
25464
|
+
});
|
25465
|
+
}
|
25466
|
+
function setNextValidSequenceNumber(client, tx) {
|
25467
|
+
return __awaiter(this, void 0, void 0, function* () {
|
25468
|
+
tx.Sequence = yield getNextValidSequenceNumber(client, tx.Account);
|
25602
25469
|
});
|
25603
25470
|
}
|
25604
25471
|
exports.setNextValidSequenceNumber = setNextValidSequenceNumber;
|
@@ -25629,7 +25496,11 @@ function calculateFeePerTransactionType(client, tx, signersCount = 0) {
|
|
25629
25496
|
const netFeeXRP = yield (0, getFeeXrp_1.default)(client);
|
25630
25497
|
const netFeeDrops = new bignumber_js_1.default((0, utils_1.xrpToDrops)(netFeeXRP));
|
25631
25498
|
let baseFee = netFeeDrops;
|
25632
|
-
|
25499
|
+
const isSpecialTxCost = ['AccountDelete', 'AMMCreate'].includes(tx.TransactionType);
|
25500
|
+
if (tx.TransactionType === 'EscrowCreate' && tx.FinishFunction != null) {
|
25501
|
+
baseFee = baseFee.plus(1000);
|
25502
|
+
}
|
25503
|
+
else if (tx.TransactionType === 'EscrowFinish') {
|
25633
25504
|
if (tx.Fulfillment != null) {
|
25634
25505
|
const fulfillmentBytesSize = Math.ceil(tx.Fulfillment.length / 2);
|
25635
25506
|
baseFee = netFeeDrops.multipliedBy(33 + fulfillmentBytesSize / 16);
|
@@ -25642,24 +25513,34 @@ function calculateFeePerTransactionType(client, tx, signersCount = 0) {
|
|
25642
25513
|
baseFee = baseFee.plus(extraFee);
|
25643
25514
|
}
|
25644
25515
|
}
|
25645
|
-
if (tx.TransactionType === '
|
25646
|
-
|
25516
|
+
else if (tx.TransactionType === 'Batch') {
|
25517
|
+
const rawTxFees = yield tx.RawTransactions.reduce((acc, rawTxn) => __awaiter(this, void 0, void 0, function* () {
|
25518
|
+
const resolvedAcc = yield acc;
|
25519
|
+
const fee = yield calculateFeePerTransactionType(client, rawTxn.RawTransaction);
|
25520
|
+
return bignumber_js_1.default.sum(resolvedAcc, fee);
|
25521
|
+
}), Promise.resolve(new bignumber_js_1.default(0)));
|
25522
|
+
baseFee = bignumber_js_1.default.sum(baseFee.times(2), rawTxFees);
|
25647
25523
|
}
|
25648
|
-
|
25649
|
-
if (isSpecialTxCost) {
|
25524
|
+
else if (isSpecialTxCost) {
|
25650
25525
|
baseFee = yield fetchOwnerReserveFee(client);
|
25651
25526
|
}
|
25652
25527
|
if (signersCount > 0) {
|
25653
|
-
baseFee = bignumber_js_1.default.sum(baseFee, netFeeDrops.multipliedBy(
|
25528
|
+
baseFee = bignumber_js_1.default.sum(baseFee, netFeeDrops.multipliedBy(signersCount));
|
25654
25529
|
}
|
25655
25530
|
const maxFeeDrops = (0, utils_1.xrpToDrops)(client.maxFeeXRP);
|
25656
25531
|
const totalFee = isSpecialTxCost
|
25657
25532
|
? baseFee
|
25658
25533
|
: bignumber_js_1.default.min(baseFee, maxFeeDrops);
|
25659
|
-
|
25534
|
+
return totalFee.dp(0, bignumber_js_1.default.ROUND_CEIL);
|
25535
|
+
});
|
25536
|
+
}
|
25537
|
+
function getTransactionFee(client, tx, signersCount = 0) {
|
25538
|
+
return __awaiter(this, void 0, void 0, function* () {
|
25539
|
+
const fee = yield calculateFeePerTransactionType(client, tx, signersCount);
|
25540
|
+
tx.Fee = fee.toString(10);
|
25660
25541
|
});
|
25661
25542
|
}
|
25662
|
-
exports.
|
25543
|
+
exports.getTransactionFee = getTransactionFee;
|
25663
25544
|
function setLatestValidatedLedgerSequence(client, tx) {
|
25664
25545
|
return __awaiter(this, void 0, void 0, function* () {
|
25665
25546
|
const ledgerSequence = yield client.getLedgerIndex();
|
@@ -25685,6 +25566,73 @@ function checkAccountDeleteBlockers(client, tx) {
|
|
25685
25566
|
});
|
25686
25567
|
}
|
25687
25568
|
exports.checkAccountDeleteBlockers = checkAccountDeleteBlockers;
|
25569
|
+
function handleDeliverMax(tx) {
|
25570
|
+
if (tx.DeliverMax != null) {
|
25571
|
+
if (tx.Amount == null) {
|
25572
|
+
tx.Amount = tx.DeliverMax;
|
25573
|
+
}
|
25574
|
+
if (tx.Amount != null && tx.Amount !== tx.DeliverMax) {
|
25575
|
+
throw new errors_1.ValidationError('PaymentTransaction: Amount and DeliverMax fields must be identical when both are provided');
|
25576
|
+
}
|
25577
|
+
delete tx.DeliverMax;
|
25578
|
+
}
|
25579
|
+
}
|
25580
|
+
exports.handleDeliverMax = handleDeliverMax;
|
25581
|
+
function autofillBatchTxn(client, tx) {
|
25582
|
+
var _a, e_1, _b, _c;
|
25583
|
+
return __awaiter(this, void 0, void 0, function* () {
|
25584
|
+
const accountSequences = {};
|
25585
|
+
try {
|
25586
|
+
for (var _d = true, _e = __asyncValues(tx.RawTransactions), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
|
25587
|
+
_c = _f.value;
|
25588
|
+
_d = false;
|
25589
|
+
const rawTxn = _c;
|
25590
|
+
const txn = rawTxn.RawTransaction;
|
25591
|
+
if (txn.Sequence == null && txn.TicketSequence == null) {
|
25592
|
+
if (txn.Account in accountSequences) {
|
25593
|
+
txn.Sequence = accountSequences[txn.Account];
|
25594
|
+
accountSequences[txn.Account] += 1;
|
25595
|
+
}
|
25596
|
+
else {
|
25597
|
+
const nextSequence = yield getNextValidSequenceNumber(client, txn.Account);
|
25598
|
+
const sequence = txn.Account === tx.Account ? nextSequence + 1 : nextSequence;
|
25599
|
+
accountSequences[txn.Account] = sequence + 1;
|
25600
|
+
txn.Sequence = sequence;
|
25601
|
+
}
|
25602
|
+
}
|
25603
|
+
if (txn.Fee == null) {
|
25604
|
+
txn.Fee = '0';
|
25605
|
+
}
|
25606
|
+
else if (txn.Fee !== '0') {
|
25607
|
+
throw new errors_1.XrplError('Must have `Fee of "0" in inner Batch transaction.');
|
25608
|
+
}
|
25609
|
+
if (txn.SigningPubKey == null) {
|
25610
|
+
txn.SigningPubKey = '';
|
25611
|
+
}
|
25612
|
+
else if (txn.SigningPubKey !== '') {
|
25613
|
+
throw new errors_1.XrplError('Must have `SigningPubKey` of "" in inner Batch transaction.');
|
25614
|
+
}
|
25615
|
+
if (txn.TxnSignature != null) {
|
25616
|
+
throw new errors_1.XrplError('Must not have `TxnSignature` in inner Batch transaction.');
|
25617
|
+
}
|
25618
|
+
if (txn.Signers != null) {
|
25619
|
+
throw new errors_1.XrplError('Must not have `Signers` in inner Batch transaction.');
|
25620
|
+
}
|
25621
|
+
if (txn.NetworkID == null && txNeedsNetworkID(client)) {
|
25622
|
+
txn.NetworkID = client.networkID;
|
25623
|
+
}
|
25624
|
+
}
|
25625
|
+
}
|
25626
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
25627
|
+
finally {
|
25628
|
+
try {
|
25629
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
25630
|
+
}
|
25631
|
+
finally { if (e_1) throw e_1.error; }
|
25632
|
+
}
|
25633
|
+
});
|
25634
|
+
}
|
25635
|
+
exports.autofillBatchTxn = autofillBatchTxn;
|
25688
25636
|
|
25689
25637
|
|
25690
25638
|
/***/ }),
|
@@ -26482,7 +26430,8 @@ class LeafNode extends node_1.Node {
|
|
26482
26430
|
}
|
26483
26431
|
addItem(tag, node) {
|
26484
26432
|
throw new errors_1.XrplError('Cannot call addItem on a LeafNode');
|
26485
|
-
|
26433
|
+
// removed by dead control flow
|
26434
|
+
{}
|
26486
26435
|
}
|
26487
26436
|
}
|
26488
26437
|
exports["default"] = LeafNode;
|
@@ -26599,6 +26548,8 @@ const utils_1 = __webpack_require__(/*! @xrplf/isomorphic/utils */ "../../node_m
|
|
26599
26548
|
const bignumber_js_1 = __importDefault(__webpack_require__(/*! bignumber.js */ "../../node_modules/bignumber.js/bignumber.js"));
|
26600
26549
|
const ripple_binary_codec_1 = __webpack_require__(/*! ripple-binary-codec */ "../../node_modules/ripple-binary-codec/dist/index.js");
|
26601
26550
|
const errors_1 = __webpack_require__(/*! ../../errors */ "./dist/npm/errors.js");
|
26551
|
+
const common_1 = __webpack_require__(/*! ../../models/transactions/common */ "./dist/npm/models/transactions/common.js");
|
26552
|
+
const utils_2 = __webpack_require__(/*! ../../models/utils */ "./dist/npm/models/utils/index.js");
|
26602
26553
|
const HashPrefix_1 = __importDefault(__webpack_require__(/*! ./HashPrefix */ "./dist/npm/utils/hashes/HashPrefix.js"));
|
26603
26554
|
const sha512Half_1 = __importDefault(__webpack_require__(/*! ./sha512Half */ "./dist/npm/utils/hashes/sha512Half.js"));
|
26604
26555
|
const SHAMap_1 = __importStar(__webpack_require__(/*! ./SHAMap */ "./dist/npm/utils/hashes/SHAMap/index.js"));
|
@@ -26645,7 +26596,8 @@ function hashSignedTx(tx) {
|
|
26645
26596
|
}
|
26646
26597
|
if (txObject.TxnSignature === undefined &&
|
26647
26598
|
txObject.Signers === undefined &&
|
26648
|
-
txObject.SigningPubKey === undefined
|
26599
|
+
txObject.SigningPubKey === undefined &&
|
26600
|
+
!(0, utils_2.hasFlag)(txObject, common_1.GlobalFlags.tfInnerBatchTxn, 'tfInnerBatchTxn')) {
|
26649
26601
|
throw new errors_1.ValidationError('The transaction must be signed to hash it.');
|
26650
26602
|
}
|
26651
26603
|
const prefix = HashPrefix_1.default.TRANSACTION_ID.toString(16).toUpperCase();
|