@moveindustries/ts-sdk 5.1.4
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/LICENSE +201 -0
- package/README.md +66 -0
- package/dist/common/accountAddress-DoqkxUqw.d.ts +7769 -0
- package/dist/common/chunk-56DGDNEY.js +4 -0
- package/dist/common/chunk-56DGDNEY.js.map +1 -0
- package/dist/common/cli/index.d.ts +316 -0
- package/dist/common/cli/index.js +2 -0
- package/dist/common/cli/index.js.map +1 -0
- package/dist/common/index.d.ts +10643 -0
- package/dist/common/index.js +482 -0
- package/dist/common/index.js.map +1 -0
- package/dist/esm/Ed25519Account-DsqenvLJ.d.mts +628 -0
- package/dist/esm/account/AbstractKeylessAccount.d.mts +336 -0
- package/dist/esm/account/AbstractKeylessAccount.mjs +2 -0
- package/dist/esm/account/AbstractKeylessAccount.mjs.map +1 -0
- package/dist/esm/account/AbstractedAccount.d.mts +64 -0
- package/dist/esm/account/AbstractedAccount.mjs +2 -0
- package/dist/esm/account/AbstractedAccount.mjs.map +1 -0
- package/dist/esm/account/Account.d.mts +8 -0
- package/dist/esm/account/Account.mjs +2 -0
- package/dist/esm/account/Account.mjs.map +1 -0
- package/dist/esm/account/AccountUtils.d.mts +38 -0
- package/dist/esm/account/AccountUtils.mjs +2 -0
- package/dist/esm/account/AccountUtils.mjs.map +1 -0
- package/dist/esm/account/DerivableAbstractedAccount.d.mts +59 -0
- package/dist/esm/account/DerivableAbstractedAccount.mjs +2 -0
- package/dist/esm/account/DerivableAbstractedAccount.mjs.map +1 -0
- package/dist/esm/account/Ed25519Account.d.mts +8 -0
- package/dist/esm/account/Ed25519Account.mjs +2 -0
- package/dist/esm/account/Ed25519Account.mjs.map +1 -0
- package/dist/esm/account/EphemeralKeyPair.d.mts +141 -0
- package/dist/esm/account/EphemeralKeyPair.mjs +2 -0
- package/dist/esm/account/EphemeralKeyPair.mjs.map +1 -0
- package/dist/esm/account/FederatedKeylessAccount.d.mts +118 -0
- package/dist/esm/account/FederatedKeylessAccount.mjs +2 -0
- package/dist/esm/account/FederatedKeylessAccount.mjs.map +1 -0
- package/dist/esm/account/KeylessAccount.d.mts +124 -0
- package/dist/esm/account/KeylessAccount.mjs +2 -0
- package/dist/esm/account/KeylessAccount.mjs.map +1 -0
- package/dist/esm/account/MultiEd25519Account.d.mts +102 -0
- package/dist/esm/account/MultiEd25519Account.mjs +2 -0
- package/dist/esm/account/MultiEd25519Account.mjs.map +1 -0
- package/dist/esm/account/MultiKeyAccount.d.mts +206 -0
- package/dist/esm/account/MultiKeyAccount.mjs +2 -0
- package/dist/esm/account/MultiKeyAccount.mjs.map +1 -0
- package/dist/esm/account/SingleKeyAccount.d.mts +8 -0
- package/dist/esm/account/SingleKeyAccount.mjs +2 -0
- package/dist/esm/account/SingleKeyAccount.mjs.map +1 -0
- package/dist/esm/account/index.d.mts +24 -0
- package/dist/esm/account/index.mjs +2 -0
- package/dist/esm/account/index.mjs.map +1 -0
- package/dist/esm/account/utils.d.mts +14 -0
- package/dist/esm/account/utils.mjs +2 -0
- package/dist/esm/account/utils.mjs.map +1 -0
- package/dist/esm/accountAddress-CNXtapt1.d.mts +6979 -0
- package/dist/esm/api/account/abstraction.d.mts +181 -0
- package/dist/esm/api/account/abstraction.mjs +2 -0
- package/dist/esm/api/account/abstraction.mjs.map +1 -0
- package/dist/esm/api/account.d.mts +852 -0
- package/dist/esm/api/account.mjs +2 -0
- package/dist/esm/api/account.mjs.map +1 -0
- package/dist/esm/api/ans.d.mts +504 -0
- package/dist/esm/api/ans.mjs +2 -0
- package/dist/esm/api/ans.mjs.map +1 -0
- package/dist/esm/api/coin.d.mts +81 -0
- package/dist/esm/api/coin.mjs +2 -0
- package/dist/esm/api/coin.mjs.map +1 -0
- package/dist/esm/api/digitalAsset.d.mts +1030 -0
- package/dist/esm/api/digitalAsset.mjs +2 -0
- package/dist/esm/api/digitalAsset.mjs.map +1 -0
- package/dist/esm/api/faucet.d.mts +80 -0
- package/dist/esm/api/faucet.mjs +2 -0
- package/dist/esm/api/faucet.mjs.map +1 -0
- package/dist/esm/api/fungibleAsset.d.mts +288 -0
- package/dist/esm/api/fungibleAsset.mjs +2 -0
- package/dist/esm/api/fungibleAsset.mjs.map +1 -0
- package/dist/esm/api/general.d.mts +303 -0
- package/dist/esm/api/general.mjs +2 -0
- package/dist/esm/api/general.mjs.map +1 -0
- package/dist/esm/api/index.d.mts +46 -0
- package/dist/esm/api/index.mjs +2 -0
- package/dist/esm/api/index.mjs.map +1 -0
- package/dist/esm/api/keyless.d.mts +170 -0
- package/dist/esm/api/keyless.mjs +2 -0
- package/dist/esm/api/keyless.mjs.map +1 -0
- package/dist/esm/api/movement.d.mts +113 -0
- package/dist/esm/api/movement.mjs +2 -0
- package/dist/esm/api/movement.mjs.map +1 -0
- package/dist/esm/api/movementConfig.d.mts +7 -0
- package/dist/esm/api/movementConfig.mjs +2 -0
- package/dist/esm/api/movementConfig.mjs.map +1 -0
- package/dist/esm/api/object.d.mts +80 -0
- package/dist/esm/api/object.mjs +2 -0
- package/dist/esm/api/object.mjs.map +1 -0
- package/dist/esm/api/staking.d.mts +134 -0
- package/dist/esm/api/staking.mjs +2 -0
- package/dist/esm/api/staking.mjs.map +1 -0
- package/dist/esm/api/table.d.mts +169 -0
- package/dist/esm/api/table.mjs +2 -0
- package/dist/esm/api/table.mjs.map +1 -0
- package/dist/esm/api/transaction.d.mts +679 -0
- package/dist/esm/api/transaction.mjs +2 -0
- package/dist/esm/api/transaction.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission/build.d.mts +141 -0
- package/dist/esm/api/transactionSubmission/build.mjs +2 -0
- package/dist/esm/api/transactionSubmission/build.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission/helpers.d.mts +98 -0
- package/dist/esm/api/transactionSubmission/helpers.mjs +2 -0
- package/dist/esm/api/transactionSubmission/helpers.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission/management.d.mts +168 -0
- package/dist/esm/api/transactionSubmission/management.mjs +2 -0
- package/dist/esm/api/transactionSubmission/management.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission/sign.d.mts +124 -0
- package/dist/esm/api/transactionSubmission/sign.mjs +2 -0
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission/simulate.d.mts +181 -0
- package/dist/esm/api/transactionSubmission/simulate.mjs +2 -0
- package/dist/esm/api/transactionSubmission/simulate.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission/submit.d.mts +142 -0
- package/dist/esm/api/transactionSubmission/submit.mjs +2 -0
- package/dist/esm/api/transactionSubmission/submit.mjs.map +1 -0
- package/dist/esm/api/utils.d.mts +45 -0
- package/dist/esm/api/utils.mjs +2 -0
- package/dist/esm/api/utils.mjs.map +1 -0
- package/dist/esm/bcs/consts.d.mts +28 -0
- package/dist/esm/bcs/consts.mjs +2 -0
- package/dist/esm/bcs/consts.mjs.map +1 -0
- package/dist/esm/bcs/deserializer.d.mts +7 -0
- package/dist/esm/bcs/deserializer.mjs +2 -0
- package/dist/esm/bcs/deserializer.mjs.map +1 -0
- package/dist/esm/bcs/index.d.mts +8 -0
- package/dist/esm/bcs/index.mjs +2 -0
- package/dist/esm/bcs/index.mjs.map +1 -0
- package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +65 -0
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +2 -0
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs.map +1 -0
- package/dist/esm/bcs/serializable/fixedBytes.d.mts +7 -0
- package/dist/esm/bcs/serializable/fixedBytes.mjs +2 -0
- package/dist/esm/bcs/serializable/fixedBytes.mjs.map +1 -0
- package/dist/esm/bcs/serializable/movePrimitives.d.mts +7 -0
- package/dist/esm/bcs/serializable/movePrimitives.mjs +2 -0
- package/dist/esm/bcs/serializable/movePrimitives.mjs.map +1 -0
- package/dist/esm/bcs/serializable/moveStructs.d.mts +7 -0
- package/dist/esm/bcs/serializable/moveStructs.mjs +2 -0
- package/dist/esm/bcs/serializable/moveStructs.mjs.map +1 -0
- package/dist/esm/bcs/serializer.d.mts +7 -0
- package/dist/esm/bcs/serializer.mjs +2 -0
- package/dist/esm/bcs/serializer.mjs.map +1 -0
- package/dist/esm/chunk-2KDUIZKB.mjs +2 -0
- package/dist/esm/chunk-2KDUIZKB.mjs.map +1 -0
- package/dist/esm/chunk-2QTV4AOE.mjs +2 -0
- package/dist/esm/chunk-2QTV4AOE.mjs.map +1 -0
- package/dist/esm/chunk-47V7UGV5.mjs +4 -0
- package/dist/esm/chunk-47V7UGV5.mjs.map +1 -0
- package/dist/esm/chunk-4QMXOWHP.mjs +1 -0
- package/dist/esm/chunk-4QMXOWHP.mjs.map +1 -0
- package/dist/esm/chunk-4WPQQPUF.mjs +1 -0
- package/dist/esm/chunk-4WPQQPUF.mjs.map +1 -0
- package/dist/esm/chunk-5HXLZHDW.mjs +1 -0
- package/dist/esm/chunk-5HXLZHDW.mjs.map +1 -0
- package/dist/esm/chunk-5IMQPJ6J.mjs +2 -0
- package/dist/esm/chunk-5IMQPJ6J.mjs.map +1 -0
- package/dist/esm/chunk-5ZKA765G.mjs +2 -0
- package/dist/esm/chunk-5ZKA765G.mjs.map +1 -0
- package/dist/esm/chunk-6NO4QKAO.mjs +2 -0
- package/dist/esm/chunk-6NO4QKAO.mjs.map +1 -0
- package/dist/esm/chunk-7ECCT6PK.mjs +1 -0
- package/dist/esm/chunk-7ECCT6PK.mjs.map +1 -0
- package/dist/esm/chunk-7TTTMBAK.mjs +2 -0
- package/dist/esm/chunk-7TTTMBAK.mjs.map +1 -0
- package/dist/esm/chunk-A5L76YP7.mjs +2 -0
- package/dist/esm/chunk-A5L76YP7.mjs.map +1 -0
- package/dist/esm/chunk-ANTEUWH6.mjs +2 -0
- package/dist/esm/chunk-ANTEUWH6.mjs.map +1 -0
- package/dist/esm/chunk-CHWDP6AR.mjs +2 -0
- package/dist/esm/chunk-CHWDP6AR.mjs.map +1 -0
- package/dist/esm/chunk-CRCE7R4D.mjs +2 -0
- package/dist/esm/chunk-CRCE7R4D.mjs.map +1 -0
- package/dist/esm/chunk-D6HPXGEP.mjs +2 -0
- package/dist/esm/chunk-D6HPXGEP.mjs.map +1 -0
- package/dist/esm/chunk-DS6QB6HG.mjs +4 -0
- package/dist/esm/chunk-DS6QB6HG.mjs.map +1 -0
- package/dist/esm/chunk-FD6FGKYY.mjs +1 -0
- package/dist/esm/chunk-FD6FGKYY.mjs.map +1 -0
- package/dist/esm/chunk-FJRPU2NH.mjs +2 -0
- package/dist/esm/chunk-FJRPU2NH.mjs.map +1 -0
- package/dist/esm/chunk-FS5ZJKO7.mjs +2 -0
- package/dist/esm/chunk-FS5ZJKO7.mjs.map +1 -0
- package/dist/esm/chunk-FZY4PMEE.mjs +1 -0
- package/dist/esm/chunk-FZY4PMEE.mjs.map +1 -0
- package/dist/esm/chunk-G3MHXDYA.mjs +1 -0
- package/dist/esm/chunk-G3MHXDYA.mjs.map +1 -0
- package/dist/esm/chunk-GOXRBEIJ.mjs +2 -0
- package/dist/esm/chunk-GOXRBEIJ.mjs.map +1 -0
- package/dist/esm/chunk-HGLO5LDS.mjs +1 -0
- package/dist/esm/chunk-HGLO5LDS.mjs.map +1 -0
- package/dist/esm/chunk-HL2JMZ7N.mjs +2 -0
- package/dist/esm/chunk-HL2JMZ7N.mjs.map +1 -0
- package/dist/esm/chunk-I6YGBK5S.mjs +2 -0
- package/dist/esm/chunk-I6YGBK5S.mjs.map +1 -0
- package/dist/esm/chunk-K4NT6TTN.mjs +2 -0
- package/dist/esm/chunk-K4NT6TTN.mjs.map +1 -0
- package/dist/esm/chunk-KDMSOCZY.mjs +2 -0
- package/dist/esm/chunk-KDMSOCZY.mjs.map +1 -0
- package/dist/esm/chunk-KPJGWDSQ.mjs +7 -0
- package/dist/esm/chunk-KPJGWDSQ.mjs.map +1 -0
- package/dist/esm/chunk-MEWW7VTQ.mjs +2 -0
- package/dist/esm/chunk-MEWW7VTQ.mjs.map +1 -0
- package/dist/esm/chunk-NECL5FCQ.mjs +1 -0
- package/dist/esm/chunk-NECL5FCQ.mjs.map +1 -0
- package/dist/esm/chunk-NMFJJOGW.mjs +2 -0
- package/dist/esm/chunk-NMFJJOGW.mjs.map +1 -0
- package/dist/esm/chunk-NQUZ4UHR.mjs +2 -0
- package/dist/esm/chunk-NQUZ4UHR.mjs.map +1 -0
- package/dist/esm/chunk-NUB6KE73.mjs +2 -0
- package/dist/esm/chunk-NUB6KE73.mjs.map +1 -0
- package/dist/esm/chunk-OOOAVIMQ.mjs +2 -0
- package/dist/esm/chunk-OOOAVIMQ.mjs.map +1 -0
- package/dist/esm/chunk-PCESRJYO.mjs +2 -0
- package/dist/esm/chunk-PCESRJYO.mjs.map +1 -0
- package/dist/esm/chunk-PHRRBT44.mjs +2 -0
- package/dist/esm/chunk-PHRRBT44.mjs.map +1 -0
- package/dist/esm/chunk-PZ233FIY.mjs +2 -0
- package/dist/esm/chunk-PZ233FIY.mjs.map +1 -0
- package/dist/esm/chunk-R2G23RIY.mjs +2 -0
- package/dist/esm/chunk-R2G23RIY.mjs.map +1 -0
- package/dist/esm/chunk-RL4YPMN4.mjs +2 -0
- package/dist/esm/chunk-RL4YPMN4.mjs.map +1 -0
- package/dist/esm/chunk-RUIFVDWM.mjs +2 -0
- package/dist/esm/chunk-RUIFVDWM.mjs.map +1 -0
- package/dist/esm/chunk-RXHPS4IU.mjs +2 -0
- package/dist/esm/chunk-RXHPS4IU.mjs.map +1 -0
- package/dist/esm/chunk-S4D2KBYN.mjs +2 -0
- package/dist/esm/chunk-S4D2KBYN.mjs.map +1 -0
- package/dist/esm/chunk-SRXFRTHK.mjs +2 -0
- package/dist/esm/chunk-SRXFRTHK.mjs.map +1 -0
- package/dist/esm/chunk-SYXDZA4K.mjs +2 -0
- package/dist/esm/chunk-SYXDZA4K.mjs.map +1 -0
- package/dist/esm/chunk-UI4OF6CP.mjs +2 -0
- package/dist/esm/chunk-UI4OF6CP.mjs.map +1 -0
- package/dist/esm/chunk-UL777LTI.mjs +494 -0
- package/dist/esm/chunk-UL777LTI.mjs.map +1 -0
- package/dist/esm/chunk-UVP74ONT.mjs +2 -0
- package/dist/esm/chunk-UVP74ONT.mjs.map +1 -0
- package/dist/esm/chunk-UYVPNUH3.mjs +1 -0
- package/dist/esm/chunk-UYVPNUH3.mjs.map +1 -0
- package/dist/esm/chunk-V3MBJJTL.mjs +1 -0
- package/dist/esm/chunk-V3MBJJTL.mjs.map +1 -0
- package/dist/esm/chunk-V3O2SBO4.mjs +2 -0
- package/dist/esm/chunk-V3O2SBO4.mjs.map +1 -0
- package/dist/esm/chunk-VEZCMPUG.mjs +2 -0
- package/dist/esm/chunk-VEZCMPUG.mjs.map +1 -0
- package/dist/esm/chunk-VW3WBAAD.mjs +2 -0
- package/dist/esm/chunk-VW3WBAAD.mjs.map +1 -0
- package/dist/esm/chunk-WFAH73WN.mjs +2 -0
- package/dist/esm/chunk-WFAH73WN.mjs.map +1 -0
- package/dist/esm/chunk-WVDICMU4.mjs +2 -0
- package/dist/esm/chunk-WVDICMU4.mjs.map +1 -0
- package/dist/esm/chunk-XCURF77K.mjs +2 -0
- package/dist/esm/chunk-XCURF77K.mjs.map +1 -0
- package/dist/esm/chunk-Y6YW4BAZ.mjs +2 -0
- package/dist/esm/chunk-Y6YW4BAZ.mjs.map +1 -0
- package/dist/esm/chunk-YFFYA5U3.mjs +2 -0
- package/dist/esm/chunk-YFFYA5U3.mjs.map +1 -0
- package/dist/esm/chunk-YOHEYPDP.mjs +2 -0
- package/dist/esm/chunk-YOHEYPDP.mjs.map +1 -0
- package/dist/esm/chunk-ZP4DWSQA.mjs +2 -0
- package/dist/esm/chunk-ZP4DWSQA.mjs.map +1 -0
- package/dist/esm/cli/index.d.mts +10 -0
- package/dist/esm/cli/index.mjs +2 -0
- package/dist/esm/cli/index.mjs.map +1 -0
- package/dist/esm/cli/localNode.d.mts +67 -0
- package/dist/esm/cli/localNode.mjs +2 -0
- package/dist/esm/cli/localNode.mjs.map +1 -0
- package/dist/esm/cli/move.d.mts +257 -0
- package/dist/esm/cli/move.mjs +2 -0
- package/dist/esm/cli/move.mjs.map +1 -0
- package/dist/esm/client/core.d.mts +42 -0
- package/dist/esm/client/core.mjs +2 -0
- package/dist/esm/client/core.mjs.map +1 -0
- package/dist/esm/client/get.d.mts +125 -0
- package/dist/esm/client/get.mjs +2 -0
- package/dist/esm/client/get.mjs.map +1 -0
- package/dist/esm/client/index.d.mts +10 -0
- package/dist/esm/client/index.mjs +2 -0
- package/dist/esm/client/index.mjs.map +1 -0
- package/dist/esm/client/post.d.mts +158 -0
- package/dist/esm/client/post.mjs +2 -0
- package/dist/esm/client/post.mjs.map +1 -0
- package/dist/esm/core/account/index.d.mts +8 -0
- package/dist/esm/core/account/index.mjs +2 -0
- package/dist/esm/core/account/index.mjs.map +1 -0
- package/dist/esm/core/account/utils/address.d.mts +55 -0
- package/dist/esm/core/account/utils/address.mjs +2 -0
- package/dist/esm/core/account/utils/address.mjs.map +1 -0
- package/dist/esm/core/account/utils/index.d.mts +8 -0
- package/dist/esm/core/account/utils/index.mjs +2 -0
- package/dist/esm/core/account/utils/index.mjs.map +1 -0
- package/dist/esm/core/accountAddress.d.mts +7 -0
- package/dist/esm/core/accountAddress.mjs +2 -0
- package/dist/esm/core/accountAddress.mjs.map +1 -0
- package/dist/esm/core/authenticationKey.d.mts +7 -0
- package/dist/esm/core/authenticationKey.mjs +2 -0
- package/dist/esm/core/authenticationKey.mjs.map +1 -0
- package/dist/esm/core/common.d.mts +52 -0
- package/dist/esm/core/common.mjs +2 -0
- package/dist/esm/core/common.mjs.map +1 -0
- package/dist/esm/core/crypto/abstraction.d.mts +24 -0
- package/dist/esm/core/crypto/abstraction.mjs +2 -0
- package/dist/esm/core/crypto/abstraction.mjs.map +1 -0
- package/dist/esm/core/crypto/deserializationUtils.d.mts +28 -0
- package/dist/esm/core/crypto/deserializationUtils.mjs +2 -0
- package/dist/esm/core/crypto/deserializationUtils.mjs.map +1 -0
- package/dist/esm/core/crypto/ed25519.d.mts +7 -0
- package/dist/esm/core/crypto/ed25519.mjs +2 -0
- package/dist/esm/core/crypto/ed25519.mjs.map +1 -0
- package/dist/esm/core/crypto/ephemeral.d.mts +116 -0
- package/dist/esm/core/crypto/ephemeral.mjs +2 -0
- package/dist/esm/core/crypto/ephemeral.mjs.map +1 -0
- package/dist/esm/core/crypto/federatedKeyless.d.mts +13 -0
- package/dist/esm/core/crypto/federatedKeyless.mjs +2 -0
- package/dist/esm/core/crypto/federatedKeyless.mjs.map +1 -0
- package/dist/esm/core/crypto/hdKey.d.mts +95 -0
- package/dist/esm/core/crypto/hdKey.mjs +2 -0
- package/dist/esm/core/crypto/hdKey.mjs.map +1 -0
- package/dist/esm/core/crypto/index.d.mts +19 -0
- package/dist/esm/core/crypto/index.mjs +2 -0
- package/dist/esm/core/crypto/index.mjs.map +1 -0
- package/dist/esm/core/crypto/keyless.d.mts +13 -0
- package/dist/esm/core/crypto/keyless.mjs +2 -0
- package/dist/esm/core/crypto/keyless.mjs.map +1 -0
- package/dist/esm/core/crypto/multiEd25519.d.mts +7 -0
- package/dist/esm/core/crypto/multiEd25519.mjs +2 -0
- package/dist/esm/core/crypto/multiEd25519.mjs.map +1 -0
- package/dist/esm/core/crypto/multiKey.d.mts +7 -0
- package/dist/esm/core/crypto/multiKey.mjs +2 -0
- package/dist/esm/core/crypto/multiKey.mjs.map +1 -0
- package/dist/esm/core/crypto/poseidon.d.mts +59 -0
- package/dist/esm/core/crypto/poseidon.mjs +2 -0
- package/dist/esm/core/crypto/poseidon.mjs.map +1 -0
- package/dist/esm/core/crypto/privateKey.d.mts +7 -0
- package/dist/esm/core/crypto/privateKey.mjs +2 -0
- package/dist/esm/core/crypto/privateKey.mjs.map +1 -0
- package/dist/esm/core/crypto/proof.d.mts +18 -0
- package/dist/esm/core/crypto/proof.mjs +2 -0
- package/dist/esm/core/crypto/proof.mjs.map +1 -0
- package/dist/esm/core/crypto/publicKey.d.mts +7 -0
- package/dist/esm/core/crypto/publicKey.mjs +2 -0
- package/dist/esm/core/crypto/publicKey.mjs.map +1 -0
- package/dist/esm/core/crypto/secp256k1.d.mts +7 -0
- package/dist/esm/core/crypto/secp256k1.mjs +2 -0
- package/dist/esm/core/crypto/secp256k1.mjs.map +1 -0
- package/dist/esm/core/crypto/secp256r1.d.mts +306 -0
- package/dist/esm/core/crypto/secp256r1.mjs +2 -0
- package/dist/esm/core/crypto/secp256r1.mjs.map +1 -0
- package/dist/esm/core/crypto/signature.d.mts +7 -0
- package/dist/esm/core/crypto/signature.mjs +2 -0
- package/dist/esm/core/crypto/signature.mjs.map +1 -0
- package/dist/esm/core/crypto/singleKey.d.mts +7 -0
- package/dist/esm/core/crypto/singleKey.mjs +2 -0
- package/dist/esm/core/crypto/singleKey.mjs.map +1 -0
- package/dist/esm/core/crypto/types.d.mts +11 -0
- package/dist/esm/core/crypto/types.mjs +2 -0
- package/dist/esm/core/crypto/types.mjs.map +1 -0
- package/dist/esm/core/crypto/utils.d.mts +23 -0
- package/dist/esm/core/crypto/utils.mjs +2 -0
- package/dist/esm/core/crypto/utils.mjs.map +1 -0
- package/dist/esm/core/hex.d.mts +7 -0
- package/dist/esm/core/hex.mjs +2 -0
- package/dist/esm/core/hex.mjs.map +1 -0
- package/dist/esm/core/index.d.mts +20 -0
- package/dist/esm/core/index.mjs +2 -0
- package/dist/esm/core/index.mjs.map +1 -0
- package/dist/esm/errors/index.d.mts +131 -0
- package/dist/esm/errors/index.mjs +2 -0
- package/dist/esm/errors/index.mjs.map +1 -0
- package/dist/esm/federatedKeyless-D-d9d5aC.d.mts +869 -0
- package/dist/esm/index.d.mts +71 -0
- package/dist/esm/index.mjs +2 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/internal/abstraction.d.mts +27 -0
- package/dist/esm/internal/abstraction.mjs +2 -0
- package/dist/esm/internal/abstraction.mjs.map +1 -0
- package/dist/esm/internal/account.d.mts +453 -0
- package/dist/esm/internal/account.mjs +2 -0
- package/dist/esm/internal/account.mjs.map +1 -0
- package/dist/esm/internal/ans.d.mts +365 -0
- package/dist/esm/internal/ans.mjs +2 -0
- package/dist/esm/internal/ans.mjs.map +1 -0
- package/dist/esm/internal/coin.d.mts +31 -0
- package/dist/esm/internal/coin.mjs +2 -0
- package/dist/esm/internal/coin.mjs.map +1 -0
- package/dist/esm/internal/digitalAsset.d.mts +580 -0
- package/dist/esm/internal/digitalAsset.mjs +2 -0
- package/dist/esm/internal/digitalAsset.mjs.map +1 -0
- package/dist/esm/internal/faucet.d.mts +39 -0
- package/dist/esm/internal/faucet.mjs +2 -0
- package/dist/esm/internal/faucet.mjs.map +1 -0
- package/dist/esm/internal/fungibleAsset.d.mts +112 -0
- package/dist/esm/internal/fungibleAsset.mjs +2 -0
- package/dist/esm/internal/fungibleAsset.mjs.map +1 -0
- package/dist/esm/internal/general.d.mts +92 -0
- package/dist/esm/internal/general.mjs +2 -0
- package/dist/esm/internal/general.mjs.map +1 -0
- package/dist/esm/internal/keyless.d.mts +111 -0
- package/dist/esm/internal/keyless.mjs +2 -0
- package/dist/esm/internal/keyless.mjs.map +1 -0
- package/dist/esm/internal/object.d.mts +42 -0
- package/dist/esm/internal/object.mjs +2 -0
- package/dist/esm/internal/object.mjs.map +1 -0
- package/dist/esm/internal/staking.d.mts +60 -0
- package/dist/esm/internal/staking.mjs +2 -0
- package/dist/esm/internal/staking.mjs.map +1 -0
- package/dist/esm/internal/table.d.mts +66 -0
- package/dist/esm/internal/table.mjs +2 -0
- package/dist/esm/internal/table.mjs.map +1 -0
- package/dist/esm/internal/transaction.d.mts +199 -0
- package/dist/esm/internal/transaction.mjs +2 -0
- package/dist/esm/internal/transaction.mjs.map +1 -0
- package/dist/esm/internal/transactionSubmission.d.mts +165 -0
- package/dist/esm/internal/transactionSubmission.mjs +2 -0
- package/dist/esm/internal/transactionSubmission.mjs.map +1 -0
- package/dist/esm/internal/utils/index.d.mts +8 -0
- package/dist/esm/internal/utils/index.mjs +2 -0
- package/dist/esm/internal/utils/index.mjs.map +1 -0
- package/dist/esm/internal/utils/utils.d.mts +41 -0
- package/dist/esm/internal/utils/utils.mjs +2 -0
- package/dist/esm/internal/utils/utils.mjs.map +1 -0
- package/dist/esm/internal/view.d.mts +20 -0
- package/dist/esm/internal/view.mjs +2 -0
- package/dist/esm/internal/view.mjs.map +1 -0
- package/dist/esm/transactions/authenticator/account.d.mts +7 -0
- package/dist/esm/transactions/authenticator/account.mjs +2 -0
- package/dist/esm/transactions/authenticator/account.mjs.map +1 -0
- package/dist/esm/transactions/authenticator/index.d.mts +8 -0
- package/dist/esm/transactions/authenticator/index.mjs +2 -0
- package/dist/esm/transactions/authenticator/index.mjs.map +1 -0
- package/dist/esm/transactions/authenticator/transaction.d.mts +152 -0
- package/dist/esm/transactions/authenticator/transaction.mjs +2 -0
- package/dist/esm/transactions/authenticator/transaction.mjs.map +1 -0
- package/dist/esm/transactions/index.d.mts +15 -0
- package/dist/esm/transactions/index.mjs +2 -0
- package/dist/esm/transactions/index.mjs.map +1 -0
- package/dist/esm/transactions/instances/chainId.d.mts +7 -0
- package/dist/esm/transactions/instances/chainId.mjs +2 -0
- package/dist/esm/transactions/instances/chainId.mjs.map +1 -0
- package/dist/esm/transactions/instances/identifier.d.mts +7 -0
- package/dist/esm/transactions/instances/identifier.mjs +2 -0
- package/dist/esm/transactions/instances/identifier.mjs.map +1 -0
- package/dist/esm/transactions/instances/index.d.mts +10 -0
- package/dist/esm/transactions/instances/index.mjs +2 -0
- package/dist/esm/transactions/instances/index.mjs.map +1 -0
- package/dist/esm/transactions/instances/moduleId.d.mts +7 -0
- package/dist/esm/transactions/instances/moduleId.mjs +2 -0
- package/dist/esm/transactions/instances/moduleId.mjs.map +1 -0
- package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +7 -0
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +2 -0
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs.map +1 -0
- package/dist/esm/transactions/instances/rawTransaction.d.mts +7 -0
- package/dist/esm/transactions/instances/rawTransaction.mjs +2 -0
- package/dist/esm/transactions/instances/rawTransaction.mjs.map +1 -0
- package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +58 -0
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +2 -0
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs.map +1 -0
- package/dist/esm/transactions/instances/signedTransaction.d.mts +59 -0
- package/dist/esm/transactions/instances/signedTransaction.mjs +2 -0
- package/dist/esm/transactions/instances/signedTransaction.mjs.map +1 -0
- package/dist/esm/transactions/instances/simpleTransaction.d.mts +7 -0
- package/dist/esm/transactions/instances/simpleTransaction.mjs +2 -0
- package/dist/esm/transactions/instances/simpleTransaction.mjs.map +1 -0
- package/dist/esm/transactions/instances/transactionArgument.d.mts +7 -0
- package/dist/esm/transactions/instances/transactionArgument.mjs +2 -0
- package/dist/esm/transactions/instances/transactionArgument.mjs.map +1 -0
- package/dist/esm/transactions/instances/transactionPayload.d.mts +7 -0
- package/dist/esm/transactions/instances/transactionPayload.mjs +2 -0
- package/dist/esm/transactions/instances/transactionPayload.mjs.map +1 -0
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +123 -0
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +2 -0
- package/dist/esm/transactions/management/accountSequenceNumber.mjs.map +1 -0
- package/dist/esm/transactions/management/asyncQueue.d.mts +77 -0
- package/dist/esm/transactions/management/asyncQueue.mjs +2 -0
- package/dist/esm/transactions/management/asyncQueue.mjs.map +1 -0
- package/dist/esm/transactions/management/index.d.mts +12 -0
- package/dist/esm/transactions/management/index.mjs +2 -0
- package/dist/esm/transactions/management/index.mjs.map +1 -0
- package/dist/esm/transactions/management/transactionWorker.d.mts +210 -0
- package/dist/esm/transactions/management/transactionWorker.mjs +2 -0
- package/dist/esm/transactions/management/transactionWorker.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +159 -0
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +2 -0
- package/dist/esm/transactions/transactionBuilder/helpers.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/index.d.mts +11 -0
- package/dist/esm/transactions/transactionBuilder/index.mjs +2 -0
- package/dist/esm/transactions/transactionBuilder/index.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +104 -0
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +2 -0
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +62 -0
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +2 -0
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +192 -0
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +2 -0
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs.map +1 -0
- package/dist/esm/transactions/typeTag/index.d.mts +7 -0
- package/dist/esm/transactions/typeTag/index.mjs +2 -0
- package/dist/esm/transactions/typeTag/index.mjs.map +1 -0
- package/dist/esm/transactions/typeTag/parser.d.mts +81 -0
- package/dist/esm/transactions/typeTag/parser.mjs +2 -0
- package/dist/esm/transactions/typeTag/parser.mjs.map +1 -0
- package/dist/esm/transactions/types.d.mts +7 -0
- package/dist/esm/transactions/types.mjs +2 -0
- package/dist/esm/transactions/types.mjs.map +1 -0
- package/dist/esm/types/abstraction.d.mts +15 -0
- package/dist/esm/types/abstraction.mjs +2 -0
- package/dist/esm/types/abstraction.mjs.map +1 -0
- package/dist/esm/types/generated/operations.d.mts +709 -0
- package/dist/esm/types/generated/operations.mjs +1 -0
- package/dist/esm/types/generated/operations.mjs.map +1 -0
- package/dist/esm/types/generated/queries.d.mts +66 -0
- package/dist/esm/types/generated/queries.mjs +2 -0
- package/dist/esm/types/generated/queries.mjs.map +1 -0
- package/dist/esm/types/generated/types.d.mts +9495 -0
- package/dist/esm/types/generated/types.mjs +2 -0
- package/dist/esm/types/generated/types.mjs.map +1 -0
- package/dist/esm/types/index.d.mts +7 -0
- package/dist/esm/types/index.mjs +2 -0
- package/dist/esm/types/index.mjs.map +1 -0
- package/dist/esm/types/indexer.d.mts +186 -0
- package/dist/esm/types/indexer.mjs +2 -0
- package/dist/esm/types/indexer.mjs.map +1 -0
- package/dist/esm/types/keyless.d.mts +102 -0
- package/dist/esm/types/keyless.mjs +1 -0
- package/dist/esm/types/keyless.mjs.map +1 -0
- package/dist/esm/types/types.d.mts +7 -0
- package/dist/esm/types/types.mjs +2 -0
- package/dist/esm/types/types.mjs.map +1 -0
- package/dist/esm/utils/apiEndpoints.d.mts +51 -0
- package/dist/esm/utils/apiEndpoints.mjs +2 -0
- package/dist/esm/utils/apiEndpoints.mjs.map +1 -0
- package/dist/esm/utils/const.d.mts +90 -0
- package/dist/esm/utils/const.mjs +2 -0
- package/dist/esm/utils/const.mjs.map +1 -0
- package/dist/esm/utils/helpers.d.mts +174 -0
- package/dist/esm/utils/helpers.mjs +2 -0
- package/dist/esm/utils/helpers.mjs.map +1 -0
- package/dist/esm/utils/index.d.mts +9 -0
- package/dist/esm/utils/index.mjs +2 -0
- package/dist/esm/utils/index.mjs.map +1 -0
- package/dist/esm/utils/memoize.d.mts +26 -0
- package/dist/esm/utils/memoize.mjs +2 -0
- package/dist/esm/utils/memoize.mjs.map +1 -0
- package/dist/esm/utils/normalizeBundle.d.mts +35 -0
- package/dist/esm/utils/normalizeBundle.mjs +2 -0
- package/dist/esm/utils/normalizeBundle.mjs.map +1 -0
- package/dist/esm/version.d.mts +8 -0
- package/dist/esm/version.mjs +2 -0
- package/dist/esm/version.mjs.map +1 -0
- package/package.json +98 -0
- package/src/account/AbstractKeylessAccount.ts +579 -0
- package/src/account/AbstractedAccount.ts +124 -0
- package/src/account/Account.ts +354 -0
- package/src/account/AccountUtils.ts +216 -0
- package/src/account/DerivableAbstractedAccount.ts +103 -0
- package/src/account/Ed25519Account.ts +210 -0
- package/src/account/EphemeralKeyPair.ts +222 -0
- package/src/account/FederatedKeylessAccount.ts +178 -0
- package/src/account/KeylessAccount.ts +179 -0
- package/src/account/MultiEd25519Account.ts +181 -0
- package/src/account/MultiKeyAccount.ts +296 -0
- package/src/account/SingleKeyAccount.ts +277 -0
- package/src/account/index.ts +12 -0
- package/src/account/utils.ts +16 -0
- package/src/api/account/abstraction.ts +239 -0
- package/src/api/account.ts +1128 -0
- package/src/api/ans.ts +550 -0
- package/src/api/coin.ts +83 -0
- package/src/api/digitalAsset.ts +1203 -0
- package/src/api/faucet.ts +94 -0
- package/src/api/fungibleAsset.ts +371 -0
- package/src/api/general.ts +351 -0
- package/src/api/index.ts +6 -0
- package/src/api/keyless.ts +227 -0
- package/src/api/movement.ts +171 -0
- package/src/api/movementConfig.ts +334 -0
- package/src/api/object.ts +90 -0
- package/src/api/staking.ts +161 -0
- package/src/api/table.ts +193 -0
- package/src/api/transaction.ts +784 -0
- package/src/api/transactionSubmission/build.ts +153 -0
- package/src/api/transactionSubmission/helpers.ts +112 -0
- package/src/api/transactionSubmission/management.ts +211 -0
- package/src/api/transactionSubmission/sign.ts +142 -0
- package/src/api/transactionSubmission/simulate.ts +192 -0
- package/src/api/transactionSubmission/submit.ts +156 -0
- package/src/api/utils.ts +48 -0
- package/src/bcs/consts.ts +28 -0
- package/src/bcs/deserializer.ts +550 -0
- package/src/bcs/index.ts +10 -0
- package/src/bcs/serializable/entryFunctionBytes.ts +92 -0
- package/src/bcs/serializable/fixedBytes.ts +107 -0
- package/src/bcs/serializable/movePrimitives.ts +564 -0
- package/src/bcs/serializable/moveStructs.ts +619 -0
- package/src/bcs/serializer.ts +641 -0
- package/src/cli/index.ts +2 -0
- package/src/cli/localNode.ts +169 -0
- package/src/cli/move.ts +474 -0
- package/src/client/core.ts +120 -0
- package/src/client/get.ts +262 -0
- package/src/client/index.ts +7 -0
- package/src/client/post.ts +245 -0
- package/src/core/account/index.ts +1 -0
- package/src/core/account/utils/address.ts +85 -0
- package/src/core/account/utils/index.ts +1 -0
- package/src/core/accountAddress.ts +524 -0
- package/src/core/authenticationKey.ts +157 -0
- package/src/core/common.ts +60 -0
- package/src/core/crypto/abstraction.ts +52 -0
- package/src/core/crypto/deserializationUtils.ts +106 -0
- package/src/core/crypto/ed25519.ts +493 -0
- package/src/core/crypto/ephemeral.ts +185 -0
- package/src/core/crypto/federatedKeyless.ts +169 -0
- package/src/core/crypto/hdKey.ts +136 -0
- package/src/core/crypto/index.ts +21 -0
- package/src/core/crypto/keyless.ts +1700 -0
- package/src/core/crypto/multiEd25519.ts +434 -0
- package/src/core/crypto/multiKey.ts +498 -0
- package/src/core/crypto/poseidon.ts +231 -0
- package/src/core/crypto/privateKey.ts +115 -0
- package/src/core/crypto/proof.ts +9 -0
- package/src/core/crypto/publicKey.ts +106 -0
- package/src/core/crypto/secp256k1.ts +451 -0
- package/src/core/crypto/secp256r1.ts +495 -0
- package/src/core/crypto/signature.ts +57 -0
- package/src/core/crypto/singleKey.ts +351 -0
- package/src/core/crypto/types.ts +9 -0
- package/src/core/crypto/utils.ts +63 -0
- package/src/core/hex.ts +241 -0
- package/src/core/index.ts +10 -0
- package/src/errors/index.ts +457 -0
- package/src/index.ts +14 -0
- package/src/internal/abstraction.ts +79 -0
- package/src/internal/account.ts +1484 -0
- package/src/internal/ans.ts +853 -0
- package/src/internal/coin.ts +49 -0
- package/src/internal/digitalAsset.ts +1291 -0
- package/src/internal/faucet.ts +71 -0
- package/src/internal/fungibleAsset.ts +233 -0
- package/src/internal/general.ts +161 -0
- package/src/internal/keyless.ts +297 -0
- package/src/internal/object.ts +68 -0
- package/src/internal/queries/TokenActivitiesFieldsFragment.graphql +17 -0
- package/src/internal/queries/ansTokenFragment.graphql +11 -0
- package/src/internal/queries/currentTokenOwnershipFieldsFragment.graphql +46 -0
- package/src/internal/queries/getAccountAddressesForAuthKey.graphql +8 -0
- package/src/internal/queries/getAccountCoinCount.graphql +7 -0
- package/src/internal/queries/getAccountCoinsData.graphql +32 -0
- package/src/internal/queries/getAccountCollectionsWithOwnedTokens.graphql +33 -0
- package/src/internal/queries/getAccountOwnedTokens.graphql +11 -0
- package/src/internal/queries/getAccountOwnedTokensByTokenData.graphql +11 -0
- package/src/internal/queries/getAccountOwnedTokensFromCollectionAddress.graphql +11 -0
- package/src/internal/queries/getAccountTokensCount.graphql +7 -0
- package/src/internal/queries/getAccountTransactionsCount.graphql +7 -0
- package/src/internal/queries/getAuthKeysForPublicKey.graphql +11 -0
- package/src/internal/queries/getChainTopUserTransactions.graphql +5 -0
- package/src/internal/queries/getCollectionData.graphql +29 -0
- package/src/internal/queries/getCurrentFungibleAssetBalances.graphql +17 -0
- package/src/internal/queries/getDelegatedStakingActivities.graphql +12 -0
- package/src/internal/queries/getEvents.graphql +13 -0
- package/src/internal/queries/getFungibleAssetActivities.graphql +20 -0
- package/src/internal/queries/getFungibleAssetMetadata.graphql +18 -0
- package/src/internal/queries/getNames.graphql +11 -0
- package/src/internal/queries/getNumberOfDelegatorsQuery.graphql +9 -0
- package/src/internal/queries/getObjectData.graphql +16 -0
- package/src/internal/queries/getProcessorStatus.graphql +7 -0
- package/src/internal/queries/getTableItemsData.graphql +15 -0
- package/src/internal/queries/getTableItemsMetadata.graphql +12 -0
- package/src/internal/queries/getTokenActivity.graphql +11 -0
- package/src/internal/queries/getTokenCurrentOwner.graphql +11 -0
- package/src/internal/queries/getTokenData.graphql +39 -0
- package/src/internal/staking.ts +96 -0
- package/src/internal/table.ts +117 -0
- package/src/internal/transaction.ts +503 -0
- package/src/internal/transactionSubmission.ts +454 -0
- package/src/internal/utils/index.ts +4 -0
- package/src/internal/utils/utils.ts +86 -0
- package/src/internal/view.ts +61 -0
- package/src/transactions/authenticator/account.ts +405 -0
- package/src/transactions/authenticator/index.ts +6 -0
- package/src/transactions/authenticator/transaction.ts +288 -0
- package/src/transactions/index.ts +10 -0
- package/src/transactions/instances/chainId.ts +53 -0
- package/src/transactions/instances/identifier.ts +54 -0
- package/src/transactions/instances/index.ts +14 -0
- package/src/transactions/instances/moduleId.ts +77 -0
- package/src/transactions/instances/multiAgentTransaction.ts +92 -0
- package/src/transactions/instances/rawTransaction.ts +256 -0
- package/src/transactions/instances/rotationProofChallenge.ts +86 -0
- package/src/transactions/instances/signedTransaction.ts +73 -0
- package/src/transactions/instances/simpleTransaction.ts +83 -0
- package/src/transactions/instances/transactionArgument.ts +79 -0
- package/src/transactions/instances/transactionPayload.ts +676 -0
- package/src/transactions/management/accountSequenceNumber.ts +226 -0
- package/src/transactions/management/asyncQueue.ts +126 -0
- package/src/transactions/management/index.ts +2 -0
- package/src/transactions/management/transactionWorker.ts +396 -0
- package/src/transactions/transactionBuilder/helpers.ts +319 -0
- package/src/transactions/transactionBuilder/index.ts +8 -0
- package/src/transactions/transactionBuilder/remoteAbi.ts +655 -0
- package/src/transactions/transactionBuilder/signingMessage.ts +111 -0
- package/src/transactions/transactionBuilder/transactionBuilder.ts +863 -0
- package/src/transactions/typeTag/index.ts +926 -0
- package/src/transactions/typeTag/parser.ts +434 -0
- package/src/transactions/types.ts +518 -0
- package/src/types/abstraction.ts +14 -0
- package/src/types/codegen.yaml +33 -0
- package/src/types/generated/operations.ts +738 -0
- package/src/types/generated/queries.ts +926 -0
- package/src/types/generated/types.ts +10421 -0
- package/src/types/index.ts +2 -0
- package/src/types/indexer.ts +240 -0
- package/src/types/keyless.ts +94 -0
- package/src/types/types.ts +1713 -0
- package/src/utils/apiEndpoints.ts +107 -0
- package/src/utils/const.ts +100 -0
- package/src/utils/helpers.ts +287 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/memoize.ts +76 -0
- package/src/utils/normalizeBundle.ts +34 -0
- package/src/version.ts +9 -0
|
@@ -0,0 +1,784 @@
|
|
|
1
|
+
// Copyright © Move Industries
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { Account, Ed25519Account, MultiEd25519Account } from "../account";
|
|
5
|
+
import { AccountAddressInput, AccountPublicKey, Ed25519PrivateKey } from "../core";
|
|
6
|
+
import { rotateAuthKey, rotateAuthKeyUnverified } from "../internal/account";
|
|
7
|
+
import {
|
|
8
|
+
getGasPriceEstimation,
|
|
9
|
+
getTransactionByHash,
|
|
10
|
+
getTransactionByVersion,
|
|
11
|
+
getTransactions,
|
|
12
|
+
isTransactionPending,
|
|
13
|
+
waitForTransaction,
|
|
14
|
+
} from "../internal/transaction";
|
|
15
|
+
import {
|
|
16
|
+
FeePayerOrFeePayerAuthenticatorOrNeither,
|
|
17
|
+
getSigningMessage,
|
|
18
|
+
publicPackageTransaction,
|
|
19
|
+
signAndSubmitAsFeePayer,
|
|
20
|
+
signAndSubmitTransaction,
|
|
21
|
+
signAsFeePayer,
|
|
22
|
+
signTransaction,
|
|
23
|
+
} from "../internal/transactionSubmission";
|
|
24
|
+
import {
|
|
25
|
+
AccountAuthenticator,
|
|
26
|
+
AnyRawTransaction,
|
|
27
|
+
InputGenerateTransactionOptions,
|
|
28
|
+
InputGenerateTransactionPayloadData,
|
|
29
|
+
InputTransactionPluginData,
|
|
30
|
+
} from "../transactions";
|
|
31
|
+
import { SimpleTransaction } from "../transactions/instances/simpleTransaction";
|
|
32
|
+
import {
|
|
33
|
+
AnyNumber,
|
|
34
|
+
CommittedTransactionResponse,
|
|
35
|
+
GasEstimation,
|
|
36
|
+
HexInput,
|
|
37
|
+
PaginationArgs,
|
|
38
|
+
PendingTransactionResponse,
|
|
39
|
+
TransactionResponse,
|
|
40
|
+
WaitForTransactionOptions,
|
|
41
|
+
} from "../types";
|
|
42
|
+
import { MovementConfig } from "./movementConfig";
|
|
43
|
+
import { Build } from "./transactionSubmission/build";
|
|
44
|
+
import { TransactionManagement } from "./transactionSubmission/management";
|
|
45
|
+
import { Simulate } from "./transactionSubmission/simulate";
|
|
46
|
+
import { Submit } from "./transactionSubmission/submit";
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Represents a transaction in the Movement blockchain,
|
|
50
|
+
* providing methods to build, simulate, submit, and manage transactions.
|
|
51
|
+
* This class encapsulates functionalities for querying transaction details,
|
|
52
|
+
* estimating gas prices, signing transactions, and handling transaction states.
|
|
53
|
+
*
|
|
54
|
+
* This class is used as part of the Movement object, so should be called like so:
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* import { Account, Movement, MovementConfig, Network } from "@moveindustries/ts-sdk";
|
|
58
|
+
*
|
|
59
|
+
* const MOVEMENT_COIN = "0x1::aptos_coin::AptosCoin";
|
|
60
|
+
* const COIN_STORE = `0x1::coin::CoinStore<${MOVEMENT_COIN}>`;
|
|
61
|
+
* const ALICE_INITIAL_BALANCE = 100_000_000;
|
|
62
|
+
* const TRANSFER_AMOUNT = 100;
|
|
63
|
+
*
|
|
64
|
+
* async function example() {
|
|
65
|
+
* console.log(
|
|
66
|
+
* "This example will create two accounts (Alice and Bob), fund them, and transfer between them.",
|
|
67
|
+
* );
|
|
68
|
+
*
|
|
69
|
+
* // Set up the client
|
|
70
|
+
* const config = new MovementConfig({ network: Network.DEVNET });
|
|
71
|
+
* const movement = new Movement(config);
|
|
72
|
+
*
|
|
73
|
+
* // Generate two account credentials
|
|
74
|
+
* // Each account has a private key, a public key, and an address
|
|
75
|
+
* const alice = Account.generate();
|
|
76
|
+
* const bob = Account.generate();
|
|
77
|
+
*
|
|
78
|
+
* console.log("=== Addresses ===\n");
|
|
79
|
+
* console.log(`Alice's address is: ${alice.accountAddress}`);
|
|
80
|
+
* console.log(`Bob's address is: ${bob.accountAddress}`);
|
|
81
|
+
*
|
|
82
|
+
* // Fund the accounts using a faucet
|
|
83
|
+
* console.log("\n=== Funding accounts ===\n");
|
|
84
|
+
*
|
|
85
|
+
* await movement.fundAccount({
|
|
86
|
+
* accountAddress: alice.accountAddress,
|
|
87
|
+
* amount: ALICE_INITIAL_BALANCE,
|
|
88
|
+
* });
|
|
89
|
+
*
|
|
90
|
+
* // Send a transaction from Alice's account to Bob's account
|
|
91
|
+
* const txn = await movement.transaction.build.simple({
|
|
92
|
+
* sender: alice.accountAddress,
|
|
93
|
+
* data: {
|
|
94
|
+
* // All transactions on Movement are implemented via smart contracts.
|
|
95
|
+
* function: "0x1::aptos_account::transfer",
|
|
96
|
+
* functionArguments: [bob.accountAddress, 100],
|
|
97
|
+
* },
|
|
98
|
+
* });
|
|
99
|
+
*
|
|
100
|
+
* console.log("\n=== Transfer transaction ===\n");
|
|
101
|
+
* // Both signs and submits
|
|
102
|
+
* const committedTxn = await movement.signAndSubmitTransaction({
|
|
103
|
+
* signer: alice,
|
|
104
|
+
* transaction: txn,
|
|
105
|
+
* });
|
|
106
|
+
* // Waits for Movement to verify and execute the transaction
|
|
107
|
+
* const executedTransaction = await movement.waitForTransaction({
|
|
108
|
+
* transactionHash: committedTxn.hash,
|
|
109
|
+
* });
|
|
110
|
+
* console.log("Transaction hash:", executedTransaction.hash);
|
|
111
|
+
*
|
|
112
|
+
* console.log("\n=== Balances after transfer ===\n");
|
|
113
|
+
* const newAliceAccountBalance = await movement.getAccountResource({
|
|
114
|
+
* accountAddress: alice.accountAddress,
|
|
115
|
+
* resourceType: COIN_STORE,
|
|
116
|
+
* });
|
|
117
|
+
* const newAliceBalance = Number(newAliceAccountBalance.coin.value);
|
|
118
|
+
* console.log(`Alice's balance is: ${newAliceBalance}`);
|
|
119
|
+
*
|
|
120
|
+
* const newBobAccountBalance = await movement.getAccountResource({
|
|
121
|
+
* accountAddress: bob.accountAddress,
|
|
122
|
+
* resourceType: COIN_STORE,
|
|
123
|
+
* });
|
|
124
|
+
* const newBobBalance = Number(newBobAccountBalance.coin.value);
|
|
125
|
+
* console.log(`Bob's balance is: ${newBobBalance}`);
|
|
126
|
+
* }
|
|
127
|
+
*
|
|
128
|
+
* example();
|
|
129
|
+
* ```
|
|
130
|
+
* @group Transaction
|
|
131
|
+
*/
|
|
132
|
+
export class Transaction {
|
|
133
|
+
readonly config: MovementConfig;
|
|
134
|
+
|
|
135
|
+
readonly build: Build;
|
|
136
|
+
|
|
137
|
+
readonly simulate: Simulate;
|
|
138
|
+
|
|
139
|
+
readonly submit: Submit;
|
|
140
|
+
|
|
141
|
+
readonly batch: TransactionManagement;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Creates an instance of the Movement client with the specified configuration.
|
|
145
|
+
* This allows you to interact with the Movement blockchain using the provided settings.
|
|
146
|
+
*
|
|
147
|
+
* @param config - The configuration settings for the Movement client.
|
|
148
|
+
* @param config.network - The network to connect to (e.g., Testnet, Mainnet).
|
|
149
|
+
* @param config.nodeUrl - The URL of the Movement node to connect to.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* import { Movement, MovementConfig, Network } from "@moveindustries/ts-sdk";
|
|
154
|
+
*
|
|
155
|
+
* async function runExample() {
|
|
156
|
+
* // Create a new Movement client instance
|
|
157
|
+
* const config = new MovementConfig({ network: Network.TESTNET }); // Specify the network
|
|
158
|
+
* const movement = new Movement(config);
|
|
159
|
+
*
|
|
160
|
+
* console.log("Movement client created successfully:", aptos);
|
|
161
|
+
* }
|
|
162
|
+
* runExample().catch(console.error);
|
|
163
|
+
* ```
|
|
164
|
+
* @group Transaction
|
|
165
|
+
*/
|
|
166
|
+
constructor(config: MovementConfig) {
|
|
167
|
+
this.config = config;
|
|
168
|
+
this.build = new Build(this.config);
|
|
169
|
+
this.simulate = new Simulate(this.config);
|
|
170
|
+
this.submit = new Submit(this.config);
|
|
171
|
+
this.batch = new TransactionManagement(this.config);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Queries on-chain transactions, excluding pending transactions.
|
|
176
|
+
* Use this function to retrieve historical transactions from the blockchain.
|
|
177
|
+
*
|
|
178
|
+
* @param args Optional parameters for pagination.
|
|
179
|
+
* @param args.options Optional pagination options.
|
|
180
|
+
* @param args.options.offset The number of the transaction to start with.
|
|
181
|
+
* @param args.options.limit The number of results to return.
|
|
182
|
+
*
|
|
183
|
+
* @returns An array of on-chain transactions.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```typescript
|
|
187
|
+
* import { Movement, MovementConfig, Network } from "@moveindustries/ts-sdk";
|
|
188
|
+
*
|
|
189
|
+
* const config = new MovementConfig({ network: Network.TESTNET });
|
|
190
|
+
* const movement = new Movement(config);
|
|
191
|
+
*
|
|
192
|
+
* async function runExample() {
|
|
193
|
+
* // Fetch transactions with pagination
|
|
194
|
+
* const transactions = await movement.getTransactions({
|
|
195
|
+
* options: {
|
|
196
|
+
* offset: 0, // Start from the first transaction
|
|
197
|
+
* limit: 10, // Limit to 10 results
|
|
198
|
+
* },
|
|
199
|
+
* });
|
|
200
|
+
*
|
|
201
|
+
* console.log(transactions);
|
|
202
|
+
* }
|
|
203
|
+
* runExample().catch(console.error);
|
|
204
|
+
* ```
|
|
205
|
+
* @group Transaction
|
|
206
|
+
*/
|
|
207
|
+
async getTransactions(args?: { options?: PaginationArgs }): Promise<TransactionResponse[]> {
|
|
208
|
+
return getTransactions({
|
|
209
|
+
movementConfig: this.config,
|
|
210
|
+
...args,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Queries on-chain transaction by version. This function will not return pending transactions.
|
|
216
|
+
*
|
|
217
|
+
* @param args - The arguments for querying the transaction.
|
|
218
|
+
* @param args.ledgerVersion - Transaction version is an unsigned 64-bit number.
|
|
219
|
+
* @returns On-chain transaction. Only on-chain transactions have versions, so this
|
|
220
|
+
* function cannot be used to query pending transactions.
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
* ```typescript
|
|
224
|
+
* import { Movement, MovementConfig, Network } from "@moveindustries/ts-sdk";
|
|
225
|
+
*
|
|
226
|
+
* const config = new MovementConfig({ network: Network.TESTNET });
|
|
227
|
+
* const movement = new Movement(config);
|
|
228
|
+
*
|
|
229
|
+
* async function runExample() {
|
|
230
|
+
* // Fetching a transaction by its version
|
|
231
|
+
* const transaction = await movement.getTransactionByVersion({ ledgerVersion: 1 }); // replace 1 with a real version
|
|
232
|
+
* console.log(transaction);
|
|
233
|
+
* }
|
|
234
|
+
* runExample().catch(console.error);
|
|
235
|
+
* ```
|
|
236
|
+
* @group Transaction
|
|
237
|
+
*/
|
|
238
|
+
async getTransactionByVersion(args: { ledgerVersion: AnyNumber }): Promise<TransactionResponse> {
|
|
239
|
+
return getTransactionByVersion({
|
|
240
|
+
movementConfig: this.config,
|
|
241
|
+
...args,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Queries on-chain transactions by their transaction hash, returning both pending and committed transactions.
|
|
247
|
+
*
|
|
248
|
+
* @param args - The arguments for querying the transaction.
|
|
249
|
+
* @param args.transactionHash - The transaction hash should be a hex-encoded bytes string with a 0x prefix.
|
|
250
|
+
* @returns The transaction from the mempool (pending) or the on-chain (committed) transaction.
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* ```typescript
|
|
254
|
+
* import { Movement, MovementConfig, Network } from "@moveindustries/ts-sdk";
|
|
255
|
+
*
|
|
256
|
+
* const config = new MovementConfig({ network: Network.TESTNET });
|
|
257
|
+
* const movement = new Movement(config);
|
|
258
|
+
*
|
|
259
|
+
* async function runExample() {
|
|
260
|
+
* // Fetch a transaction by its hash
|
|
261
|
+
* const transaction = await movement.getTransactionByHash({ transactionHash: "0x123" }); // replace with a real transaction hash
|
|
262
|
+
*
|
|
263
|
+
* console.log(transaction);
|
|
264
|
+
* }
|
|
265
|
+
* runExample().catch(console.error);
|
|
266
|
+
* ```
|
|
267
|
+
* @group Transaction
|
|
268
|
+
*/
|
|
269
|
+
async getTransactionByHash(args: { transactionHash: HexInput }): Promise<TransactionResponse> {
|
|
270
|
+
return getTransactionByHash({
|
|
271
|
+
movementConfig: this.config,
|
|
272
|
+
...args,
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Defines if the specified transaction is currently in a pending state.
|
|
278
|
+
* This function helps you determine the status of a transaction using its hash.
|
|
279
|
+
*
|
|
280
|
+
* @param args - The arguments for the function.
|
|
281
|
+
* @param args.transactionHash - A hash of the transaction in hexadecimal format.
|
|
282
|
+
* @returns `true` if the transaction is in a pending state and `false` otherwise.
|
|
283
|
+
*
|
|
284
|
+
* @example
|
|
285
|
+
* ```typescript
|
|
286
|
+
* import { Movement, MovementConfig, Network } from "@moveindustries/ts-sdk";
|
|
287
|
+
*
|
|
288
|
+
* const config = new MovementConfig({ network: Network.TESTNET });
|
|
289
|
+
* const movement = new Movement(config);
|
|
290
|
+
*
|
|
291
|
+
* async function runExample() {
|
|
292
|
+
* // Check if the transaction is pending using its hash
|
|
293
|
+
* const isPendingTransaction = await movement.isPendingTransaction({ transactionHash: "0x123" }); // replace with a real transaction hash
|
|
294
|
+
* console.log("Is the transaction pending?", isPendingTransaction);
|
|
295
|
+
* }
|
|
296
|
+
* runExample().catch(console.error);
|
|
297
|
+
* ```
|
|
298
|
+
* @group Transaction
|
|
299
|
+
*/
|
|
300
|
+
async isPendingTransaction(args: { transactionHash: HexInput }): Promise<boolean> {
|
|
301
|
+
return isTransactionPending({
|
|
302
|
+
movementConfig: this.config,
|
|
303
|
+
...args,
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Waits for a transaction to move past the pending state and provides the transaction response.
|
|
309
|
+
* There are 4 cases.
|
|
310
|
+
* 1. Transaction is successfully processed and committed to the chain.
|
|
311
|
+
* - The function will resolve with the transaction response from the API.
|
|
312
|
+
* 2. Transaction is rejected for some reason, and is therefore not committed to the blockchain.
|
|
313
|
+
* - The function will throw an MovementApiError with an HTTP status code indicating some problem with the request.
|
|
314
|
+
* 3. Transaction is committed but execution failed, meaning no changes were
|
|
315
|
+
* written to the blockchain state.
|
|
316
|
+
* - If `checkSuccess` is true, the function will throw a FailedTransactionError
|
|
317
|
+
* If `checkSuccess` is false, the function will resolve with the transaction response where the `success` field is false.
|
|
318
|
+
* 4. Transaction does not move past the pending state within `args.options.timeoutSecs` seconds.
|
|
319
|
+
* - The function will throw a WaitForTransactionError
|
|
320
|
+
*
|
|
321
|
+
* @param args.transactionHash - The hash of a transaction previously submitted to the blockchain.
|
|
322
|
+
* @param args.options - Optional parameters for waiting behavior.
|
|
323
|
+
* @param args.options.timeoutSecs - Timeout in seconds. Defaults to 20 seconds.
|
|
324
|
+
* @param args.options.checkSuccess - A boolean which controls whether the function will error if the transaction failed.
|
|
325
|
+
* Defaults to true.
|
|
326
|
+
* @returns The transaction on-chain response.
|
|
327
|
+
*
|
|
328
|
+
* @example
|
|
329
|
+
* ```typescript
|
|
330
|
+
* import { Movement, MovementConfig, Network } from "@moveindustries/ts-sdk";
|
|
331
|
+
*
|
|
332
|
+
* const config = new MovementConfig({ network: Network.TESTNET });
|
|
333
|
+
* const movement = new Movement(config);
|
|
334
|
+
*
|
|
335
|
+
* async function runExample() {
|
|
336
|
+
* // Wait for a transaction to complete using its hash
|
|
337
|
+
* const transactionHash = "0x123"; // replace with a real transaction hash
|
|
338
|
+
* const transactionResponse = await movement.waitForTransaction({
|
|
339
|
+
* transactionHash,
|
|
340
|
+
* options: {
|
|
341
|
+
* timeoutSecs: 30, // specify your own timeout if needed
|
|
342
|
+
* checkSuccess: true,
|
|
343
|
+
* },
|
|
344
|
+
* });
|
|
345
|
+
*
|
|
346
|
+
* console.log(transactionResponse);
|
|
347
|
+
* }
|
|
348
|
+
* runExample().catch(console.error);
|
|
349
|
+
* ```
|
|
350
|
+
* @group Transaction
|
|
351
|
+
*/
|
|
352
|
+
async waitForTransaction(args: {
|
|
353
|
+
transactionHash: HexInput;
|
|
354
|
+
options?: WaitForTransactionOptions;
|
|
355
|
+
}): Promise<CommittedTransactionResponse> {
|
|
356
|
+
return waitForTransaction({
|
|
357
|
+
movementConfig: this.config,
|
|
358
|
+
...args,
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Estimates the gas unit price required to process a transaction on the Movement blockchain in a timely manner.
|
|
364
|
+
* This helps users to understand the cost associated with their transactions.
|
|
365
|
+
* {@link https://mainnet.movementnetwork.xyz/v1/spec#/operations/estimate_gas_price}
|
|
366
|
+
*
|
|
367
|
+
* @returns An object containing the estimated gas price.
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* ```typescript
|
|
371
|
+
* import { Movement, MovementConfig, Network } from "@moveindustries/ts-sdk";
|
|
372
|
+
*
|
|
373
|
+
* const config = new MovementConfig({ network: Network.TESTNET }); // Specify your network
|
|
374
|
+
* const movement = new Movement(config);
|
|
375
|
+
*
|
|
376
|
+
* async function runExample() {
|
|
377
|
+
* // Getting the gas price estimation
|
|
378
|
+
* const gasPriceEstimation = await movement.getGasPriceEstimation();
|
|
379
|
+
*
|
|
380
|
+
* console.log("Estimated Gas Price:", gasPriceEstimation);
|
|
381
|
+
* }
|
|
382
|
+
* runExample().catch(console.error);
|
|
383
|
+
* ```
|
|
384
|
+
* @group Transaction
|
|
385
|
+
*/
|
|
386
|
+
async getGasPriceEstimation(): Promise<GasEstimation> {
|
|
387
|
+
return getGasPriceEstimation({
|
|
388
|
+
movementConfig: this.config,
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Returns a signing message for a transaction, allowing a user to sign it using their preferred method before submission to the network.
|
|
394
|
+
*
|
|
395
|
+
* @param args - The arguments for obtaining the signing message.
|
|
396
|
+
* @param args.transaction - A raw transaction for signing elsewhere.
|
|
397
|
+
*
|
|
398
|
+
* @example
|
|
399
|
+
* ```typescript
|
|
400
|
+
* import { Movement, MovementConfig, Network } from "@moveindustries/ts-sdk";
|
|
401
|
+
*
|
|
402
|
+
* const config = new MovementConfig({ network: Network.TESTNET });
|
|
403
|
+
* const movement = new Movement(config);
|
|
404
|
+
*
|
|
405
|
+
* async function runExample() {
|
|
406
|
+
* const transaction = await movement.transaction.build.simple({
|
|
407
|
+
* sender: "0x1", // replace with a real sender address
|
|
408
|
+
* data: {
|
|
409
|
+
* function: "0x1::aptos_account::transfer",
|
|
410
|
+
* functionArguments: ["0x2", 100], // replace with a real destination address
|
|
411
|
+
* },
|
|
412
|
+
* });
|
|
413
|
+
*
|
|
414
|
+
* const message = await movement.getSigningMessage({ transaction });
|
|
415
|
+
* console.log(message);
|
|
416
|
+
* }
|
|
417
|
+
* runExample().catch(console.error);
|
|
418
|
+
* ```
|
|
419
|
+
* @group Transaction
|
|
420
|
+
*/
|
|
421
|
+
// eslint-disable-next-line class-methods-use-this
|
|
422
|
+
getSigningMessage(args: { transaction: AnyRawTransaction }): Uint8Array {
|
|
423
|
+
return getSigningMessage(args);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Generates a transaction to publish a Move package to the blockchain.
|
|
428
|
+
* This function helps you create a transaction that can be simulated or submitted to the chain for publishing a package.
|
|
429
|
+
*
|
|
430
|
+
* To get the `metadataBytes` and `byteCode`, can compile using Movement CLI with command
|
|
431
|
+
* `aptos move compile --save-metadata ...`,
|
|
432
|
+
*
|
|
433
|
+
* {@link https://movement.dev/tutorials/your-first-dapp/#step-4-publish-a-move-module}
|
|
434
|
+
*
|
|
435
|
+
* @param args The arguments for publishing the package.
|
|
436
|
+
* @param args.account The publisher account.
|
|
437
|
+
* @param args.metadataBytes The package metadata bytes.
|
|
438
|
+
* @param args.moduleBytecode An array of the bytecode of each module in the package in compiler output order.
|
|
439
|
+
* @param args.options Optional settings for generating the transaction.
|
|
440
|
+
*
|
|
441
|
+
* @returns A SimpleTransaction that can be simulated or submitted to the chain.
|
|
442
|
+
*
|
|
443
|
+
* @example
|
|
444
|
+
* ```typescript
|
|
445
|
+
* import { Movement, MovementConfig, Network } from "@moveindustries/ts-sdk";
|
|
446
|
+
*
|
|
447
|
+
* const config = new MovementConfig({ network: Network.TESTNET });
|
|
448
|
+
* const movement = new Movement(config);
|
|
449
|
+
*
|
|
450
|
+
* async function runExample() {
|
|
451
|
+
* // Replace with a real account address
|
|
452
|
+
* const account = "0x1";
|
|
453
|
+
* const metadataBytes = "0x..."; // replace with real metadata bytes
|
|
454
|
+
* const byteCode = "0x..."; // replace with real module bytecode
|
|
455
|
+
*
|
|
456
|
+
* const transaction = await movement.publishPackageTransaction({
|
|
457
|
+
* account,
|
|
458
|
+
* metadataBytes,
|
|
459
|
+
* moduleBytecode: [byteCode],
|
|
460
|
+
* });
|
|
461
|
+
*
|
|
462
|
+
* console.log(transaction);
|
|
463
|
+
* }
|
|
464
|
+
* runExample().catch(console.error);
|
|
465
|
+
* ```
|
|
466
|
+
* @group Transaction
|
|
467
|
+
*/
|
|
468
|
+
async publishPackageTransaction(args: {
|
|
469
|
+
account: AccountAddressInput;
|
|
470
|
+
metadataBytes: HexInput;
|
|
471
|
+
moduleBytecode: Array<HexInput>;
|
|
472
|
+
options?: InputGenerateTransactionOptions;
|
|
473
|
+
}): Promise<SimpleTransaction> {
|
|
474
|
+
return publicPackageTransaction({ movementConfig: this.config, ...args });
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Rotates the authentication key for a given account. Once an account is rotated, only the new private key
|
|
479
|
+
* or keyless signing scheme can be used to sign transactions for the account.
|
|
480
|
+
*
|
|
481
|
+
* @param args - The arguments for rotating the authentication key.
|
|
482
|
+
* @param args.fromAccount - The account from which the authentication key will be rotated.
|
|
483
|
+
* @param args.toAccount - (Optional) The target account to rotate to. Required if not using toNewPrivateKey.
|
|
484
|
+
* @param args.toNewPrivateKey - (Optional) The new private key to rotate to. Required if not using toAccount.
|
|
485
|
+
*
|
|
486
|
+
* @remarks
|
|
487
|
+
* This function supports three modes of rotation:
|
|
488
|
+
* 1. Using a target Account object (toAccount)
|
|
489
|
+
* 2. Using a new private key (toNewPrivateKey)
|
|
490
|
+
*
|
|
491
|
+
* For Ed25519 accounts, the function will use a challenge-based rotation that requires signatures from both the old and new keys.
|
|
492
|
+
* For multi-key accounts like MultiEd25519Account, the function will use a challenge-based rotation that requires signatures from both keys.
|
|
493
|
+
* For other account types, the function will use an unverified rotation that only requires the new public key.
|
|
494
|
+
*
|
|
495
|
+
* @returns SimpleTransaction that can be submitted to rotate the auth key
|
|
496
|
+
*
|
|
497
|
+
* @example
|
|
498
|
+
* ```typescript
|
|
499
|
+
* // Create and submit transaction to rotate the auth key
|
|
500
|
+
* const transaction = await movement.rotateAuthKey({
|
|
501
|
+
* fromAccount,
|
|
502
|
+
* toAccount: toAccount,
|
|
503
|
+
* });
|
|
504
|
+
*
|
|
505
|
+
* // Sign and submit the transaction
|
|
506
|
+
* const pendingTransaction = await movement.signAndSubmitTransaction({
|
|
507
|
+
* signer: fromAccount,
|
|
508
|
+
* transaction,
|
|
509
|
+
* });
|
|
510
|
+
* ```
|
|
511
|
+
* @group Transaction
|
|
512
|
+
*/
|
|
513
|
+
async rotateAuthKey(
|
|
514
|
+
args: {
|
|
515
|
+
fromAccount: Account;
|
|
516
|
+
options?: InputGenerateTransactionOptions;
|
|
517
|
+
} & ({ toAccount: Ed25519Account | MultiEd25519Account } | { toNewPrivateKey: Ed25519PrivateKey }),
|
|
518
|
+
): Promise<SimpleTransaction> {
|
|
519
|
+
return rotateAuthKey({ movementConfig: this.config, ...args });
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Rotates the authentication key for a given account without verifying the new key.
|
|
524
|
+
*
|
|
525
|
+
* Accounts with their auth key rotated via this function will be derivable via the `getAccountsForPublicKey` and
|
|
526
|
+
* `deriveOwnedAccountsFromSigner` functions however the public key will be unverified (no proof of ownership). Thus
|
|
527
|
+
* includeUnverified must be set to true to derive the account until the public key is verified via signing a transaction.
|
|
528
|
+
*
|
|
529
|
+
* @param args - The arguments for rotating the authentication key.
|
|
530
|
+
* @param args.fromAccount - The account from which the authentication key will be rotated.
|
|
531
|
+
* @param args.toNewPublicKey - The new public key to rotate to.
|
|
532
|
+
*
|
|
533
|
+
* @returns A simple transaction object that can be submitted to the network.
|
|
534
|
+
*
|
|
535
|
+
* @example
|
|
536
|
+
* ```typescript
|
|
537
|
+
* // Create and submit transaction to rotate the auth key
|
|
538
|
+
* const transaction = await movement.rotateAuthKeyUnverified({
|
|
539
|
+
* fromAccount,
|
|
540
|
+
* toNewPublicKey,
|
|
541
|
+
* });
|
|
542
|
+
*
|
|
543
|
+
* // Sign and submit the transaction
|
|
544
|
+
* const pendingTransaction = await movement.signAndSubmitTransaction({
|
|
545
|
+
* signer: fromAccount,
|
|
546
|
+
* transaction,
|
|
547
|
+
* });
|
|
548
|
+
* ```
|
|
549
|
+
* @group Transaction
|
|
550
|
+
*/
|
|
551
|
+
async rotateAuthKeyUnverified(args: {
|
|
552
|
+
fromAccount: Account;
|
|
553
|
+
options?: InputGenerateTransactionOptions;
|
|
554
|
+
toNewPublicKey: AccountPublicKey;
|
|
555
|
+
}): Promise<SimpleTransaction> {
|
|
556
|
+
return rotateAuthKeyUnverified({ movementConfig: this.config, ...args });
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* Sign a transaction that can later be submitted to the chain.
|
|
561
|
+
* This function is essential for ensuring the authenticity of the transaction by using the provided account's signing capabilities.
|
|
562
|
+
*
|
|
563
|
+
* @param args - The arguments for signing the transaction.
|
|
564
|
+
* @param args.signer - The account that will sign the transaction.
|
|
565
|
+
* @param args.transaction - A raw transaction to sign.
|
|
566
|
+
*
|
|
567
|
+
* @returns AccountAuthenticator - The authenticator for the signed transaction.
|
|
568
|
+
*
|
|
569
|
+
* @example
|
|
570
|
+
* ```typescript
|
|
571
|
+
* import { Movement, MovementConfig, Network } from "@moveindustries/ts-sdk";
|
|
572
|
+
*
|
|
573
|
+
* const config = new MovementConfig({ network: Network.TESTNET });
|
|
574
|
+
* const movement = new Movement(config);
|
|
575
|
+
*
|
|
576
|
+
* async function runExample() {
|
|
577
|
+
* const sender = Account.generate(); // Generate a new account for signing
|
|
578
|
+
* const transaction = await movement.transaction.build.simple({
|
|
579
|
+
* sender: sender.accountAddress,
|
|
580
|
+
* data: {
|
|
581
|
+
* function: "0x1::aptos_account::transfer",
|
|
582
|
+
* functionArguments: [ "0x1", 100 ], // replace with a real account address and amount
|
|
583
|
+
* },
|
|
584
|
+
* });
|
|
585
|
+
*
|
|
586
|
+
* const signedTransaction = await movement.transaction.sign({
|
|
587
|
+
* signer: sender,
|
|
588
|
+
* transaction,
|
|
589
|
+
* }); // Sign the transaction
|
|
590
|
+
*
|
|
591
|
+
* console.log("Signed Transaction:", signedTransaction);
|
|
592
|
+
* }
|
|
593
|
+
* runExample().catch(console.error);
|
|
594
|
+
* ```
|
|
595
|
+
* @group Transaction
|
|
596
|
+
*/
|
|
597
|
+
// eslint-disable-next-line class-methods-use-this
|
|
598
|
+
sign(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {
|
|
599
|
+
return signTransaction({
|
|
600
|
+
...args,
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Sign a transaction as a fee payer that can later be submitted to the chain.
|
|
606
|
+
* This function ensures that the transaction is marked with the fee payer's address, allowing it to be processed correctly.
|
|
607
|
+
*
|
|
608
|
+
* @param args - The arguments for signing the transaction.
|
|
609
|
+
* @param args.signer - The fee payer signer account.
|
|
610
|
+
* @param args.transaction - A raw transaction to sign on. This transaction must include a `feePayerAddress` property.
|
|
611
|
+
*
|
|
612
|
+
* @returns AccountAuthenticator - The authenticator for the signed transaction.
|
|
613
|
+
*
|
|
614
|
+
* @example
|
|
615
|
+
* ```typescript
|
|
616
|
+
* import { Movement, MovementConfig, Network } from "@moveindustries/ts-sdk";
|
|
617
|
+
*
|
|
618
|
+
* const config = new MovementConfig({ network: Network.TESTNET });
|
|
619
|
+
* const movement = new Movement(config);
|
|
620
|
+
*
|
|
621
|
+
* async function runExample() {
|
|
622
|
+
* const sender = Account.generate(); // Generate a new account for the fee payer
|
|
623
|
+
* const transaction = await movement.transaction.build.simple({
|
|
624
|
+
* // All transactions on Movement are implemented via smart contracts.
|
|
625
|
+
* function: "0x1::aptos_account::transfer",
|
|
626
|
+
* functionArguments: [sender.accountAddress, 100],
|
|
627
|
+
* feePayerAddress: sender.accountAddress, // Set the fee payer address
|
|
628
|
+
* });
|
|
629
|
+
*
|
|
630
|
+
* const signedTransaction = await movement.transaction.signAsFeePayer({
|
|
631
|
+
* signer: sender,
|
|
632
|
+
* transaction,
|
|
633
|
+
* });
|
|
634
|
+
*
|
|
635
|
+
* console.log("Signed transaction as fee payer:", signedTransaction);
|
|
636
|
+
* }
|
|
637
|
+
* runExample().catch(console.error);
|
|
638
|
+
* ```
|
|
639
|
+
* @group Transaction
|
|
640
|
+
*/
|
|
641
|
+
// eslint-disable-next-line class-methods-use-this
|
|
642
|
+
signAsFeePayer(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {
|
|
643
|
+
return signAsFeePayer({
|
|
644
|
+
...args,
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
// TRANSACTION SUBMISSION //
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* @deprecated Prefer to use `movement.transaction.batch.forSingleAccount()`
|
|
652
|
+
*
|
|
653
|
+
* Batch transactions for a single account by submitting multiple transaction payloads.
|
|
654
|
+
* This function is useful for efficiently processing and submitting transactions that do not depend on each other, such as
|
|
655
|
+
* batch funding or batch token minting.
|
|
656
|
+
*
|
|
657
|
+
* @param args - The arguments for batching transactions.
|
|
658
|
+
* @param args.sender - The sender account to sign and submit the transactions.
|
|
659
|
+
* @param args.data - An array of transaction payloads to be processed.
|
|
660
|
+
* @param args.options - Optional. Transaction generation configurations (excluding accountSequenceNumber).
|
|
661
|
+
*
|
|
662
|
+
* @throws Error if any worker failure occurs during submission.
|
|
663
|
+
*
|
|
664
|
+
* @example
|
|
665
|
+
* ```typescript
|
|
666
|
+
* import { Movement, MovementConfig, Network, Account } from "@moveindustries/ts-sdk";
|
|
667
|
+
*
|
|
668
|
+
* const config = new MovementConfig({ network: Network.TESTNET });
|
|
669
|
+
* const movement = new Movement(config);
|
|
670
|
+
* const sender = Account.generate(); // Generate a new account for sending transactions
|
|
671
|
+
*
|
|
672
|
+
* async function runExample() {
|
|
673
|
+
* const transactions = [
|
|
674
|
+
* { }, // Build your first transaction payload
|
|
675
|
+
* { }, // Build your second transaction payload
|
|
676
|
+
* ];
|
|
677
|
+
*
|
|
678
|
+
* // Batch transactions for the single account
|
|
679
|
+
* await movement.batchTransactionsForSingleAccount({
|
|
680
|
+
* sender,
|
|
681
|
+
* data: transactions,
|
|
682
|
+
* });
|
|
683
|
+
*
|
|
684
|
+
* console.log("Batch transactions submitted successfully.");
|
|
685
|
+
* }
|
|
686
|
+
* runExample().catch(console.error);
|
|
687
|
+
* ```
|
|
688
|
+
* @group Transaction
|
|
689
|
+
*/
|
|
690
|
+
async batchTransactionsForSingleAccount(args: {
|
|
691
|
+
sender: Account;
|
|
692
|
+
data: InputGenerateTransactionPayloadData[];
|
|
693
|
+
options?: Omit<InputGenerateTransactionOptions, "accountSequenceNumber">;
|
|
694
|
+
}): Promise<void> {
|
|
695
|
+
try {
|
|
696
|
+
const { sender, data, options } = args;
|
|
697
|
+
this.batch.forSingleAccount({ sender, data, options });
|
|
698
|
+
} catch (error: any) {
|
|
699
|
+
throw new Error(`failed to submit transactions with error: ${error}`);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Sign and submit a single signer transaction to the blockchain.
|
|
705
|
+
* This function allows you to execute a transaction after signing it with the specified account.
|
|
706
|
+
*
|
|
707
|
+
* @param args The arguments for signing and submitting the transaction.
|
|
708
|
+
* @param args.signer The signer account to sign the transaction.
|
|
709
|
+
* @param args.transaction An instance of a RawTransaction, plus optional secondary/fee payer addresses.
|
|
710
|
+
*
|
|
711
|
+
* @example
|
|
712
|
+
* ```typescript
|
|
713
|
+
* import { Movement, MovementConfig, Network } from "@moveindustries/ts-sdk";
|
|
714
|
+
*
|
|
715
|
+
* const config = new MovementConfig({ network: Network.TESTNET });
|
|
716
|
+
* const movement = new Movement(config);
|
|
717
|
+
*
|
|
718
|
+
* async function runExample() {
|
|
719
|
+
* const sender = Account.generate(); // Generate a new account for sending the transaction
|
|
720
|
+
* const transaction = await movement.transaction.build.simple({
|
|
721
|
+
* sender: sender.accountAddress,
|
|
722
|
+
* data: {
|
|
723
|
+
* function: "0x1::aptos_account::transfer",
|
|
724
|
+
* functionArguments: [ "0x1", 100 ], // replace with a real account address
|
|
725
|
+
* },
|
|
726
|
+
* });
|
|
727
|
+
*
|
|
728
|
+
* // Sign and submit the transaction
|
|
729
|
+
* const pendingTransaction = await movement.signAndSubmitTransaction({
|
|
730
|
+
* signer: sender,
|
|
731
|
+
* transaction,
|
|
732
|
+
* });
|
|
733
|
+
*
|
|
734
|
+
* console.log(pendingTransaction);
|
|
735
|
+
* }
|
|
736
|
+
* runExample().catch(console.error);
|
|
737
|
+
* ```
|
|
738
|
+
* @return PendingTransactionResponse
|
|
739
|
+
* @group Transaction
|
|
740
|
+
*/
|
|
741
|
+
async signAndSubmitTransaction(
|
|
742
|
+
args: FeePayerOrFeePayerAuthenticatorOrNeither & {
|
|
743
|
+
signer: Account;
|
|
744
|
+
transaction: AnyRawTransaction;
|
|
745
|
+
} & InputTransactionPluginData,
|
|
746
|
+
): Promise<PendingTransactionResponse> {
|
|
747
|
+
return signAndSubmitTransaction({
|
|
748
|
+
movementConfig: this.config,
|
|
749
|
+
...args,
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
/**
|
|
754
|
+
* Sign and submit a single signer transaction as the fee payer to chain given an authenticator by the sender of the transaction.
|
|
755
|
+
*
|
|
756
|
+
* @param args.feePayer The fee payer account to sign the transaction
|
|
757
|
+
* @param args.senderAuthenticator The AccountAuthenticator signed by the sender of the transaction
|
|
758
|
+
* @param args.transaction An instance of a RawTransaction, plus optional secondary/fee payer addresses
|
|
759
|
+
*
|
|
760
|
+
* @example
|
|
761
|
+
* const transaction = await movement.transaction.build.simple({sender: alice.accountAddress, feePayer: true ...})
|
|
762
|
+
* const senderAuthenticator = alice.signTransactionWithAuthenticator(transaction)
|
|
763
|
+
* const pendingTransaction = await movement.signAndSubmitAsFeePayer({
|
|
764
|
+
* senderAuthenticator,
|
|
765
|
+
* feePayer: bob,
|
|
766
|
+
* transaction,
|
|
767
|
+
* })
|
|
768
|
+
*
|
|
769
|
+
* @return PendingTransactionResponse
|
|
770
|
+
* @group Transaction
|
|
771
|
+
*/
|
|
772
|
+
async signAndSubmitAsFeePayer(
|
|
773
|
+
args: {
|
|
774
|
+
feePayer: Account;
|
|
775
|
+
senderAuthenticator: AccountAuthenticator;
|
|
776
|
+
transaction: AnyRawTransaction;
|
|
777
|
+
} & InputTransactionPluginData,
|
|
778
|
+
): Promise<PendingTransactionResponse> {
|
|
779
|
+
return signAndSubmitAsFeePayer({
|
|
780
|
+
movementConfig: this.config,
|
|
781
|
+
...args,
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
}
|