@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,7 +1,7 @@
|
|
|
1
1
|
import * as Types from "./operations";
|
|
2
2
|
|
|
3
|
-
import { GraphQLClient } from "graphql-request";
|
|
4
|
-
|
|
3
|
+
import { GraphQLClient, RequestOptions } from "graphql-request";
|
|
4
|
+
type GraphQLClientRequestHeaders = RequestOptions["requestHeaders"];
|
|
5
5
|
export const TokenActivitiesFieldsFragmentDoc = `
|
|
6
6
|
fragment TokenActivitiesFields on token_activities_v2 {
|
|
7
7
|
after_value
|
|
@@ -357,6 +357,8 @@ export const GetFungibleAssetMetadata = `
|
|
|
357
357
|
name
|
|
358
358
|
symbol
|
|
359
359
|
token_standard
|
|
360
|
+
supply_v2
|
|
361
|
+
maximum_v2
|
|
360
362
|
}
|
|
361
363
|
}
|
|
362
364
|
`;
|
|
@@ -490,9 +492,10 @@ export type SdkFunctionWrapper = <T>(
|
|
|
490
492
|
action: (requestHeaders?: Record<string, string>) => Promise<T>,
|
|
491
493
|
operationName: string,
|
|
492
494
|
operationType?: string,
|
|
495
|
+
variables?: any,
|
|
493
496
|
) => Promise<T>;
|
|
494
497
|
|
|
495
|
-
const defaultWrapper: SdkFunctionWrapper = (action, _operationName, _operationType) => action();
|
|
498
|
+
const defaultWrapper: SdkFunctionWrapper = (action, _operationName, _operationType, _variables) => action();
|
|
496
499
|
|
|
497
500
|
export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = defaultWrapper) {
|
|
498
501
|
return {
|
|
@@ -508,6 +511,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
508
511
|
}),
|
|
509
512
|
"getAccountCoinsCount",
|
|
510
513
|
"query",
|
|
514
|
+
variables,
|
|
511
515
|
);
|
|
512
516
|
},
|
|
513
517
|
getAccountCoinsData(
|
|
@@ -522,6 +526,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
522
526
|
}),
|
|
523
527
|
"getAccountCoinsData",
|
|
524
528
|
"query",
|
|
529
|
+
variables,
|
|
525
530
|
);
|
|
526
531
|
},
|
|
527
532
|
getAccountCollectionsWithOwnedTokens(
|
|
@@ -537,6 +542,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
537
542
|
),
|
|
538
543
|
"getAccountCollectionsWithOwnedTokens",
|
|
539
544
|
"query",
|
|
545
|
+
variables,
|
|
540
546
|
);
|
|
541
547
|
},
|
|
542
548
|
getAccountOwnedObjects(
|
|
@@ -551,6 +557,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
551
557
|
}),
|
|
552
558
|
"getAccountOwnedObjects",
|
|
553
559
|
"query",
|
|
560
|
+
variables,
|
|
554
561
|
);
|
|
555
562
|
},
|
|
556
563
|
getAccountOwnedTokens(
|
|
@@ -565,6 +572,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
565
572
|
}),
|
|
566
573
|
"getAccountOwnedTokens",
|
|
567
574
|
"query",
|
|
575
|
+
variables,
|
|
568
576
|
);
|
|
569
577
|
},
|
|
570
578
|
getAccountOwnedTokensByTokenData(
|
|
@@ -579,6 +587,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
579
587
|
}),
|
|
580
588
|
"getAccountOwnedTokensByTokenData",
|
|
581
589
|
"query",
|
|
590
|
+
variables,
|
|
582
591
|
);
|
|
583
592
|
},
|
|
584
593
|
getAccountOwnedTokensFromCollection(
|
|
@@ -594,6 +603,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
594
603
|
),
|
|
595
604
|
"getAccountOwnedTokensFromCollection",
|
|
596
605
|
"query",
|
|
606
|
+
variables,
|
|
597
607
|
);
|
|
598
608
|
},
|
|
599
609
|
getAccountTokensCount(
|
|
@@ -608,6 +618,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
608
618
|
}),
|
|
609
619
|
"getAccountTokensCount",
|
|
610
620
|
"query",
|
|
621
|
+
variables,
|
|
611
622
|
);
|
|
612
623
|
},
|
|
613
624
|
getAccountTransactionsCount(
|
|
@@ -622,6 +633,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
622
633
|
}),
|
|
623
634
|
"getAccountTransactionsCount",
|
|
624
635
|
"query",
|
|
636
|
+
variables,
|
|
625
637
|
);
|
|
626
638
|
},
|
|
627
639
|
getChainTopUserTransactions(
|
|
@@ -636,6 +648,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
636
648
|
}),
|
|
637
649
|
"getChainTopUserTransactions",
|
|
638
650
|
"query",
|
|
651
|
+
variables,
|
|
639
652
|
);
|
|
640
653
|
},
|
|
641
654
|
getCollectionData(
|
|
@@ -650,6 +663,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
650
663
|
}),
|
|
651
664
|
"getCollectionData",
|
|
652
665
|
"query",
|
|
666
|
+
variables,
|
|
653
667
|
);
|
|
654
668
|
},
|
|
655
669
|
getCurrentFungibleAssetBalances(
|
|
@@ -664,6 +678,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
664
678
|
}),
|
|
665
679
|
"getCurrentFungibleAssetBalances",
|
|
666
680
|
"query",
|
|
681
|
+
variables,
|
|
667
682
|
);
|
|
668
683
|
},
|
|
669
684
|
getDelegatedStakingActivities(
|
|
@@ -678,6 +693,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
678
693
|
}),
|
|
679
694
|
"getDelegatedStakingActivities",
|
|
680
695
|
"query",
|
|
696
|
+
variables,
|
|
681
697
|
);
|
|
682
698
|
},
|
|
683
699
|
getEvents(
|
|
@@ -689,6 +705,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
689
705
|
client.request<Types.GetEventsQuery>(GetEvents, variables, { ...requestHeaders, ...wrappedRequestHeaders }),
|
|
690
706
|
"getEvents",
|
|
691
707
|
"query",
|
|
708
|
+
variables,
|
|
692
709
|
);
|
|
693
710
|
},
|
|
694
711
|
getFungibleAssetActivities(
|
|
@@ -703,6 +720,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
703
720
|
}),
|
|
704
721
|
"getFungibleAssetActivities",
|
|
705
722
|
"query",
|
|
723
|
+
variables,
|
|
706
724
|
);
|
|
707
725
|
},
|
|
708
726
|
getFungibleAssetMetadata(
|
|
@@ -717,6 +735,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
717
735
|
}),
|
|
718
736
|
"getFungibleAssetMetadata",
|
|
719
737
|
"query",
|
|
738
|
+
variables,
|
|
720
739
|
);
|
|
721
740
|
},
|
|
722
741
|
getNames(
|
|
@@ -728,6 +747,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
728
747
|
client.request<Types.GetNamesQuery>(GetNames, variables, { ...requestHeaders, ...wrappedRequestHeaders }),
|
|
729
748
|
"getNames",
|
|
730
749
|
"query",
|
|
750
|
+
variables,
|
|
731
751
|
);
|
|
732
752
|
},
|
|
733
753
|
getNumberOfDelegators(
|
|
@@ -742,6 +762,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
742
762
|
}),
|
|
743
763
|
"getNumberOfDelegators",
|
|
744
764
|
"query",
|
|
765
|
+
variables,
|
|
745
766
|
);
|
|
746
767
|
},
|
|
747
768
|
getProcessorStatus(
|
|
@@ -756,6 +777,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
756
777
|
}),
|
|
757
778
|
"getProcessorStatus",
|
|
758
779
|
"query",
|
|
780
|
+
variables,
|
|
759
781
|
);
|
|
760
782
|
},
|
|
761
783
|
getTableItemsData(
|
|
@@ -770,6 +792,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
770
792
|
}),
|
|
771
793
|
"getTableItemsData",
|
|
772
794
|
"query",
|
|
795
|
+
variables,
|
|
773
796
|
);
|
|
774
797
|
},
|
|
775
798
|
getTableItemsMetadata(
|
|
@@ -784,6 +807,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
784
807
|
}),
|
|
785
808
|
"getTableItemsMetadata",
|
|
786
809
|
"query",
|
|
810
|
+
variables,
|
|
787
811
|
);
|
|
788
812
|
},
|
|
789
813
|
getTokenActivity(
|
|
@@ -798,6 +822,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
798
822
|
}),
|
|
799
823
|
"getTokenActivity",
|
|
800
824
|
"query",
|
|
825
|
+
variables,
|
|
801
826
|
);
|
|
802
827
|
},
|
|
803
828
|
getCurrentTokenOwnership(
|
|
@@ -812,6 +837,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
812
837
|
}),
|
|
813
838
|
"getCurrentTokenOwnership",
|
|
814
839
|
"query",
|
|
840
|
+
variables,
|
|
815
841
|
);
|
|
816
842
|
},
|
|
817
843
|
getTokenData(
|
|
@@ -826,6 +852,7 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
|
|
|
826
852
|
}),
|
|
827
853
|
"getTokenData",
|
|
828
854
|
"query",
|
|
855
|
+
variables,
|
|
829
856
|
);
|
|
830
857
|
},
|
|
831
858
|
};
|
|
@@ -3539,14 +3539,15 @@ export type CurrentTokenDatasV2 = {
|
|
|
3539
3539
|
current_token_ownerships: Array<CurrentTokenOwnershipsV2>;
|
|
3540
3540
|
/** An aggregate relationship */
|
|
3541
3541
|
current_token_ownerships_aggregate: CurrentTokenOwnershipsV2Aggregate;
|
|
3542
|
-
decimals
|
|
3542
|
+
decimals?: Maybe<Scalars["bigint"]["output"]>;
|
|
3543
3543
|
description: Scalars["String"]["output"];
|
|
3544
|
+
is_deleted_v2?: Maybe<Scalars["Boolean"]["output"]>;
|
|
3544
3545
|
is_fungible_v2?: Maybe<Scalars["Boolean"]["output"]>;
|
|
3545
3546
|
largest_property_version_v1?: Maybe<Scalars["numeric"]["output"]>;
|
|
3546
3547
|
last_transaction_timestamp: Scalars["timestamp"]["output"];
|
|
3547
3548
|
last_transaction_version: Scalars["bigint"]["output"];
|
|
3548
3549
|
maximum?: Maybe<Scalars["numeric"]["output"]>;
|
|
3549
|
-
supply
|
|
3550
|
+
supply?: Maybe<Scalars["numeric"]["output"]>;
|
|
3550
3551
|
token_data_id: Scalars["String"]["output"];
|
|
3551
3552
|
token_name: Scalars["String"]["output"];
|
|
3552
3553
|
token_properties: Scalars["jsonb"]["output"];
|
|
@@ -3590,6 +3591,7 @@ export type CurrentTokenDatasV2BoolExp = {
|
|
|
3590
3591
|
current_token_ownerships_aggregate?: InputMaybe<CurrentTokenOwnershipsV2AggregateBoolExp>;
|
|
3591
3592
|
decimals?: InputMaybe<BigintComparisonExp>;
|
|
3592
3593
|
description?: InputMaybe<StringComparisonExp>;
|
|
3594
|
+
is_deleted_v2?: InputMaybe<BooleanComparisonExp>;
|
|
3593
3595
|
is_fungible_v2?: InputMaybe<BooleanComparisonExp>;
|
|
3594
3596
|
largest_property_version_v1?: InputMaybe<NumericComparisonExp>;
|
|
3595
3597
|
last_transaction_timestamp?: InputMaybe<TimestampComparisonExp>;
|
|
@@ -3612,6 +3614,7 @@ export type CurrentTokenDatasV2OrderBy = {
|
|
|
3612
3614
|
current_token_ownerships_aggregate?: InputMaybe<CurrentTokenOwnershipsV2AggregateOrderBy>;
|
|
3613
3615
|
decimals?: InputMaybe<OrderBy>;
|
|
3614
3616
|
description?: InputMaybe<OrderBy>;
|
|
3617
|
+
is_deleted_v2?: InputMaybe<OrderBy>;
|
|
3615
3618
|
is_fungible_v2?: InputMaybe<OrderBy>;
|
|
3616
3619
|
largest_property_version_v1?: InputMaybe<OrderBy>;
|
|
3617
3620
|
last_transaction_timestamp?: InputMaybe<OrderBy>;
|
|
@@ -3634,6 +3637,8 @@ export enum CurrentTokenDatasV2SelectColumn {
|
|
|
3634
3637
|
/** column name */
|
|
3635
3638
|
Description = "description",
|
|
3636
3639
|
/** column name */
|
|
3640
|
+
IsDeletedV2 = "is_deleted_v2",
|
|
3641
|
+
/** column name */
|
|
3637
3642
|
IsFungibleV2 = "is_fungible_v2",
|
|
3638
3643
|
/** column name */
|
|
3639
3644
|
LargestPropertyVersionV1 = "largest_property_version_v1",
|
|
@@ -3670,6 +3675,7 @@ export type CurrentTokenDatasV2StreamCursorValueInput = {
|
|
|
3670
3675
|
collection_id?: InputMaybe<Scalars["String"]["input"]>;
|
|
3671
3676
|
decimals?: InputMaybe<Scalars["bigint"]["input"]>;
|
|
3672
3677
|
description?: InputMaybe<Scalars["String"]["input"]>;
|
|
3678
|
+
is_deleted_v2?: InputMaybe<Scalars["Boolean"]["input"]>;
|
|
3673
3679
|
is_fungible_v2?: InputMaybe<Scalars["Boolean"]["input"]>;
|
|
3674
3680
|
largest_property_version_v1?: InputMaybe<Scalars["numeric"]["input"]>;
|
|
3675
3681
|
last_transaction_timestamp?: InputMaybe<Scalars["timestamp"]["input"]>;
|
|
@@ -5415,10 +5421,12 @@ export type FungibleAssetMetadata = {
|
|
|
5415
5421
|
icon_uri?: Maybe<Scalars["String"]["output"]>;
|
|
5416
5422
|
last_transaction_timestamp: Scalars["timestamp"]["output"];
|
|
5417
5423
|
last_transaction_version: Scalars["bigint"]["output"];
|
|
5424
|
+
maximum_v2?: Maybe<Scalars["numeric"]["output"]>;
|
|
5418
5425
|
name: Scalars["String"]["output"];
|
|
5419
5426
|
project_uri?: Maybe<Scalars["String"]["output"]>;
|
|
5420
5427
|
supply_aggregator_table_handle_v1?: Maybe<Scalars["String"]["output"]>;
|
|
5421
5428
|
supply_aggregator_table_key_v1?: Maybe<Scalars["String"]["output"]>;
|
|
5429
|
+
supply_v2?: Maybe<Scalars["numeric"]["output"]>;
|
|
5422
5430
|
symbol: Scalars["String"]["output"];
|
|
5423
5431
|
token_standard: Scalars["String"]["output"];
|
|
5424
5432
|
};
|
|
@@ -5434,10 +5442,12 @@ export type FungibleAssetMetadataBoolExp = {
|
|
|
5434
5442
|
icon_uri?: InputMaybe<StringComparisonExp>;
|
|
5435
5443
|
last_transaction_timestamp?: InputMaybe<TimestampComparisonExp>;
|
|
5436
5444
|
last_transaction_version?: InputMaybe<BigintComparisonExp>;
|
|
5445
|
+
maximum_v2?: InputMaybe<NumericComparisonExp>;
|
|
5437
5446
|
name?: InputMaybe<StringComparisonExp>;
|
|
5438
5447
|
project_uri?: InputMaybe<StringComparisonExp>;
|
|
5439
5448
|
supply_aggregator_table_handle_v1?: InputMaybe<StringComparisonExp>;
|
|
5440
5449
|
supply_aggregator_table_key_v1?: InputMaybe<StringComparisonExp>;
|
|
5450
|
+
supply_v2?: InputMaybe<NumericComparisonExp>;
|
|
5441
5451
|
symbol?: InputMaybe<StringComparisonExp>;
|
|
5442
5452
|
token_standard?: InputMaybe<StringComparisonExp>;
|
|
5443
5453
|
};
|
|
@@ -5450,10 +5460,12 @@ export type FungibleAssetMetadataOrderBy = {
|
|
|
5450
5460
|
icon_uri?: InputMaybe<OrderBy>;
|
|
5451
5461
|
last_transaction_timestamp?: InputMaybe<OrderBy>;
|
|
5452
5462
|
last_transaction_version?: InputMaybe<OrderBy>;
|
|
5463
|
+
maximum_v2?: InputMaybe<OrderBy>;
|
|
5453
5464
|
name?: InputMaybe<OrderBy>;
|
|
5454
5465
|
project_uri?: InputMaybe<OrderBy>;
|
|
5455
5466
|
supply_aggregator_table_handle_v1?: InputMaybe<OrderBy>;
|
|
5456
5467
|
supply_aggregator_table_key_v1?: InputMaybe<OrderBy>;
|
|
5468
|
+
supply_v2?: InputMaybe<OrderBy>;
|
|
5457
5469
|
symbol?: InputMaybe<OrderBy>;
|
|
5458
5470
|
token_standard?: InputMaybe<OrderBy>;
|
|
5459
5471
|
};
|
|
@@ -5473,6 +5485,8 @@ export enum FungibleAssetMetadataSelectColumn {
|
|
|
5473
5485
|
/** column name */
|
|
5474
5486
|
LastTransactionVersion = "last_transaction_version",
|
|
5475
5487
|
/** column name */
|
|
5488
|
+
MaximumV2 = "maximum_v2",
|
|
5489
|
+
/** column name */
|
|
5476
5490
|
Name = "name",
|
|
5477
5491
|
/** column name */
|
|
5478
5492
|
ProjectUri = "project_uri",
|
|
@@ -5481,6 +5495,8 @@ export enum FungibleAssetMetadataSelectColumn {
|
|
|
5481
5495
|
/** column name */
|
|
5482
5496
|
SupplyAggregatorTableKeyV1 = "supply_aggregator_table_key_v1",
|
|
5483
5497
|
/** column name */
|
|
5498
|
+
SupplyV2 = "supply_v2",
|
|
5499
|
+
/** column name */
|
|
5484
5500
|
Symbol = "symbol",
|
|
5485
5501
|
/** column name */
|
|
5486
5502
|
TokenStandard = "token_standard",
|
|
@@ -5502,10 +5518,12 @@ export type FungibleAssetMetadataStreamCursorValueInput = {
|
|
|
5502
5518
|
icon_uri?: InputMaybe<Scalars["String"]["input"]>;
|
|
5503
5519
|
last_transaction_timestamp?: InputMaybe<Scalars["timestamp"]["input"]>;
|
|
5504
5520
|
last_transaction_version?: InputMaybe<Scalars["bigint"]["input"]>;
|
|
5521
|
+
maximum_v2?: InputMaybe<Scalars["numeric"]["input"]>;
|
|
5505
5522
|
name?: InputMaybe<Scalars["String"]["input"]>;
|
|
5506
5523
|
project_uri?: InputMaybe<Scalars["String"]["input"]>;
|
|
5507
5524
|
supply_aggregator_table_handle_v1?: InputMaybe<Scalars["String"]["input"]>;
|
|
5508
5525
|
supply_aggregator_table_key_v1?: InputMaybe<Scalars["String"]["input"]>;
|
|
5526
|
+
supply_v2?: InputMaybe<Scalars["numeric"]["input"]>;
|
|
5509
5527
|
symbol?: InputMaybe<Scalars["String"]["input"]>;
|
|
5510
5528
|
token_standard?: InputMaybe<Scalars["String"]["input"]>;
|
|
5511
5529
|
};
|
package/src/types/index.ts
CHANGED
|
@@ -108,11 +108,29 @@ export enum AccountAuthenticatorVariant {
|
|
|
108
108
|
export enum AnyPublicKeyVariant {
|
|
109
109
|
Ed25519 = 0,
|
|
110
110
|
Secp256k1 = 1,
|
|
111
|
+
Keyless = 3,
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
export enum AnySignatureVariant {
|
|
114
115
|
Ed25519 = 0,
|
|
115
116
|
Secp256k1 = 1,
|
|
117
|
+
Keyless = 3,
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export enum EphemeralPublicKeyVariant {
|
|
121
|
+
Ed25519 = 0,
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export enum EphemeralSignatureVariant {
|
|
125
|
+
Ed25519 = 0,
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export enum EphemeralCertificateVariant {
|
|
129
|
+
ZkProof = 0,
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export enum ZkpVariant {
|
|
133
|
+
Groth16 = 0,
|
|
116
134
|
}
|
|
117
135
|
|
|
118
136
|
/**
|
|
@@ -140,6 +158,10 @@ export type AptosSettings = {
|
|
|
140
158
|
|
|
141
159
|
readonly indexer?: string;
|
|
142
160
|
|
|
161
|
+
readonly pepper?: string;
|
|
162
|
+
|
|
163
|
+
readonly prover?: string;
|
|
164
|
+
|
|
143
165
|
readonly clientConfig?: ClientConfig;
|
|
144
166
|
|
|
145
167
|
readonly client?: Client;
|
|
@@ -300,9 +322,9 @@ export type GasEstimation = {
|
|
|
300
322
|
prioritized_gas_estimate?: number;
|
|
301
323
|
};
|
|
302
324
|
|
|
303
|
-
export type MoveResource = {
|
|
325
|
+
export type MoveResource<T = {}> = {
|
|
304
326
|
type: MoveStructId;
|
|
305
|
-
data:
|
|
327
|
+
data: T;
|
|
306
328
|
};
|
|
307
329
|
|
|
308
330
|
export type AccountData = {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type ProverRequest = {
|
|
2
|
+
jwt_b64: string;
|
|
3
|
+
epk: string;
|
|
4
|
+
exp_date_secs: number;
|
|
5
|
+
exp_horizon_secs: number;
|
|
6
|
+
epk_blinder: string;
|
|
7
|
+
uid_key: string;
|
|
8
|
+
pepper: string;
|
|
9
|
+
};
|
|
10
|
+
export type ProverResponse = {
|
|
11
|
+
proof: { a: string; b: string; c: string };
|
|
12
|
+
public_inputs_hash: string;
|
|
13
|
+
training_wheels_signature: string;
|
|
14
|
+
};
|
|
15
|
+
export type PepperFetchRequest = {
|
|
16
|
+
jwt_b64: number;
|
|
17
|
+
epk: string;
|
|
18
|
+
exp_date_secs: number;
|
|
19
|
+
epk_blinder: string;
|
|
20
|
+
uid_key: string;
|
|
21
|
+
derivation_path: string;
|
|
22
|
+
};
|
|
23
|
+
export type PepperFetchResponse = { pepper: string; address: string };
|
|
24
|
+
|
|
25
|
+
export type KeylessConfigurationResponse = {
|
|
26
|
+
max_commited_epk_bytes: number;
|
|
27
|
+
max_exp_horizon_secs: string;
|
|
28
|
+
max_extra_field_bytes: number;
|
|
29
|
+
max_iss_val_bytes: number;
|
|
30
|
+
max_jwt_header_b64_bytes: number;
|
|
31
|
+
max_signatures_per_txn: number;
|
|
32
|
+
override_aud_vals: string[];
|
|
33
|
+
training_wheels_pubkey: { vec: string[] };
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type Groth16VerificationKeyResponse = {
|
|
37
|
+
alpha_g1: string;
|
|
38
|
+
beta_g2: string;
|
|
39
|
+
delta_g2: string;
|
|
40
|
+
gamma_abc_g1: [string, string];
|
|
41
|
+
gamma_g2: string;
|
|
42
|
+
};
|
|
@@ -22,6 +22,22 @@ export const NetworkToFaucetAPI: Record<string, string> = {
|
|
|
22
22
|
local: "http://127.0.0.1:8081",
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
export const NetworkToPepperAPI: Record<string, string> = {
|
|
26
|
+
mainnet: "https://api.mainnet.aptoslabs.com/keyless/pepper/v0",
|
|
27
|
+
testnet: "https://api.testnet.aptoslabs.com/keyless/pepper/v0",
|
|
28
|
+
devnet: "https://api.devnet.aptoslabs.com/keyless/pepper/v0",
|
|
29
|
+
// Use the devnet service for local environment
|
|
30
|
+
local: "https://api.devnet.aptoslabs.com/keyless/pepper/v0",
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const NetworkToProverAPI: Record<string, string> = {
|
|
34
|
+
mainnet: "https://api.mainnet.aptoslabs.com/keyless/prover/v0",
|
|
35
|
+
testnet: "https://api.testnet.aptoslabs.com/keyless/prover/v0",
|
|
36
|
+
devnet: "https://api.devnet.aptoslabs.com/keyless/prover/v0",
|
|
37
|
+
// Use the devnet service for local environment
|
|
38
|
+
local: "https://api.devnet.aptoslabs.com/keyless/prover/v0",
|
|
39
|
+
};
|
|
40
|
+
|
|
25
41
|
export enum Network {
|
|
26
42
|
MAINNET = "mainnet",
|
|
27
43
|
TESTNET = "testnet",
|
package/src/utils/const.ts
CHANGED
package/src/utils/helpers.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Copyright © Aptos Foundation
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
+
import { decode } from "js-base64";
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* Sleep the current thread for the given amount of time
|
|
6
8
|
* @param timeMs time in milliseconds to sleep
|
|
@@ -10,3 +12,23 @@ export async function sleep(timeMs: number): Promise<null> {
|
|
|
10
12
|
setTimeout(resolve, timeMs);
|
|
11
13
|
});
|
|
12
14
|
}
|
|
15
|
+
|
|
16
|
+
export const nowInSeconds = () => Math.floor(Date.now() / 1000);
|
|
17
|
+
|
|
18
|
+
export function floorToWholeHour(timestampInSeconds: number): number {
|
|
19
|
+
const date = new Date(timestampInSeconds * 1000);
|
|
20
|
+
// Reset minutes and seconds to zero
|
|
21
|
+
date.setMinutes(0);
|
|
22
|
+
date.setSeconds(0);
|
|
23
|
+
date.setMilliseconds(0);
|
|
24
|
+
return Math.floor(date.getTime() / 1000);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function base64UrlDecode(base64Url: string): string {
|
|
28
|
+
// Replace base64url-specific characters
|
|
29
|
+
const base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/");
|
|
30
|
+
// Pad the string with '=' characters if needed
|
|
31
|
+
const paddedBase64 = base64 + "==".substring(0, (3 - (base64.length % 3)) % 3);
|
|
32
|
+
const decodedString = decode(paddedBase64);
|
|
33
|
+
return decodedString;
|
|
34
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var l=(r,n,s,o)=>{for(var e=o>1?void 0:o?m(n,s):n,t=r.length-1,u;t>=0;t--)(u=r[t])&&(e=(o?u(n,s,e):u(e))||e);return o&&e&&i(n,s,e),e};async function p(r){return new Promise(n=>{setTimeout(n,r)})}exports.a = l; exports.b = p;
|
|
2
|
-
//# sourceMappingURL=chunk-KSEUZTKY.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/helpers.ts"],"names":["sleep","timeMs","resolve"],"mappings":"wMAOA,eAAsBA,EAAMC,EAA+B,CACzD,OAAO,IAAI,QAASC,GAAY,CAC9B,WAAWA,EAASD,CAAM,CAC5B,CAAC,CACH","sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/helpers.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\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"],"mappings":"AAOA,eAAsBA,EAAMC,EAA+B,CACzD,OAAO,IAAI,QAASC,GAAY,CAC9B,WAAWA,EAASD,CAAM,CAC5B,CAAC,CACH","names":["sleep","timeMs","resolve"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as t}from"./chunk-56CNRT2K.mjs";var n=class{constructor(e){this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e,0),this.offset=0}read(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Reached to the end of buffer");let i=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,i}deserializeStr(){let e=this.deserializeBytes();return new TextDecoder().decode(e)}deserializeBytes(){let e=this.deserializeUleb128AsU32();return new Uint8Array(this.read(e))}deserializeFixedBytes(e){return new Uint8Array(this.read(e))}deserializeBool(){let e=new Uint8Array(this.read(1))[0];if(e!==1&&e!==0)throw new Error("Invalid boolean value");return e===1}deserializeU8(){return new DataView(this.read(1)).getUint8(0)}deserializeU16(){return new DataView(this.read(2)).getUint16(0,!0)}deserializeU32(){return new DataView(this.read(4)).getUint32(0,!0)}deserializeU64(){let e=this.deserializeU32(),i=this.deserializeU32();return BigInt(BigInt(i)<<BigInt(32)|BigInt(e))}deserializeU128(){let e=this.deserializeU64(),i=this.deserializeU64();return BigInt(i<<BigInt(64)|e)}deserializeU256(){let e=this.deserializeU128(),i=this.deserializeU128();return BigInt(i<<BigInt(128)|e)}deserializeUleb128AsU32(){let e=BigInt(0),i=0;for(;e<t;){let r=this.deserializeU8();if(e|=BigInt(r&127)<<BigInt(i),!(r&128))break;i+=7}if(e>t)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(e)}deserialize(e){return e.deserialize(this)}deserializeVector(e){let i=this.deserializeUleb128AsU32(),r=new Array;for(let s=0;s<i;s+=1)r.push(this.deserialize(e));return r}};export{n as a};
|
|
2
|
-
//# sourceMappingURL=chunk-6IFMQ5AS.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bcs/deserializer.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable no-bitwise */\nimport { MAX_U32_NUMBER } from \"./consts\";\nimport { Uint8, Uint16, Uint32, Uint64, Uint128, Uint256 } from \"../types\";\n\n/**\n * This interface exists to define Deserializable<T> inputs for functions that\n * deserialize a byte buffer into a type T.\n * It is not intended to be implemented or extended, because Typescript has no support\n * for static methods in interfaces.\n */\nexport interface Deserializable<T> {\n deserialize(deserializer: Deserializer): T;\n}\n\nexport class Deserializer {\n private buffer: ArrayBuffer;\n\n private offset: number;\n\n constructor(data: Uint8Array) {\n // copies data to prevent outside mutation of buffer.\n this.buffer = new ArrayBuffer(data.length);\n new Uint8Array(this.buffer).set(data, 0);\n this.offset = 0;\n }\n\n private read(length: number): ArrayBuffer {\n if (this.offset + length > this.buffer.byteLength) {\n throw new Error(\"Reached to the end of buffer\");\n }\n\n const bytes = this.buffer.slice(this.offset, this.offset + length);\n this.offset += length;\n return bytes;\n }\n\n /**\n * Deserializes a string. UTF8 string is supported. Reads the string's bytes length \"l\" first,\n * and then reads \"l\" bytes of content. Decodes the byte array into a string.\n *\n * BCS layout for \"string\": string_length | string_content\n * where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.\n *\n * @example\n * ```ts\n * const deserializer = new Deserializer(new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));\n * assert(deserializer.deserializeStr() === \"1234abcd\");\n * ```\n */\n deserializeStr(): string {\n const value = this.deserializeBytes();\n const textDecoder = new TextDecoder();\n return textDecoder.decode(value);\n }\n\n /**\n * Deserializes an array of bytes.\n *\n * BCS layout for \"bytes\": bytes_length | bytes\n * where bytes_length is a u32 integer encoded as a uleb128 integer, equal to the length of the bytes array.\n */\n deserializeBytes(): Uint8Array {\n const len = this.deserializeUleb128AsU32();\n return new Uint8Array(this.read(len));\n }\n\n /**\n * Deserializes an array of bytes. The number of bytes to read is already known.\n *\n */\n deserializeFixedBytes(len: number): Uint8Array {\n return new Uint8Array(this.read(len));\n }\n\n /**\n * Deserializes a boolean value.\n *\n * BCS layout for \"boolean\": One byte. \"0x01\" for true and \"0x00\" for false.\n */\n deserializeBool(): boolean {\n const bool = new Uint8Array(this.read(1))[0];\n if (bool !== 1 && bool !== 0) {\n throw new Error(\"Invalid boolean value\");\n }\n return bool === 1;\n }\n\n /**\n * Deserializes a uint8 number.\n *\n * BCS layout for \"uint8\": One byte. Binary format in little-endian representation.\n */\n deserializeU8(): Uint8 {\n return new DataView(this.read(1)).getUint8(0);\n }\n\n /**\n * Deserializes a uint16 number.\n *\n * BCS layout for \"uint16\": Two bytes. Binary format in little-endian representation.\n * @example\n * ```ts\n * const deserializer = new Deserializer(new Uint8Array([0x34, 0x12]));\n * assert(deserializer.deserializeU16() === 4660);\n * ```\n */\n deserializeU16(): Uint16 {\n return new DataView(this.read(2)).getUint16(0, true);\n }\n\n /**\n * Deserializes a uint32 number.\n *\n * BCS layout for \"uint32\": Four bytes. Binary format in little-endian representation.\n * @example\n * ```ts\n * const deserializer = new Deserializer(new Uint8Array([0x78, 0x56, 0x34, 0x12]));\n * assert(deserializer.deserializeU32() === 305419896);\n * ```\n */\n deserializeU32(): Uint32 {\n return new DataView(this.read(4)).getUint32(0, true);\n }\n\n /**\n * Deserializes a uint64 number.\n *\n * BCS layout for \"uint64\": Eight bytes. Binary format in little-endian representation.\n * @example\n * ```ts\n * const deserializer = new Deserializer(new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));\n * assert(deserializer.deserializeU64() === 1311768467750121216);\n * ```\n */\n deserializeU64(): Uint64 {\n const low = this.deserializeU32();\n const high = this.deserializeU32();\n\n // combine the two 32-bit values and return (little endian)\n return BigInt((BigInt(high) << BigInt(32)) | BigInt(low));\n }\n\n /**\n * Deserializes a uint128 number.\n *\n * BCS layout for \"uint128\": Sixteen bytes. Binary format in little-endian representation.\n */\n deserializeU128(): Uint128 {\n const low = this.deserializeU64();\n const high = this.deserializeU64();\n\n // combine the two 64-bit values and return (little endian)\n return BigInt((high << BigInt(64)) | low);\n }\n\n /**\n * Deserializes a uint256 number.\n *\n * BCS layout for \"uint256\": Thirty-two bytes. Binary format in little-endian representation.\n */\n deserializeU256(): Uint256 {\n const low = this.deserializeU128();\n const high = this.deserializeU128();\n\n // combine the two 128-bit values and return (little endian)\n return BigInt((high << BigInt(128)) | low);\n }\n\n /**\n * Deserializes a uleb128 encoded uint32 number.\n *\n * BCS use uleb128 encoding in two cases: (1) lengths of variable-length sequences and (2) tags of enum values\n */\n deserializeUleb128AsU32(): Uint32 {\n let value: bigint = BigInt(0);\n let shift = 0;\n\n while (value < MAX_U32_NUMBER) {\n const byte = this.deserializeU8();\n value |= BigInt(byte & 0x7f) << BigInt(shift);\n\n if ((byte & 0x80) === 0) {\n break;\n }\n shift += 7;\n }\n\n if (value > MAX_U32_NUMBER) {\n throw new Error(\"Overflow while parsing uleb128-encoded uint32 value\");\n }\n\n return Number(value);\n }\n\n /**\n * Helper function that primarily exists to support alternative syntax for deserialization.\n * That is, if we have a `const deserializer: new Deserializer(...)`, instead of having to use\n * `MyClass.deserialize(deserializer)`, we can call `deserializer.deserialize(MyClass)`.\n *\n * @example const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));\n * const value = deserializer.deserialize(MyClass); // where MyClass has a `deserialize` function\n * // value is now an instance of MyClass\n * // equivalent to `const value = MyClass.deserialize(deserializer)`\n * @param cls The BCS-deserializable class to deserialize the buffered bytes into.\n *\n * @returns the deserialized value of class type T\n */\n deserialize<T>(cls: Deserializable<T>): T {\n // NOTE: `deserialize` in `cls.deserialize(this)` here is a static method defined in `cls`,\n // It is separate from the `deserialize` instance method defined here in Deserializer.\n return cls.deserialize(this);\n }\n\n /**\n * Deserializes an array of BCS Deserializable values given an existing Deserializer\n * instance with a loaded byte buffer.\n *\n * @param cls The BCS-deserializable class to deserialize the buffered bytes into.\n * @example\n * // serialize a vector of addresses\n * const addresses = new Array<AccountAddress>(\n * AccountAddress.from(\"0x1\"),\n * AccountAddress.from(\"0x2\"),\n * AccountAddress.from(\"0xa\"),\n * AccountAddress.from(\"0xb\"),\n * );\n * const serializer = new Serializer();\n * serializer.serializeVector(addresses);\n * const serializedBytes = serializer.toUint8Array();\n *\n * // deserialize the bytes into an array of addresses\n * const deserializer = new Deserializer(serializedBytes);\n * const deserializedAddresses = deserializer.deserializeVector(AccountAddress);\n * // deserializedAddresses is now an array of AccountAddress instances\n * @returns an array of deserialized values of type T\n */\n deserializeVector<T>(cls: Deserializable<T>): Array<T> {\n const length = this.deserializeUleb128AsU32();\n const vector = new Array<T>();\n for (let i = 0; i < length; i += 1) {\n vector.push(this.deserialize(cls));\n }\n return vector;\n }\n}\n"],"mappings":"yCAiBO,IAAMA,EAAN,KAAmB,CAKxB,YAAYC,EAAkB,CAE5B,KAAK,OAAS,IAAI,YAAYA,EAAK,MAAM,EACzC,IAAI,WAAW,KAAK,MAAM,EAAE,IAAIA,EAAM,CAAC,EACvC,KAAK,OAAS,CAChB,CAEQ,KAAKC,EAA6B,CACxC,GAAI,KAAK,OAASA,EAAS,KAAK,OAAO,WACrC,MAAM,IAAI,MAAM,8BAA8B,EAGhD,IAAMC,EAAQ,KAAK,OAAO,MAAM,KAAK,OAAQ,KAAK,OAASD,CAAM,EACjE,YAAK,QAAUA,EACRC,CACT,CAeA,gBAAyB,CACvB,IAAMC,EAAQ,KAAK,iBAAiB,EAEpC,OADoB,IAAI,YAAY,EACjB,OAAOA,CAAK,CACjC,CAQA,kBAA+B,CAC7B,IAAMC,EAAM,KAAK,wBAAwB,EACzC,OAAO,IAAI,WAAW,KAAK,KAAKA,CAAG,CAAC,CACtC,CAMA,sBAAsBA,EAAyB,CAC7C,OAAO,IAAI,WAAW,KAAK,KAAKA,CAAG,CAAC,CACtC,CAOA,iBAA2B,CACzB,IAAMC,EAAO,IAAI,WAAW,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,EAC3C,GAAIA,IAAS,GAAKA,IAAS,EACzB,MAAM,IAAI,MAAM,uBAAuB,EAEzC,OAAOA,IAAS,CAClB,CAOA,eAAuB,CACrB,OAAO,IAAI,SAAS,KAAK,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAC9C,CAYA,gBAAyB,CACvB,OAAO,IAAI,SAAS,KAAK,KAAK,CAAC,CAAC,EAAE,UAAU,EAAG,EAAI,CACrD,CAYA,gBAAyB,CACvB,OAAO,IAAI,SAAS,KAAK,KAAK,CAAC,CAAC,EAAE,UAAU,EAAG,EAAI,CACrD,CAYA,gBAAyB,CACvB,IAAMC,EAAM,KAAK,eAAe,EAC1BC,EAAO,KAAK,eAAe,EAGjC,OAAO,OAAQ,OAAOA,CAAI,GAAK,OAAO,EAAE,EAAK,OAAOD,CAAG,CAAC,CAC1D,CAOA,iBAA2B,CACzB,IAAMA,EAAM,KAAK,eAAe,EAC1BC,EAAO,KAAK,eAAe,EAGjC,OAAO,OAAQA,GAAQ,OAAO,EAAE,EAAKD,CAAG,CAC1C,CAOA,iBAA2B,CACzB,IAAMA,EAAM,KAAK,gBAAgB,EAC3BC,EAAO,KAAK,gBAAgB,EAGlC,OAAO,OAAQA,GAAQ,OAAO,GAAG,EAAKD,CAAG,CAC3C,CAOA,yBAAkC,CAChC,IAAIH,EAAgB,OAAO,CAAC,EACxBK,EAAQ,EAEZ,KAAOL,EAAQM,GAAgB,CAC7B,IAAMC,EAAO,KAAK,cAAc,EAGhC,GAFAP,GAAS,OAAOO,EAAO,GAAI,GAAK,OAAOF,CAAK,EAEvC,EAAAE,EAAO,KACV,MAEFF,GAAS,CACX,CAEA,GAAIL,EAAQM,EACV,MAAM,IAAI,MAAM,qDAAqD,EAGvE,OAAO,OAAON,CAAK,CACrB,CAeA,YAAeQ,EAA2B,CAGxC,OAAOA,EAAI,YAAY,IAAI,CAC7B,CAyBA,kBAAqBA,EAAkC,CACrD,IAAMV,EAAS,KAAK,wBAAwB,EACtCW,EAAS,IAAI,MACnB,QAASC,EAAI,EAAGA,EAAIZ,EAAQY,GAAK,EAC/BD,EAAO,KAAK,KAAK,YAAYD,CAAG,CAAC,EAEnC,OAAOC,CACT,CACF","names":["Deserializer","data","length","bytes","value","len","bool","low","high","shift","MAX_U32_NUMBER","byte","cls","vector","i"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as s}from"./chunk-2HF2XEHO.mjs";import{a as e}from"./chunk-3JPVQHOR.mjs";var n=()=>Math.floor(Date.now()/1e3),r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
|
|
2
|
-
//# sourceMappingURL=chunk-746MU2AB.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/transactions/management/accountSequenceNumber.ts"],"sourcesContent":["/**\n * A wrapper that handles and manages an account sequence number.\n *\n * Submit up to `maximumInFlight` transactions per account in parallel with a timeout of `sleepTime`\n * If local assumes `maximumInFlight` are in flight, determine the actual committed state from the network\n * If there are less than `maximumInFlight` due to some being committed, adjust the window\n * If `maximumInFlight` are in flight, wait `sleepTime` seconds before re-evaluating\n * If ever waiting more than `maxWaitTime` restart the sequence number to the current on-chain state\n *\n * Assumptions:\n * Accounts are expected to be managed by a single AccountSequenceNumber and not used otherwise.\n * They are initialized to the current on-chain state, so if there are already transactions in\n * flight, they may take some time to reset.\n * Accounts are automatically initialized if not explicitly\n *\n * Notes:\n * This is co-routine safe, that is many async tasks can be reading from this concurrently.\n * The state of an account cannot be used across multiple AccountSequenceNumber services.\n * The synchronize method will create a barrier that prevents additional nextSequenceNumber\n * calls until it is complete.\n * This only manages the distribution of sequence numbers it does not help handle transaction\n * failures.\n * If a transaction fails, you should call synchronize and wait for timeouts.\n */\n\nimport { AptosConfig } from \"../../api/aptosConfig\";\nimport { Account } from \"../../account\";\nimport { getInfo } from \"../../internal/account\";\nimport { sleep } from \"../../utils/helpers\";\n\n// returns `now` time in seconds\nconst now = () => Math.floor(Date.now() / 1000);\n\nexport class AccountSequenceNumber {\n readonly aptosConfig: AptosConfig;\n\n readonly account: Account;\n\n // sequence number on chain\n lastUncommintedNumber: bigint | null = null;\n\n // local sequence number\n currentNumber: bigint | null = null;\n\n /**\n * We want to guarantee that we preserve ordering of workers to requests.\n *\n * `lock` is used to try to prevent multiple coroutines from accessing a shared resource at the same time,\n * which can result in race conditions and data inconsistency.\n * This code actually doesn't do it though, since we aren't giving out a slot, it is still somewhat a race condition.\n *\n * The ideal solution is likely that each thread grabs the next number from a incremental integer.\n * When they complete, they increment that number and that entity is able to enter the `lock`.\n * That would guarantee ordering.\n */\n lock = false;\n\n maxWaitTime: number;\n\n maximumInFlight: number;\n\n sleepTime: number;\n\n constructor(\n aptosConfig: AptosConfig,\n account: Account,\n maxWaitTime: number,\n maximumInFlight: number,\n sleepTime: number,\n ) {\n this.aptosConfig = aptosConfig;\n this.account = account;\n this.maxWaitTime = maxWaitTime;\n this.maximumInFlight = maximumInFlight;\n this.sleepTime = sleepTime;\n }\n\n /**\n * Returns the next available sequence number for this account\n *\n * @returns next available sequence number\n */\n async nextSequenceNumber(): Promise<bigint | null> {\n /* eslint-disable no-await-in-loop */\n while (this.lock) {\n await sleep(this.sleepTime);\n }\n\n this.lock = true;\n let nextNumber = BigInt(0);\n try {\n if (this.lastUncommintedNumber === null || this.currentNumber === null) {\n await this.initialize();\n }\n\n if (this.currentNumber! - this.lastUncommintedNumber! >= this.maximumInFlight) {\n await this.update();\n\n const startTime = now();\n while (this.currentNumber! - this.lastUncommintedNumber! >= this.maximumInFlight) {\n await sleep(this.sleepTime);\n if (now() - startTime > this.maxWaitTime) {\n /* eslint-disable no-console */\n console.warn(\n `Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`,\n );\n await this.initialize();\n } else {\n await this.update();\n }\n }\n }\n nextNumber = this.currentNumber!;\n this.currentNumber! += BigInt(1);\n } catch (e) {\n console.error(\"error in getting next sequence number for this account\", e);\n } finally {\n this.lock = false;\n }\n return nextNumber;\n }\n\n /**\n * Initializes this account with the sequence number on chain\n */\n async initialize(): Promise<void> {\n const { sequence_number: sequenceNumber } = await getInfo({\n aptosConfig: this.aptosConfig,\n accountAddress: this.account.accountAddress,\n });\n this.currentNumber = BigInt(sequenceNumber);\n this.lastUncommintedNumber = BigInt(sequenceNumber);\n }\n\n /**\n * Updates this account sequence number with the one on-chain\n *\n * @returns on-chain sequence number for this account\n */\n async update(): Promise<bigint> {\n const { sequence_number: sequenceNumber } = await getInfo({\n aptosConfig: this.aptosConfig,\n accountAddress: this.account.accountAddress,\n });\n this.lastUncommintedNumber = BigInt(sequenceNumber);\n return this.lastUncommintedNumber;\n }\n\n /**\n * Synchronizes local sequence number with the seqeunce number on chain for this account.\n *\n * Poll the network until all submitted transactions have either been committed or until\n * the maximum wait time has elapsed\n */\n async synchronize(): Promise<void> {\n if (this.lastUncommintedNumber === this.currentNumber) return;\n\n /* eslint-disable no-await-in-loop */\n while (this.lock) {\n await sleep(this.sleepTime);\n }\n\n this.lock = true;\n\n try {\n await this.update();\n const startTime = now();\n while (this.lastUncommintedNumber !== this.currentNumber) {\n if (now() - startTime > this.maxWaitTime) {\n /* eslint-disable no-console */\n console.warn(\n `Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`,\n );\n await this.initialize();\n } else {\n await sleep(this.sleepTime);\n await this.update();\n }\n }\n } catch (e) {\n console.error(\"error in synchronizing this account sequence number with the one on chain\", e);\n } finally {\n this.lock = false;\n }\n }\n}\n"],"mappings":"kFA+BA,IAAMA,EAAM,IAAM,KAAK,MAAM,KAAK,IAAI,EAAI,GAAI,EAEjCC,EAAN,KAA4B,CA8BjC,YACEC,EACAC,EACAC,EACAC,EACAC,EACA,CA9BF,2BAAuC,KAGvC,mBAA+B,KAa/B,UAAO,GAeL,KAAK,YAAcJ,EACnB,KAAK,QAAUC,EACf,KAAK,YAAcC,EACnB,KAAK,gBAAkBC,EACvB,KAAK,UAAYC,CACnB,CAOA,MAAM,oBAA6C,CAEjD,KAAO,KAAK,MACV,MAAMC,EAAM,KAAK,SAAS,EAG5B,KAAK,KAAO,GACZ,IAAIC,EAAa,OAAO,CAAC,EACzB,GAAI,CAKF,IAJI,KAAK,wBAA0B,MAAQ,KAAK,gBAAkB,OAChE,MAAM,KAAK,WAAW,EAGpB,KAAK,cAAiB,KAAK,uBAA0B,KAAK,gBAAiB,CAC7E,MAAM,KAAK,OAAO,EAElB,IAAMC,EAAYT,EAAI,EACtB,KAAO,KAAK,cAAiB,KAAK,uBAA0B,KAAK,iBAC/D,MAAMO,EAAM,KAAK,SAAS,EACtBP,EAAI,EAAIS,EAAY,KAAK,aAE3B,QAAQ,KACN,iEAAiE,KAAK,QAAQ,eAAe,SAAS,CAAC,EACzG,EACA,MAAM,KAAK,WAAW,GAEtB,MAAM,KAAK,OAAO,CAGxB,CACAD,EAAa,KAAK,cAClB,KAAK,eAAkB,OAAO,CAAC,CACjC,OAASE,EAAG,CACV,QAAQ,MAAM,yDAA0DA,CAAC,CAC3E,QAAE,CACA,KAAK,KAAO,EACd,CACA,OAAOF,CACT,CAKA,MAAM,YAA4B,CAChC,GAAM,CAAE,gBAAiBG,CAAe,EAAI,MAAMC,EAAQ,CACxD,YAAa,KAAK,YAClB,eAAgB,KAAK,QAAQ,cAC/B,CAAC,EACD,KAAK,cAAgB,OAAOD,CAAc,EAC1C,KAAK,sBAAwB,OAAOA,CAAc,CACpD,CAOA,MAAM,QAA0B,CAC9B,GAAM,CAAE,gBAAiBA,CAAe,EAAI,MAAMC,EAAQ,CACxD,YAAa,KAAK,YAClB,eAAgB,KAAK,QAAQ,cAC/B,CAAC,EACD,YAAK,sBAAwB,OAAOD,CAAc,EAC3C,KAAK,qBACd,CAQA,MAAM,aAA6B,CACjC,GAAI,KAAK,wBAA0B,KAAK,cAGxC,MAAO,KAAK,MACV,MAAMJ,EAAM,KAAK,SAAS,EAG5B,KAAK,KAAO,GAEZ,GAAI,CACF,MAAM,KAAK,OAAO,EAClB,IAAME,EAAYT,EAAI,EACtB,KAAO,KAAK,wBAA0B,KAAK,eACrCA,EAAI,EAAIS,EAAY,KAAK,aAE3B,QAAQ,KACN,iEAAiE,KAAK,QAAQ,eAAe,SAAS,CAAC,EACzG,EACA,MAAM,KAAK,WAAW,IAEtB,MAAMF,EAAM,KAAK,SAAS,EAC1B,MAAM,KAAK,OAAO,EAGxB,OAASG,EAAG,CACV,QAAQ,MAAM,4EAA6EA,CAAC,CAC9F,QAAE,CACA,KAAK,KAAO,EACd,EACF,CACF","names":["now","AccountSequenceNumber","aptosConfig","account","maxWaitTime","maximumInFlight","sleepTime","sleep","nextNumber","startTime","e","sequenceNumber","getInfo"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{spawn as n}from"child_process";import{platform as p}from"os";var i=class{async init(e){let{network:t,profile:s}=e,r=["aptos","init",`--network=${t??"local"}`,`--profile=${s??"default"}`];return this.runCommand(r)}async compile(e){let{packageDirectoryPath:t,namedAddresses:s}=e,r=["aptos","move","compile","--package-dir",t,"--skip-fetch-latest-git-deps"],o=this.parseNamedAddresses(s);return r.push(...this.prepareNamedAddresses(o)),this.runCommand(r)}async test(e){let{packageDirectoryPath:t,namedAddresses:s}=e,r=["aptos","move","test","--package-dir",t,"--skip-fetch-latest-git-deps"],o=this.parseNamedAddresses(s);return r.push(...this.prepareNamedAddresses(o)),this.runCommand(r)}async publish(e){let{packageDirectoryPath:t,namedAddresses:s,profile:r}=e,o=["aptos","move","publish","--package-dir",t,"--skip-fetch-latest-git-deps",`--profile=${r??"default"}`],a=this.parseNamedAddresses(s);return o.push(...this.prepareNamedAddresses(a)),this.runCommand(o)}async runCommand(e){return new Promise((t,s)=>{let r=p(),o;r==="win32"?o=n("npx",e,{shell:!0}):o=n("npx",e),o.stdout.pipe(process.stdout),o.stderr.pipe(process.stderr),process.stdin.pipe(o.stdin),o.on("close",a=>{a===0?t(!0):s(new Error(`Child process exited with code ${a}`))})})}prepareNamedAddresses(e){let t=e.size,s=[];if(t===0)return s;s.push("--named-addresses");let r=0;return e.forEach((o,a)=>{r+=1;let d=`${a}=${o.toString()}`;r<t-1&&(d+=","),s.push(d)}),s}parseNamedAddresses(e){let t=new Map;return Object.keys(e).forEach(s=>{let r=e[s];t.set(s,r)}),t}};export{i as a};
|
|
2
|
-
//# sourceMappingURL=chunk-7UBKXR37.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as i}from"./chunk-SUAMDMAA.mjs";async function s(e){let{type:t,originMethod:o,path:p,body:r,acceptType:R,contentType:f,params:c,aptosConfig:n,overrides:d}=e,g=n.getRequestUrl(t);return i({url:g,method:"POST",originMethod:o,path:p,body:r,contentType:f,acceptType:R,params:c,overrides:d},n,e.type)}async function y(e){let{aptosConfig:t}=e;return s({...e,type:"Fullnode",overrides:{...t.clientConfig,...t.fullnodeConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.fullnodeConfig?.HEADERS}}})}async function m(e){let{aptosConfig:t}=e;return s({...e,type:"Indexer",overrides:{...t.clientConfig,...t.indexerConfig,...e.overrides,HEADERS:{...t.clientConfig?.HEADERS,...t.indexerConfig?.HEADERS}}})}async function a(e){let{aptosConfig:t}=e,o={...t,clientConfig:{...t.clientConfig}};return delete o?.clientConfig?.API_KEY,s({...e,type:"Faucet",overrides:{...o.clientConfig,...o.faucetConfig,...e.overrides,HEADERS:{...o.clientConfig?.HEADERS,...o.faucetConfig?.HEADERS}}})}export{s as a,y as b,m as c,a as d};
|
|
2
|
-
//# sourceMappingURL=chunk-BRVWHCP3.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var t=(S=>(S.FULLNODE="Fullnode",S.INDEXER="Indexer",S.FAUCET="Faucet",S))(t||{}),E=2e5,n=20,A=20,R="0x1::aptos_coin::AptosCoin",o="APTOS::RawTransaction",T="APTOS::RawTransactionWithData",O=(_=>(_.ACCOUNT_TRANSACTION_PROCESSOR="account_transactions_processor",_.DEFAULT="default_processor",_.EVENTS_PROCESSOR="events_processor",_.FUNGIBLE_ASSET_PROCESSOR="fungible_asset_processor",_.STAKE_PROCESSOR="stake_processor",_.TOKEN_V2_PROCESSOR="token_v2_processor",_.USER_TRANSACTION_PROCESSOR="user_transaction_processor",_))(O||{});export{t as a,E as b,n as c,A as d,R as e,o as f,T as g,O as h};
|
|
2
|
-
//# sourceMappingURL=chunk-CYNQRMO5.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/const.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * Type of API endpoint for request routing\n */\nexport enum AptosApiType {\n FULLNODE = \"Fullnode\",\n INDEXER = \"Indexer\",\n FAUCET = \"Faucet\",\n}\n\n/**\n * The default max gas amount when none is given.\n *\n * This is the maximum number of gas units that will be used by a transaction before being rejected.\n *\n * Note that max gas amount varies based on the transaction. A larger transaction will go over this\n * default gas amount, and the value will need to be changed for the specific transaction.\n */\nexport const DEFAULT_MAX_GAS_AMOUNT = 200000;\n\n/**\n * The default transaction expiration seconds from now.\n *\n * This time is how long until the blockchain nodes will reject the transaction.\n *\n * Note that the transaction expiration time varies based on network connection and network load. It may need to be\n * increased for the transaction to be processed.\n */\nexport const DEFAULT_TXN_EXP_SEC_FROM_NOW = 20;\n\n/**\n * The default number of seconds to wait for a transaction to be processed.\n *\n * This time is the amount of time that the SDK will wait for a transaction to be processed when waiting for\n * the results of the transaction. It may take longer based on network connection and network load.\n */\nexport const DEFAULT_TXN_TIMEOUT_SEC = 20;\n\n/**\n * The default gas currency for the network.\n */\nexport const APTOS_COIN = \"0x1::aptos_coin::AptosCoin\";\n\nexport const RAW_TRANSACTION_SALT = \"APTOS::RawTransaction\";\nexport const RAW_TRANSACTION_WITH_DATA_SALT = \"APTOS::RawTransactionWithData\";\n\n/**\n * The list of supported Processor types for our indexer api.\n *\n * These can be found from the processor_status table in the indexer database.\n * {@link https://cloud.hasura.io/public/graphiql?endpoint=https://api.mainnet.aptoslabs.com/v1/graphql}\n */\nexport enum ProcessorType {\n ACCOUNT_TRANSACTION_PROCESSOR = \"account_transactions_processor\",\n DEFAULT = \"default_processor\",\n EVENTS_PROCESSOR = \"events_processor\",\n // Fungible asset processor also handles coins\n FUNGIBLE_ASSET_PROCESSOR = \"fungible_asset_processor\",\n STAKE_PROCESSOR = \"stake_processor\",\n // Token V2 processor replaces Token processor (not only for digital assets)\n TOKEN_V2_PROCESSOR = \"token_v2_processor\",\n USER_TRANSACTION_PROCESSOR = \"user_transaction_processor\",\n}\n"],"mappings":"AAMO,IAAKA,OACVA,EAAA,SAAW,WACXA,EAAA,QAAU,UACVA,EAAA,OAAS,SAHCA,OAAA,IAcCC,EAAyB,IAUzBC,EAA+B,GAQ/BC,EAA0B,GAK1BC,EAAa,6BAEbC,EAAuB,wBACvBC,EAAiC,gCAQlCC,OACVA,EAAA,8BAAgC,iCAChCA,EAAA,QAAU,oBACVA,EAAA,iBAAmB,mBAEnBA,EAAA,yBAA2B,2BAC3BA,EAAA,gBAAkB,kBAElBA,EAAA,mBAAqB,qBACrBA,EAAA,2BAA6B,6BATnBA,OAAA","names":["AptosApiType","DEFAULT_MAX_GAS_AMOUNT","DEFAULT_TXN_EXP_SEC_FROM_NOW","DEFAULT_TXN_TIMEOUT_SEC","APTOS_COIN","RAW_TRANSACTION_SALT","RAW_TRANSACTION_WITH_DATA_SALT","ProcessorType"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as l}from"./chunk-337U6Q6K.mjs";import{a as u}from"./chunk-J5I4OZAS.mjs";import{a as m}from"./chunk-ZHCSSCC5.mjs";import{a as h}from"./chunk-CT2BQQTZ.mjs";import{a as p}from"./chunk-3BNA74V5.mjs";import{a as A}from"./chunk-RTSWVT2Q.mjs";import{a as r}from"./chunk-ND6OMSQU.mjs";import{a}from"./chunk-LGNSPATO.mjs";import{a as c}from"./chunk-3SPIFLBZ.mjs";import{a as f}from"./chunk-RNL5TAQT.mjs";import{a as g}from"./chunk-FAFJKSVZ.mjs";import{a as s}from"./chunk-G2UPF44Z.mjs";var t=class{constructor(i){this.config=new A(i),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new f(this.config),this.fungibleAsset=new g(this.config),this.general=new l(this.config),this.staking=new u(this.config),this.transaction=new h(this.config),this.table=new m(this.config)}};function n(y,i,d){Object.getOwnPropertyNames(i.prototype).forEach(e=>{let o=Object.getOwnPropertyDescriptor(i.prototype,e);o&&(o.value=function(...b){return this[d][e](...b)},Object.defineProperty(y.prototype,e,o))})}n(t,s,"account");n(t,p,"ans");n(t,r,"coin");n(t,a,"digitalAsset");n(t,c,"event");n(t,f,"faucet");n(t,g,"fungibleAsset");n(t,l,"general");n(t,u,"staking");n(t,h,"transaction");n(t,m,"table");export{t as a};
|
|
2
|
-
//# sourceMappingURL=chunk-D2LNQMKD.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/aptos.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"./account\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { Coin } from \"./coin\";\nimport { DigitalAsset } from \"./digitalAsset\";\nimport { Event } from \"./event\";\nimport { Faucet } from \"./faucet\";\nimport { FungibleAsset } from \"./fungibleAsset\";\nimport { General } from \"./general\";\nimport { ANS } from \"./ans\";\nimport { Staking } from \"./staking\";\nimport { Transaction } from \"./transaction\";\nimport { Table } from \"./table\";\n\n/**\n * This class is the main entry point into Aptos's\n * APIs and separates functionality into different namespaces.\n *\n * To use the SDK, create a new Aptos instance to get access\n * to all the sdk functionality.\n *\n * @example\n *\n * const aptos = new Aptos();\n */\nexport class Aptos {\n readonly config: AptosConfig;\n\n readonly account: Account;\n\n readonly ans: ANS;\n\n readonly coin: Coin;\n\n readonly digitalAsset: DigitalAsset;\n\n readonly event: Event;\n\n readonly faucet: Faucet;\n\n readonly fungibleAsset: FungibleAsset;\n\n readonly general: General;\n\n readonly staking: Staking;\n\n readonly transaction: Transaction;\n\n readonly table: Table;\n\n constructor(settings?: AptosConfig) {\n this.config = new AptosConfig(settings);\n this.account = new Account(this.config);\n this.ans = new ANS(this.config);\n this.coin = new Coin(this.config);\n this.digitalAsset = new DigitalAsset(this.config);\n this.event = new Event(this.config);\n this.faucet = new Faucet(this.config);\n this.fungibleAsset = new FungibleAsset(this.config);\n this.general = new General(this.config);\n this.staking = new Staking(this.config);\n this.transaction = new Transaction(this.config);\n this.table = new Table(this.config);\n }\n}\n\n// extends Aptos interface so all the methods and properties\n// from the other classes will be recognized by typescript.\nexport interface Aptos\n extends Account,\n ANS,\n Coin,\n DigitalAsset,\n Event,\n Faucet,\n FungibleAsset,\n General,\n Staking,\n Table,\n Omit<Transaction, \"build\" | \"simulate\" | \"submit\" | \"batch\"> {}\n\n/**\nIn TypeScript, we can’t inherit or extend from more than one class,\nMixins helps us to get around that by creating a partial classes\nthat we can combine to form a single class that contains all the methods and properties from the partial classes.\n{@link https://www.typescriptlang.org/docs/handbook/mixins.html#alternative-pattern}\n\nHere, we combine any subclass and the Aptos class.\n*/\nfunction applyMixin(targetClass: any, baseClass: any, baseClassProp: string) {\n // Mixin instance methods\n Object.getOwnPropertyNames(baseClass.prototype).forEach((propertyName) => {\n const propertyDescriptor = Object.getOwnPropertyDescriptor(baseClass.prototype, propertyName);\n if (!propertyDescriptor) return;\n // eslint-disable-next-line func-names\n propertyDescriptor.value = function (...args: any) {\n return (this as any)[baseClassProp][propertyName](...args);\n };\n Object.defineProperty(targetClass.prototype, propertyName, propertyDescriptor);\n });\n}\n\napplyMixin(Aptos, Account, \"account\");\napplyMixin(Aptos, ANS, \"ans\");\napplyMixin(Aptos, Coin, \"coin\");\napplyMixin(Aptos, DigitalAsset, \"digitalAsset\");\napplyMixin(Aptos, Event, \"event\");\napplyMixin(Aptos, Faucet, \"faucet\");\napplyMixin(Aptos, FungibleAsset, \"fungibleAsset\");\napplyMixin(Aptos, General, \"general\");\napplyMixin(Aptos, Staking, \"staking\");\napplyMixin(Aptos, Transaction, \"transaction\");\napplyMixin(Aptos, Table, \"table\");\n"],"mappings":"ueA2BO,IAAMA,EAAN,KAAY,CAyBjB,YAAYC,EAAwB,CAClC,KAAK,OAAS,IAAIC,EAAYD,CAAQ,EACtC,KAAK,QAAU,IAAIE,EAAQ,KAAK,MAAM,EACtC,KAAK,IAAM,IAAIC,EAAI,KAAK,MAAM,EAC9B,KAAK,KAAO,IAAIC,EAAK,KAAK,MAAM,EAChC,KAAK,aAAe,IAAIC,EAAa,KAAK,MAAM,EAChD,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,cAAgB,IAAIC,EAAc,KAAK,MAAM,EAClD,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,YAAc,IAAIC,EAAY,KAAK,MAAM,EAC9C,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,CACpC,CACF,EAyBA,SAASC,EAAWC,EAAkBC,EAAgBC,EAAuB,CAE3E,OAAO,oBAAoBD,EAAU,SAAS,EAAE,QAASE,GAAiB,CACxE,IAAMC,EAAqB,OAAO,yBAAyBH,EAAU,UAAWE,CAAY,EACvFC,IAELA,EAAmB,MAAQ,YAAaC,EAAW,CACjD,OAAQ,KAAaH,CAAa,EAAEC,CAAY,EAAE,GAAGE,CAAI,CAC3D,EACA,OAAO,eAAeL,EAAY,UAAWG,EAAcC,CAAkB,EAC/E,CAAC,CACH,CAEAL,EAAWd,EAAOG,EAAS,SAAS,EACpCW,EAAWd,EAAOI,EAAK,KAAK,EAC5BU,EAAWd,EAAOK,EAAM,MAAM,EAC9BS,EAAWd,EAAOM,EAAc,cAAc,EAC9CQ,EAAWd,EAAOO,EAAO,OAAO,EAChCO,EAAWd,EAAOQ,EAAQ,QAAQ,EAClCM,EAAWd,EAAOS,EAAe,eAAe,EAChDK,EAAWd,EAAOU,EAAS,SAAS,EACpCI,EAAWd,EAAOW,EAAS,SAAS,EACpCG,EAAWd,EAAOY,EAAa,aAAa,EAC5CE,EAAWd,EAAOa,EAAO,OAAO","names":["Aptos","settings","AptosConfig","Account","ANS","Coin","DigitalAsset","Event","Faucet","FungibleAsset","General","Staking","Transaction","Table","applyMixin","targetClass","baseClass","baseClassProp","propertyName","propertyDescriptor","args"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e as o}from"./chunk-3N6N3KOS.mjs";import{a as g,b as c}from"./chunk-PIVZMT5D.mjs";var y=class a{constructor(i){let{multiKey:n,signers:s}=i;this.publicKey=n,this.signingScheme=3,this.accountAddress=this.publicKey.authKey().derivedAddress();let r=[];for(let e of s)r.push(this.publicKey.getIndex(e.publicKey));let t=s.map((e,u)=>[e,r[u]]);t.sort((e,u)=>e[1]-u[1]),this.signers=t.map(e=>e[0]),this.signerIndicies=t.map(e=>e[1]),this.signaturesBitmap=this.publicKey.createBitmap({bits:r})}static fromPublicKeysAndSigners(i){let{publicKeys:n,signaturesRequired:s,signers:r}=i,t=new g({publicKeys:n,signaturesRequired:s});return new a({multiKey:t,signers:r})}static isMultiKeySigner(i){return i instanceof a}signWithAuthenticator(i){return new o(this.publicKey,this.sign(i))}signTransactionWithAuthenticator(i){return new o(this.publicKey,this.signTransaction(i))}sign(i){let n=[];for(let s of this.signers)n.push(s.sign(i));return new c({signatures:n,bitmap:this.signaturesBitmap})}signTransaction(i){let n=[];for(let s of this.signers)n.push(s.signTransaction(i));return new c({signatures:n,bitmap:this.signaturesBitmap})}verifySignature(i){let{message:n,signature:s}=i;if(!this.signerIndicies.every((t,e)=>e===0||t>=this.signerIndicies[e-1]))return!1;for(let t=0;t<s.signatures.length;t+=1){let e=s.signatures[t];if(!this.publicKey.publicKeys[this.signerIndicies[t]].verifySignature({message:n,signature:e}))return!1}return!0}};export{y as a};
|
|
2
|
-
//# sourceMappingURL=chunk-DLAIJ2UM.mjs.map
|