@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,926 @@
|
|
|
1
|
+
// Copyright © Move Industries
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5
|
+
/* eslint-disable class-methods-use-this */
|
|
6
|
+
/* eslint-disable max-classes-per-file */
|
|
7
|
+
import { Deserializer } from "../../bcs/deserializer";
|
|
8
|
+
import { Serializable, Serializer } from "../../bcs/serializer";
|
|
9
|
+
import { AccountAddress } from "../../core";
|
|
10
|
+
import { TypeTagVariants } from "../../types";
|
|
11
|
+
import { Identifier } from "../instances/identifier";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents a type tag in the serialization framework, serving as a base class for various specific type tags.
|
|
15
|
+
* This class provides methods for serialization and deserialization of type tags, as well as type checking methods
|
|
16
|
+
* to determine the specific type of the tag at runtime.
|
|
17
|
+
*
|
|
18
|
+
* @extends Serializable
|
|
19
|
+
* @group Implementation
|
|
20
|
+
* @category Transactions
|
|
21
|
+
*/
|
|
22
|
+
export abstract class TypeTag extends Serializable {
|
|
23
|
+
abstract serialize(serializer: Serializer): void;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Deserializes a StructTag from the provided deserializer.
|
|
27
|
+
* This function allows you to reconstruct a StructTag object from its serialized form.
|
|
28
|
+
*
|
|
29
|
+
* @param deserializer - The deserializer instance used to read the serialized data.
|
|
30
|
+
* @group Implementation
|
|
31
|
+
* @category Transactions
|
|
32
|
+
*/
|
|
33
|
+
deserialize(deserializer: Deserializer): StructTag {
|
|
34
|
+
const address = AccountAddress.deserialize(deserializer);
|
|
35
|
+
const moduleName = Identifier.deserialize(deserializer);
|
|
36
|
+
const name = Identifier.deserialize(deserializer);
|
|
37
|
+
const typeArgs = deserializer.deserializeVector(TypeTag);
|
|
38
|
+
return new StructTag(address, moduleName, name, typeArgs);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
static deserialize(deserializer: Deserializer): TypeTag {
|
|
42
|
+
const index = deserializer.deserializeUleb128AsU32();
|
|
43
|
+
switch (index) {
|
|
44
|
+
case TypeTagVariants.Bool:
|
|
45
|
+
return TypeTagBool.load(deserializer);
|
|
46
|
+
case TypeTagVariants.U8:
|
|
47
|
+
return TypeTagU8.load(deserializer);
|
|
48
|
+
case TypeTagVariants.U64:
|
|
49
|
+
return TypeTagU64.load(deserializer);
|
|
50
|
+
case TypeTagVariants.U128:
|
|
51
|
+
return TypeTagU128.load(deserializer);
|
|
52
|
+
case TypeTagVariants.Address:
|
|
53
|
+
return TypeTagAddress.load(deserializer);
|
|
54
|
+
case TypeTagVariants.Signer:
|
|
55
|
+
return TypeTagSigner.load(deserializer);
|
|
56
|
+
case TypeTagVariants.Vector:
|
|
57
|
+
return TypeTagVector.load(deserializer);
|
|
58
|
+
case TypeTagVariants.Struct:
|
|
59
|
+
return TypeTagStruct.load(deserializer);
|
|
60
|
+
case TypeTagVariants.U16:
|
|
61
|
+
return TypeTagU16.load(deserializer);
|
|
62
|
+
case TypeTagVariants.U32:
|
|
63
|
+
return TypeTagU32.load(deserializer);
|
|
64
|
+
case TypeTagVariants.U256:
|
|
65
|
+
return TypeTagU256.load(deserializer);
|
|
66
|
+
case TypeTagVariants.I8:
|
|
67
|
+
return TypeTagI8.load(deserializer);
|
|
68
|
+
case TypeTagVariants.I16:
|
|
69
|
+
return TypeTagI16.load(deserializer);
|
|
70
|
+
case TypeTagVariants.I32:
|
|
71
|
+
return TypeTagI32.load(deserializer);
|
|
72
|
+
case TypeTagVariants.I64:
|
|
73
|
+
return TypeTagI64.load(deserializer);
|
|
74
|
+
case TypeTagVariants.I128:
|
|
75
|
+
return TypeTagI128.load(deserializer);
|
|
76
|
+
case TypeTagVariants.I256:
|
|
77
|
+
return TypeTagI256.load(deserializer);
|
|
78
|
+
case TypeTagVariants.Generic:
|
|
79
|
+
// This is only used for ABI representation, and cannot actually be used as a type.
|
|
80
|
+
return TypeTagGeneric.load(deserializer);
|
|
81
|
+
default:
|
|
82
|
+
throw new Error(`Unknown variant index for TypeTag: ${index}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
abstract toString(): string;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Determines if the current instance is of type TypeTagBool.
|
|
90
|
+
*
|
|
91
|
+
* @returns {boolean} True if the instance is a TypeTagBool, otherwise false.
|
|
92
|
+
* @group Implementation
|
|
93
|
+
* @category Transactions
|
|
94
|
+
*/
|
|
95
|
+
isBool(): this is TypeTagBool {
|
|
96
|
+
return this instanceof TypeTagBool;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Determines if the current instance is of type TypeTagAddress.
|
|
101
|
+
*
|
|
102
|
+
* @returns {boolean} True if the instance is a TypeTagAddress, otherwise false.
|
|
103
|
+
* @group Implementation
|
|
104
|
+
* @category Transactions
|
|
105
|
+
*/
|
|
106
|
+
isAddress(): this is TypeTagAddress {
|
|
107
|
+
return this instanceof TypeTagAddress;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Determines if the current instance is of type TypeTagGeneric.
|
|
112
|
+
*
|
|
113
|
+
* @returns {boolean} Returns true if the instance is a TypeTagGeneric, otherwise false.
|
|
114
|
+
* @group Implementation
|
|
115
|
+
* @category Transactions
|
|
116
|
+
*/
|
|
117
|
+
isGeneric(): this is TypeTagGeneric {
|
|
118
|
+
return this instanceof TypeTagGeneric;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Determine if the current instance is a TypeTagSigner.
|
|
123
|
+
*
|
|
124
|
+
* @returns {boolean} Returns true if the instance is a TypeTagSigner, otherwise false.
|
|
125
|
+
* @group Implementation
|
|
126
|
+
* @category Transactions
|
|
127
|
+
*/
|
|
128
|
+
isSigner(): this is TypeTagSigner {
|
|
129
|
+
return this instanceof TypeTagSigner;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Checks if the current instance is a vector type.
|
|
134
|
+
* This can help determine the specific type of data structure being used.
|
|
135
|
+
*
|
|
136
|
+
* @returns {boolean} True if the instance is of type TypeTagVector, otherwise false.
|
|
137
|
+
* @group Implementation
|
|
138
|
+
* @category Transactions
|
|
139
|
+
*/
|
|
140
|
+
isVector(): this is TypeTagVector {
|
|
141
|
+
return this instanceof TypeTagVector;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Determines if the current instance is a structure type.
|
|
146
|
+
*
|
|
147
|
+
* @returns {boolean} True if the instance is of type TypeTagStruct, otherwise false.
|
|
148
|
+
* @group Implementation
|
|
149
|
+
* @category Transactions
|
|
150
|
+
*/
|
|
151
|
+
isStruct(): this is TypeTagStruct {
|
|
152
|
+
return this instanceof TypeTagStruct;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Determines if the current instance is of type `TypeTagU8`.
|
|
157
|
+
*
|
|
158
|
+
* @returns {boolean} Returns true if the instance is of type `TypeTagU8`, otherwise false.
|
|
159
|
+
* @group Implementation
|
|
160
|
+
* @category Transactions
|
|
161
|
+
*/
|
|
162
|
+
isU8(): this is TypeTagU8 {
|
|
163
|
+
return this instanceof TypeTagU8;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Checks if the current instance is of type TypeTagU16.
|
|
168
|
+
*
|
|
169
|
+
* @returns {boolean} True if the instance is TypeTagU16, otherwise false.
|
|
170
|
+
* @group Implementation
|
|
171
|
+
* @category Transactions
|
|
172
|
+
*/
|
|
173
|
+
isU16(): this is TypeTagU16 {
|
|
174
|
+
return this instanceof TypeTagU16;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Checks if the current instance is of type TypeTagU32.
|
|
179
|
+
*
|
|
180
|
+
* @returns {boolean} Returns true if the instance is TypeTagU32, otherwise false.
|
|
181
|
+
* @group Implementation
|
|
182
|
+
* @category Transactions
|
|
183
|
+
*/
|
|
184
|
+
isU32(): this is TypeTagU32 {
|
|
185
|
+
return this instanceof TypeTagU32;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Checks if the current instance is of type TypeTagU64.
|
|
190
|
+
*
|
|
191
|
+
* @returns {boolean} True if the instance is a TypeTagU64, otherwise false.
|
|
192
|
+
* @group Implementation
|
|
193
|
+
* @category Transactions
|
|
194
|
+
*/
|
|
195
|
+
isU64(): this is TypeTagU64 {
|
|
196
|
+
return this instanceof TypeTagU64;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Determines if the current instance is of the TypeTagU128 type.
|
|
201
|
+
*
|
|
202
|
+
* @returns {boolean} True if the instance is of TypeTagU128, otherwise false.
|
|
203
|
+
* @group Implementation
|
|
204
|
+
* @category Transactions
|
|
205
|
+
*/
|
|
206
|
+
isU128(): this is TypeTagU128 {
|
|
207
|
+
return this instanceof TypeTagU128;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Checks if the current instance is of type TypeTagU256.
|
|
212
|
+
*
|
|
213
|
+
* @returns {boolean} Returns true if the instance is of type TypeTagU256, otherwise false.
|
|
214
|
+
* @group Implementation
|
|
215
|
+
* @category Transactions
|
|
216
|
+
*/
|
|
217
|
+
isU256(): this is TypeTagU256 {
|
|
218
|
+
return this instanceof TypeTagU256;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** Signed integer helpers */
|
|
222
|
+
isI8(): this is TypeTagI8 {
|
|
223
|
+
return this instanceof TypeTagI8;
|
|
224
|
+
}
|
|
225
|
+
isI16(): this is TypeTagI16 {
|
|
226
|
+
return this instanceof TypeTagI16;
|
|
227
|
+
}
|
|
228
|
+
isI32(): this is TypeTagI32 {
|
|
229
|
+
return this instanceof TypeTagI32;
|
|
230
|
+
}
|
|
231
|
+
isI64(): this is TypeTagI64 {
|
|
232
|
+
return this instanceof TypeTagI64;
|
|
233
|
+
}
|
|
234
|
+
isI128(): this is TypeTagI128 {
|
|
235
|
+
return this instanceof TypeTagI128;
|
|
236
|
+
}
|
|
237
|
+
isI256(): this is TypeTagI256 {
|
|
238
|
+
return this instanceof TypeTagI256;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
isPrimitive(): boolean {
|
|
242
|
+
return (
|
|
243
|
+
this instanceof TypeTagSigner ||
|
|
244
|
+
this instanceof TypeTagAddress ||
|
|
245
|
+
this instanceof TypeTagBool ||
|
|
246
|
+
this instanceof TypeTagU8 ||
|
|
247
|
+
this instanceof TypeTagU16 ||
|
|
248
|
+
this instanceof TypeTagU32 ||
|
|
249
|
+
this instanceof TypeTagU64 ||
|
|
250
|
+
this instanceof TypeTagU128 ||
|
|
251
|
+
this instanceof TypeTagU256 ||
|
|
252
|
+
this instanceof TypeTagI8 ||
|
|
253
|
+
this instanceof TypeTagI16 ||
|
|
254
|
+
this instanceof TypeTagI32 ||
|
|
255
|
+
this instanceof TypeTagI64 ||
|
|
256
|
+
this instanceof TypeTagI128 ||
|
|
257
|
+
this instanceof TypeTagI256
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Represents a boolean type tag in the type system.
|
|
264
|
+
* This class extends the base TypeTag class and provides
|
|
265
|
+
* methods for serialization and deserialization of the boolean
|
|
266
|
+
* type tag.
|
|
267
|
+
*
|
|
268
|
+
* @extends TypeTag
|
|
269
|
+
* @group Implementation
|
|
270
|
+
* @category Transactions
|
|
271
|
+
*/
|
|
272
|
+
export class TypeTagBool extends TypeTag {
|
|
273
|
+
/**
|
|
274
|
+
* Returns the string representation of the object.
|
|
275
|
+
*
|
|
276
|
+
* @returns {string} The string representation of the object.
|
|
277
|
+
* @group Implementation
|
|
278
|
+
* @category Transactions
|
|
279
|
+
*/
|
|
280
|
+
toString(): string {
|
|
281
|
+
return "bool";
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Serializes the current instance's properties into a provided serializer.
|
|
286
|
+
* This function ensures that the address, module name, name, and type arguments are properly serialized.
|
|
287
|
+
*
|
|
288
|
+
* @param serializer - The serializer instance used to serialize the properties.
|
|
289
|
+
* @group Implementation
|
|
290
|
+
* @category Transactions
|
|
291
|
+
*/
|
|
292
|
+
serialize(serializer: Serializer): void {
|
|
293
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.Bool);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Deserializes a StructTag and returns a new TypeTagStruct instance.
|
|
298
|
+
*
|
|
299
|
+
* @param _deserializer - The deserializer used to read the StructTag data.
|
|
300
|
+
* @group Implementation
|
|
301
|
+
* @category Transactions
|
|
302
|
+
*/
|
|
303
|
+
static load(_deserializer: Deserializer): TypeTagBool {
|
|
304
|
+
return new TypeTagBool();
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Represents a type tag for an 8-bit unsigned integer (u8).
|
|
310
|
+
* This class extends the base TypeTag class and provides methods
|
|
311
|
+
* for serialization and deserialization specific to the u8 type.
|
|
312
|
+
*
|
|
313
|
+
* @extends TypeTag
|
|
314
|
+
* @group Implementation
|
|
315
|
+
* @category Transactions
|
|
316
|
+
*/
|
|
317
|
+
export class TypeTagU8 extends TypeTag {
|
|
318
|
+
toString(): string {
|
|
319
|
+
return "u8";
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
serialize(serializer: Serializer): void {
|
|
323
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.U8);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
static load(_deserializer: Deserializer): TypeTagU8 {
|
|
327
|
+
return new TypeTagU8();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Represents a type tag for an 8-bit signed integer (i8).
|
|
333
|
+
* This class extends the base TypeTag class and provides methods
|
|
334
|
+
* for serialization and deserialization specific to the i8 type.
|
|
335
|
+
*
|
|
336
|
+
* @extends TypeTag
|
|
337
|
+
* @group Implementation
|
|
338
|
+
* @category Transactions
|
|
339
|
+
*/
|
|
340
|
+
export class TypeTagI8 extends TypeTag {
|
|
341
|
+
toString(): string {
|
|
342
|
+
return "i8";
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
serialize(serializer: Serializer): void {
|
|
346
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.I8);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
static load(_deserializer: Deserializer): TypeTagI8 {
|
|
350
|
+
return new TypeTagI8();
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Represents a type tag for unsigned 16-bit integers (u16).
|
|
356
|
+
* This class extends the base TypeTag class and provides methods for serialization and deserialization.
|
|
357
|
+
*
|
|
358
|
+
* @extends TypeTag
|
|
359
|
+
* @group Implementation
|
|
360
|
+
* @category Transactions
|
|
361
|
+
*/
|
|
362
|
+
export class TypeTagU16 extends TypeTag {
|
|
363
|
+
toString(): string {
|
|
364
|
+
return "u16";
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
serialize(serializer: Serializer): void {
|
|
368
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.U16);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
static load(_deserializer: Deserializer): TypeTagU16 {
|
|
372
|
+
return new TypeTagU16();
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Represents a type tag for signed 16-bit integers (i16).
|
|
378
|
+
* This class extends the base TypeTag class and provides methods for serialization and deserialization.
|
|
379
|
+
*
|
|
380
|
+
* @extends TypeTag
|
|
381
|
+
* @group Implementation
|
|
382
|
+
* @category Transactions
|
|
383
|
+
*/
|
|
384
|
+
export class TypeTagI16 extends TypeTag {
|
|
385
|
+
toString(): string {
|
|
386
|
+
return "i16";
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
serialize(serializer: Serializer): void {
|
|
390
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.I16);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
static load(_deserializer: Deserializer): TypeTagI16 {
|
|
394
|
+
return new TypeTagI16();
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Represents a type tag for a 32-bit unsigned integer (u32).
|
|
400
|
+
* This class extends the base TypeTag class and provides methods for serialization
|
|
401
|
+
* and deserialization specific to the u32 type.
|
|
402
|
+
*
|
|
403
|
+
* @extends TypeTag
|
|
404
|
+
* @group Implementation
|
|
405
|
+
* @category Transactions
|
|
406
|
+
*/
|
|
407
|
+
export class TypeTagU32 extends TypeTag {
|
|
408
|
+
toString(): string {
|
|
409
|
+
return "u32";
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
serialize(serializer: Serializer): void {
|
|
413
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.U32);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
static load(_deserializer: Deserializer): TypeTagU32 {
|
|
417
|
+
return new TypeTagU32();
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Represents a type tag for a 32-bit signed integer (i32).
|
|
423
|
+
* This class extends the base TypeTag class and provides methods for serialization
|
|
424
|
+
* and deserialization specific to the i32 type.
|
|
425
|
+
*
|
|
426
|
+
* @extends TypeTag
|
|
427
|
+
* @group Implementation
|
|
428
|
+
* @category Transactions
|
|
429
|
+
*/
|
|
430
|
+
export class TypeTagI32 extends TypeTag {
|
|
431
|
+
toString(): string {
|
|
432
|
+
return "i32";
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
serialize(serializer: Serializer): void {
|
|
436
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.I32);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
static load(_deserializer: Deserializer): TypeTagI32 {
|
|
440
|
+
return new TypeTagI32();
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Represents a type tag for 64-bit unsigned integers (u64).
|
|
446
|
+
* This class extends the base TypeTag class and provides methods for serialization and deserialization.
|
|
447
|
+
*
|
|
448
|
+
* @extends TypeTag
|
|
449
|
+
* @group Implementation
|
|
450
|
+
* @category Transactions
|
|
451
|
+
*/
|
|
452
|
+
export class TypeTagU64 extends TypeTag {
|
|
453
|
+
toString(): string {
|
|
454
|
+
return "u64";
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
serialize(serializer: Serializer): void {
|
|
458
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.U64);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
static load(_deserializer: Deserializer): TypeTagU64 {
|
|
462
|
+
return new TypeTagU64();
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Represents a type tag for 64-bit signed integers (i64).
|
|
468
|
+
* This class extends the base TypeTag class and provides methods for serialization and deserialization.
|
|
469
|
+
*
|
|
470
|
+
* @extends TypeTag
|
|
471
|
+
* @group Implementation
|
|
472
|
+
* @category Transactions
|
|
473
|
+
*/
|
|
474
|
+
export class TypeTagI64 extends TypeTag {
|
|
475
|
+
toString(): string {
|
|
476
|
+
return "i64";
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
serialize(serializer: Serializer): void {
|
|
480
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.I64);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
static load(_deserializer: Deserializer): TypeTagI64 {
|
|
484
|
+
return new TypeTagI64();
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Represents a type tag for the u128 data type.
|
|
490
|
+
* This class extends the base TypeTag class and provides methods for serialization and deserialization.
|
|
491
|
+
*
|
|
492
|
+
* @extends TypeTag
|
|
493
|
+
* @group Implementation
|
|
494
|
+
* @category Transactions
|
|
495
|
+
*/
|
|
496
|
+
export class TypeTagU128 extends TypeTag {
|
|
497
|
+
toString(): string {
|
|
498
|
+
return "u128";
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
serialize(serializer: Serializer): void {
|
|
502
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.U128);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
static load(_deserializer: Deserializer): TypeTagU128 {
|
|
506
|
+
return new TypeTagU128();
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Represents a type tag for the i128 data type.
|
|
512
|
+
* This class extends the base TypeTag class and provides methods for serialization and deserialization.
|
|
513
|
+
*
|
|
514
|
+
* @extends TypeTag
|
|
515
|
+
* @group Implementation
|
|
516
|
+
* @category Transactions
|
|
517
|
+
*/
|
|
518
|
+
export class TypeTagI128 extends TypeTag {
|
|
519
|
+
toString(): string {
|
|
520
|
+
return "i128";
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
serialize(serializer: Serializer): void {
|
|
524
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.I128);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
static load(_deserializer: Deserializer): TypeTagI128 {
|
|
528
|
+
return new TypeTagI128();
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Represents a type tag for the U256 data type.
|
|
534
|
+
* This class extends the base TypeTag class and provides methods for serialization and deserialization.
|
|
535
|
+
*
|
|
536
|
+
* @extends TypeTag
|
|
537
|
+
* @group Implementation
|
|
538
|
+
* @category Transactions
|
|
539
|
+
*/
|
|
540
|
+
export class TypeTagU256 extends TypeTag {
|
|
541
|
+
toString(): string {
|
|
542
|
+
return "u256";
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
serialize(serializer: Serializer): void {
|
|
546
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.U256);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
static load(_deserializer: Deserializer): TypeTagU256 {
|
|
550
|
+
return new TypeTagU256();
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Represents a type tag for the I256 data type.
|
|
556
|
+
* This class extends the base TypeTag class and provides methods for serialization and deserialization.
|
|
557
|
+
*
|
|
558
|
+
* @extends TypeTag
|
|
559
|
+
* @group Implementation
|
|
560
|
+
* @category Transactions
|
|
561
|
+
*/
|
|
562
|
+
export class TypeTagI256 extends TypeTag {
|
|
563
|
+
toString(): string {
|
|
564
|
+
return "i256";
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
serialize(serializer: Serializer): void {
|
|
568
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.I256);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
static load(_deserializer: Deserializer): TypeTagI256 {
|
|
572
|
+
return new TypeTagI256();
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Represents a type tag for an address in the system.
|
|
578
|
+
* This class extends the TypeTag class and provides functionality
|
|
579
|
+
* to serialize the address type and load it from a deserializer.
|
|
580
|
+
*
|
|
581
|
+
* @extends TypeTag
|
|
582
|
+
* @group Implementation
|
|
583
|
+
* @category Transactions
|
|
584
|
+
*/
|
|
585
|
+
export class TypeTagAddress extends TypeTag {
|
|
586
|
+
toString(): string {
|
|
587
|
+
return "address";
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
serialize(serializer: Serializer): void {
|
|
591
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.Address);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
static load(_deserializer: Deserializer): TypeTagAddress {
|
|
595
|
+
return new TypeTagAddress();
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Represents a type tag for a signer in the system.
|
|
601
|
+
* This class extends the base TypeTag and provides specific functionality
|
|
602
|
+
* related to the signer type.
|
|
603
|
+
*
|
|
604
|
+
* @extends TypeTag
|
|
605
|
+
* @group Implementation
|
|
606
|
+
* @category Transactions
|
|
607
|
+
*/
|
|
608
|
+
export class TypeTagSigner extends TypeTag {
|
|
609
|
+
toString(): string {
|
|
610
|
+
return "signer";
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
serialize(serializer: Serializer): void {
|
|
614
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.Signer);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
static load(_deserializer: Deserializer): TypeTagSigner {
|
|
618
|
+
return new TypeTagSigner();
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Represents a reference to a type tag in the type system.
|
|
624
|
+
* This class extends the TypeTag class and provides functionality
|
|
625
|
+
* to serialize and deserialize type tag references.
|
|
626
|
+
*
|
|
627
|
+
* @extends TypeTag
|
|
628
|
+
* @group Implementation
|
|
629
|
+
* @category Transactions
|
|
630
|
+
*/
|
|
631
|
+
export class TypeTagReference extends TypeTag {
|
|
632
|
+
toString(): `&${string}` {
|
|
633
|
+
return `&${this.value.toString()}`;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Initializes a new instance of the class with the specified parameters.
|
|
638
|
+
*
|
|
639
|
+
* @param value - The TypeTag to reference.
|
|
640
|
+
* @group Implementation
|
|
641
|
+
* @category Transactions
|
|
642
|
+
*/
|
|
643
|
+
constructor(public readonly value: TypeTag) {
|
|
644
|
+
super();
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
serialize(serializer: Serializer): void {
|
|
648
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.Reference);
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
static load(deserializer: Deserializer): TypeTagReference {
|
|
652
|
+
const value = TypeTag.deserialize(deserializer);
|
|
653
|
+
return new TypeTagReference(value);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Represents a generic type tag used for type parameters in entry functions.
|
|
659
|
+
* Generics are not serialized into a real type, so they cannot be used as a type directly.
|
|
660
|
+
*
|
|
661
|
+
* @extends TypeTag
|
|
662
|
+
* @group Implementation
|
|
663
|
+
* @category Transactions
|
|
664
|
+
*/
|
|
665
|
+
export class TypeTagGeneric extends TypeTag {
|
|
666
|
+
toString(): `T${number}` {
|
|
667
|
+
return `T${this.value}`;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
constructor(public readonly value: number) {
|
|
671
|
+
super();
|
|
672
|
+
if (value < 0) throw new Error("Generic type parameter index cannot be negative");
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
serialize(serializer: Serializer): void {
|
|
676
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.Generic);
|
|
677
|
+
serializer.serializeU32(this.value);
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
static load(deserializer: Deserializer): TypeTagGeneric {
|
|
681
|
+
const value = deserializer.deserializeU32();
|
|
682
|
+
return new TypeTagGeneric(value);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Represents a vector type tag, which encapsulates a single type tag value.
|
|
688
|
+
* This class extends the base TypeTag class and provides methods for serialization,
|
|
689
|
+
* deserialization, and string representation of the vector type tag.
|
|
690
|
+
*
|
|
691
|
+
* @extends TypeTag
|
|
692
|
+
* @group Implementation
|
|
693
|
+
* @category Transactions
|
|
694
|
+
*/
|
|
695
|
+
export class TypeTagVector extends TypeTag {
|
|
696
|
+
toString(): `vector<${string}>` {
|
|
697
|
+
return `vector<${this.value.toString()}>`;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
constructor(public readonly value: TypeTag) {
|
|
701
|
+
super();
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* Creates a new TypeTagVector instance with a TypeTagU8 type.
|
|
706
|
+
*
|
|
707
|
+
* @returns {TypeTagVector} A new TypeTagVector initialized with TypeTagU8.
|
|
708
|
+
* @group Implementation
|
|
709
|
+
* @category Transactions
|
|
710
|
+
*/
|
|
711
|
+
static u8(): TypeTagVector {
|
|
712
|
+
return new TypeTagVector(new TypeTagU8());
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
serialize(serializer: Serializer): void {
|
|
716
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.Vector);
|
|
717
|
+
this.value.serialize(serializer);
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
static load(deserializer: Deserializer): TypeTagVector {
|
|
721
|
+
const value = TypeTag.deserialize(deserializer);
|
|
722
|
+
return new TypeTagVector(value);
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* Represents a structured type tag in the system, extending the base TypeTag class.
|
|
728
|
+
* This class encapsulates information about a specific structure, including its address,
|
|
729
|
+
* module name, and type arguments, and provides methods for serialization and type checking.
|
|
730
|
+
*
|
|
731
|
+
* @param value - The StructTag instance containing the details of the structured type.
|
|
732
|
+
* @group Implementation
|
|
733
|
+
* @category Transactions
|
|
734
|
+
*/
|
|
735
|
+
export class TypeTagStruct extends TypeTag {
|
|
736
|
+
toString(): `0x${string}::${string}::${string}` {
|
|
737
|
+
// Collect type args and add it if there are any
|
|
738
|
+
let typePredicate = "";
|
|
739
|
+
if (this.value.typeArgs.length > 0) {
|
|
740
|
+
typePredicate = `<${this.value.typeArgs.map((typeArg) => typeArg.toString()).join(", ")}>`;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
return `${this.value.address.toString()}::${this.value.moduleName.identifier}::${this.value.name.identifier
|
|
744
|
+
}${typePredicate}`;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
constructor(public readonly value: StructTag) {
|
|
748
|
+
super();
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
serialize(serializer: Serializer): void {
|
|
752
|
+
serializer.serializeU32AsUleb128(TypeTagVariants.Struct);
|
|
753
|
+
this.value.serialize(serializer);
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
static load(deserializer: Deserializer): TypeTagStruct {
|
|
757
|
+
const value = StructTag.deserialize(deserializer);
|
|
758
|
+
return new TypeTagStruct(value);
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
/**
|
|
762
|
+
* Determines if the provided address, module name, and struct name match the current type tag.
|
|
763
|
+
*
|
|
764
|
+
* @param address - The account address to compare against the type tag.
|
|
765
|
+
* @param moduleName - The name of the module to compare against the type tag.
|
|
766
|
+
* @param structName - The name of the struct to compare against the type tag.
|
|
767
|
+
* @returns True if the address, module name, and struct name match the type tag; otherwise, false.
|
|
768
|
+
* @group Implementation
|
|
769
|
+
* @category Transactions
|
|
770
|
+
*/
|
|
771
|
+
isTypeTag(address: AccountAddress, moduleName: string, structName: string): boolean {
|
|
772
|
+
return (
|
|
773
|
+
this.value.moduleName.identifier === moduleName &&
|
|
774
|
+
this.value.name.identifier === structName &&
|
|
775
|
+
this.value.address.equals(address)
|
|
776
|
+
);
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Checks if the provided value is of type string.
|
|
781
|
+
* This function can help ensure that the data being processed is in the correct format before further operations.
|
|
782
|
+
*
|
|
783
|
+
* @returns {boolean} Returns true if the value is a string, otherwise false.
|
|
784
|
+
* @group Implementation
|
|
785
|
+
* @category Transactions
|
|
786
|
+
*/
|
|
787
|
+
isString(): boolean {
|
|
788
|
+
return this.isTypeTag(AccountAddress.ONE, "string", "String");
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Checks if the specified account address is of type "option".
|
|
793
|
+
*
|
|
794
|
+
* @returns {boolean} Returns true if the account address is an option type, otherwise false.
|
|
795
|
+
* @group Implementation
|
|
796
|
+
* @category Transactions
|
|
797
|
+
*/
|
|
798
|
+
isOption(): boolean {
|
|
799
|
+
return this.isTypeTag(AccountAddress.ONE, "option", "Option");
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* Checks if the provided value is of type 'object'.
|
|
804
|
+
* This function helps determine if a value can be treated as an object type in the context of the SDK.
|
|
805
|
+
*
|
|
806
|
+
* @returns {boolean} Returns true if the value is an object, otherwise false.
|
|
807
|
+
* @group Implementation
|
|
808
|
+
* @category Transactions
|
|
809
|
+
*/
|
|
810
|
+
isObject(): boolean {
|
|
811
|
+
return this.isTypeTag(AccountAddress.ONE, "object", "Object");
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
/**
|
|
815
|
+
* Checks if the provided value is a 'DelegationKey' for permissioned signers.
|
|
816
|
+
*
|
|
817
|
+
* @returns {boolean} Returns true if the value is a DelegationKey, otherwise false.
|
|
818
|
+
* @group Implementation
|
|
819
|
+
* @category Transactions
|
|
820
|
+
*/
|
|
821
|
+
isDelegationKey(): boolean {
|
|
822
|
+
return this.isTypeTag(AccountAddress.ONE, "permissioned_delegation", "DelegationKey");
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Checks if the provided value is of type `RateLimiter`.
|
|
827
|
+
*
|
|
828
|
+
* @returns {boolean} Returns true if the value is a RateLimiter, otherwise false.
|
|
829
|
+
* @group Implementation
|
|
830
|
+
* @category Transactions
|
|
831
|
+
*/
|
|
832
|
+
isRateLimiter(): boolean {
|
|
833
|
+
return this.isTypeTag(AccountAddress.ONE, "rate_limiter", "RateLimiter");
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* Represents a structured tag that includes an address, module name,
|
|
839
|
+
* name, and type arguments. This class is used to define and manage
|
|
840
|
+
* structured data types within the SDK.
|
|
841
|
+
*
|
|
842
|
+
* @property {AccountAddress} address - The address associated with the struct tag.
|
|
843
|
+
* @property {Identifier} moduleName - The name of the module that contains the struct.
|
|
844
|
+
* @property {Identifier} name - The name of the struct.
|
|
845
|
+
* @property {Array<TypeTag>} typeArgs - An array of type arguments associated with the struct.
|
|
846
|
+
* @group Implementation
|
|
847
|
+
* @category Transactions
|
|
848
|
+
*/
|
|
849
|
+
export class StructTag extends Serializable {
|
|
850
|
+
public readonly address: AccountAddress;
|
|
851
|
+
|
|
852
|
+
public readonly moduleName: Identifier;
|
|
853
|
+
|
|
854
|
+
public readonly name: Identifier;
|
|
855
|
+
|
|
856
|
+
public readonly typeArgs: Array<TypeTag>;
|
|
857
|
+
|
|
858
|
+
constructor(address: AccountAddress, module_name: Identifier, name: Identifier, type_args: Array<TypeTag>) {
|
|
859
|
+
super();
|
|
860
|
+
this.address = address;
|
|
861
|
+
this.moduleName = module_name;
|
|
862
|
+
this.name = name;
|
|
863
|
+
this.typeArgs = type_args;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
serialize(serializer: Serializer): void {
|
|
867
|
+
serializer.serialize(this.address);
|
|
868
|
+
serializer.serialize(this.moduleName);
|
|
869
|
+
serializer.serialize(this.name);
|
|
870
|
+
serializer.serializeVector(this.typeArgs);
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
static deserialize(deserializer: Deserializer): StructTag {
|
|
874
|
+
const address = AccountAddress.deserialize(deserializer);
|
|
875
|
+
const moduleName = Identifier.deserialize(deserializer);
|
|
876
|
+
const name = Identifier.deserialize(deserializer);
|
|
877
|
+
const typeArgs = deserializer.deserializeVector(TypeTag);
|
|
878
|
+
return new StructTag(address, moduleName, name, typeArgs);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
/**
|
|
883
|
+
* Retrieves the StructTag for the MovementCoin, which represents the Movement Coin in the Movement blockchain.
|
|
884
|
+
*
|
|
885
|
+
* @returns {StructTag} The StructTag for the MovementCoin.
|
|
886
|
+
* @group Implementation
|
|
887
|
+
* @category Transactions
|
|
888
|
+
*/
|
|
889
|
+
export function aptosCoinStructTag(): StructTag {
|
|
890
|
+
return new StructTag(AccountAddress.ONE, new Identifier("aptos_coin"), new Identifier("AptosCoin"), []);
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* Returns a new StructTag representing a string type.
|
|
895
|
+
*
|
|
896
|
+
* @returns {StructTag} A StructTag for the string type.
|
|
897
|
+
* @group Implementation
|
|
898
|
+
* @category Transactions
|
|
899
|
+
*/
|
|
900
|
+
export function stringStructTag(): StructTag {
|
|
901
|
+
return new StructTag(AccountAddress.ONE, new Identifier("string"), new Identifier("String"), []);
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
/**
|
|
905
|
+
* Creates a new StructTag for the Option type with the specified type argument.
|
|
906
|
+
* This can help in defining a specific instance of an Option type in your application.
|
|
907
|
+
*
|
|
908
|
+
* @param typeArg - The type tag that specifies the type of the value contained in the Option.
|
|
909
|
+
* @group Implementation
|
|
910
|
+
* @category Transactions
|
|
911
|
+
*/
|
|
912
|
+
export function optionStructTag(typeArg: TypeTag): StructTag {
|
|
913
|
+
return new StructTag(AccountAddress.ONE, new Identifier("option"), new Identifier("Option"), [typeArg]);
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
/**
|
|
917
|
+
* Creates a new StructTag for the Object type with the specified type argument.
|
|
918
|
+
* This function helps in defining a structured representation of an Object with a specific type.
|
|
919
|
+
*
|
|
920
|
+
* @param typeArg - The type tag that specifies the type of the Object.
|
|
921
|
+
* @group Implementation
|
|
922
|
+
* @category Transactions
|
|
923
|
+
*/
|
|
924
|
+
export function objectStructTag(typeArg: TypeTag): StructTag {
|
|
925
|
+
return new StructTag(AccountAddress.ONE, new Identifier("object"), new Identifier("Object"), [typeArg]);
|
|
926
|
+
}
|