@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,107 @@
|
|
|
1
|
+
// Copyright © Move Industries
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @group Implementation
|
|
6
|
+
* @category Network
|
|
7
|
+
*/
|
|
8
|
+
export const NetworkToIndexerAPI: Record<string, string> = {
|
|
9
|
+
mainnet: "https://indexer.mainnet.movementnetwork.xyz/v1/graphql",
|
|
10
|
+
testnet: "https://indexer.testnet.movementnetwork.xyz/v1/graphql",
|
|
11
|
+
devnet: "https://indexer.devnet.movementnetwork.xyz/v1/graphql",
|
|
12
|
+
shelbynet: "https://api.shelbynet.shelby.xyz/v1/graphql",
|
|
13
|
+
netna: "https://api.netna.staging.aptoslabs.com/v1/graphql",
|
|
14
|
+
local: "http://127.0.0.1:8090/v1/graphql",
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @group Implementation
|
|
19
|
+
* @category Network
|
|
20
|
+
*/
|
|
21
|
+
export const NetworkToNodeAPI: Record<string, string> = {
|
|
22
|
+
mainnet: "https://mainnet.movementnetwork.xyz/v1",
|
|
23
|
+
testnet: "https://testnet.movementnetwork.xyz/v1",
|
|
24
|
+
devnet: "https://devnet.movementnetwork.xyz/v1",
|
|
25
|
+
shelbynet: "https://api.shelbynet.shelby.xyz/v1",
|
|
26
|
+
netna: "https://api.netna.staging.aptoslabs.com/v1",
|
|
27
|
+
local: "http://127.0.0.1:8080/v1",
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @group Implementation
|
|
32
|
+
* @category Network
|
|
33
|
+
*/
|
|
34
|
+
export const NetworkToFaucetAPI: Record<string, string> = {
|
|
35
|
+
testnet: "https://faucet.testnet.movementnetwork.xyz",
|
|
36
|
+
devnet: "https://faucet.devnet.movementnetwork.xyz",
|
|
37
|
+
shelbynet: "https://faucet.shelbynet.shelby.xyz",
|
|
38
|
+
netna: "https://faucet-dev-netna-us-central1-410192433417.us-central1.run.app",
|
|
39
|
+
local: "http://127.0.0.1:8081",
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @group Implementation
|
|
44
|
+
* @category Network
|
|
45
|
+
*/
|
|
46
|
+
export const NetworkToPepperAPI: Record<string, string> = {
|
|
47
|
+
mainnet: "https://api.mainnet.aptoslabs.com/keyless/pepper/v0",
|
|
48
|
+
testnet: "https://api.testnet.aptoslabs.com/keyless/pepper/v0",
|
|
49
|
+
devnet: "https://api.devnet.aptoslabs.com/keyless/pepper/v0",
|
|
50
|
+
shelbynet: "https://api.shelbynet.aptoslabs.com/keyless/pepper/v0",
|
|
51
|
+
netna: "https://api.devnet.aptoslabs.com/keyless/pepper/v0",
|
|
52
|
+
// Use the devnet service for local environment
|
|
53
|
+
local: "https://api.devnet.aptoslabs.com/keyless/pepper/v0",
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @group Implementation
|
|
58
|
+
* @category Network
|
|
59
|
+
*/
|
|
60
|
+
export const NetworkToProverAPI: Record<string, string> = {
|
|
61
|
+
mainnet: "https://api.mainnet.aptoslabs.com/keyless/prover/v0",
|
|
62
|
+
testnet: "https://api.testnet.aptoslabs.com/keyless/prover/v0",
|
|
63
|
+
devnet: "https://api.devnet.aptoslabs.com/keyless/prover/v0",
|
|
64
|
+
shelbynet: "https://api.shelbynet.aptoslabs.com/keyless/prover/v0",
|
|
65
|
+
netna: "https://api.devnet.aptoslabs.com/keyless/prover/v0",
|
|
66
|
+
// Use the devnet service for local environment
|
|
67
|
+
local: "https://api.devnet.aptoslabs.com/keyless/prover/v0",
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Different network environments for connecting to services, ranging from production to development setups.
|
|
72
|
+
* @group Implementation
|
|
73
|
+
* @category Network
|
|
74
|
+
*/
|
|
75
|
+
export enum Network {
|
|
76
|
+
MAINNET = "mainnet",
|
|
77
|
+
TESTNET = "testnet",
|
|
78
|
+
DEVNET = "devnet",
|
|
79
|
+
SHELBYNET = "shelbynet",
|
|
80
|
+
NETNA = "netna",
|
|
81
|
+
LOCAL = "local",
|
|
82
|
+
CUSTOM = "custom",
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @group Implementation
|
|
87
|
+
* @category Network
|
|
88
|
+
*/
|
|
89
|
+
export const NetworkToChainId: Record<string, number> = {
|
|
90
|
+
mainnet: 126,
|
|
91
|
+
testnet: 250,
|
|
92
|
+
local: 4,
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @group Implementation
|
|
97
|
+
* @category Network
|
|
98
|
+
*/
|
|
99
|
+
export const NetworkToNetworkName: Record<string, Network> = {
|
|
100
|
+
mainnet: Network.MAINNET,
|
|
101
|
+
testnet: Network.TESTNET,
|
|
102
|
+
devnet: Network.DEVNET,
|
|
103
|
+
shelbynet: Network.SHELBYNET,
|
|
104
|
+
netna: Network.NETNA,
|
|
105
|
+
local: Network.LOCAL,
|
|
106
|
+
custom: Network.CUSTOM,
|
|
107
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// Copyright © Move Industries
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Types of API endpoints used for routing requests in the Movement network.
|
|
6
|
+
* @group Implementation
|
|
7
|
+
* @category Utils
|
|
8
|
+
*/
|
|
9
|
+
export enum MovementApiType {
|
|
10
|
+
FULLNODE = "Fullnode",
|
|
11
|
+
INDEXER = "Indexer",
|
|
12
|
+
FAUCET = "Faucet",
|
|
13
|
+
PEPPER = "Pepper",
|
|
14
|
+
PROVER = "Prover",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The default max gas amount when none is given.
|
|
19
|
+
*
|
|
20
|
+
* This is the maximum number of gas units that will be used by a transaction before being rejected.
|
|
21
|
+
*
|
|
22
|
+
* Note that max gas amount varies based on the transaction. A larger transaction will go over this
|
|
23
|
+
* default gas amount, and the value will need to be changed for the specific transaction.
|
|
24
|
+
* @group Implementation
|
|
25
|
+
* @category Utils
|
|
26
|
+
*/
|
|
27
|
+
export const DEFAULT_MAX_GAS_AMOUNT = 200000;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The default transaction expiration seconds from now.
|
|
31
|
+
*
|
|
32
|
+
* This time is how long until the blockchain nodes will reject the transaction.
|
|
33
|
+
*
|
|
34
|
+
* Note that the transaction expiration time varies based on network connection and network load. It may need to be
|
|
35
|
+
* increased for the transaction to be processed.
|
|
36
|
+
* @group Implementation
|
|
37
|
+
* @category Utils
|
|
38
|
+
*/
|
|
39
|
+
export const DEFAULT_TXN_EXP_SEC_FROM_NOW = 20;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The default number of seconds to wait for a transaction to be processed.
|
|
43
|
+
*
|
|
44
|
+
* This time is the amount of time that the SDK will wait for a transaction to be processed when waiting for
|
|
45
|
+
* the results of the transaction. It may take longer based on network connection and network load.
|
|
46
|
+
* @group Implementation
|
|
47
|
+
* @category Utils
|
|
48
|
+
*/
|
|
49
|
+
export const DEFAULT_TXN_TIMEOUT_SEC = 20;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The default gas currency for the network.
|
|
53
|
+
* @group Implementation
|
|
54
|
+
* @category Utils
|
|
55
|
+
*/
|
|
56
|
+
export const MOVEMENT_COIN = "0x1::aptos_coin::AptosCoin";
|
|
57
|
+
/**
|
|
58
|
+
* @group Implementation
|
|
59
|
+
* @category Utils
|
|
60
|
+
*/
|
|
61
|
+
export const MOVEMENT_FA = "0x000000000000000000000000000000000000000000000000000000000000000a";
|
|
62
|
+
/**
|
|
63
|
+
* @group Implementation
|
|
64
|
+
* @category Utils
|
|
65
|
+
*/
|
|
66
|
+
export const RAW_TRANSACTION_SALT = "APTOS::RawTransaction";
|
|
67
|
+
/**
|
|
68
|
+
* @group Implementation
|
|
69
|
+
* @category Utils
|
|
70
|
+
*/
|
|
71
|
+
export const RAW_TRANSACTION_WITH_DATA_SALT = "APTOS::RawTransactionWithData";
|
|
72
|
+
|
|
73
|
+
export const ACCOUNT_ABSTRACTION_SIGNING_DATA_SALT = "APTOS::AASigningData";
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Supported processor types for the indexer API, sourced from the processor_status table in the indexer database.
|
|
77
|
+
* {@link https://cloud.hasura.io/public/graphiql?endpoint=https://mainnet.movementnetwork.xyz/v1/graphql}
|
|
78
|
+
* @group Implementation
|
|
79
|
+
* @category Utils
|
|
80
|
+
*/
|
|
81
|
+
export enum ProcessorType {
|
|
82
|
+
ACCOUNT_RESTORATION_PROCESSOR = "account_restoration_processor",
|
|
83
|
+
ACCOUNT_TRANSACTION_PROCESSOR = "account_transactions_processor",
|
|
84
|
+
DEFAULT = "default_processor",
|
|
85
|
+
EVENTS_PROCESSOR = "events_processor",
|
|
86
|
+
// Fungible asset processor also handles coins
|
|
87
|
+
FUNGIBLE_ASSET_PROCESSOR = "fungible_asset_processor",
|
|
88
|
+
STAKE_PROCESSOR = "stake_processor",
|
|
89
|
+
// Token V2 processor replaces Token processor (not only for digital assets)
|
|
90
|
+
TOKEN_V2_PROCESSOR = "token_v2_processor",
|
|
91
|
+
USER_TRANSACTION_PROCESSOR = "user_transaction_processor",
|
|
92
|
+
OBJECT_PROCESSOR = "objects_processor",
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Regular expression pattern for Firebase Auth issuer URLs
|
|
97
|
+
* Matches URLs in the format: https://securetoken.google.com/[project-id]
|
|
98
|
+
* where project-id can contain letters, numbers, hyphens, and underscores
|
|
99
|
+
*/
|
|
100
|
+
export const FIREBASE_AUTH_ISS_PATTERN = /^https:\/\/securetoken\.google\.com\/[a-zA-Z0-9-_]+$/;
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
// Copyright © Move Industries
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { decode } from "js-base64";
|
|
5
|
+
import { createObjectAddress } from "../core/account/utils/address";
|
|
6
|
+
import { AccountAddress } from "../core/accountAddress";
|
|
7
|
+
import { MoveFunctionId, MoveStructId } from "../types";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Sleep for the specified amount of time in milliseconds.
|
|
11
|
+
* This function can be used to introduce delays in asynchronous operations.
|
|
12
|
+
*
|
|
13
|
+
* @param timeMs - The time in milliseconds to sleep.
|
|
14
|
+
* @group Implementation
|
|
15
|
+
* @category Utils
|
|
16
|
+
*/
|
|
17
|
+
export async function sleep(timeMs: number): Promise<null> {
|
|
18
|
+
return new Promise((resolve) => {
|
|
19
|
+
setTimeout(resolve, timeMs);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get the error message from an unknown error.
|
|
25
|
+
*
|
|
26
|
+
* @param error The error to get the message from
|
|
27
|
+
* @returns The error message
|
|
28
|
+
* @group Implementation
|
|
29
|
+
* @category Utils
|
|
30
|
+
*/
|
|
31
|
+
export function getErrorMessage(error: unknown): string {
|
|
32
|
+
return error instanceof Error ? error.message : String(error);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @group Implementation
|
|
37
|
+
* @category Utils
|
|
38
|
+
*/
|
|
39
|
+
export const nowInSeconds = () => Math.floor(Date.now() / 1000);
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Floors the given timestamp to the nearest whole hour.
|
|
43
|
+
* This function is useful for normalizing timestamps to hourly intervals.
|
|
44
|
+
*
|
|
45
|
+
* @param timestampInSeconds - The timestamp in seconds to be floored.
|
|
46
|
+
* @group Implementation
|
|
47
|
+
* @category Utils
|
|
48
|
+
*/
|
|
49
|
+
export function floorToWholeHour(timestampInSeconds: number): number {
|
|
50
|
+
const date = new Date(timestampInSeconds * 1000);
|
|
51
|
+
// Reset minutes and seconds to zero
|
|
52
|
+
date.setMinutes(0);
|
|
53
|
+
date.setSeconds(0);
|
|
54
|
+
date.setMilliseconds(0);
|
|
55
|
+
return Math.floor(date.getTime() / 1000);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Decodes a base64 URL-encoded string into its original form.
|
|
60
|
+
* This function is useful for converting base64 URL-encoded data back to a readable format.
|
|
61
|
+
*
|
|
62
|
+
* @param base64Url - The base64 URL-encoded string to decode.
|
|
63
|
+
* @returns The decoded string.
|
|
64
|
+
* @group Implementation
|
|
65
|
+
* @category Utils
|
|
66
|
+
*/
|
|
67
|
+
export function base64UrlDecode(base64Url: string): string {
|
|
68
|
+
// Replace base64url-specific characters
|
|
69
|
+
const base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/");
|
|
70
|
+
// Pad the string with '=' characters if needed
|
|
71
|
+
const paddedBase64 = base64 + "==".substring(0, (3 - (base64.length % 3)) % 3);
|
|
72
|
+
const decodedString = decode(paddedBase64);
|
|
73
|
+
return decodedString;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function base64UrlToBytes(base64Url: string): Uint8Array {
|
|
77
|
+
// Convert Base64Url to Base64
|
|
78
|
+
let base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/");
|
|
79
|
+
// Add padding if needed
|
|
80
|
+
while (base64.length % 4 !== 0) {
|
|
81
|
+
base64 += "=";
|
|
82
|
+
}
|
|
83
|
+
// Use Buffer to convert base64 to Uint8Array
|
|
84
|
+
return new Uint8Array(Buffer.from(base64, "base64"));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Amount is represented in the smallest unit format on chain, this function converts
|
|
89
|
+
* a human-readable amount format to the smallest unit format
|
|
90
|
+
* @example
|
|
91
|
+
* human-readable amount format: 500
|
|
92
|
+
* on chain amount format when decimal is 8: 50000000000
|
|
93
|
+
*
|
|
94
|
+
* @param value The value in human-readable format
|
|
95
|
+
* @param decimal The token decimal
|
|
96
|
+
* @returns The value in the smallest units
|
|
97
|
+
* @group Implementation
|
|
98
|
+
* @category Utils
|
|
99
|
+
*/
|
|
100
|
+
export const convertAmountFromHumanReadableToOnChain = (value: number, decimal: number) => value * 10 ** decimal;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Amount is represented in the smallest unit format on chain, this function converts
|
|
104
|
+
* the smallest unit format to a human-readable amount format
|
|
105
|
+
* @example
|
|
106
|
+
* human-readable amount format: 500
|
|
107
|
+
* on chain amount format when decimal is 8: 50000000000
|
|
108
|
+
*
|
|
109
|
+
* @param value The value in human-readable format
|
|
110
|
+
* @param decimal The token decimal
|
|
111
|
+
* @returns The value in the smallest units
|
|
112
|
+
* @group Implementation
|
|
113
|
+
* @category Utils
|
|
114
|
+
*/
|
|
115
|
+
export const convertAmountFromOnChainToHumanReadable = (value: number, decimal: number) => value / 10 ** decimal;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Convert a hex string to an ascii string with the `0x` prefix.
|
|
119
|
+
*
|
|
120
|
+
* `0x6170746f735f636f696e` --> `aptos_coin`
|
|
121
|
+
*
|
|
122
|
+
* @param hex The hex string to convert (e.g. `0x6170746f735f636f696e`)
|
|
123
|
+
* @returns The ascii string
|
|
124
|
+
* @group Implementation
|
|
125
|
+
* @category Utils
|
|
126
|
+
*/
|
|
127
|
+
const hexToAscii = (hex: string) => {
|
|
128
|
+
let str = "";
|
|
129
|
+
for (let n = 2; n < hex.length; n += 2) {
|
|
130
|
+
str += String.fromCharCode(parseInt(hex.substring(n, n + 2), 16));
|
|
131
|
+
}
|
|
132
|
+
return str;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Convert an encoded struct to a MoveStructId.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* const structObj = {
|
|
140
|
+
* account_address: "0x1",
|
|
141
|
+
* module_name: "0x6170746f735f636f696e",
|
|
142
|
+
* struct_name: "0x4170746f73436f696e",
|
|
143
|
+
* };
|
|
144
|
+
* // structId is "0x1::aptos_coin::AptosCoin"
|
|
145
|
+
* const structId = parseEncodedStruct(structObj);
|
|
146
|
+
*
|
|
147
|
+
* @param structObj The struct with account_address, module_name, and struct_name properties
|
|
148
|
+
* @returns The MoveStructId
|
|
149
|
+
* @group Implementation
|
|
150
|
+
* @category Utils
|
|
151
|
+
*/
|
|
152
|
+
export const parseEncodedStruct = (structObj: {
|
|
153
|
+
account_address: string;
|
|
154
|
+
module_name: string;
|
|
155
|
+
struct_name: string;
|
|
156
|
+
}): MoveStructId => {
|
|
157
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
158
|
+
const { account_address, module_name, struct_name } = structObj;
|
|
159
|
+
const moduleName = hexToAscii(module_name);
|
|
160
|
+
const structName = hexToAscii(struct_name);
|
|
161
|
+
return `${account_address}::${moduleName}::${structName}`;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Determines whether the given object is an encoded struct type with the following properties:
|
|
166
|
+
* - account_address: string
|
|
167
|
+
* - module_name: string
|
|
168
|
+
* - struct_name: string
|
|
169
|
+
*
|
|
170
|
+
* @param structObj The object to check
|
|
171
|
+
* @returns Whether the object is an encoded struct type
|
|
172
|
+
* @group Implementation
|
|
173
|
+
* @category Utils
|
|
174
|
+
*/
|
|
175
|
+
export const isEncodedStruct = (
|
|
176
|
+
structObj: any,
|
|
177
|
+
): structObj is {
|
|
178
|
+
account_address: string;
|
|
179
|
+
module_name: string;
|
|
180
|
+
struct_name: string;
|
|
181
|
+
} =>
|
|
182
|
+
typeof structObj === "object" &&
|
|
183
|
+
!Array.isArray(structObj) &&
|
|
184
|
+
structObj !== null &&
|
|
185
|
+
"account_address" in structObj &&
|
|
186
|
+
"module_name" in structObj &&
|
|
187
|
+
"struct_name" in structObj &&
|
|
188
|
+
typeof structObj.account_address === "string" &&
|
|
189
|
+
typeof structObj.module_name === "string" &&
|
|
190
|
+
typeof structObj.struct_name === "string";
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Splits a function identifier into its constituent parts: module address, module name, and function name.
|
|
194
|
+
* This function helps in validating and extracting details from a function identifier string.
|
|
195
|
+
*
|
|
196
|
+
* @param functionArg - The function identifier string in the format "moduleAddress::moduleName::functionName".
|
|
197
|
+
* @returns An object containing the module address, module name, and function name.
|
|
198
|
+
* @throws Error if the function identifier does not contain exactly three parts.
|
|
199
|
+
* @group Implementation
|
|
200
|
+
* @category Transactions
|
|
201
|
+
*/
|
|
202
|
+
export function getFunctionParts(functionArg: MoveFunctionId) {
|
|
203
|
+
const funcNameParts = functionArg.split("::");
|
|
204
|
+
if (funcNameParts.length !== 3) {
|
|
205
|
+
throw new Error(`Invalid function ${functionArg}`);
|
|
206
|
+
}
|
|
207
|
+
const moduleAddress = funcNameParts[0];
|
|
208
|
+
const moduleName = funcNameParts[1];
|
|
209
|
+
const functionName = funcNameParts[2];
|
|
210
|
+
return { moduleAddress, moduleName, functionName };
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Validates the provided function information.
|
|
215
|
+
*
|
|
216
|
+
* @param functionInfo - The function information to validate.
|
|
217
|
+
* @returns Whether the function information is valid.
|
|
218
|
+
* @group Implementation
|
|
219
|
+
* @category Utils
|
|
220
|
+
*/
|
|
221
|
+
export function isValidFunctionInfo(functionInfo: string): boolean {
|
|
222
|
+
const parts = functionInfo.split("::");
|
|
223
|
+
return parts.length === 3 && AccountAddress.isValid({ input: parts[0] }).valid;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Truncates the provided wallet address at the middle with an ellipsis.
|
|
228
|
+
*
|
|
229
|
+
* @param address - The wallet address to truncate.
|
|
230
|
+
* @param start - The number of characters to show at the beginning of the address.
|
|
231
|
+
* @param end - The number of characters to show at the end of the address.
|
|
232
|
+
* @returns The truncated address.
|
|
233
|
+
* @group Implementation
|
|
234
|
+
* @category Utils
|
|
235
|
+
*/
|
|
236
|
+
export function truncateAddress(address: string, start: number = 6, end: number = 5) {
|
|
237
|
+
return `${address.slice(0, start)}...${address.slice(-end)}`;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Constants for metadata address calculation
|
|
242
|
+
*/
|
|
243
|
+
const MOVE_COIN_TYPE_STR = "0x1::aptos_coin::AptosCoin";
|
|
244
|
+
const MOVE_METADATA_ADDRESS_HEX = AccountAddress.A.toStringLong();
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Helper function to standardize Move type string by converting all addresses to short form,
|
|
248
|
+
* including addresses within nested type parameters
|
|
249
|
+
*/
|
|
250
|
+
function standardizeMoveTypeString(input: string): string {
|
|
251
|
+
// Regular expression to match addresses in the type string, including those within type parameters
|
|
252
|
+
// This regex matches "0x" followed by hex digits, handling both standalone addresses and those within <>
|
|
253
|
+
const addressRegex = /0x[0-9a-fA-F]+/g;
|
|
254
|
+
|
|
255
|
+
return input.replace(addressRegex, (match) => {
|
|
256
|
+
// Use AccountAddress to handle the address
|
|
257
|
+
return AccountAddress.from(match, { maxMissingChars: 63 }).toStringShort();
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Calculates the paired FA metadata address for a given coin type.
|
|
263
|
+
* This function is tolerant of various address formats in the coin type string,
|
|
264
|
+
* including complex nested types.
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* // All these formats are valid and will produce the same result:
|
|
268
|
+
* pairedFaMetadataAddress("0x1::aptos_coin::AptosCoin") // simple form
|
|
269
|
+
* pairedFaMetadataAddress("0x0000000000000000000000000000000000000000000000000000000000000001::aptos_coin::AptosCoin") // long form
|
|
270
|
+
* pairedFaMetadataAddress("0x00001::aptos_coin::AptosCoin") // with leading zeros
|
|
271
|
+
* pairedFaMetadataAddress("0x1::coin::Coin<0x1412::a::struct<0x0001::aptos_coin::AptosCoin>>") // nested type parameters
|
|
272
|
+
*
|
|
273
|
+
* @param coinType - The coin type string in any of these formats:
|
|
274
|
+
* - Short form address: "0x1::aptos_coin::AptosCoin"
|
|
275
|
+
* - Long form address: "0x0000000000000000000000000000000000000000000000000000000000000001::aptos_coin::AptosCoin"
|
|
276
|
+
* - With leading zeros: "0x00001::aptos_coin::AptosCoin"
|
|
277
|
+
* - With nested types: "0x1::coin::Coin<0x1412::a::struct<0x0001::aptos_coin::AptosCoin>>"
|
|
278
|
+
* @returns The calculated metadata address as an AccountAddress instance
|
|
279
|
+
*/
|
|
280
|
+
export function pairedFaMetadataAddress(coinType: `0x${string}::${string}::${string}`): AccountAddress {
|
|
281
|
+
// Standardize the coin type string to handle any address format
|
|
282
|
+
const standardizedMoveTypeName = standardizeMoveTypeString(coinType);
|
|
283
|
+
|
|
284
|
+
return standardizedMoveTypeName === MOVE_COIN_TYPE_STR
|
|
285
|
+
? AccountAddress.A
|
|
286
|
+
: createObjectAddress(AccountAddress.A, standardizedMoveTypeName);
|
|
287
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Copyright © Move Industries
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The global cache Map shared across all functions. Must keep care to ensure that the
|
|
6
|
+
* cache keys are unique across all functions.
|
|
7
|
+
* @group Implementation
|
|
8
|
+
* @category Utils
|
|
9
|
+
*/
|
|
10
|
+
const cache = new Map<string, { value: any; timestamp: number }>();
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A memoize higher-order function to cache the response of an async function.
|
|
14
|
+
* This function helps to improve performance by avoiding repeated calls to the same async function with the same arguments
|
|
15
|
+
* within a specified time-to-live (TTL).
|
|
16
|
+
*
|
|
17
|
+
* @param func The async function to cache the result of.
|
|
18
|
+
* @param key The cache key used to store the result.
|
|
19
|
+
* @param ttlMs The time-to-live in milliseconds for cached data.
|
|
20
|
+
* @returns The cached or latest result.
|
|
21
|
+
* @group Implementation
|
|
22
|
+
* @category Utils
|
|
23
|
+
*/
|
|
24
|
+
export function memoizeAsync<T>(
|
|
25
|
+
func: (...args: any[]) => Promise<T>,
|
|
26
|
+
key: string,
|
|
27
|
+
ttlMs?: number,
|
|
28
|
+
): (...args: any[]) => Promise<T> {
|
|
29
|
+
return async (...args: any[]) => {
|
|
30
|
+
// Check if the cached result exists and is within TTL
|
|
31
|
+
if (cache.has(key)) {
|
|
32
|
+
const { value, timestamp } = cache.get(key)!;
|
|
33
|
+
if (ttlMs === undefined || Date.now() - timestamp <= ttlMs) {
|
|
34
|
+
return value;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// If not cached or TTL expired, compute the result
|
|
39
|
+
const result = await func(...args);
|
|
40
|
+
|
|
41
|
+
// Cache the result with a timestamp
|
|
42
|
+
cache.set(key, { value: result, timestamp: Date.now() });
|
|
43
|
+
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Caches the result of a function call to improve performance on subsequent calls with the same arguments.
|
|
50
|
+
*
|
|
51
|
+
* @param key - The key to cache on, all accesses by this key will return the cached value.
|
|
52
|
+
* @param func - The function whose result will be cached.
|
|
53
|
+
* @param ttlMs - The time-to-live in milliseconds for cached data.
|
|
54
|
+
* @returns A memoized version of the provided function that returns the cached result if available and within TTL.
|
|
55
|
+
* @group Implementation
|
|
56
|
+
* @category Utils
|
|
57
|
+
*/
|
|
58
|
+
export function memoize<T>(func: (...args: any[]) => T, key: string, ttlMs?: number): (...args: any[]) => T {
|
|
59
|
+
return (...args: any[]) => {
|
|
60
|
+
// Check if the cached result exists and is within TTL
|
|
61
|
+
if (cache.has(key)) {
|
|
62
|
+
const { value, timestamp } = cache.get(key)!;
|
|
63
|
+
if (ttlMs === undefined || Date.now() - timestamp <= ttlMs) {
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// If not cached or TTL expired, compute the result
|
|
69
|
+
const result = func(...args);
|
|
70
|
+
|
|
71
|
+
// Cache the result with a timestamp
|
|
72
|
+
cache.set(key, { value: result, timestamp: Date.now() });
|
|
73
|
+
|
|
74
|
+
return result;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright © Move Industries
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { Deserializer, Serializable } from "../bcs";
|
|
5
|
+
/**
|
|
6
|
+
* @group Implementation
|
|
7
|
+
* @category Utils
|
|
8
|
+
*/
|
|
9
|
+
export type DeserializableClass<T extends Serializable> = {
|
|
10
|
+
/**
|
|
11
|
+
* Deserializes a serialized object using the provided deserializer.
|
|
12
|
+
* This function allows you to reconstruct an object from its serialized form.
|
|
13
|
+
*
|
|
14
|
+
* @param deserializer - An instance of the Deserializer used to read the serialized data.
|
|
15
|
+
* @group Implementation
|
|
16
|
+
* @category Utils
|
|
17
|
+
*/
|
|
18
|
+
deserialize(deserializer: Deserializer): T;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Normalizes an instance of a class by deserializing it from its byte representation.
|
|
23
|
+
* This function allows the `instanceof` operator to work correctly when the input objects originate from a different bundle.
|
|
24
|
+
*
|
|
25
|
+
* @param cls - The class of the object to normalize.
|
|
26
|
+
* @param value - The instance to normalize.
|
|
27
|
+
* @group Implementation
|
|
28
|
+
* @category Utils
|
|
29
|
+
*/
|
|
30
|
+
export function normalizeBundle<T extends Serializable>(cls: DeserializableClass<T>, value: T) {
|
|
31
|
+
const serializedBytes = value.bcsToBytes();
|
|
32
|
+
const deserializer = new Deserializer(serializedBytes);
|
|
33
|
+
return cls.deserialize(deserializer);
|
|
34
|
+
}
|