@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,454 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file contains the underlying implementations for exposed submission API surface in
|
|
3
|
+
* the {@link api/transaction}. By moving the methods out into a separate file,
|
|
4
|
+
* other namespaces and processes can access these methods without depending on the entire
|
|
5
|
+
* transaction namespace and without having a dependency cycle error.
|
|
6
|
+
* @group Implementation
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { AbstractKeylessAccount, Account, isKeylessSigner } from "../account";
|
|
10
|
+
import { MovementConfig } from "../api/movementConfig";
|
|
11
|
+
import { Deserializer, MoveVector } from "../bcs";
|
|
12
|
+
import { postAptosFullNode } from "../client";
|
|
13
|
+
import { AccountAddress, AccountAddressInput } from "../core/accountAddress";
|
|
14
|
+
import { FederatedKeylessPublicKey, KeylessPublicKey, KeylessSignature } from "../core/crypto";
|
|
15
|
+
import { SignedTransaction, TypeTagVector, generateSigningMessageForTransaction } from "../transactions";
|
|
16
|
+
import { AccountAuthenticator } from "../transactions/authenticator/account";
|
|
17
|
+
import { MultiAgentTransaction } from "../transactions/instances/multiAgentTransaction";
|
|
18
|
+
import { SimpleTransaction } from "../transactions/instances/simpleTransaction";
|
|
19
|
+
import {
|
|
20
|
+
buildTransaction,
|
|
21
|
+
generateSignedTransaction,
|
|
22
|
+
generateSignedTransactionForSimulation,
|
|
23
|
+
generateTransactionPayload,
|
|
24
|
+
} from "../transactions/transactionBuilder/transactionBuilder";
|
|
25
|
+
import {
|
|
26
|
+
AnyRawTransaction,
|
|
27
|
+
AnyTransactionPayloadInstance,
|
|
28
|
+
EntryFunctionABI,
|
|
29
|
+
InputGenerateMultiAgentRawTransactionData,
|
|
30
|
+
InputGenerateSingleSignerRawTransactionData,
|
|
31
|
+
InputGenerateTransactionData,
|
|
32
|
+
InputGenerateTransactionOptions,
|
|
33
|
+
InputGenerateTransactionPayloadDataWithRemoteABI,
|
|
34
|
+
InputSimulateTransactionData,
|
|
35
|
+
InputSubmitTransactionData,
|
|
36
|
+
InputTransactionPluginData,
|
|
37
|
+
} from "../transactions/types";
|
|
38
|
+
import { HexInput, MimeType, PendingTransactionResponse, UserTransactionResponse } from "../types";
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* We are defining function signatures, each with its specific input and output.
|
|
42
|
+
* These are the possible function signature for `generateTransaction` function.
|
|
43
|
+
* When we call `generateTransaction` function with the relevant type properties,
|
|
44
|
+
* Typescript can infer the return type based on the appropriate function overload.
|
|
45
|
+
* @group Implementation
|
|
46
|
+
*/
|
|
47
|
+
export async function generateTransaction(
|
|
48
|
+
args: { movementConfig: MovementConfig } & InputGenerateSingleSignerRawTransactionData,
|
|
49
|
+
): Promise<SimpleTransaction>;
|
|
50
|
+
export async function generateTransaction(
|
|
51
|
+
args: { movementConfig: MovementConfig } & InputGenerateMultiAgentRawTransactionData,
|
|
52
|
+
): Promise<MultiAgentTransaction>;
|
|
53
|
+
/**
|
|
54
|
+
* Generates any transaction by passing in the required arguments
|
|
55
|
+
*
|
|
56
|
+
* @param args.sender The transaction sender's account address as a AccountAddressInput
|
|
57
|
+
* @param args.data EntryFunctionData | ScriptData | MultiSigData
|
|
58
|
+
* @param args.feePayerAddress optional. For a fee payer (aka sponsored) transaction
|
|
59
|
+
* @param args.secondarySignerAddresses optional. For a multi-agent or fee payer (aka sponsored) transactions
|
|
60
|
+
* @param args.options optional. GenerateTransactionOptions type
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* For a single signer entry function
|
|
64
|
+
* move function name, move function type arguments, move function arguments
|
|
65
|
+
* `
|
|
66
|
+
* data: {
|
|
67
|
+
* function:"0x1::aptos_account::transfer",
|
|
68
|
+
* typeArguments:[]
|
|
69
|
+
* functionArguments :[receiverAddress,10]
|
|
70
|
+
* }
|
|
71
|
+
* `
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* For a single signer script function
|
|
75
|
+
* module bytecode, move function type arguments, move function arguments
|
|
76
|
+
* ```
|
|
77
|
+
* data: {
|
|
78
|
+
* bytecode:"0x001234567",
|
|
79
|
+
* typeArguments:[],
|
|
80
|
+
* functionArguments :[receiverAddress,10]
|
|
81
|
+
* }
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* @return An instance of a RawTransaction, plus optional secondary/fee payer addresses
|
|
85
|
+
* ```
|
|
86
|
+
* {
|
|
87
|
+
* rawTransaction: RawTransaction,
|
|
88
|
+
* secondarySignerAddresses?: Array<AccountAddress>,
|
|
89
|
+
* feePayerAddress?: AccountAddress
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
92
|
+
* @group Implementation
|
|
93
|
+
*/
|
|
94
|
+
export async function generateTransaction(
|
|
95
|
+
args: { movementConfig: MovementConfig } & InputGenerateTransactionData,
|
|
96
|
+
): Promise<AnyRawTransaction> {
|
|
97
|
+
const payload = await buildTransactionPayload(args);
|
|
98
|
+
return buildRawTransaction(args, payload);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Builds a transaction payload based on the provided configuration and input data.
|
|
103
|
+
* This function is essential for preparing transaction data for execution on the Movement blockchain.
|
|
104
|
+
*
|
|
105
|
+
* @param args - The arguments for building the transaction payload.
|
|
106
|
+
* @param args.movementConfig - Configuration settings for the Movement network.
|
|
107
|
+
* @param args.data - Input data required to generate the transaction payload, which may include bytecode, multisig address,
|
|
108
|
+
* function name, function arguments, type arguments, and ABI.
|
|
109
|
+
* @returns A promise that resolves to the generated transaction payload instance.
|
|
110
|
+
* @group Implementation
|
|
111
|
+
*/
|
|
112
|
+
export async function buildTransactionPayload(
|
|
113
|
+
args: { movementConfig: MovementConfig } & InputGenerateTransactionData,
|
|
114
|
+
): Promise<AnyTransactionPayloadInstance> {
|
|
115
|
+
const { movementConfig, data } = args;
|
|
116
|
+
// Merge in movementConfig for remote ABI on non-script payloads
|
|
117
|
+
let generateTransactionPayloadData: InputGenerateTransactionPayloadDataWithRemoteABI;
|
|
118
|
+
let payload: AnyTransactionPayloadInstance;
|
|
119
|
+
|
|
120
|
+
if ("bytecode" in data) {
|
|
121
|
+
// TODO: Add ABI checking later
|
|
122
|
+
payload = await generateTransactionPayload(data);
|
|
123
|
+
} else if ("multisigAddress" in data) {
|
|
124
|
+
generateTransactionPayloadData = {
|
|
125
|
+
movementConfig,
|
|
126
|
+
multisigAddress: data.multisigAddress,
|
|
127
|
+
function: data.function,
|
|
128
|
+
functionArguments: data.functionArguments,
|
|
129
|
+
typeArguments: data.typeArguments,
|
|
130
|
+
abi: data.abi,
|
|
131
|
+
};
|
|
132
|
+
payload = await generateTransactionPayload(generateTransactionPayloadData);
|
|
133
|
+
} else {
|
|
134
|
+
generateTransactionPayloadData = {
|
|
135
|
+
movementConfig,
|
|
136
|
+
function: data.function,
|
|
137
|
+
functionArguments: data.functionArguments,
|
|
138
|
+
typeArguments: data.typeArguments,
|
|
139
|
+
abi: data.abi,
|
|
140
|
+
};
|
|
141
|
+
payload = await generateTransactionPayload(generateTransactionPayloadData);
|
|
142
|
+
}
|
|
143
|
+
return payload;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Builds a raw transaction based on the provided configuration and payload.
|
|
148
|
+
* This function helps in creating a transaction that can be sent to the Movement blockchain.
|
|
149
|
+
*
|
|
150
|
+
* @param args - The arguments for generating the transaction.
|
|
151
|
+
* @param args.movementConfig - The configuration settings for Movement.
|
|
152
|
+
* @param args.sender - The address of the sender of the transaction.
|
|
153
|
+
* @param args.options - Additional options for the transaction.
|
|
154
|
+
* @param payload - The payload of the transaction, which defines the action to be performed.
|
|
155
|
+
* @group Implementation
|
|
156
|
+
*/
|
|
157
|
+
export async function buildRawTransaction(
|
|
158
|
+
args: { movementConfig: MovementConfig } & InputGenerateTransactionData,
|
|
159
|
+
payload: AnyTransactionPayloadInstance,
|
|
160
|
+
): Promise<AnyRawTransaction> {
|
|
161
|
+
const { movementConfig, sender, options } = args;
|
|
162
|
+
|
|
163
|
+
let feePayerAddress;
|
|
164
|
+
if (isFeePayerTransactionInput(args)) {
|
|
165
|
+
feePayerAddress = AccountAddress.ZERO.toString();
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (isMultiAgentTransactionInput(args)) {
|
|
169
|
+
const { secondarySignerAddresses } = args;
|
|
170
|
+
return buildTransaction({
|
|
171
|
+
movementConfig,
|
|
172
|
+
sender,
|
|
173
|
+
payload,
|
|
174
|
+
options,
|
|
175
|
+
secondarySignerAddresses,
|
|
176
|
+
feePayerAddress,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return buildTransaction({
|
|
181
|
+
movementConfig,
|
|
182
|
+
sender,
|
|
183
|
+
payload,
|
|
184
|
+
options,
|
|
185
|
+
feePayerAddress,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Determine if the transaction input includes a fee payer.
|
|
191
|
+
*
|
|
192
|
+
* @param data - The input data for generating a transaction.
|
|
193
|
+
* @param data.withFeePayer - Indicates whether a fee payer is included in the transaction input.
|
|
194
|
+
* @returns A boolean value indicating if the transaction input has a fee payer.
|
|
195
|
+
* @group Implementation
|
|
196
|
+
*/
|
|
197
|
+
function isFeePayerTransactionInput(data: InputGenerateTransactionData): boolean {
|
|
198
|
+
return data.withFeePayer === true;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Determines whether the provided transaction input data includes multiple agent signatures.
|
|
203
|
+
*
|
|
204
|
+
* @param data - The transaction input data to evaluate.
|
|
205
|
+
* @param data.secondarySignerAddresses - An array of secondary signer addresses, indicating multiple agents.
|
|
206
|
+
* @group Implementation
|
|
207
|
+
*/
|
|
208
|
+
function isMultiAgentTransactionInput(
|
|
209
|
+
data: InputGenerateTransactionData,
|
|
210
|
+
): data is InputGenerateMultiAgentRawTransactionData {
|
|
211
|
+
return "secondarySignerAddresses" in data;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Builds a signing message that can be signed by external signers.
|
|
216
|
+
*
|
|
217
|
+
* Note: Please prefer using `signTransaction` unless signing outside the SDK.
|
|
218
|
+
*
|
|
219
|
+
* @param args - The arguments for generating the signing message.
|
|
220
|
+
* @param args.transaction - AnyRawTransaction, as generated by `generateTransaction()`.
|
|
221
|
+
*
|
|
222
|
+
* @returns The message to be signed.
|
|
223
|
+
* @group Implementation
|
|
224
|
+
*/
|
|
225
|
+
export function getSigningMessage(args: { transaction: AnyRawTransaction }): Uint8Array {
|
|
226
|
+
const { transaction } = args;
|
|
227
|
+
return generateSigningMessageForTransaction(transaction);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Sign a transaction that can later be submitted to the chain.
|
|
232
|
+
*
|
|
233
|
+
* @param args The arguments for signing the transaction.
|
|
234
|
+
* @param args.signer The signer account to sign the transaction.
|
|
235
|
+
* @param args.transaction An instance of a RawTransaction, plus optional secondary/fee payer addresses.
|
|
236
|
+
*
|
|
237
|
+
* @return The signer AccountAuthenticator.
|
|
238
|
+
* @group Implementation
|
|
239
|
+
*/
|
|
240
|
+
export function signTransaction(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {
|
|
241
|
+
const { signer, transaction } = args;
|
|
242
|
+
return signer.signTransactionWithAuthenticator(transaction);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export function signAsFeePayer(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {
|
|
246
|
+
const { signer, transaction } = args;
|
|
247
|
+
|
|
248
|
+
// if transaction doesn't hold a "feePayerAddress" prop it means
|
|
249
|
+
// this is not a fee payer transaction
|
|
250
|
+
if (!transaction.feePayerAddress) {
|
|
251
|
+
throw new Error(`Transaction ${transaction} is not a Fee Payer transaction`);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Set the feePayerAddress to the signer account address
|
|
255
|
+
transaction.feePayerAddress = signer.accountAddress;
|
|
256
|
+
|
|
257
|
+
return signTransaction({
|
|
258
|
+
signer,
|
|
259
|
+
transaction,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Simulates a transaction before signing it to evaluate its potential outcome.
|
|
265
|
+
*
|
|
266
|
+
* @param args The arguments for simulating the transaction.
|
|
267
|
+
* @param args.movementConfig The configuration for the Movement network.
|
|
268
|
+
* @param args.transaction The raw transaction to simulate.
|
|
269
|
+
* @param args.signerPublicKey Optional. The signer public key.
|
|
270
|
+
* @param args.secondarySignersPublicKeys Optional. For when the transaction involves multiple signers.
|
|
271
|
+
* @param args.feePayerPublicKey Optional. For when the transaction is sponsored by a fee payer.
|
|
272
|
+
* @param args.options Optional. A configuration object to customize the simulation process.
|
|
273
|
+
* @param args.options.estimateGasUnitPrice Optional. Indicates whether to estimate the gas unit price.
|
|
274
|
+
* @param args.options.estimateMaxGasAmount Optional. Indicates whether to estimate the maximum gas amount.
|
|
275
|
+
* @param args.options.estimatePrioritizedGasUnitPrice Optional. Indicates whether to estimate the prioritized gas unit price.
|
|
276
|
+
* @group Implementation
|
|
277
|
+
*/
|
|
278
|
+
export async function simulateTransaction(
|
|
279
|
+
args: { movementConfig: MovementConfig } & InputSimulateTransactionData,
|
|
280
|
+
): Promise<Array<UserTransactionResponse>> {
|
|
281
|
+
const { movementConfig, transaction, signerPublicKey, secondarySignersPublicKeys, feePayerPublicKey, options } = args;
|
|
282
|
+
|
|
283
|
+
const signedTransaction = generateSignedTransactionForSimulation({
|
|
284
|
+
transaction,
|
|
285
|
+
signerPublicKey,
|
|
286
|
+
secondarySignersPublicKeys,
|
|
287
|
+
feePayerPublicKey,
|
|
288
|
+
options,
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
const { data } = await postAptosFullNode<Uint8Array, Array<UserTransactionResponse>>({
|
|
292
|
+
movementConfig,
|
|
293
|
+
body: signedTransaction,
|
|
294
|
+
path: "transactions/simulate",
|
|
295
|
+
params: {
|
|
296
|
+
estimate_gas_unit_price: args.options?.estimateGasUnitPrice ?? false,
|
|
297
|
+
estimate_max_gas_amount: args.options?.estimateMaxGasAmount ?? false,
|
|
298
|
+
estimate_prioritized_gas_unit_price: args.options?.estimatePrioritizedGasUnitPrice ?? false,
|
|
299
|
+
},
|
|
300
|
+
originMethod: "simulateTransaction",
|
|
301
|
+
contentType: MimeType.BCS_SIGNED_TRANSACTION,
|
|
302
|
+
});
|
|
303
|
+
return data;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Submit a transaction to the Movement blockchain.
|
|
308
|
+
*
|
|
309
|
+
* @param args - The arguments for submitting the transaction.
|
|
310
|
+
* @param args.movementConfig - The configuration for connecting to the Movement network.
|
|
311
|
+
* @param args.transaction - The Movement transaction data to be submitted.
|
|
312
|
+
* @param args.senderAuthenticator - The account authenticator of the transaction sender.
|
|
313
|
+
* @param args.secondarySignerAuthenticators - Optional. Authenticators for additional signers in a multi-signer transaction.
|
|
314
|
+
*
|
|
315
|
+
* @returns PendingTransactionResponse - The response containing the status of the submitted transaction.
|
|
316
|
+
* @group Implementation
|
|
317
|
+
*/
|
|
318
|
+
export async function submitTransaction(
|
|
319
|
+
args: {
|
|
320
|
+
movementConfig: MovementConfig;
|
|
321
|
+
} & InputSubmitTransactionData,
|
|
322
|
+
): Promise<PendingTransactionResponse> {
|
|
323
|
+
const { movementConfig, transactionSubmitter } = args;
|
|
324
|
+
const maybeTransactionSubmitter =
|
|
325
|
+
transactionSubmitter === undefined ? movementConfig.getTransactionSubmitter() : transactionSubmitter;
|
|
326
|
+
if (maybeTransactionSubmitter) {
|
|
327
|
+
return maybeTransactionSubmitter.submitTransaction(args);
|
|
328
|
+
}
|
|
329
|
+
const signedTransaction = generateSignedTransaction({ ...args });
|
|
330
|
+
try {
|
|
331
|
+
const { data } = await postAptosFullNode<Uint8Array, PendingTransactionResponse>({
|
|
332
|
+
movementConfig,
|
|
333
|
+
body: signedTransaction,
|
|
334
|
+
path: "transactions",
|
|
335
|
+
originMethod: "submitTransaction",
|
|
336
|
+
contentType: MimeType.BCS_SIGNED_TRANSACTION,
|
|
337
|
+
});
|
|
338
|
+
return data;
|
|
339
|
+
} catch (e) {
|
|
340
|
+
const signedTxn = SignedTransaction.deserialize(new Deserializer(signedTransaction));
|
|
341
|
+
if (
|
|
342
|
+
signedTxn.authenticator.isSingleSender() &&
|
|
343
|
+
signedTxn.authenticator.sender.isSingleKey() &&
|
|
344
|
+
(signedTxn.authenticator.sender.public_key.publicKey instanceof KeylessPublicKey ||
|
|
345
|
+
signedTxn.authenticator.sender.public_key.publicKey instanceof FederatedKeylessPublicKey)
|
|
346
|
+
) {
|
|
347
|
+
await AbstractKeylessAccount.fetchJWK({
|
|
348
|
+
movementConfig,
|
|
349
|
+
publicKey: signedTxn.authenticator.sender.public_key.publicKey,
|
|
350
|
+
kid: (signedTxn.authenticator.sender.signature.signature as KeylessSignature).getJwkKid(),
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
throw e;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export type FeePayerOrFeePayerAuthenticatorOrNeither =
|
|
358
|
+
| { feePayer: Account; feePayerAuthenticator?: never }
|
|
359
|
+
| { feePayer?: never; feePayerAuthenticator: AccountAuthenticator }
|
|
360
|
+
| { feePayer?: never; feePayerAuthenticator?: never };
|
|
361
|
+
|
|
362
|
+
export async function signAndSubmitTransaction(
|
|
363
|
+
args: FeePayerOrFeePayerAuthenticatorOrNeither & {
|
|
364
|
+
movementConfig: MovementConfig;
|
|
365
|
+
signer: Account;
|
|
366
|
+
transaction: AnyRawTransaction;
|
|
367
|
+
} & InputTransactionPluginData,
|
|
368
|
+
): Promise<PendingTransactionResponse> {
|
|
369
|
+
const { movementConfig, signer, feePayer, transaction, ...rest } = args;
|
|
370
|
+
// If the signer contains a KeylessAccount, await proof fetching in case the proof
|
|
371
|
+
// was fetched asynchronously.
|
|
372
|
+
if (isKeylessSigner(signer)) {
|
|
373
|
+
await signer.checkKeylessAccountValidity(movementConfig);
|
|
374
|
+
}
|
|
375
|
+
if (isKeylessSigner(feePayer)) {
|
|
376
|
+
await feePayer.checkKeylessAccountValidity(movementConfig);
|
|
377
|
+
}
|
|
378
|
+
const feePayerAuthenticator =
|
|
379
|
+
args.feePayerAuthenticator || (feePayer && signAsFeePayer({ signer: feePayer, transaction }));
|
|
380
|
+
|
|
381
|
+
const senderAuthenticator = signTransaction({ signer, transaction });
|
|
382
|
+
return submitTransaction({
|
|
383
|
+
movementConfig,
|
|
384
|
+
transaction,
|
|
385
|
+
senderAuthenticator,
|
|
386
|
+
feePayerAuthenticator,
|
|
387
|
+
...rest,
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export async function signAndSubmitAsFeePayer(
|
|
392
|
+
args: {
|
|
393
|
+
movementConfig: MovementConfig;
|
|
394
|
+
feePayer: Account;
|
|
395
|
+
senderAuthenticator: AccountAuthenticator;
|
|
396
|
+
transaction: AnyRawTransaction;
|
|
397
|
+
} & InputTransactionPluginData,
|
|
398
|
+
): Promise<PendingTransactionResponse> {
|
|
399
|
+
const { movementConfig, senderAuthenticator, feePayer, transaction, ...rest } = args;
|
|
400
|
+
|
|
401
|
+
if (isKeylessSigner(feePayer)) {
|
|
402
|
+
await feePayer.checkKeylessAccountValidity(movementConfig);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
const feePayerAuthenticator = signAsFeePayer({ signer: feePayer, transaction });
|
|
406
|
+
|
|
407
|
+
return submitTransaction({
|
|
408
|
+
movementConfig,
|
|
409
|
+
transaction,
|
|
410
|
+
senderAuthenticator,
|
|
411
|
+
feePayerAuthenticator,
|
|
412
|
+
...rest,
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
const packagePublishAbi: EntryFunctionABI = {
|
|
417
|
+
typeParameters: [],
|
|
418
|
+
parameters: [TypeTagVector.u8(), new TypeTagVector(TypeTagVector.u8())],
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Publishes a package transaction to the Movement blockchain.
|
|
423
|
+
* This function allows you to create and send a transaction that publishes a package with the specified metadata and bytecode.
|
|
424
|
+
*
|
|
425
|
+
* @param args - The arguments for the package transaction.
|
|
426
|
+
* @param args.movementConfig - The configuration settings for the Movement client.
|
|
427
|
+
* @param args.account - The address of the account sending the transaction.
|
|
428
|
+
* @param args.metadataBytes - The metadata associated with the package, represented as hexadecimal input.
|
|
429
|
+
* @param args.moduleBytecode - An array of module bytecode, each represented as hexadecimal input.
|
|
430
|
+
* @param args.options - Optional parameters for generating the transaction.
|
|
431
|
+
* @group Implementation
|
|
432
|
+
*/
|
|
433
|
+
export async function publicPackageTransaction(args: {
|
|
434
|
+
movementConfig: MovementConfig;
|
|
435
|
+
account: AccountAddressInput;
|
|
436
|
+
metadataBytes: HexInput;
|
|
437
|
+
moduleBytecode: Array<HexInput>;
|
|
438
|
+
options?: InputGenerateTransactionOptions;
|
|
439
|
+
}): Promise<SimpleTransaction> {
|
|
440
|
+
const { movementConfig, account, metadataBytes, moduleBytecode, options } = args;
|
|
441
|
+
|
|
442
|
+
const totalByteCode = moduleBytecode.map((bytecode) => MoveVector.U8(bytecode));
|
|
443
|
+
|
|
444
|
+
return generateTransaction({
|
|
445
|
+
movementConfig,
|
|
446
|
+
sender: AccountAddress.from(account),
|
|
447
|
+
data: {
|
|
448
|
+
function: "0x1::code::publish_package_txn",
|
|
449
|
+
functionArguments: [MoveVector.U8(metadataBytes), new MoveVector(totalByteCode)],
|
|
450
|
+
abi: packagePublishAbi,
|
|
451
|
+
},
|
|
452
|
+
options,
|
|
453
|
+
});
|
|
454
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { MovementConfig } from "../../api/movementConfig";
|
|
2
|
+
import { getAptosFullNode } from "../../client";
|
|
3
|
+
import { AccountAddress, AccountAddressInput } from "../../core/accountAddress";
|
|
4
|
+
import { AccountData, LedgerVersionArg, MoveModuleBytecode } from "../../types/types";
|
|
5
|
+
import { memoizeAsync } from "../../utils/memoize";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves account information for a specified account address.
|
|
9
|
+
*
|
|
10
|
+
* @param args - The arguments for retrieving account information.
|
|
11
|
+
* @param args.movementConfig - The configuration object for Movement.
|
|
12
|
+
* @param args.accountAddress - The address of the account to retrieve information for.
|
|
13
|
+
* @group Implementation
|
|
14
|
+
*/
|
|
15
|
+
export async function getInfo(args: {
|
|
16
|
+
movementConfig: MovementConfig;
|
|
17
|
+
accountAddress: AccountAddressInput;
|
|
18
|
+
}): Promise<AccountData> {
|
|
19
|
+
const { movementConfig, accountAddress } = args;
|
|
20
|
+
const { data } = await getAptosFullNode<{}, AccountData>({
|
|
21
|
+
movementConfig,
|
|
22
|
+
originMethod: "getInfo",
|
|
23
|
+
path: `accounts/${AccountAddress.from(accountAddress).toString()}`,
|
|
24
|
+
});
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Queries for a move module given an account address and module name.
|
|
30
|
+
* This function can help you retrieve the module's ABI and other relevant information.
|
|
31
|
+
*
|
|
32
|
+
* @param args - The arguments for retrieving the module.
|
|
33
|
+
* @param args.movementConfig - The configuration for the Movement client.
|
|
34
|
+
* @param args.accountAddress - The account address in hex-encoded 32 byte format.
|
|
35
|
+
* @param args.moduleName - The name of the module to retrieve.
|
|
36
|
+
* @param args.options - Optional parameters for the request.
|
|
37
|
+
* @param args.options.ledgerVersion - Specifies the ledger version of transactions. By default, the latest version will be used.
|
|
38
|
+
* @returns The move module.
|
|
39
|
+
* @group Implementation
|
|
40
|
+
*/
|
|
41
|
+
export async function getModule(args: {
|
|
42
|
+
movementConfig: MovementConfig;
|
|
43
|
+
accountAddress: AccountAddressInput;
|
|
44
|
+
moduleName: string;
|
|
45
|
+
options?: LedgerVersionArg;
|
|
46
|
+
}): Promise<MoveModuleBytecode> {
|
|
47
|
+
// We don't memoize the account module by ledger version, as it's not a common use case, this would be handled
|
|
48
|
+
// by the developer directly
|
|
49
|
+
if (args.options?.ledgerVersion !== undefined) {
|
|
50
|
+
return getModuleInner(args);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return memoizeAsync(
|
|
54
|
+
async () => getModuleInner(args),
|
|
55
|
+
`module-${args.accountAddress}-${args.moduleName}`,
|
|
56
|
+
1000 * 60 * 5, // 5 minutes
|
|
57
|
+
)();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Retrieves the bytecode of a specified module from a given account address.
|
|
62
|
+
*
|
|
63
|
+
* @param args - The parameters for retrieving the module bytecode.
|
|
64
|
+
* @param args.movementConfig - The configuration for connecting to the Movement network.
|
|
65
|
+
* @param args.accountAddress - The address of the account from which to retrieve the module.
|
|
66
|
+
* @param args.moduleName - The name of the module to retrieve.
|
|
67
|
+
* @param args.options - Optional parameters for specifying the ledger version.
|
|
68
|
+
* @param args.options.ledgerVersion - The specific ledger version to query.
|
|
69
|
+
* @group Implementation
|
|
70
|
+
*/
|
|
71
|
+
async function getModuleInner(args: {
|
|
72
|
+
movementConfig: MovementConfig;
|
|
73
|
+
accountAddress: AccountAddressInput;
|
|
74
|
+
moduleName: string;
|
|
75
|
+
options?: LedgerVersionArg;
|
|
76
|
+
}): Promise<MoveModuleBytecode> {
|
|
77
|
+
const { movementConfig, accountAddress, moduleName, options } = args;
|
|
78
|
+
|
|
79
|
+
const { data } = await getAptosFullNode<{}, MoveModuleBytecode>({
|
|
80
|
+
movementConfig,
|
|
81
|
+
originMethod: "getModule",
|
|
82
|
+
path: `accounts/${AccountAddress.from(accountAddress).toString()}/module/${moduleName}`,
|
|
83
|
+
params: { ledger_version: options?.ledgerVersion },
|
|
84
|
+
});
|
|
85
|
+
return data;
|
|
86
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Copyright © Move Industries
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { MovementConfig } from "../api/movementConfig";
|
|
5
|
+
import { Serializer } from "../bcs";
|
|
6
|
+
import { postAptosFullNode } from "../client";
|
|
7
|
+
import {
|
|
8
|
+
generateViewFunctionPayload,
|
|
9
|
+
InputViewFunctionData,
|
|
10
|
+
InputViewFunctionJsonData,
|
|
11
|
+
ViewFunctionJsonPayload,
|
|
12
|
+
} from "../transactions";
|
|
13
|
+
import { LedgerVersionArg, MimeType, MoveValue } from "../types";
|
|
14
|
+
|
|
15
|
+
export async function view<T extends Array<MoveValue> = Array<MoveValue>>(args: {
|
|
16
|
+
movementConfig: MovementConfig;
|
|
17
|
+
payload: InputViewFunctionData;
|
|
18
|
+
options?: LedgerVersionArg;
|
|
19
|
+
}): Promise<T> {
|
|
20
|
+
const { movementConfig, payload, options } = args;
|
|
21
|
+
const viewFunctionPayload = await generateViewFunctionPayload({
|
|
22
|
+
...payload,
|
|
23
|
+
movementConfig,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const serializer = new Serializer();
|
|
27
|
+
viewFunctionPayload.serialize(serializer);
|
|
28
|
+
const bytes = serializer.toUint8Array();
|
|
29
|
+
|
|
30
|
+
const { data } = await postAptosFullNode<Uint8Array, MoveValue[]>({
|
|
31
|
+
movementConfig,
|
|
32
|
+
path: "view",
|
|
33
|
+
originMethod: "view",
|
|
34
|
+
contentType: MimeType.BCS_VIEW_FUNCTION,
|
|
35
|
+
params: { ledger_version: options?.ledgerVersion },
|
|
36
|
+
body: bytes,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
return data as T;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export async function viewJson<T extends Array<MoveValue> = Array<MoveValue>>(args: {
|
|
43
|
+
movementConfig: MovementConfig;
|
|
44
|
+
payload: InputViewFunctionJsonData;
|
|
45
|
+
options?: LedgerVersionArg;
|
|
46
|
+
}): Promise<T> {
|
|
47
|
+
const { movementConfig, payload, options } = args;
|
|
48
|
+
const { data } = await postAptosFullNode<ViewFunctionJsonPayload, MoveValue[]>({
|
|
49
|
+
movementConfig,
|
|
50
|
+
originMethod: "viewJson",
|
|
51
|
+
path: "view",
|
|
52
|
+
params: { ledger_version: options?.ledgerVersion },
|
|
53
|
+
body: {
|
|
54
|
+
function: payload.function,
|
|
55
|
+
type_arguments: payload.typeArguments ?? [],
|
|
56
|
+
arguments: payload.functionArguments ?? [],
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
return data as T;
|
|
61
|
+
}
|