@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,120 @@
|
|
|
1
|
+
// Copyright © Move Industries
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { MovementConfig } from "../api/movementConfig";
|
|
5
|
+
import { MovementApiError } from "../errors";
|
|
6
|
+
import { AnyNumber, Client, ClientRequest, ClientResponse, MimeType, MovementRequest, MovementResponse } from "../types";
|
|
7
|
+
import { MovementApiType } from "../utils";
|
|
8
|
+
import { VERSION } from "../version";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Sends a request using the specified options and returns the response.
|
|
12
|
+
*
|
|
13
|
+
* @param options - The options for the request.
|
|
14
|
+
* @param options.url - The URL to send the request to.
|
|
15
|
+
* @param options.method - The HTTP method to use for the request.
|
|
16
|
+
* @param options.body - The body of the request.
|
|
17
|
+
* @param options.contentType - The content type of the request.
|
|
18
|
+
* @param options.params - The query parameters to include in the request.
|
|
19
|
+
* @param options.overrides - Additional overrides for the request.
|
|
20
|
+
* @param options.overrides.HEADERS - Custom headers to include in the request.
|
|
21
|
+
* @param options.overrides.AUTH_TOKEN - The authorization token for the request.
|
|
22
|
+
* @param options.overrides.API_KEY - The API key for the request.
|
|
23
|
+
* @param options.originMethod - The origin method for the request.
|
|
24
|
+
* @param client - The client used to make the request.
|
|
25
|
+
*
|
|
26
|
+
* @returns The response from the request.
|
|
27
|
+
* @group Implementation
|
|
28
|
+
* @category Client
|
|
29
|
+
*/
|
|
30
|
+
export async function request<Req, Res>(options: ClientRequest<Req>, client: Client): Promise<ClientResponse<Res>> {
|
|
31
|
+
const { url, method, body, contentType, params, overrides, originMethod } = options;
|
|
32
|
+
const headers: Record<string, string | AnyNumber | boolean | undefined> = {
|
|
33
|
+
...overrides?.HEADERS,
|
|
34
|
+
"x-aptos-client": `aptos-typescript-sdk/${VERSION}`,
|
|
35
|
+
"content-type": contentType ?? MimeType.JSON,
|
|
36
|
+
"x-aptos-typescript-sdk-origin-method": originMethod,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
if (overrides?.AUTH_TOKEN) {
|
|
40
|
+
headers.Authorization = `Bearer ${overrides?.AUTH_TOKEN}`;
|
|
41
|
+
}
|
|
42
|
+
if (overrides?.API_KEY) {
|
|
43
|
+
headers.Authorization = `Bearer ${overrides?.API_KEY}`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/*
|
|
47
|
+
* make a call using the @moveindustries/movement-client package
|
|
48
|
+
* {@link https://www.npmjs.com/package/@moveindustries/movement-client}
|
|
49
|
+
*/
|
|
50
|
+
return client.provider<Req, Res>({
|
|
51
|
+
url,
|
|
52
|
+
method,
|
|
53
|
+
body,
|
|
54
|
+
params,
|
|
55
|
+
headers,
|
|
56
|
+
overrides,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The main function to use when making an API request, returning the response or throwing an MovementApiError on failure.
|
|
62
|
+
*
|
|
63
|
+
* @param movementRequestOpts - Options for the Movement request, including the URL and path.
|
|
64
|
+
* @param movementConfig - The configuration information for the SDK client instance.
|
|
65
|
+
* @param apiType - The type of API being accessed, which determines how the response is handled.
|
|
66
|
+
* @returns The response from the API request or throws an MovementApiError if the request fails.
|
|
67
|
+
* @group Implementation
|
|
68
|
+
* @category Client
|
|
69
|
+
*/
|
|
70
|
+
export async function aptosRequest<Req extends {}, Res extends {}>(
|
|
71
|
+
movementRequestOpts: MovementRequest,
|
|
72
|
+
movementConfig: MovementConfig,
|
|
73
|
+
apiType: MovementApiType,
|
|
74
|
+
): Promise<MovementResponse<Req, Res>> {
|
|
75
|
+
const { url, path } = movementRequestOpts;
|
|
76
|
+
const fullUrl = path ? `${url}/${path}` : url;
|
|
77
|
+
const clientResponse = await request<Req, Res>({ ...movementRequestOpts, url: fullUrl }, movementConfig.client);
|
|
78
|
+
|
|
79
|
+
const movementResponse: MovementResponse<Req, Res> = {
|
|
80
|
+
status: clientResponse.status,
|
|
81
|
+
statusText: clientResponse.statusText ?? "No status text provided",
|
|
82
|
+
data: clientResponse.data,
|
|
83
|
+
headers: clientResponse.headers,
|
|
84
|
+
config: clientResponse.config,
|
|
85
|
+
request: clientResponse.request,
|
|
86
|
+
url: fullUrl,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// Handle case for `Unauthorized` error (i.e. API_KEY error)
|
|
90
|
+
if (movementResponse.status === 401) {
|
|
91
|
+
throw new MovementApiError({ apiType, aptosRequest: movementRequestOpts, movementResponse });
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// to support both fullnode and indexer responses,
|
|
95
|
+
// check if it is an indexer query, and adjust response.data
|
|
96
|
+
if (apiType === MovementApiType.INDEXER) {
|
|
97
|
+
const indexerResponse = movementResponse.data as any;
|
|
98
|
+
// Handle Indexer general errors
|
|
99
|
+
if (indexerResponse.errors) {
|
|
100
|
+
throw new MovementApiError({
|
|
101
|
+
apiType,
|
|
102
|
+
aptosRequest: movementRequestOpts,
|
|
103
|
+
movementResponse,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
movementResponse.data = indexerResponse.data as Res;
|
|
107
|
+
} else if (apiType === MovementApiType.PEPPER || apiType === MovementApiType.PROVER) {
|
|
108
|
+
if (movementResponse.status >= 400) {
|
|
109
|
+
throw new MovementApiError({ apiType, aptosRequest: movementRequestOpts, movementResponse });
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (movementResponse.status >= 200 && movementResponse.status < 300) {
|
|
114
|
+
return movementResponse;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// We have to explicitly check for all request types, because if the error is a non-indexer error, but
|
|
118
|
+
// comes from an indexer request (e.g. 404), we'll need to mention it appropriately
|
|
119
|
+
throw new MovementApiError({ apiType, aptosRequest: movementRequestOpts, movementResponse });
|
|
120
|
+
}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { MovementConfig } from "../api/movementConfig";
|
|
2
|
+
import { AnyNumber, ClientConfig, MimeType, MovementResponse } from "../types";
|
|
3
|
+
import { MovementApiType } from "../utils/const";
|
|
4
|
+
import { aptosRequest } from "./core";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Options for making a GET request, including configuration for the API client.
|
|
8
|
+
* @group Implementation
|
|
9
|
+
* @category Client
|
|
10
|
+
*/
|
|
11
|
+
export type GetRequestOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* The config for the API client
|
|
14
|
+
* @group Implementation
|
|
15
|
+
* @category Client
|
|
16
|
+
*/
|
|
17
|
+
movementConfig: MovementConfig;
|
|
18
|
+
/**
|
|
19
|
+
* The type of API endpoint to call e.g. fullnode, indexer, etc
|
|
20
|
+
* @group Implementation
|
|
21
|
+
* @category Client
|
|
22
|
+
*/
|
|
23
|
+
type: MovementApiType;
|
|
24
|
+
/**
|
|
25
|
+
* The name of the API method
|
|
26
|
+
* @group Implementation
|
|
27
|
+
* @category Client
|
|
28
|
+
*/
|
|
29
|
+
originMethod: string;
|
|
30
|
+
/**
|
|
31
|
+
* The URL path to the API method
|
|
32
|
+
* @group Implementation
|
|
33
|
+
* @category Client
|
|
34
|
+
*/
|
|
35
|
+
path: string;
|
|
36
|
+
/**
|
|
37
|
+
* The content type of the request body
|
|
38
|
+
* @group Implementation
|
|
39
|
+
* @category Client
|
|
40
|
+
*/
|
|
41
|
+
contentType?: MimeType;
|
|
42
|
+
/**
|
|
43
|
+
* The accepted content type of the response of the API
|
|
44
|
+
* @group Implementation
|
|
45
|
+
* @category Client
|
|
46
|
+
*/
|
|
47
|
+
acceptType?: MimeType;
|
|
48
|
+
/**
|
|
49
|
+
* The query parameters for the request
|
|
50
|
+
* @group Implementation
|
|
51
|
+
* @category Client
|
|
52
|
+
*/
|
|
53
|
+
params?: Record<string, string | AnyNumber | boolean | undefined>;
|
|
54
|
+
/**
|
|
55
|
+
* Specific client overrides for this request to override movementConfig
|
|
56
|
+
* @group Implementation
|
|
57
|
+
* @category Client
|
|
58
|
+
*/
|
|
59
|
+
overrides?: ClientConfig;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Options for making a request to the Movement API, excluding the "type" field.
|
|
64
|
+
* @group Implementation
|
|
65
|
+
* @category Client
|
|
66
|
+
*/
|
|
67
|
+
export type GetAptosRequestOptions = Omit<GetRequestOptions, "type">;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Executes a GET request to retrieve data based on the provided options.
|
|
71
|
+
*
|
|
72
|
+
* @param options - The options for the GET request.
|
|
73
|
+
* @param options.movementConfig - The configuration object for Movement requests.
|
|
74
|
+
* @param options.overrides - Optional overrides for the request configuration.
|
|
75
|
+
* @param options.params - Query parameters to include in the request.
|
|
76
|
+
* @param options.contentType - The content type of the request.
|
|
77
|
+
* @param options.acceptType - The accepted response type.
|
|
78
|
+
* @param options.path - The specific path for the request.
|
|
79
|
+
* @param options.originMethod - The original method of the request.
|
|
80
|
+
* @param options.type - The type of request being made.
|
|
81
|
+
* @returns The response from the GET request.
|
|
82
|
+
* @group Implementation
|
|
83
|
+
* @category Client
|
|
84
|
+
*/
|
|
85
|
+
export async function get<Req extends {}, Res extends {}>(
|
|
86
|
+
options: GetRequestOptions,
|
|
87
|
+
): Promise<MovementResponse<Req, Res>> {
|
|
88
|
+
const { movementConfig, overrides, params, contentType, acceptType, path, originMethod, type } = options;
|
|
89
|
+
const url = movementConfig.getRequestUrl(type);
|
|
90
|
+
|
|
91
|
+
return aptosRequest<Req, Res>(
|
|
92
|
+
{
|
|
93
|
+
url,
|
|
94
|
+
method: "GET",
|
|
95
|
+
originMethod,
|
|
96
|
+
path,
|
|
97
|
+
contentType,
|
|
98
|
+
acceptType,
|
|
99
|
+
params,
|
|
100
|
+
overrides: {
|
|
101
|
+
...movementConfig.clientConfig,
|
|
102
|
+
...overrides,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
movementConfig,
|
|
106
|
+
options.type,
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Retrieves data from the Movement full node using the provided options.
|
|
112
|
+
*
|
|
113
|
+
* @param options - The options for the request to the Movement full node.
|
|
114
|
+
* @param options.movementConfig - Configuration settings specific to the Movement client and full node.
|
|
115
|
+
* @param options.movementConfig.clientConfig - The client configuration settings.
|
|
116
|
+
* @param options.movementConfig.fullnodeConfig - The full node configuration settings.
|
|
117
|
+
* @param options.overrides - Additional overrides for the request.
|
|
118
|
+
* @param options.type - The type of API request being made.
|
|
119
|
+
*
|
|
120
|
+
* @returns A promise that resolves with the response from the Movement full node.
|
|
121
|
+
* @group Implementation
|
|
122
|
+
* @category Client
|
|
123
|
+
*/
|
|
124
|
+
export async function getAptosFullNode<Req extends {}, Res extends {}>(
|
|
125
|
+
options: GetAptosRequestOptions,
|
|
126
|
+
): Promise<MovementResponse<Req, Res>> {
|
|
127
|
+
const { movementConfig } = options;
|
|
128
|
+
|
|
129
|
+
return get<Req, Res>({
|
|
130
|
+
...options,
|
|
131
|
+
type: MovementApiType.FULLNODE,
|
|
132
|
+
overrides: {
|
|
133
|
+
...movementConfig.clientConfig,
|
|
134
|
+
...movementConfig.fullnodeConfig,
|
|
135
|
+
...options.overrides,
|
|
136
|
+
HEADERS: { ...movementConfig.clientConfig?.HEADERS, ...movementConfig.fullnodeConfig?.HEADERS },
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Makes a GET request to the Movement Pepper service to retrieve data.
|
|
143
|
+
*
|
|
144
|
+
* @param options - The options for the request.
|
|
145
|
+
* @param options.param1 - Description of param1.
|
|
146
|
+
* @param options.param2 - Description of param2.
|
|
147
|
+
* @returns MovementResponse - The response from the Movement Pepper service.
|
|
148
|
+
* @group Implementation
|
|
149
|
+
* @category Client
|
|
150
|
+
*/
|
|
151
|
+
export async function getAptosPepperService<Req extends {}, Res extends {}>(
|
|
152
|
+
options: GetAptosRequestOptions,
|
|
153
|
+
): Promise<MovementResponse<Req, Res>> {
|
|
154
|
+
return get<Req, Res>({ ...options, type: MovementApiType.PEPPER });
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* This function is a helper for paginating using a function wrapping an API
|
|
159
|
+
* @group Implementation
|
|
160
|
+
* @category Client
|
|
161
|
+
*/
|
|
162
|
+
export async function paginateWithCursor<Req extends Record<string, any>, Res extends Array<{}>>(
|
|
163
|
+
options: GetAptosRequestOptions,
|
|
164
|
+
): Promise<Res> {
|
|
165
|
+
const out: Res = new Array(0) as Res;
|
|
166
|
+
let cursor: string | undefined;
|
|
167
|
+
const requestParams = options.params as { start?: string; limit?: number };
|
|
168
|
+
do {
|
|
169
|
+
// eslint-disable-next-line no-await-in-loop
|
|
170
|
+
const response = await get<Req, Res>({
|
|
171
|
+
type: MovementApiType.FULLNODE,
|
|
172
|
+
movementConfig: options.movementConfig,
|
|
173
|
+
originMethod: options.originMethod,
|
|
174
|
+
path: options.path,
|
|
175
|
+
params: requestParams,
|
|
176
|
+
overrides: options.overrides,
|
|
177
|
+
});
|
|
178
|
+
/**
|
|
179
|
+
* the cursor is a "state key" from the API perspective. Client
|
|
180
|
+
* should not need to "care" what it represents but just use it
|
|
181
|
+
* to query the next chunk of data.
|
|
182
|
+
* @group Implementation
|
|
183
|
+
* @category Client
|
|
184
|
+
*/
|
|
185
|
+
cursor = response.headers["x-aptos-cursor"];
|
|
186
|
+
// Now that we have the cursor (if any), we remove the headers before
|
|
187
|
+
// adding these to the output of this function.
|
|
188
|
+
delete response.headers;
|
|
189
|
+
out.push(...response.data);
|
|
190
|
+
requestParams.start = cursor;
|
|
191
|
+
} while (cursor !== null && cursor !== undefined);
|
|
192
|
+
return out;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/// This function is a helper for paginating using a function wrapping an API using offset instead of start
|
|
196
|
+
export async function paginateWithObfuscatedCursor<Req extends Record<string, any>, Res extends Array<{}>>(
|
|
197
|
+
options: GetAptosRequestOptions,
|
|
198
|
+
): Promise<Res> {
|
|
199
|
+
const out: Res = new Array(0) as Res;
|
|
200
|
+
let cursor: string | undefined;
|
|
201
|
+
const requestParams = options.params as { start?: string; limit?: number };
|
|
202
|
+
const totalLimit = requestParams.limit;
|
|
203
|
+
do {
|
|
204
|
+
// eslint-disable-next-line no-await-in-loop
|
|
205
|
+
const { response, cursor: newCursor } = await getPageWithObfuscatedCursor<Req, Res>({ ...options });
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* the cursor is a "state key" from the API perspective. Client
|
|
209
|
+
* should not need to "care" what it represents but just use it
|
|
210
|
+
* to query the next chunk of data.
|
|
211
|
+
*/
|
|
212
|
+
cursor = newCursor;
|
|
213
|
+
out.push(...response.data);
|
|
214
|
+
if (options?.params) {
|
|
215
|
+
options.params.start = cursor;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Re-evaluate length
|
|
219
|
+
if (totalLimit !== undefined) {
|
|
220
|
+
const newLimit = totalLimit - out.length;
|
|
221
|
+
if (newLimit <= 0) {
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
requestParams.limit = newLimit;
|
|
225
|
+
}
|
|
226
|
+
} while (cursor !== null && cursor !== undefined);
|
|
227
|
+
return out;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export async function getPageWithObfuscatedCursor<Req extends Record<string, any>, Res extends Array<{}>>(
|
|
231
|
+
options: GetAptosRequestOptions,
|
|
232
|
+
): Promise<{ response: MovementResponse<Req, Res>; cursor: string | undefined }> {
|
|
233
|
+
let cursor: string | undefined;
|
|
234
|
+
let requestParams: { start?: string; limit?: number } = {};
|
|
235
|
+
|
|
236
|
+
// Drop any other values
|
|
237
|
+
// TODO: Throw error if cursor is not a string
|
|
238
|
+
if (typeof options.params?.cursor === "string") {
|
|
239
|
+
requestParams.start = options.params.cursor;
|
|
240
|
+
}
|
|
241
|
+
if (typeof options.params?.limit === "number") {
|
|
242
|
+
requestParams.limit = options.params.limit;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// eslint-disable-next-line no-await-in-loop
|
|
246
|
+
const response = await get<Req, Res>({
|
|
247
|
+
type: MovementApiType.FULLNODE,
|
|
248
|
+
movementConfig: options.movementConfig,
|
|
249
|
+
originMethod: options.originMethod,
|
|
250
|
+
path: options.path,
|
|
251
|
+
params: requestParams,
|
|
252
|
+
overrides: options.overrides,
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* the cursor is a "state key" from the API perspective. Client
|
|
257
|
+
* should not need to "care" what it represents but just use it
|
|
258
|
+
* to query the next chunk of data.
|
|
259
|
+
*/
|
|
260
|
+
cursor = response.headers["x-aptos-cursor"];
|
|
261
|
+
return { response, cursor };
|
|
262
|
+
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
// Copyright © Move Industries
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { MovementConfig } from "../api/movementConfig";
|
|
5
|
+
import { AnyNumber, ClientConfig, MimeType, MovementResponse } from "../types";
|
|
6
|
+
import { MovementApiType } from "../utils/const";
|
|
7
|
+
import { aptosRequest } from "./core";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Options for making a POST request, including the API client configuration.
|
|
11
|
+
* @group Implementation
|
|
12
|
+
* @category Client
|
|
13
|
+
*/
|
|
14
|
+
export type PostRequestOptions = {
|
|
15
|
+
/**
|
|
16
|
+
* The config for the API client
|
|
17
|
+
* @group Implementation
|
|
18
|
+
* @category Client
|
|
19
|
+
*/
|
|
20
|
+
movementConfig: MovementConfig;
|
|
21
|
+
/**
|
|
22
|
+
* The type of API endpoint to call e.g. fullnode, indexer, etc
|
|
23
|
+
* @group Implementation
|
|
24
|
+
* @category Client
|
|
25
|
+
*/
|
|
26
|
+
type: MovementApiType;
|
|
27
|
+
/**
|
|
28
|
+
* The name of the API method
|
|
29
|
+
* @group Implementation
|
|
30
|
+
* @category Client
|
|
31
|
+
*/
|
|
32
|
+
originMethod: string;
|
|
33
|
+
/**
|
|
34
|
+
* The URL path to the API method
|
|
35
|
+
* @group Implementation
|
|
36
|
+
* @category Client
|
|
37
|
+
*/
|
|
38
|
+
path: string;
|
|
39
|
+
/**
|
|
40
|
+
* The content type of the request body
|
|
41
|
+
* @group Implementation
|
|
42
|
+
* @category Client
|
|
43
|
+
*/
|
|
44
|
+
contentType?: MimeType;
|
|
45
|
+
/**
|
|
46
|
+
* The accepted content type of the response of the API
|
|
47
|
+
* @group Implementation
|
|
48
|
+
* @category Client
|
|
49
|
+
*/
|
|
50
|
+
acceptType?: MimeType;
|
|
51
|
+
/**
|
|
52
|
+
* The query parameters for the request
|
|
53
|
+
* @group Implementation
|
|
54
|
+
* @category Client
|
|
55
|
+
*/
|
|
56
|
+
params?: Record<string, string | AnyNumber | boolean | undefined>;
|
|
57
|
+
/**
|
|
58
|
+
* The body of the request, should match the content type of the request
|
|
59
|
+
* @group Implementation
|
|
60
|
+
* @category Client
|
|
61
|
+
*/
|
|
62
|
+
body?: any;
|
|
63
|
+
/**
|
|
64
|
+
* Specific client overrides for this request to override movementConfig
|
|
65
|
+
* @group Implementation
|
|
66
|
+
* @category Client
|
|
67
|
+
*/
|
|
68
|
+
overrides?: ClientConfig;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Options for posting a request to Movement, excluding the type field.
|
|
73
|
+
* @group Implementation
|
|
74
|
+
* @category Client
|
|
75
|
+
*/
|
|
76
|
+
export type PostAptosRequestOptions = Omit<PostRequestOptions, "type">;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Executes a POST request to the specified URL with the provided options.
|
|
80
|
+
*
|
|
81
|
+
* @param options - The options for the POST request.
|
|
82
|
+
* @param options.type - The type of the request.
|
|
83
|
+
* @param options.originMethod - The original method that initiated the request.
|
|
84
|
+
* @param options.path - The path for the request.
|
|
85
|
+
* @param options.body - The body content to be sent with the request.
|
|
86
|
+
* @param options.acceptType - The type of response expected from the server.
|
|
87
|
+
* @param options.contentType - The content type of the request body.
|
|
88
|
+
* @param options.params - Additional parameters to include in the request.
|
|
89
|
+
* @param options.movementConfig - Configuration settings for the Movement request.
|
|
90
|
+
* @param options.overrides - Any overrides for the default request behavior.
|
|
91
|
+
* @returns The response from the POST request.
|
|
92
|
+
* @group Implementation
|
|
93
|
+
* @category Client
|
|
94
|
+
*/
|
|
95
|
+
export async function post<Req extends {}, Res extends {}>(
|
|
96
|
+
options: PostRequestOptions,
|
|
97
|
+
): Promise<MovementResponse<Req, Res>> {
|
|
98
|
+
const { type, originMethod, path, body, acceptType, contentType, params, movementConfig, overrides } = options;
|
|
99
|
+
const url = movementConfig.getRequestUrl(type);
|
|
100
|
+
|
|
101
|
+
return aptosRequest<Req, Res>(
|
|
102
|
+
{
|
|
103
|
+
url,
|
|
104
|
+
method: "POST",
|
|
105
|
+
originMethod,
|
|
106
|
+
path,
|
|
107
|
+
body,
|
|
108
|
+
contentType,
|
|
109
|
+
acceptType,
|
|
110
|
+
params,
|
|
111
|
+
overrides,
|
|
112
|
+
},
|
|
113
|
+
movementConfig,
|
|
114
|
+
options.type,
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Sends a request to the Movement full node using the specified options.
|
|
120
|
+
* This function allows you to interact with the Movement blockchain by sending requests to the full node.
|
|
121
|
+
*
|
|
122
|
+
* @param options - The options for the request.
|
|
123
|
+
* @param options.movementConfig - Configuration settings for the Movement client.
|
|
124
|
+
* @param options.movementConfig.clientConfig - Client-specific configuration settings.
|
|
125
|
+
* @param options.movementConfig.fullnodeConfig - Full node-specific configuration settings.
|
|
126
|
+
* @param options.overrides - Additional overrides for the request.
|
|
127
|
+
* @group Implementation
|
|
128
|
+
* @category Client
|
|
129
|
+
*/
|
|
130
|
+
export async function postAptosFullNode<Req extends {}, Res extends {}>(
|
|
131
|
+
options: PostAptosRequestOptions,
|
|
132
|
+
): Promise<MovementResponse<Req, Res>> {
|
|
133
|
+
const { movementConfig } = options;
|
|
134
|
+
|
|
135
|
+
return post<Req, Res>({
|
|
136
|
+
...options,
|
|
137
|
+
type: MovementApiType.FULLNODE,
|
|
138
|
+
overrides: {
|
|
139
|
+
...movementConfig.clientConfig,
|
|
140
|
+
...movementConfig.fullnodeConfig,
|
|
141
|
+
...options.overrides,
|
|
142
|
+
HEADERS: { ...movementConfig.clientConfig?.HEADERS, ...movementConfig.fullnodeConfig?.HEADERS },
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Sends a request to the Movement indexer with the specified options.
|
|
149
|
+
* This function allows you to interact with the Movement indexer and customize the request using various configurations.
|
|
150
|
+
*
|
|
151
|
+
* @param options - The options for the request to the Movement indexer.
|
|
152
|
+
* @param options.movementConfig - Configuration settings specific to the Movement client and indexer.
|
|
153
|
+
* @param options.movementConfig.clientConfig - The client configuration settings.
|
|
154
|
+
* @param options.movementConfig.indexerConfig - The indexer configuration settings.
|
|
155
|
+
* @param options.overrides - Additional overrides for the request.
|
|
156
|
+
* @param options.overrides.HEADERS - Custom headers to include in the request.
|
|
157
|
+
* @group Implementation
|
|
158
|
+
* @category Client
|
|
159
|
+
*/
|
|
160
|
+
export async function postAptosIndexer<Req extends {}, Res extends {}>(
|
|
161
|
+
options: PostAptosRequestOptions,
|
|
162
|
+
): Promise<MovementResponse<Req, Res>> {
|
|
163
|
+
const { movementConfig } = options;
|
|
164
|
+
|
|
165
|
+
return post<Req, Res>({
|
|
166
|
+
...options,
|
|
167
|
+
type: MovementApiType.INDEXER,
|
|
168
|
+
overrides: {
|
|
169
|
+
...movementConfig.clientConfig,
|
|
170
|
+
...movementConfig.indexerConfig,
|
|
171
|
+
...options.overrides,
|
|
172
|
+
HEADERS: { ...movementConfig.clientConfig?.HEADERS, ...movementConfig.indexerConfig?.HEADERS },
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Sends a request to the Movement faucet to obtain test tokens.
|
|
179
|
+
* This function modifies the provided configuration to ensure that the API_KEY is not included in the request.
|
|
180
|
+
*
|
|
181
|
+
* @param options - The options for the request.
|
|
182
|
+
* @param options.movementConfig - The configuration settings for the Movement client.
|
|
183
|
+
* @param options.movementConfig.clientConfig - The client-specific configuration settings.
|
|
184
|
+
* @param options.movementConfig.clientConfig.HEADERS - Optional headers to include in the request.
|
|
185
|
+
* @param options.movementConfig.faucetConfig - The configuration settings specific to the faucet.
|
|
186
|
+
* @param options.overrides - Additional overrides for the request configuration.
|
|
187
|
+
* @group Implementation
|
|
188
|
+
* @category Client
|
|
189
|
+
*/
|
|
190
|
+
export async function postAptosFaucet<Req extends {}, Res extends {}>(
|
|
191
|
+
options: PostAptosRequestOptions,
|
|
192
|
+
): Promise<MovementResponse<Req, Res>> {
|
|
193
|
+
const { movementConfig } = options;
|
|
194
|
+
// Faucet does not support API_KEY
|
|
195
|
+
// Create a new object with the desired modification
|
|
196
|
+
const modifiedMovementConfig = {
|
|
197
|
+
...movementConfig,
|
|
198
|
+
clientConfig: { ...movementConfig.clientConfig },
|
|
199
|
+
};
|
|
200
|
+
// Delete API_KEY config
|
|
201
|
+
delete modifiedMovementConfig?.clientConfig?.API_KEY;
|
|
202
|
+
|
|
203
|
+
return post<Req, Res>({
|
|
204
|
+
...options,
|
|
205
|
+
type: MovementApiType.FAUCET,
|
|
206
|
+
overrides: {
|
|
207
|
+
...modifiedMovementConfig.clientConfig,
|
|
208
|
+
...modifiedMovementConfig.faucetConfig,
|
|
209
|
+
...options.overrides,
|
|
210
|
+
HEADERS: { ...modifiedMovementConfig.clientConfig?.HEADERS, ...modifiedMovementConfig.faucetConfig?.HEADERS },
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Makes a post request to the pepper service.
|
|
217
|
+
*
|
|
218
|
+
* @param options - The options for the request.
|
|
219
|
+
* @param options.url - The URL to which the request is sent.
|
|
220
|
+
* @param options.headers - The headers to include in the request.
|
|
221
|
+
* @param options.body - The body of the request.
|
|
222
|
+
* @returns A promise that resolves to the response from the pepper service.
|
|
223
|
+
* @group Implementation
|
|
224
|
+
* @category Client
|
|
225
|
+
*/
|
|
226
|
+
export async function postAptosPepperService<Req extends {}, Res extends {}>(
|
|
227
|
+
options: PostAptosRequestOptions,
|
|
228
|
+
): Promise<MovementResponse<Req, Res>> {
|
|
229
|
+
return post<Req, Res>({ ...options, type: MovementApiType.PEPPER });
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Sends a request to the Movement proving service with the specified options.
|
|
234
|
+
*
|
|
235
|
+
* @param options - The options for the request to the Movement proving service.
|
|
236
|
+
* @param options.type - The type of the request, which should be set to MovementApiType.PROVER.
|
|
237
|
+
* @param options.data - The data to be included in the request.
|
|
238
|
+
* @group Implementation
|
|
239
|
+
* @category Client
|
|
240
|
+
*/
|
|
241
|
+
export async function postAptosProvingService<Req extends {}, Res extends {}>(
|
|
242
|
+
options: PostAptosRequestOptions,
|
|
243
|
+
): Promise<MovementResponse<Req, Res>> {
|
|
244
|
+
return post<Req, Res>({ ...options, type: MovementApiType.PROVER });
|
|
245
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./utils";
|