xrpl 4.1.0 → 4.2.0-batch.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/xrpl-latest-min.js +3 -0
- package/build/xrpl-latest-min.js.map +1 -0
- package/build/xrpl-latest.js +528 -83
- 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 +124 -0
- package/dist/npm/Wallet/batchSigner.js.map +1 -0
- package/dist/npm/Wallet/defaultFaucets.d.ts +2 -1
- package/dist/npm/Wallet/defaultFaucets.d.ts.map +1 -1
- package/dist/npm/Wallet/defaultFaucets.js +5 -0
- package/dist/npm/Wallet/defaultFaucets.js.map +1 -1
- package/dist/npm/Wallet/index.d.ts.map +1 -1
- package/dist/npm/Wallet/index.js +8 -2
- package/dist/npm/Wallet/index.js.map +1 -1
- 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 +4 -0
- package/dist/npm/client/index.d.ts.map +1 -1
- package/dist/npm/client/index.js +16 -9
- package/dist/npm/client/index.js.map +1 -1
- package/dist/npm/models/index.d.ts +1 -1
- package/dist/npm/models/index.d.ts.map +1 -1
- package/dist/npm/models/index.js +3 -2
- package/dist/npm/models/index.js.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/PermissionedDomain.d.ts +11 -0
- package/dist/npm/models/ledger/PermissionedDomain.d.ts.map +1 -0
- package/dist/npm/models/ledger/PermissionedDomain.js +3 -0
- package/dist/npm/models/ledger/PermissionedDomain.js.map +1 -0
- package/dist/npm/models/ledger/RippleState.d.ts +3 -1
- package/dist/npm/models/ledger/RippleState.d.ts.map +1 -1
- package/dist/npm/models/ledger/RippleState.js +2 -0
- package/dist/npm/models/ledger/RippleState.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/ledger.d.ts +2 -2
- package/dist/npm/models/methods/ledger.d.ts.map +1 -1
- package/dist/npm/models/methods/serverState.d.ts +1 -0
- package/dist/npm/models/methods/serverState.d.ts.map +1 -1
- package/dist/npm/models/methods/simulate.d.ts +42 -0
- package/dist/npm/models/methods/simulate.d.ts.map +1 -0
- package/dist/npm/models/methods/simulate.js +3 -0
- package/dist/npm/models/methods/simulate.js.map +1 -0
- package/dist/npm/models/transactions/AMMClawback.d.ts +17 -0
- package/dist/npm/models/transactions/AMMClawback.d.ts.map +1 -0
- package/dist/npm/models/transactions/AMMClawback.js +34 -0
- package/dist/npm/models/transactions/AMMClawback.js.map +1 -0
- 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/AMMWithdraw.d.ts +2 -2
- package/dist/npm/models/transactions/AMMWithdraw.d.ts.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.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/NFTokenCreateOffer.d.ts +2 -2
- package/dist/npm/models/transactions/NFTokenCreateOffer.d.ts.map +1 -1
- package/dist/npm/models/transactions/NFTokenMint.d.ts +5 -3
- package/dist/npm/models/transactions/NFTokenMint.d.ts.map +1 -1
- package/dist/npm/models/transactions/NFTokenMint.js +1 -0
- package/dist/npm/models/transactions/NFTokenMint.js.map +1 -1
- package/dist/npm/models/transactions/NFTokenModify.d.ts +9 -0
- package/dist/npm/models/transactions/NFTokenModify.d.ts.map +1 -0
- package/dist/npm/models/transactions/NFTokenModify.js +22 -0
- package/dist/npm/models/transactions/NFTokenModify.js.map +1 -0
- 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 +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 +62 -0
- package/dist/npm/models/transactions/batch.js.map +1 -0
- package/dist/npm/models/transactions/common.d.ts +21 -6
- package/dist/npm/models/transactions/common.d.ts.map +1 -1
- package/dist/npm/models/transactions/common.js +52 -16
- package/dist/npm/models/transactions/common.js.map +1 -1
- package/dist/npm/models/transactions/depositPreauth.d.ts.map +1 -1
- package/dist/npm/models/transactions/depositPreauth.js +2 -2
- 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 +1 -1
- package/dist/npm/models/transactions/escrowFinish.js.map +1 -1
- package/dist/npm/models/transactions/index.d.ts +6 -1
- package/dist/npm/models/transactions/index.d.ts.map +1 -1
- package/dist/npm/models/transactions/index.js +5 -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/payment.d.ts +2 -2
- package/dist/npm/models/transactions/payment.d.ts.map +1 -1
- package/dist/npm/models/transactions/payment.js +1 -1
- 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 +1 -1
- package/dist/npm/models/transactions/paymentChannelClaim.js.map +1 -1
- package/dist/npm/models/transactions/permissionedDomainDelete.d.ts +7 -0
- package/dist/npm/models/transactions/permissionedDomainDelete.d.ts.map +1 -0
- package/dist/npm/models/transactions/permissionedDomainDelete.js +10 -0
- package/dist/npm/models/transactions/permissionedDomainDelete.js.map +1 -0
- package/dist/npm/models/transactions/permissionedDomainSet.d.ts +9 -0
- package/dist/npm/models/transactions/permissionedDomainSet.d.ts.map +1 -0
- package/dist/npm/models/transactions/permissionedDomainSet.js +13 -0
- package/dist/npm/models/transactions/permissionedDomainSet.js.map +1 -0
- package/dist/npm/models/transactions/transaction.d.ts +6 -1
- package/dist/npm/models/transactions/transaction.d.ts.map +1 -1
- package/dist/npm/models/transactions/transaction.js +24 -1
- package/dist/npm/models/transactions/transaction.js.map +1 -1
- package/dist/npm/models/transactions/trustSet.d.ts +7 -3
- package/dist/npm/models/transactions/trustSet.d.ts.map +1 -1
- package/dist/npm/models/transactions/trustSet.js +2 -0
- package/dist/npm/models/transactions/trustSet.js.map +1 -1
- package/dist/npm/models/utils/flags.d.ts +2 -0
- package/dist/npm/models/utils/flags.d.ts.map +1 -1
- package/dist/npm/models/utils/flags.js +59 -26
- package/dist/npm/models/utils/flags.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 +124 -0
- package/dist/npm/src/Wallet/batchSigner.js.map +1 -0
- package/dist/npm/src/Wallet/defaultFaucets.d.ts +2 -1
- package/dist/npm/src/Wallet/defaultFaucets.d.ts.map +1 -1
- package/dist/npm/src/Wallet/defaultFaucets.js +5 -0
- package/dist/npm/src/Wallet/defaultFaucets.js.map +1 -1
- package/dist/npm/src/Wallet/index.d.ts.map +1 -1
- package/dist/npm/src/Wallet/index.js +8 -2
- package/dist/npm/src/Wallet/index.js.map +1 -1
- 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 +4 -0
- package/dist/npm/src/client/index.d.ts.map +1 -1
- package/dist/npm/src/client/index.js +16 -9
- package/dist/npm/src/client/index.js.map +1 -1
- package/dist/npm/src/models/index.d.ts +1 -1
- package/dist/npm/src/models/index.d.ts.map +1 -1
- package/dist/npm/src/models/index.js +3 -2
- package/dist/npm/src/models/index.js.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/PermissionedDomain.d.ts +11 -0
- package/dist/npm/src/models/ledger/PermissionedDomain.d.ts.map +1 -0
- package/dist/npm/src/models/ledger/PermissionedDomain.js +3 -0
- package/dist/npm/src/models/ledger/PermissionedDomain.js.map +1 -0
- package/dist/npm/src/models/ledger/RippleState.d.ts +3 -1
- package/dist/npm/src/models/ledger/RippleState.d.ts.map +1 -1
- package/dist/npm/src/models/ledger/RippleState.js +2 -0
- package/dist/npm/src/models/ledger/RippleState.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/ledger.d.ts +2 -2
- package/dist/npm/src/models/methods/ledger.d.ts.map +1 -1
- package/dist/npm/src/models/methods/serverState.d.ts +1 -0
- package/dist/npm/src/models/methods/serverState.d.ts.map +1 -1
- package/dist/npm/src/models/methods/simulate.d.ts +42 -0
- package/dist/npm/src/models/methods/simulate.d.ts.map +1 -0
- package/dist/npm/src/models/methods/simulate.js +3 -0
- package/dist/npm/src/models/methods/simulate.js.map +1 -0
- package/dist/npm/src/models/transactions/AMMClawback.d.ts +17 -0
- package/dist/npm/src/models/transactions/AMMClawback.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/AMMClawback.js +34 -0
- package/dist/npm/src/models/transactions/AMMClawback.js.map +1 -0
- 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/AMMWithdraw.d.ts +2 -2
- package/dist/npm/src/models/transactions/AMMWithdraw.d.ts.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.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/NFTokenCreateOffer.d.ts +2 -2
- package/dist/npm/src/models/transactions/NFTokenCreateOffer.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/NFTokenMint.d.ts +5 -3
- package/dist/npm/src/models/transactions/NFTokenMint.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/NFTokenMint.js +1 -0
- package/dist/npm/src/models/transactions/NFTokenMint.js.map +1 -1
- package/dist/npm/src/models/transactions/NFTokenModify.d.ts +9 -0
- package/dist/npm/src/models/transactions/NFTokenModify.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/NFTokenModify.js +22 -0
- package/dist/npm/src/models/transactions/NFTokenModify.js.map +1 -0
- 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 +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 +62 -0
- package/dist/npm/src/models/transactions/batch.js.map +1 -0
- package/dist/npm/src/models/transactions/common.d.ts +21 -6
- package/dist/npm/src/models/transactions/common.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/common.js +52 -16
- package/dist/npm/src/models/transactions/common.js.map +1 -1
- package/dist/npm/src/models/transactions/depositPreauth.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/depositPreauth.js +2 -2
- 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 +1 -1
- package/dist/npm/src/models/transactions/escrowFinish.js.map +1 -1
- package/dist/npm/src/models/transactions/index.d.ts +6 -1
- package/dist/npm/src/models/transactions/index.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/index.js +5 -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/payment.d.ts +2 -2
- package/dist/npm/src/models/transactions/payment.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/payment.js +1 -1
- 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 +1 -1
- package/dist/npm/src/models/transactions/paymentChannelClaim.js.map +1 -1
- package/dist/npm/src/models/transactions/permissionedDomainDelete.d.ts +7 -0
- package/dist/npm/src/models/transactions/permissionedDomainDelete.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/permissionedDomainDelete.js +10 -0
- package/dist/npm/src/models/transactions/permissionedDomainDelete.js.map +1 -0
- package/dist/npm/src/models/transactions/permissionedDomainSet.d.ts +9 -0
- package/dist/npm/src/models/transactions/permissionedDomainSet.d.ts.map +1 -0
- package/dist/npm/src/models/transactions/permissionedDomainSet.js +13 -0
- package/dist/npm/src/models/transactions/permissionedDomainSet.js.map +1 -0
- package/dist/npm/src/models/transactions/transaction.d.ts +6 -1
- package/dist/npm/src/models/transactions/transaction.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/transaction.js +24 -1
- package/dist/npm/src/models/transactions/transaction.js.map +1 -1
- package/dist/npm/src/models/transactions/trustSet.d.ts +7 -3
- package/dist/npm/src/models/transactions/trustSet.d.ts.map +1 -1
- package/dist/npm/src/models/transactions/trustSet.js +2 -0
- package/dist/npm/src/models/transactions/trustSet.js.map +1 -1
- package/dist/npm/src/models/utils/flags.d.ts +2 -0
- package/dist/npm/src/models/utils/flags.d.ts.map +1 -1
- package/dist/npm/src/models/utils/flags.js +59 -26
- package/dist/npm/src/models/utils/flags.js.map +1 -1
- package/dist/npm/src/sugar/autofill.d.ts +3 -1
- package/dist/npm/src/sugar/autofill.d.ts.map +1 -1
- package/dist/npm/src/sugar/autofill.js +100 -5
- 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 +7 -7
- 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 +3 -1
- package/dist/npm/sugar/autofill.d.ts.map +1 -1
- package/dist/npm/sugar/autofill.js +100 -5
- 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 +7 -7
- 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 +5 -5
- package/src/Wallet/batchSigner.ts +222 -0
- package/src/Wallet/defaultFaucets.ts +6 -0
- package/src/Wallet/index.ts +9 -3
- package/src/client/RequestManager.ts +4 -1
- package/src/client/connection.ts +0 -1
- package/src/client/index.ts +49 -30
- package/src/models/index.ts +2 -1
- package/src/models/ledger/Credential.ts +2 -2
- package/src/models/ledger/LedgerEntry.ts +3 -0
- package/src/models/ledger/PermissionedDomain.ts +29 -0
- package/src/models/ledger/RippleState.ts +4 -0
- package/src/models/methods/baseMethod.ts +1 -0
- package/src/models/methods/index.ts +18 -0
- package/src/models/methods/ledger.ts +2 -2
- package/src/models/methods/serverState.ts +1 -0
- package/src/models/methods/simulate.ts +88 -0
- package/src/models/transactions/AMMClawback.ts +120 -0
- package/src/models/transactions/AMMDeposit.ts +2 -2
- package/src/models/transactions/AMMWithdraw.ts +2 -2
- package/src/models/transactions/MPTokenAuthorize.ts +2 -2
- package/src/models/transactions/MPTokenIssuanceCreate.ts +3 -2
- package/src/models/transactions/MPTokenIssuanceSet.ts +2 -2
- package/src/models/transactions/NFTokenCreateOffer.ts +2 -2
- package/src/models/transactions/NFTokenMint.ts +7 -2
- package/src/models/transactions/NFTokenModify.ts +67 -0
- package/src/models/transactions/XChainModifyBridge.ts +2 -2
- package/src/models/transactions/accountDelete.ts +2 -0
- package/src/models/transactions/accountSet.ts +2 -1
- package/src/models/transactions/batch.ts +147 -0
- package/src/models/transactions/common.ts +110 -30
- package/src/models/transactions/depositPreauth.ts +3 -0
- package/src/models/transactions/escrowFinish.ts +2 -0
- package/src/models/transactions/index.ts +10 -1
- package/src/models/transactions/metadata.ts +2 -0
- package/src/models/transactions/offerCreate.ts +2 -2
- package/src/models/transactions/payment.ts +4 -2
- package/src/models/transactions/paymentChannelClaim.ts +5 -2
- package/src/models/transactions/permissionedDomainDelete.ts +28 -0
- package/src/models/transactions/permissionedDomainSet.ts +54 -0
- package/src/models/transactions/transaction.ts +47 -2
- package/src/models/transactions/trustSet.ts +12 -2
- package/src/models/utils/flags.ts +85 -30
- package/src/sugar/autofill.ts +140 -11
- package/src/sugar/submit.ts +3 -5
- package/src/utils/hashes/hashLedger.ts +5 -2
@@ -9,15 +9,15 @@ import {
|
|
9
9
|
AuthorizeCredential,
|
10
10
|
Currency,
|
11
11
|
IssuedCurrencyAmount,
|
12
|
+
MPTAmount,
|
12
13
|
Memo,
|
13
14
|
Signer,
|
14
15
|
XChainBridge,
|
15
|
-
MPTAmount,
|
16
16
|
} from '../common'
|
17
17
|
import { onlyHasFields } from '../utils'
|
18
18
|
|
19
19
|
const MEMO_SIZE = 3
|
20
|
-
const
|
20
|
+
export const MAX_AUTHORIZED_CREDENTIALS = 8
|
21
21
|
const MAX_CREDENTIAL_BYTE_LENGTH = 64
|
22
22
|
const MAX_CREDENTIAL_TYPE_LENGTH = MAX_CREDENTIAL_BYTE_LENGTH * 2
|
23
23
|
|
@@ -134,7 +134,9 @@ export function isIssuedCurrency(
|
|
134
134
|
* @param input - The input to check the form and type of
|
135
135
|
* @returns Whether the AuthorizeCredential is properly formed
|
136
136
|
*/
|
137
|
-
function isAuthorizeCredential(
|
137
|
+
export function isAuthorizeCredential(
|
138
|
+
input: unknown,
|
139
|
+
): input is AuthorizeCredential {
|
138
140
|
return (
|
139
141
|
isRecord(input) &&
|
140
142
|
isRecord(input.Credential) &&
|
@@ -208,31 +210,57 @@ export function isXChainBridge(input: unknown): input is XChainBridge {
|
|
208
210
|
)
|
209
211
|
}
|
210
212
|
|
213
|
+
/**
|
214
|
+
* Verify the form and type of an Object at runtime.
|
215
|
+
*
|
216
|
+
* @param input - The object to check the form and type of.
|
217
|
+
* @returns Whether the Object is properly formed.
|
218
|
+
*/
|
219
|
+
export function isObject(input: unknown): input is object {
|
220
|
+
return typeof input === 'object'
|
221
|
+
}
|
222
|
+
|
223
|
+
/**
|
224
|
+
* Verify the form and type of an Array at runtime.
|
225
|
+
*
|
226
|
+
* @param input - The object to check the form and type of.
|
227
|
+
* @returns Whether the Array is properly formed.
|
228
|
+
*/
|
229
|
+
export function isArray(input: unknown): boolean {
|
230
|
+
return Array.isArray(input)
|
231
|
+
}
|
232
|
+
|
211
233
|
/* eslint-disable @typescript-eslint/restrict-template-expressions -- tx.TransactionType is checked before any calls */
|
212
234
|
|
213
235
|
/**
|
214
236
|
* Verify the form and type of a required type for a transaction at runtime.
|
215
237
|
*
|
216
|
-
* @param tx - The
|
217
|
-
* @param
|
238
|
+
* @param tx - The object input to check the form and type of.
|
239
|
+
* @param param - The object parameter.
|
218
240
|
* @param checkValidity - The function to use to check the type.
|
241
|
+
* @param errorOpts - Extra values to make the error message easier to understand.
|
242
|
+
* @param errorOpts.txType - The transaction type throwing the error.
|
243
|
+
* @param errorOpts.paramName - The name of the parameter in the transaction with the error.
|
219
244
|
* @throws
|
220
245
|
*/
|
246
|
+
// eslint-disable-next-line max-params -- helper function
|
221
247
|
export function validateRequiredField(
|
222
248
|
tx: Record<string, unknown>,
|
223
|
-
|
249
|
+
param: string,
|
224
250
|
checkValidity: (inp: unknown) => boolean,
|
251
|
+
errorOpts: {
|
252
|
+
txType?: string
|
253
|
+
paramName?: string
|
254
|
+
} = {},
|
225
255
|
): void {
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
)
|
256
|
+
const paramNameStr = errorOpts.paramName ?? param
|
257
|
+
const txType = errorOpts.txType ?? tx.TransactionType
|
258
|
+
if (tx[param] == null) {
|
259
|
+
throw new ValidationError(`${txType}: missing field ${paramNameStr}`)
|
230
260
|
}
|
231
261
|
|
232
|
-
if (!checkValidity(tx[
|
233
|
-
throw new ValidationError(
|
234
|
-
`${tx.TransactionType}: invalid field ${paramName}`,
|
235
|
-
)
|
262
|
+
if (!checkValidity(tx[param])) {
|
263
|
+
throw new ValidationError(`${txType}: invalid field ${paramNameStr}`)
|
236
264
|
}
|
237
265
|
}
|
238
266
|
|
@@ -240,26 +268,39 @@ export function validateRequiredField(
|
|
240
268
|
* Verify the form and type of an optional type for a transaction at runtime.
|
241
269
|
*
|
242
270
|
* @param tx - The transaction input to check the form and type of.
|
243
|
-
* @param
|
271
|
+
* @param param - The object parameter.
|
244
272
|
* @param checkValidity - The function to use to check the type.
|
273
|
+
* @param errorOpts - Extra values to make the error message easier to understand.
|
274
|
+
* @param errorOpts.txType - The transaction type throwing the error.
|
275
|
+
* @param errorOpts.paramName - The name of the parameter in the transaction with the error.
|
245
276
|
* @throws
|
246
277
|
*/
|
278
|
+
// eslint-disable-next-line max-params -- helper function
|
247
279
|
export function validateOptionalField(
|
248
280
|
tx: Record<string, unknown>,
|
249
|
-
|
281
|
+
param: string,
|
250
282
|
checkValidity: (inp: unknown) => boolean,
|
283
|
+
errorOpts: {
|
284
|
+
txType?: string
|
285
|
+
paramName?: string
|
286
|
+
} = {},
|
251
287
|
): void {
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
)
|
288
|
+
const paramNameStr = errorOpts.paramName ?? param
|
289
|
+
const txType = errorOpts.txType ?? tx.TransactionType
|
290
|
+
if (tx[param] !== undefined && !checkValidity(tx[param])) {
|
291
|
+
throw new ValidationError(`${txType}: invalid field ${paramNameStr}`)
|
256
292
|
}
|
257
293
|
}
|
258
294
|
|
259
295
|
/* eslint-enable @typescript-eslint/restrict-template-expressions -- checked before */
|
260
296
|
|
261
|
-
|
262
|
-
|
297
|
+
export enum GlobalFlags {
|
298
|
+
tfInnerBatchTxn = 0x40000000,
|
299
|
+
}
|
300
|
+
|
301
|
+
export interface GlobalFlagsInterface {
|
302
|
+
tfInnerBatchTxn?: boolean
|
303
|
+
}
|
263
304
|
|
264
305
|
/**
|
265
306
|
* Every transaction has the same set of common fields.
|
@@ -292,7 +333,7 @@ export interface BaseTransaction {
|
|
292
333
|
*/
|
293
334
|
AccountTxnID?: string
|
294
335
|
/** Set of bit-flags for this transaction. */
|
295
|
-
Flags?: number |
|
336
|
+
Flags?: number | GlobalFlagsInterface
|
296
337
|
/**
|
297
338
|
* Highest ledger index this transaction can appear in. Specifying this field
|
298
339
|
* places a strict upper limit on how long the transaction can wait to be
|
@@ -355,7 +396,9 @@ export function validateBaseTransaction(common: Record<string, unknown>): void {
|
|
355
396
|
}
|
356
397
|
|
357
398
|
if (!TRANSACTION_TYPES.includes(common.TransactionType)) {
|
358
|
-
throw new ValidationError(
|
399
|
+
throw new ValidationError(
|
400
|
+
`BaseTransaction: Unknown TransactionType ${common.TransactionType}`,
|
401
|
+
)
|
359
402
|
}
|
360
403
|
|
361
404
|
validateRequiredField(common, 'Account', isString)
|
@@ -455,13 +498,16 @@ export function validateCredentialType(tx: Record<string, unknown>): void {
|
|
455
498
|
* @param credentials An array of credential IDs to check for errors
|
456
499
|
* @param transactionType The transaction type to include in error messages
|
457
500
|
* @param isStringID Toggle for if array contains IDs instead of AuthorizeCredential objects
|
501
|
+
* @param maxCredentials The maximum length of the credentials array.
|
502
|
+
* PermissionedDomainSet transaction uses 10, other transactions use 8.
|
458
503
|
* @throws Validation Error if the formatting is incorrect
|
459
504
|
*/
|
460
|
-
// eslint-disable-next-line max-lines-per-function -- separating logic further will add unnecessary complexity
|
505
|
+
// eslint-disable-next-line max-lines-per-function, max-params -- separating logic further will add unnecessary complexity
|
461
506
|
export function validateCredentialsList(
|
462
507
|
credentials: unknown,
|
463
508
|
transactionType: string,
|
464
509
|
isStringID: boolean,
|
510
|
+
maxCredentials: number,
|
465
511
|
): void {
|
466
512
|
if (credentials == null) {
|
467
513
|
return
|
@@ -471,9 +517,9 @@ export function validateCredentialsList(
|
|
471
517
|
`${transactionType}: Credentials must be an array`,
|
472
518
|
)
|
473
519
|
}
|
474
|
-
if (credentials.length >
|
520
|
+
if (credentials.length > maxCredentials) {
|
475
521
|
throw new ValidationError(
|
476
|
-
`${transactionType}: Credentials length cannot exceed ${
|
522
|
+
`${transactionType}: Credentials length cannot exceed ${maxCredentials} elements`,
|
477
523
|
)
|
478
524
|
} else if (credentials.length === 0) {
|
479
525
|
throw new ValidationError(
|
@@ -500,7 +546,41 @@ export function validateCredentialsList(
|
|
500
546
|
}
|
501
547
|
}
|
502
548
|
|
503
|
-
|
504
|
-
|
505
|
-
|
549
|
+
// Type guard to ensure we're working with AuthorizeCredential[]
|
550
|
+
// Note: This is not a rigorous type-guard. A more thorough solution would be to iterate over the array and check each item.
|
551
|
+
function isAuthorizeCredentialArray(
|
552
|
+
list: AuthorizeCredential[] | string[],
|
553
|
+
): list is AuthorizeCredential[] {
|
554
|
+
return typeof list[0] !== 'string'
|
555
|
+
}
|
556
|
+
|
557
|
+
/**
|
558
|
+
* Check if an array of objects contains any duplicates.
|
559
|
+
*
|
560
|
+
* @param objectList - Array of objects to check for duplicates
|
561
|
+
* @returns True if duplicates exist, false otherwise
|
562
|
+
*/
|
563
|
+
export function containsDuplicates(
|
564
|
+
objectList: AuthorizeCredential[] | string[],
|
565
|
+
): boolean {
|
566
|
+
// Case-1: Process a list of string-IDs
|
567
|
+
if (typeof objectList[0] === 'string') {
|
568
|
+
const objSet = new Set(objectList.map((obj) => JSON.stringify(obj)))
|
569
|
+
return objSet.size !== objectList.length
|
570
|
+
}
|
571
|
+
|
572
|
+
// Case-2: Process a list of nested objects
|
573
|
+
const seen = new Set<string>()
|
574
|
+
|
575
|
+
if (isAuthorizeCredentialArray(objectList)) {
|
576
|
+
for (const item of objectList) {
|
577
|
+
const key = `${item.Credential.Issuer}-${item.Credential.CredentialType}`
|
578
|
+
if (seen.has(key)) {
|
579
|
+
return true
|
580
|
+
}
|
581
|
+
seen.add(key)
|
582
|
+
}
|
583
|
+
}
|
584
|
+
|
585
|
+
return false
|
506
586
|
}
|
@@ -5,6 +5,7 @@ import {
|
|
5
5
|
BaseTransaction,
|
6
6
|
validateBaseTransaction,
|
7
7
|
validateCredentialsList,
|
8
|
+
MAX_AUTHORIZED_CREDENTIALS,
|
8
9
|
} from './common'
|
9
10
|
|
10
11
|
/**
|
@@ -72,6 +73,7 @@ export function validateDepositPreauth(tx: Record<string, unknown>): void {
|
|
72
73
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- confirmed in base transaction check
|
73
74
|
tx.TransactionType as string,
|
74
75
|
false,
|
76
|
+
MAX_AUTHORIZED_CREDENTIALS,
|
75
77
|
)
|
76
78
|
} else if (tx.UnauthorizeCredentials !== undefined) {
|
77
79
|
validateCredentialsList(
|
@@ -79,6 +81,7 @@ export function validateDepositPreauth(tx: Record<string, unknown>): void {
|
|
79
81
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- confirmed in base transaction check
|
80
82
|
tx.TransactionType as string,
|
81
83
|
false,
|
84
|
+
MAX_AUTHORIZED_CREDENTIALS,
|
82
85
|
)
|
83
86
|
}
|
84
87
|
}
|
@@ -7,6 +7,7 @@ import {
|
|
7
7
|
validateBaseTransaction,
|
8
8
|
validateCredentialsList,
|
9
9
|
validateRequiredField,
|
10
|
+
MAX_AUTHORIZED_CREDENTIALS,
|
10
11
|
} from './common'
|
11
12
|
|
12
13
|
/**
|
@@ -55,6 +56,7 @@ export function validateEscrowFinish(tx: Record<string, unknown>): void {
|
|
55
56
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- known from base check
|
56
57
|
tx.TransactionType as string,
|
57
58
|
true,
|
59
|
+
MAX_AUTHORIZED_CREDENTIALS,
|
58
60
|
)
|
59
61
|
|
60
62
|
if (tx.OfferSequence == null) {
|
@@ -15,19 +15,25 @@ export {
|
|
15
15
|
} from './accountSet'
|
16
16
|
export { AccountDelete } from './accountDelete'
|
17
17
|
export { AMMBid } from './AMMBid'
|
18
|
+
export {
|
19
|
+
AMMClawbackFlags,
|
20
|
+
AMMClawbackFlagsInterface,
|
21
|
+
AMMClawback,
|
22
|
+
} from './AMMClawback'
|
23
|
+
export { AMMCreate } from './AMMCreate'
|
18
24
|
export { AMMDelete } from './AMMDelete'
|
19
25
|
export {
|
20
26
|
AMMDepositFlags,
|
21
27
|
AMMDepositFlagsInterface,
|
22
28
|
AMMDeposit,
|
23
29
|
} from './AMMDeposit'
|
24
|
-
export { AMMCreate } from './AMMCreate'
|
25
30
|
export { AMMVote } from './AMMVote'
|
26
31
|
export {
|
27
32
|
AMMWithdrawFlags,
|
28
33
|
AMMWithdrawFlagsInterface,
|
29
34
|
AMMWithdraw,
|
30
35
|
} from './AMMWithdraw'
|
36
|
+
export { Batch } from './batch'
|
31
37
|
export { CheckCancel } from './checkCancel'
|
32
38
|
export { CheckCash } from './checkCash'
|
33
39
|
export { CheckCreate } from './checkCreate'
|
@@ -71,6 +77,7 @@ export {
|
|
71
77
|
NFTokenMintFlags,
|
72
78
|
NFTokenMintFlagsInterface,
|
73
79
|
} from './NFTokenMint'
|
80
|
+
export { NFTokenModify, validateNFTokenModify } from './NFTokenModify'
|
74
81
|
export { OfferCancel } from './offerCancel'
|
75
82
|
export {
|
76
83
|
OfferCreateFlags,
|
@@ -93,6 +100,8 @@ export { SignerListSet } from './signerListSet'
|
|
93
100
|
export { TicketCreate } from './ticketCreate'
|
94
101
|
export { TrustSetFlagsInterface, TrustSetFlags, TrustSet } from './trustSet'
|
95
102
|
export { UNLModify } from './UNLModify'
|
103
|
+
export { PermissionedDomainSet } from './permissionedDomainSet'
|
104
|
+
export { PermissionedDomainDelete } from './permissionedDomainDelete'
|
96
105
|
export { XChainAddAccountCreateAttestation } from './XChainAddAccountCreateAttestation'
|
97
106
|
export { XChainAddClaimAttestation } from './XChainAddClaimAttestation'
|
98
107
|
export { XChainClaim } from './XChainClaim'
|
@@ -88,6 +88,8 @@ export interface TransactionMetadataBase {
|
|
88
88
|
delivered_amount?: Amount | MPTAmount | 'unavailable'
|
89
89
|
TransactionIndex: number
|
90
90
|
TransactionResult: string
|
91
|
+
|
92
|
+
ParentBatchID?: string
|
91
93
|
}
|
92
94
|
|
93
95
|
export type TransactionMetadata<T extends BaseTransaction = Transaction> =
|
@@ -3,7 +3,7 @@ import { Amount } from '../common'
|
|
3
3
|
|
4
4
|
import {
|
5
5
|
BaseTransaction,
|
6
|
-
|
6
|
+
GlobalFlagsInterface,
|
7
7
|
validateBaseTransaction,
|
8
8
|
isAmount,
|
9
9
|
} from './common'
|
@@ -78,7 +78,7 @@ export enum OfferCreateFlags {
|
|
78
78
|
* // }
|
79
79
|
* ```
|
80
80
|
*/
|
81
|
-
export interface OfferCreateFlagsInterface extends
|
81
|
+
export interface OfferCreateFlagsInterface extends GlobalFlagsInterface {
|
82
82
|
tfPassive?: boolean
|
83
83
|
tfImmediateOrCancel?: boolean
|
84
84
|
tfFillOrKill?: boolean
|
@@ -5,7 +5,7 @@ import { isFlagEnabled } from '../utils'
|
|
5
5
|
import {
|
6
6
|
BaseTransaction,
|
7
7
|
isAmount,
|
8
|
-
|
8
|
+
GlobalFlagsInterface,
|
9
9
|
validateBaseTransaction,
|
10
10
|
isAccount,
|
11
11
|
validateRequiredField,
|
@@ -13,6 +13,7 @@ import {
|
|
13
13
|
isNumber,
|
14
14
|
Account,
|
15
15
|
validateCredentialsList,
|
16
|
+
MAX_AUTHORIZED_CREDENTIALS,
|
16
17
|
} from './common'
|
17
18
|
import type { TransactionMetadataBase } from './metadata'
|
18
19
|
|
@@ -83,7 +84,7 @@ export enum PaymentFlags {
|
|
83
84
|
* // }
|
84
85
|
* ```
|
85
86
|
*/
|
86
|
-
export interface PaymentFlagsInterface extends
|
87
|
+
export interface PaymentFlagsInterface extends GlobalFlagsInterface {
|
87
88
|
/**
|
88
89
|
* Do not use the default path; only use paths included in the Paths field.
|
89
90
|
* This is intended to force the transaction to take arbitrage opportunities.
|
@@ -188,6 +189,7 @@ export function validatePayment(tx: Record<string, unknown>): void {
|
|
188
189
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- known from base check
|
189
190
|
tx.TransactionType as string,
|
190
191
|
true,
|
192
|
+
MAX_AUTHORIZED_CREDENTIALS,
|
191
193
|
)
|
192
194
|
|
193
195
|
if (tx.InvoiceID !== undefined && typeof tx.InvoiceID !== 'string') {
|
@@ -2,9 +2,10 @@ import { ValidationError } from '../../errors'
|
|
2
2
|
|
3
3
|
import {
|
4
4
|
BaseTransaction,
|
5
|
-
|
5
|
+
GlobalFlagsInterface,
|
6
6
|
validateBaseTransaction,
|
7
7
|
validateCredentialsList,
|
8
|
+
MAX_AUTHORIZED_CREDENTIALS,
|
8
9
|
} from './common'
|
9
10
|
|
10
11
|
/**
|
@@ -72,7 +73,8 @@ export enum PaymentChannelClaimFlags {
|
|
72
73
|
* // }
|
73
74
|
* ```
|
74
75
|
*/
|
75
|
-
export interface PaymentChannelClaimFlagsInterface
|
76
|
+
export interface PaymentChannelClaimFlagsInterface
|
77
|
+
extends GlobalFlagsInterface {
|
76
78
|
/**
|
77
79
|
* Clear the channel's Expiration time. (Expiration is different from the
|
78
80
|
* channel's immutable CancelAfter time.) Only the source address of the
|
@@ -153,6 +155,7 @@ export function validatePaymentChannelClaim(tx: Record<string, unknown>): void {
|
|
153
155
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- known from base check
|
154
156
|
tx.TransactionType as string,
|
155
157
|
true,
|
158
|
+
MAX_AUTHORIZED_CREDENTIALS,
|
156
159
|
)
|
157
160
|
|
158
161
|
if (tx.Channel === undefined) {
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import {
|
2
|
+
BaseTransaction,
|
3
|
+
isString,
|
4
|
+
validateBaseTransaction,
|
5
|
+
validateRequiredField,
|
6
|
+
} from './common'
|
7
|
+
|
8
|
+
export interface PermissionedDomainDelete extends BaseTransaction {
|
9
|
+
/* The transaction type (PermissionedDomainDelete). */
|
10
|
+
TransactionType: 'PermissionedDomainDelete'
|
11
|
+
|
12
|
+
/* The domain to delete. */
|
13
|
+
DomainID: string
|
14
|
+
}
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Verify the form and type of a PermissionedDomainDelete transaction.
|
18
|
+
*
|
19
|
+
* @param tx - The transaction to verify.
|
20
|
+
* @throws When the transaction is malformed.
|
21
|
+
*/
|
22
|
+
export function validatePermissionedDomainDelete(
|
23
|
+
tx: Record<string, unknown>,
|
24
|
+
): void {
|
25
|
+
validateBaseTransaction(tx)
|
26
|
+
|
27
|
+
validateRequiredField(tx, 'DomainID', isString)
|
28
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import { AuthorizeCredential } from '../common'
|
2
|
+
|
3
|
+
import {
|
4
|
+
BaseTransaction,
|
5
|
+
isString,
|
6
|
+
validateBaseTransaction,
|
7
|
+
validateOptionalField,
|
8
|
+
validateRequiredField,
|
9
|
+
validateCredentialsList,
|
10
|
+
} from './common'
|
11
|
+
|
12
|
+
const MAX_ACCEPTED_CREDENTIALS = 10
|
13
|
+
|
14
|
+
export interface PermissionedDomainSet extends BaseTransaction {
|
15
|
+
/* The transaction type (PermissionedDomainSet). */
|
16
|
+
TransactionType: 'PermissionedDomainSet'
|
17
|
+
|
18
|
+
/* The domain to modify. Must be included if modifying an existing domain. */
|
19
|
+
DomainID?: string
|
20
|
+
|
21
|
+
/* The credentials that are accepted by the domain. Ownership of one
|
22
|
+
of these credentials automatically makes you a member of the domain.
|
23
|
+
An empty array means deleting the field. */
|
24
|
+
AcceptedCredentials: AuthorizeCredential[]
|
25
|
+
}
|
26
|
+
|
27
|
+
/**
|
28
|
+
* Validate a PermissionedDomainSet transaction.
|
29
|
+
*
|
30
|
+
* @param tx - The transaction to validate.
|
31
|
+
* @throws {ValidationError} When the transaction is invalid.
|
32
|
+
*/
|
33
|
+
export function validatePermissionedDomainSet(
|
34
|
+
tx: Record<string, unknown>,
|
35
|
+
): void {
|
36
|
+
validateBaseTransaction(tx)
|
37
|
+
|
38
|
+
validateOptionalField(tx, 'DomainID', isString)
|
39
|
+
validateRequiredField(
|
40
|
+
tx,
|
41
|
+
'AcceptedCredentials',
|
42
|
+
() => tx.AcceptedCredentials instanceof Array,
|
43
|
+
)
|
44
|
+
|
45
|
+
validateCredentialsList(
|
46
|
+
tx.AcceptedCredentials,
|
47
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- known from base check
|
48
|
+
tx.TransactionType as string,
|
49
|
+
// PermissionedDomainSet uses AuthorizeCredential nested objects only, strings are not allowed
|
50
|
+
false,
|
51
|
+
// PermissionedDomainSet uses at most 10 accepted credentials. This is different from Credential-feature transactions.
|
52
|
+
MAX_ACCEPTED_CREDENTIALS,
|
53
|
+
)
|
54
|
+
}
|
@@ -4,16 +4,18 @@
|
|
4
4
|
import { ValidationError } from '../../errors'
|
5
5
|
import { IssuedCurrencyAmount, Memo } from '../common'
|
6
6
|
import { isHex } from '../utils'
|
7
|
-
import {
|
7
|
+
import { convertTxFlagsToNumber } from '../utils/flags'
|
8
8
|
|
9
9
|
import { AccountDelete, validateAccountDelete } from './accountDelete'
|
10
10
|
import { AccountSet, validateAccountSet } from './accountSet'
|
11
11
|
import { AMMBid, validateAMMBid } from './AMMBid'
|
12
|
+
import { AMMClawback, validateAMMClawback } from './AMMClawback'
|
12
13
|
import { AMMCreate, validateAMMCreate } from './AMMCreate'
|
13
14
|
import { AMMDelete, validateAMMDelete } from './AMMDelete'
|
14
15
|
import { AMMDeposit, validateAMMDeposit } from './AMMDeposit'
|
15
16
|
import { AMMVote, validateAMMVote } from './AMMVote'
|
16
17
|
import { AMMWithdraw, validateAMMWithdraw } from './AMMWithdraw'
|
18
|
+
import { Batch, validateBatch } from './batch'
|
17
19
|
import { CheckCancel, validateCheckCancel } from './checkCancel'
|
18
20
|
import { CheckCash, validateCheckCash } from './checkCash'
|
19
21
|
import { CheckCreate, validateCheckCreate } from './checkCreate'
|
@@ -57,6 +59,7 @@ import {
|
|
57
59
|
validateNFTokenCreateOffer,
|
58
60
|
} from './NFTokenCreateOffer'
|
59
61
|
import { NFTokenMint, validateNFTokenMint } from './NFTokenMint'
|
62
|
+
import { NFTokenModify, validateNFTokenModify } from './NFTokenModify'
|
60
63
|
import { OfferCancel, validateOfferCancel } from './offerCancel'
|
61
64
|
import { OfferCreate, validateOfferCreate } from './offerCreate'
|
62
65
|
import { OracleDelete, validateOracleDelete } from './oracleDelete'
|
@@ -74,6 +77,14 @@ import {
|
|
74
77
|
PaymentChannelFund,
|
75
78
|
validatePaymentChannelFund,
|
76
79
|
} from './paymentChannelFund'
|
80
|
+
import {
|
81
|
+
PermissionedDomainDelete,
|
82
|
+
validatePermissionedDomainDelete,
|
83
|
+
} from './permissionedDomainDelete'
|
84
|
+
import {
|
85
|
+
PermissionedDomainSet,
|
86
|
+
validatePermissionedDomainSet,
|
87
|
+
} from './permissionedDomainSet'
|
77
88
|
import { SetFee } from './setFee'
|
78
89
|
import { SetRegularKey, validateSetRegularKey } from './setRegularKey'
|
79
90
|
import { SignerListSet, validateSignerListSet } from './signerListSet'
|
@@ -114,6 +125,7 @@ import {
|
|
114
125
|
*/
|
115
126
|
export type SubmittableTransaction =
|
116
127
|
| AMMBid
|
128
|
+
| AMMClawback
|
117
129
|
| AMMCreate
|
118
130
|
| AMMDelete
|
119
131
|
| AMMDeposit
|
@@ -121,6 +133,7 @@ export type SubmittableTransaction =
|
|
121
133
|
| AMMWithdraw
|
122
134
|
| AccountDelete
|
123
135
|
| AccountSet
|
136
|
+
| Batch
|
124
137
|
| CheckCancel
|
125
138
|
| CheckCash
|
126
139
|
| CheckCreate
|
@@ -143,6 +156,7 @@ export type SubmittableTransaction =
|
|
143
156
|
| NFTokenCancelOffer
|
144
157
|
| NFTokenCreateOffer
|
145
158
|
| NFTokenMint
|
159
|
+
| NFTokenModify
|
146
160
|
| OfferCancel
|
147
161
|
| OfferCreate
|
148
162
|
| OracleDelete
|
@@ -151,6 +165,8 @@ export type SubmittableTransaction =
|
|
151
165
|
| PaymentChannelClaim
|
152
166
|
| PaymentChannelCreate
|
153
167
|
| PaymentChannelFund
|
168
|
+
| PermissionedDomainSet
|
169
|
+
| PermissionedDomainDelete
|
154
170
|
| SetRegularKey
|
155
171
|
| SignerListSet
|
156
172
|
| TicketCreate
|
@@ -255,12 +271,16 @@ export function validate(transaction: Record<string, unknown>): void {
|
|
255
271
|
})
|
256
272
|
|
257
273
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- okay here
|
258
|
-
|
274
|
+
tx.Flags = convertTxFlagsToNumber(tx as unknown as Transaction)
|
259
275
|
switch (tx.TransactionType) {
|
260
276
|
case 'AMMBid':
|
261
277
|
validateAMMBid(tx)
|
262
278
|
break
|
263
279
|
|
280
|
+
case 'AMMClawback':
|
281
|
+
validateAMMClawback(tx)
|
282
|
+
break
|
283
|
+
|
264
284
|
case 'AMMCreate':
|
265
285
|
validateAMMCreate(tx)
|
266
286
|
break
|
@@ -289,6 +309,19 @@ export function validate(transaction: Record<string, unknown>): void {
|
|
289
309
|
validateAccountSet(tx)
|
290
310
|
break
|
291
311
|
|
312
|
+
case 'Batch':
|
313
|
+
validateBatch(tx)
|
314
|
+
// This is done here to avoid issues with dependency cycles
|
315
|
+
|
316
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- okay here
|
317
|
+
// @ts-expect-error -- already checked
|
318
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call -- already checked above
|
319
|
+
tx.RawTransactions.forEach((innerTx: Record<string, unknown>) => {
|
320
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- already checked above
|
321
|
+
validate(innerTx.RawTransaction as Record<string, unknown>)
|
322
|
+
})
|
323
|
+
break
|
324
|
+
|
292
325
|
case 'CheckCancel':
|
293
326
|
validateCheckCancel(tx)
|
294
327
|
break
|
@@ -377,6 +410,10 @@ export function validate(transaction: Record<string, unknown>): void {
|
|
377
410
|
validateNFTokenMint(tx)
|
378
411
|
break
|
379
412
|
|
413
|
+
case 'NFTokenModify':
|
414
|
+
validateNFTokenModify(tx)
|
415
|
+
break
|
416
|
+
|
380
417
|
case 'OfferCancel':
|
381
418
|
validateOfferCancel(tx)
|
382
419
|
break
|
@@ -409,6 +446,14 @@ export function validate(transaction: Record<string, unknown>): void {
|
|
409
446
|
validatePaymentChannelFund(tx)
|
410
447
|
break
|
411
448
|
|
449
|
+
case 'PermissionedDomainSet':
|
450
|
+
validatePermissionedDomainSet(tx)
|
451
|
+
break
|
452
|
+
|
453
|
+
case 'PermissionedDomainDelete':
|
454
|
+
validatePermissionedDomainDelete(tx)
|
455
|
+
break
|
456
|
+
|
412
457
|
case 'SetRegularKey':
|
413
458
|
validateSetRegularKey(tx)
|
414
459
|
break
|
@@ -3,7 +3,7 @@ import { IssuedCurrencyAmount } from '../common'
|
|
3
3
|
|
4
4
|
import {
|
5
5
|
BaseTransaction,
|
6
|
-
|
6
|
+
GlobalFlagsInterface,
|
7
7
|
isAmount,
|
8
8
|
validateBaseTransaction,
|
9
9
|
} from './common'
|
@@ -30,6 +30,11 @@ export enum TrustSetFlags {
|
|
30
30
|
tfSetFreeze = 0x00100000,
|
31
31
|
/** Unfreeze the trust line. */
|
32
32
|
tfClearFreeze = 0x00200000,
|
33
|
+
/** Deep-Freeze the trustline -- disallow sending and receiving the said IssuedCurrency */
|
34
|
+
/** Allowed only if the trustline is already regularly frozen, or if tfSetFreeze is set in the same transaction. */
|
35
|
+
tfSetDeepFreeze = 0x00400000,
|
36
|
+
/** Clear a Deep-Frozen trustline */
|
37
|
+
tfClearDeepFreeze = 0x00800000,
|
33
38
|
}
|
34
39
|
|
35
40
|
/**
|
@@ -72,7 +77,7 @@ export enum TrustSetFlags {
|
|
72
77
|
* // }
|
73
78
|
* ```
|
74
79
|
*/
|
75
|
-
export interface TrustSetFlagsInterface extends
|
80
|
+
export interface TrustSetFlagsInterface extends GlobalFlagsInterface {
|
76
81
|
/**
|
77
82
|
* Authorize the other party to hold currency issued by this account. (No
|
78
83
|
* effect unless using the asfRequireAuth AccountSet flag.) Cannot be unset.
|
@@ -89,6 +94,11 @@ export interface TrustSetFlagsInterface extends GlobalFlags {
|
|
89
94
|
tfSetFreeze?: boolean
|
90
95
|
/** Unfreeze the trust line. */
|
91
96
|
tfClearFreeze?: boolean
|
97
|
+
/** Deep-Freeze the trustline -- disallow sending and receiving the said IssuedCurrency */
|
98
|
+
/** Allowed only if the trustline is already regularly frozen, or if tfSetFreeze is set in the same transaction. */
|
99
|
+
tfSetDeepFreeze?: boolean
|
100
|
+
/** Clear a Deep-Frozen trust line */
|
101
|
+
tfClearDeepFreeze?: boolean
|
92
102
|
}
|
93
103
|
|
94
104
|
/**
|