@aptos-labs/ts-sdk 0.0.5 → 0.0.7
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 +12 -7
- package/dist/browser/index.d.ts +874 -596
- package/dist/browser/index.global.js +75 -30
- package/dist/browser/index.global.js.map +1 -1
- package/dist/common/index.d.ts +874 -596
- package/dist/common/index.js +45 -24
- package/dist/common/index.js.map +1 -1
- package/dist/esm/api/{account.d.ts → account.d.mts} +17 -17
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +273 -0
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +80 -0
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/{aptosConfig.d.ts → aptosConfig.d.mts} +6 -6
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +59 -0
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/{digitalAsset.d.ts → digitalAsset.d.mts} +35 -35
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/{event.d.ts → event.d.mts} +14 -14
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/{faucet.d.ts → faucet.d.mts} +13 -13
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/{fungibleAsset.d.ts → fungibleAsset.d.mts} +7 -7
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/{general.d.ts → general.d.mts} +11 -11
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +50 -0
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/{staking.d.ts → staking.d.mts} +13 -13
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/{transaction.d.ts → transaction.d.mts} +7 -7
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +53 -0
- package/dist/esm/api/transactionSubmission/build.mjs +2 -0
- package/dist/esm/api/transactionSubmission/sign.d.mts +50 -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 +53 -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 +51 -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 +91 -0
- package/dist/esm/api/transactionSubmission.mjs +1 -1
- package/dist/esm/bcs/{consts.d.ts → consts.d.mts} +5 -5
- package/dist/esm/bcs/consts.mjs +1 -1
- package/dist/esm/bcs/{deserializer.d.ts → deserializer.d.mts} +5 -5
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.d.mts +14 -0
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/{entryFunctionBytes.d.ts → entryFunctionBytes.d.mts} +11 -11
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/{fixedBytes.d.ts → fixedBytes.d.mts} +10 -10
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/{movePrimitives.d.ts → movePrimitives.d.mts} +10 -10
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/{moveStructs.d.ts → moveStructs.d.mts} +11 -11
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/{serializer.d.ts → serializer.d.mts} +7 -7
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-2B5QXKPU.mjs → chunk-2OZRBXLM.mjs} +2 -2
- package/dist/esm/chunk-2OZRBXLM.mjs.map +1 -0
- package/dist/esm/{chunk-O243HOP3.mjs → chunk-33T7WTB6.mjs} +2 -2
- package/dist/esm/chunk-33T7WTB6.mjs.map +1 -0
- package/dist/esm/chunk-3732I6BR.mjs +2 -0
- package/dist/esm/chunk-3732I6BR.mjs.map +1 -0
- package/dist/esm/chunk-3VZ3OZKC.mjs +2 -0
- package/dist/esm/chunk-3VZ3OZKC.mjs.map +1 -0
- package/dist/esm/chunk-44MGBJ73.mjs +2 -0
- package/dist/esm/{chunk-CZZJAR3B.mjs.map → chunk-44MGBJ73.mjs.map} +1 -1
- package/dist/esm/chunk-4ADA5BE7.mjs +2 -0
- package/dist/esm/{chunk-7AQXAH6Q.mjs.map → chunk-4ADA5BE7.mjs.map} +1 -1
- package/dist/esm/chunk-4KTQIWUP.mjs +2 -0
- package/dist/esm/chunk-4KTQIWUP.mjs.map +1 -0
- package/dist/esm/chunk-5LO7FR2P.mjs +2 -0
- package/dist/esm/chunk-5LO7FR2P.mjs.map +1 -0
- package/dist/esm/chunk-62SCW5NH.mjs +2 -0
- package/dist/esm/{chunk-YS2OX7AB.mjs.map → chunk-62SCW5NH.mjs.map} +1 -1
- package/dist/esm/{chunk-DNYVUM3K.mjs → chunk-67OGU66P.mjs} +2 -2
- package/dist/esm/{chunk-DNYVUM3K.mjs.map → chunk-67OGU66P.mjs.map} +1 -1
- package/dist/esm/{chunk-XFSL7O6Q.mjs → chunk-72F5YXGC.mjs} +2 -2
- package/dist/esm/chunk-72F5YXGC.mjs.map +1 -0
- package/dist/esm/{chunk-N6XWY4UT.mjs → chunk-ARVSIDVB.mjs} +1 -1
- package/dist/esm/{chunk-N6XWY4UT.mjs.map → chunk-ARVSIDVB.mjs.map} +1 -1
- package/dist/esm/{chunk-WVMDCC4V.mjs → chunk-BFQRMCY2.mjs} +2 -2
- package/dist/esm/{chunk-WVMDCC4V.mjs.map → chunk-BFQRMCY2.mjs.map} +1 -1
- package/dist/esm/{chunk-XFS5O5GJ.mjs → chunk-BM4HBROC.mjs} +2 -2
- package/dist/esm/{chunk-XFS5O5GJ.mjs.map → chunk-BM4HBROC.mjs.map} +1 -1
- package/dist/esm/chunk-BPYLPPEQ.mjs +2 -0
- package/dist/esm/{chunk-V6AAQLLJ.mjs.map → chunk-BPYLPPEQ.mjs.map} +1 -1
- package/dist/esm/{chunk-3OJN4I42.mjs → chunk-BV4OOU5Y.mjs} +2 -2
- package/dist/esm/{chunk-3OJN4I42.mjs.map → chunk-BV4OOU5Y.mjs.map} +1 -1
- package/dist/esm/chunk-CYDWEPFL.mjs +1 -0
- package/dist/esm/chunk-CYDWEPFL.mjs.map +1 -0
- package/dist/esm/chunk-DRPMIJH7.mjs +2 -0
- package/dist/esm/chunk-DRPMIJH7.mjs.map +1 -0
- package/dist/esm/chunk-EFIYW4WK.mjs +2 -0
- package/dist/esm/chunk-EWTHPMEE.mjs +2 -0
- package/dist/esm/{chunk-LAXIJRYU.mjs.map → chunk-EWTHPMEE.mjs.map} +1 -1
- package/dist/esm/chunk-GAI75GOG.mjs +2 -0
- package/dist/esm/{chunk-J3QOSJFP.mjs.map → chunk-GAI75GOG.mjs.map} +1 -1
- package/dist/esm/{chunk-BC2NOUYT.mjs → chunk-GTC7WHMV.mjs} +2 -2
- package/dist/esm/{chunk-BC2NOUYT.mjs.map → chunk-GTC7WHMV.mjs.map} +1 -1
- package/dist/esm/{chunk-MIBLZSNS.mjs → chunk-GU4OUKAF.mjs} +2 -2
- package/dist/esm/chunk-GU4OUKAF.mjs.map +1 -0
- package/dist/esm/{chunk-27P7PELS.mjs → chunk-HA6JD5R6.mjs} +2 -2
- package/dist/esm/{chunk-27P7PELS.mjs.map → chunk-HA6JD5R6.mjs.map} +1 -1
- package/dist/esm/chunk-HO7K2UAK.mjs +2 -0
- package/dist/esm/{chunk-ADR4XQPR.mjs.map → chunk-HO7K2UAK.mjs.map} +1 -1
- package/dist/esm/chunk-HVADSXTB.mjs +2 -0
- package/dist/esm/{chunk-LU6VS7PJ.mjs.map → chunk-HVADSXTB.mjs.map} +1 -1
- package/dist/esm/chunk-IBH7IOIM.mjs +2 -0
- package/dist/esm/{chunk-ZXJ5ZBTL.mjs.map → chunk-IBH7IOIM.mjs.map} +1 -1
- package/dist/esm/chunk-J5BH7V37.mjs +2 -0
- package/dist/esm/chunk-J5BH7V37.mjs.map +1 -0
- package/dist/esm/chunk-JZNLZMUC.mjs +2 -0
- package/dist/esm/{chunk-WGXAIQ7K.mjs.map → chunk-JZNLZMUC.mjs.map} +1 -1
- package/dist/esm/chunk-KQXRH5FK.mjs +2 -0
- package/dist/esm/{chunk-UQIOMAXE.mjs.map → chunk-KQXRH5FK.mjs.map} +1 -1
- package/dist/esm/chunk-L7AA75WZ.mjs +2 -0
- package/dist/esm/chunk-L7AA75WZ.mjs.map +1 -0
- package/dist/esm/chunk-LACQ537H.mjs +2 -0
- package/dist/esm/{chunk-KFP7MDSD.mjs.map → chunk-LACQ537H.mjs.map} +1 -1
- package/dist/esm/{chunk-2MQZUGO6.mjs → chunk-LDAD54H5.mjs} +1 -1
- package/dist/esm/chunk-LDAD54H5.mjs.map +1 -0
- package/dist/esm/chunk-LXW3A3MJ.mjs +2 -0
- package/dist/esm/chunk-LXW3A3MJ.mjs.map +1 -0
- package/dist/esm/{chunk-KYWYIK5P.mjs → chunk-M2V2POWK.mjs} +2 -2
- package/dist/esm/chunk-M2V2POWK.mjs.map +1 -0
- package/dist/esm/chunk-ND3ZQKTT.mjs +2 -0
- package/dist/esm/chunk-ND3ZQKTT.mjs.map +1 -0
- package/dist/esm/chunk-NZIJV4O2.mjs +2 -0
- package/dist/esm/{chunk-HH5RSP2H.mjs.map → chunk-NZIJV4O2.mjs.map} +1 -1
- package/dist/esm/chunk-O2B54NZT.mjs +2 -0
- package/dist/esm/chunk-O2B54NZT.mjs.map +1 -0
- package/dist/esm/chunk-OCW2L33Q.mjs +2 -0
- package/dist/esm/chunk-OCW2L33Q.mjs.map +1 -0
- package/dist/esm/{chunk-PJDVHU7X.mjs → chunk-OCYS4V2V.mjs} +2 -2
- package/dist/esm/{chunk-PJDVHU7X.mjs.map → chunk-OCYS4V2V.mjs.map} +1 -1
- package/dist/esm/{chunk-VAGYTPSI.mjs → chunk-OSTH5JRX.mjs} +2 -2
- package/dist/esm/chunk-OSTH5JRX.mjs.map +1 -0
- package/dist/esm/chunk-OVHY6ZUJ.mjs +2 -0
- package/dist/esm/{chunk-JTGGMXB7.mjs.map → chunk-OVHY6ZUJ.mjs.map} +1 -1
- package/dist/esm/chunk-PZCMSHY6.mjs +2 -0
- package/dist/esm/chunk-QWVR4RCV.mjs +2 -0
- package/dist/esm/{chunk-IPJKGHQY.mjs.map → chunk-QWVR4RCV.mjs.map} +1 -1
- package/dist/esm/chunk-R3KWVOFG.mjs +2 -0
- package/dist/esm/{chunk-KWJ6XKNF.mjs.map → chunk-R3KWVOFG.mjs.map} +1 -1
- package/dist/esm/{chunk-TXUMB5ZO.mjs → chunk-RHS5ROLP.mjs} +2 -2
- package/dist/esm/chunk-RHS5ROLP.mjs.map +1 -0
- package/dist/esm/{chunk-IXMH6AXJ.mjs → chunk-RKKU2SY5.mjs} +2 -2
- package/dist/esm/chunk-RYETO74W.mjs +2 -0
- package/dist/esm/{chunk-BIUGRAMO.mjs.map → chunk-RYETO74W.mjs.map} +1 -1
- package/dist/esm/chunk-S36IYY6K.mjs +2 -0
- package/dist/esm/{chunk-DXUIJ6KA.mjs.map → chunk-S36IYY6K.mjs.map} +1 -1
- package/dist/esm/chunk-TGKB6ALT.mjs +2 -0
- package/dist/esm/chunk-TGKB6ALT.mjs.map +1 -0
- package/dist/esm/chunk-TIH6ARYP.mjs +2 -0
- package/dist/esm/{chunk-IZHPCZE3.mjs.map → chunk-TIH6ARYP.mjs.map} +1 -1
- package/dist/esm/chunk-TPWSHFFI.mjs +2 -0
- package/dist/esm/chunk-TPWSHFFI.mjs.map +1 -0
- package/dist/esm/chunk-U25N2VWA.mjs +2 -0
- package/dist/esm/{chunk-FNB6CFQR.mjs.map → chunk-U25N2VWA.mjs.map} +1 -1
- package/dist/esm/chunk-U6SZNNVL.mjs +2 -0
- package/dist/esm/chunk-U6SZNNVL.mjs.map +1 -0
- package/dist/esm/{chunk-EKAOAGNQ.mjs → chunk-UAAI3NCA.mjs} +2 -2
- package/dist/esm/{chunk-BTK34A5U.mjs → chunk-UDBH4CER.mjs} +42 -21
- package/dist/esm/chunk-UDBH4CER.mjs.map +1 -0
- package/dist/esm/chunk-VWVEDCBM.mjs +2 -0
- package/dist/esm/{chunk-BREUBEPM.mjs.map → chunk-VWVEDCBM.mjs.map} +1 -1
- package/dist/esm/{chunk-ZT2A5ABR.mjs → chunk-WEJAI26R.mjs} +2 -2
- package/dist/esm/{chunk-ZT2A5ABR.mjs.map → chunk-WEJAI26R.mjs.map} +1 -1
- package/dist/esm/chunk-WL4OXZLN.mjs +2 -0
- package/dist/esm/{chunk-KNLMUSIO.mjs.map → chunk-WL4OXZLN.mjs.map} +1 -1
- package/dist/esm/chunk-X32O46IB.mjs +2 -0
- package/dist/esm/{chunk-PDLUCVJB.mjs.map → chunk-X32O46IB.mjs.map} +1 -1
- package/dist/esm/{chunk-KPESAXVI.mjs → chunk-Y2HRRUZ6.mjs} +2 -2
- package/dist/esm/{chunk-GUT3G5CG.mjs → chunk-Y7VR7X5W.mjs} +2 -2
- package/dist/esm/chunk-Y7VR7X5W.mjs.map +1 -0
- package/dist/esm/chunk-YYRDFZE6.mjs +2 -0
- package/dist/esm/{chunk-UVGCVCNG.mjs.map → chunk-YYRDFZE6.mjs.map} +1 -1
- package/dist/esm/{chunk-TYHBYRUA.mjs → chunk-ZLW65YCO.mjs} +2 -2
- package/dist/esm/chunk-ZLW65YCO.mjs.map +1 -0
- package/dist/esm/chunk-ZUHN56GM.mjs +2 -0
- package/dist/esm/chunk-ZUHN56GM.mjs.map +1 -0
- package/dist/esm/{chunk-XNFEUXDS.mjs → chunk-ZWH2ESXT.mjs} +1 -1
- package/dist/esm/chunk-ZWH2ESXT.mjs.map +1 -0
- package/dist/esm/client/{core.d.ts → core.d.mts} +9 -9
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/{get.d.ts → get.d.mts} +12 -12
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +11 -0
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/{post.d.ts → post.d.mts} +14 -14
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/client/{types.d.ts → types.d.mts} +5 -5
- package/dist/esm/client/types.mjs +1 -1
- package/dist/esm/core/{account.d.ts → account.d.mts} +13 -13
- package/dist/esm/core/account.mjs +1 -1
- package/dist/esm/core/{accountAddress.d.ts → accountAddress.d.mts} +11 -11
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/{authenticationKey.d.ts → authenticationKey.d.mts} +12 -12
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/{common.d.ts → common.d.mts} +1 -1
- package/dist/esm/core/common.mjs +1 -1
- package/dist/esm/core/crypto/{anyPublicKey.d.ts → anyPublicKey.d.mts} +11 -11
- package/dist/esm/core/crypto/anyPublicKey.mjs +1 -1
- package/dist/esm/core/crypto/{anySignature.d.ts → anySignature.d.mts} +10 -10
- package/dist/esm/core/crypto/anySignature.mjs +1 -1
- package/dist/esm/core/crypto/{asymmetricCrypto.d.ts → asymmetricCrypto.d.mts} +8 -8
- package/dist/esm/core/crypto/asymmetricCrypto.mjs +1 -1
- package/dist/esm/core/crypto/{ed25519.d.ts → ed25519.d.mts} +10 -10
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/{hdKey.d.ts → hdKey.d.mts} +1 -1
- package/dist/esm/core/crypto/hdKey.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +17 -0
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/{multiEd25519.d.ts → multiEd25519.d.mts} +11 -11
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/{multiKey.d.ts → multiKey.d.mts} +12 -12
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/{secp256k1.d.ts → secp256k1.d.mts} +10 -10
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/{hex.d.ts → hex.d.mts} +6 -6
- package/dist/esm/core/hex.mjs +1 -1
- package/dist/esm/core/index.d.mts +21 -0
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +64 -0
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/{account.d.ts → account.d.mts} +17 -17
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +150 -0
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +43 -0
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/{digitalAsset.d.ts → digitalAsset.d.mts} +34 -34
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/{event.d.ts → event.d.mts} +14 -14
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +29 -0
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/{fungibleAsset.d.ts → fungibleAsset.d.mts} +7 -7
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/{general.d.ts → general.d.mts} +11 -11
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/{staking.d.ts → staking.d.mts} +13 -13
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/{transaction.d.ts → transaction.d.mts} +7 -7
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/{transactionSubmission.d.ts → transactionSubmission.d.mts} +41 -72
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/transactions/authenticator/{account.d.ts → account.d.mts} +15 -15
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +19 -0
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/{transaction.d.ts → transaction.d.mts} +18 -18
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +39 -0
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.d.mts +21 -0
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/{identifier.d.ts → identifier.d.mts} +9 -9
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/index.d.mts +29 -0
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/{moduleId.d.ts → moduleId.d.mts} +12 -12
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/{rawTransaction.d.ts → rawTransaction.d.mts} +16 -16
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/{rotationProofChallenge.d.ts → rotationProofChallenge.d.mts} +14 -14
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/{signedTransaction.d.ts → signedTransaction.d.mts} +25 -25
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/{transactionArgument.d.ts → transactionArgument.d.mts} +8 -8
- package/dist/esm/transactions/instances/{transactionPayload.d.ts → transactionPayload.d.mts} +14 -14
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/{helpers.d.ts → helpers.d.mts} +31 -31
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +35 -0
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +54 -0
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/{transactionBuilder.d.ts → transactionBuilder.d.mts} +35 -40
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/{index.d.ts → index.d.mts} +12 -12
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/{parser.d.ts → parser.d.mts} +14 -13
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/{types.d.ts → types.d.mts} +60 -97
- package/dist/esm/types/generated/{operations.d.ts → operations.d.mts} +105 -79
- package/dist/esm/types/generated/{queries.d.ts → queries.d.mts} +35 -32
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/generated/{types.d.ts → types.d.mts} +3184 -3146
- 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.ts → index.d.mts} +94 -92
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/indexer.d.mts +63 -0
- package/dist/esm/utils/apiEndpoints.mjs +1 -1
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.d.mts +2 -0
- package/dist/esm/utils/index.mjs +2 -0
- package/dist/esm/utils/index.mjs.map +1 -0
- package/dist/esm/utils/memoize.mjs +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +30 -30
- package/src/api/account.ts +2 -2
- package/src/api/ans.ts +250 -11
- package/src/api/aptos.ts +20 -0
- package/src/api/coin.ts +4 -4
- package/src/api/digitalAsset.ts +3 -3
- package/src/api/event.ts +2 -2
- package/src/api/general.ts +4 -4
- 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 +4 -138
- package/src/client/core.ts +1 -1
- package/src/client/get.ts +6 -2
- package/src/client/post.ts +12 -4
- package/src/index.ts +1 -1
- package/src/internal/account.ts +2 -2
- package/src/internal/ans.ts +408 -22
- package/src/internal/coin.ts +5 -5
- package/src/internal/digitalAsset.ts +5 -5
- package/src/internal/event.ts +2 -2
- package/src/internal/general.ts +7 -6
- package/src/internal/queries/ansTokenFragment.graphql +9 -0
- package/src/internal/queries/getNames.graphql +11 -0
- package/src/internal/transactionSubmission.ts +52 -12
- package/src/transactions/transactionBuilder/helpers.ts +2 -2
- package/src/transactions/transactionBuilder/transactionBuilder.ts +22 -46
- package/src/transactions/typeTag/parser.ts +10 -2
- package/src/transactions/types.ts +16 -56
- package/src/types/generated/operations.ts +62 -33
- package/src/types/generated/queries.ts +56 -22
- package/src/types/generated/types.ts +2253 -2251
- package/src/types/index.ts +16 -10
- package/src/types/indexer.ts +3 -0
- package/src/utils/index.ts +2 -0
- package/dist/esm/api/ans.d.ts +0 -79
- package/dist/esm/api/aptos.d.ts +0 -72
- package/dist/esm/api/coin.d.ts +0 -59
- package/dist/esm/api/index.d.ts +0 -46
- package/dist/esm/api/transactionSubmission.d.ts +0 -142
- package/dist/esm/bcs/index.d.ts +0 -14
- package/dist/esm/chunk-2444YR3Y.mjs +0 -2
- package/dist/esm/chunk-2444YR3Y.mjs.map +0 -1
- package/dist/esm/chunk-2B5QXKPU.mjs.map +0 -1
- package/dist/esm/chunk-2MQZUGO6.mjs.map +0 -1
- package/dist/esm/chunk-3YOV42H5.mjs +0 -2
- package/dist/esm/chunk-3YOV42H5.mjs.map +0 -1
- package/dist/esm/chunk-7AIV5FEN.mjs +0 -2
- package/dist/esm/chunk-7AIV5FEN.mjs.map +0 -1
- package/dist/esm/chunk-7AQXAH6Q.mjs +0 -2
- package/dist/esm/chunk-7TL2MY2B.mjs +0 -2
- package/dist/esm/chunk-7TL2MY2B.mjs.map +0 -1
- package/dist/esm/chunk-ADR4XQPR.mjs +0 -2
- package/dist/esm/chunk-AY2HWVDO.mjs +0 -2
- package/dist/esm/chunk-AY2HWVDO.mjs.map +0 -1
- package/dist/esm/chunk-BIUGRAMO.mjs +0 -2
- package/dist/esm/chunk-BREUBEPM.mjs +0 -2
- package/dist/esm/chunk-BTK34A5U.mjs.map +0 -1
- package/dist/esm/chunk-CZZJAR3B.mjs +0 -2
- package/dist/esm/chunk-DXUIJ6KA.mjs +0 -2
- package/dist/esm/chunk-E72CFUU4.mjs +0 -2
- package/dist/esm/chunk-FHJ7F7Z6.mjs +0 -2
- package/dist/esm/chunk-FHJ7F7Z6.mjs.map +0 -1
- package/dist/esm/chunk-FNB6CFQR.mjs +0 -2
- package/dist/esm/chunk-GUT3G5CG.mjs.map +0 -1
- package/dist/esm/chunk-HH5RSP2H.mjs +0 -2
- package/dist/esm/chunk-IPJKGHQY.mjs +0 -2
- package/dist/esm/chunk-IZHPCZE3.mjs +0 -2
- package/dist/esm/chunk-J3QOSJFP.mjs +0 -2
- package/dist/esm/chunk-J5OKXARS.mjs +0 -2
- package/dist/esm/chunk-J5OKXARS.mjs.map +0 -1
- package/dist/esm/chunk-JTGGMXB7.mjs +0 -2
- package/dist/esm/chunk-KFP7MDSD.mjs +0 -2
- package/dist/esm/chunk-KJDY66XF.mjs +0 -2
- package/dist/esm/chunk-KJDY66XF.mjs.map +0 -1
- package/dist/esm/chunk-KNLMUSIO.mjs +0 -2
- package/dist/esm/chunk-KWJ6XKNF.mjs +0 -2
- package/dist/esm/chunk-KYWYIK5P.mjs.map +0 -1
- package/dist/esm/chunk-LAXIJRYU.mjs +0 -2
- package/dist/esm/chunk-LU6VS7PJ.mjs +0 -2
- package/dist/esm/chunk-MIBLZSNS.mjs.map +0 -1
- package/dist/esm/chunk-NKTKHC3Z.mjs +0 -2
- package/dist/esm/chunk-NKTKHC3Z.mjs.map +0 -1
- package/dist/esm/chunk-O243HOP3.mjs.map +0 -1
- package/dist/esm/chunk-PDLUCVJB.mjs +0 -2
- package/dist/esm/chunk-SJLO3JIH.mjs +0 -2
- package/dist/esm/chunk-TXUMB5ZO.mjs.map +0 -1
- package/dist/esm/chunk-TYHBYRUA.mjs.map +0 -1
- package/dist/esm/chunk-UQIOMAXE.mjs +0 -2
- package/dist/esm/chunk-UVGCVCNG.mjs +0 -2
- package/dist/esm/chunk-V6AAQLLJ.mjs +0 -2
- package/dist/esm/chunk-VAGYTPSI.mjs.map +0 -1
- package/dist/esm/chunk-WGXAIQ7K.mjs +0 -2
- package/dist/esm/chunk-WNEZCERQ.mjs +0 -2
- package/dist/esm/chunk-WNEZCERQ.mjs.map +0 -1
- package/dist/esm/chunk-XFSL7O6Q.mjs.map +0 -1
- package/dist/esm/chunk-YS2OX7AB.mjs +0 -2
- package/dist/esm/chunk-Z56AKXJ7.mjs +0 -2
- package/dist/esm/chunk-Z56AKXJ7.mjs.map +0 -1
- package/dist/esm/chunk-ZXJ5ZBTL.mjs +0 -2
- package/dist/esm/client/index.d.ts +0 -11
- package/dist/esm/core/crypto/index.d.ts +0 -17
- package/dist/esm/core/index.d.ts +0 -21
- package/dist/esm/index.d.ts +0 -60
- package/dist/esm/internal/ans.d.ts +0 -83
- package/dist/esm/internal/coin.d.ts +0 -43
- package/dist/esm/internal/faucet.d.ts +0 -29
- package/dist/esm/transactions/authenticator/index.d.ts +0 -19
- package/dist/esm/transactions/index.d.ts +0 -39
- package/dist/esm/transactions/instances/chainId.d.ts +0 -21
- package/dist/esm/transactions/instances/index.d.ts +0 -29
- package/dist/esm/transactions/transactionBuilder/index.d.ts +0 -35
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.ts +0 -54
- package/dist/esm/types/indexer.d.ts +0 -62
- /package/dist/esm/{chunk-XNFEUXDS.mjs.map → api/transactionSubmission/build.mjs.map} +0 -0
- /package/dist/esm/{chunk-E72CFUU4.mjs.map → chunk-EFIYW4WK.mjs.map} +0 -0
- /package/dist/esm/{chunk-SJLO3JIH.mjs.map → chunk-PZCMSHY6.mjs.map} +0 -0
- /package/dist/esm/{chunk-IXMH6AXJ.mjs.map → chunk-RKKU2SY5.mjs.map} +0 -0
- /package/dist/esm/{chunk-EKAOAGNQ.mjs.map → chunk-UAAI3NCA.mjs.map} +0 -0
- /package/dist/esm/{chunk-KPESAXVI.mjs.map → chunk-Y2HRRUZ6.mjs.map} +0 -0
- /package/dist/esm/utils/{apiEndpoints.d.ts → apiEndpoints.d.mts} +0 -0
- /package/dist/esm/utils/{const.d.ts → const.d.mts} +0 -0
- /package/dist/esm/utils/{helpers.d.ts → helpers.d.mts} +0 -0
- /package/dist/esm/utils/{memoize.d.ts → memoize.d.mts} +0 -0
- /package/dist/esm/{version.d.ts → version.d.mts} +0 -0
|
@@ -25,13 +25,29 @@ import {
|
|
|
25
25
|
AnyRawTransaction,
|
|
26
26
|
InputSimulateTransactionData,
|
|
27
27
|
InputGenerateTransactionOptions,
|
|
28
|
-
|
|
28
|
+
SingleSignerTransaction,
|
|
29
29
|
InputGenerateTransactionPayloadDataWithRemoteABI,
|
|
30
30
|
InputSubmitTransactionData,
|
|
31
|
+
InputGenerateMultiAgentRawTransactionData,
|
|
32
|
+
InputGenerateSingleSignerRawTransactionData,
|
|
33
|
+
MultiAgentTransaction,
|
|
34
|
+
AnyTransactionPayloadInstance,
|
|
31
35
|
} from "../transactions/types";
|
|
32
36
|
import { getInfo } from "./account";
|
|
33
37
|
import { UserTransactionResponse, PendingTransactionResponse, MimeType, HexInput, TransactionResponse } from "../types";
|
|
34
38
|
|
|
39
|
+
/**
|
|
40
|
+
* We are defining function signatures, each with its specific input and output.
|
|
41
|
+
* These are the possible function signature for `generateTransaction` function.
|
|
42
|
+
* When we call `generateTransaction` function with the relevant type properties,
|
|
43
|
+
* Typescript can infer the return type based on the appropriate function overload.
|
|
44
|
+
*/
|
|
45
|
+
export async function generateTransaction(
|
|
46
|
+
args: { aptosConfig: AptosConfig } & InputGenerateSingleSignerRawTransactionData,
|
|
47
|
+
): Promise<SingleSignerTransaction>;
|
|
48
|
+
export async function generateTransaction(
|
|
49
|
+
args: { aptosConfig: AptosConfig } & InputGenerateMultiAgentRawTransactionData,
|
|
50
|
+
): Promise<MultiAgentTransaction>;
|
|
35
51
|
/**
|
|
36
52
|
* Generates any transaction by passing in the required arguments
|
|
37
53
|
*
|
|
@@ -75,18 +91,14 @@ import { UserTransactionResponse, PendingTransactionResponse, MimeType, HexInput
|
|
|
75
91
|
export async function generateTransaction(
|
|
76
92
|
args: { aptosConfig: AptosConfig } & InputGenerateTransactionData,
|
|
77
93
|
): Promise<AnyRawTransaction> {
|
|
78
|
-
const { aptosConfig, sender, data, options
|
|
79
|
-
|
|
80
|
-
// Upate feePayerAddress if it has sponsor
|
|
81
|
-
let feePayerAddress;
|
|
82
|
-
if (hasFeePayer === true) {
|
|
83
|
-
feePayerAddress = AccountAddress.ZERO.toString();
|
|
84
|
-
}
|
|
94
|
+
const { aptosConfig, sender, data, options } = args;
|
|
85
95
|
|
|
86
96
|
// Merge in aptosConfig for remote ABI on non-script payloads
|
|
87
97
|
let generateTransactionPayloadData: InputGenerateTransactionPayloadDataWithRemoteABI;
|
|
98
|
+
let payload: AnyTransactionPayloadInstance;
|
|
88
99
|
if ("bytecode" in data) {
|
|
89
100
|
generateTransactionPayloadData = data;
|
|
101
|
+
payload = await generateTransactionPayload(generateTransactionPayloadData);
|
|
90
102
|
} else if ("multisigAddress" in data) {
|
|
91
103
|
generateTransactionPayloadData = {
|
|
92
104
|
aptosConfig,
|
|
@@ -95,6 +107,7 @@ export async function generateTransaction(
|
|
|
95
107
|
functionArguments: data.functionArguments,
|
|
96
108
|
typeArguments: data.typeArguments,
|
|
97
109
|
};
|
|
110
|
+
payload = await generateTransactionPayload(generateTransactionPayloadData);
|
|
98
111
|
} else {
|
|
99
112
|
generateTransactionPayloadData = {
|
|
100
113
|
aptosConfig,
|
|
@@ -102,18 +115,45 @@ export async function generateTransaction(
|
|
|
102
115
|
functionArguments: data.functionArguments,
|
|
103
116
|
typeArguments: data.typeArguments,
|
|
104
117
|
};
|
|
118
|
+
payload = await generateTransactionPayload(generateTransactionPayloadData);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
let feePayerAddress;
|
|
122
|
+
if (isFeePayerTransactionInput(args)) {
|
|
123
|
+
feePayerAddress = AccountAddress.ZERO.toString();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (isMultiAgentTransactionInput(args)) {
|
|
127
|
+
const { secondarySignerAddresses } = args;
|
|
128
|
+
return buildTransaction({
|
|
129
|
+
aptosConfig,
|
|
130
|
+
sender,
|
|
131
|
+
payload,
|
|
132
|
+
options,
|
|
133
|
+
secondarySignerAddresses,
|
|
134
|
+
feePayerAddress,
|
|
135
|
+
});
|
|
105
136
|
}
|
|
106
|
-
|
|
137
|
+
|
|
107
138
|
return buildTransaction({
|
|
108
139
|
aptosConfig,
|
|
109
140
|
sender,
|
|
110
141
|
payload,
|
|
111
142
|
options,
|
|
112
|
-
secondarySignerAddresses,
|
|
113
143
|
feePayerAddress,
|
|
114
144
|
});
|
|
115
145
|
}
|
|
116
146
|
|
|
147
|
+
function isFeePayerTransactionInput(data: InputGenerateTransactionData): boolean {
|
|
148
|
+
return data.withFeePayer === true;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function isMultiAgentTransactionInput(
|
|
152
|
+
data: InputGenerateTransactionData,
|
|
153
|
+
): data is InputGenerateMultiAgentRawTransactionData {
|
|
154
|
+
return "secondarySignerAddresses" in data;
|
|
155
|
+
}
|
|
156
|
+
|
|
117
157
|
/**
|
|
118
158
|
* Sign a transaction that can later be submitted to chain
|
|
119
159
|
*
|
|
@@ -217,7 +257,7 @@ export async function publicPackageTransaction(args: {
|
|
|
217
257
|
metadataBytes: HexInput;
|
|
218
258
|
moduleBytecode: Array<HexInput>;
|
|
219
259
|
options?: InputGenerateTransactionOptions;
|
|
220
|
-
}): Promise<
|
|
260
|
+
}): Promise<SingleSignerTransaction> {
|
|
221
261
|
const { aptosConfig, account, metadataBytes, moduleBytecode, options } = args;
|
|
222
262
|
|
|
223
263
|
const totalByteCode = moduleBytecode.map((bytecode) => MoveVector.U8(bytecode));
|
|
@@ -231,7 +271,7 @@ export async function publicPackageTransaction(args: {
|
|
|
231
271
|
},
|
|
232
272
|
options,
|
|
233
273
|
});
|
|
234
|
-
return transaction as
|
|
274
|
+
return transaction as SingleSignerTransaction;
|
|
235
275
|
}
|
|
236
276
|
|
|
237
277
|
/**
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "../types";
|
|
11
11
|
import { Bool, FixedBytes, MoveString, U128, U16, U256, U32, U64, U8 } from "../../bcs";
|
|
12
12
|
import { AccountAddress } from "../../core";
|
|
13
|
-
import { MoveFunction,
|
|
13
|
+
import { MoveFunction, MoveFunctionId } from "../../types";
|
|
14
14
|
|
|
15
15
|
export function isBool(arg: SimpleEntryFunctionArgumentTypes): arg is boolean {
|
|
16
16
|
return typeof arg === "boolean";
|
|
@@ -91,7 +91,7 @@ export function findFirstNonSignerArg(functionAbi: MoveFunction): number {
|
|
|
91
91
|
return index;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
export function getFunctionParts(functionArg:
|
|
94
|
+
export function getFunctionParts(functionArg: MoveFunctionId) {
|
|
95
95
|
const funcNameParts = functionArg.split("::");
|
|
96
96
|
if (funcNameParts.length !== 3) {
|
|
97
97
|
throw new Error(`Invalid function ${functionArg}`);
|
|
@@ -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,
|
|
@@ -86,18 +83,13 @@ import { getFunctionParts, isScriptDataInput } from "./helpers";
|
|
|
86
83
|
* When we call our `generateTransactionPayload` function with the relevant type properties,
|
|
87
84
|
* Typescript can infer the return type based on the appropriate function overload.
|
|
88
85
|
*/
|
|
89
|
-
export async function generateTransactionPayload(
|
|
90
|
-
args: InputScriptData & { aptosConfig?: undefined },
|
|
91
|
-
): Promise<TransactionPayloadScript>;
|
|
86
|
+
export async function generateTransactionPayload(args: InputScriptData): Promise<TransactionPayloadScript>;
|
|
92
87
|
export async function generateTransactionPayload(
|
|
93
88
|
args: InputEntryFunctionDataWithRemoteABI,
|
|
94
89
|
): Promise<TransactionPayloadEntryFunction>;
|
|
95
90
|
export async function generateTransactionPayload(
|
|
96
91
|
args: InputMultiSigDataWithRemoteABI,
|
|
97
92
|
): Promise<TransactionPayloadMultisig>;
|
|
98
|
-
export async function generateTransactionPayload(
|
|
99
|
-
args: InputGenerateTransactionPayloadDataWithRemoteABI,
|
|
100
|
-
): Promise<AnyTransactionPayloadInstance>;
|
|
101
93
|
|
|
102
94
|
/**
|
|
103
95
|
* Builds a transaction payload based on the data argument and returns
|
|
@@ -234,7 +226,7 @@ export async function generateRawTransaction(args: {
|
|
|
234
226
|
);
|
|
235
227
|
|
|
236
228
|
const { maxGasAmount, gasUnitPrice, expireTimestamp } = {
|
|
237
|
-
maxGasAmount: BigInt(DEFAULT_MAX_GAS_AMOUNT),
|
|
229
|
+
maxGasAmount: options?.maxGasAmount ? BigInt(options.maxGasAmount) : BigInt(DEFAULT_MAX_GAS_AMOUNT),
|
|
238
230
|
gasUnitPrice: BigInt(gasEstimate),
|
|
239
231
|
expireTimestamp: BigInt(Math.floor(Date.now() / 1000) + DEFAULT_TXN_EXP_SEC_FROM_NOW),
|
|
240
232
|
...options,
|
|
@@ -259,14 +251,9 @@ export async function generateRawTransaction(args: {
|
|
|
259
251
|
*/
|
|
260
252
|
export async function buildTransaction(
|
|
261
253
|
args: InputGenerateSingleSignerRawTransactionArgs,
|
|
262
|
-
): Promise<
|
|
263
|
-
export async function buildTransaction(
|
|
264
|
-
|
|
265
|
-
): Promise<InputFeePayerTransaction>;
|
|
266
|
-
export async function buildTransaction(
|
|
267
|
-
args: InputGenerateMultiAgentRawTransactionArgs,
|
|
268
|
-
): Promise<InputMultiAgentTransaction>;
|
|
269
|
-
export async function buildTransaction(args: InputGenerateRawTransactionArgs): Promise<AnyRawTransaction>;
|
|
254
|
+
): Promise<SingleSignerTransaction>;
|
|
255
|
+
export async function buildTransaction(args: InputGenerateMultiAgentRawTransactionArgs): Promise<MultiAgentTransaction>;
|
|
256
|
+
|
|
270
257
|
/**
|
|
271
258
|
* Generates a transaction based on the provided arguments
|
|
272
259
|
*
|
|
@@ -290,7 +277,7 @@ export async function buildTransaction(args: InputGenerateRawTransactionArgs): P
|
|
|
290
277
|
* ```
|
|
291
278
|
*/
|
|
292
279
|
export async function buildTransaction(args: InputGenerateRawTransactionArgs): Promise<AnyRawTransaction> {
|
|
293
|
-
const { aptosConfig, sender, payload, options
|
|
280
|
+
const { aptosConfig, sender, payload, options } = args;
|
|
294
281
|
// generate raw transaction
|
|
295
282
|
const rawTxn = await generateRawTransaction({
|
|
296
283
|
aptosConfig,
|
|
@@ -299,28 +286,22 @@ export async function buildTransaction(args: InputGenerateRawTransactionArgs): P
|
|
|
299
286
|
options,
|
|
300
287
|
});
|
|
301
288
|
|
|
302
|
-
if
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
return {
|
|
308
|
-
rawTransaction: rawTxn,
|
|
309
|
-
secondarySignerAddresses: signers,
|
|
310
|
-
feePayerAddress: AccountAddress.fromRelaxed(feePayerAddress),
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
if (secondarySignerAddresses) {
|
|
315
|
-
const signers: Array<AccountAddress> = secondarySignerAddresses.map((signer) => AccountAddress.fromRelaxed(signer));
|
|
289
|
+
// if multi agent transaction
|
|
290
|
+
if ("secondarySignerAddresses" in args) {
|
|
291
|
+
const signers: Array<AccountAddress> =
|
|
292
|
+
args.secondarySignerAddresses?.map((signer) => AccountAddress.fromRelaxed(signer)) ?? [];
|
|
316
293
|
|
|
317
294
|
return {
|
|
318
295
|
rawTransaction: rawTxn,
|
|
319
296
|
secondarySignerAddresses: signers,
|
|
297
|
+
feePayerAddress: args.feePayerAddress ? AccountAddress.fromRelaxed(args.feePayerAddress) : undefined,
|
|
320
298
|
};
|
|
321
299
|
}
|
|
322
300
|
// return the raw transaction
|
|
323
|
-
return {
|
|
301
|
+
return {
|
|
302
|
+
rawTransaction: rawTxn,
|
|
303
|
+
feePayerAddress: args.feePayerAddress ? AccountAddress.fromRelaxed(args.feePayerAddress) : undefined,
|
|
304
|
+
};
|
|
324
305
|
}
|
|
325
306
|
|
|
326
307
|
/**
|
|
@@ -337,25 +318,21 @@ export async function buildTransaction(args: InputGenerateRawTransactionArgs): P
|
|
|
337
318
|
export function generateSignedTransactionForSimulation(args: InputSimulateTransactionData): Uint8Array {
|
|
338
319
|
const { signerPublicKey, transaction, secondarySignersPublicKeys, feePayerPublicKey } = args;
|
|
339
320
|
|
|
340
|
-
const deserializer = new Deserializer(transaction.rawTransaction.bcsToBytes());
|
|
341
|
-
const deserializedTransaction = RawTransaction.deserialize(deserializer);
|
|
342
|
-
|
|
343
321
|
const accountAuthenticator = getAuthenticatorForSimulation(signerPublicKey);
|
|
322
|
+
|
|
344
323
|
// fee payer transaction
|
|
345
324
|
if (transaction.feePayerAddress) {
|
|
346
325
|
const transactionToSign = new FeePayerRawTransaction(
|
|
347
|
-
|
|
326
|
+
transaction.rawTransaction,
|
|
348
327
|
transaction.secondarySignerAddresses ?? [],
|
|
349
328
|
transaction.feePayerAddress,
|
|
350
329
|
);
|
|
351
|
-
|
|
352
330
|
let secondaryAccountAuthenticators: Array<AccountAuthenticator> = [];
|
|
353
331
|
if (secondarySignersPublicKeys) {
|
|
354
332
|
secondaryAccountAuthenticators = secondarySignersPublicKeys.map((publicKey) =>
|
|
355
333
|
getAuthenticatorForSimulation(publicKey),
|
|
356
334
|
);
|
|
357
335
|
}
|
|
358
|
-
|
|
359
336
|
const feePayerAuthenticator = getAuthenticatorForSimulation(feePayerPublicKey!);
|
|
360
337
|
|
|
361
338
|
const transactionAuthenticator = new TransactionAuthenticatorFeePayer(
|
|
@@ -373,7 +350,7 @@ export function generateSignedTransactionForSimulation(args: InputSimulateTransa
|
|
|
373
350
|
// multi agent transaction
|
|
374
351
|
if (transaction.secondarySignerAddresses) {
|
|
375
352
|
const transactionToSign = new MultiAgentRawTransaction(
|
|
376
|
-
|
|
353
|
+
transaction.rawTransaction,
|
|
377
354
|
transaction.secondarySignerAddresses,
|
|
378
355
|
);
|
|
379
356
|
|
|
@@ -392,7 +369,7 @@ export function generateSignedTransactionForSimulation(args: InputSimulateTransa
|
|
|
392
369
|
return new SignedTransaction(transactionToSign.raw_txn, transactionAuthenticator).bcsToBytes();
|
|
393
370
|
}
|
|
394
371
|
|
|
395
|
-
// raw transaction
|
|
372
|
+
// single signer raw transaction
|
|
396
373
|
let transactionAuthenticator;
|
|
397
374
|
if (accountAuthenticator instanceof AccountAuthenticatorEd25519) {
|
|
398
375
|
transactionAuthenticator = new TransactionAuthenticatorEd25519(
|
|
@@ -404,7 +381,7 @@ export function generateSignedTransactionForSimulation(args: InputSimulateTransa
|
|
|
404
381
|
} else {
|
|
405
382
|
throw new Error("Invalid public key");
|
|
406
383
|
}
|
|
407
|
-
return new SignedTransaction(
|
|
384
|
+
return new SignedTransaction(transaction.rawTransaction, transactionAuthenticator).bcsToBytes();
|
|
408
385
|
}
|
|
409
386
|
|
|
410
387
|
export function getAuthenticatorForSimulation(publicKey: PublicKey) {
|
|
@@ -419,7 +396,6 @@ export function getAuthenticatorForSimulation(publicKey: PublicKey) {
|
|
|
419
396
|
}
|
|
420
397
|
|
|
421
398
|
// legacy code
|
|
422
|
-
// TODO add support to legacy multied25519
|
|
423
399
|
return new AccountAuthenticatorEd25519(
|
|
424
400
|
new Ed25519PublicKey(publicKey.toUint8Array()),
|
|
425
401
|
new Ed25519Signature(new Uint8Array(64)),
|
|
@@ -29,6 +29,10 @@ function isValidWhitespaceCharacter(char: string) {
|
|
|
29
29
|
return !!char.match(/\s/);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
function isGeneric(str: string) {
|
|
33
|
+
return !!str.match(/^T[0-9]+$/);
|
|
34
|
+
}
|
|
35
|
+
|
|
32
36
|
function consumeWhitespace(tagStr: string, pos: number) {
|
|
33
37
|
let i = pos;
|
|
34
38
|
for (; i < tagStr.length; i += 1) {
|
|
@@ -50,6 +54,7 @@ type TypeTagState = {
|
|
|
50
54
|
|
|
51
55
|
export enum TypeTagParserErrorType {
|
|
52
56
|
InvalidTypeTag = "unknown type",
|
|
57
|
+
UnexpectedGenericType = "unexpected generic type",
|
|
53
58
|
UnexpectedTypeArgumentClose = "unexpected '>'",
|
|
54
59
|
UnexpectedWhitespaceCharacter = "unexpected whitespace character",
|
|
55
60
|
UnexpectedComma = "unexpected ','",
|
|
@@ -262,8 +267,11 @@ function parseTypeTagInner(str: string, types: Array<TypeTag>, allowGenerics: bo
|
|
|
262
267
|
}
|
|
263
268
|
return new TypeTagVector(types[0]);
|
|
264
269
|
default:
|
|
265
|
-
if (
|
|
266
|
-
|
|
270
|
+
if (isGeneric(str)) {
|
|
271
|
+
if (allowGenerics) {
|
|
272
|
+
return new TypeTagGeneric(Number(str.split("T")[1]));
|
|
273
|
+
}
|
|
274
|
+
throw new TypeTagParserError(str, TypeTagParserErrorType.UnexpectedGenericType);
|
|
267
275
|
}
|
|
268
276
|
|
|
269
277
|
// If the value doesn't contain a colon, then we'll assume it isn't trying to be a struct
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
TransactionPayloadMultisig,
|
|
16
16
|
TransactionPayloadScript,
|
|
17
17
|
} from "./instances";
|
|
18
|
-
import { AnyNumber, HexInput, MoveFunctionGenericTypeParam,
|
|
18
|
+
import { AnyNumber, HexInput, MoveFunctionGenericTypeParam, MoveFunctionId } from "../types";
|
|
19
19
|
import { TypeTag } from "./typeTag";
|
|
20
20
|
import { AccountAuthenticator } from "./authenticator/account";
|
|
21
21
|
|
|
@@ -97,7 +97,7 @@ export type AnyTransactionPayloadInstance =
|
|
|
97
97
|
export type InputGenerateTransactionPayloadData = InputEntryFunctionData | InputScriptData | InputMultiSigData;
|
|
98
98
|
|
|
99
99
|
export type InputGenerateTransactionPayloadDataWithRemoteABI =
|
|
100
|
-
|
|
|
100
|
+
| InputScriptData
|
|
101
101
|
| InputEntryFunctionDataWithRemoteABI
|
|
102
102
|
| InputMultiSigDataWithRemoteABI;
|
|
103
103
|
|
|
@@ -105,7 +105,7 @@ export type InputGenerateTransactionPayloadDataWithRemoteABI =
|
|
|
105
105
|
* The data needed to generate an Entry Function payload
|
|
106
106
|
*/
|
|
107
107
|
export type InputEntryFunctionData = {
|
|
108
|
-
function:
|
|
108
|
+
function: MoveFunctionId;
|
|
109
109
|
typeArguments?: Array<TypeTag | string>;
|
|
110
110
|
functionArguments: Array<EntryFunctionArgumentTypes | SimpleEntryFunctionArgumentTypes>;
|
|
111
111
|
};
|
|
@@ -152,22 +152,8 @@ export interface InputGenerateSingleSignerRawTransactionArgs {
|
|
|
152
152
|
aptosConfig: AptosConfig;
|
|
153
153
|
sender: AccountAddressInput;
|
|
154
154
|
payload: AnyTransactionPayloadInstance;
|
|
155
|
-
feePayerAddress?: undefined;
|
|
156
|
-
secondarySignerAddresses?: undefined;
|
|
157
|
-
options?: InputGenerateTransactionOptions;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Interface of the arguments to generate a fee payer transaction.
|
|
162
|
-
* Used to provide to `generateTransaction()` method in the transaction builder flow
|
|
163
|
-
*/
|
|
164
|
-
export interface InputGenerateFeePayerRawTransactionArgs {
|
|
165
|
-
aptosConfig: AptosConfig;
|
|
166
|
-
sender: AccountAddressInput;
|
|
167
|
-
payload: AnyTransactionPayloadInstance;
|
|
168
|
-
feePayerAddress: AccountAddressInput;
|
|
169
|
-
secondarySignerAddresses?: AccountAddressInput[];
|
|
170
155
|
options?: InputGenerateTransactionOptions;
|
|
156
|
+
feePayerAddress?: AccountAddressInput;
|
|
171
157
|
}
|
|
172
158
|
|
|
173
159
|
/**
|
|
@@ -179,8 +165,8 @@ export interface InputGenerateMultiAgentRawTransactionArgs {
|
|
|
179
165
|
sender: AccountAddressInput;
|
|
180
166
|
payload: AnyTransactionPayloadInstance;
|
|
181
167
|
secondarySignerAddresses: AccountAddressInput[];
|
|
182
|
-
feePayerAddress?: undefined;
|
|
183
168
|
options?: InputGenerateTransactionOptions;
|
|
169
|
+
feePayerAddress?: AccountAddressInput;
|
|
184
170
|
}
|
|
185
171
|
|
|
186
172
|
/**
|
|
@@ -188,7 +174,6 @@ export interface InputGenerateMultiAgentRawTransactionArgs {
|
|
|
188
174
|
*/
|
|
189
175
|
export type InputGenerateRawTransactionArgs =
|
|
190
176
|
| InputGenerateSingleSignerRawTransactionArgs
|
|
191
|
-
| InputGenerateFeePayerRawTransactionArgs
|
|
192
177
|
| InputGenerateMultiAgentRawTransactionArgs;
|
|
193
178
|
|
|
194
179
|
/**
|
|
@@ -196,41 +181,28 @@ export type InputGenerateRawTransactionArgs =
|
|
|
196
181
|
*
|
|
197
182
|
* @param rawTransaction a bcs serialized raw transaction
|
|
198
183
|
*/
|
|
199
|
-
export interface
|
|
184
|
+
export interface SingleSignerTransaction {
|
|
200
185
|
rawTransaction: RawTransaction;
|
|
201
|
-
feePayerAddress?:
|
|
186
|
+
feePayerAddress?: AccountAddress;
|
|
202
187
|
secondarySignerAddresses?: undefined;
|
|
203
188
|
}
|
|
204
189
|
|
|
205
|
-
/**
|
|
206
|
-
* Interface that holds the return data when generating a fee payer transaction
|
|
207
|
-
*
|
|
208
|
-
* @param rawTransaction a bcs serialized raw transaction
|
|
209
|
-
* @param secondarySignerAddresses optional. secondary signer addresses for multi-agent transaction
|
|
210
|
-
* @param feePayerAddress fee payer address for a fee payer transaction (aka Sponsored Transaction)
|
|
211
|
-
*/
|
|
212
|
-
export interface InputFeePayerTransaction {
|
|
213
|
-
rawTransaction: RawTransaction;
|
|
214
|
-
feePayerAddress: AccountAddress;
|
|
215
|
-
secondarySignerAddresses?: AccountAddress[];
|
|
216
|
-
}
|
|
217
|
-
|
|
218
190
|
/**
|
|
219
191
|
* Interface that holds the return data when generating a multi-agent transaction.
|
|
220
192
|
*
|
|
221
193
|
* @param rawTransaction a bcs serialized raw transaction
|
|
222
194
|
* @param secondarySignerAddresses secondary signer addresses for multi-agent transaction
|
|
223
195
|
*/
|
|
224
|
-
export interface
|
|
196
|
+
export interface MultiAgentTransaction {
|
|
225
197
|
rawTransaction: RawTransaction;
|
|
226
198
|
secondarySignerAddresses: AccountAddress[];
|
|
227
|
-
feePayerAddress?:
|
|
199
|
+
feePayerAddress?: AccountAddress;
|
|
228
200
|
}
|
|
229
201
|
|
|
230
202
|
/**
|
|
231
203
|
* Unified type that holds all the return interfaces when generating different transaction types
|
|
232
204
|
*/
|
|
233
|
-
export type AnyRawTransaction =
|
|
205
|
+
export type AnyRawTransaction = SingleSignerTransaction | MultiAgentTransaction;
|
|
234
206
|
|
|
235
207
|
// TRANSACTION SIMULATION TYPES //
|
|
236
208
|
|
|
@@ -267,21 +239,10 @@ export type InputSimulateTransactionOptions = {
|
|
|
267
239
|
*/
|
|
268
240
|
export interface InputGenerateSingleSignerRawTransactionData {
|
|
269
241
|
sender: AccountAddressInput;
|
|
270
|
-
hasFeePayer?: undefined;
|
|
271
|
-
secondarySignerAddresses?: undefined;
|
|
272
|
-
options?: InputGenerateTransactionOptions;
|
|
273
242
|
data: InputGenerateTransactionPayloadData;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Interface that holds the user data input when generating a fee payer transaction
|
|
278
|
-
*/
|
|
279
|
-
export interface InputGenerateFeePayerRawTransactionData {
|
|
280
|
-
sender: AccountAddressInput;
|
|
281
|
-
hasFeePayer: true;
|
|
282
|
-
secondarySignerAddresses?: AccountAddressInput[];
|
|
283
243
|
options?: InputGenerateTransactionOptions;
|
|
284
|
-
|
|
244
|
+
withFeePayer?: boolean;
|
|
245
|
+
secondarySignerAddresses?: undefined;
|
|
285
246
|
}
|
|
286
247
|
|
|
287
248
|
/**
|
|
@@ -289,19 +250,18 @@ export interface InputGenerateFeePayerRawTransactionData {
|
|
|
289
250
|
*/
|
|
290
251
|
export interface InputGenerateMultiAgentRawTransactionData {
|
|
291
252
|
sender: AccountAddressInput;
|
|
253
|
+
data: InputGenerateTransactionPayloadData;
|
|
292
254
|
secondarySignerAddresses: AccountAddressInput[];
|
|
293
|
-
hasFeePayer?: undefined;
|
|
294
255
|
options?: InputGenerateTransactionOptions;
|
|
295
|
-
|
|
256
|
+
withFeePayer?: boolean;
|
|
296
257
|
}
|
|
297
258
|
|
|
298
259
|
/**
|
|
299
260
|
* Unified type that holds all the user data input interfaces when generating different transaction types
|
|
300
261
|
*/
|
|
301
262
|
export type InputGenerateTransactionData =
|
|
302
|
-
|
|
|
303
|
-
|
|
|
304
|
-
| InputGenerateSingleSignerRawTransactionData;
|
|
263
|
+
| InputGenerateSingleSignerRawTransactionData
|
|
264
|
+
| InputGenerateMultiAgentRawTransactionData;
|
|
305
265
|
|
|
306
266
|
/**
|
|
307
267
|
* Interface that holds the user data input when submitting a transaction
|