@aptos-labs/ts-sdk 1.17.0 → 1.18.1
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/dist/common/{accountAddress-ccLvlUQe.d.ts → accountAddress-Lv-GSihU.d.ts} +107 -13
- package/dist/common/chunk-BHKSQXUZ.js +2 -0
- package/dist/common/chunk-BHKSQXUZ.js.map +1 -0
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +808 -117
- package/dist/common/index.js +30 -28
- package/dist/common/index.js.map +1 -1
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.d.mts +85 -0
- package/dist/esm/account/EphemeralKeyPair.mjs +2 -0
- package/dist/esm/account/KeylessAccount.d.mts +175 -0
- package/dist/esm/account/KeylessAccount.mjs +2 -0
- package/dist/esm/account/MultiKeyAccount.d.mts +11 -5
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.d.mts +6 -0
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/api/account.d.mts +2 -2
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +2 -2
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +9 -1
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +20 -0
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +2 -2
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +2 -2
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +7 -0
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +104 -0
- package/dist/esm/api/keyless.mjs +2 -0
- package/dist/esm/api/keyless.mjs.map +1 -0
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/simulate.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/deserializer.d.mts +32 -0
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.d.mts +42 -0
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-TQLED4KC.mjs → chunk-2DSPX6BX.mjs} +2 -2
- package/dist/esm/chunk-2QWQ6RX5.mjs +2 -0
- package/dist/esm/chunk-2QWQ6RX5.mjs.map +1 -0
- package/dist/esm/chunk-362JBD4O.mjs +2 -0
- package/dist/esm/{chunk-SUAMDMAA.mjs.map → chunk-362JBD4O.mjs.map} +1 -1
- package/dist/esm/{chunk-RWXHA4QZ.mjs → chunk-3VUSIKCF.mjs} +2 -2
- package/dist/esm/chunk-3ZCQQ3L2.mjs +2 -0
- package/dist/esm/chunk-3ZCQQ3L2.mjs.map +1 -0
- package/dist/esm/chunk-42SZQH5Z.mjs +2 -0
- package/dist/esm/chunk-42SZQH5Z.mjs.map +1 -0
- package/dist/esm/{chunk-MCRRHBFQ.mjs → chunk-4EPLOSKY.mjs} +2 -2
- package/dist/esm/{chunk-BSVNV6SJ.mjs → chunk-4IBJW3PB.mjs} +2 -2
- package/dist/esm/{chunk-J6HKAEKY.mjs → chunk-5X2BJDOB.mjs} +2 -2
- package/dist/esm/{chunk-5UKBTF7N.mjs → chunk-5YHI7WOB.mjs} +2 -2
- package/dist/esm/{chunk-J5I4OZAS.mjs → chunk-6DYDZSEW.mjs} +2 -2
- package/dist/esm/{chunk-J4Z6XR5D.mjs → chunk-6JL2U7JB.mjs} +2 -2
- package/dist/esm/{chunk-RNL5TAQT.mjs → chunk-6UDHM6YZ.mjs} +2 -2
- package/dist/esm/{chunk-2X7A4HUS.mjs → chunk-6ZQWPHLV.mjs} +2 -2
- package/dist/esm/{chunk-4NHWV5AI.mjs → chunk-76OH2Z4Q.mjs} +2 -2
- package/dist/esm/{chunk-5EN52MUT.mjs → chunk-77NXCSLY.mjs} +2 -2
- package/dist/esm/{chunk-ND6OMSQU.mjs → chunk-7Y45UTRL.mjs} +2 -2
- package/dist/esm/chunk-7Z6DYLCA.mjs +1 -0
- package/dist/esm/chunk-7Z6DYLCA.mjs.map +1 -0
- package/dist/esm/{chunk-T2AGN5YT.mjs → chunk-A2Z7I2EY.mjs} +2 -2
- package/dist/esm/{chunk-36QXVFR5.mjs → chunk-A63SMUOU.mjs} +2 -2
- package/dist/esm/{chunk-36QXVFR5.mjs.map → chunk-A63SMUOU.mjs.map} +1 -1
- package/dist/esm/chunk-AQ4I7VVB.mjs +1 -0
- package/dist/esm/chunk-AQ4I7VVB.mjs.map +1 -0
- package/dist/esm/{chunk-3XFID2N4.mjs → chunk-AVH5SYTL.mjs} +2 -2
- package/dist/esm/{chunk-3N6N3KOS.mjs → chunk-AYKZA676.mjs} +2 -2
- package/dist/esm/{chunk-QRS4DGP3.mjs → chunk-BF46IXHH.mjs} +2 -2
- package/dist/esm/chunk-BLVYB7Y3.mjs +2 -0
- package/dist/esm/chunk-BLVYB7Y3.mjs.map +1 -0
- package/dist/esm/{chunk-PF57EOJY.mjs → chunk-BOYYQAB4.mjs} +2 -2
- package/dist/esm/{chunk-RPND23OR.mjs → chunk-BS7EVBWX.mjs} +2 -2
- package/dist/esm/{chunk-JX75UKJX.mjs → chunk-BVB3QII3.mjs} +2 -2
- package/dist/esm/{chunk-KZZWY4YI.mjs → chunk-C5V4EBVP.mjs} +2 -2
- package/dist/esm/{chunk-3BNA74V5.mjs → chunk-CZ6TC4GO.mjs} +2 -2
- package/dist/esm/{chunk-2HF2XEHO.mjs → chunk-DLDGUTFV.mjs} +2 -2
- package/dist/esm/{chunk-YR7JRJ25.mjs → chunk-DPO352QL.mjs} +2 -2
- package/dist/esm/{chunk-GM56MMNJ.mjs → chunk-DW2KZREM.mjs} +2 -2
- package/dist/esm/chunk-DZXM2MQY.mjs +2 -0
- package/dist/esm/chunk-DZXM2MQY.mjs.map +1 -0
- package/dist/esm/{chunk-6YV3366Z.mjs → chunk-EAW6AWYD.mjs} +2 -2
- package/dist/esm/{chunk-NUK6JT5I.mjs → chunk-EYIJYUN7.mjs} +2 -2
- package/dist/esm/{chunk-AF5WNJOP.mjs → chunk-F74FF323.mjs} +2 -2
- package/dist/esm/chunk-FM6ALU5B.mjs +2 -0
- package/dist/esm/chunk-FM6ALU5B.mjs.map +1 -0
- package/dist/esm/{chunk-ISIUQQMV.mjs → chunk-FNFQA7NS.mjs} +2 -2
- package/dist/esm/chunk-FTIW5GGG.mjs +2 -0
- package/dist/esm/{chunk-BRVWHCP3.mjs.map → chunk-FTIW5GGG.mjs.map} +1 -1
- package/dist/esm/{chunk-G2XVNF2T.mjs → chunk-FYB7C42X.mjs} +2 -2
- package/dist/esm/chunk-GFRNBBTY.mjs +2 -0
- package/dist/esm/chunk-GFRNBBTY.mjs.map +1 -0
- package/dist/esm/{chunk-CEHCDA3G.mjs → chunk-H6YNXJNF.mjs} +2 -2
- package/dist/esm/{chunk-47IIBESV.mjs → chunk-HCN7YJGB.mjs} +2 -2
- package/dist/esm/chunk-HHE63GFW.mjs +2 -0
- package/dist/esm/chunk-HHE63GFW.mjs.map +1 -0
- package/dist/esm/{chunk-S3EDNXZE.mjs → chunk-HIHKTLLM.mjs} +20 -18
- package/dist/esm/chunk-HIHKTLLM.mjs.map +1 -0
- package/dist/esm/chunk-IVVWQKCF.mjs +2 -0
- package/dist/esm/chunk-IVVWQKCF.mjs.map +1 -0
- package/dist/esm/{chunk-53INTTOI.mjs → chunk-JPDT6E3B.mjs} +2 -2
- package/dist/esm/{chunk-J4VNDDKJ.mjs → chunk-JSWBLHMX.mjs} +2 -2
- package/dist/esm/{chunk-73QJNN7O.mjs → chunk-K4CTCBLY.mjs} +2 -2
- package/dist/esm/{chunk-AQAH67IV.mjs → chunk-K7DBDI2I.mjs} +2 -2
- package/dist/esm/{chunk-PIVZMT5D.mjs → chunk-L22R3OIW.mjs} +2 -2
- package/dist/esm/{chunk-4GWNWSZP.mjs → chunk-LVSOUCFD.mjs} +2 -2
- package/dist/esm/{chunk-AHW3SKT7.mjs → chunk-M3JHXCGV.mjs} +2 -2
- package/dist/esm/{chunk-ZRKXS7XG.mjs → chunk-MHZ64FIW.mjs} +2 -2
- package/dist/esm/{chunk-UGPALAPN.mjs → chunk-MLDQ2TY2.mjs} +2 -2
- package/dist/esm/chunk-MQGW234H.mjs +2 -0
- package/dist/esm/chunk-MQGW234H.mjs.map +1 -0
- package/dist/esm/chunk-NCUBVHUW.mjs +2 -0
- package/dist/esm/chunk-NCUBVHUW.mjs.map +1 -0
- package/dist/esm/chunk-NMD45OTM.mjs +2 -0
- package/dist/esm/chunk-NMD45OTM.mjs.map +1 -0
- package/dist/esm/{chunk-R5VVKRJ2.mjs → chunk-NNQYSSLH.mjs} +2 -2
- package/dist/esm/{chunk-CZOD4SCZ.mjs → chunk-NSQLZBCA.mjs} +2 -2
- package/dist/esm/{chunk-KAGLWBIJ.mjs → chunk-OPGMT27G.mjs} +2 -2
- package/dist/esm/{chunk-N3U47Y6Y.mjs → chunk-P5V7OZNN.mjs} +2 -2
- package/dist/esm/{chunk-337U6Q6K.mjs → chunk-PTA3VHTQ.mjs} +2 -2
- package/dist/esm/chunk-Q6LFIZ3L.mjs +2 -0
- package/dist/esm/chunk-Q6LFIZ3L.mjs.map +1 -0
- package/dist/esm/chunk-QAMV4L3K.mjs +2 -0
- package/dist/esm/chunk-QAMV4L3K.mjs.map +1 -0
- package/dist/esm/{chunk-BEVXJJJF.mjs → chunk-QL2QFRKV.mjs} +2 -2
- package/dist/esm/chunk-QVWBJJRF.mjs +2 -0
- package/dist/esm/chunk-QVWBJJRF.mjs.map +1 -0
- package/dist/esm/{chunk-U3YYSIIT.mjs → chunk-RFA7BIDN.mjs} +2 -2
- package/dist/esm/{chunk-G56GPLTB.mjs → chunk-RJ4RKVVQ.mjs} +2 -2
- package/dist/esm/{chunk-BBVIJO6X.mjs → chunk-S32JHML7.mjs} +2 -2
- package/dist/esm/chunk-SCHZ67F3.mjs +2 -0
- package/dist/esm/chunk-SCHZ67F3.mjs.map +1 -0
- package/dist/esm/chunk-SFUTXSDK.mjs +2 -0
- package/dist/esm/chunk-SFUTXSDK.mjs.map +1 -0
- package/dist/esm/{chunk-3SPIFLBZ.mjs → chunk-SLFAROVZ.mjs} +2 -2
- package/dist/esm/{chunk-CT2BQQTZ.mjs → chunk-TG2LLWVU.mjs} +2 -2
- package/dist/esm/{chunk-35EWRSDK.mjs → chunk-TY4IEDJD.mjs} +2 -2
- package/dist/esm/chunk-U4A56FN2.mjs +2 -0
- package/dist/esm/{chunk-7UBKXR37.mjs.map → chunk-U4A56FN2.mjs.map} +1 -1
- package/dist/esm/chunk-U6X2FYNI.mjs +2 -0
- package/dist/esm/chunk-U6X2FYNI.mjs.map +1 -0
- package/dist/esm/{chunk-G2UPF44Z.mjs → chunk-UAZUO75M.mjs} +2 -2
- package/dist/esm/{chunk-HLC4HAYY.mjs → chunk-UGVNOSD3.mjs} +2 -2
- package/dist/esm/{chunk-LGNSPATO.mjs → chunk-VCMP3MXN.mjs} +2 -2
- package/dist/esm/{chunk-PZ4SAXY7.mjs → chunk-VTKPSYKA.mjs} +2 -2
- package/dist/esm/chunk-VTKPSYKA.mjs.map +1 -0
- package/dist/esm/chunk-WQHW4WQN.mjs +2 -0
- package/dist/esm/chunk-WQHW4WQN.mjs.map +1 -0
- package/dist/esm/chunk-WV5AD4IE.mjs +2 -0
- package/dist/esm/{chunk-CE65OKFI.mjs → chunk-XWVU4G57.mjs} +2 -2
- package/dist/esm/{chunk-ZHCSSCC5.mjs → chunk-XYLM277Z.mjs} +2 -2
- package/dist/esm/chunk-YE5B2S5L.mjs +2 -0
- package/dist/esm/chunk-YE5B2S5L.mjs.map +1 -0
- package/dist/esm/{chunk-FAFJKSVZ.mjs → chunk-YMUCYX3B.mjs} +2 -2
- package/dist/esm/{chunk-SRDIYE3M.mjs → chunk-YPHH6CAO.mjs} +2 -2
- package/dist/esm/chunk-YTQVMLFD.mjs +2 -0
- package/dist/esm/chunk-YTQVMLFD.mjs.map +1 -0
- package/dist/esm/{chunk-B7X6PSE7.mjs → chunk-YUNDX5I7.mjs} +2 -2
- package/dist/esm/chunk-Z4YHE4A5.mjs +2 -0
- package/dist/esm/{chunk-4BJA3QUQ.mjs.map → chunk-Z4YHE4A5.mjs.map} +1 -1
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/localNode.mjs +1 -1
- package/dist/esm/cli/move.mjs +1 -1
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +8 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +2 -2
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.d.mts +9 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account/index.mjs +1 -1
- package/dist/esm/core/account/utils/address.mjs +1 -1
- package/dist/esm/core/account/utils/index.mjs +1 -1
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.d.mts +73 -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/index.d.mts +6 -0
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.d.mts +321 -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.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/poseidon.d.mts +19 -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/proof.d.mts +21 -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.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/index.d.mts +6 -0
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +11 -4
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.d.mts +72 -0
- package/dist/esm/internal/keyless.mjs +2 -0
- package/dist/esm/internal/keyless.mjs.map +1 -0
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +3 -0
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/types/generated/operations.d.mts +14 -12
- package/dist/esm/types/generated/queries.d.mts +4 -4
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/generated/types.d.mts +20 -2
- package/dist/esm/types/generated/types.mjs +1 -1
- package/dist/esm/types/generated/types.mjs.map +1 -1
- package/dist/esm/types/index.d.mts +21 -5
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/keyless.d.mts +51 -0
- package/dist/esm/types/keyless.mjs +1 -0
- package/dist/esm/types/keyless.mjs.map +1 -0
- package/dist/esm/utils/apiEndpoints.d.mts +3 -1
- package/dist/esm/utils/apiEndpoints.mjs +1 -1
- package/dist/esm/utils/const.d.mts +3 -1
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/helpers.d.mts +4 -1
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.d.mts +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +9 -3
- package/src/account/EphemeralKeyPair.ts +150 -0
- package/src/account/KeylessAccount.ts +370 -0
- package/src/account/MultiKeyAccount.ts +12 -0
- package/src/account/index.ts +2 -0
- package/src/api/aptos.ts +6 -0
- package/src/api/aptosConfig.ts +46 -1
- package/src/api/keyless.ts +78 -0
- package/src/bcs/deserializer.ts +40 -0
- package/src/bcs/serializer.ts +57 -0
- package/src/cli/move.ts +4 -7
- package/src/client/core.ts +4 -0
- package/src/client/get.ts +12 -0
- package/src/client/post.ts +18 -0
- package/src/core/crypto/ephemeral.ts +138 -0
- package/src/core/crypto/index.ts +2 -0
- package/src/core/crypto/keyless.ts +679 -0
- package/src/core/crypto/poseidon.ts +144 -0
- package/src/core/crypto/proof.ts +16 -0
- package/src/core/crypto/singleKey.ts +11 -0
- package/src/internal/keyless.ts +129 -0
- package/src/internal/queries/getFungibleAssetMetadata.graphql +2 -0
- package/src/internal/transactionSubmission.ts +6 -1
- package/src/transactions/management/accountSequenceNumber.ts +5 -8
- package/src/transactions/transactionBuilder/signingMessage.ts +3 -0
- package/src/transactions/transactionBuilder/transactionBuilder.ts +16 -1
- package/src/types/generated/operations.ts +14 -12
- package/src/types/generated/queries.ts +30 -3
- package/src/types/generated/types.ts +20 -2
- package/src/types/index.ts +24 -2
- package/src/types/keyless.ts +42 -0
- package/src/utils/apiEndpoints.ts +16 -0
- package/src/utils/const.ts +2 -0
- package/src/utils/helpers.ts +22 -0
- package/src/version.ts +1 -1
- package/dist/common/chunk-KSEUZTKY.js +0 -2
- package/dist/common/chunk-KSEUZTKY.js.map +0 -1
- package/dist/esm/chunk-3JPVQHOR.mjs +0 -2
- package/dist/esm/chunk-3JPVQHOR.mjs.map +0 -1
- package/dist/esm/chunk-4BJA3QUQ.mjs +0 -2
- package/dist/esm/chunk-6IFMQ5AS.mjs +0 -2
- package/dist/esm/chunk-6IFMQ5AS.mjs.map +0 -1
- package/dist/esm/chunk-746MU2AB.mjs +0 -2
- package/dist/esm/chunk-746MU2AB.mjs.map +0 -1
- package/dist/esm/chunk-7UBKXR37.mjs +0 -2
- package/dist/esm/chunk-BRVWHCP3.mjs +0 -2
- package/dist/esm/chunk-CYNQRMO5.mjs +0 -2
- package/dist/esm/chunk-CYNQRMO5.mjs.map +0 -1
- package/dist/esm/chunk-D2LNQMKD.mjs +0 -2
- package/dist/esm/chunk-D2LNQMKD.mjs.map +0 -1
- package/dist/esm/chunk-DLAIJ2UM.mjs +0 -2
- package/dist/esm/chunk-DLAIJ2UM.mjs.map +0 -1
- package/dist/esm/chunk-HYCGMFC2.mjs +0 -2
- package/dist/esm/chunk-HYCGMFC2.mjs.map +0 -1
- package/dist/esm/chunk-IENCDVPF.mjs +0 -2
- package/dist/esm/chunk-IENCDVPF.mjs.map +0 -1
- package/dist/esm/chunk-MM5VMKFE.mjs +0 -2
- package/dist/esm/chunk-MM5VMKFE.mjs.map +0 -1
- package/dist/esm/chunk-OWW6SIDP.mjs +0 -2
- package/dist/esm/chunk-OWW6SIDP.mjs.map +0 -1
- package/dist/esm/chunk-PZ4SAXY7.mjs.map +0 -1
- package/dist/esm/chunk-ROXFCLDT.mjs +0 -2
- package/dist/esm/chunk-RTSWVT2Q.mjs +0 -2
- package/dist/esm/chunk-RTSWVT2Q.mjs.map +0 -1
- package/dist/esm/chunk-S3EDNXZE.mjs.map +0 -1
- package/dist/esm/chunk-SUAMDMAA.mjs +0 -2
- package/dist/esm/chunk-UO3NZ5AH.mjs +0 -1
- package/dist/esm/chunk-UTKM2WYS.mjs +0 -2
- package/dist/esm/chunk-UTKM2WYS.mjs.map +0 -1
- package/dist/esm/chunk-UVSRX4SV.mjs +0 -1
- package/dist/esm/chunk-W33BZ6IQ.mjs +0 -2
- package/dist/esm/chunk-W33BZ6IQ.mjs.map +0 -1
- /package/dist/esm/{chunk-UO3NZ5AH.mjs.map → account/EphemeralKeyPair.mjs.map} +0 -0
- /package/dist/esm/{chunk-UVSRX4SV.mjs.map → account/KeylessAccount.mjs.map} +0 -0
- /package/dist/esm/{chunk-TQLED4KC.mjs.map → chunk-2DSPX6BX.mjs.map} +0 -0
- /package/dist/esm/{chunk-RWXHA4QZ.mjs.map → chunk-3VUSIKCF.mjs.map} +0 -0
- /package/dist/esm/{chunk-MCRRHBFQ.mjs.map → chunk-4EPLOSKY.mjs.map} +0 -0
- /package/dist/esm/{chunk-BSVNV6SJ.mjs.map → chunk-4IBJW3PB.mjs.map} +0 -0
- /package/dist/esm/{chunk-J6HKAEKY.mjs.map → chunk-5X2BJDOB.mjs.map} +0 -0
- /package/dist/esm/{chunk-5UKBTF7N.mjs.map → chunk-5YHI7WOB.mjs.map} +0 -0
- /package/dist/esm/{chunk-J5I4OZAS.mjs.map → chunk-6DYDZSEW.mjs.map} +0 -0
- /package/dist/esm/{chunk-J4Z6XR5D.mjs.map → chunk-6JL2U7JB.mjs.map} +0 -0
- /package/dist/esm/{chunk-RNL5TAQT.mjs.map → chunk-6UDHM6YZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-2X7A4HUS.mjs.map → chunk-6ZQWPHLV.mjs.map} +0 -0
- /package/dist/esm/{chunk-4NHWV5AI.mjs.map → chunk-76OH2Z4Q.mjs.map} +0 -0
- /package/dist/esm/{chunk-5EN52MUT.mjs.map → chunk-77NXCSLY.mjs.map} +0 -0
- /package/dist/esm/{chunk-ND6OMSQU.mjs.map → chunk-7Y45UTRL.mjs.map} +0 -0
- /package/dist/esm/{chunk-T2AGN5YT.mjs.map → chunk-A2Z7I2EY.mjs.map} +0 -0
- /package/dist/esm/{chunk-3XFID2N4.mjs.map → chunk-AVH5SYTL.mjs.map} +0 -0
- /package/dist/esm/{chunk-3N6N3KOS.mjs.map → chunk-AYKZA676.mjs.map} +0 -0
- /package/dist/esm/{chunk-QRS4DGP3.mjs.map → chunk-BF46IXHH.mjs.map} +0 -0
- /package/dist/esm/{chunk-PF57EOJY.mjs.map → chunk-BOYYQAB4.mjs.map} +0 -0
- /package/dist/esm/{chunk-RPND23OR.mjs.map → chunk-BS7EVBWX.mjs.map} +0 -0
- /package/dist/esm/{chunk-JX75UKJX.mjs.map → chunk-BVB3QII3.mjs.map} +0 -0
- /package/dist/esm/{chunk-KZZWY4YI.mjs.map → chunk-C5V4EBVP.mjs.map} +0 -0
- /package/dist/esm/{chunk-3BNA74V5.mjs.map → chunk-CZ6TC4GO.mjs.map} +0 -0
- /package/dist/esm/{chunk-2HF2XEHO.mjs.map → chunk-DLDGUTFV.mjs.map} +0 -0
- /package/dist/esm/{chunk-YR7JRJ25.mjs.map → chunk-DPO352QL.mjs.map} +0 -0
- /package/dist/esm/{chunk-GM56MMNJ.mjs.map → chunk-DW2KZREM.mjs.map} +0 -0
- /package/dist/esm/{chunk-6YV3366Z.mjs.map → chunk-EAW6AWYD.mjs.map} +0 -0
- /package/dist/esm/{chunk-NUK6JT5I.mjs.map → chunk-EYIJYUN7.mjs.map} +0 -0
- /package/dist/esm/{chunk-AF5WNJOP.mjs.map → chunk-F74FF323.mjs.map} +0 -0
- /package/dist/esm/{chunk-ISIUQQMV.mjs.map → chunk-FNFQA7NS.mjs.map} +0 -0
- /package/dist/esm/{chunk-G2XVNF2T.mjs.map → chunk-FYB7C42X.mjs.map} +0 -0
- /package/dist/esm/{chunk-CEHCDA3G.mjs.map → chunk-H6YNXJNF.mjs.map} +0 -0
- /package/dist/esm/{chunk-47IIBESV.mjs.map → chunk-HCN7YJGB.mjs.map} +0 -0
- /package/dist/esm/{chunk-53INTTOI.mjs.map → chunk-JPDT6E3B.mjs.map} +0 -0
- /package/dist/esm/{chunk-J4VNDDKJ.mjs.map → chunk-JSWBLHMX.mjs.map} +0 -0
- /package/dist/esm/{chunk-73QJNN7O.mjs.map → chunk-K4CTCBLY.mjs.map} +0 -0
- /package/dist/esm/{chunk-AQAH67IV.mjs.map → chunk-K7DBDI2I.mjs.map} +0 -0
- /package/dist/esm/{chunk-PIVZMT5D.mjs.map → chunk-L22R3OIW.mjs.map} +0 -0
- /package/dist/esm/{chunk-4GWNWSZP.mjs.map → chunk-LVSOUCFD.mjs.map} +0 -0
- /package/dist/esm/{chunk-AHW3SKT7.mjs.map → chunk-M3JHXCGV.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZRKXS7XG.mjs.map → chunk-MHZ64FIW.mjs.map} +0 -0
- /package/dist/esm/{chunk-UGPALAPN.mjs.map → chunk-MLDQ2TY2.mjs.map} +0 -0
- /package/dist/esm/{chunk-R5VVKRJ2.mjs.map → chunk-NNQYSSLH.mjs.map} +0 -0
- /package/dist/esm/{chunk-CZOD4SCZ.mjs.map → chunk-NSQLZBCA.mjs.map} +0 -0
- /package/dist/esm/{chunk-KAGLWBIJ.mjs.map → chunk-OPGMT27G.mjs.map} +0 -0
- /package/dist/esm/{chunk-N3U47Y6Y.mjs.map → chunk-P5V7OZNN.mjs.map} +0 -0
- /package/dist/esm/{chunk-337U6Q6K.mjs.map → chunk-PTA3VHTQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-BEVXJJJF.mjs.map → chunk-QL2QFRKV.mjs.map} +0 -0
- /package/dist/esm/{chunk-U3YYSIIT.mjs.map → chunk-RFA7BIDN.mjs.map} +0 -0
- /package/dist/esm/{chunk-G56GPLTB.mjs.map → chunk-RJ4RKVVQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-BBVIJO6X.mjs.map → chunk-S32JHML7.mjs.map} +0 -0
- /package/dist/esm/{chunk-3SPIFLBZ.mjs.map → chunk-SLFAROVZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-CT2BQQTZ.mjs.map → chunk-TG2LLWVU.mjs.map} +0 -0
- /package/dist/esm/{chunk-35EWRSDK.mjs.map → chunk-TY4IEDJD.mjs.map} +0 -0
- /package/dist/esm/{chunk-G2UPF44Z.mjs.map → chunk-UAZUO75M.mjs.map} +0 -0
- /package/dist/esm/{chunk-HLC4HAYY.mjs.map → chunk-UGVNOSD3.mjs.map} +0 -0
- /package/dist/esm/{chunk-LGNSPATO.mjs.map → chunk-VCMP3MXN.mjs.map} +0 -0
- /package/dist/esm/{chunk-ROXFCLDT.mjs.map → chunk-WV5AD4IE.mjs.map} +0 -0
- /package/dist/esm/{chunk-CE65OKFI.mjs.map → chunk-XWVU4G57.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZHCSSCC5.mjs.map → chunk-XYLM277Z.mjs.map} +0 -0
- /package/dist/esm/{chunk-FAFJKSVZ.mjs.map → chunk-YMUCYX3B.mjs.map} +0 -0
- /package/dist/esm/{chunk-SRDIYE3M.mjs.map → chunk-YPHH6CAO.mjs.map} +0 -0
- /package/dist/esm/{chunk-B7X6PSE7.mjs.map → chunk-YUNDX5I7.mjs.map} +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare const NetworkToIndexerAPI: Record<string, string>;
|
|
2
2
|
declare const NetworkToNodeAPI: Record<string, string>;
|
|
3
3
|
declare const NetworkToFaucetAPI: Record<string, string>;
|
|
4
|
+
declare const NetworkToPepperAPI: Record<string, string>;
|
|
5
|
+
declare const NetworkToProverAPI: Record<string, string>;
|
|
4
6
|
declare enum Network {
|
|
5
7
|
MAINNET = "mainnet",
|
|
6
8
|
TESTNET = "testnet",
|
|
@@ -99,13 +101,13 @@ type GetAccountOwnedTokensQuery = {
|
|
|
99
101
|
last_transaction_timestamp: any;
|
|
100
102
|
last_transaction_version: any;
|
|
101
103
|
maximum?: any | null;
|
|
102
|
-
supply
|
|
104
|
+
supply?: any | null;
|
|
103
105
|
token_data_id: string;
|
|
104
106
|
token_name: string;
|
|
105
107
|
token_properties: any;
|
|
106
108
|
token_standard: string;
|
|
107
109
|
token_uri: string;
|
|
108
|
-
decimals
|
|
110
|
+
decimals?: any | null;
|
|
109
111
|
current_collection?: {
|
|
110
112
|
collection_id: string;
|
|
111
113
|
collection_name: string;
|
|
@@ -147,13 +149,13 @@ type GetAccountOwnedTokensFromCollectionQuery = {
|
|
|
147
149
|
last_transaction_timestamp: any;
|
|
148
150
|
last_transaction_version: any;
|
|
149
151
|
maximum?: any | null;
|
|
150
|
-
supply
|
|
152
|
+
supply?: any | null;
|
|
151
153
|
token_data_id: string;
|
|
152
154
|
token_name: string;
|
|
153
155
|
token_properties: any;
|
|
154
156
|
token_standard: string;
|
|
155
157
|
token_uri: string;
|
|
156
|
-
decimals
|
|
158
|
+
decimals?: any | null;
|
|
157
159
|
current_collection?: {
|
|
158
160
|
collection_id: string;
|
|
159
161
|
collection_name: string;
|
|
@@ -266,6 +268,8 @@ type GetFungibleAssetMetadataQuery = {
|
|
|
266
268
|
name: string;
|
|
267
269
|
symbol: string;
|
|
268
270
|
token_standard: string;
|
|
271
|
+
supply_v2?: any | null;
|
|
272
|
+
maximum_v2?: any | null;
|
|
269
273
|
}>;
|
|
270
274
|
};
|
|
271
275
|
type GetNamesQuery = {
|
|
@@ -350,13 +354,13 @@ type GetCurrentTokenOwnershipQuery = {
|
|
|
350
354
|
last_transaction_timestamp: any;
|
|
351
355
|
last_transaction_version: any;
|
|
352
356
|
maximum?: any | null;
|
|
353
|
-
supply
|
|
357
|
+
supply?: any | null;
|
|
354
358
|
token_data_id: string;
|
|
355
359
|
token_name: string;
|
|
356
360
|
token_properties: any;
|
|
357
361
|
token_standard: string;
|
|
358
362
|
token_uri: string;
|
|
359
|
-
decimals
|
|
363
|
+
decimals?: any | null;
|
|
360
364
|
current_collection?: {
|
|
361
365
|
collection_id: string;
|
|
362
366
|
collection_name: string;
|
|
@@ -385,13 +389,13 @@ type GetTokenDataQuery = {
|
|
|
385
389
|
last_transaction_timestamp: any;
|
|
386
390
|
last_transaction_version: any;
|
|
387
391
|
maximum?: any | null;
|
|
388
|
-
supply
|
|
392
|
+
supply?: any | null;
|
|
389
393
|
token_data_id: string;
|
|
390
394
|
token_name: string;
|
|
391
395
|
token_properties: any;
|
|
392
396
|
token_standard: string;
|
|
393
397
|
token_uri: string;
|
|
394
|
-
decimals
|
|
398
|
+
decimals?: any | null;
|
|
395
399
|
current_collection?: {
|
|
396
400
|
collection_id: string;
|
|
397
401
|
collection_name: string;
|
|
@@ -565,11 +569,25 @@ declare enum AccountAuthenticatorVariant {
|
|
|
565
569
|
}
|
|
566
570
|
declare enum AnyPublicKeyVariant {
|
|
567
571
|
Ed25519 = 0,
|
|
568
|
-
Secp256k1 = 1
|
|
572
|
+
Secp256k1 = 1,
|
|
573
|
+
Keyless = 3
|
|
569
574
|
}
|
|
570
575
|
declare enum AnySignatureVariant {
|
|
571
576
|
Ed25519 = 0,
|
|
572
|
-
Secp256k1 = 1
|
|
577
|
+
Secp256k1 = 1,
|
|
578
|
+
Keyless = 3
|
|
579
|
+
}
|
|
580
|
+
declare enum EphemeralPublicKeyVariant {
|
|
581
|
+
Ed25519 = 0
|
|
582
|
+
}
|
|
583
|
+
declare enum EphemeralSignatureVariant {
|
|
584
|
+
Ed25519 = 0
|
|
585
|
+
}
|
|
586
|
+
declare enum EphemeralCertificateVariant {
|
|
587
|
+
ZkProof = 0
|
|
588
|
+
}
|
|
589
|
+
declare enum ZkpVariant {
|
|
590
|
+
Groth16 = 0
|
|
573
591
|
}
|
|
574
592
|
/**
|
|
575
593
|
* BCS types
|
|
@@ -591,6 +609,8 @@ type AptosSettings = {
|
|
|
591
609
|
readonly fullnode?: string;
|
|
592
610
|
readonly faucet?: string;
|
|
593
611
|
readonly indexer?: string;
|
|
612
|
+
readonly pepper?: string;
|
|
613
|
+
readonly prover?: string;
|
|
594
614
|
readonly clientConfig?: ClientConfig;
|
|
595
615
|
readonly client?: Client;
|
|
596
616
|
readonly fullnodeConfig?: FullNodeConfig;
|
|
@@ -729,9 +749,9 @@ type GasEstimation = {
|
|
|
729
749
|
*/
|
|
730
750
|
prioritized_gas_estimate?: number;
|
|
731
751
|
};
|
|
732
|
-
type MoveResource = {
|
|
752
|
+
type MoveResource<T = {}> = {
|
|
733
753
|
type: MoveStructId;
|
|
734
|
-
data:
|
|
754
|
+
data: T;
|
|
735
755
|
};
|
|
736
756
|
type AccountData = {
|
|
737
757
|
sequence_number: string;
|
|
@@ -1431,6 +1451,38 @@ declare class Deserializer {
|
|
|
1431
1451
|
* ```
|
|
1432
1452
|
*/
|
|
1433
1453
|
deserializeStr(): string;
|
|
1454
|
+
/**
|
|
1455
|
+
* Deserializes a an optional string.
|
|
1456
|
+
*
|
|
1457
|
+
* BCS layout for Optional<String>: 0 if none, else 1 | string_length | string_content
|
|
1458
|
+
* @example
|
|
1459
|
+
* ```ts
|
|
1460
|
+
* const deserializer = new Deserializer(new Uint8Array([0x00]));
|
|
1461
|
+
* assert(deserializer.deserializeOptionStr() === undefined);
|
|
1462
|
+
* const deserializer = new Deserializer(new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));
|
|
1463
|
+
* assert(deserializer.deserializeOptionStr() === "1234abcd");
|
|
1464
|
+
* ```
|
|
1465
|
+
*/
|
|
1466
|
+
deserializeOptionStr(): string | undefined;
|
|
1467
|
+
/**
|
|
1468
|
+
* Deserializes a an optional deserializable class.
|
|
1469
|
+
*
|
|
1470
|
+
* BCS layout for Optional<T>: 0 if none, else 1 | bcs representation of class
|
|
1471
|
+
*
|
|
1472
|
+
* @example
|
|
1473
|
+
* const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));
|
|
1474
|
+
* const value = deserializer.deserializeOption(MyClass); // where MyClass has a `deserialize` function
|
|
1475
|
+
* // value is now an instance of MyClass
|
|
1476
|
+
*
|
|
1477
|
+
* const deserializer = new Deserializer(new Uint8Array([0]));
|
|
1478
|
+
* const value = deserializer.deserializeOption(MyClass); // where MyClass has a `deserialize` function
|
|
1479
|
+
* // value is undefined
|
|
1480
|
+
*
|
|
1481
|
+
* @param cls The BCS-deserializable class to deserialize the buffered bytes into.
|
|
1482
|
+
*
|
|
1483
|
+
* @returns the deserialized value of class type T
|
|
1484
|
+
*/
|
|
1485
|
+
deserializeOption<T>(cls: Deserializable<T>): T | undefined;
|
|
1434
1486
|
/**
|
|
1435
1487
|
* Deserializes an array of bytes.
|
|
1436
1488
|
*
|
|
@@ -1852,6 +1904,48 @@ declare class Serializer {
|
|
|
1852
1904
|
* // `bcs::to_bytes(&vector<address> [@0x1, @0x2, @0xa, @0xb])`;
|
|
1853
1905
|
*/
|
|
1854
1906
|
serializeVector<T extends Serializable>(values: Array<T>): void;
|
|
1907
|
+
/**
|
|
1908
|
+
* Serializes a BCS Serializable values into a serializer instance or undefined.
|
|
1909
|
+
* Note that this does not return anything. The bytes are added to the serializer instance's byte buffer.
|
|
1910
|
+
*
|
|
1911
|
+
* @param values The array of BCS Serializable values
|
|
1912
|
+
*
|
|
1913
|
+
* @example
|
|
1914
|
+
* ```ts
|
|
1915
|
+
* const serializer = new Serializer();
|
|
1916
|
+
* serializer.serializeOption(new AccountAddress(...));
|
|
1917
|
+
* const serializedBytes = serializer.toUint8Array();
|
|
1918
|
+
* // serializedBytes is now the BCS-serialized byte representation of AccountAddress
|
|
1919
|
+
*
|
|
1920
|
+
* const serializer = new Serializer();
|
|
1921
|
+
* serializer.serializeOption(undefined);
|
|
1922
|
+
* assert(serializer.toUint8Array() === new Uint8Array([0x00]));
|
|
1923
|
+
* ```
|
|
1924
|
+
*/
|
|
1925
|
+
serializeOption<T extends Serializable>(value?: T): void;
|
|
1926
|
+
/**
|
|
1927
|
+
* Serializes an optional string. UTF8 string is supported.
|
|
1928
|
+
*
|
|
1929
|
+
* The existence of the string is encoded first, 0 if undefined and 1 if it exists.
|
|
1930
|
+
* Them the number of bytes in the string content is serialized, as a uleb128-encoded u32 integer.
|
|
1931
|
+
* Then the string content is serialized as UTF8 encoded bytes.
|
|
1932
|
+
*
|
|
1933
|
+
* BCS layout for optional "string": 1 | string_length | string_content
|
|
1934
|
+
* where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.
|
|
1935
|
+
*
|
|
1936
|
+
* BCS layout for undefined: 0
|
|
1937
|
+
* @example
|
|
1938
|
+
* ```ts
|
|
1939
|
+
* const serializer = new Serializer();
|
|
1940
|
+
* serializer.serializeOptionStr("1234abcd");
|
|
1941
|
+
* assert(serializer.toUint8Array() === new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));
|
|
1942
|
+
*
|
|
1943
|
+
* const serializer = new Serializer();
|
|
1944
|
+
* serializer.serializeOptionStr(undefined);
|
|
1945
|
+
* assert(serializer.toUint8Array() === new Uint8Array([0]));
|
|
1946
|
+
* ```
|
|
1947
|
+
*/
|
|
1948
|
+
serializeOptionStr(value?: string): void;
|
|
1855
1949
|
}
|
|
1856
1950
|
declare function ensureBoolean(value: unknown): asserts value is boolean;
|
|
1857
1951
|
declare const outOfRangeErrorMessage: (value: AnyNumber, min: AnyNumber, max: AnyNumber) => string;
|
|
@@ -2119,4 +2213,4 @@ declare class AccountAddress extends Serializable implements TransactionArgument
|
|
|
2119
2213
|
equals(other: AccountAddress): boolean;
|
|
2120
2214
|
}
|
|
2121
2215
|
|
|
2122
|
-
export { type
|
|
2216
|
+
export { type WaitForTransactionOptions as $, type AnyNumber as A, type GetAccountCollectionsWithOwnedTokenResponse as B, type Client as C, Deserializer as D, type EntryFunctionArgument as E, type FullNodeConfig as F, type GetAccountOwnedTokensQueryResponse as G, type HexInput as H, type IndexerConfig as I, type GetAccountCoinsDataResponse as J, type GetAccountOwnedObjectsResponse as K, type LedgerVersionArg as L, type MoveModuleId as M, Network as N, type OrderByArg as O, type PaginationArgs as P, type GetCollectionDataResponse as Q, type GetTokenDataResponse as R, Serializable as S, type TransactionArgument as T, type Uint8 as U, type GetCurrentTokenOwnershipResponse as V, type WhereArg as W, type GetOwnedTokensResponse as X, type GetTokenActivityResponse as Y, ZkpVariant as Z, type GetEventsResponse as _, Serializer as a, type TransactionPayloadResponse as a$, type UserTransactionResponse as a0, type MoveFunction as a1, type GetFungibleAssetMetadataResponse as a2, type GetFungibleAssetActivitiesResponse as a3, type GetCurrentFungibleAssetBalancesResponse as a4, type LedgerInfo as a5, type Block as a6, type MoveValue as a7, type GetChainTopUserTransactionsResponse as a8, type GraphqlQuery as a9, AccountAuthenticatorVariant as aA, AnySignatureVariant as aB, EphemeralSignatureVariant as aC, type Uint64 as aD, type Uint128 as aE, type Uint256 as aF, type ClientHeadersType as aG, TransactionResponseType as aH, isPendingTransactionResponse as aI, isUserTransactionResponse as aJ, isGenesisTransactionResponse as aK, isBlockMetadataTransactionResponse as aL, isStateCheckpointTransactionResponse as aM, isValidatorTransactionResponse as aN, type GenesisTransactionResponse as aO, type BlockMetadataTransactionResponse as aP, type StateCheckpointTransactionResponse as aQ, type ValidatorTransactionResponse as aR, type WriteSetChange as aS, type WriteSetChangeDeleteModule as aT, type WriteSetChangeDeleteResource as aU, type WriteSetChangeDeleteTableItem as aV, type WriteSetChangeWriteModule as aW, type WriteSetChangeWriteResource as aX, type WriteSetChangeWriteTableItem as aY, type DecodedTableData as aZ, type DeletedTableData as a_, type GetProcessorStatusResponse as aa, type GetANSNameResponse as ab, type GetNumberOfDelegatorsResponse as ac, type GetDelegatedStakingActivitiesResponse as ad, type PendingTransactionResponse as ae, type CommittedTransactionResponse as af, type GasEstimation as ag, type TableItemRequest as ah, type GetTableItemsDataResponse as ai, type GetTableItemsMetadataResponse as aj, type AptosRequest as ak, type ClientRequest as al, type ClientResponse as am, MimeType as an, ensureBoolean as ao, outOfRangeErrorMessage as ap, validateNumberInRange as aq, AddressInvalidReason as ar, ParsingError as as, type ParsingResult as at, HexInvalidReason as au, TypeTagVariants as av, ScriptTransactionArgumentVariants as aw, TransactionPayloadVariants as ax, TransactionVariants as ay, TransactionAuthenticatorVariant as az, type Uint16 as b, type EntryFunctionPayloadResponse as b0, type ScriptPayloadResponse as b1, type MultisigPayloadResponse as b2, type GenesisPayload as b3, type MoveScriptBytecode as b4, type TransactionSignature as b5, isEd25519Signature as b6, isSecp256k1Signature as b7, isMultiAgentSignature as b8, isFeePayerSignature as b9, type MoveModule as bA, type MoveStruct as bB, RoleType as bC, DeriveScheme as bD, type GenerateAccountWithEd25519 as bE, type GenerateAccountWithSingleSignerSecp256k1Key as bF, type GenerateAccount as bG, type OrderBy as bH, type OrderByValue as bI, type TokenStandard as bJ, NetworkToIndexerAPI as bK, NetworkToNodeAPI as bL, NetworkToFaucetAPI as bM, NetworkToPepperAPI as bN, NetworkToProverAPI as bO, NetworkToChainId as bP, NetworkToNetworkName as bQ, isMultiEd25519Signature as ba, type TransactionEd25519Signature as bb, type TransactionSecp256k1Signature as bc, type TransactionMultiEd25519Signature as bd, type TransactionMultiAgentSignature as be, type TransactionFeePayerSignature as bf, type AccountSignature as bg, type WriteSet as bh, type ScriptWriteSet as bi, type DirectWriteSet as bj, type EventGuid as bk, type Event as bl, type MoveUint8Type as bm, type MoveUint16Type as bn, type MoveUint32Type as bo, type MoveUint64Type as bp, type MoveUint128Type as bq, type MoveUint256Type as br, type MoveAddressType as bs, type MoveObjectType as bt, type MoveOptionType as bu, type MoveStructType as bv, type MoveType as bw, MoveFunctionVisibility as bx, MoveAbility as by, type MoveStructField as bz, type Uint32 as c, type Deserializable as d, Hex as e, type AuthenticationKeyScheme as f, AccountAddress as g, AnyPublicKeyVariant as h, EphemeralPublicKeyVariant as i, type ClientConfig as j, type FaucetConfig as k, type AptosSettings as l, EphemeralCertificateVariant as m, type ScriptFunctionArgument as n, type MoveFunctionId as o, type AccountAddressInput as p, type MoveFunctionGenericTypeParam as q, SigningSchemeInput as r, SigningScheme as s, type AccountData as t, type MoveModuleBytecode as u, type TransactionResponse as v, type MoveResource as w, type MoveStructId as x, type TokenStandardArg as y, type GetAccountOwnedTokensFromCollectionResponse as z };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var d=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var l=(o,e,t,r)=>{for(var n=r>1?void 0:r?i(e,t):e,s=o.length-1,c;s>=0;s--)(c=o[s])&&(n=(r?c(e,t,n):c(n))||n);return r&&n&&d(e,t,n),n};var _jsbase64 = require('js-base64');async function m(o){return new Promise(e=>{setTimeout(e,o)})}var p=()=>Math.floor(Date.now()/1e3);function f(o){let e=new Date(o*1e3);return e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),Math.floor(e.getTime()/1e3)}function b(o){let e=o.replace(/-/g,"+").replace(/_/g,"/"),t=e+"==".substring(0,(3-e.length%3)%3);return _jsbase64.decode.call(void 0, t)}exports.a = l; exports.b = m; exports.c = p; exports.d = f; exports.e = b;
|
|
2
|
+
//# sourceMappingURL=chunk-BHKSQXUZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/helpers.ts"],"names":["decode","sleep","timeMs","resolve","nowInSeconds","floorToWholeHour","timestampInSeconds","date","base64UrlDecode","base64Url","base64","paddedBase64"],"mappings":"wMAGA,OAAS,UAAAA,MAAc,YAMvB,eAAsBC,EAAMC,EAA+B,CACzD,OAAO,IAAI,QAASC,GAAY,CAC9B,WAAWA,EAASD,CAAM,CAC5B,CAAC,CACH,CAEO,IAAME,EAAe,IAAM,KAAK,MAAM,KAAK,IAAI,EAAI,GAAI,EAEvD,SAASC,EAAiBC,EAAoC,CACnE,IAAMC,EAAO,IAAI,KAAKD,EAAqB,GAAI,EAE/C,OAAAC,EAAK,WAAW,CAAC,EACjBA,EAAK,WAAW,CAAC,EACjBA,EAAK,gBAAgB,CAAC,EACf,KAAK,MAAMA,EAAK,QAAQ,EAAI,GAAI,CACzC,CAEO,SAASC,EAAgBC,EAA2B,CAEzD,IAAMC,EAASD,EAAU,QAAQ,KAAM,GAAG,EAAE,QAAQ,KAAM,GAAG,EAEvDE,EAAeD,EAAS,KAAK,UAAU,GAAI,EAAKA,EAAO,OAAS,GAAM,CAAC,EAE7E,OADsBV,EAAOW,CAAY,CAE3C","sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { decode } from \"js-base64\";\n\n/**\n * Sleep the current thread for the given amount of time\n * @param timeMs time in milliseconds to sleep\n */\nexport async function sleep(timeMs: number): Promise<null> {\n return new Promise((resolve) => {\n setTimeout(resolve, timeMs);\n });\n}\n\nexport const nowInSeconds = () => Math.floor(Date.now() / 1000);\n\nexport function floorToWholeHour(timestampInSeconds: number): number {\n const date = new Date(timestampInSeconds * 1000);\n // Reset minutes and seconds to zero\n date.setMinutes(0);\n date.setSeconds(0);\n date.setMilliseconds(0);\n return Math.floor(date.getTime() / 1000);\n}\n\nexport function base64UrlDecode(base64Url: string): string {\n // Replace base64url-specific characters\n const base64 = base64Url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n // Pad the string with '=' characters if needed\n const paddedBase64 = base64 + \"==\".substring(0, (3 - (base64.length % 3)) % 3);\n const decodedString = decode(paddedBase64);\n return decodedString;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChildProcessWithoutNullStreams } from 'child_process';
|
|
2
|
-
import { N as Network, g as AccountAddress } from '../accountAddress-
|
|
2
|
+
import { N as Network, g as AccountAddress } from '../accountAddress-Lv-GSihU.js';
|
|
3
3
|
|
|
4
4
|
declare class LocalNode {
|
|
5
5
|
readonly MAXIMUM_WAIT_TIME_SEC = 75;
|
package/dist/common/cli/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkBHKSQXUZjs = require('../chunk-BHKSQXUZ.js');var _child_process = require('child_process');var _treekill = require('tree-kill'); var _treekill2 = _interopRequireDefault(_treekill);var _os = require('os');var c=class{constructor(){this.MAXIMUM_WAIT_TIME_SEC=75;this.READINESS_ENDPOINT="http://127.0.0.1:8070/";this.process=null}stop(){_optionalChain([this, 'access', _ => _.process, 'optionalAccess', _2 => _2.pid])&&_treekill2.default.call(void 0, this.process.pid)}async run(){await this.checkIfProcessIsUp()||(this.start(),await this.waitUntilProcessIsUp())}start(){let s="npx",t=["aptos","node","run-local-testnet","--force-restart","--assume-yes","--with-indexer-api"],e=_os.platform.call(void 0, ),r;e==="win32"?r=_child_process.spawn.call(void 0, s,t,{shell:!0}):r=_child_process.spawn.call(void 0, s,t),this.process=r,_optionalChain([r, 'access', _3 => _3.stderr, 'optionalAccess', _4 => _4.on, 'call', _5 => _5("data",o=>{let a=o.toString();console.log(a)})]),_optionalChain([r, 'access', _6 => _6.stdout, 'optionalAccess', _7 => _7.on, 'call', _8 => _8("data",o=>{let a=o.toString();console.log(a)})])}async waitUntilProcessIsUp(){let s=await this.checkIfProcessIsUp(),t=Date.now()/1e3,e=t;for(;!s&&t+this.MAXIMUM_WAIT_TIME_SEC>e;)await _chunkBHKSQXUZjs.b.call(void 0, 1e3),s=await this.checkIfProcessIsUp(),e=Date.now()/1e3;if(!s)throw new Error("Process failed to start");return!0}async checkIfProcessIsUp(){try{return(await fetch(this.READINESS_ENDPOINT)).status===200}catch (e2){return!1}}};var p=class{async init(s){let{network:t,profile:e}=s,r=["aptos","init",`--network=${_nullishCoalesce(t, () => ("local"))}`,`--profile=${_nullishCoalesce(e, () => ("default"))}`];return this.runCommand(r)}async compile(s){let{packageDirectoryPath:t,namedAddresses:e}=s,r=["aptos","move","compile","--package-dir",t,"--skip-fetch-latest-git-deps"],o=this.parseNamedAddresses(e);return r.push(...this.prepareNamedAddresses(o)),this.runCommand(r)}async test(s){let{packageDirectoryPath:t,namedAddresses:e}=s,r=["aptos","move","test","--package-dir",t,"--skip-fetch-latest-git-deps"],o=this.parseNamedAddresses(e);return r.push(...this.prepareNamedAddresses(o)),this.runCommand(r)}async publish(s){let{packageDirectoryPath:t,namedAddresses:e,profile:r}=s,o=["aptos","move","publish","--package-dir",t,"--skip-fetch-latest-git-deps",`--profile=${_nullishCoalesce(r, () => ("default"))}`],a=this.parseNamedAddresses(e);return o.push(...this.prepareNamedAddresses(a)),this.runCommand(o)}async runCommand(s){return new Promise((t,e)=>{let r=_os.platform.call(void 0, ),o;r==="win32"?o=_child_process.spawn.call(void 0, "npx",s,{shell:!0}):o=_child_process.spawn.call(void 0, "npx",s),o.stdout.pipe(process.stdout),o.stderr.pipe(process.stderr),process.stdin.pipe(o.stdin),o.on("close",a=>{a===0?t(!0):e(new Error(`Child process exited with code ${a}`))})})}prepareNamedAddresses(s){let t=s.size,e=[];if(t===0)return e;e.push("--named-addresses");let r=[];return s.forEach((o,a)=>{let m=`${a}=${o.toString()}`;r.push(m)}),e.push(r.join(",")),e}parseNamedAddresses(s){let t=new Map;return Object.keys(s).forEach(e=>{let r=s[e];t.set(e,r)}),t}};exports.LocalNode = c; exports.Move = p;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/localNode.ts","../../../src/cli/move.ts"],"names":["spawn","kill","platform","LocalNode","cliCommand","cliArgs","currentPlatform","childProcess","data","str","operational","start","last","sleep","Move","args","network","profile","packageDirectoryPath","namedAddresses","addressesMap","resolve","reject","code","totalNames","newArgs","idx","value","key","toAppend","address"],"mappings":"yCAAA,OAAyC,SAAAA,MAAa,gBACtD,OAAOC,MAAU,YACjB,OAAS,YAAAC,MAAgB,KAIlB,IAAMC,EAAN,KAAgB,CAAhB,cACL,KAAS,sBAAwB,GAEjC,KAAS,mBAAqB,yBAE9B,aAAiD,KAMjD,MAAO,CACA,KAAK,SAAS,KACnBF,EAAK,KAAK,QAAQ,GAAG,CACvB,CAQA,MAAM,KAAM,CACO,MAAM,KAAK,mBAAmB,IAI/C,KAAK,MAAM,EACX,MAAM,KAAK,qBAAqB,EAClC,CAKA,OAAQ,CACN,IAAMG,EAAa,MACbC,EAAU,CAAC,QAAS,OAAQ,oBAAqB,kBAAmB,eAAgB,oBAAoB,EAExGC,EAAkBJ,EAAS,EAC7BK,EAEAD,IAAoB,QACtBC,EAAeP,EAAMI,EAAYC,EAAS,CAAE,MAAO,EAAK,CAAC,EAEzDE,EAA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mB,EAEhC,IAAIC,EAAM,EACV,OAAAP,EAAe,QAAQ,CAACQ,EAAOC,IAAQ,CACrCF,GAAO,EACP,IAAIG,EAAW,GAAGD,CAAG,IAAID,EAAM,SAAS,CAAC,GACrCD,EAAMF,EAAa,IACrBK,GAAY,KAEdJ,EAAQ,KAAKI,CAAQ,CACvB,CAAC,EACMJ,CACT,CASQ,oBAAoBN,EAA6E,CACvG,IAAMC,EAAe,IAAI,IAEzB,cAAO,KAAKD,CAAc,EAAE,QAASS,GAAQ,CAC3C,IAAME,EAAUX,EAAeS,CAAG,EAClCR,EAAa,IAAIQ,EAAKE,CAAO,CAC/B,CAAC,EAEMV,CACT,CACF","sourcesContent":["import { ChildProcessWithoutNullStreams, spawn } from \"child_process\";\nimport kill from \"tree-kill\";\nimport { platform } from \"os\";\n\nimport { sleep } from \"../utils/helpers\";\n\nexport class LocalNode {\n readonly MAXIMUM_WAIT_TIME_SEC = 75;\n\n readonly READINESS_ENDPOINT = \"http://127.0.0.1:8070/\";\n\n process: ChildProcessWithoutNullStreams | null = null;\n\n /**\n * kills all the descendent processes\n * of the node process, including the node process itself\n */\n stop() {\n if (!this.process?.pid) return;\n kill(this.process.pid);\n }\n\n /**\n * Runs a local testnet and waits for process to be up.\n *\n * If local node process is already up it returns and does\n * not start the process\n */\n async run() {\n const nodeIsUp = await this.checkIfProcessIsUp();\n if (nodeIsUp) {\n return;\n }\n this.start();\n await this.waitUntilProcessIsUp();\n }\n\n /**\n * Starts the local testnet by running the aptos node run-local-testnet command\n */\n start() {\n const cliCommand = \"npx\";\n const cliArgs = [\"aptos\", \"node\", \"run-local-testnet\", \"--force-restart\", \"--assume-yes\", \"--with-indexer-api\"];\n\n const currentPlatform = platform();\n let childProcess;\n // Check if current OS is windows\n if (currentPlatform === \"win32\") {\n childProcess = spawn(cliCommand, cliArgs, { shell: true });\n } else {\n childProcess = spawn(cliCommand, cliArgs);\n }\n\n this.process = childProcess;\n\n childProcess.stderr?.on(\"data\", (data: any) => {\n const str = data.toString();\n // Print local node output log\n // eslint-disable-next-line no-console\n console.log(str);\n });\n\n childProcess.stdout?.on(\"data\", (data: any) => {\n const str = data.toString();\n // Print local node output log\n // eslint-disable-next-line no-console\n console.log(str);\n });\n }\n\n /**\n * Waits for the local testnet process to be up\n *\n * @returns Promise<boolean>\n */\n async waitUntilProcessIsUp(): Promise<boolean> {\n let operational = await this.checkIfProcessIsUp();\n const start = Date.now() / 1000;\n let last = start;\n\n while (!operational && start + this.MAXIMUM_WAIT_TIME_SEC > last) {\n // eslint-disable-next-line no-await-in-loop\n await sleep(1000);\n // eslint-disable-next-line no-await-in-loop\n operational = await this.checkIfProcessIsUp();\n last = Date.now() / 1000;\n }\n\n // If we are here it means something blocks the process to start.\n // Might worth checking if another process is running on port 8080\n if (!operational) {\n throw new Error(\"Process failed to start\");\n }\n\n return true;\n }\n\n /**\n * Checks if the local testnet is up\n *\n * @returns Promise<boolean>\n */\n async checkIfProcessIsUp(): Promise<boolean> {\n try {\n // Query readiness endpoint\n const data = await fetch(this.READINESS_ENDPOINT);\n if (data.status === 200) {\n return true;\n }\n return false;\n } catch (err: any) {\n return false;\n }\n }\n}\n","import { spawn } from \"child_process\";\nimport { platform } from \"os\";\n\nimport { AccountAddress } from \"../core\";\nimport { Network } from \"../utils\";\n\nexport class Move {\n /**\n * Function to initialize current directory for Aptos\n *\n * Configuration will be pushed into .aptos/config.yaml\n * @param args.network optional Netowrk type argument to use for default settings, default is local\n * @param args.profile optional Profile to use from the config file, default is 'default'\n * This will be used to override associated settings such as the REST URL, the Faucet URL, and the private key arguments.\n *\n * @returns\n */\n async init(args: { network?: Network; profile?: string }): Promise<boolean> {\n const { network, profile } = args;\n const cliArgs = [\"aptos\", \"init\", `--network=${network ?? \"local\"}`, `--profile=${profile ?? \"default\"}`];\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Function to compile a package\n *\n * @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n *\n * @returns\n */\n async compile(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses } = args;\n const cliArgs = [\"aptos\", \"move\", \"compile\", \"--package-dir\", packageDirectoryPath, \"--skip-fetch-latest-git-deps\"];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Function to run Move unit tests for a package\n *\n * @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n *\n * @returns\n */\n async test(args: { packageDirectoryPath: string; namedAddresses: Record<string, AccountAddress> }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses } = args;\n const cliArgs = [\"aptos\", \"move\", \"test\", \"--package-dir\", packageDirectoryPath, \"--skip-fetch-latest-git-deps\"];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Function to publishe the modules in a Move package to the Aptos blockchain\n *\n * @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n * @param args.profile optional Profile to use from the config file.\n *\n * @returns\n */\n async publish(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses, profile } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"publish\",\n \"--package-dir\",\n packageDirectoryPath,\n \"--skip-fetch-latest-git-deps\",\n `--profile=${profile ?? \"default\"}`,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Run a move command\n *\n * @param args\n * @returns\n */\n // eslint-disable-next-line class-methods-use-this\n private async runCommand(args: Array<string>): Promise<boolean> {\n return new Promise((resolve, reject) => {\n const currentPlatform = platform();\n let childProcess;\n\n // Check if current OS is windows\n if (currentPlatform === \"win32\") {\n childProcess = spawn(\"npx\", args, { shell: true });\n } else {\n childProcess = spawn(\"npx\", args);\n }\n\n childProcess.stdout.pipe(process.stdout);\n childProcess.stderr.pipe(process.stderr);\n process.stdin.pipe(childProcess.stdin);\n\n childProcess.on(\"close\", (code) => {\n if (code === 0) {\n resolve(true); // Resolve with true if the child process exits successfully\n } else {\n reject(new Error(`Child process exited with code ${code}`)); // Reject with an error if the child process exits with an error code\n }\n });\n });\n }\n\n /**\n * Convert named addresses from a Map into an array seperated by a comma\n *\n * @example\n * input: {'alice' => '0x123', 'bob' => '0x456'}\n * output: \"alice=0x123,bob=0x456\"\n *\n * @param namedAddresses\n * @returns An array of names addresses seperated by a comma\n */\n // eslint-disable-next-line class-methods-use-this\n private prepareNamedAddresses(namedAddresses: Map<string, AccountAddress>): Array<string> {\n const totalNames = namedAddresses.size;\n const newArgs: Array<string> = [];\n\n if (totalNames === 0) {\n return newArgs;\n }\n\n newArgs.push(\"--named-addresses\");\n\n let idx = 0;\n namedAddresses.forEach((value, key) => {\n idx += 1;\n let toAppend = `${key}=${value.toString()}`;\n if (idx < totalNames - 1) {\n toAppend += \",\";\n }\n newArgs.push(toAppend);\n });\n return newArgs;\n }\n\n /**\n * Parse named addresses from a Record type into a Map\n *\n * @param namedAddresses\n * @returns Map<name,address>\n */\n // eslint-disable-next-line class-methods-use-this\n private parseNamedAddresses(namedAddresses: Record<string, AccountAddress>): Map<string, AccountAddress> {\n const addressesMap = new Map();\n\n Object.keys(namedAddresses).forEach((key) => {\n const address = namedAddresses[key];\n addressesMap.set(key, address);\n });\n\n return addressesMap;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/localNode.ts","../../../src/cli/move.ts"],"names":["spawn","kill","platform","LocalNode","cliCommand","cliArgs","currentPlatform","childProcess","data","str","operational","start","last","sleep","Move","args","network","profile","packageDirectoryPath","namedAddresses","addressesMap","resolve","reject","code","totalNames","newArgs","names","value","key","toAppend","address"],"mappings":"yCAAA,OAAyC,SAAAA,MAAa,gBACtD,OAAOC,MAAU,YACjB,OAAS,YAAAC,MAAgB,KAIlB,IAAMC,EAAN,KAAgB,CAAhB,cACL,KAAS,sBAAwB,GAEjC,KAAS,mBAAqB,yBAE9B,aAAiD,KAMjD,MAAO,CACA,KAAK,SAAS,KACnBF,EAAK,KAAK,QAAQ,GAAG,CACvB,CAQA,MAAM,KAAM,CACO,MAAM,KAAK,mBAAmB,IAI/C,KAAK,MAAM,EACX,MAAM,KAAK,qBAAqB,EAClC,CAKA,OAAQ,CACN,IAAMG,EAAa,MACbC,EAAU,CAAC,QAAS,OAAQ,oBAAqB,kBAAmB,eAAgB,oBAAoB,EAExGC,EAAkBJ,EAAS,EAC7BK,EAEAD,IAAoB,QACtBC,EAAeP,EAAMI,EAAYC,EAAS,CAAE,MAAO,EAAK,CAAC,EAEzDE,EAAeP,EAAMI,EAAYC,CAAO,EAG1C,KAAK,QAAUE,EAEfA,EAAa,QAAQ,GAAG,OAASC,GAAc,CAC7C,IAAMC,EAAMD,EAAK,SAAS,EAG1B,QAAQ,IAAIC,CAAG,CACjB,CAAC,EAEDF,EAAa,QAAQ,GAAG,OAASC,GAAc,CAC7C,IAAMC,EAAMD,EAAK,SAAS,EAG1B,QAAQ,IAAIC,CAAG,CACjB,CAAC,CACH,CAOA,MAAM,sBAAyC,CAC7C,IAAIC,EAAc,MAAM,KAAK,mBAAmB,EAC1CC,EAAQ,KAAK,IAAI,EAAI,IACvBC,EAAOD,EAEX,KAAO,CAACD,GAAeC,EAAQ,KAAK,sBAAwBC,GAE1D,MAAMC,EAAM,GAAI,EAEhBH,EAAc,MAAM,KAAK,mBAA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kill\";\nimport { platform } from \"os\";\n\nimport { sleep } from \"../utils/helpers\";\n\nexport class LocalNode {\n readonly MAXIMUM_WAIT_TIME_SEC = 75;\n\n readonly READINESS_ENDPOINT = \"http://127.0.0.1:8070/\";\n\n process: ChildProcessWithoutNullStreams | null = null;\n\n /**\n * kills all the descendent processes\n * of the node process, including the node process itself\n */\n stop() {\n if (!this.process?.pid) return;\n kill(this.process.pid);\n }\n\n /**\n * Runs a local testnet and waits for process to be up.\n *\n * If local node process is already up it returns and does\n * not start the process\n */\n async run() {\n const nodeIsUp = await this.checkIfProcessIsUp();\n if (nodeIsUp) {\n return;\n }\n this.start();\n await this.waitUntilProcessIsUp();\n }\n\n /**\n * Starts the local testnet by running the aptos node run-local-testnet command\n */\n start() {\n const cliCommand = \"npx\";\n const cliArgs = [\"aptos\", \"node\", \"run-local-testnet\", \"--force-restart\", \"--assume-yes\", \"--with-indexer-api\"];\n\n const currentPlatform = platform();\n let childProcess;\n // Check if current OS is windows\n if (currentPlatform === \"win32\") {\n childProcess = spawn(cliCommand, cliArgs, { shell: true });\n } else {\n childProcess = spawn(cliCommand, cliArgs);\n }\n\n this.process = childProcess;\n\n childProcess.stderr?.on(\"data\", (data: any) => {\n const str = data.toString();\n // Print local node output log\n // eslint-disable-next-line no-console\n console.log(str);\n });\n\n childProcess.stdout?.on(\"data\", (data: any) => {\n const str = data.toString();\n // Print local node output log\n // eslint-disable-next-line no-console\n console.log(str);\n });\n }\n\n /**\n * Waits for the local testnet process to be up\n *\n * @returns Promise<boolean>\n */\n async waitUntilProcessIsUp(): Promise<boolean> {\n let operational = await this.checkIfProcessIsUp();\n const start = Date.now() / 1000;\n let last = start;\n\n while (!operational && start + this.MAXIMUM_WAIT_TIME_SEC > last) {\n // eslint-disable-next-line no-await-in-loop\n await sleep(1000);\n // eslint-disable-next-line no-await-in-loop\n operational = await this.checkIfProcessIsUp();\n last = Date.now() / 1000;\n }\n\n // If we are here it means something blocks the process to start.\n // Might worth checking if another process is running on port 8080\n if (!operational) {\n throw new Error(\"Process failed to start\");\n }\n\n return true;\n }\n\n /**\n * Checks if the local testnet is up\n *\n * @returns Promise<boolean>\n */\n async checkIfProcessIsUp(): Promise<boolean> {\n try {\n // Query readiness endpoint\n const data = await fetch(this.READINESS_ENDPOINT);\n if (data.status === 200) {\n return true;\n }\n return false;\n } catch (err: any) {\n return false;\n }\n }\n}\n","import { spawn } from \"child_process\";\nimport { platform } from \"os\";\n\nimport { AccountAddress } from \"../core\";\nimport { Network } from \"../utils\";\n\nexport class Move {\n /**\n * Function to initialize current directory for Aptos\n *\n * Configuration will be pushed into .aptos/config.yaml\n * @param args.network optional Netowrk type argument to use for default settings, default is local\n * @param args.profile optional Profile to use from the config file, default is 'default'\n * This will be used to override associated settings such as the REST URL, the Faucet URL, and the private key arguments.\n *\n * @returns\n */\n async init(args: { network?: Network; profile?: string }): Promise<boolean> {\n const { network, profile } = args;\n const cliArgs = [\"aptos\", \"init\", `--network=${network ?? \"local\"}`, `--profile=${profile ?? \"default\"}`];\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Function to compile a package\n *\n * @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n *\n * @returns\n */\n async compile(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses } = args;\n const cliArgs = [\"aptos\", \"move\", \"compile\", \"--package-dir\", packageDirectoryPath, \"--skip-fetch-latest-git-deps\"];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Function to run Move unit tests for a package\n *\n * @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n *\n * @returns\n */\n async test(args: { packageDirectoryPath: string; namedAddresses: Record<string, AccountAddress> }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses } = args;\n const cliArgs = [\"aptos\", \"move\", \"test\", \"--package-dir\", packageDirectoryPath, \"--skip-fetch-latest-git-deps\"];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Function to publishe the modules in a Move package to the Aptos blockchain\n *\n * @param args.packageDirectoryPath Path to a move package (the folder with a Move.toml file)\n * @param args.namedAddresses Named addresses for the move binary\n * @example\n * {\n * alice:0x1234, bob:0x5678\n * }\n * @param args.profile optional Profile to use from the config file.\n *\n * @returns\n */\n async publish(args: {\n packageDirectoryPath: string;\n namedAddresses: Record<string, AccountAddress>;\n profile?: string;\n }): Promise<boolean> {\n const { packageDirectoryPath, namedAddresses, profile } = args;\n const cliArgs = [\n \"aptos\",\n \"move\",\n \"publish\",\n \"--package-dir\",\n packageDirectoryPath,\n \"--skip-fetch-latest-git-deps\",\n `--profile=${profile ?? \"default\"}`,\n ];\n\n const addressesMap = this.parseNamedAddresses(namedAddresses);\n\n cliArgs.push(...this.prepareNamedAddresses(addressesMap));\n\n return this.runCommand(cliArgs);\n }\n\n /**\n * Run a move command\n *\n * @param args\n * @returns\n */\n // eslint-disable-next-line class-methods-use-this\n private async runCommand(args: Array<string>): Promise<boolean> {\n return new Promise((resolve, reject) => {\n const currentPlatform = platform();\n let childProcess;\n\n // Check if current OS is windows\n if (currentPlatform === \"win32\") {\n childProcess = spawn(\"npx\", args, { shell: true });\n } else {\n childProcess = spawn(\"npx\", args);\n }\n\n childProcess.stdout.pipe(process.stdout);\n childProcess.stderr.pipe(process.stderr);\n process.stdin.pipe(childProcess.stdin);\n\n childProcess.on(\"close\", (code) => {\n if (code === 0) {\n resolve(true); // Resolve with true if the child process exits successfully\n } else {\n reject(new Error(`Child process exited with code ${code}`)); // Reject with an error if the child process exits with an error code\n }\n });\n });\n }\n\n /**\n * Convert named addresses from a Map into an array seperated by a comma\n *\n * @example\n * input: {'alice' => '0x123', 'bob' => '0x456'}\n * output: \"alice=0x123,bob=0x456\"\n *\n * @param namedAddresses\n * @returns An array of names addresses seperated by a comma\n */\n // eslint-disable-next-line class-methods-use-this\n private prepareNamedAddresses(namedAddresses: Map<string, AccountAddress>): Array<string> {\n const totalNames = namedAddresses.size;\n const newArgs: Array<string> = [];\n\n if (totalNames === 0) {\n return newArgs;\n }\n\n newArgs.push(\"--named-addresses\");\n\n const names: Array<string> = [];\n namedAddresses.forEach((value, key) => {\n const toAppend = `${key}=${value.toString()}`;\n names.push(toAppend);\n });\n newArgs.push(names.join(\",\"));\n return newArgs;\n }\n\n /**\n * Parse named addresses from a Record type into a Map\n *\n * @param namedAddresses\n * @returns Map<name,address>\n */\n // eslint-disable-next-line class-methods-use-this\n private parseNamedAddresses(namedAddresses: Record<string, AccountAddress>): Map<string, AccountAddress> {\n const addressesMap = new Map();\n\n Object.keys(namedAddresses).forEach((key) => {\n const address = namedAddresses[key];\n addressesMap.set(key, address);\n });\n\n return addressesMap;\n }\n}\n"]}
|