@aptos-labs/ts-sdk 0.0.6 → 0.0.8
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/README.md +26 -5
- package/dist/browser/index.d.ts +1097 -519
- package/dist/browser/index.global.js +49 -28
- package/dist/browser/index.global.js.map +1 -1
- package/dist/common/index.d.ts +1097 -519
- package/dist/common/index.js +48 -27
- package/dist/common/index.js.map +1 -1
- package/dist/esm/api/account.d.mts +72 -47
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +214 -18
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +9 -0
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +2 -2
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +6 -5
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +24 -21
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.d.mts +12 -14
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.d.mts +4 -4
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.d.mts +71 -30
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +12 -5
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +5 -0
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/staking.d.mts +13 -9
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +36 -2
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +54 -0
- package/dist/esm/api/transactionSubmission/build.mjs +2 -0
- package/dist/esm/api/transactionSubmission/sign.d.mts +51 -0
- package/dist/esm/api/transactionSubmission/sign.mjs +2 -0
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission/simulate.d.mts +54 -0
- package/dist/esm/api/transactionSubmission/simulate.mjs +2 -0
- package/dist/esm/api/transactionSubmission/simulate.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission/submit.d.mts +52 -0
- package/dist/esm/api/transactionSubmission/submit.mjs +2 -0
- package/dist/esm/api/transactionSubmission/submit.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission.d.mts +25 -54
- package/dist/esm/api/transactionSubmission.mjs +1 -1
- package/dist/esm/api/utils.d.mts +21 -0
- package/dist/esm/api/utils.mjs +2 -0
- package/dist/esm/api/utils.mjs.map +1 -0
- package/dist/esm/bcs/deserializer.d.mts +4 -4
- 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 +4 -4
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-UAAI3NCA.mjs → chunk-2SAKPC5Q.mjs} +2 -2
- package/dist/esm/chunk-2YQXX64E.mjs +2 -0
- package/dist/esm/chunk-2YQXX64E.mjs.map +1 -0
- package/dist/esm/chunk-3F5WV6US.mjs +2 -0
- package/dist/esm/chunk-3F5WV6US.mjs.map +1 -0
- package/dist/esm/{chunk-ARVSIDVB.mjs → chunk-3RMXGSHK.mjs} +2 -2
- package/dist/esm/chunk-3RMXGSHK.mjs.map +1 -0
- package/dist/esm/{chunk-4ADA5BE7.mjs → chunk-53DS6NBQ.mjs} +2 -2
- package/dist/esm/chunk-5CUNY7X2.mjs +2 -0
- package/dist/esm/chunk-5CUNY7X2.mjs.map +1 -0
- package/dist/esm/{chunk-QWVR4RCV.mjs → chunk-5OPOJ43H.mjs} +2 -2
- package/dist/esm/{chunk-V45RFKH7.mjs → chunk-5UY5OKXR.mjs} +2 -2
- package/dist/esm/chunk-5UY5OKXR.mjs.map +1 -0
- package/dist/esm/chunk-5ZVCSKFX.mjs +2 -0
- package/dist/esm/chunk-5ZVCSKFX.mjs.map +1 -0
- package/dist/esm/{chunk-HVADSXTB.mjs → chunk-73VWOS4Z.mjs} +2 -2
- package/dist/esm/chunk-ALFESCPU.mjs +2 -0
- package/dist/esm/chunk-ALFESCPU.mjs.map +1 -0
- package/dist/esm/chunk-APSQ4M23.mjs +2 -0
- package/dist/esm/chunk-APSQ4M23.mjs.map +1 -0
- package/dist/esm/{chunk-U25N2VWA.mjs → chunk-AZUWHKN5.mjs} +2 -2
- package/dist/esm/{chunk-WX43AJTD.mjs → chunk-BQSE5HHW.mjs} +45 -24
- package/dist/esm/chunk-BQSE5HHW.mjs.map +1 -0
- package/dist/esm/chunk-CCXMVVXD.mjs +2 -0
- package/dist/esm/chunk-CCXMVVXD.mjs.map +1 -0
- package/dist/esm/{chunk-JZNLZMUC.mjs → chunk-CJPCOS4R.mjs} +2 -2
- package/dist/esm/{chunk-S36IYY6K.mjs → chunk-CL5B2QNS.mjs} +2 -2
- package/dist/esm/chunk-CLJLQXFQ.mjs +2 -0
- package/dist/esm/chunk-CLJLQXFQ.mjs.map +1 -0
- package/dist/esm/{chunk-EWTHPMEE.mjs → chunk-CU2DINU4.mjs} +2 -2
- package/dist/esm/chunk-EFRFDFS4.mjs +2 -0
- package/dist/esm/chunk-EFRFDFS4.mjs.map +1 -0
- package/dist/esm/chunk-EOC4UI5B.mjs +2 -0
- package/dist/esm/{chunk-KC64ESLO.mjs.map → chunk-EOC4UI5B.mjs.map} +1 -1
- package/dist/esm/{chunk-HA6JD5R6.mjs → chunk-F6K26WV5.mjs} +2 -2
- package/dist/esm/{chunk-HA6JD5R6.mjs.map → chunk-F6K26WV5.mjs.map} +1 -1
- package/dist/esm/chunk-F7EWDYTE.mjs +2 -0
- package/dist/esm/chunk-F7EWDYTE.mjs.map +1 -0
- package/dist/esm/{chunk-44MGBJ73.mjs → chunk-FZ56IS3E.mjs} +2 -2
- package/dist/esm/chunk-G36AY4R7.mjs +2 -0
- package/dist/esm/chunk-G36AY4R7.mjs.map +1 -0
- package/dist/esm/chunk-GEZSEAL5.mjs +2 -0
- package/dist/esm/chunk-GEZSEAL5.mjs.map +1 -0
- package/dist/esm/chunk-GIZLK7M7.mjs +2 -0
- package/dist/esm/chunk-GIZLK7M7.mjs.map +1 -0
- package/dist/esm/chunk-GMG4VR3K.mjs +2 -0
- package/dist/esm/chunk-GMG4VR3K.mjs.map +1 -0
- package/dist/esm/{chunk-U6SZNNVL.mjs → chunk-GXPGRCSW.mjs} +2 -2
- package/dist/esm/{chunk-U6SZNNVL.mjs.map → chunk-GXPGRCSW.mjs.map} +1 -1
- package/dist/esm/{chunk-GEFQFRL3.mjs → chunk-HC5VMNXA.mjs} +2 -2
- package/dist/esm/chunk-HTI5LEST.mjs +2 -0
- package/dist/esm/chunk-HTI5LEST.mjs.map +1 -0
- package/dist/esm/chunk-IELTCGLP.mjs +2 -0
- package/dist/esm/chunk-IELTCGLP.mjs.map +1 -0
- package/dist/esm/chunk-IHYTP2EW.mjs +1 -0
- package/dist/esm/chunk-IHYTP2EW.mjs.map +1 -0
- package/dist/esm/chunk-JI2BBZ2W.mjs +2 -0
- package/dist/esm/{chunk-3JVGSFHP.mjs.map → chunk-JI2BBZ2W.mjs.map} +1 -1
- package/dist/esm/chunk-KKER5KL4.mjs +2 -0
- package/dist/esm/chunk-KKER5KL4.mjs.map +1 -0
- package/dist/esm/chunk-KNMWDGP4.mjs +2 -0
- package/dist/esm/chunk-KNMWDGP4.mjs.map +1 -0
- package/dist/esm/{chunk-YYRDFZE6.mjs → chunk-KZSJ5MFF.mjs} +2 -2
- package/dist/esm/{chunk-YYRDFZE6.mjs.map → chunk-KZSJ5MFF.mjs.map} +1 -1
- package/dist/esm/chunk-MWAMLQ25.mjs +2 -0
- package/dist/esm/chunk-MWAMLQ25.mjs.map +1 -0
- package/dist/esm/chunk-NL72WE3E.mjs +2 -0
- package/dist/esm/{chunk-TIH6ARYP.mjs.map → chunk-NL72WE3E.mjs.map} +1 -1
- package/dist/esm/chunk-NZSGGL25.mjs +2 -0
- package/dist/esm/chunk-NZSGGL25.mjs.map +1 -0
- package/dist/esm/chunk-OBOOY2QD.mjs +2 -0
- package/dist/esm/chunk-OBOOY2QD.mjs.map +1 -0
- package/dist/esm/chunk-OT2UDMUU.mjs +2 -0
- package/dist/esm/chunk-OT2UDMUU.mjs.map +1 -0
- package/dist/esm/chunk-OZZDXS26.mjs +2 -0
- package/dist/esm/chunk-OZZDXS26.mjs.map +1 -0
- package/dist/esm/chunk-P5747ZYC.mjs +2 -0
- package/dist/esm/chunk-P5747ZYC.mjs.map +1 -0
- package/dist/esm/{chunk-BPYLPPEQ.mjs → chunk-PL2VA73L.mjs} +2 -2
- package/dist/esm/chunk-PXTMLJKO.mjs +2 -0
- package/dist/esm/{chunk-JDS7K2WI.mjs → chunk-QCBIJCU4.mjs} +2 -2
- package/dist/esm/chunk-QEXAMHPU.mjs +2 -0
- package/dist/esm/chunk-QEXAMHPU.mjs.map +1 -0
- package/dist/esm/{chunk-KQXRH5FK.mjs → chunk-QNTV5NMH.mjs} +2 -2
- package/dist/esm/{chunk-EQ5BEDJ7.mjs → chunk-RCM3K5JL.mjs} +2 -2
- package/dist/esm/chunk-RLG3WOTH.mjs +2 -0
- package/dist/esm/chunk-RLG3WOTH.mjs.map +1 -0
- package/dist/esm/chunk-SDPICQ5B.mjs +2 -0
- package/dist/esm/{chunk-FYIFBLHU.mjs.map → chunk-SDPICQ5B.mjs.map} +1 -1
- package/dist/esm/chunk-SGTFMSOG.mjs +2 -0
- package/dist/esm/chunk-SGTFMSOG.mjs.map +1 -0
- package/dist/esm/chunk-SO6EE5DX.mjs +2 -0
- package/dist/esm/chunk-SO6EE5DX.mjs.map +1 -0
- package/dist/esm/chunk-SRGPSANH.mjs +2 -0
- package/dist/esm/chunk-SRGPSANH.mjs.map +1 -0
- package/dist/esm/{chunk-UPLWWSB4.mjs → chunk-SSJQOXEP.mjs} +2 -2
- package/dist/esm/chunk-TZ623H2V.mjs +2 -0
- package/dist/esm/chunk-TZ623H2V.mjs.map +1 -0
- package/dist/esm/chunk-U6Z4FNB7.mjs +2 -0
- package/dist/esm/chunk-U6Z4FNB7.mjs.map +1 -0
- package/dist/esm/{chunk-GTC7WHMV.mjs → chunk-UDMADMVO.mjs} +1 -1
- package/dist/esm/{chunk-GTC7WHMV.mjs.map → chunk-UDMADMVO.mjs.map} +1 -1
- package/dist/esm/chunk-UIVJXLRM.mjs +1 -0
- package/dist/esm/chunk-UIVJXLRM.mjs.map +1 -0
- package/dist/esm/chunk-UKSA4H2O.mjs +2 -0
- package/dist/esm/chunk-UKSA4H2O.mjs.map +1 -0
- package/dist/esm/chunk-UW6HQ643.mjs +2 -0
- package/dist/esm/chunk-UW6HQ643.mjs.map +1 -0
- package/dist/esm/chunk-UWXDXOFK.mjs +2 -0
- package/dist/esm/chunk-UWXDXOFK.mjs.map +1 -0
- package/dist/esm/chunk-VQ7LYNMD.mjs +2 -0
- package/dist/esm/chunk-VQ7LYNMD.mjs.map +1 -0
- package/dist/esm/{chunk-U3LO2FSJ.mjs → chunk-WTGGCH34.mjs} +2 -2
- package/dist/esm/{chunk-X32O46IB.mjs → chunk-XITLXPBK.mjs} +2 -2
- package/dist/esm/chunk-XMUUI6HG.mjs +2 -0
- package/dist/esm/{chunk-R3KWVOFG.mjs.map → chunk-XMUUI6HG.mjs.map} +1 -1
- package/dist/esm/chunk-XX2Z26FH.mjs +2 -0
- package/dist/esm/chunk-XX2Z26FH.mjs.map +1 -0
- package/dist/esm/chunk-Y6PVFMBS.mjs +2 -0
- package/dist/esm/chunk-Y6PVFMBS.mjs.map +1 -0
- package/dist/esm/{chunk-VWVEDCBM.mjs → chunk-YN6UIVFB.mjs} +2 -2
- package/dist/esm/chunk-ZFK7QD3B.mjs +2 -0
- package/dist/esm/chunk-ZFK7QD3B.mjs.map +1 -0
- package/dist/esm/chunk-ZJUDDSWN.mjs +2 -0
- package/dist/esm/chunk-ZJUDDSWN.mjs.map +1 -0
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +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/core/account.mjs +1 -1
- package/dist/esm/core/accountAddress.d.mts +9 -9
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/anyPublicKey.d.mts +5 -0
- package/dist/esm/core/crypto/anyPublicKey.mjs +1 -1
- package/dist/esm/core/crypto/anySignature.mjs +1 -1
- package/dist/esm/core/crypto/asymmetricCrypto.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.d.mts +3 -0
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +2 -2
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +2 -0
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.d.mts +3 -0
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/hex.mjs +1 -1
- package/dist/esm/core/index.d.mts +2 -2
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +17 -10
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.d.mts +20 -33
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +78 -14
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +6 -5
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +12 -21
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.d.mts +5 -12
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +2 -2
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +40 -22
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.d.mts +9 -5
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/staking.d.mts +4 -6
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/transaction.d.mts +12 -4
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +29 -41
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.d.mts +5 -0
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +1 -0
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +1 -0
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +5 -4
- 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 -0
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.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.d.mts +1 -0
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +89 -0
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +2 -0
- package/dist/esm/transactions/management/accountSequenceNumber.mjs.map +1 -0
- package/dist/esm/transactions/management/asyncQueue.d.mts +58 -0
- package/dist/esm/transactions/management/asyncQueue.mjs +2 -0
- package/dist/esm/transactions/management/asyncQueue.mjs.map +1 -0
- package/dist/esm/transactions/management/index.d.mts +36 -0
- package/dist/esm/transactions/management/index.mjs +2 -0
- package/dist/esm/transactions/management/index.mjs.map +1 -0
- package/dist/esm/transactions/management/transactionWorker.d.mts +135 -0
- package/dist/esm/transactions/management/transactionWorker.mjs +2 -0
- package/dist/esm/transactions/management/transactionWorker.mjs.map +1 -0
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +3 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +4 -3
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +3 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +6 -8
- 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 +18 -43
- package/dist/esm/types/generated/operations.d.mts +30 -4
- package/dist/esm/types/generated/queries.d.mts +8 -5
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/index.d.mts +27 -9
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/indexer.d.mts +3 -2
- package/dist/esm/utils/const.d.mts +18 -1
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/index.d.mts +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/src/api/account.ts +150 -53
- package/src/api/ans.ts +252 -16
- package/src/api/aptos.ts +20 -0
- package/src/api/aptosConfig.ts +2 -2
- package/src/api/coin.ts +4 -8
- package/src/api/digitalAsset.ts +75 -25
- package/src/api/event.ts +28 -17
- package/src/api/faucet.ts +12 -9
- package/src/api/fungibleAsset.ts +76 -35
- package/src/api/general.ts +19 -3
- package/src/api/staking.ts +30 -11
- package/src/api/transaction.ts +16 -1
- package/src/api/transactionSubmission/build.ts +42 -0
- package/src/api/transactionSubmission/sign.ts +44 -0
- package/src/api/transactionSubmission/simulate.ts +56 -0
- package/src/api/transactionSubmission/submit.ts +53 -0
- package/src/api/transactionSubmission.ts +31 -128
- package/src/api/utils.ts +37 -0
- package/src/bcs/deserializer.ts +4 -4
- package/src/bcs/serializer.ts +4 -4
- package/src/client/core.ts +6 -4
- package/src/client/get.ts +7 -6
- package/src/core/accountAddress.ts +20 -22
- package/src/core/crypto/anyPublicKey.ts +12 -0
- package/src/core/crypto/ed25519.ts +13 -0
- package/src/core/crypto/index.ts +2 -0
- package/src/core/crypto/secp256k1.ts +12 -0
- package/src/core/hex.ts +5 -7
- package/src/index.ts +1 -0
- package/src/internal/account.ts +56 -50
- package/src/internal/ans.ts +423 -24
- package/src/internal/coin.ts +6 -8
- package/src/internal/digitalAsset.ts +15 -25
- package/src/internal/event.ts +7 -14
- package/src/internal/faucet.ts +10 -6
- package/src/internal/fungibleAsset.ts +36 -18
- package/src/internal/general.ts +30 -3
- package/src/internal/queries/ansTokenFragment.graphql +9 -0
- package/src/internal/queries/getNames.graphql +11 -0
- package/src/internal/queries/getNumberOfDelegatorsQuery.graphql +5 -5
- package/src/internal/queries/getProcessorStatus.graphql +2 -2
- package/src/internal/staking.ts +12 -14
- package/src/internal/transaction.ts +23 -26
- package/src/internal/transactionSubmission.ts +63 -25
- package/src/transactions/authenticator/account.ts +16 -0
- package/src/transactions/instances/moduleId.ts +1 -1
- package/src/transactions/management/accountSequenceNumber.ts +186 -0
- package/src/transactions/management/asyncQueue.ts +107 -0
- package/src/transactions/management/index.ts +2 -0
- package/src/transactions/management/transactionWorker.ts +275 -0
- package/src/transactions/transactionBuilder/helpers.ts +28 -1
- package/src/transactions/transactionBuilder/remoteAbi.ts +35 -28
- package/src/transactions/transactionBuilder/transactionBuilder.ts +46 -67
- package/src/transactions/typeTag/parser.ts +1 -1
- package/src/transactions/types.ts +16 -47
- package/src/types/generated/operations.ts +33 -2
- package/src/types/generated/queries.ts +38 -4
- package/src/types/index.ts +67 -11
- package/src/types/indexer.ts +3 -0
- package/src/utils/const.ts +18 -0
- package/src/version.ts +1 -1
- package/dist/esm/chunk-2W744GUN.mjs +0 -2
- package/dist/esm/chunk-2W744GUN.mjs.map +0 -1
- package/dist/esm/chunk-3JVGSFHP.mjs +0 -2
- package/dist/esm/chunk-4RVIA63I.mjs +0 -2
- package/dist/esm/chunk-4RVIA63I.mjs.map +0 -1
- package/dist/esm/chunk-62SCW5NH.mjs +0 -2
- package/dist/esm/chunk-62SCW5NH.mjs.map +0 -1
- package/dist/esm/chunk-7MNEEVXY.mjs +0 -2
- package/dist/esm/chunk-7MNEEVXY.mjs.map +0 -1
- package/dist/esm/chunk-AAIBCWZY.mjs +0 -2
- package/dist/esm/chunk-AAIBCWZY.mjs.map +0 -1
- package/dist/esm/chunk-ARVSIDVB.mjs.map +0 -1
- package/dist/esm/chunk-BFSEVKNA.mjs +0 -2
- package/dist/esm/chunk-BFSEVKNA.mjs.map +0 -1
- package/dist/esm/chunk-BP5ZO7NK.mjs +0 -2
- package/dist/esm/chunk-BP5ZO7NK.mjs.map +0 -1
- package/dist/esm/chunk-BV4OOU5Y.mjs +0 -2
- package/dist/esm/chunk-BV4OOU5Y.mjs.map +0 -1
- package/dist/esm/chunk-BWMNPUTK.mjs +0 -2
- package/dist/esm/chunk-BWMNPUTK.mjs.map +0 -1
- package/dist/esm/chunk-EFIYW4WK.mjs +0 -2
- package/dist/esm/chunk-EGOYLZBU.mjs +0 -2
- package/dist/esm/chunk-EGOYLZBU.mjs.map +0 -1
- package/dist/esm/chunk-EYXHVA6W.mjs +0 -2
- package/dist/esm/chunk-EYXHVA6W.mjs.map +0 -1
- package/dist/esm/chunk-FYIFBLHU.mjs +0 -2
- package/dist/esm/chunk-IG5CHHSI.mjs +0 -2
- package/dist/esm/chunk-IG5CHHSI.mjs.map +0 -1
- package/dist/esm/chunk-IXMB2GOK.mjs +0 -2
- package/dist/esm/chunk-IXMB2GOK.mjs.map +0 -1
- package/dist/esm/chunk-J5ZFOJN2.mjs +0 -2
- package/dist/esm/chunk-J5ZFOJN2.mjs.map +0 -1
- package/dist/esm/chunk-KC64ESLO.mjs +0 -2
- package/dist/esm/chunk-NGCFPQ22.mjs +0 -2
- package/dist/esm/chunk-NGCFPQ22.mjs.map +0 -1
- package/dist/esm/chunk-NTD3H2S4.mjs +0 -2
- package/dist/esm/chunk-NTD3H2S4.mjs.map +0 -1
- package/dist/esm/chunk-NYFVEKF6.mjs +0 -2
- package/dist/esm/chunk-NYFVEKF6.mjs.map +0 -1
- package/dist/esm/chunk-NZIJV4O2.mjs +0 -2
- package/dist/esm/chunk-NZIJV4O2.mjs.map +0 -1
- package/dist/esm/chunk-P32MY5YF.mjs +0 -2
- package/dist/esm/chunk-P32MY5YF.mjs.map +0 -1
- package/dist/esm/chunk-Q6N6QACD.mjs +0 -2
- package/dist/esm/chunk-Q6N6QACD.mjs.map +0 -1
- package/dist/esm/chunk-R26XML3D.mjs +0 -2
- package/dist/esm/chunk-R26XML3D.mjs.map +0 -1
- package/dist/esm/chunk-R3KWVOFG.mjs +0 -2
- package/dist/esm/chunk-RYETO74W.mjs +0 -2
- package/dist/esm/chunk-RYETO74W.mjs.map +0 -1
- package/dist/esm/chunk-TCTZCPQ6.mjs +0 -1
- package/dist/esm/chunk-TIH6ARYP.mjs +0 -2
- package/dist/esm/chunk-TQD4IGUM.mjs +0 -2
- package/dist/esm/chunk-TQD4IGUM.mjs.map +0 -1
- package/dist/esm/chunk-UNQNACJT.mjs +0 -2
- package/dist/esm/chunk-UNQNACJT.mjs.map +0 -1
- package/dist/esm/chunk-V45RFKH7.mjs.map +0 -1
- package/dist/esm/chunk-VMQWW5UT.mjs +0 -2
- package/dist/esm/chunk-VMQWW5UT.mjs.map +0 -1
- package/dist/esm/chunk-VOYW2TZW.mjs +0 -2
- package/dist/esm/chunk-VOYW2TZW.mjs.map +0 -1
- package/dist/esm/chunk-VYAVLUPJ.mjs +0 -2
- package/dist/esm/chunk-VYAVLUPJ.mjs.map +0 -1
- package/dist/esm/chunk-WKY5ENCK.mjs +0 -2
- package/dist/esm/chunk-WKY5ENCK.mjs.map +0 -1
- package/dist/esm/chunk-WX43AJTD.mjs.map +0 -1
- package/dist/esm/chunk-Y5DJPHJT.mjs +0 -2
- package/dist/esm/chunk-Y5DJPHJT.mjs.map +0 -1
- package/dist/esm/chunk-Y7VR7X5W.mjs +0 -2
- package/dist/esm/chunk-Y7VR7X5W.mjs.map +0 -1
- package/dist/esm/chunk-Z2UDRTHA.mjs +0 -2
- package/dist/esm/chunk-Z2UDRTHA.mjs.map +0 -1
- /package/dist/esm/{chunk-TCTZCPQ6.mjs.map → api/transactionSubmission/build.mjs.map} +0 -0
- /package/dist/esm/{chunk-UAAI3NCA.mjs.map → chunk-2SAKPC5Q.mjs.map} +0 -0
- /package/dist/esm/{chunk-4ADA5BE7.mjs.map → chunk-53DS6NBQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-QWVR4RCV.mjs.map → chunk-5OPOJ43H.mjs.map} +0 -0
- /package/dist/esm/{chunk-HVADSXTB.mjs.map → chunk-73VWOS4Z.mjs.map} +0 -0
- /package/dist/esm/{chunk-U25N2VWA.mjs.map → chunk-AZUWHKN5.mjs.map} +0 -0
- /package/dist/esm/{chunk-JZNLZMUC.mjs.map → chunk-CJPCOS4R.mjs.map} +0 -0
- /package/dist/esm/{chunk-S36IYY6K.mjs.map → chunk-CL5B2QNS.mjs.map} +0 -0
- /package/dist/esm/{chunk-EWTHPMEE.mjs.map → chunk-CU2DINU4.mjs.map} +0 -0
- /package/dist/esm/{chunk-44MGBJ73.mjs.map → chunk-FZ56IS3E.mjs.map} +0 -0
- /package/dist/esm/{chunk-GEFQFRL3.mjs.map → chunk-HC5VMNXA.mjs.map} +0 -0
- /package/dist/esm/{chunk-BPYLPPEQ.mjs.map → chunk-PL2VA73L.mjs.map} +0 -0
- /package/dist/esm/{chunk-EFIYW4WK.mjs.map → chunk-PXTMLJKO.mjs.map} +0 -0
- /package/dist/esm/{chunk-JDS7K2WI.mjs.map → chunk-QCBIJCU4.mjs.map} +0 -0
- /package/dist/esm/{chunk-KQXRH5FK.mjs.map → chunk-QNTV5NMH.mjs.map} +0 -0
- /package/dist/esm/{chunk-EQ5BEDJ7.mjs.map → chunk-RCM3K5JL.mjs.map} +0 -0
- /package/dist/esm/{chunk-UPLWWSB4.mjs.map → chunk-SSJQOXEP.mjs.map} +0 -0
- /package/dist/esm/{chunk-U3LO2FSJ.mjs.map → chunk-WTGGCH34.mjs.map} +0 -0
- /package/dist/esm/{chunk-X32O46IB.mjs.map → chunk-XITLXPBK.mjs.map} +0 -0
- /package/dist/esm/{chunk-VWVEDCBM.mjs.map → chunk-YN6UIVFB.mjs.map} +0 -0
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
findFirstNonSignerArg,
|
|
13
13
|
isBcsAddress,
|
|
14
14
|
isBcsBool,
|
|
15
|
-
isBcsFixedBytes,
|
|
16
15
|
isBcsString,
|
|
17
16
|
isBcsU128,
|
|
18
17
|
isBcsU16,
|
|
@@ -21,6 +20,7 @@ import {
|
|
|
21
20
|
isBcsU64,
|
|
22
21
|
isBcsU8,
|
|
23
22
|
isBool,
|
|
23
|
+
isEncodedEntryFunctionArgument,
|
|
24
24
|
isLargeNumber,
|
|
25
25
|
isNull,
|
|
26
26
|
isNumber,
|
|
@@ -104,28 +104,25 @@ export function convertArgument(
|
|
|
104
104
|
throw new Error(`Too many arguments for '${functionName}', expected ${functionAbi.parameters.length}`);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
const param = functionAbi.parameters[position];
|
|
108
|
+
return checkOrConvertArgument(arg, param, position, genericTypeParams);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function checkOrConvertArgument(
|
|
112
|
+
arg: SimpleEntryFunctionArgumentTypes | EntryFunctionArgumentTypes,
|
|
113
|
+
param: TypeTag,
|
|
114
|
+
position: number,
|
|
115
|
+
genericTypeParams: Array<TypeTag>,
|
|
116
|
+
) {
|
|
107
117
|
// If the argument is bcs encoded, we can just use it directly
|
|
108
|
-
if (
|
|
109
|
-
isBcsBool(arg) ||
|
|
110
|
-
isBcsU8(arg) ||
|
|
111
|
-
isBcsU16(arg) ||
|
|
112
|
-
isBcsU32(arg) ||
|
|
113
|
-
isBcsU64(arg) ||
|
|
114
|
-
isBcsU128(arg) ||
|
|
115
|
-
isBcsU256(arg) ||
|
|
116
|
-
isBcsAddress(arg) ||
|
|
117
|
-
isBcsString(arg) ||
|
|
118
|
-
isBcsFixedBytes(arg) ||
|
|
119
|
-
arg instanceof MoveVector ||
|
|
120
|
-
arg instanceof MoveOption
|
|
121
|
-
) {
|
|
118
|
+
if (isEncodedEntryFunctionArgument(arg)) {
|
|
122
119
|
// Ensure the type matches the ABI
|
|
123
|
-
checkType(
|
|
120
|
+
checkType(param, arg, position);
|
|
124
121
|
return arg;
|
|
125
122
|
}
|
|
126
123
|
|
|
127
124
|
// If it is not BCS encoded, we will need to convert it with the ABI
|
|
128
|
-
return parseArg(arg,
|
|
125
|
+
return parseArg(arg, param, position, genericTypeParams);
|
|
129
126
|
}
|
|
130
127
|
|
|
131
128
|
/**
|
|
@@ -150,7 +147,7 @@ function parseArg(
|
|
|
150
147
|
// TODO: support uint8array?
|
|
151
148
|
if (param.isAddress()) {
|
|
152
149
|
if (isString(arg)) {
|
|
153
|
-
return AccountAddress.
|
|
150
|
+
return AccountAddress.fromString(arg);
|
|
154
151
|
}
|
|
155
152
|
throwTypeMismatch("string", position);
|
|
156
153
|
}
|
|
@@ -198,19 +195,30 @@ function parseArg(
|
|
|
198
195
|
throw new Error(`Generic argument ${param.toString()} is invalid for argument ${position}`);
|
|
199
196
|
}
|
|
200
197
|
|
|
201
|
-
|
|
198
|
+
checkOrConvertArgument(arg, genericTypeParams[genericIndex], position, genericTypeParams);
|
|
202
199
|
}
|
|
203
200
|
|
|
204
201
|
// We have to special case some vectors for Vector<u8>
|
|
205
202
|
if (param.isVector()) {
|
|
206
203
|
// Check special case for Vector<u8>
|
|
207
|
-
if (param.value.isU8()
|
|
208
|
-
|
|
209
|
-
|
|
204
|
+
if (param.value.isU8()) {
|
|
205
|
+
if (isString(arg)) {
|
|
206
|
+
try {
|
|
207
|
+
return MoveVector.U8(Hex.fromHexInput(arg).toUint8Array());
|
|
208
|
+
} catch (e: any) {
|
|
209
|
+
// This is a bit of a hack to not reuse code, but also have a better error message
|
|
210
|
+
throw new Error(`vector<u8> must be passed in as a hex string or a Uint8array, type '${param.toString()}'`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (arg instanceof Uint8Array) {
|
|
214
|
+
return MoveVector.U8(arg);
|
|
215
|
+
}
|
|
210
216
|
}
|
|
211
217
|
|
|
218
|
+
// TODO: Support Uint16Array, Uint32Array, BigUint64Array?
|
|
219
|
+
|
|
212
220
|
if (Array.isArray(arg)) {
|
|
213
|
-
return new MoveVector(arg.map((item) =>
|
|
221
|
+
return new MoveVector(arg.map((item) => checkOrConvertArgument(item, param.value, position, genericTypeParams)));
|
|
214
222
|
}
|
|
215
223
|
|
|
216
224
|
throw new Error(`Type mismatch for argument ${position}, type '${param.toString()}'`);
|
|
@@ -227,7 +235,7 @@ function parseArg(
|
|
|
227
235
|
if (param.isObject()) {
|
|
228
236
|
// The inner type of Object doesn't matter, since it's just syntactic sugar
|
|
229
237
|
if (isString(arg)) {
|
|
230
|
-
return AccountAddress.
|
|
238
|
+
return AccountAddress.fromString(arg);
|
|
231
239
|
}
|
|
232
240
|
throwTypeMismatch("string", position);
|
|
233
241
|
}
|
|
@@ -239,7 +247,7 @@ function parseArg(
|
|
|
239
247
|
return new MoveOption<U8>(null);
|
|
240
248
|
}
|
|
241
249
|
|
|
242
|
-
return new MoveOption(
|
|
250
|
+
return new MoveOption(checkOrConvertArgument(arg, param.value.typeArgs[0], position, genericTypeParams));
|
|
243
251
|
}
|
|
244
252
|
|
|
245
253
|
throw new Error(`Unsupported struct input type for argument ${position}, type '${param.toString()}'`);
|
|
@@ -250,12 +258,11 @@ function parseArg(
|
|
|
250
258
|
|
|
251
259
|
/**
|
|
252
260
|
* Checks that the type of an already BCS encoded argument matches the ABI
|
|
253
|
-
* @param
|
|
261
|
+
* @param param
|
|
254
262
|
* @param arg
|
|
255
263
|
* @param position
|
|
256
264
|
*/
|
|
257
|
-
function checkType(
|
|
258
|
-
const param = functionAbi.parameters[position];
|
|
265
|
+
function checkType(param: TypeTag, arg: EntryFunctionArgumentTypes, position: number) {
|
|
259
266
|
if (param.isBool()) {
|
|
260
267
|
if (isBcsBool(arg)) {
|
|
261
268
|
return;
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { sha3_256 as sha3Hash } from "@noble/hashes/sha3";
|
|
10
10
|
import { AptosConfig } from "../../api/aptosConfig";
|
|
11
|
-
import { Deserializer } from "../../bcs/deserializer";
|
|
12
11
|
import { AccountAddress, AccountAddressInput, Hex, PublicKey } from "../../core";
|
|
13
12
|
import { Account } from "../../core/account";
|
|
14
13
|
import { AnyPublicKey } from "../../core/crypto/anyPublicKey";
|
|
@@ -57,14 +56,12 @@ import {
|
|
|
57
56
|
AnyRawTransactionInstance,
|
|
58
57
|
EntryFunctionArgumentTypes,
|
|
59
58
|
EntryFunctionABI,
|
|
60
|
-
InputGenerateFeePayerRawTransactionArgs,
|
|
61
59
|
InputGenerateMultiAgentRawTransactionArgs,
|
|
62
60
|
InputGenerateRawTransactionArgs,
|
|
63
61
|
InputGenerateSingleSignerRawTransactionArgs,
|
|
64
|
-
|
|
62
|
+
SingleSignerTransaction,
|
|
65
63
|
InputGenerateTransactionOptions,
|
|
66
|
-
|
|
67
|
-
InputMultiAgentTransaction,
|
|
64
|
+
MultiAgentTransaction,
|
|
68
65
|
InputScriptData,
|
|
69
66
|
InputSimulateTransactionData,
|
|
70
67
|
InputGenerateTransactionPayloadData,
|
|
@@ -93,9 +90,6 @@ export async function generateTransactionPayload(
|
|
|
93
90
|
export async function generateTransactionPayload(
|
|
94
91
|
args: InputMultiSigDataWithRemoteABI,
|
|
95
92
|
): Promise<TransactionPayloadMultisig>;
|
|
96
|
-
export async function generateTransactionPayload(
|
|
97
|
-
args: InputGenerateTransactionPayloadDataWithRemoteABI,
|
|
98
|
-
): Promise<AnyTransactionPayloadInstance>;
|
|
99
93
|
|
|
100
94
|
/**
|
|
101
95
|
* Builds a transaction payload based on the data argument and returns
|
|
@@ -177,12 +171,7 @@ export function generateTransactionPayloadWithABI(
|
|
|
177
171
|
|
|
178
172
|
// Send it as multi sig if it's a multisig payload
|
|
179
173
|
if ("multisigAddress" in args) {
|
|
180
|
-
|
|
181
|
-
if (typeof args.multisigAddress === "string") {
|
|
182
|
-
multisigAddress = AccountAddress.from(args.multisigAddress);
|
|
183
|
-
} else {
|
|
184
|
-
multisigAddress = args.multisigAddress;
|
|
185
|
-
}
|
|
174
|
+
const multisigAddress = AccountAddress.from(args.multisigAddress);
|
|
186
175
|
return new TransactionPayloadMultisig(
|
|
187
176
|
new MultiSig(multisigAddress, new MultisigTransactionPayload(entryFunctionPayload)),
|
|
188
177
|
);
|
|
@@ -215,9 +204,10 @@ export async function generateRawTransaction(args: {
|
|
|
215
204
|
}): Promise<RawTransaction> {
|
|
216
205
|
const { aptosConfig, sender, payload, options } = args;
|
|
217
206
|
|
|
218
|
-
const getSequenceNumber =
|
|
219
|
-
|
|
220
|
-
|
|
207
|
+
const getSequenceNumber =
|
|
208
|
+
options?.accountSequenceNumber !== undefined
|
|
209
|
+
? Promise.resolve({ sequence_number: options.accountSequenceNumber })
|
|
210
|
+
: getInfo({ aptosConfig, accountAddress: sender });
|
|
221
211
|
|
|
222
212
|
const getChainId = NetworkToChainId[aptosConfig.network]
|
|
223
213
|
? Promise.resolve({ chain_id: NetworkToChainId[aptosConfig.network] })
|
|
@@ -239,7 +229,7 @@ export async function generateRawTransaction(args: {
|
|
|
239
229
|
};
|
|
240
230
|
|
|
241
231
|
return new RawTransaction(
|
|
242
|
-
AccountAddress.
|
|
232
|
+
AccountAddress.from(sender),
|
|
243
233
|
BigInt(sequenceNumber),
|
|
244
234
|
payload,
|
|
245
235
|
BigInt(maxGasAmount),
|
|
@@ -257,14 +247,9 @@ export async function generateRawTransaction(args: {
|
|
|
257
247
|
*/
|
|
258
248
|
export async function buildTransaction(
|
|
259
249
|
args: InputGenerateSingleSignerRawTransactionArgs,
|
|
260
|
-
): Promise<
|
|
261
|
-
export async function buildTransaction(
|
|
262
|
-
|
|
263
|
-
): Promise<InputFeePayerTransaction>;
|
|
264
|
-
export async function buildTransaction(
|
|
265
|
-
args: InputGenerateMultiAgentRawTransactionArgs,
|
|
266
|
-
): Promise<InputMultiAgentTransaction>;
|
|
267
|
-
export async function buildTransaction(args: InputGenerateRawTransactionArgs): Promise<AnyRawTransaction>;
|
|
250
|
+
): Promise<SingleSignerTransaction>;
|
|
251
|
+
export async function buildTransaction(args: InputGenerateMultiAgentRawTransactionArgs): Promise<MultiAgentTransaction>;
|
|
252
|
+
|
|
268
253
|
/**
|
|
269
254
|
* Generates a transaction based on the provided arguments
|
|
270
255
|
*
|
|
@@ -297,29 +282,22 @@ export async function buildTransaction(args: InputGenerateRawTransactionArgs): P
|
|
|
297
282
|
options,
|
|
298
283
|
});
|
|
299
284
|
|
|
300
|
-
if
|
|
301
|
-
const signers: Array<AccountAddress> =
|
|
302
|
-
args.secondarySignerAddresses?.map((signer) => AccountAddress.fromRelaxed(signer)) ?? [];
|
|
303
|
-
|
|
304
|
-
return {
|
|
305
|
-
rawTransaction: rawTxn,
|
|
306
|
-
secondarySignerAddresses: signers,
|
|
307
|
-
feePayerAddress:
|
|
308
|
-
args?.feePayerAddress !== undefined ? AccountAddress.fromRelaxed(args.feePayerAddress) : undefined,
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
|
|
285
|
+
// if multi agent transaction
|
|
312
286
|
if ("secondarySignerAddresses" in args) {
|
|
313
287
|
const signers: Array<AccountAddress> =
|
|
314
|
-
args.secondarySignerAddresses?.map((signer) => AccountAddress.
|
|
288
|
+
args.secondarySignerAddresses?.map((signer) => AccountAddress.from(signer)) ?? [];
|
|
315
289
|
|
|
316
290
|
return {
|
|
317
291
|
rawTransaction: rawTxn,
|
|
318
292
|
secondarySignerAddresses: signers,
|
|
293
|
+
feePayerAddress: args.feePayerAddress ? AccountAddress.from(args.feePayerAddress) : undefined,
|
|
319
294
|
};
|
|
320
295
|
}
|
|
321
296
|
// return the raw transaction
|
|
322
|
-
return {
|
|
297
|
+
return {
|
|
298
|
+
rawTransaction: rawTxn,
|
|
299
|
+
feePayerAddress: args.feePayerAddress ? AccountAddress.from(args.feePayerAddress) : undefined,
|
|
300
|
+
};
|
|
323
301
|
}
|
|
324
302
|
|
|
325
303
|
/**
|
|
@@ -336,25 +314,21 @@ export async function buildTransaction(args: InputGenerateRawTransactionArgs): P
|
|
|
336
314
|
export function generateSignedTransactionForSimulation(args: InputSimulateTransactionData): Uint8Array {
|
|
337
315
|
const { signerPublicKey, transaction, secondarySignersPublicKeys, feePayerPublicKey } = args;
|
|
338
316
|
|
|
339
|
-
const deserializer = new Deserializer(transaction.rawTransaction.bcsToBytes());
|
|
340
|
-
const deserializedTransaction = RawTransaction.deserialize(deserializer);
|
|
341
|
-
|
|
342
317
|
const accountAuthenticator = getAuthenticatorForSimulation(signerPublicKey);
|
|
318
|
+
|
|
343
319
|
// fee payer transaction
|
|
344
|
-
if (
|
|
320
|
+
if (transaction.feePayerAddress) {
|
|
345
321
|
const transactionToSign = new FeePayerRawTransaction(
|
|
346
|
-
|
|
322
|
+
transaction.rawTransaction,
|
|
347
323
|
transaction.secondarySignerAddresses ?? [],
|
|
348
324
|
transaction.feePayerAddress,
|
|
349
325
|
);
|
|
350
|
-
|
|
351
326
|
let secondaryAccountAuthenticators: Array<AccountAuthenticator> = [];
|
|
352
327
|
if (secondarySignersPublicKeys) {
|
|
353
328
|
secondaryAccountAuthenticators = secondarySignersPublicKeys.map((publicKey) =>
|
|
354
329
|
getAuthenticatorForSimulation(publicKey),
|
|
355
330
|
);
|
|
356
331
|
}
|
|
357
|
-
|
|
358
332
|
const feePayerAuthenticator = getAuthenticatorForSimulation(feePayerPublicKey!);
|
|
359
333
|
|
|
360
334
|
const transactionAuthenticator = new TransactionAuthenticatorFeePayer(
|
|
@@ -370,9 +344,9 @@ export function generateSignedTransactionForSimulation(args: InputSimulateTransa
|
|
|
370
344
|
}
|
|
371
345
|
|
|
372
346
|
// multi agent transaction
|
|
373
|
-
if (
|
|
347
|
+
if (transaction.secondarySignerAddresses) {
|
|
374
348
|
const transactionToSign = new MultiAgentRawTransaction(
|
|
375
|
-
|
|
349
|
+
transaction.rawTransaction,
|
|
376
350
|
transaction.secondarySignerAddresses,
|
|
377
351
|
);
|
|
378
352
|
|
|
@@ -391,7 +365,7 @@ export function generateSignedTransactionForSimulation(args: InputSimulateTransa
|
|
|
391
365
|
return new SignedTransaction(transactionToSign.raw_txn, transactionAuthenticator).bcsToBytes();
|
|
392
366
|
}
|
|
393
367
|
|
|
394
|
-
// raw transaction
|
|
368
|
+
// single signer raw transaction
|
|
395
369
|
let transactionAuthenticator;
|
|
396
370
|
if (accountAuthenticator instanceof AccountAuthenticatorEd25519) {
|
|
397
371
|
transactionAuthenticator = new TransactionAuthenticatorEd25519(
|
|
@@ -403,7 +377,7 @@ export function generateSignedTransactionForSimulation(args: InputSimulateTransa
|
|
|
403
377
|
} else {
|
|
404
378
|
throw new Error("Invalid public key");
|
|
405
379
|
}
|
|
406
|
-
return new SignedTransaction(
|
|
380
|
+
return new SignedTransaction(transaction.rawTransaction, transactionAuthenticator).bcsToBytes();
|
|
407
381
|
}
|
|
408
382
|
|
|
409
383
|
export function getAuthenticatorForSimulation(publicKey: PublicKey) {
|
|
@@ -418,7 +392,6 @@ export function getAuthenticatorForSimulation(publicKey: PublicKey) {
|
|
|
418
392
|
}
|
|
419
393
|
|
|
420
394
|
// legacy code
|
|
421
|
-
// TODO add support to legacy multied25519
|
|
422
395
|
return new AccountAuthenticatorEd25519(
|
|
423
396
|
new Ed25519PublicKey(publicKey.toUint8Array()),
|
|
424
397
|
new Ed25519Signature(new Uint8Array(64)),
|
|
@@ -436,10 +409,8 @@ export function getAuthenticatorForSimulation(publicKey: PublicKey) {
|
|
|
436
409
|
export function sign(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {
|
|
437
410
|
const { signer, transaction } = args;
|
|
438
411
|
|
|
439
|
-
const transactionToSign = deriveTransactionType(transaction);
|
|
440
|
-
|
|
441
412
|
// get the signing message
|
|
442
|
-
const message =
|
|
413
|
+
const message = generateSigningMessage(transaction);
|
|
443
414
|
|
|
444
415
|
// account.signMessage
|
|
445
416
|
const signerSignature = signer.sign(message);
|
|
@@ -452,7 +423,10 @@ export function sign(args: { signer: Account; transaction: AnyRawTransaction }):
|
|
|
452
423
|
new Ed25519Signature(signerSignature.toUint8Array()),
|
|
453
424
|
);
|
|
454
425
|
case SigningScheme.SingleKey:
|
|
455
|
-
|
|
426
|
+
if (!AnyPublicKey.isPublicKey(signer.publicKey)) {
|
|
427
|
+
throw new Error(`Cannot sign transaction, public key does not match ${signer.signingScheme}`);
|
|
428
|
+
}
|
|
429
|
+
return new AccountAuthenticatorSingleKey(signer.publicKey, new AnySignature(signerSignature));
|
|
456
430
|
// TODO support MultiEd25519
|
|
457
431
|
default:
|
|
458
432
|
throw new Error(`Cannot sign transaction, signing scheme ${signer.signingScheme} not supported`);
|
|
@@ -473,9 +447,12 @@ export function generateSignedTransaction(args: InputSubmitTransactionData): Uin
|
|
|
473
447
|
|
|
474
448
|
const transactionToSubmit = deriveTransactionType(transaction);
|
|
475
449
|
|
|
476
|
-
if (
|
|
450
|
+
if (
|
|
451
|
+
(feePayerAuthenticator || additionalSignersAuthenticators) &&
|
|
452
|
+
(transactionToSubmit instanceof MultiAgentRawTransaction || transactionToSubmit instanceof FeePayerRawTransaction)
|
|
453
|
+
) {
|
|
477
454
|
return generateMultiSignersSignedTransaction(
|
|
478
|
-
transactionToSubmit
|
|
455
|
+
transactionToSubmit,
|
|
479
456
|
senderAuthenticator,
|
|
480
457
|
feePayerAuthenticator,
|
|
481
458
|
additionalSignersAuthenticators,
|
|
@@ -485,20 +462,21 @@ export function generateSignedTransaction(args: InputSubmitTransactionData): Uin
|
|
|
485
462
|
// submit single signer transaction
|
|
486
463
|
|
|
487
464
|
// check what instance is accountAuthenticator
|
|
488
|
-
if (senderAuthenticator instanceof AccountAuthenticatorEd25519) {
|
|
465
|
+
if (senderAuthenticator instanceof AccountAuthenticatorEd25519 && transactionToSubmit instanceof RawTransaction) {
|
|
489
466
|
const transactionAuthenticator = new TransactionAuthenticatorEd25519(
|
|
490
467
|
senderAuthenticator.public_key,
|
|
491
468
|
senderAuthenticator.signature,
|
|
492
469
|
);
|
|
493
|
-
return new SignedTransaction(transactionToSubmit
|
|
470
|
+
return new SignedTransaction(transactionToSubmit, transactionAuthenticator).bcsToBytes();
|
|
494
471
|
}
|
|
495
472
|
|
|
496
473
|
if (
|
|
497
|
-
senderAuthenticator instanceof AccountAuthenticatorSingleKey ||
|
|
498
|
-
|
|
474
|
+
(senderAuthenticator instanceof AccountAuthenticatorSingleKey ||
|
|
475
|
+
senderAuthenticator instanceof AccountAuthenticatorMultiKey) &&
|
|
476
|
+
transactionToSubmit instanceof RawTransaction
|
|
499
477
|
) {
|
|
500
478
|
const transactionAuthenticator = new TransactionAuthenticatorSingleSender(senderAuthenticator);
|
|
501
|
-
return new SignedTransaction(transactionToSubmit
|
|
479
|
+
return new SignedTransaction(transactionToSubmit, transactionAuthenticator).bcsToBytes();
|
|
502
480
|
}
|
|
503
481
|
|
|
504
482
|
throw new Error(
|
|
@@ -514,18 +492,18 @@ export function generateSignedTransaction(args: InputSubmitTransactionData): Uin
|
|
|
514
492
|
* @returns FeePayerRawTransaction | MultiAgentRawTransaction | RawTransaction
|
|
515
493
|
*/
|
|
516
494
|
export function deriveTransactionType(transaction: AnyRawTransaction): AnyRawTransactionInstance {
|
|
517
|
-
if (
|
|
495
|
+
if (transaction.feePayerAddress) {
|
|
518
496
|
return new FeePayerRawTransaction(
|
|
519
497
|
transaction.rawTransaction,
|
|
520
498
|
transaction.secondarySignerAddresses ?? [],
|
|
521
499
|
transaction.feePayerAddress,
|
|
522
500
|
);
|
|
523
501
|
}
|
|
524
|
-
if (
|
|
502
|
+
if (transaction.secondarySignerAddresses) {
|
|
525
503
|
return new MultiAgentRawTransaction(transaction.rawTransaction, transaction.secondarySignerAddresses);
|
|
526
504
|
}
|
|
527
505
|
|
|
528
|
-
return transaction.rawTransaction
|
|
506
|
+
return transaction.rawTransaction;
|
|
529
507
|
}
|
|
530
508
|
|
|
531
509
|
/**
|
|
@@ -577,7 +555,8 @@ export function generateMultiSignersSignedTransaction(
|
|
|
577
555
|
);
|
|
578
556
|
}
|
|
579
557
|
|
|
580
|
-
export function
|
|
558
|
+
export function generateSigningMessage(transaction: AnyRawTransaction): Uint8Array {
|
|
559
|
+
const rawTxn = deriveTransactionType(transaction);
|
|
581
560
|
const hash = sha3Hash.create();
|
|
582
561
|
|
|
583
562
|
if (rawTxn instanceof RawTransaction) {
|
|
@@ -296,7 +296,7 @@ function parseTypeTagInner(str: string, types: Array<TypeTag>, allowGenerics: bo
|
|
|
296
296
|
|
|
297
297
|
return new TypeTagStruct(
|
|
298
298
|
new StructTag(
|
|
299
|
-
AccountAddress.
|
|
299
|
+
AccountAddress.fromString(structParts[0]),
|
|
300
300
|
new Identifier(structParts[1]),
|
|
301
301
|
new Identifier(structParts[2]),
|
|
302
302
|
types,
|
|
@@ -30,7 +30,7 @@ export type SimpleEntryFunctionArgumentTypes =
|
|
|
30
30
|
| null // To support optional empty
|
|
31
31
|
| undefined // To support optional empty
|
|
32
32
|
| Uint8Array
|
|
33
|
-
| Array<SimpleEntryFunctionArgumentTypes>;
|
|
33
|
+
| Array<SimpleEntryFunctionArgumentTypes | EntryFunctionArgumentTypes>;
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Entry function arguments to be used when building a raw transaction using BCS serialized arguments
|
|
@@ -115,7 +115,7 @@ export type InputEntryFunctionDataWithRemoteABI = InputEntryFunctionData & { apt
|
|
|
115
115
|
* The data needed to generate a Multi Sig payload
|
|
116
116
|
*/
|
|
117
117
|
export type InputMultiSigData = {
|
|
118
|
-
multisigAddress:
|
|
118
|
+
multisigAddress: AccountAddressInput;
|
|
119
119
|
} & InputEntryFunctionData;
|
|
120
120
|
|
|
121
121
|
/**
|
|
@@ -153,19 +153,7 @@ export interface InputGenerateSingleSignerRawTransactionArgs {
|
|
|
153
153
|
sender: AccountAddressInput;
|
|
154
154
|
payload: AnyTransactionPayloadInstance;
|
|
155
155
|
options?: InputGenerateTransactionOptions;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Interface of the arguments to generate a fee payer transaction.
|
|
160
|
-
* Used to provide to `generateTransaction()` method in the transaction builder flow
|
|
161
|
-
*/
|
|
162
|
-
export interface InputGenerateFeePayerRawTransactionArgs {
|
|
163
|
-
aptosConfig: AptosConfig;
|
|
164
|
-
sender: AccountAddressInput;
|
|
165
|
-
payload: AnyTransactionPayloadInstance;
|
|
166
|
-
feePayerAddress: AccountAddressInput;
|
|
167
|
-
secondarySignerAddresses?: AccountAddressInput[];
|
|
168
|
-
options?: InputGenerateTransactionOptions;
|
|
156
|
+
feePayerAddress?: AccountAddressInput;
|
|
169
157
|
}
|
|
170
158
|
|
|
171
159
|
/**
|
|
@@ -178,6 +166,7 @@ export interface InputGenerateMultiAgentRawTransactionArgs {
|
|
|
178
166
|
payload: AnyTransactionPayloadInstance;
|
|
179
167
|
secondarySignerAddresses: AccountAddressInput[];
|
|
180
168
|
options?: InputGenerateTransactionOptions;
|
|
169
|
+
feePayerAddress?: AccountAddressInput;
|
|
181
170
|
}
|
|
182
171
|
|
|
183
172
|
/**
|
|
@@ -185,7 +174,6 @@ export interface InputGenerateMultiAgentRawTransactionArgs {
|
|
|
185
174
|
*/
|
|
186
175
|
export type InputGenerateRawTransactionArgs =
|
|
187
176
|
| InputGenerateSingleSignerRawTransactionArgs
|
|
188
|
-
| InputGenerateFeePayerRawTransactionArgs
|
|
189
177
|
| InputGenerateMultiAgentRawTransactionArgs;
|
|
190
178
|
|
|
191
179
|
/**
|
|
@@ -193,21 +181,10 @@ export type InputGenerateRawTransactionArgs =
|
|
|
193
181
|
*
|
|
194
182
|
* @param rawTransaction a bcs serialized raw transaction
|
|
195
183
|
*/
|
|
196
|
-
export interface
|
|
197
|
-
rawTransaction: RawTransaction;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Interface that holds the return data when generating a fee payer transaction
|
|
202
|
-
*
|
|
203
|
-
* @param rawTransaction a bcs serialized raw transaction
|
|
204
|
-
* @param secondarySignerAddresses optional. secondary signer addresses for multi-agent transaction
|
|
205
|
-
* @param feePayerAddress fee payer address for a fee payer transaction (aka Sponsored Transaction)
|
|
206
|
-
*/
|
|
207
|
-
export interface InputFeePayerTransaction {
|
|
184
|
+
export interface SingleSignerTransaction {
|
|
208
185
|
rawTransaction: RawTransaction;
|
|
209
|
-
feePayerAddress
|
|
210
|
-
secondarySignerAddresses?:
|
|
186
|
+
feePayerAddress?: AccountAddress;
|
|
187
|
+
secondarySignerAddresses?: undefined;
|
|
211
188
|
}
|
|
212
189
|
|
|
213
190
|
/**
|
|
@@ -216,15 +193,16 @@ export interface InputFeePayerTransaction {
|
|
|
216
193
|
* @param rawTransaction a bcs serialized raw transaction
|
|
217
194
|
* @param secondarySignerAddresses secondary signer addresses for multi-agent transaction
|
|
218
195
|
*/
|
|
219
|
-
export interface
|
|
196
|
+
export interface MultiAgentTransaction {
|
|
220
197
|
rawTransaction: RawTransaction;
|
|
221
198
|
secondarySignerAddresses: AccountAddress[];
|
|
199
|
+
feePayerAddress?: AccountAddress;
|
|
222
200
|
}
|
|
223
201
|
|
|
224
202
|
/**
|
|
225
203
|
* Unified type that holds all the return interfaces when generating different transaction types
|
|
226
204
|
*/
|
|
227
|
-
export type AnyRawTransaction =
|
|
205
|
+
export type AnyRawTransaction = SingleSignerTransaction | MultiAgentTransaction;
|
|
228
206
|
|
|
229
207
|
// TRANSACTION SIMULATION TYPES //
|
|
230
208
|
|
|
@@ -261,19 +239,10 @@ export type InputSimulateTransactionOptions = {
|
|
|
261
239
|
*/
|
|
262
240
|
export interface InputGenerateSingleSignerRawTransactionData {
|
|
263
241
|
sender: AccountAddressInput;
|
|
264
|
-
options?: InputGenerateTransactionOptions;
|
|
265
242
|
data: InputGenerateTransactionPayloadData;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* Interface that holds the user data input when generating a fee payer transaction
|
|
270
|
-
*/
|
|
271
|
-
export interface InputGenerateFeePayerRawTransactionData {
|
|
272
|
-
sender: AccountAddressInput;
|
|
273
|
-
hasFeePayer: true;
|
|
274
|
-
secondarySignerAddresses?: AccountAddressInput[];
|
|
275
243
|
options?: InputGenerateTransactionOptions;
|
|
276
|
-
|
|
244
|
+
withFeePayer?: boolean;
|
|
245
|
+
secondarySignerAddresses?: undefined;
|
|
277
246
|
}
|
|
278
247
|
|
|
279
248
|
/**
|
|
@@ -281,18 +250,18 @@ export interface InputGenerateFeePayerRawTransactionData {
|
|
|
281
250
|
*/
|
|
282
251
|
export interface InputGenerateMultiAgentRawTransactionData {
|
|
283
252
|
sender: AccountAddressInput;
|
|
253
|
+
data: InputGenerateTransactionPayloadData;
|
|
284
254
|
secondarySignerAddresses: AccountAddressInput[];
|
|
285
255
|
options?: InputGenerateTransactionOptions;
|
|
286
|
-
|
|
256
|
+
withFeePayer?: boolean;
|
|
287
257
|
}
|
|
288
258
|
|
|
289
259
|
/**
|
|
290
260
|
* Unified type that holds all the user data input interfaces when generating different transaction types
|
|
291
261
|
*/
|
|
292
262
|
export type InputGenerateTransactionData =
|
|
293
|
-
|
|
|
294
|
-
|
|
|
295
|
-
| InputGenerateSingleSignerRawTransactionData;
|
|
263
|
+
| InputGenerateSingleSignerRawTransactionData
|
|
264
|
+
| InputGenerateMultiAgentRawTransactionData;
|
|
296
265
|
|
|
297
266
|
/**
|
|
298
267
|
* Interface that holds the user data input when submitting a transaction
|
|
@@ -18,6 +18,16 @@ export type TokenActivitiesFieldsFragment = {
|
|
|
18
18
|
type: string;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
+
export type AnsTokenFragmentFragment = {
|
|
22
|
+
domain?: string | null;
|
|
23
|
+
expiration_timestamp?: any | null;
|
|
24
|
+
registered_address?: string | null;
|
|
25
|
+
subdomain?: string | null;
|
|
26
|
+
token_standard?: string | null;
|
|
27
|
+
is_primary?: boolean | null;
|
|
28
|
+
owner_address?: string | null;
|
|
29
|
+
};
|
|
30
|
+
|
|
21
31
|
export type CurrentTokenOwnershipFieldsFragment = {
|
|
22
32
|
token_standard: string;
|
|
23
33
|
token_properties_mutated_v1?: any | null;
|
|
@@ -485,8 +495,27 @@ export type GetFungibleAssetMetadataQuery = {
|
|
|
485
495
|
}>;
|
|
486
496
|
};
|
|
487
497
|
|
|
498
|
+
export type GetNamesQueryVariables = Types.Exact<{
|
|
499
|
+
offset?: Types.InputMaybe<Types.Scalars["Int"]["input"]>;
|
|
500
|
+
limit?: Types.InputMaybe<Types.Scalars["Int"]["input"]>;
|
|
501
|
+
where_condition?: Types.InputMaybe<Types.CurrentAptosNamesBoolExp>;
|
|
502
|
+
order_by?: Types.InputMaybe<Array<Types.CurrentAptosNamesOrderBy> | Types.CurrentAptosNamesOrderBy>;
|
|
503
|
+
}>;
|
|
504
|
+
|
|
505
|
+
export type GetNamesQuery = {
|
|
506
|
+
current_aptos_names: Array<{
|
|
507
|
+
domain?: string | null;
|
|
508
|
+
expiration_timestamp?: any | null;
|
|
509
|
+
registered_address?: string | null;
|
|
510
|
+
subdomain?: string | null;
|
|
511
|
+
token_standard?: string | null;
|
|
512
|
+
is_primary?: boolean | null;
|
|
513
|
+
owner_address?: string | null;
|
|
514
|
+
}>;
|
|
515
|
+
};
|
|
516
|
+
|
|
488
517
|
export type GetNumberOfDelegatorsQueryVariables = Types.Exact<{
|
|
489
|
-
where_condition
|
|
518
|
+
where_condition?: Types.InputMaybe<Types.NumActiveDelegatorPerPoolBoolExp>;
|
|
490
519
|
order_by?: Types.InputMaybe<Array<Types.NumActiveDelegatorPerPoolOrderBy> | Types.NumActiveDelegatorPerPoolOrderBy>;
|
|
491
520
|
}>;
|
|
492
521
|
|
|
@@ -494,7 +523,9 @@ export type GetNumberOfDelegatorsQuery = {
|
|
|
494
523
|
num_active_delegator_per_pool: Array<{ num_active_delegator?: any | null; pool_address?: string | null }>;
|
|
495
524
|
};
|
|
496
525
|
|
|
497
|
-
export type GetProcessorStatusQueryVariables = Types.Exact<{
|
|
526
|
+
export type GetProcessorStatusQueryVariables = Types.Exact<{
|
|
527
|
+
where_condition?: Types.InputMaybe<Types.ProcessorStatusBoolExp>;
|
|
528
|
+
}>;
|
|
498
529
|
|
|
499
530
|
export type GetProcessorStatusQuery = {
|
|
500
531
|
processor_status: Array<{ last_success_version: any; processor: string; last_updated: any }>;
|