@aptos-labs/ts-sdk 1.14.0 → 1.15.0
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-csDQ8Gnp.d.ts → accountAddress-ccLvlUQe.d.ts} +20 -1
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/index.d.ts +1624 -1390
- package/dist/common/index.js +42 -13
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account--qjfup2u.d.mts → Ed25519Account-B1VMJOY2.d.mts} +77 -10
- package/dist/esm/account/Account.d.mts +34 -0
- package/dist/esm/account/Account.mjs +2 -0
- package/dist/esm/account/Ed25519Account.d.mts +34 -0
- package/dist/esm/account/Ed25519Account.mjs +2 -0
- package/dist/esm/account/MultiKeyAccount.d.mts +133 -0
- package/dist/esm/account/MultiKeyAccount.mjs +2 -0
- package/dist/esm/account/SingleKeyAccount.d.mts +34 -0
- package/dist/esm/account/SingleKeyAccount.mjs +2 -0
- package/dist/esm/account/index.d.mts +35 -0
- package/dist/esm/account/index.mjs +2 -0
- package/dist/esm/api/account.d.mts +14 -2
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +3 -3
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +11 -9
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/coin.d.mts +7 -7
- 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.d.mts +6 -6
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +8 -33
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +10 -9
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.d.mts +84 -0
- package/dist/esm/api/table.mjs +2 -0
- package/dist/esm/api/transaction.d.mts +2 -2
- 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.d.mts +9 -9
- 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 +7 -7
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.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.mjs +1 -1
- package/dist/esm/{chunk-O4JRPZZM.mjs → chunk-2X7A4HUS.mjs} +2 -2
- package/dist/esm/{chunk-PXFIA4BL.mjs → chunk-2XK53QFA.mjs} +2 -2
- package/dist/esm/{chunk-RHBCVCOS.mjs → chunk-35EWRSDK.mjs} +2 -2
- package/dist/esm/{chunk-52C73T26.mjs → chunk-36QXVFR5.mjs} +2 -2
- package/dist/esm/{chunk-P3UFJZY5.mjs → chunk-3Y46WJUR.mjs} +2 -2
- package/dist/esm/chunk-3Y46WJUR.mjs.map +1 -0
- package/dist/esm/{chunk-FXNFWLQC.mjs → chunk-4GWNWSZP.mjs} +2 -2
- package/dist/esm/chunk-4NHWV5AI.mjs +2 -0
- package/dist/esm/chunk-53INTTOI.mjs +2 -0
- package/dist/esm/{chunk-NPFNYP75.mjs → chunk-5EN52MUT.mjs} +2 -2
- package/dist/esm/{chunk-BIAEC6FO.mjs → chunk-A4JUQZXI.mjs} +2 -2
- package/dist/esm/chunk-AF5WNJOP.mjs +2 -0
- package/dist/esm/{chunk-BAV4XY7C.mjs → chunk-AHW3SKT7.mjs} +2 -2
- package/dist/esm/chunk-B7X6PSE7.mjs +2 -0
- package/dist/esm/chunk-BBKE2QJU.mjs +2 -0
- package/dist/esm/chunk-BBKE2QJU.mjs.map +1 -0
- package/dist/esm/{chunk-AOCNYMMX.mjs → chunk-BCUSI3N6.mjs} +2 -2
- package/dist/esm/{chunk-QD2Y3VK4.mjs → chunk-BN22EYXR.mjs} +2 -2
- package/dist/esm/chunk-BN22EYXR.mjs.map +1 -0
- package/dist/esm/chunk-CEHCDA3G.mjs +2 -0
- package/dist/esm/{chunk-PMUT3HZE.mjs → chunk-CHWE77CR.mjs} +2 -2
- package/dist/esm/chunk-CHWE77CR.mjs.map +1 -0
- package/dist/esm/chunk-CJDEPZ4J.mjs +2 -0
- package/dist/esm/{chunk-CPBGL37X.mjs.map → chunk-CJDEPZ4J.mjs.map} +1 -1
- package/dist/esm/{chunk-4P5EKAJB.mjs → chunk-CYTRYBWN.mjs} +2 -2
- package/dist/esm/{chunk-NWYIE7ZX.mjs → chunk-DZSDCUP2.mjs} +2 -2
- package/dist/esm/chunk-E56MTU2U.mjs +2 -0
- package/dist/esm/chunk-E56MTU2U.mjs.map +1 -0
- package/dist/esm/{chunk-5HY3DEPF.mjs → chunk-EA2DKJPX.mjs} +2 -2
- package/dist/esm/{chunk-HG4Q4EFG.mjs → chunk-ERIPXWXJ.mjs} +2 -2
- package/dist/esm/chunk-ERIPXWXJ.mjs.map +1 -0
- package/dist/esm/chunk-EZPUVLME.mjs +2 -0
- package/dist/esm/chunk-F4GDEXZ6.mjs +2 -0
- package/dist/esm/chunk-F4GDEXZ6.mjs.map +1 -0
- package/dist/esm/chunk-F7EMGK4M.mjs +2 -0
- package/dist/esm/chunk-F7NLNWHN.mjs +2 -0
- package/dist/esm/chunk-F7NLNWHN.mjs.map +1 -0
- package/dist/esm/chunk-FFGY7Z4B.mjs +2 -0
- package/dist/esm/chunk-FFGY7Z4B.mjs.map +1 -0
- package/dist/esm/{chunk-FS3NSGBF.mjs → chunk-G56GPLTB.mjs} +2 -2
- package/dist/esm/{chunk-6FBKUTGF.mjs → chunk-GHYE26Q5.mjs} +2 -2
- package/dist/esm/{chunk-QTRYMRYK.mjs → chunk-GM56MMNJ.mjs} +2 -2
- package/dist/esm/chunk-GP6Z47HM.mjs +2 -0
- package/dist/esm/chunk-GP6Z47HM.mjs.map +1 -0
- package/dist/esm/chunk-GPEM3JVU.mjs +2 -0
- package/dist/esm/{chunk-6OV2PQS5.mjs → chunk-GUALXVFI.mjs} +2 -2
- package/dist/esm/chunk-H6FEXRTK.mjs +2 -0
- package/dist/esm/chunk-H6FEXRTK.mjs.map +1 -0
- package/dist/esm/{chunk-S2LTZKM4.mjs → chunk-HSJTQLI2.mjs} +2 -2
- package/dist/esm/chunk-I5T6PHDV.mjs +2 -0
- package/dist/esm/{chunk-AT2A6UGB.mjs → chunk-IENCDVPF.mjs} +2 -2
- package/dist/esm/{chunk-AT2A6UGB.mjs.map → chunk-IENCDVPF.mjs.map} +1 -1
- package/dist/esm/{chunk-PYXJYEAC.mjs → chunk-JGSOTNJ5.mjs} +2 -2
- package/dist/esm/chunk-JGSOTNJ5.mjs.map +1 -0
- package/dist/esm/chunk-JQIGQMNZ.mjs +2 -0
- package/dist/esm/chunk-JQIGQMNZ.mjs.map +1 -0
- package/dist/esm/{chunk-UPIN5AIO.mjs → chunk-JX75UKJX.mjs} +2 -2
- package/dist/esm/chunk-JXCZTOYC.mjs +1 -0
- package/dist/esm/chunk-JXCZTOYC.mjs.map +1 -0
- package/dist/esm/{chunk-UML2VQZT.mjs → chunk-KAGLWBIJ.mjs} +2 -2
- package/dist/esm/chunk-LG7RJQ57.mjs +2 -0
- package/dist/esm/chunk-LQNPI3IR.mjs +2 -0
- package/dist/esm/chunk-LQNPI3IR.mjs.map +1 -0
- package/dist/esm/{chunk-XO3HHRJV.mjs → chunk-MCRRHBFQ.mjs} +2 -2
- package/dist/esm/{chunk-U43IJHQN.mjs → chunk-MJPUASSD.mjs} +2 -2
- package/dist/esm/chunk-N3U47Y6Y.mjs +2 -0
- package/dist/esm/{chunk-3YZGJLW7.mjs → chunk-NGQR5UQ3.mjs} +2 -2
- package/dist/esm/chunk-O2K7RZWM.mjs +2 -0
- package/dist/esm/chunk-O2K7RZWM.mjs.map +1 -0
- package/dist/esm/chunk-O4WVPLUX.mjs +2 -0
- package/dist/esm/{chunk-RW2A63WK.mjs → chunk-P46OPJB4.mjs} +2 -2
- package/dist/esm/chunk-P46OPJB4.mjs.map +1 -0
- package/dist/esm/chunk-P5TZBE3L.mjs +2 -0
- package/dist/esm/chunk-P5TZBE3L.mjs.map +1 -0
- package/dist/esm/chunk-PF57EOJY.mjs +2 -0
- package/dist/esm/chunk-PIVZMT5D.mjs +2 -0
- package/dist/esm/chunk-PIVZMT5D.mjs.map +1 -0
- package/dist/esm/chunk-PZ4SAXY7.mjs +2 -0
- package/dist/esm/chunk-PZ4SAXY7.mjs.map +1 -0
- package/dist/esm/{chunk-IOSQVDZI.mjs → chunk-QRS4DGP3.mjs} +2 -2
- package/dist/esm/{chunk-IOSQVDZI.mjs.map → chunk-QRS4DGP3.mjs.map} +1 -1
- package/dist/esm/{chunk-N77VJHW5.mjs → chunk-R5ST36VJ.mjs} +2 -2
- package/dist/esm/chunk-RFSO3JRG.mjs +1 -0
- package/dist/esm/chunk-RFSO3JRG.mjs.map +1 -0
- package/dist/esm/chunk-RFZ5LTGP.mjs +2 -0
- package/dist/esm/chunk-RFZ5LTGP.mjs.map +1 -0
- package/dist/esm/{chunk-SPU745XV.mjs → chunk-RT6LEYHZ.mjs} +2 -2
- package/dist/esm/{chunk-APDALGDD.mjs → chunk-S2VSJJRJ.mjs} +2 -2
- package/dist/esm/{chunk-S4SEFF4K.mjs → chunk-S3EDNXZE.mjs} +46 -17
- package/dist/esm/chunk-S3EDNXZE.mjs.map +1 -0
- package/dist/esm/chunk-SRDIYE3M.mjs +2 -0
- package/dist/esm/{chunk-QIAHBEEW.mjs.map → chunk-SRDIYE3M.mjs.map} +1 -1
- package/dist/esm/{chunk-CNMQNPNV.mjs → chunk-T2AGN5YT.mjs} +2 -2
- package/dist/esm/chunk-TM7NDDT3.mjs +2 -0
- package/dist/esm/chunk-TM7NDDT3.mjs.map +1 -0
- package/dist/esm/{chunk-DMKUAQB7.mjs → chunk-U3YYSIIT.mjs} +2 -2
- package/dist/esm/chunk-UGPALAPN.mjs +2 -0
- package/dist/esm/chunk-UO3NZ5AH.mjs +1 -0
- package/dist/esm/chunk-UO3NZ5AH.mjs.map +1 -0
- package/dist/esm/chunk-UR3JTLIT.mjs +2 -0
- package/dist/esm/chunk-UR3JTLIT.mjs.map +1 -0
- package/dist/esm/{chunk-2G4ZSGL4.mjs → chunk-UW2FPXYA.mjs} +2 -2
- package/dist/esm/{chunk-CDB34C4N.mjs → chunk-WN3JL7ZT.mjs} +2 -2
- package/dist/esm/chunk-WN3JL7ZT.mjs.map +1 -0
- package/dist/esm/{chunk-HWECUBBA.mjs → chunk-WNPL4SEJ.mjs} +2 -2
- package/dist/esm/chunk-WNPL4SEJ.mjs.map +1 -0
- package/dist/esm/{chunk-WCVUDO5S.mjs → chunk-XFSDV3ND.mjs} +2 -2
- package/dist/esm/{chunk-BE4FOV6X.mjs → chunk-YCC6HN74.mjs} +2 -2
- package/dist/esm/chunk-YK63A5T6.mjs +2 -0
- package/dist/esm/chunk-YK63A5T6.mjs.map +1 -0
- package/dist/esm/{chunk-UDRSFVAK.mjs → chunk-YMB2XW2O.mjs} +2 -2
- package/dist/esm/{chunk-JCD72AW7.mjs → chunk-ZCG6WBLE.mjs} +2 -2
- package/dist/esm/chunk-ZM33M6QO.mjs +2 -0
- package/dist/esm/chunk-ZM33M6QO.mjs.map +1 -0
- package/dist/esm/cli/index.d.mts +1 -1
- package/dist/esm/cli/move.d.mts +1 -1
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/client/types.mjs +1 -1
- package/dist/esm/core/account/index.d.mts +5 -14
- 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.d.mts +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/common.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.d.mts +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +4 -4
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +8 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.d.mts +1 -1
- package/dist/esm/core/crypto/publicKey.d.mts +1 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.d.mts +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.d.mts +1 -1
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/crypto/utils.mjs +1 -1
- package/dist/esm/core/hex.mjs +1 -1
- package/dist/esm/core/index.d.mts +3 -6
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +7 -5
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +15 -3
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +3 -3
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +8 -8
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +3 -3
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.d.mts +1 -1
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +6 -6
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.d.mts +2 -8
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/staking.d.mts +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.d.mts +31 -0
- package/dist/esm/internal/table.mjs +2 -0
- package/dist/esm/internal/table.mjs.map +1 -0
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +2 -2
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/view.d.mts +7 -7
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.d.mts +4 -5
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +3 -3
- 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.d.mts +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.d.mts +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.d.mts +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.d.mts +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.d.mts +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +14 -2
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +3 -3
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +2 -2
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +9 -9
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +9 -9
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +6 -6
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +72 -0
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +2 -0
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +7 -29
- 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/transactions/types.d.mts +7 -7
- package/dist/esm/types/generated/operations.d.mts +31 -2
- package/dist/esm/types/generated/queries.d.mts +6 -2
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/generated/types.d.mts +212 -7
- 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 +1 -1
- package/dist/esm/types/indexer.d.mts +4 -2
- 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 +2 -2
- package/src/{core/account → account}/Account.ts +25 -15
- package/src/{core/account → account}/Ed25519Account.ts +45 -9
- package/src/account/MultiKeyAccount.ts +176 -0
- package/src/{core/account → account}/SingleKeyAccount.ts +45 -10
- package/src/account/index.ts +4 -0
- package/src/api/account.ts +2 -1
- package/src/api/ans.ts +2 -1
- package/src/api/aptos.ts +6 -0
- package/src/api/digitalAsset.ts +2 -1
- package/src/api/fungibleAsset.ts +2 -1
- package/src/api/general.ts +0 -26
- package/src/api/table.ts +108 -0
- package/src/api/transaction.ts +2 -1
- package/src/api/transactionSubmission/management.ts +1 -1
- package/src/api/transactionSubmission/sign.ts +1 -1
- package/src/core/account/index.ts +0 -3
- package/src/core/crypto/multiKey.ts +17 -6
- package/src/core/index.ts +0 -1
- package/src/index.ts +1 -0
- package/src/internal/account.ts +3 -2
- package/src/internal/ans.ts +2 -1
- package/src/internal/digitalAsset.ts +2 -1
- package/src/internal/fungibleAsset.ts +2 -1
- package/src/internal/general.ts +1 -20
- package/src/internal/queries/currentTokenOwnershipFieldsFragment.graphql +1 -0
- package/src/internal/queries/getTableItemsData.graphql +15 -0
- package/src/internal/queries/getTableItemsMetadata.graphql +12 -0
- package/src/internal/table.ts +82 -0
- package/src/internal/transactionSubmission.ts +5 -7
- package/src/transactions/authenticator/account.ts +6 -11
- package/src/transactions/management/accountSequenceNumber.ts +1 -1
- package/src/transactions/management/transactionWorker.ts +1 -1
- package/src/transactions/transactionBuilder/index.ts +1 -0
- package/src/transactions/transactionBuilder/signingMessage.ts +93 -0
- package/src/transactions/transactionBuilder/transactionBuilder.ts +2 -73
- package/src/types/generated/operations.ts +29 -0
- package/src/types/generated/queries.ts +59 -0
- package/src/types/generated/types.ts +223 -4
- package/src/types/indexer.ts +4 -0
- package/src/version.ts +1 -1
- package/dist/esm/chunk-4374JPA6.mjs +0 -2
- package/dist/esm/chunk-4374JPA6.mjs.map +0 -1
- package/dist/esm/chunk-62P5CJAJ.mjs +0 -2
- package/dist/esm/chunk-62P5CJAJ.mjs.map +0 -1
- package/dist/esm/chunk-B3BRR4WP.mjs +0 -2
- package/dist/esm/chunk-B3BRR4WP.mjs.map +0 -1
- package/dist/esm/chunk-BWFJHFBQ.mjs +0 -2
- package/dist/esm/chunk-CDB34C4N.mjs.map +0 -1
- package/dist/esm/chunk-CF5R4HVB.mjs +0 -2
- package/dist/esm/chunk-CPBGL37X.mjs +0 -2
- package/dist/esm/chunk-DSTKXJMA.mjs +0 -2
- package/dist/esm/chunk-E7FWVXGX.mjs +0 -1
- package/dist/esm/chunk-FBPNHF54.mjs +0 -2
- package/dist/esm/chunk-HG4Q4EFG.mjs.map +0 -1
- package/dist/esm/chunk-HWECUBBA.mjs.map +0 -1
- package/dist/esm/chunk-IR46T46A.mjs +0 -2
- package/dist/esm/chunk-IR46T46A.mjs.map +0 -1
- package/dist/esm/chunk-L5IL2IAB.mjs +0 -2
- package/dist/esm/chunk-LBGYH45K.mjs +0 -2
- package/dist/esm/chunk-LBGYH45K.mjs.map +0 -1
- package/dist/esm/chunk-MFL3UCKA.mjs +0 -2
- package/dist/esm/chunk-MFL3UCKA.mjs.map +0 -1
- package/dist/esm/chunk-MLWIHWNH.mjs +0 -1
- package/dist/esm/chunk-NBCHJ75L.mjs +0 -2
- package/dist/esm/chunk-NBCHJ75L.mjs.map +0 -1
- package/dist/esm/chunk-NZGRLKRG.mjs +0 -2
- package/dist/esm/chunk-OGHE4AQA.mjs +0 -2
- package/dist/esm/chunk-P3UFJZY5.mjs.map +0 -1
- package/dist/esm/chunk-PJPXC22D.mjs +0 -2
- package/dist/esm/chunk-PJPXC22D.mjs.map +0 -1
- package/dist/esm/chunk-PMUT3HZE.mjs.map +0 -1
- package/dist/esm/chunk-PYXJYEAC.mjs.map +0 -1
- package/dist/esm/chunk-QD2Y3VK4.mjs.map +0 -1
- package/dist/esm/chunk-QIAHBEEW.mjs +0 -2
- package/dist/esm/chunk-QIAU5K5Y.mjs +0 -2
- package/dist/esm/chunk-QIAU5K5Y.mjs.map +0 -1
- package/dist/esm/chunk-R5QUBEH6.mjs +0 -2
- package/dist/esm/chunk-R7G3CLRI.mjs +0 -1
- package/dist/esm/chunk-RR7I2HLA.mjs +0 -2
- package/dist/esm/chunk-RR7I2HLA.mjs.map +0 -1
- package/dist/esm/chunk-RW2A63WK.mjs.map +0 -1
- package/dist/esm/chunk-S4SEFF4K.mjs.map +0 -1
- package/dist/esm/chunk-TBMAJ6AW.mjs +0 -2
- package/dist/esm/chunk-TGXZVNR5.mjs +0 -2
- package/dist/esm/chunk-TJDC5PWD.mjs +0 -2
- package/dist/esm/chunk-UF534PKA.mjs +0 -2
- package/dist/esm/chunk-UF534PKA.mjs.map +0 -1
- package/dist/esm/chunk-UMDTVVQC.mjs +0 -2
- package/dist/esm/chunk-UMDTVVQC.mjs.map +0 -1
- package/dist/esm/chunk-UNU3RVRJ.mjs +0 -2
- package/dist/esm/chunk-WFZDFFBM.mjs +0 -2
- package/dist/esm/chunk-XIJHRBDL.mjs +0 -2
- package/dist/esm/chunk-XIJHRBDL.mjs.map +0 -1
- package/dist/esm/chunk-ZEHKHKBP.mjs +0 -2
- package/dist/esm/chunk-ZEHKHKBP.mjs.map +0 -1
- package/dist/esm/chunk-ZYYK3UXP.mjs +0 -2
- package/dist/esm/core/account/Account.d.mts +0 -20
- package/dist/esm/core/account/Account.mjs +0 -2
- package/dist/esm/core/account/Ed25519Account.d.mts +0 -20
- package/dist/esm/core/account/Ed25519Account.mjs +0 -2
- package/dist/esm/core/account/SingleKeyAccount.d.mts +0 -20
- package/dist/esm/core/account/SingleKeyAccount.mjs +0 -2
- /package/dist/esm/{core/account → account}/Account.mjs.map +0 -0
- /package/dist/esm/{core/account → account}/Ed25519Account.mjs.map +0 -0
- /package/dist/esm/{chunk-E7FWVXGX.mjs.map → account/MultiKeyAccount.mjs.map} +0 -0
- /package/dist/esm/{core/account → account}/SingleKeyAccount.mjs.map +0 -0
- /package/dist/esm/{chunk-MLWIHWNH.mjs.map → account/index.mjs.map} +0 -0
- /package/dist/esm/{chunk-R7G3CLRI.mjs.map → api/table.mjs.map} +0 -0
- /package/dist/esm/{chunk-O4JRPZZM.mjs.map → chunk-2X7A4HUS.mjs.map} +0 -0
- /package/dist/esm/{chunk-PXFIA4BL.mjs.map → chunk-2XK53QFA.mjs.map} +0 -0
- /package/dist/esm/{chunk-RHBCVCOS.mjs.map → chunk-35EWRSDK.mjs.map} +0 -0
- /package/dist/esm/{chunk-52C73T26.mjs.map → chunk-36QXVFR5.mjs.map} +0 -0
- /package/dist/esm/{chunk-FXNFWLQC.mjs.map → chunk-4GWNWSZP.mjs.map} +0 -0
- /package/dist/esm/{chunk-WFZDFFBM.mjs.map → chunk-4NHWV5AI.mjs.map} +0 -0
- /package/dist/esm/{chunk-OGHE4AQA.mjs.map → chunk-53INTTOI.mjs.map} +0 -0
- /package/dist/esm/{chunk-NPFNYP75.mjs.map → chunk-5EN52MUT.mjs.map} +0 -0
- /package/dist/esm/{chunk-BIAEC6FO.mjs.map → chunk-A4JUQZXI.mjs.map} +0 -0
- /package/dist/esm/{chunk-TGXZVNR5.mjs.map → chunk-AF5WNJOP.mjs.map} +0 -0
- /package/dist/esm/{chunk-BAV4XY7C.mjs.map → chunk-AHW3SKT7.mjs.map} +0 -0
- /package/dist/esm/{chunk-DSTKXJMA.mjs.map → chunk-B7X6PSE7.mjs.map} +0 -0
- /package/dist/esm/{chunk-AOCNYMMX.mjs.map → chunk-BCUSI3N6.mjs.map} +0 -0
- /package/dist/esm/{chunk-TBMAJ6AW.mjs.map → chunk-CEHCDA3G.mjs.map} +0 -0
- /package/dist/esm/{chunk-4P5EKAJB.mjs.map → chunk-CYTRYBWN.mjs.map} +0 -0
- /package/dist/esm/{chunk-NWYIE7ZX.mjs.map → chunk-DZSDCUP2.mjs.map} +0 -0
- /package/dist/esm/{chunk-5HY3DEPF.mjs.map → chunk-EA2DKJPX.mjs.map} +0 -0
- /package/dist/esm/{chunk-L5IL2IAB.mjs.map → chunk-EZPUVLME.mjs.map} +0 -0
- /package/dist/esm/{chunk-TJDC5PWD.mjs.map → chunk-F7EMGK4M.mjs.map} +0 -0
- /package/dist/esm/{chunk-FS3NSGBF.mjs.map → chunk-G56GPLTB.mjs.map} +0 -0
- /package/dist/esm/{chunk-6FBKUTGF.mjs.map → chunk-GHYE26Q5.mjs.map} +0 -0
- /package/dist/esm/{chunk-QTRYMRYK.mjs.map → chunk-GM56MMNJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-NZGRLKRG.mjs.map → chunk-GPEM3JVU.mjs.map} +0 -0
- /package/dist/esm/{chunk-6OV2PQS5.mjs.map → chunk-GUALXVFI.mjs.map} +0 -0
- /package/dist/esm/{chunk-S2LTZKM4.mjs.map → chunk-HSJTQLI2.mjs.map} +0 -0
- /package/dist/esm/{chunk-UNU3RVRJ.mjs.map → chunk-I5T6PHDV.mjs.map} +0 -0
- /package/dist/esm/{chunk-UPIN5AIO.mjs.map → chunk-JX75UKJX.mjs.map} +0 -0
- /package/dist/esm/{chunk-UML2VQZT.mjs.map → chunk-KAGLWBIJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-FBPNHF54.mjs.map → chunk-LG7RJQ57.mjs.map} +0 -0
- /package/dist/esm/{chunk-XO3HHRJV.mjs.map → chunk-MCRRHBFQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-U43IJHQN.mjs.map → chunk-MJPUASSD.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZYYK3UXP.mjs.map → chunk-N3U47Y6Y.mjs.map} +0 -0
- /package/dist/esm/{chunk-3YZGJLW7.mjs.map → chunk-NGQR5UQ3.mjs.map} +0 -0
- /package/dist/esm/{chunk-CF5R4HVB.mjs.map → chunk-O4WVPLUX.mjs.map} +0 -0
- /package/dist/esm/{chunk-BWFJHFBQ.mjs.map → chunk-PF57EOJY.mjs.map} +0 -0
- /package/dist/esm/{chunk-N77VJHW5.mjs.map → chunk-R5ST36VJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-SPU745XV.mjs.map → chunk-RT6LEYHZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-APDALGDD.mjs.map → chunk-S2VSJJRJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-CNMQNPNV.mjs.map → chunk-T2AGN5YT.mjs.map} +0 -0
- /package/dist/esm/{chunk-DMKUAQB7.mjs.map → chunk-U3YYSIIT.mjs.map} +0 -0
- /package/dist/esm/{chunk-R5QUBEH6.mjs.map → chunk-UGPALAPN.mjs.map} +0 -0
- /package/dist/esm/{chunk-2G4ZSGL4.mjs.map → chunk-UW2FPXYA.mjs.map} +0 -0
- /package/dist/esm/{chunk-WCVUDO5S.mjs.map → chunk-XFSDV3ND.mjs.map} +0 -0
- /package/dist/esm/{chunk-BE4FOV6X.mjs.map → chunk-YCC6HN74.mjs.map} +0 -0
- /package/dist/esm/{chunk-UDRSFVAK.mjs.map → chunk-YMB2XW2O.mjs.map} +0 -0
- /package/dist/esm/{chunk-JCD72AW7.mjs.map → chunk-ZCG6WBLE.mjs.map} +0 -0
- /package/dist/esm/{publicKey-lq5djCIY.d.mts → publicKey-B3XRNhHO.d.mts} +0 -0
package/src/api/table.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { getTableItem, getTableItemsData, getTableItemsMetadata } from "../internal/table";
|
|
2
|
+
import {
|
|
3
|
+
TableItemRequest,
|
|
4
|
+
LedgerVersionArg,
|
|
5
|
+
AnyNumber,
|
|
6
|
+
PaginationArgs,
|
|
7
|
+
WhereArg,
|
|
8
|
+
OrderByArg,
|
|
9
|
+
GetTableItemsDataResponse,
|
|
10
|
+
GetTableItemsMetadataResponse,
|
|
11
|
+
} from "../types";
|
|
12
|
+
import { TableItemsBoolExp, TableMetadatasBoolExp } from "../types/generated/types";
|
|
13
|
+
import { ProcessorType } from "../utils";
|
|
14
|
+
import { AptosConfig } from "./aptosConfig";
|
|
15
|
+
import { waitForIndexerOnVersion } from "./utils";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A class to query all `Table` Aptos related queries
|
|
19
|
+
*/
|
|
20
|
+
export class Table {
|
|
21
|
+
readonly config: AptosConfig;
|
|
22
|
+
|
|
23
|
+
constructor(config: AptosConfig) {
|
|
24
|
+
this.config = config;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Queries for a table item for a table identified by the handle and the key for the item.
|
|
29
|
+
* Key and value types need to be passed in to help with key serialization and value deserialization.
|
|
30
|
+
*
|
|
31
|
+
* Note, this query calls the fullnode server
|
|
32
|
+
*
|
|
33
|
+
* @example https://api.devnet.aptoslabs.com/v1/accounts/0x1/resource/0x1::coin::CoinInfo%3C0x1::aptos_coin::AptosCoin%3E
|
|
34
|
+
* const tableItem = await aptos.getTableItem({
|
|
35
|
+
* handle: "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca",
|
|
36
|
+
* data: {
|
|
37
|
+
* key_type: "address", // Move type of table key
|
|
38
|
+
* value_type: "u128", // Move type of table value
|
|
39
|
+
* key: "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935" // Value of table key
|
|
40
|
+
* },
|
|
41
|
+
* })
|
|
42
|
+
*
|
|
43
|
+
* @param args.handle A pointer to where that table is stored
|
|
44
|
+
* @param args.data Object that describes table item
|
|
45
|
+
* @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version
|
|
46
|
+
*
|
|
47
|
+
* @returns Table item value rendered in JSON
|
|
48
|
+
*/
|
|
49
|
+
async getTableItem<T>(args: { handle: string; data: TableItemRequest; options?: LedgerVersionArg }): Promise<T> {
|
|
50
|
+
return getTableItem<T>({ aptosConfig: this.config, ...args });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Queries for a table items data.
|
|
55
|
+
*
|
|
56
|
+
* Optional `options.where` param can be passed to filter the response.
|
|
57
|
+
*
|
|
58
|
+
* Note, this query calls the indexer server
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* const data = await aptos.getTableItemsData({
|
|
62
|
+
* options: { where: {
|
|
63
|
+
* table_handle: { _eq: "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca" },
|
|
64
|
+
* transaction_version: { _eq: "0" }
|
|
65
|
+
* }
|
|
66
|
+
* },
|
|
67
|
+
* });
|
|
68
|
+
*
|
|
69
|
+
* @returns GetTableItemsDataResponse
|
|
70
|
+
*/
|
|
71
|
+
async getTableItemsData(args: {
|
|
72
|
+
minimumLedgerVersion?: AnyNumber;
|
|
73
|
+
options?: PaginationArgs & WhereArg<TableItemsBoolExp> & OrderByArg<GetTableItemsDataResponse[0]>;
|
|
74
|
+
}): Promise<GetTableItemsDataResponse> {
|
|
75
|
+
await waitForIndexerOnVersion({
|
|
76
|
+
config: this.config,
|
|
77
|
+
minimumLedgerVersion: args.minimumLedgerVersion,
|
|
78
|
+
processorType: ProcessorType.DEFAULT,
|
|
79
|
+
});
|
|
80
|
+
return getTableItemsData({ aptosConfig: this.config, ...args });
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Queries for a table items metadata.
|
|
85
|
+
*
|
|
86
|
+
* Optional `options.where` param can be passed to filter the response.
|
|
87
|
+
*
|
|
88
|
+
* Note, this query calls the indexer server
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* const data = await aptos.getTableItemsMetadata({
|
|
92
|
+
* options: { where: { handle: { _eq: "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca" } } },
|
|
93
|
+
* });
|
|
94
|
+
*
|
|
95
|
+
* @returns GetTableItemsMetadataResponse
|
|
96
|
+
*/
|
|
97
|
+
async getTableItemsMetadata(args: {
|
|
98
|
+
minimumLedgerVersion?: AnyNumber;
|
|
99
|
+
options?: PaginationArgs & WhereArg<TableMetadatasBoolExp> & OrderByArg<GetTableItemsMetadataResponse[0]>;
|
|
100
|
+
}): Promise<GetTableItemsMetadataResponse> {
|
|
101
|
+
await waitForIndexerOnVersion({
|
|
102
|
+
config: this.config,
|
|
103
|
+
minimumLedgerVersion: args.minimumLedgerVersion,
|
|
104
|
+
processorType: ProcessorType.DEFAULT,
|
|
105
|
+
});
|
|
106
|
+
return getTableItemsMetadata({ aptosConfig: this.config, ...args });
|
|
107
|
+
}
|
|
108
|
+
}
|
package/src/api/transaction.ts
CHANGED
|
@@ -33,7 +33,8 @@ import {
|
|
|
33
33
|
InputGenerateTransactionOptions,
|
|
34
34
|
InputGenerateTransactionPayloadData,
|
|
35
35
|
} from "../transactions";
|
|
36
|
-
import { AccountAddressInput,
|
|
36
|
+
import { AccountAddressInput, PrivateKey } from "../core";
|
|
37
|
+
import { Account } from "../account";
|
|
37
38
|
import { Build } from "./transactionSubmission/build";
|
|
38
39
|
import { Simulate } from "./transactionSubmission/simulate";
|
|
39
40
|
import { Submit } from "./transactionSubmission/submit";
|
|
@@ -2,7 +2,7 @@ import EventEmitter from "eventemitter3";
|
|
|
2
2
|
import { TransactionWorkerEvents, TransactionWorker, TransactionWorkerEventsEnum } from "../../transactions/management";
|
|
3
3
|
import { InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from "../../transactions";
|
|
4
4
|
import { AptosConfig } from "../aptosConfig";
|
|
5
|
-
import { Account } from "../../
|
|
5
|
+
import { Account } from "../../account";
|
|
6
6
|
|
|
7
7
|
export class TransactionManagement extends EventEmitter<TransactionWorkerEvents> {
|
|
8
8
|
account!: Account;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright © Aptos Foundation
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import { Account } from "../../
|
|
4
|
+
import { Account } from "../../account";
|
|
5
5
|
import { signTransaction } from "../../internal/transactionSubmission";
|
|
6
6
|
import { AccountAuthenticator, AnyRawTransaction } from "../../transactions";
|
|
7
7
|
import { AptosConfig } from "../aptosConfig";
|
|
@@ -139,6 +139,22 @@ export class MultiKey extends AccountPublicKey {
|
|
|
139
139
|
|
|
140
140
|
return bitmap;
|
|
141
141
|
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Get the index of the provided public key.
|
|
145
|
+
*
|
|
146
|
+
* @param publicKey array of the index mapping to the matching public keys
|
|
147
|
+
* @returns the corresponding index of the publicKey, if it exists
|
|
148
|
+
*/
|
|
149
|
+
getIndex(publicKey: PublicKey): number {
|
|
150
|
+
const anyPublicKey = publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey);
|
|
151
|
+
const index = this.publicKeys.findIndex((pk) => pk.toString() === anyPublicKey.toString());
|
|
152
|
+
|
|
153
|
+
if (index !== -1) {
|
|
154
|
+
return index;
|
|
155
|
+
}
|
|
156
|
+
throw new Error("Public key not found in MultiKey");
|
|
157
|
+
}
|
|
142
158
|
}
|
|
143
159
|
|
|
144
160
|
export class MultiKeySignature extends Signature {
|
|
@@ -266,13 +282,8 @@ export class MultiKeySignature extends Signature {
|
|
|
266
282
|
}
|
|
267
283
|
|
|
268
284
|
static deserialize(deserializer: Deserializer): MultiKeySignature {
|
|
285
|
+
const signatures = deserializer.deserializeVector(AnySignature);
|
|
269
286
|
const bitmap = deserializer.deserializeBytes();
|
|
270
|
-
const nSignatures = bitmap.reduce((acc, byte) => acc + bitCount(byte), 0);
|
|
271
|
-
const signatures: AnySignature[] = [];
|
|
272
|
-
for (let i = 0; i < nSignatures; i += 1) {
|
|
273
|
-
const signature = AnySignature.deserialize(deserializer);
|
|
274
|
-
signatures.push(signature);
|
|
275
|
-
}
|
|
276
287
|
return new MultiKeySignature({ signatures, bitmap });
|
|
277
288
|
}
|
|
278
289
|
|
package/src/core/index.ts
CHANGED
package/src/index.ts
CHANGED
package/src/internal/account.ts
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
import { AptosConfig } from "../api/aptosConfig";
|
|
12
12
|
import { AptosApiError, getAptosFullNode, paginateWithCursor } from "../client";
|
|
13
13
|
import { AccountAddress, AccountAddressInput } from "../core/accountAddress";
|
|
14
|
-
import { Account } from "../
|
|
14
|
+
import { Account } from "../account";
|
|
15
15
|
import { AnyPublicKey, Ed25519PublicKey, PrivateKey } from "../core/crypto";
|
|
16
|
-
import {
|
|
16
|
+
import { queryIndexer } from "./general";
|
|
17
17
|
import {
|
|
18
18
|
AccountData,
|
|
19
19
|
GetAccountCoinsDataResponse,
|
|
@@ -54,6 +54,7 @@ import {
|
|
|
54
54
|
import { memoizeAsync } from "../utils/memoize";
|
|
55
55
|
import { Secp256k1PrivateKey, AuthenticationKey, Ed25519PrivateKey } from "../core";
|
|
56
56
|
import { CurrentFungibleAssetBalancesBoolExp } from "../types/generated/types";
|
|
57
|
+
import { getTableItem } from "./table";
|
|
57
58
|
|
|
58
59
|
export async function getInfo(args: {
|
|
59
60
|
aptosConfig: AptosConfig;
|
package/src/internal/ans.ts
CHANGED
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { AptosConfig } from "../api/aptosConfig";
|
|
12
|
-
import { Account
|
|
12
|
+
import { Account } from "../account";
|
|
13
|
+
import { AccountAddress, AccountAddressInput } from "../core";
|
|
13
14
|
import { InputGenerateTransactionOptions } from "../transactions/types";
|
|
14
15
|
import { GetANSNameResponse, MoveAddressType, OrderByArg, PaginationArgs, WhereArg } from "../types";
|
|
15
16
|
import { GetNamesQuery } from "../types/generated/operations";
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
import { AptosConfig } from "../api/aptosConfig";
|
|
12
12
|
import { Bool, MoveString, MoveVector, U64 } from "../bcs";
|
|
13
|
-
import {
|
|
13
|
+
import { AccountAddress, AccountAddressInput } from "../core";
|
|
14
|
+
import { Account } from "../account";
|
|
14
15
|
import { EntryFunctionABI, InputGenerateTransactionOptions } from "../transactions/types";
|
|
15
16
|
import {
|
|
16
17
|
AnyNumber,
|
|
@@ -33,7 +33,8 @@ import {
|
|
|
33
33
|
FungibleAssetActivitiesBoolExp,
|
|
34
34
|
FungibleAssetMetadataBoolExp,
|
|
35
35
|
} from "../types/generated/types";
|
|
36
|
-
import {
|
|
36
|
+
import { AccountAddressInput } from "../core";
|
|
37
|
+
import { Account } from "../account";
|
|
37
38
|
import {
|
|
38
39
|
EntryFunctionABI,
|
|
39
40
|
InputGenerateTransactionOptions,
|
package/src/internal/general.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { AptosConfig } from "../api/aptosConfig";
|
|
12
|
-
import { getAptosFullNode,
|
|
12
|
+
import { getAptosFullNode, postAptosIndexer } from "../client";
|
|
13
13
|
import {
|
|
14
14
|
AnyNumber,
|
|
15
15
|
Block,
|
|
@@ -17,8 +17,6 @@ import {
|
|
|
17
17
|
GetProcessorStatusResponse,
|
|
18
18
|
GraphqlQuery,
|
|
19
19
|
LedgerInfo,
|
|
20
|
-
LedgerVersionArg,
|
|
21
|
-
TableItemRequest,
|
|
22
20
|
} from "../types";
|
|
23
21
|
import { GetChainTopUserTransactionsQuery, GetProcessorStatusQuery } from "../types/generated/operations";
|
|
24
22
|
import { GetChainTopUserTransactions, GetProcessorStatus } from "../types/generated/queries";
|
|
@@ -64,23 +62,6 @@ export async function getBlockByHeight(args: {
|
|
|
64
62
|
return data;
|
|
65
63
|
}
|
|
66
64
|
|
|
67
|
-
export async function getTableItem<T>(args: {
|
|
68
|
-
aptosConfig: AptosConfig;
|
|
69
|
-
handle: string;
|
|
70
|
-
data: TableItemRequest;
|
|
71
|
-
options?: LedgerVersionArg;
|
|
72
|
-
}): Promise<T> {
|
|
73
|
-
const { aptosConfig, handle, data, options } = args;
|
|
74
|
-
const response = await postAptosFullNode<TableItemRequest, any>({
|
|
75
|
-
aptosConfig,
|
|
76
|
-
originMethod: "getTableItem",
|
|
77
|
-
path: `tables/${handle}/item`,
|
|
78
|
-
params: { ledger_version: options?.ledgerVersion },
|
|
79
|
-
body: data,
|
|
80
|
-
});
|
|
81
|
-
return response.data as T;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
65
|
export async function getChainTopUserTransactions(args: {
|
|
85
66
|
aptosConfig: AptosConfig;
|
|
86
67
|
limit: number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
query getTableItemsData(
|
|
2
|
+
$where_condition: table_items_bool_exp!
|
|
3
|
+
$offset: Int
|
|
4
|
+
$limit: Int
|
|
5
|
+
$order_by: [table_items_order_by!]
|
|
6
|
+
) {
|
|
7
|
+
table_items(where: $where_condition, offset: $offset, limit: $limit, order_by: $order_by){
|
|
8
|
+
decoded_key
|
|
9
|
+
decoded_value
|
|
10
|
+
key
|
|
11
|
+
table_handle
|
|
12
|
+
transaction_version
|
|
13
|
+
write_set_change_index
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
query getTableItemsMetadata(
|
|
2
|
+
$where_condition: table_metadatas_bool_exp!
|
|
3
|
+
$offset: Int
|
|
4
|
+
$limit: Int
|
|
5
|
+
$order_by: [table_metadatas_order_by!]
|
|
6
|
+
) {
|
|
7
|
+
table_metadatas(where: $where_condition, offset: $offset, limit: $limit, order_by: $order_by){
|
|
8
|
+
handle
|
|
9
|
+
key_type
|
|
10
|
+
value_type
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { AptosConfig } from "../api/aptosConfig";
|
|
2
|
+
import { postAptosFullNode } from "../client";
|
|
3
|
+
import {
|
|
4
|
+
TableItemRequest,
|
|
5
|
+
LedgerVersionArg,
|
|
6
|
+
PaginationArgs,
|
|
7
|
+
WhereArg,
|
|
8
|
+
OrderByArg,
|
|
9
|
+
GetTableItemsDataResponse,
|
|
10
|
+
GetTableItemsMetadataResponse,
|
|
11
|
+
} from "../types";
|
|
12
|
+
import { GetTableItemsDataQuery, GetTableItemsMetadataQuery } from "../types/generated/operations";
|
|
13
|
+
import { GetTableItemsData, GetTableItemsMetadata } from "../types/generated/queries";
|
|
14
|
+
import { TableItemsBoolExp, TableMetadatasBoolExp } from "../types/generated/types";
|
|
15
|
+
import { queryIndexer } from "./general";
|
|
16
|
+
|
|
17
|
+
export async function getTableItem<T>(args: {
|
|
18
|
+
aptosConfig: AptosConfig;
|
|
19
|
+
handle: string;
|
|
20
|
+
data: TableItemRequest;
|
|
21
|
+
options?: LedgerVersionArg;
|
|
22
|
+
}): Promise<T> {
|
|
23
|
+
const { aptosConfig, handle, data, options } = args;
|
|
24
|
+
const response = await postAptosFullNode<TableItemRequest, any>({
|
|
25
|
+
aptosConfig,
|
|
26
|
+
originMethod: "getTableItem",
|
|
27
|
+
path: `tables/${handle}/item`,
|
|
28
|
+
params: { ledger_version: options?.ledgerVersion },
|
|
29
|
+
body: data,
|
|
30
|
+
});
|
|
31
|
+
return response.data as T;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export async function getTableItemsData(args: {
|
|
35
|
+
aptosConfig: AptosConfig;
|
|
36
|
+
options?: PaginationArgs & WhereArg<TableItemsBoolExp> & OrderByArg<GetTableItemsDataResponse[0]>;
|
|
37
|
+
}) {
|
|
38
|
+
const { aptosConfig, options } = args;
|
|
39
|
+
|
|
40
|
+
const graphqlQuery = {
|
|
41
|
+
query: GetTableItemsData,
|
|
42
|
+
variables: {
|
|
43
|
+
where_condition: options?.where,
|
|
44
|
+
offset: options?.offset,
|
|
45
|
+
limit: options?.limit,
|
|
46
|
+
order_by: options?.orderBy,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const data = await queryIndexer<GetTableItemsDataQuery>({
|
|
51
|
+
aptosConfig,
|
|
52
|
+
query: graphqlQuery,
|
|
53
|
+
originMethod: "getTableItemsData",
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return data.table_items;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export async function getTableItemsMetadata(args: {
|
|
60
|
+
aptosConfig: AptosConfig;
|
|
61
|
+
options?: PaginationArgs & WhereArg<TableMetadatasBoolExp> & OrderByArg<GetTableItemsMetadataResponse[0]>;
|
|
62
|
+
}): Promise<GetTableItemsMetadataResponse> {
|
|
63
|
+
const { aptosConfig, options } = args;
|
|
64
|
+
|
|
65
|
+
const graphqlQuery = {
|
|
66
|
+
query: GetTableItemsMetadata,
|
|
67
|
+
variables: {
|
|
68
|
+
where_condition: options?.where,
|
|
69
|
+
offset: options?.offset,
|
|
70
|
+
limit: options?.limit,
|
|
71
|
+
order_by: options?.orderBy,
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const data = await queryIndexer<GetTableItemsMetadataQuery>({
|
|
76
|
+
aptosConfig,
|
|
77
|
+
query: graphqlQuery,
|
|
78
|
+
originMethod: "getTableItemsMetadata",
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
return data.table_metadatas;
|
|
82
|
+
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { AptosConfig } from "../api/aptosConfig";
|
|
9
9
|
import { MoveVector, U8 } from "../bcs";
|
|
10
10
|
import { postAptosFullNode } from "../client";
|
|
11
|
-
import { Account } from "../
|
|
11
|
+
import { Account } from "../account";
|
|
12
12
|
import { AccountAddress, AccountAddressInput } from "../core/accountAddress";
|
|
13
13
|
import { PrivateKey } from "../core/crypto";
|
|
14
14
|
import { AccountAuthenticator } from "../transactions/authenticator/account";
|
|
@@ -18,8 +18,6 @@ import {
|
|
|
18
18
|
generateTransactionPayload,
|
|
19
19
|
generateSignedTransactionForSimulation,
|
|
20
20
|
generateSignedTransaction,
|
|
21
|
-
sign,
|
|
22
|
-
generateSigningMessage,
|
|
23
21
|
} from "../transactions/transactionBuilder/transactionBuilder";
|
|
24
22
|
import {
|
|
25
23
|
InputGenerateTransactionData,
|
|
@@ -35,7 +33,7 @@ import {
|
|
|
35
33
|
} from "../transactions/types";
|
|
36
34
|
import { getInfo } from "./account";
|
|
37
35
|
import { UserTransactionResponse, PendingTransactionResponse, MimeType, HexInput, TransactionResponse } from "../types";
|
|
38
|
-
import { TypeTagU8, TypeTagVector } from "../transactions";
|
|
36
|
+
import { TypeTagU8, TypeTagVector, generateSigningMessageForTransaction } from "../transactions";
|
|
39
37
|
import { SimpleTransaction } from "../transactions/instances/simpleTransaction";
|
|
40
38
|
import { MultiAgentTransaction } from "../transactions/instances/multiAgentTransaction";
|
|
41
39
|
|
|
@@ -185,7 +183,7 @@ function isMultiAgentTransactionInput(
|
|
|
185
183
|
*/
|
|
186
184
|
export function getSigningMessage(args: { transaction: AnyRawTransaction }): Uint8Array {
|
|
187
185
|
const { transaction } = args;
|
|
188
|
-
return
|
|
186
|
+
return generateSigningMessageForTransaction(transaction);
|
|
189
187
|
}
|
|
190
188
|
|
|
191
189
|
/**
|
|
@@ -204,8 +202,8 @@ export function getSigningMessage(args: { transaction: AnyRawTransaction }): Uin
|
|
|
204
202
|
* @return The signer AccountAuthenticator
|
|
205
203
|
*/
|
|
206
204
|
export function signTransaction(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {
|
|
207
|
-
const
|
|
208
|
-
return
|
|
205
|
+
const { signer, transaction } = args;
|
|
206
|
+
return signer.signTransactionWithAuthenticator(transaction);
|
|
209
207
|
}
|
|
210
208
|
|
|
211
209
|
/**
|
|
@@ -7,7 +7,7 @@ import { Serializer, Deserializer, Serializable } from "../../bcs";
|
|
|
7
7
|
import { AnyPublicKey, AnySignature } from "../../core/crypto";
|
|
8
8
|
import { Ed25519PublicKey, Ed25519Signature } from "../../core/crypto/ed25519";
|
|
9
9
|
import { MultiEd25519PublicKey, MultiEd25519Signature } from "../../core/crypto/multiEd25519";
|
|
10
|
-
import { MultiKey } from "../../core/crypto/multiKey";
|
|
10
|
+
import { MultiKey, MultiKeySignature } from "../../core/crypto/multiKey";
|
|
11
11
|
import { AccountAuthenticatorVariant } from "../../types";
|
|
12
12
|
|
|
13
13
|
export abstract class AccountAuthenticator extends Serializable {
|
|
@@ -149,28 +149,23 @@ export class AccountAuthenticatorSingleKey extends AccountAuthenticator {
|
|
|
149
149
|
export class AccountAuthenticatorMultiKey extends AccountAuthenticator {
|
|
150
150
|
public readonly public_keys: MultiKey;
|
|
151
151
|
|
|
152
|
-
public readonly signatures:
|
|
152
|
+
public readonly signatures: MultiKeySignature;
|
|
153
153
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
constructor(public_keys: MultiKey, signatures: Array<AnySignature>, signatures_bitmap: Uint8Array) {
|
|
154
|
+
constructor(public_keys: MultiKey, signatures: MultiKeySignature) {
|
|
157
155
|
super();
|
|
158
156
|
this.public_keys = public_keys;
|
|
159
157
|
this.signatures = signatures;
|
|
160
|
-
this.signatures_bitmap = signatures_bitmap;
|
|
161
158
|
}
|
|
162
159
|
|
|
163
160
|
serialize(serializer: Serializer): void {
|
|
164
161
|
serializer.serializeU32AsUleb128(AccountAuthenticatorVariant.MultiKey);
|
|
165
162
|
this.public_keys.serialize(serializer);
|
|
166
|
-
|
|
167
|
-
serializer.serializeBytes(this.signatures_bitmap);
|
|
163
|
+
this.signatures.serialize(serializer);
|
|
168
164
|
}
|
|
169
165
|
|
|
170
166
|
static load(deserializer: Deserializer): AccountAuthenticatorMultiKey {
|
|
171
167
|
const public_keys = MultiKey.deserialize(deserializer);
|
|
172
|
-
const signatures =
|
|
173
|
-
|
|
174
|
-
return new AccountAuthenticatorMultiKey(public_keys, signatures, signatures_bitmap);
|
|
168
|
+
const signatures = MultiKeySignature.deserialize(deserializer);
|
|
169
|
+
return new AccountAuthenticatorMultiKey(public_keys, signatures);
|
|
175
170
|
}
|
|
176
171
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import EventEmitter from "eventemitter3";
|
|
4
4
|
import { AptosConfig } from "../../api/aptosConfig";
|
|
5
|
-
import { Account } from "../../
|
|
5
|
+
import { Account } from "../../account";
|
|
6
6
|
import { waitForTransaction } from "../../internal/transaction";
|
|
7
7
|
import { generateTransaction, signAndSubmitTransaction } from "../../internal/transactionSubmission";
|
|
8
8
|
import { PendingTransactionResponse, TransactionResponse } from "../../types";
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Copyright © Aptos Foundation
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This file handles the generation of the signing message.
|
|
6
|
+
*/
|
|
7
|
+
import { sha3_256 as sha3Hash } from "@noble/hashes/sha3";
|
|
8
|
+
import { RAW_TRANSACTION_SALT, RAW_TRANSACTION_WITH_DATA_SALT } from "../../utils/const";
|
|
9
|
+
import { FeePayerRawTransaction, MultiAgentRawTransaction } from "../instances";
|
|
10
|
+
import { AnyRawTransaction, AnyRawTransactionInstance } from "../types";
|
|
11
|
+
import { Serializable } from "../../bcs";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Derive the raw transaction type - FeePayerRawTransaction or MultiAgentRawTransaction or RawTransaction
|
|
15
|
+
*
|
|
16
|
+
* @param transaction A aptos transaction type
|
|
17
|
+
*
|
|
18
|
+
* @returns FeePayerRawTransaction | MultiAgentRawTransaction | RawTransaction
|
|
19
|
+
*/
|
|
20
|
+
export function deriveTransactionType(transaction: AnyRawTransaction): AnyRawTransactionInstance {
|
|
21
|
+
if (transaction.feePayerAddress) {
|
|
22
|
+
return new FeePayerRawTransaction(
|
|
23
|
+
transaction.rawTransaction,
|
|
24
|
+
transaction.secondarySignerAddresses ?? [],
|
|
25
|
+
transaction.feePayerAddress,
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
if (transaction.secondarySignerAddresses) {
|
|
29
|
+
return new MultiAgentRawTransaction(transaction.rawTransaction, transaction.secondarySignerAddresses);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return transaction.rawTransaction;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Generates the 'signing message' form of a message to be signed.
|
|
37
|
+
*
|
|
38
|
+
* @param bytes The byte representation of the message to be signed and sent to the chain
|
|
39
|
+
* @param domainSeparator A domain separator that starts with 'APTOS::'
|
|
40
|
+
*
|
|
41
|
+
* @returns The Uint8Array of the signing message
|
|
42
|
+
*/
|
|
43
|
+
export function generateSigningMessage(bytes: Uint8Array, domainSeparator: string): Uint8Array {
|
|
44
|
+
const hash = sha3Hash.create();
|
|
45
|
+
|
|
46
|
+
if (!domainSeparator.startsWith("APTOS::")) {
|
|
47
|
+
throw new Error(`Domain separator needs to start with 'APTOS::'. Provided - ${domainSeparator}`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
hash.update(domainSeparator);
|
|
51
|
+
|
|
52
|
+
const prefix = hash.digest();
|
|
53
|
+
|
|
54
|
+
const body = bytes;
|
|
55
|
+
|
|
56
|
+
const mergedArray = new Uint8Array(prefix.length + body.length);
|
|
57
|
+
mergedArray.set(prefix);
|
|
58
|
+
mergedArray.set(body, prefix.length);
|
|
59
|
+
|
|
60
|
+
return mergedArray;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Generates the 'signing message' form of a serilizable value. It bcs serializes the value and uses the name of
|
|
65
|
+
* its constructor as the domain separator.
|
|
66
|
+
*
|
|
67
|
+
* @param serializable An object that has a bcs serialized form
|
|
68
|
+
*
|
|
69
|
+
* @returns The Uint8Array of the signing message
|
|
70
|
+
*/
|
|
71
|
+
export function generateSigningMessageForSerializable(serializable: Serializable): Uint8Array {
|
|
72
|
+
return generateSigningMessage(serializable.bcsToBytes(), `APTOS::${serializable.constructor.name}`);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Generates the 'signing message' form of a transaction. It derives the type of transaction and
|
|
77
|
+
* applies the appropriate domain separator based on if there is extra data such as a fee payer or
|
|
78
|
+
* secondary signers.
|
|
79
|
+
*
|
|
80
|
+
* @param transaction A transaction that is to be signed
|
|
81
|
+
*
|
|
82
|
+
* @returns The Uint8Array of the signing message
|
|
83
|
+
*/
|
|
84
|
+
export function generateSigningMessageForTransaction(transaction: AnyRawTransaction): Uint8Array {
|
|
85
|
+
const rawTxn = deriveTransactionType(transaction);
|
|
86
|
+
if (transaction.feePayerAddress) {
|
|
87
|
+
return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_WITH_DATA_SALT);
|
|
88
|
+
}
|
|
89
|
+
if (transaction.secondarySignerAddresses) {
|
|
90
|
+
return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_WITH_DATA_SALT);
|
|
91
|
+
}
|
|
92
|
+
return generateSigningMessage(rawTxn.bcsToBytes(), RAW_TRANSACTION_SALT);
|
|
93
|
+
}
|