@aptos-labs/ts-sdk 1.35.0-zeta.2 → 1.36.0-zeta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/{accountAddress-Ce4Cv60D.d.ts → accountAddress-C685VEzA.d.ts} +11 -99
- package/dist/common/chunk-5GUWOXQG.js +4 -0
- package/dist/common/chunk-5GUWOXQG.js.map +1 -0
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js +1 -486
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +9105 -8699
- package/dist/common/index.js +436 -18333
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account-D4j3_WIS.d.mts → Ed25519Account-6KGApCPu.d.mts} +3 -3
- package/dist/esm/account/AbstractKeylessAccount.d.mts +23 -13
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -75
- package/dist/esm/account/AbstractedAccount.d.mts +10 -10
- package/dist/esm/account/AbstractedAccount.mjs +1 -74
- package/dist/esm/account/Account.d.mts +6 -6
- package/dist/esm/account/Account.mjs +1 -72
- package/dist/esm/account/AccountUtils.d.mts +11 -10
- package/dist/esm/account/AccountUtils.mjs +1 -78
- package/dist/esm/account/Ed25519Account.d.mts +5 -5
- package/dist/esm/account/Ed25519Account.mjs +1 -70
- package/dist/esm/account/EphemeralKeyPair.d.mts +3 -1
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -50
- package/dist/esm/account/FederatedKeylessAccount.d.mts +12 -11
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -72
- package/dist/esm/account/KeylessAccount.d.mts +12 -11
- package/dist/esm/account/KeylessAccount.mjs +1 -72
- package/dist/esm/account/MultiEd25519Account.d.mts +9 -9
- package/dist/esm/account/MultiEd25519Account.mjs +1 -70
- package/dist/esm/account/MultiKeyAccount.d.mts +34 -12
- package/dist/esm/account/MultiKeyAccount.mjs +1 -74
- package/dist/esm/account/SingleKeyAccount.d.mts +5 -5
- package/dist/esm/account/SingleKeyAccount.mjs +1 -72
- package/dist/esm/account/index.d.mts +7 -6
- package/dist/esm/account/index.mjs +1 -119
- package/dist/esm/account/utils.mjs +1 -54
- package/dist/esm/api/account/abstraction.d.mts +9 -9
- package/dist/esm/api/account/abstraction.mjs +1 -101
- package/dist/esm/api/account.d.mts +4 -20
- package/dist/esm/api/account.mjs +1 -105
- package/dist/esm/api/ans.d.mts +13 -13
- package/dist/esm/api/ans.mjs +1 -101
- package/dist/esm/api/aptos.d.mts +6 -5
- package/dist/esm/api/aptos.mjs +1 -139
- package/dist/esm/api/aptosConfig.mjs +1 -9
- package/dist/esm/api/coin.d.mts +9 -9
- package/dist/esm/api/coin.mjs +1 -100
- package/dist/esm/api/digitalAsset.d.mts +5 -5
- package/dist/esm/api/digitalAsset.mjs +1 -101
- package/dist/esm/api/event.mjs +1 -59
- package/dist/esm/api/experimental.d.mts +7 -7
- package/dist/esm/api/experimental.mjs +1 -85
- package/dist/esm/api/faucet.mjs +1 -58
- package/dist/esm/api/fungibleAsset.d.mts +13 -13
- package/dist/esm/api/fungibleAsset.mjs +1 -101
- package/dist/esm/api/general.d.mts +7 -7
- package/dist/esm/api/general.mjs +1 -85
- package/dist/esm/api/index.d.mts +6 -5
- package/dist/esm/api/index.mjs +1 -143
- package/dist/esm/api/keyless.d.mts +20 -19
- package/dist/esm/api/keyless.mjs +1 -102
- package/dist/esm/api/object.mjs +1 -59
- package/dist/esm/api/staking.mjs +1 -59
- package/dist/esm/api/table.mjs +1 -38
- package/dist/esm/api/transaction.d.mts +4 -4
- package/dist/esm/api/transaction.mjs +1 -110
- package/dist/esm/api/transactionSubmission/build.d.mts +9 -9
- package/dist/esm/api/transactionSubmission/build.mjs +1 -99
- package/dist/esm/api/transactionSubmission/helpers.mjs +1 -9
- package/dist/esm/api/transactionSubmission/management.d.mts +8 -8
- package/dist/esm/api/transactionSubmission/management.mjs +1 -105
- package/dist/esm/api/transactionSubmission/sign.d.mts +3 -3
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -218
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/simulate.d.mts +9 -9
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -100
- package/dist/esm/api/transactionSubmission/submit.d.mts +3 -3
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -100
- package/dist/esm/api/utils.mjs +1 -36
- package/dist/esm/bcs/consts.mjs +1 -17
- package/dist/esm/bcs/deserializer.mjs +1 -10
- package/dist/esm/bcs/index.mjs +1 -60
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -12
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -11
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -26
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -22
- package/dist/esm/bcs/serializer.mjs +1 -18
- package/dist/esm/chunk-2V636AYW.mjs +2 -0
- package/dist/esm/{chunk-3IWV2Q3K.mjs.map → chunk-2V636AYW.mjs.map} +1 -1
- package/dist/esm/chunk-35CO4BP4.mjs +2 -0
- package/dist/esm/chunk-35CO4BP4.mjs.map +1 -0
- package/dist/esm/chunk-35DKMW7Q.mjs +2 -0
- package/dist/esm/{chunk-GUA5YTIK.mjs.map → chunk-35DKMW7Q.mjs.map} +1 -1
- package/dist/esm/chunk-3EUHEZND.mjs +2 -0
- package/dist/esm/{chunk-G34CJDST.mjs.map → chunk-3EUHEZND.mjs.map} +1 -1
- package/dist/esm/chunk-3OLFJ65O.mjs +2 -0
- package/dist/esm/{chunk-G4NBRMZ2.mjs.map → chunk-3OLFJ65O.mjs.map} +1 -1
- package/dist/esm/chunk-3RVAGHAA.mjs +2 -0
- package/dist/esm/{chunk-XQFUKBY7.mjs.map → chunk-3RVAGHAA.mjs.map} +1 -1
- package/dist/esm/chunk-4RXKALLC.mjs +2 -0
- package/dist/esm/{chunk-SFLQPB72.mjs.map → chunk-4RXKALLC.mjs.map} +1 -1
- package/dist/esm/chunk-56CNRT2K.mjs +2 -0
- package/dist/esm/{chunk-SBB4YEPT.mjs.map → chunk-56CNRT2K.mjs.map} +1 -1
- package/dist/esm/chunk-6KE4JZD6.mjs +2 -0
- package/dist/esm/chunk-6KE4JZD6.mjs.map +1 -0
- package/dist/esm/chunk-7CRQNXR5.mjs +2 -0
- package/dist/esm/{chunk-YU65LNIC.mjs.map → chunk-7CRQNXR5.mjs.map} +1 -1
- package/dist/esm/chunk-7YTGBTWH.mjs +2 -0
- package/dist/esm/chunk-7YTGBTWH.mjs.map +1 -0
- package/dist/esm/chunk-A3VO773Q.mjs +2 -0
- package/dist/esm/{chunk-KLUO6XPE.mjs.map → chunk-A3VO773Q.mjs.map} +1 -1
- package/dist/esm/chunk-A5L76YP7.mjs +2 -0
- package/dist/esm/{chunk-PT2QHUB6.mjs.map → chunk-A5L76YP7.mjs.map} +1 -1
- package/dist/esm/chunk-AEGA5N2W.mjs +2 -0
- package/dist/esm/{chunk-QJ6CGH7N.mjs.map → chunk-AEGA5N2W.mjs.map} +1 -1
- package/dist/esm/chunk-AIPHJFJL.mjs +2 -0
- package/dist/esm/{chunk-6I37A76G.mjs.map → chunk-AIPHJFJL.mjs.map} +1 -1
- package/dist/esm/chunk-BMPHQ3E7.mjs +2 -0
- package/dist/esm/{chunk-MWXBQ6HR.mjs.map → chunk-BMPHQ3E7.mjs.map} +1 -1
- package/dist/esm/chunk-C3Q23D22.mjs +2 -0
- package/dist/esm/{chunk-F7W7KS5C.mjs.map → chunk-C3Q23D22.mjs.map} +1 -1
- package/dist/esm/chunk-CWL7ZA3P.mjs +2 -0
- package/dist/esm/{chunk-6T3V5LXK.mjs.map → chunk-CWL7ZA3P.mjs.map} +1 -1
- package/dist/esm/chunk-DOVH6HPL.mjs +2 -0
- package/dist/esm/{chunk-THWEBWUC.mjs.map → chunk-DOVH6HPL.mjs.map} +1 -1
- package/dist/esm/chunk-EODSU3YN.mjs +2 -0
- package/dist/esm/{chunk-WXQUBQK4.mjs.map → chunk-EODSU3YN.mjs.map} +1 -1
- package/dist/esm/chunk-ERLDXTIY.mjs +2 -0
- package/dist/esm/{chunk-6ASWESA2.mjs.map → chunk-ERLDXTIY.mjs.map} +1 -1
- package/dist/esm/chunk-GOXRBEIJ.mjs +2 -0
- package/dist/esm/{chunk-APM7OSLS.mjs.map → chunk-GOXRBEIJ.mjs.map} +1 -1
- package/dist/esm/chunk-HHWJHOFZ.mjs +2 -0
- package/dist/esm/{chunk-KSK3XIGF.mjs.map → chunk-HHWJHOFZ.mjs.map} +1 -1
- package/dist/esm/chunk-IF4UU2MT.mjs +2 -0
- package/dist/esm/{chunk-QPT4BSAB.mjs.map → chunk-IF4UU2MT.mjs.map} +1 -1
- package/dist/esm/chunk-IMTC3J2M.mjs +2 -0
- package/dist/esm/{chunk-LJRNGZMY.mjs.map → chunk-IMTC3J2M.mjs.map} +1 -1
- package/dist/esm/chunk-KDMSOCZY.mjs +2 -0
- package/dist/esm/chunk-KSLLV3ZC.mjs +2 -0
- package/dist/esm/{chunk-OFUNBTK4.mjs.map → chunk-KSLLV3ZC.mjs.map} +1 -1
- package/dist/esm/chunk-KXVD52Y6.mjs +2 -0
- package/dist/esm/{chunk-YT7V6AVJ.mjs.map → chunk-KXVD52Y6.mjs.map} +1 -1
- package/dist/esm/chunk-LGC2JORV.mjs +2 -0
- package/dist/esm/chunk-LGC2JORV.mjs.map +1 -0
- package/dist/esm/chunk-LQOSHBB7.mjs +4 -0
- package/dist/esm/{chunk-CXLXUSCG.mjs.map → chunk-LQOSHBB7.mjs.map} +1 -1
- package/dist/esm/chunk-LS3IDL2N.mjs +2 -0
- package/dist/esm/{chunk-MYEYZ7PF.mjs.map → chunk-LS3IDL2N.mjs.map} +1 -1
- package/dist/esm/chunk-MIW45ADL.mjs +2 -0
- package/dist/esm/chunk-MIW45ADL.mjs.map +1 -0
- package/dist/esm/chunk-NFPNWY6Z.mjs +4 -0
- package/dist/esm/chunk-NFPNWY6Z.mjs.map +1 -0
- package/dist/esm/chunk-PDAWVDI7.mjs +2 -0
- package/dist/esm/{chunk-MFFBZ43D.mjs.map → chunk-PDAWVDI7.mjs.map} +1 -1
- package/dist/esm/chunk-PSZYS4RG.mjs +2 -0
- package/dist/esm/{chunk-YK66QBML.mjs.map → chunk-PSZYS4RG.mjs.map} +1 -1
- package/dist/esm/chunk-R6QCPXQG.mjs +2 -0
- package/dist/esm/{chunk-SQNS4SFV.mjs.map → chunk-R6QCPXQG.mjs.map} +1 -1
- package/dist/esm/chunk-RIINVEZA.mjs +2 -0
- package/dist/esm/{chunk-Y3ENAKRC.mjs.map → chunk-RIINVEZA.mjs.map} +1 -1
- package/dist/esm/chunk-RJ7F4JDV.mjs +2 -0
- package/dist/esm/chunk-RJ7F4JDV.mjs.map +1 -0
- package/dist/esm/chunk-RXHER6EA.mjs +2 -0
- package/dist/esm/{chunk-C7T6GW5P.mjs.map → chunk-RXHER6EA.mjs.map} +1 -1
- package/dist/esm/chunk-RXMLONF7.mjs +2 -0
- package/dist/esm/{chunk-BU43ZFDJ.mjs.map → chunk-RXMLONF7.mjs.map} +1 -1
- package/dist/esm/chunk-TBY3VMMV.mjs +2 -0
- package/dist/esm/chunk-TBY3VMMV.mjs.map +1 -0
- package/dist/esm/chunk-TKXEVD7A.mjs +2 -0
- package/dist/esm/{chunk-QSYWLSSN.mjs.map → chunk-TKXEVD7A.mjs.map} +1 -1
- package/dist/esm/chunk-TNWABITK.mjs +2 -0
- package/dist/esm/{chunk-FRLS4GRM.mjs.map → chunk-TNWABITK.mjs.map} +1 -1
- package/dist/esm/chunk-TTY5GFMN.mjs +2 -0
- package/dist/esm/{chunk-PKUXOBIV.mjs.map → chunk-TTY5GFMN.mjs.map} +1 -1
- package/dist/esm/chunk-VHNX2NUR.mjs +473 -0
- package/dist/esm/chunk-VHNX2NUR.mjs.map +1 -0
- package/dist/esm/chunk-VHY6ZATX.mjs +2 -0
- package/dist/esm/{chunk-BDM6FBUO.mjs.map → chunk-VHY6ZATX.mjs.map} +1 -1
- package/dist/esm/chunk-W4BSN6SK.mjs +2 -0
- package/dist/esm/{chunk-ZWCTF3NQ.mjs.map → chunk-W4BSN6SK.mjs.map} +1 -1
- package/dist/esm/chunk-WB26DWOY.mjs +7 -0
- package/dist/esm/chunk-WB26DWOY.mjs.map +1 -0
- package/dist/esm/chunk-X5YB74NB.mjs +2 -0
- package/dist/esm/{chunk-I25AX6PQ.mjs.map → chunk-X5YB74NB.mjs.map} +1 -1
- package/dist/esm/chunk-XLDMPCLF.mjs +2 -0
- package/dist/esm/{chunk-WLTQHGIJ.mjs.map → chunk-XLDMPCLF.mjs.map} +1 -1
- package/dist/esm/chunk-YOZBVVKL.mjs +2 -0
- package/dist/esm/{chunk-BEYIOC2H.mjs.map → chunk-YOZBVVKL.mjs.map} +1 -1
- package/dist/esm/chunk-ZD2TY5N3.mjs +2 -0
- package/dist/esm/{chunk-NUT2VOX2.mjs.map → chunk-ZD2TY5N3.mjs.map} +1 -1
- package/dist/esm/chunk-ZELTLAUN.mjs +2 -0
- package/dist/esm/chunk-ZELTLAUN.mjs.map +1 -0
- package/dist/esm/cli/index.mjs +1 -20
- package/dist/esm/cli/localNode.mjs +1 -16
- package/dist/esm/cli/move.mjs +1 -7
- package/dist/esm/client/core.mjs +1 -34
- package/dist/esm/client/get.mjs +1 -41
- package/dist/esm/client/index.mjs +1 -69
- package/dist/esm/client/post.mjs +1 -43
- package/dist/esm/core/account/index.mjs +1 -21
- package/dist/esm/core/account/utils/address.mjs +1 -19
- package/dist/esm/core/account/utils/index.mjs +1 -20
- package/dist/esm/core/accountAddress.mjs +1 -16
- package/dist/esm/core/authenticationKey.d.mts +3 -1
- package/dist/esm/core/authenticationKey.mjs +1 -15
- package/dist/esm/core/common.mjs +1 -7
- package/dist/esm/core/crypto/abstraction.d.mts +4 -1
- package/dist/esm/core/crypto/abstraction.mjs +1 -26
- package/dist/esm/core/crypto/ed25519.d.mts +18 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -33
- package/dist/esm/core/crypto/ephemeral.d.mts +8 -1
- package/dist/esm/core/crypto/ephemeral.mjs +1 -30
- package/dist/esm/core/crypto/federatedKeyless.d.mts +11 -87
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -44
- package/dist/esm/core/crypto/hdKey.mjs +1 -25
- package/dist/esm/core/crypto/index.d.mts +8 -6
- package/dist/esm/core/crypto/index.mjs +1 -173
- package/dist/esm/core/crypto/keyless.d.mts +13 -586
- package/dist/esm/core/crypto/keyless.mjs +1 -83
- package/dist/esm/core/crypto/multiEd25519.d.mts +14 -4
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -50
- package/dist/esm/core/crypto/multiKey.d.mts +39 -3
- package/dist/esm/core/crypto/multiKey.mjs +1 -51
- package/dist/esm/core/crypto/poseidon.mjs +1 -15
- package/dist/esm/core/crypto/privateKey.d.mts +3 -1
- package/dist/esm/core/crypto/privateKey.mjs +1 -12
- package/dist/esm/core/crypto/proof.mjs +1 -20
- package/dist/esm/core/crypto/publicKey.d.mts +3 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -22
- package/dist/esm/core/crypto/secp256k1.d.mts +26 -2
- package/dist/esm/core/crypto/secp256k1.mjs +1 -29
- package/dist/esm/core/crypto/signature.mjs +1 -20
- package/dist/esm/core/crypto/singleKey.d.mts +27 -5
- package/dist/esm/core/crypto/singleKey.mjs +1 -48
- package/dist/esm/core/crypto/utils.mjs +1 -9
- package/dist/esm/core/hex.mjs +1 -12
- package/dist/esm/core/index.d.mts +8 -6
- package/dist/esm/core/index.mjs +1 -202
- package/dist/esm/errors/index.d.mts +10 -2
- package/dist/esm/errors/index.mjs +1 -25
- package/dist/esm/federatedKeyless-Qe_j8OqV.d.mts +875 -0
- package/dist/esm/index.d.mts +11 -10
- package/dist/esm/index.mjs +1 -798
- package/dist/esm/internal/abstraction.d.mts +9 -9
- package/dist/esm/internal/abstraction.mjs +1 -103
- package/dist/esm/internal/account.d.mts +7 -24
- package/dist/esm/internal/account.mjs +1 -142
- package/dist/esm/internal/ans.d.mts +13 -13
- package/dist/esm/internal/ans.mjs +1 -138
- package/dist/esm/internal/coin.d.mts +7 -7
- package/dist/esm/internal/coin.mjs +1 -99
- package/dist/esm/internal/digitalAsset.d.mts +2 -2
- package/dist/esm/internal/digitalAsset.mjs +1 -145
- package/dist/esm/internal/event.mjs +1 -62
- package/dist/esm/internal/experimental.d.mts +7 -7
- package/dist/esm/internal/experimental.mjs +1 -84
- package/dist/esm/internal/faucet.mjs +1 -57
- package/dist/esm/internal/fungibleAsset.d.mts +2 -2
- package/dist/esm/internal/fungibleAsset.mjs +1 -105
- package/dist/esm/internal/general.mjs +1 -43
- package/dist/esm/internal/keyless.d.mts +10 -20
- package/dist/esm/internal/keyless.mjs +1 -107
- package/dist/esm/internal/object.mjs +1 -58
- package/dist/esm/internal/staking.mjs +1 -60
- package/dist/esm/internal/table.mjs +1 -38
- package/dist/esm/internal/transaction.mjs +1 -57
- package/dist/esm/internal/transactionSubmission.d.mts +6 -6
- package/dist/esm/internal/transactionSubmission.mjs +1 -118
- package/dist/esm/internal/utils/index.mjs +1 -38
- package/dist/esm/internal/utils/utils.mjs +1 -37
- package/dist/esm/internal/view.d.mts +7 -7
- package/dist/esm/internal/view.mjs +1 -86
- package/dist/esm/{publicKey-BMtGNNLg.d.mts → publicKey-pDHBAZlT.d.mts} +27 -1
- package/dist/esm/transactions/authenticator/account.d.mts +3 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -67
- package/dist/esm/transactions/authenticator/index.d.mts +3 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -82
- package/dist/esm/transactions/authenticator/transaction.d.mts +4 -2
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -66
- package/dist/esm/transactions/index.d.mts +4 -4
- package/dist/esm/transactions/index.mjs +1 -296
- package/dist/esm/transactions/instances/chainId.mjs +1 -11
- package/dist/esm/transactions/instances/identifier.mjs +1 -11
- package/dist/esm/transactions/instances/index.d.mts +4 -2
- package/dist/esm/transactions/instances/index.mjs +1 -114
- package/dist/esm/transactions/instances/moduleId.mjs +1 -55
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -60
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -65
- package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +3 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -21
- package/dist/esm/transactions/instances/signedTransaction.d.mts +3 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -63
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -60
- package/dist/esm/transactions/instances/transactionArgument.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -73
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +2 -2
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -101
- package/dist/esm/transactions/management/asyncQueue.mjs +1 -9
- package/dist/esm/transactions/management/index.d.mts +2 -2
- package/dist/esm/transactions/management/index.mjs +1 -111
- package/dist/esm/transactions/management/transactionWorker.d.mts +3 -3
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -107
- package/dist/esm/transactions/scriptComposer/index.d.mts +7 -7
- package/dist/esm/transactions/scriptComposer/index.mjs +1 -80
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +8 -8
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -92
- package/dist/esm/transactions/transactionBuilder/index.d.mts +8 -8
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -166
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +34 -23
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -74
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +7 -7
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -75
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +8 -8
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -97
- package/dist/esm/transactions/typeTag/index.d.mts +16 -0
- package/dist/esm/transactions/typeTag/index.mjs +1 -91
- package/dist/esm/transactions/typeTag/parser.mjs +1 -60
- package/dist/esm/transactions/types.d.mts +5 -5
- package/dist/esm/transactions/types.mjs +1 -1
- package/dist/esm/types/abstraction.mjs +1 -7
- package/dist/esm/types/generated/operations.d.mts +10 -63
- package/dist/esm/types/generated/queries.d.mts +2 -10
- package/dist/esm/types/generated/queries.mjs +1 -69
- package/dist/esm/types/generated/types.d.mts +1054 -824
- package/dist/esm/types/generated/types.mjs +1 -774
- package/dist/esm/types/generated/types.mjs.map +1 -1
- package/dist/esm/types/index.d.mts +2 -2
- package/dist/esm/types/index.mjs +1 -82
- package/dist/esm/types/indexer.d.mts +2 -14
- package/dist/esm/types/indexer.mjs +1 -1
- package/dist/esm/types/keyless.d.mts +1 -1
- package/dist/esm/types/types.d.mts +3 -58
- package/dist/esm/types/types.mjs +1 -77
- package/dist/esm/utils/apiEndpoints.mjs +1 -21
- package/dist/esm/utils/const.d.mts +1 -1
- package/dist/esm/utils/const.mjs +1 -25
- package/dist/esm/utils/helpers.d.mts +2 -1
- package/dist/esm/utils/helpers.mjs +1 -37
- package/dist/esm/utils/index.d.mts +1 -1
- package/dist/esm/utils/index.mjs +1 -88
- package/dist/esm/utils/memoize.mjs +1 -9
- package/dist/esm/utils/normalizeBundle.mjs +1 -20
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -7
- package/package.json +3 -3
- package/src/account/AbstractKeylessAccount.ts +33 -49
- package/src/account/MultiKeyAccount.ts +23 -16
- package/src/api/account.ts +2 -56
- package/src/cli/localNode.ts +6 -15
- package/src/core/crypto/abstraction.ts +6 -1
- package/src/core/crypto/ed25519.ts +19 -1
- package/src/core/crypto/ephemeral.ts +9 -0
- package/src/core/crypto/federatedKeyless.ts +40 -4
- package/src/core/crypto/index.ts +4 -3
- package/src/core/crypto/keyless.ts +577 -17
- package/src/core/crypto/multiEd25519.ts +11 -3
- package/src/core/crypto/multiKey.ts +74 -4
- package/src/core/crypto/publicKey.ts +28 -0
- package/src/core/crypto/secp256k1.ts +25 -2
- package/src/core/crypto/singleKey.ts +32 -7
- package/src/errors/index.ts +50 -0
- package/src/internal/account.ts +2 -395
- package/src/internal/keyless.ts +9 -17
- package/src/transactions/scriptComposer/index.ts +19 -6
- package/src/transactions/transactionBuilder/remoteAbi.ts +107 -35
- package/src/transactions/typeTag/index.ts +22 -0
- package/src/types/codegen.yaml +1 -1
- package/src/types/generated/operations.ts +8 -69
- package/src/types/generated/queries.ts +0 -111
- package/src/types/generated/types.ts +1159 -951
- package/src/types/indexer.ts +0 -16
- package/src/types/keyless.ts +1 -1
- package/src/types/types.ts +3 -62
- package/src/utils/const.ts +1 -1
- package/src/utils/helpers.ts +11 -0
- package/src/version.ts +1 -1
- package/dist/common/chunk-JMOQXLED.js +0 -1305
- package/dist/common/chunk-JMOQXLED.js.map +0 -1
- package/dist/esm/chunk-2FTF6J7F.mjs +0 -97
- package/dist/esm/chunk-2FTF6J7F.mjs.map +0 -1
- package/dist/esm/chunk-2HL7JEFC.mjs +0 -829
- package/dist/esm/chunk-2HL7JEFC.mjs.map +0 -1
- package/dist/esm/chunk-2WBJAKBO.mjs +0 -53
- package/dist/esm/chunk-2WBJAKBO.mjs.map +0 -1
- package/dist/esm/chunk-32UQAST6.mjs +0 -296
- package/dist/esm/chunk-32UQAST6.mjs.map +0 -1
- package/dist/esm/chunk-3DAVHDK4.mjs +0 -195
- package/dist/esm/chunk-3DAVHDK4.mjs.map +0 -1
- package/dist/esm/chunk-3IWV2Q3K.mjs +0 -12
- package/dist/esm/chunk-3TUV6YMI.mjs +0 -305
- package/dist/esm/chunk-3TUV6YMI.mjs.map +0 -1
- package/dist/esm/chunk-4NMDYPUD.mjs +0 -1
- package/dist/esm/chunk-56UCIGTO.mjs +0 -21
- package/dist/esm/chunk-56UCIGTO.mjs.map +0 -1
- package/dist/esm/chunk-5ORUQZAR.mjs +0 -100
- package/dist/esm/chunk-5ORUQZAR.mjs.map +0 -1
- package/dist/esm/chunk-5QHMFYVL.mjs +0 -42
- package/dist/esm/chunk-5QHMFYVL.mjs.map +0 -1
- package/dist/esm/chunk-62LC4PPC.mjs +0 -128
- package/dist/esm/chunk-62LC4PPC.mjs.map +0 -1
- package/dist/esm/chunk-6ASWESA2.mjs +0 -77
- package/dist/esm/chunk-6I37A76G.mjs +0 -29
- package/dist/esm/chunk-6OFCIXWS.mjs +0 -379
- package/dist/esm/chunk-6OFCIXWS.mjs.map +0 -1
- package/dist/esm/chunk-6SNGKTWE.mjs +0 -91
- package/dist/esm/chunk-6SNGKTWE.mjs.map +0 -1
- package/dist/esm/chunk-6T3V5LXK.mjs +0 -119
- package/dist/esm/chunk-7F32C225.mjs +0 -219
- package/dist/esm/chunk-7F32C225.mjs.map +0 -1
- package/dist/esm/chunk-7WW735TU.mjs +0 -276
- package/dist/esm/chunk-7WW735TU.mjs.map +0 -1
- package/dist/esm/chunk-A33OBGVN.mjs +0 -1014
- package/dist/esm/chunk-A33OBGVN.mjs.map +0 -1
- package/dist/esm/chunk-A7LYGPFL.mjs +0 -208
- package/dist/esm/chunk-A7LYGPFL.mjs.map +0 -1
- package/dist/esm/chunk-AGKEC2IM.mjs +0 -250
- package/dist/esm/chunk-AGKEC2IM.mjs.map +0 -1
- package/dist/esm/chunk-AKXCFBYF.mjs +0 -49
- package/dist/esm/chunk-AKXCFBYF.mjs.map +0 -1
- package/dist/esm/chunk-APM7OSLS.mjs +0 -122
- package/dist/esm/chunk-BDM6FBUO.mjs +0 -198
- package/dist/esm/chunk-BEYIOC2H.mjs +0 -34
- package/dist/esm/chunk-BMM72IIP.mjs +0 -250
- package/dist/esm/chunk-BMM72IIP.mjs.map +0 -1
- package/dist/esm/chunk-BSCOVLWS.mjs +0 -1
- package/dist/esm/chunk-BSCOVLWS.mjs.map +0 -1
- package/dist/esm/chunk-BU43ZFDJ.mjs +0 -281
- package/dist/esm/chunk-C7EEG6SW.mjs +0 -689
- package/dist/esm/chunk-C7EEG6SW.mjs.map +0 -1
- package/dist/esm/chunk-C7T6GW5P.mjs +0 -376
- package/dist/esm/chunk-CXLXUSCG.mjs +0 -417
- package/dist/esm/chunk-D4MW64RH.mjs +0 -188
- package/dist/esm/chunk-D4MW64RH.mjs.map +0 -1
- package/dist/esm/chunk-D6RXVCE3.mjs +0 -86
- package/dist/esm/chunk-D6RXVCE3.mjs.map +0 -1
- package/dist/esm/chunk-DDZGHA66.mjs +0 -495
- package/dist/esm/chunk-DDZGHA66.mjs.map +0 -1
- package/dist/esm/chunk-DGDZNHUJ.mjs +0 -72
- package/dist/esm/chunk-DGDZNHUJ.mjs.map +0 -1
- package/dist/esm/chunk-DMFRIING.mjs +0 -286
- package/dist/esm/chunk-DMFRIING.mjs.map +0 -1
- package/dist/esm/chunk-E7FWVXGX.mjs +0 -1
- package/dist/esm/chunk-E7FWVXGX.mjs.map +0 -1
- package/dist/esm/chunk-EBFKT35C.mjs +0 -66
- package/dist/esm/chunk-EBFKT35C.mjs.map +0 -1
- package/dist/esm/chunk-ECTX2FGD.mjs +0 -355
- package/dist/esm/chunk-ECTX2FGD.mjs.map +0 -1
- package/dist/esm/chunk-EPTUAWRA.mjs +0 -895
- package/dist/esm/chunk-EPTUAWRA.mjs.map +0 -1
- package/dist/esm/chunk-F4VI7BNX.mjs +0 -58
- package/dist/esm/chunk-F4VI7BNX.mjs.map +0 -1
- package/dist/esm/chunk-F7W7KS5C.mjs +0 -52
- package/dist/esm/chunk-FDMI4BUL.mjs +0 -611
- package/dist/esm/chunk-FDMI4BUL.mjs.map +0 -1
- package/dist/esm/chunk-FMNMYKYH.mjs +0 -71
- package/dist/esm/chunk-FMNMYKYH.mjs.map +0 -1
- package/dist/esm/chunk-FRLS4GRM.mjs +0 -62
- package/dist/esm/chunk-G34CJDST.mjs +0 -139
- package/dist/esm/chunk-G4NBRMZ2.mjs +0 -7
- package/dist/esm/chunk-G6R77JKO.mjs +0 -121
- package/dist/esm/chunk-G6R77JKO.mjs.map +0 -1
- package/dist/esm/chunk-G7BB6K4B.mjs +0 -167
- package/dist/esm/chunk-G7BB6K4B.mjs.map +0 -1
- package/dist/esm/chunk-GCQK2S5Q.mjs +0 -43
- package/dist/esm/chunk-GCQK2S5Q.mjs.map +0 -1
- package/dist/esm/chunk-GFPEB22G.mjs +0 -1
- package/dist/esm/chunk-GFPEB22G.mjs.map +0 -1
- package/dist/esm/chunk-GUA5YTIK.mjs +0 -362
- package/dist/esm/chunk-HBXBODME.mjs +0 -84
- package/dist/esm/chunk-HBXBODME.mjs.map +0 -1
- package/dist/esm/chunk-HEZ2ZYZA.mjs +0 -1
- package/dist/esm/chunk-HEZ2ZYZA.mjs.map +0 -1
- package/dist/esm/chunk-HKQY5GXT.mjs +0 -231
- package/dist/esm/chunk-HKQY5GXT.mjs.map +0 -1
- package/dist/esm/chunk-HL337SEM.mjs +0 -219
- package/dist/esm/chunk-HL337SEM.mjs.map +0 -1
- package/dist/esm/chunk-HQDHSKVS.mjs +0 -74
- package/dist/esm/chunk-HQDHSKVS.mjs.map +0 -1
- package/dist/esm/chunk-I25AX6PQ.mjs +0 -7
- package/dist/esm/chunk-I5G7XFGT.mjs +0 -86
- package/dist/esm/chunk-I5G7XFGT.mjs.map +0 -1
- package/dist/esm/chunk-IHYTP2EW.mjs +0 -1
- package/dist/esm/chunk-IHYTP2EW.mjs.map +0 -1
- package/dist/esm/chunk-IJ7XCPP3.mjs +0 -480
- package/dist/esm/chunk-IJ7XCPP3.mjs.map +0 -1
- package/dist/esm/chunk-ILTEOGFF.mjs +0 -407
- package/dist/esm/chunk-ILTEOGFF.mjs.map +0 -1
- package/dist/esm/chunk-IP7GATDH.mjs +0 -322
- package/dist/esm/chunk-IP7GATDH.mjs.map +0 -1
- package/dist/esm/chunk-IPUAVRGL.mjs +0 -248
- package/dist/esm/chunk-IPUAVRGL.mjs.map +0 -1
- package/dist/esm/chunk-IQVHXOD3.mjs +0 -192
- package/dist/esm/chunk-IQVHXOD3.mjs.map +0 -1
- package/dist/esm/chunk-JAZJE3OR.mjs +0 -45
- package/dist/esm/chunk-JAZJE3OR.mjs.map +0 -1
- package/dist/esm/chunk-JEVGHYEP.mjs +0 -162
- package/dist/esm/chunk-JEVGHYEP.mjs.map +0 -1
- package/dist/esm/chunk-JFMFZ2IL.mjs +0 -147
- package/dist/esm/chunk-JFMFZ2IL.mjs.map +0 -1
- package/dist/esm/chunk-JQIRRM7G.mjs +0 -195
- package/dist/esm/chunk-JQIRRM7G.mjs.map +0 -1
- package/dist/esm/chunk-JXCZTOYC.mjs +0 -1
- package/dist/esm/chunk-JXCZTOYC.mjs.map +0 -1
- package/dist/esm/chunk-K5OCDM3W.mjs +0 -207
- package/dist/esm/chunk-K5OCDM3W.mjs.map +0 -1
- package/dist/esm/chunk-KLUO6XPE.mjs +0 -33
- package/dist/esm/chunk-KSK3XIGF.mjs +0 -502
- package/dist/esm/chunk-KW64NP2F.mjs +0 -71
- package/dist/esm/chunk-KW64NP2F.mjs.map +0 -1
- package/dist/esm/chunk-LJRNGZMY.mjs +0 -10
- package/dist/esm/chunk-MFFBZ43D.mjs +0 -45
- package/dist/esm/chunk-MWXBQ6HR.mjs +0 -15
- package/dist/esm/chunk-MYEYZ7PF.mjs +0 -46
- package/dist/esm/chunk-NUT2VOX2.mjs +0 -317
- package/dist/esm/chunk-OFUNBTK4.mjs +0 -169
- package/dist/esm/chunk-ORCQEMJL.mjs +0 -51
- package/dist/esm/chunk-ORCQEMJL.mjs.map +0 -1
- package/dist/esm/chunk-PGFEUN7K.mjs +0 -129
- package/dist/esm/chunk-PGFEUN7K.mjs.map +0 -1
- package/dist/esm/chunk-PKUXOBIV.mjs +0 -138
- package/dist/esm/chunk-PT2QHUB6.mjs +0 -96
- package/dist/esm/chunk-QJ6CGH7N.mjs +0 -71
- package/dist/esm/chunk-QPT4BSAB.mjs +0 -20
- package/dist/esm/chunk-QSYWLSSN.mjs +0 -216
- package/dist/esm/chunk-QYNYDQE3.mjs +0 -288
- package/dist/esm/chunk-QYNYDQE3.mjs.map +0 -1
- package/dist/esm/chunk-R45SPK6Q.mjs +0 -61
- package/dist/esm/chunk-R45SPK6Q.mjs.map +0 -1
- package/dist/esm/chunk-R4JTQQBX.mjs +0 -37
- package/dist/esm/chunk-R4JTQQBX.mjs.map +0 -1
- package/dist/esm/chunk-RCXGTN36.mjs +0 -58
- package/dist/esm/chunk-RCXGTN36.mjs.map +0 -1
- package/dist/esm/chunk-RMMOF53Q.mjs +0 -1
- package/dist/esm/chunk-RMMOF53Q.mjs.map +0 -1
- package/dist/esm/chunk-RQS33JAS.mjs +0 -77
- package/dist/esm/chunk-RQS33JAS.mjs.map +0 -1
- package/dist/esm/chunk-SAWN7RJP.mjs +0 -15
- package/dist/esm/chunk-SAWN7RJP.mjs.map +0 -1
- package/dist/esm/chunk-SBB4YEPT.mjs +0 -17
- package/dist/esm/chunk-SFLQPB72.mjs +0 -63
- package/dist/esm/chunk-SPI2HO3E.mjs +0 -177
- package/dist/esm/chunk-SPI2HO3E.mjs.map +0 -1
- package/dist/esm/chunk-SPVJXZL5.mjs +0 -865
- package/dist/esm/chunk-SPVJXZL5.mjs.map +0 -1
- package/dist/esm/chunk-SQNS4SFV.mjs +0 -232
- package/dist/esm/chunk-SRXIHVZE.mjs +0 -50
- package/dist/esm/chunk-SRXIHVZE.mjs.map +0 -1
- package/dist/esm/chunk-T4BFWV46.mjs +0 -63
- package/dist/esm/chunk-T4BFWV46.mjs.map +0 -1
- package/dist/esm/chunk-T573PCIR.mjs +0 -700
- package/dist/esm/chunk-T573PCIR.mjs.map +0 -1
- package/dist/esm/chunk-TDLL7QX5.mjs +0 -239
- package/dist/esm/chunk-TDLL7QX5.mjs.map +0 -1
- package/dist/esm/chunk-TFW6N66T.mjs +0 -415
- package/dist/esm/chunk-TFW6N66T.mjs.map +0 -1
- package/dist/esm/chunk-THWEBWUC.mjs +0 -20
- package/dist/esm/chunk-TJDF4CXI.mjs +0 -513
- package/dist/esm/chunk-TJDF4CXI.mjs.map +0 -1
- package/dist/esm/chunk-TL4Z4KHK.mjs +0 -70
- package/dist/esm/chunk-TL4Z4KHK.mjs.map +0 -1
- package/dist/esm/chunk-UGFIWCJQ.mjs +0 -130
- package/dist/esm/chunk-UGFIWCJQ.mjs.map +0 -1
- package/dist/esm/chunk-UGKZQUGE.mjs +0 -367
- package/dist/esm/chunk-UGKZQUGE.mjs.map +0 -1
- package/dist/esm/chunk-UIRAXHDH.mjs +0 -1
- package/dist/esm/chunk-UIRAXHDH.mjs.map +0 -1
- package/dist/esm/chunk-UK7SPHIE.mjs +0 -420
- package/dist/esm/chunk-UK7SPHIE.mjs.map +0 -1
- package/dist/esm/chunk-UOHCJOXI.mjs +0 -150
- package/dist/esm/chunk-UOHCJOXI.mjs.map +0 -1
- package/dist/esm/chunk-WHSS6I7T.mjs +0 -90
- package/dist/esm/chunk-WHSS6I7T.mjs.map +0 -1
- package/dist/esm/chunk-WLTQHGIJ.mjs +0 -177
- package/dist/esm/chunk-WUM247HF.mjs +0 -125
- package/dist/esm/chunk-WUM247HF.mjs.map +0 -1
- package/dist/esm/chunk-WXQUBQK4.mjs +0 -19
- package/dist/esm/chunk-X4N5BN3S.mjs +0 -40
- package/dist/esm/chunk-X4N5BN3S.mjs.map +0 -1
- package/dist/esm/chunk-XIBOO3WF.mjs +0 -168
- package/dist/esm/chunk-XIBOO3WF.mjs.map +0 -1
- package/dist/esm/chunk-XQFUKBY7.mjs +0 -136
- package/dist/esm/chunk-XX6C2QGI.mjs +0 -160
- package/dist/esm/chunk-XX6C2QGI.mjs.map +0 -1
- package/dist/esm/chunk-Y3ENAKRC.mjs +0 -73
- package/dist/esm/chunk-Y3M32DIB.mjs +0 -79
- package/dist/esm/chunk-Y3M32DIB.mjs.map +0 -1
- package/dist/esm/chunk-YK66QBML.mjs +0 -89
- package/dist/esm/chunk-YT7V6AVJ.mjs +0 -66
- package/dist/esm/chunk-YU65LNIC.mjs +0 -72
- package/dist/esm/chunk-ZRBUAZZD.mjs +0 -36
- package/dist/esm/chunk-ZRBUAZZD.mjs.map +0 -1
- package/dist/esm/chunk-ZWCTF3NQ.mjs +0 -25
- package/src/internal/queries/getAccountAddressForAuthKey.graphql +0 -8
- package/src/internal/queries/getAuthKeysForPublicKey.graphql +0 -9
- package/src/internal/queries/getMultiKeyForAuthKey.graphql +0 -9
- package/src/internal/queries/getSignatures.graphql +0 -13
- /package/dist/esm/{chunk-4NMDYPUD.mjs.map → chunk-KDMSOCZY.mjs.map} +0 -0
|
@@ -1,865 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getTableItem
|
|
3
|
-
} from "./chunk-YT7V6AVJ.mjs";
|
|
4
|
-
import {
|
|
5
|
-
generateTransaction,
|
|
6
|
-
signAndSubmitTransaction
|
|
7
|
-
} from "./chunk-HKQY5GXT.mjs";
|
|
8
|
-
import {
|
|
9
|
-
getInfo,
|
|
10
|
-
getModule,
|
|
11
|
-
getModules
|
|
12
|
-
} from "./chunk-FRLS4GRM.mjs";
|
|
13
|
-
import {
|
|
14
|
-
getTransactionByVersion,
|
|
15
|
-
waitForTransaction
|
|
16
|
-
} from "./chunk-BU43ZFDJ.mjs";
|
|
17
|
-
import {
|
|
18
|
-
queryIndexer
|
|
19
|
-
} from "./chunk-YK66QBML.mjs";
|
|
20
|
-
import {
|
|
21
|
-
GetAccountAddressesForAuthKey,
|
|
22
|
-
GetAccountCoinsCount,
|
|
23
|
-
GetAccountCoinsData,
|
|
24
|
-
GetAccountCollectionsWithOwnedTokens,
|
|
25
|
-
GetAccountOwnedTokens,
|
|
26
|
-
GetAccountOwnedTokensFromCollection,
|
|
27
|
-
GetAccountTokensCount,
|
|
28
|
-
GetAccountTransactionsCount,
|
|
29
|
-
GetAuthKeysForPublicKey,
|
|
30
|
-
GetMultiKeyForAuthKey,
|
|
31
|
-
GetObjectData,
|
|
32
|
-
GetSignatures
|
|
33
|
-
} from "./chunk-EPTUAWRA.mjs";
|
|
34
|
-
import {
|
|
35
|
-
MultiEd25519Account
|
|
36
|
-
} from "./chunk-5ORUQZAR.mjs";
|
|
37
|
-
import {
|
|
38
|
-
Account
|
|
39
|
-
} from "./chunk-WHSS6I7T.mjs";
|
|
40
|
-
import {
|
|
41
|
-
Ed25519Account
|
|
42
|
-
} from "./chunk-62LC4PPC.mjs";
|
|
43
|
-
import {
|
|
44
|
-
RotationProofChallenge
|
|
45
|
-
} from "./chunk-QJ6CGH7N.mjs";
|
|
46
|
-
import {
|
|
47
|
-
TypeTagU8,
|
|
48
|
-
TypeTagVector
|
|
49
|
-
} from "./chunk-DDZGHA66.mjs";
|
|
50
|
-
import {
|
|
51
|
-
createObjectAddress
|
|
52
|
-
} from "./chunk-6I37A76G.mjs";
|
|
53
|
-
import {
|
|
54
|
-
MultiEd25519PublicKey
|
|
55
|
-
} from "./chunk-3TUV6YMI.mjs";
|
|
56
|
-
import {
|
|
57
|
-
MultiKey
|
|
58
|
-
} from "./chunk-DMFRIING.mjs";
|
|
59
|
-
import {
|
|
60
|
-
AnyPublicKey
|
|
61
|
-
} from "./chunk-IPUAVRGL.mjs";
|
|
62
|
-
import {
|
|
63
|
-
Secp256k1PrivateKey,
|
|
64
|
-
Secp256k1PublicKey
|
|
65
|
-
} from "./chunk-ECTX2FGD.mjs";
|
|
66
|
-
import {
|
|
67
|
-
FederatedKeylessPublicKey
|
|
68
|
-
} from "./chunk-6SNGKTWE.mjs";
|
|
69
|
-
import {
|
|
70
|
-
KeylessPublicKey
|
|
71
|
-
} from "./chunk-T573PCIR.mjs";
|
|
72
|
-
import {
|
|
73
|
-
Ed25519PrivateKey,
|
|
74
|
-
Ed25519PublicKey
|
|
75
|
-
} from "./chunk-TFW6N66T.mjs";
|
|
76
|
-
import {
|
|
77
|
-
AuthenticationKey
|
|
78
|
-
} from "./chunk-PKUXOBIV.mjs";
|
|
79
|
-
import {
|
|
80
|
-
getAptosFullNode,
|
|
81
|
-
paginateWithCursor,
|
|
82
|
-
paginateWithObfuscatedCursor
|
|
83
|
-
} from "./chunk-XQFUKBY7.mjs";
|
|
84
|
-
import {
|
|
85
|
-
AptosApiError
|
|
86
|
-
} from "./chunk-32UQAST6.mjs";
|
|
87
|
-
import {
|
|
88
|
-
AccountAddress
|
|
89
|
-
} from "./chunk-CXLXUSCG.mjs";
|
|
90
|
-
import {
|
|
91
|
-
MoveVector
|
|
92
|
-
} from "./chunk-KSK3XIGF.mjs";
|
|
93
|
-
import {
|
|
94
|
-
U8
|
|
95
|
-
} from "./chunk-QSYWLSSN.mjs";
|
|
96
|
-
import {
|
|
97
|
-
isEd25519Signature,
|
|
98
|
-
isMultiEd25519Signature,
|
|
99
|
-
isSingleSenderMultiKeySignature,
|
|
100
|
-
isSingleSenderSingleKeySignature,
|
|
101
|
-
isUserTransactionResponse
|
|
102
|
-
} from "./chunk-SQNS4SFV.mjs";
|
|
103
|
-
import {
|
|
104
|
-
Deserializer
|
|
105
|
-
} from "./chunk-NUT2VOX2.mjs";
|
|
106
|
-
import {
|
|
107
|
-
Hex
|
|
108
|
-
} from "./chunk-BDM6FBUO.mjs";
|
|
109
|
-
import {
|
|
110
|
-
APTOS_COIN
|
|
111
|
-
} from "./chunk-5QHMFYVL.mjs";
|
|
112
|
-
|
|
113
|
-
// src/internal/account.ts
|
|
114
|
-
async function getInfo2(args) {
|
|
115
|
-
return getInfo(args);
|
|
116
|
-
}
|
|
117
|
-
async function getModules2(args) {
|
|
118
|
-
return getModules(args);
|
|
119
|
-
}
|
|
120
|
-
async function getModule2(args) {
|
|
121
|
-
return getModule(args);
|
|
122
|
-
}
|
|
123
|
-
async function getTransactions(args) {
|
|
124
|
-
const { aptosConfig, accountAddress, options } = args;
|
|
125
|
-
return paginateWithCursor({
|
|
126
|
-
aptosConfig,
|
|
127
|
-
originMethod: "getTransactions",
|
|
128
|
-
path: `accounts/${AccountAddress.from(accountAddress).toString()}/transactions`,
|
|
129
|
-
params: { start: options?.offset, limit: options?.limit }
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
async function getResources(args) {
|
|
133
|
-
const { aptosConfig, accountAddress, options } = args;
|
|
134
|
-
return paginateWithObfuscatedCursor({
|
|
135
|
-
aptosConfig,
|
|
136
|
-
originMethod: "getResources",
|
|
137
|
-
path: `accounts/${AccountAddress.from(accountAddress).toString()}/resources`,
|
|
138
|
-
params: {
|
|
139
|
-
ledger_version: options?.ledgerVersion,
|
|
140
|
-
offset: options?.offset,
|
|
141
|
-
limit: options?.limit ?? 999
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
async function getResource(args) {
|
|
146
|
-
const { aptosConfig, accountAddress, resourceType, options } = args;
|
|
147
|
-
const { data } = await getAptosFullNode({
|
|
148
|
-
aptosConfig,
|
|
149
|
-
originMethod: "getResource",
|
|
150
|
-
path: `accounts/${AccountAddress.from(accountAddress).toString()}/resource/${resourceType}`,
|
|
151
|
-
params: { ledger_version: options?.ledgerVersion }
|
|
152
|
-
});
|
|
153
|
-
return data.data;
|
|
154
|
-
}
|
|
155
|
-
async function lookupOriginalAccountAddress(args) {
|
|
156
|
-
const { aptosConfig, authenticationKey, options } = args;
|
|
157
|
-
const resource = await getResource({
|
|
158
|
-
aptosConfig,
|
|
159
|
-
accountAddress: "0x1",
|
|
160
|
-
resourceType: "0x1::account::OriginatingAddress",
|
|
161
|
-
options
|
|
162
|
-
});
|
|
163
|
-
const {
|
|
164
|
-
address_map: { handle }
|
|
165
|
-
} = resource;
|
|
166
|
-
const authKeyAddress = AccountAddress.from(authenticationKey);
|
|
167
|
-
try {
|
|
168
|
-
const originalAddress = await getTableItem({
|
|
169
|
-
aptosConfig,
|
|
170
|
-
handle,
|
|
171
|
-
data: {
|
|
172
|
-
key: authKeyAddress.toString(),
|
|
173
|
-
key_type: "address",
|
|
174
|
-
value_type: "address"
|
|
175
|
-
},
|
|
176
|
-
options
|
|
177
|
-
});
|
|
178
|
-
return AccountAddress.from(originalAddress);
|
|
179
|
-
} catch (err) {
|
|
180
|
-
if (err instanceof AptosApiError && err.data.error_code === "table_item_not_found") {
|
|
181
|
-
return authKeyAddress;
|
|
182
|
-
}
|
|
183
|
-
throw err;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
async function getAccountTokensCount(args) {
|
|
187
|
-
const { aptosConfig, accountAddress } = args;
|
|
188
|
-
const address = AccountAddress.from(accountAddress).toStringLong();
|
|
189
|
-
const whereCondition = {
|
|
190
|
-
owner_address: { _eq: address },
|
|
191
|
-
amount: { _gt: 0 }
|
|
192
|
-
};
|
|
193
|
-
const graphqlQuery = {
|
|
194
|
-
query: GetAccountTokensCount,
|
|
195
|
-
variables: { where_condition: whereCondition }
|
|
196
|
-
};
|
|
197
|
-
const data = await queryIndexer({
|
|
198
|
-
aptosConfig,
|
|
199
|
-
query: graphqlQuery,
|
|
200
|
-
originMethod: "getAccountTokensCount"
|
|
201
|
-
});
|
|
202
|
-
return data.current_token_ownerships_v2_aggregate.aggregate ? data.current_token_ownerships_v2_aggregate.aggregate.count : 0;
|
|
203
|
-
}
|
|
204
|
-
async function getAccountOwnedTokens(args) {
|
|
205
|
-
const { aptosConfig, accountAddress, options } = args;
|
|
206
|
-
const address = AccountAddress.from(accountAddress).toStringLong();
|
|
207
|
-
const whereCondition = {
|
|
208
|
-
owner_address: { _eq: address },
|
|
209
|
-
amount: { _gt: 0 }
|
|
210
|
-
};
|
|
211
|
-
if (options?.tokenStandard) {
|
|
212
|
-
whereCondition.token_standard = { _eq: options?.tokenStandard };
|
|
213
|
-
}
|
|
214
|
-
const graphqlQuery = {
|
|
215
|
-
query: GetAccountOwnedTokens,
|
|
216
|
-
variables: {
|
|
217
|
-
where_condition: whereCondition,
|
|
218
|
-
offset: options?.offset,
|
|
219
|
-
limit: options?.limit,
|
|
220
|
-
order_by: options?.orderBy
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
const data = await queryIndexer({
|
|
224
|
-
aptosConfig,
|
|
225
|
-
query: graphqlQuery,
|
|
226
|
-
originMethod: "getAccountOwnedTokens"
|
|
227
|
-
});
|
|
228
|
-
return data.current_token_ownerships_v2;
|
|
229
|
-
}
|
|
230
|
-
async function getAccountOwnedTokensFromCollectionAddress(args) {
|
|
231
|
-
const { aptosConfig, accountAddress, collectionAddress, options } = args;
|
|
232
|
-
const ownerAddress = AccountAddress.from(accountAddress).toStringLong();
|
|
233
|
-
const collAddress = AccountAddress.from(collectionAddress).toStringLong();
|
|
234
|
-
const whereCondition = {
|
|
235
|
-
owner_address: { _eq: ownerAddress },
|
|
236
|
-
current_token_data: { collection_id: { _eq: collAddress } },
|
|
237
|
-
amount: { _gt: 0 }
|
|
238
|
-
};
|
|
239
|
-
if (options?.tokenStandard) {
|
|
240
|
-
whereCondition.token_standard = { _eq: options?.tokenStandard };
|
|
241
|
-
}
|
|
242
|
-
const graphqlQuery = {
|
|
243
|
-
query: GetAccountOwnedTokensFromCollection,
|
|
244
|
-
variables: {
|
|
245
|
-
where_condition: whereCondition,
|
|
246
|
-
offset: options?.offset,
|
|
247
|
-
limit: options?.limit,
|
|
248
|
-
order_by: options?.orderBy
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
const data = await queryIndexer({
|
|
252
|
-
aptosConfig,
|
|
253
|
-
query: graphqlQuery,
|
|
254
|
-
originMethod: "getAccountOwnedTokensFromCollectionAddress"
|
|
255
|
-
});
|
|
256
|
-
return data.current_token_ownerships_v2;
|
|
257
|
-
}
|
|
258
|
-
async function getAccountCollectionsWithOwnedTokens(args) {
|
|
259
|
-
const { aptosConfig, accountAddress, options } = args;
|
|
260
|
-
const address = AccountAddress.from(accountAddress).toStringLong();
|
|
261
|
-
const whereCondition = {
|
|
262
|
-
owner_address: { _eq: address }
|
|
263
|
-
};
|
|
264
|
-
if (options?.tokenStandard) {
|
|
265
|
-
whereCondition.current_collection = {
|
|
266
|
-
token_standard: { _eq: options?.tokenStandard }
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
const graphqlQuery = {
|
|
270
|
-
query: GetAccountCollectionsWithOwnedTokens,
|
|
271
|
-
variables: {
|
|
272
|
-
where_condition: whereCondition,
|
|
273
|
-
offset: options?.offset,
|
|
274
|
-
limit: options?.limit,
|
|
275
|
-
order_by: options?.orderBy
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
const data = await queryIndexer({
|
|
279
|
-
aptosConfig,
|
|
280
|
-
query: graphqlQuery,
|
|
281
|
-
originMethod: "getAccountCollectionsWithOwnedTokens"
|
|
282
|
-
});
|
|
283
|
-
return data.current_collection_ownership_v2_view;
|
|
284
|
-
}
|
|
285
|
-
async function getAccountTransactionsCount(args) {
|
|
286
|
-
const { aptosConfig, accountAddress } = args;
|
|
287
|
-
const address = AccountAddress.from(accountAddress).toStringLong();
|
|
288
|
-
const graphqlQuery = {
|
|
289
|
-
query: GetAccountTransactionsCount,
|
|
290
|
-
variables: { address }
|
|
291
|
-
};
|
|
292
|
-
const data = await queryIndexer({
|
|
293
|
-
aptosConfig,
|
|
294
|
-
query: graphqlQuery,
|
|
295
|
-
originMethod: "getAccountTransactionsCount"
|
|
296
|
-
});
|
|
297
|
-
return data.account_transactions_aggregate.aggregate ? data.account_transactions_aggregate.aggregate.count : 0;
|
|
298
|
-
}
|
|
299
|
-
async function getAccountCoinAmount(args) {
|
|
300
|
-
const { aptosConfig, accountAddress, coinType, faMetadataAddress } = args;
|
|
301
|
-
let coinAssetType = coinType;
|
|
302
|
-
let faAddress;
|
|
303
|
-
if (coinType !== void 0 && faMetadataAddress !== void 0) {
|
|
304
|
-
faAddress = AccountAddress.from(faMetadataAddress).toStringLong();
|
|
305
|
-
} else if (coinType !== void 0 && faMetadataAddress === void 0) {
|
|
306
|
-
if (coinType === APTOS_COIN) {
|
|
307
|
-
faAddress = AccountAddress.A.toStringLong();
|
|
308
|
-
} else {
|
|
309
|
-
faAddress = createObjectAddress(AccountAddress.A, coinType).toStringLong();
|
|
310
|
-
}
|
|
311
|
-
} else if (coinType === void 0 && faMetadataAddress !== void 0) {
|
|
312
|
-
const addr = AccountAddress.from(faMetadataAddress);
|
|
313
|
-
faAddress = addr.toStringLong();
|
|
314
|
-
if (addr === AccountAddress.A) {
|
|
315
|
-
coinAssetType = APTOS_COIN;
|
|
316
|
-
}
|
|
317
|
-
} else {
|
|
318
|
-
throw new Error("Either coinType, fungibleAssetAddress, or both must be provided");
|
|
319
|
-
}
|
|
320
|
-
const address = AccountAddress.from(accountAddress).toStringLong();
|
|
321
|
-
let where = { asset_type: { _eq: faAddress } };
|
|
322
|
-
if (coinAssetType !== void 0) {
|
|
323
|
-
where = { asset_type: { _in: [coinAssetType, faAddress] } };
|
|
324
|
-
}
|
|
325
|
-
const data = await getAccountCoinsData({
|
|
326
|
-
aptosConfig,
|
|
327
|
-
accountAddress: address,
|
|
328
|
-
options: {
|
|
329
|
-
where
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
return data[0] ? data[0].amount : 0;
|
|
333
|
-
}
|
|
334
|
-
async function getAccountCoinsData(args) {
|
|
335
|
-
const { aptosConfig, accountAddress, options } = args;
|
|
336
|
-
const address = AccountAddress.from(accountAddress).toStringLong();
|
|
337
|
-
const whereCondition = {
|
|
338
|
-
...options?.where,
|
|
339
|
-
owner_address: { _eq: address }
|
|
340
|
-
};
|
|
341
|
-
const graphqlQuery = {
|
|
342
|
-
query: GetAccountCoinsData,
|
|
343
|
-
variables: {
|
|
344
|
-
where_condition: whereCondition,
|
|
345
|
-
offset: options?.offset,
|
|
346
|
-
limit: options?.limit,
|
|
347
|
-
order_by: options?.orderBy
|
|
348
|
-
}
|
|
349
|
-
};
|
|
350
|
-
const data = await queryIndexer({
|
|
351
|
-
aptosConfig,
|
|
352
|
-
query: graphqlQuery,
|
|
353
|
-
originMethod: "getAccountCoinsData"
|
|
354
|
-
});
|
|
355
|
-
return data.current_fungible_asset_balances;
|
|
356
|
-
}
|
|
357
|
-
async function getAccountCoinsCount(args) {
|
|
358
|
-
const { aptosConfig, accountAddress } = args;
|
|
359
|
-
const address = AccountAddress.from(accountAddress).toStringLong();
|
|
360
|
-
const graphqlQuery = {
|
|
361
|
-
query: GetAccountCoinsCount,
|
|
362
|
-
variables: { address }
|
|
363
|
-
};
|
|
364
|
-
const data = await queryIndexer({
|
|
365
|
-
aptosConfig,
|
|
366
|
-
query: graphqlQuery,
|
|
367
|
-
originMethod: "getAccountCoinsCount"
|
|
368
|
-
});
|
|
369
|
-
if (!data.current_fungible_asset_balances_aggregate.aggregate) {
|
|
370
|
-
throw Error("Failed to get the count of account coins");
|
|
371
|
-
}
|
|
372
|
-
return data.current_fungible_asset_balances_aggregate.aggregate.count;
|
|
373
|
-
}
|
|
374
|
-
async function getAccountOwnedObjects(args) {
|
|
375
|
-
const { aptosConfig, accountAddress, options } = args;
|
|
376
|
-
const address = AccountAddress.from(accountAddress).toStringLong();
|
|
377
|
-
const whereCondition = {
|
|
378
|
-
owner_address: { _eq: address }
|
|
379
|
-
};
|
|
380
|
-
const graphqlQuery = {
|
|
381
|
-
query: GetObjectData,
|
|
382
|
-
variables: {
|
|
383
|
-
where_condition: whereCondition,
|
|
384
|
-
offset: options?.offset,
|
|
385
|
-
limit: options?.limit,
|
|
386
|
-
order_by: options?.orderBy
|
|
387
|
-
}
|
|
388
|
-
};
|
|
389
|
-
const data = await queryIndexer({
|
|
390
|
-
aptosConfig,
|
|
391
|
-
query: graphqlQuery,
|
|
392
|
-
originMethod: "getAccountOwnedObjects"
|
|
393
|
-
});
|
|
394
|
-
return data.current_objects;
|
|
395
|
-
}
|
|
396
|
-
async function deriveAccountFromPrivateKey(args) {
|
|
397
|
-
const { aptosConfig, privateKey } = args;
|
|
398
|
-
const publicKey = new AnyPublicKey(privateKey.publicKey());
|
|
399
|
-
if (privateKey instanceof Secp256k1PrivateKey) {
|
|
400
|
-
const authKey = AuthenticationKey.fromPublicKey({ publicKey });
|
|
401
|
-
const address = authKey.derivedAddress();
|
|
402
|
-
return Account.fromPrivateKey({ privateKey, address });
|
|
403
|
-
}
|
|
404
|
-
if (privateKey instanceof Ed25519PrivateKey) {
|
|
405
|
-
const singleSenderTransactionAuthenticatorAuthKey = AuthenticationKey.fromPublicKey({
|
|
406
|
-
publicKey
|
|
407
|
-
});
|
|
408
|
-
const isSingleSenderTransactionAuthenticator = await isAccountExist({
|
|
409
|
-
authKey: singleSenderTransactionAuthenticatorAuthKey,
|
|
410
|
-
aptosConfig
|
|
411
|
-
});
|
|
412
|
-
if (isSingleSenderTransactionAuthenticator) {
|
|
413
|
-
const address = singleSenderTransactionAuthenticatorAuthKey.derivedAddress();
|
|
414
|
-
return Account.fromPrivateKey({ privateKey, address, legacy: false });
|
|
415
|
-
}
|
|
416
|
-
const legacyAuthKey = AuthenticationKey.fromPublicKey({
|
|
417
|
-
publicKey: publicKey.publicKey
|
|
418
|
-
});
|
|
419
|
-
const isLegacyEd25519 = await isAccountExist({ authKey: legacyAuthKey, aptosConfig });
|
|
420
|
-
if (isLegacyEd25519) {
|
|
421
|
-
const address = legacyAuthKey.derivedAddress();
|
|
422
|
-
return Account.fromPrivateKey({ privateKey, address, legacy: true });
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
throw new Error(`Can't derive account from private key ${privateKey}`);
|
|
426
|
-
}
|
|
427
|
-
async function isAccountExist(args) {
|
|
428
|
-
const { aptosConfig, authKey } = args;
|
|
429
|
-
const accountAddress = await lookupOriginalAccountAddress({
|
|
430
|
-
aptosConfig,
|
|
431
|
-
authenticationKey: authKey.derivedAddress()
|
|
432
|
-
});
|
|
433
|
-
try {
|
|
434
|
-
await getInfo2({
|
|
435
|
-
aptosConfig,
|
|
436
|
-
accountAddress
|
|
437
|
-
});
|
|
438
|
-
return true;
|
|
439
|
-
} catch (error) {
|
|
440
|
-
if (error.status === 404) {
|
|
441
|
-
return false;
|
|
442
|
-
}
|
|
443
|
-
throw new Error(`Error while looking for an account info ${accountAddress.toString()}`);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
var rotateAuthKeyAbi = {
|
|
447
|
-
typeParameters: [],
|
|
448
|
-
parameters: [
|
|
449
|
-
new TypeTagU8(),
|
|
450
|
-
TypeTagVector.u8(),
|
|
451
|
-
new TypeTagU8(),
|
|
452
|
-
TypeTagVector.u8(),
|
|
453
|
-
TypeTagVector.u8(),
|
|
454
|
-
TypeTagVector.u8()
|
|
455
|
-
]
|
|
456
|
-
};
|
|
457
|
-
async function rotateAuthKey(args) {
|
|
458
|
-
const { aptosConfig, fromAccount, dangerouslySkipVerification } = args;
|
|
459
|
-
if ("toNewPrivateKey" in args) {
|
|
460
|
-
return rotateAuthKeyWithChallenge({
|
|
461
|
-
aptosConfig,
|
|
462
|
-
fromAccount,
|
|
463
|
-
toNewPrivateKey: args.toNewPrivateKey
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
|
-
let authKey;
|
|
467
|
-
if ("toAccount" in args) {
|
|
468
|
-
if (args.toAccount instanceof Ed25519Account) {
|
|
469
|
-
return rotateAuthKeyWithChallenge({ aptosConfig, fromAccount, toNewPrivateKey: args.toAccount.privateKey });
|
|
470
|
-
}
|
|
471
|
-
if (args.toAccount instanceof MultiEd25519Account) {
|
|
472
|
-
return rotateAuthKeyWithChallenge({ aptosConfig, fromAccount, toAccount: args.toAccount });
|
|
473
|
-
}
|
|
474
|
-
authKey = args.toAccount.publicKey.authKey();
|
|
475
|
-
} else if ("toAuthKey" in args) {
|
|
476
|
-
authKey = args.toAuthKey;
|
|
477
|
-
} else {
|
|
478
|
-
throw new Error("Invalid arguments");
|
|
479
|
-
}
|
|
480
|
-
const pendingTxn = await rotateAuthKeyUnverified({
|
|
481
|
-
aptosConfig,
|
|
482
|
-
fromAccount,
|
|
483
|
-
toAuthKey: authKey
|
|
484
|
-
});
|
|
485
|
-
if (dangerouslySkipVerification === true) {
|
|
486
|
-
return pendingTxn;
|
|
487
|
-
}
|
|
488
|
-
const rotateAuthKeyTxnResponse = await waitForTransaction({
|
|
489
|
-
aptosConfig,
|
|
490
|
-
transactionHash: pendingTxn.hash
|
|
491
|
-
});
|
|
492
|
-
if (!rotateAuthKeyTxnResponse.success) {
|
|
493
|
-
throw new Error(`Failed to rotate authentication key - ${rotateAuthKeyTxnResponse}`);
|
|
494
|
-
}
|
|
495
|
-
const verificationTxn = await generateTransaction({
|
|
496
|
-
aptosConfig,
|
|
497
|
-
sender: fromAccount.accountAddress,
|
|
498
|
-
data: {
|
|
499
|
-
function: "0x1::account::set_originating_address",
|
|
500
|
-
functionArguments: []
|
|
501
|
-
}
|
|
502
|
-
});
|
|
503
|
-
return signAndSubmitTransaction({
|
|
504
|
-
aptosConfig,
|
|
505
|
-
signer: args.toAccount,
|
|
506
|
-
// Use the new account to sign
|
|
507
|
-
transaction: verificationTxn
|
|
508
|
-
});
|
|
509
|
-
}
|
|
510
|
-
async function rotateAuthKeyWithChallenge(args) {
|
|
511
|
-
const { aptosConfig, fromAccount } = args;
|
|
512
|
-
const accountInfo = await getInfo2({
|
|
513
|
-
aptosConfig,
|
|
514
|
-
accountAddress: fromAccount.accountAddress
|
|
515
|
-
});
|
|
516
|
-
let newAccount;
|
|
517
|
-
if ("toNewPrivateKey" in args) {
|
|
518
|
-
newAccount = Account.fromPrivateKey({ privateKey: args.toNewPrivateKey, legacy: true });
|
|
519
|
-
} else {
|
|
520
|
-
newAccount = args.toAccount;
|
|
521
|
-
}
|
|
522
|
-
const challenge = new RotationProofChallenge({
|
|
523
|
-
sequenceNumber: BigInt(accountInfo.sequence_number),
|
|
524
|
-
originator: fromAccount.accountAddress,
|
|
525
|
-
currentAuthKey: AccountAddress.from(accountInfo.authentication_key),
|
|
526
|
-
newPublicKey: newAccount.publicKey
|
|
527
|
-
});
|
|
528
|
-
const challengeHex = challenge.bcsToBytes();
|
|
529
|
-
const proofSignedByCurrentKey = fromAccount.sign(challengeHex);
|
|
530
|
-
const proofSignedByNewKey = newAccount.sign(challengeHex);
|
|
531
|
-
const rawTxn = await generateTransaction({
|
|
532
|
-
aptosConfig,
|
|
533
|
-
sender: fromAccount.accountAddress,
|
|
534
|
-
data: {
|
|
535
|
-
function: "0x1::account::rotate_authentication_key",
|
|
536
|
-
functionArguments: [
|
|
537
|
-
new U8(fromAccount.signingScheme),
|
|
538
|
-
// from scheme
|
|
539
|
-
MoveVector.U8(fromAccount.publicKey.toUint8Array()),
|
|
540
|
-
new U8(newAccount.signingScheme),
|
|
541
|
-
// to scheme
|
|
542
|
-
MoveVector.U8(newAccount.publicKey.toUint8Array()),
|
|
543
|
-
MoveVector.U8(proofSignedByCurrentKey.toUint8Array()),
|
|
544
|
-
MoveVector.U8(proofSignedByNewKey.toUint8Array())
|
|
545
|
-
],
|
|
546
|
-
abi: rotateAuthKeyAbi
|
|
547
|
-
}
|
|
548
|
-
});
|
|
549
|
-
return signAndSubmitTransaction({
|
|
550
|
-
aptosConfig,
|
|
551
|
-
signer: fromAccount,
|
|
552
|
-
transaction: rawTxn
|
|
553
|
-
});
|
|
554
|
-
}
|
|
555
|
-
var rotateAuthKeyUnverifiedAbi = {
|
|
556
|
-
typeParameters: [],
|
|
557
|
-
parameters: [TypeTagVector.u8()]
|
|
558
|
-
};
|
|
559
|
-
async function rotateAuthKeyUnverified(args) {
|
|
560
|
-
const { aptosConfig, fromAccount, toAuthKey } = args;
|
|
561
|
-
const authKey = toAuthKey;
|
|
562
|
-
const rawTxn = await generateTransaction({
|
|
563
|
-
aptosConfig,
|
|
564
|
-
sender: fromAccount.accountAddress,
|
|
565
|
-
data: {
|
|
566
|
-
function: "0x1::account::rotate_authentication_key_call",
|
|
567
|
-
functionArguments: [MoveVector.U8(authKey.toUint8Array())],
|
|
568
|
-
abi: rotateAuthKeyUnverifiedAbi
|
|
569
|
-
}
|
|
570
|
-
});
|
|
571
|
-
return signAndSubmitTransaction({
|
|
572
|
-
aptosConfig,
|
|
573
|
-
signer: fromAccount,
|
|
574
|
-
transaction: rawTxn
|
|
575
|
-
});
|
|
576
|
-
}
|
|
577
|
-
async function getMultiKeysForAuthenticationKeys(args) {
|
|
578
|
-
const { aptosConfig, authKeys } = args;
|
|
579
|
-
if (authKeys.length === 0) {
|
|
580
|
-
throw new Error("No authentication keys provided");
|
|
581
|
-
}
|
|
582
|
-
const whereCondition = {
|
|
583
|
-
auth_key: { _in: authKeys.map((authKey) => authKey.toString()) }
|
|
584
|
-
};
|
|
585
|
-
const graphqlQuery = {
|
|
586
|
-
query: GetMultiKeyForAuthKey,
|
|
587
|
-
variables: {
|
|
588
|
-
where_condition: whereCondition
|
|
589
|
-
}
|
|
590
|
-
};
|
|
591
|
-
const { auth_key_multikey_layout: data } = await queryIndexer({
|
|
592
|
-
aptosConfig,
|
|
593
|
-
query: graphqlQuery,
|
|
594
|
-
originMethod: "getMultiKeysForAuthenticationKeys"
|
|
595
|
-
});
|
|
596
|
-
const authKeyToMultiKey = new Map(data.map((entry) => [entry.auth_key, entry]));
|
|
597
|
-
const result = [];
|
|
598
|
-
for (let i = 0; i < authKeys.length; i += 1) {
|
|
599
|
-
const entry = authKeyToMultiKey.get(authKeys[i].toString());
|
|
600
|
-
if (!entry) {
|
|
601
|
-
throw new Error(`Failed to find multikey for authentication key ${authKeys[i]}`);
|
|
602
|
-
}
|
|
603
|
-
const publicKey = extractMultiKeyFromData(entry);
|
|
604
|
-
result.push({ authKey: authKeys[i], publicKey });
|
|
605
|
-
}
|
|
606
|
-
return result;
|
|
607
|
-
}
|
|
608
|
-
function extractMultiKeyFromData(data) {
|
|
609
|
-
const signaturesRequired = data.signatures_required;
|
|
610
|
-
const multikeyLayout = data.multikey_layout_with_prefixes;
|
|
611
|
-
const multikeyType = data.multikey_type;
|
|
612
|
-
if (multikeyType === "multi_ed25519") {
|
|
613
|
-
const ed25519PublicKeys = [];
|
|
614
|
-
for (const key of multikeyLayout) {
|
|
615
|
-
ed25519PublicKeys.push(new Ed25519PublicKey(key));
|
|
616
|
-
}
|
|
617
|
-
return new MultiEd25519PublicKey({
|
|
618
|
-
publicKeys: ed25519PublicKeys,
|
|
619
|
-
threshold: signaturesRequired
|
|
620
|
-
});
|
|
621
|
-
}
|
|
622
|
-
if (multikeyType === "multi_key") {
|
|
623
|
-
const publicKeys = [];
|
|
624
|
-
for (const key of multikeyLayout) {
|
|
625
|
-
const deserializer = Deserializer.fromHex(key);
|
|
626
|
-
const variantIndex = deserializer.deserializeUleb128AsU32();
|
|
627
|
-
let publicKey;
|
|
628
|
-
switch (variantIndex) {
|
|
629
|
-
case 0 /* Ed25519 */:
|
|
630
|
-
publicKey = new Ed25519PublicKey(deserializer.deserializeFixedBytes(32));
|
|
631
|
-
break;
|
|
632
|
-
case 1 /* Secp256k1 */:
|
|
633
|
-
publicKey = new Secp256k1PublicKey(deserializer.deserializeFixedBytes(65));
|
|
634
|
-
break;
|
|
635
|
-
case 3 /* Keyless */:
|
|
636
|
-
publicKey = KeylessPublicKey.deserialize(deserializer);
|
|
637
|
-
break;
|
|
638
|
-
case 4 /* FederatedKeyless */:
|
|
639
|
-
publicKey = FederatedKeylessPublicKey.deserialize(deserializer);
|
|
640
|
-
break;
|
|
641
|
-
default:
|
|
642
|
-
throw new Error(`Unknown variant index for AnyPublicKey: ${variantIndex}`);
|
|
643
|
-
}
|
|
644
|
-
publicKeys.push(new AnyPublicKey(publicKey));
|
|
645
|
-
}
|
|
646
|
-
return new MultiKey({
|
|
647
|
-
publicKeys,
|
|
648
|
-
signaturesRequired
|
|
649
|
-
});
|
|
650
|
-
}
|
|
651
|
-
throw new Error("Unknown multikey type");
|
|
652
|
-
}
|
|
653
|
-
async function getAuthKeysForPublicKey(args) {
|
|
654
|
-
const { aptosConfig, publicKey, options } = args;
|
|
655
|
-
const verified = options?.verified ?? true;
|
|
656
|
-
let baseKey = publicKey;
|
|
657
|
-
if (publicKey instanceof AnyPublicKey) {
|
|
658
|
-
baseKey = publicKey.publicKey;
|
|
659
|
-
}
|
|
660
|
-
const whereCondition = {
|
|
661
|
-
public_key: { _eq: baseKey.toString() },
|
|
662
|
-
verified: { _eq: verified }
|
|
663
|
-
};
|
|
664
|
-
const graphqlQuery = {
|
|
665
|
-
query: GetAuthKeysForPublicKey,
|
|
666
|
-
variables: {
|
|
667
|
-
where_condition: whereCondition
|
|
668
|
-
}
|
|
669
|
-
};
|
|
670
|
-
const { public_key_auth_keys: data } = await queryIndexer({
|
|
671
|
-
aptosConfig,
|
|
672
|
-
query: graphqlQuery,
|
|
673
|
-
originMethod: "getAuthKeysForPublicKey"
|
|
674
|
-
});
|
|
675
|
-
const sortedData = data.sort((a, b) => Number(b.last_transaction_version) - Number(a.last_transaction_version));
|
|
676
|
-
const authKeys = sortedData.map((entry) => new AuthenticationKey({ data: entry.auth_key }));
|
|
677
|
-
return authKeys;
|
|
678
|
-
}
|
|
679
|
-
async function getLastestTransactionVersionForAddress(args) {
|
|
680
|
-
const { aptosConfig, accountAddress } = args;
|
|
681
|
-
const address = AccountAddress.from(accountAddress).toString();
|
|
682
|
-
const whereCondition = {
|
|
683
|
-
signer: { _eq: accountAddress.toString() }
|
|
684
|
-
};
|
|
685
|
-
const graphqlQuery = {
|
|
686
|
-
query: GetSignatures,
|
|
687
|
-
variables: {
|
|
688
|
-
where_condition: whereCondition,
|
|
689
|
-
limit: 1,
|
|
690
|
-
order_by: { transaction_version: "desc" }
|
|
691
|
-
}
|
|
692
|
-
};
|
|
693
|
-
const { signatures: data } = await queryIndexer({
|
|
694
|
-
aptosConfig,
|
|
695
|
-
query: graphqlQuery,
|
|
696
|
-
originMethod: "getSignatures"
|
|
697
|
-
});
|
|
698
|
-
if (data.length !== 1) {
|
|
699
|
-
throw new Error(`No signatures found for address ${address}`);
|
|
700
|
-
}
|
|
701
|
-
return Number(data[0].transaction_version);
|
|
702
|
-
}
|
|
703
|
-
async function getAccountAddressesForAuthKeys(args) {
|
|
704
|
-
const { aptosConfig, options, authKeys } = args;
|
|
705
|
-
const verified = options?.verified ?? true;
|
|
706
|
-
if (authKeys.length === 0) {
|
|
707
|
-
throw new Error("No authentication keys provided");
|
|
708
|
-
}
|
|
709
|
-
const whereCondition = {
|
|
710
|
-
auth_key: { _in: authKeys.map((authKey) => authKey.toString()) },
|
|
711
|
-
verified: { _eq: verified }
|
|
712
|
-
};
|
|
713
|
-
const graphqlQuery = {
|
|
714
|
-
query: GetAccountAddressesForAuthKey,
|
|
715
|
-
variables: {
|
|
716
|
-
where_condition: whereCondition
|
|
717
|
-
}
|
|
718
|
-
};
|
|
719
|
-
const { auth_key_account_addresses: data } = await queryIndexer({
|
|
720
|
-
aptosConfig,
|
|
721
|
-
query: graphqlQuery,
|
|
722
|
-
originMethod: "getAccountAddressesForAuthKeys"
|
|
723
|
-
});
|
|
724
|
-
return data.map((entry) => ({
|
|
725
|
-
authKey: new AuthenticationKey({ data: entry.auth_key }),
|
|
726
|
-
accountAddress: new AccountAddress(Hex.hexInputToUint8Array(entry.address)),
|
|
727
|
-
verified: entry.verified,
|
|
728
|
-
lastTransactionVersion: Number(entry.last_transaction_version)
|
|
729
|
-
}));
|
|
730
|
-
}
|
|
731
|
-
async function getAccountsForPublicKey(args) {
|
|
732
|
-
const { aptosConfig, publicKey } = args;
|
|
733
|
-
let baseKey = publicKey;
|
|
734
|
-
if (publicKey instanceof AnyPublicKey) {
|
|
735
|
-
baseKey = publicKey.publicKey;
|
|
736
|
-
}
|
|
737
|
-
const singleKeyPublicKeys = [];
|
|
738
|
-
if (baseKey instanceof Ed25519PublicKey) {
|
|
739
|
-
singleKeyPublicKeys.push(baseKey);
|
|
740
|
-
}
|
|
741
|
-
const anyPublicKey = new AnyPublicKey(baseKey);
|
|
742
|
-
singleKeyPublicKeys.push(anyPublicKey);
|
|
743
|
-
const singleKeyAuthKeyPublicKeyPairs = singleKeyPublicKeys.map((pubKey) => {
|
|
744
|
-
const authKey = pubKey.authKey();
|
|
745
|
-
return { authKey, publicKey: pubKey };
|
|
746
|
-
});
|
|
747
|
-
const multiKeyAuthKeys = await getAuthKeysForPublicKey({ aptosConfig, publicKey });
|
|
748
|
-
const [multiKeyPairs, authKeyAccountAddressPairs] = await Promise.all([
|
|
749
|
-
getMultiKeysForAuthenticationKeys({ aptosConfig, authKeys: multiKeyAuthKeys }),
|
|
750
|
-
getAccountAddressesForAuthKeys({
|
|
751
|
-
aptosConfig,
|
|
752
|
-
authKeys: multiKeyAuthKeys.concat(singleKeyAuthKeyPublicKeyPairs.map((pair) => pair.publicKey.authKey()))
|
|
753
|
-
})
|
|
754
|
-
]);
|
|
755
|
-
const authKeyPublicKeyPairs = singleKeyAuthKeyPublicKeyPairs.concat(multiKeyPairs);
|
|
756
|
-
const result = [];
|
|
757
|
-
const authKeyToPublicKey = new Map(authKeyPublicKeyPairs.map((pair) => [pair.authKey.toString(), pair.publicKey]));
|
|
758
|
-
for (const authKeyAccountAddressPair of authKeyAccountAddressPairs) {
|
|
759
|
-
if (!authKeyToPublicKey.has(authKeyAccountAddressPair.authKey.toString())) {
|
|
760
|
-
throw new Error(`No publicKey found for authentication key ${authKeyAccountAddressPair.authKey}.`);
|
|
761
|
-
}
|
|
762
|
-
result.push({
|
|
763
|
-
accountAddress: authKeyAccountAddressPair.accountAddress,
|
|
764
|
-
publicKey: authKeyToPublicKey.get(authKeyAccountAddressPair.authKey.toString()),
|
|
765
|
-
verified: authKeyAccountAddressPair.verified,
|
|
766
|
-
lastTransactionVersion: authKeyAccountAddressPair.lastTransactionVersion
|
|
767
|
-
});
|
|
768
|
-
}
|
|
769
|
-
return result;
|
|
770
|
-
}
|
|
771
|
-
async function getPublicKeyFromAccountAddress(args) {
|
|
772
|
-
const { aptosConfig, accountAddress } = args;
|
|
773
|
-
const accountData = await getInfo2({ aptosConfig, accountAddress });
|
|
774
|
-
const lastTransactionVersion = await getLastestTransactionVersionForAddress({
|
|
775
|
-
aptosConfig,
|
|
776
|
-
accountAddress
|
|
777
|
-
});
|
|
778
|
-
console.log("lastTransactionVersion", lastTransactionVersion);
|
|
779
|
-
const transaction = await getTransactionByVersion({ aptosConfig, ledgerVersion: lastTransactionVersion });
|
|
780
|
-
if (!isUserTransactionResponse(transaction)) {
|
|
781
|
-
throw new Error("Transaction is not a user transaction");
|
|
782
|
-
}
|
|
783
|
-
const { signature } = transaction;
|
|
784
|
-
if (!signature) {
|
|
785
|
-
throw new Error("Transaction has no signature");
|
|
786
|
-
}
|
|
787
|
-
let publicKey;
|
|
788
|
-
if (isEd25519Signature(signature)) {
|
|
789
|
-
publicKey = new Ed25519PublicKey(signature.public_key);
|
|
790
|
-
} else if (isMultiEd25519Signature(signature)) {
|
|
791
|
-
publicKey = new MultiEd25519PublicKey({
|
|
792
|
-
publicKeys: signature.public_keys.map((pk) => new Ed25519PublicKey(pk)),
|
|
793
|
-
threshold: signature.threshold
|
|
794
|
-
});
|
|
795
|
-
} else if (isSingleSenderSingleKeySignature(signature)) {
|
|
796
|
-
publicKey = parsePublicKey(signature.public_key);
|
|
797
|
-
} else if (isSingleSenderMultiKeySignature(signature)) {
|
|
798
|
-
const publicKeys = [];
|
|
799
|
-
for (const pk of signature.public_keys) {
|
|
800
|
-
publicKeys.push(parsePublicKey(pk));
|
|
801
|
-
}
|
|
802
|
-
publicKey = new MultiKey({
|
|
803
|
-
publicKeys,
|
|
804
|
-
signaturesRequired: signature.signatures_required
|
|
805
|
-
});
|
|
806
|
-
} else {
|
|
807
|
-
throw new Error("Unknown signature type");
|
|
808
|
-
}
|
|
809
|
-
if (publicKey.authKey().toString() !== accountData.authentication_key) {
|
|
810
|
-
throw new Error(
|
|
811
|
-
"Derived public key does not match authentication key. The most recent signature was likely a key rotation."
|
|
812
|
-
);
|
|
813
|
-
}
|
|
814
|
-
return publicKey;
|
|
815
|
-
}
|
|
816
|
-
async function getMultiKeyFromAuthenticationKey(args) {
|
|
817
|
-
const { aptosConfig, authKey } = args;
|
|
818
|
-
const result = await getMultiKeysForAuthenticationKeys({ aptosConfig, authKeys: [authKey] });
|
|
819
|
-
if (result.length === 0) {
|
|
820
|
-
throw new Error(`No multikey found for the given authentication key ${authKey}`);
|
|
821
|
-
}
|
|
822
|
-
if (result.length > 1) {
|
|
823
|
-
throw new Error(`More than one multikey found for the given authentication key ${authKey}`);
|
|
824
|
-
}
|
|
825
|
-
return result[0].publicKey;
|
|
826
|
-
}
|
|
827
|
-
function parsePublicKey(data) {
|
|
828
|
-
if (data.type === "keyless") {
|
|
829
|
-
const deserializer = Deserializer.fromHex(data.value);
|
|
830
|
-
return new AnyPublicKey(KeylessPublicKey.deserialize(deserializer));
|
|
831
|
-
}
|
|
832
|
-
if (data.type === "ed25519") {
|
|
833
|
-
return new AnyPublicKey(new Ed25519PublicKey(data.value));
|
|
834
|
-
}
|
|
835
|
-
if (data.type === "secp256k1_ecdsa") {
|
|
836
|
-
return new AnyPublicKey(new Secp256k1PublicKey(data.value));
|
|
837
|
-
}
|
|
838
|
-
throw new Error("Unknown public key type");
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
export {
|
|
842
|
-
getInfo2 as getInfo,
|
|
843
|
-
getModules2 as getModules,
|
|
844
|
-
getModule2 as getModule,
|
|
845
|
-
getTransactions,
|
|
846
|
-
getResources,
|
|
847
|
-
getResource,
|
|
848
|
-
lookupOriginalAccountAddress,
|
|
849
|
-
getAccountTokensCount,
|
|
850
|
-
getAccountOwnedTokens,
|
|
851
|
-
getAccountOwnedTokensFromCollectionAddress,
|
|
852
|
-
getAccountCollectionsWithOwnedTokens,
|
|
853
|
-
getAccountTransactionsCount,
|
|
854
|
-
getAccountCoinAmount,
|
|
855
|
-
getAccountCoinsData,
|
|
856
|
-
getAccountCoinsCount,
|
|
857
|
-
getAccountOwnedObjects,
|
|
858
|
-
deriveAccountFromPrivateKey,
|
|
859
|
-
isAccountExist,
|
|
860
|
-
rotateAuthKey,
|
|
861
|
-
getAccountsForPublicKey,
|
|
862
|
-
getPublicKeyFromAccountAddress,
|
|
863
|
-
getMultiKeyFromAuthenticationKey
|
|
864
|
-
};
|
|
865
|
-
//# sourceMappingURL=chunk-SPVJXZL5.mjs.map
|