@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,195 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TransactionWorker
|
|
3
|
-
} from "./chunk-QYNYDQE3.mjs";
|
|
4
|
-
|
|
5
|
-
// src/api/transactionSubmission/management.ts
|
|
6
|
-
import EventEmitter from "eventemitter3";
|
|
7
|
-
var TransactionManagement = class extends EventEmitter {
|
|
8
|
-
/**
|
|
9
|
-
* Initializes a new instance of the Aptos client with the provided configuration settings.
|
|
10
|
-
* This allows you to interact with the Aptos blockchain using the specified network and options.
|
|
11
|
-
*
|
|
12
|
-
* @param config - The configuration settings for the Aptos client.
|
|
13
|
-
* @param config.network - The network to connect to (e.g., TESTNET, MAINNET).
|
|
14
|
-
* @param config.nodeUrl - The URL of the Aptos node to connect to.
|
|
15
|
-
* @param config.account - Optional account settings for authentication.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```typescript
|
|
19
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
20
|
-
*
|
|
21
|
-
* async function runExample() {
|
|
22
|
-
* // Create a configuration for the Aptos client
|
|
23
|
-
* const config = new AptosConfig({
|
|
24
|
-
* network: Network.TESTNET, // specify the network to use
|
|
25
|
-
* nodeUrl: "https://testnet.aptos.dev" // replace with your node URL
|
|
26
|
-
* });
|
|
27
|
-
*
|
|
28
|
-
* // Initialize the Aptos client with the configuration
|
|
29
|
-
* const aptos = new Aptos(config);
|
|
30
|
-
*
|
|
31
|
-
* console.log("Aptos client initialized successfully.");
|
|
32
|
-
* }
|
|
33
|
-
* runExample().catch(console.error);
|
|
34
|
-
* ```
|
|
35
|
-
* @group Implementation
|
|
36
|
-
*/
|
|
37
|
-
constructor(config) {
|
|
38
|
-
super();
|
|
39
|
-
this.config = config;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Initializes the transaction worker using the provided sender account and begins listening for events.
|
|
43
|
-
* This function is essential for setting up the transaction processing environment.
|
|
44
|
-
*
|
|
45
|
-
* @param args - The arguments for starting the transaction worker.
|
|
46
|
-
* @param args.sender - The sender account to sign and submit the transaction.
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```typescript
|
|
50
|
-
* import { Aptos, AptosConfig, Network, Account } from "@aptos-labs/ts-sdk";
|
|
51
|
-
*
|
|
52
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
53
|
-
* const aptos = new Aptos(config);
|
|
54
|
-
*
|
|
55
|
-
* async function runExample() {
|
|
56
|
-
* const sender = Account.generate(); // Generate a new account for sending transactions
|
|
57
|
-
*
|
|
58
|
-
* // Start the transaction worker with the sender account
|
|
59
|
-
* aptos.start({ sender });
|
|
60
|
-
*
|
|
61
|
-
* console.log("Transaction worker started with sender:", sender.accountAddress);
|
|
62
|
-
* }
|
|
63
|
-
* runExample().catch(console.error);
|
|
64
|
-
* ```
|
|
65
|
-
* @group Implementation
|
|
66
|
-
*/
|
|
67
|
-
start(args) {
|
|
68
|
-
const { sender } = args;
|
|
69
|
-
this.account = sender;
|
|
70
|
-
this.transactionWorker = new TransactionWorker(this.config, sender);
|
|
71
|
-
this.transactionWorker.start();
|
|
72
|
-
this.registerToEvents();
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Pushes transaction data to the transaction worker for processing.
|
|
76
|
-
*
|
|
77
|
-
* @param args.data An array of transaction payloads to be processed.
|
|
78
|
-
* @param args.options Optional. Transaction generation configurations (excluding accountSequenceNumber).
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* ```typescript
|
|
82
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
83
|
-
*
|
|
84
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
85
|
-
* const aptos = new Aptos(config);
|
|
86
|
-
*
|
|
87
|
-
* async function runExample() {
|
|
88
|
-
* // Prepare transaction payloads
|
|
89
|
-
* const payloads = [
|
|
90
|
-
* {}, // Build your first transaction payload
|
|
91
|
-
* {}, // Build your second transaction payload
|
|
92
|
-
* ];
|
|
93
|
-
*
|
|
94
|
-
* // Push transaction data to the worker
|
|
95
|
-
* aptos.push({
|
|
96
|
-
* data: payloads,
|
|
97
|
-
* {}, // Specify options as needed
|
|
98
|
-
* });
|
|
99
|
-
*
|
|
100
|
-
* console.log("Transaction data pushed successfully.");
|
|
101
|
-
* }
|
|
102
|
-
* runExample().catch(console.error);
|
|
103
|
-
* ```
|
|
104
|
-
* @group Implementation
|
|
105
|
-
*/
|
|
106
|
-
push(args) {
|
|
107
|
-
const { data, options } = args;
|
|
108
|
-
for (const d of data) {
|
|
109
|
-
this.transactionWorker.push(d, options);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Starts listening to transaction worker events, allowing the application to respond to transaction status changes.
|
|
114
|
-
* This function enables the application to handle events such as transaction sent, execution success, or failure.
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* ```typescript
|
|
118
|
-
* import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
|
|
119
|
-
*
|
|
120
|
-
* const config = new AptosConfig({ network: Network.TESTNET });
|
|
121
|
-
* const aptos = new Aptos(config);
|
|
122
|
-
*
|
|
123
|
-
* async function runExample() {
|
|
124
|
-
* // Register to listen for transaction events
|
|
125
|
-
* aptos.registerToEvents();
|
|
126
|
-
*
|
|
127
|
-
* // You can send a transaction here to see the events in action
|
|
128
|
-
* const sender = Account.generate(); // replace with a real account
|
|
129
|
-
* const destination = Account.generate(); // replace with a real account
|
|
130
|
-
*
|
|
131
|
-
* const transaction = await aptos.transaction.build.simple({
|
|
132
|
-
* sender: sender.accountAddress,
|
|
133
|
-
* data: {
|
|
134
|
-
* function: "0x1::aptos_account::transfer",
|
|
135
|
-
* functionArguments: [destination.accountAddress, 100],
|
|
136
|
-
* },
|
|
137
|
-
* });
|
|
138
|
-
*
|
|
139
|
-
* await aptos.transaction.send(transaction);
|
|
140
|
-
*
|
|
141
|
-
* console.log("Transaction sent and events registered.");
|
|
142
|
-
* }
|
|
143
|
-
* runExample().catch(console.error);
|
|
144
|
-
* ```
|
|
145
|
-
* @group Implementation
|
|
146
|
-
*/
|
|
147
|
-
registerToEvents() {
|
|
148
|
-
this.transactionWorker.on("transactionSent" /* TransactionSent */, async (data) => {
|
|
149
|
-
this.emit("transactionSent" /* TransactionSent */, data);
|
|
150
|
-
});
|
|
151
|
-
this.transactionWorker.on("transactionSendFailed" /* TransactionSendFailed */, async (data) => {
|
|
152
|
-
this.emit("transactionSendFailed" /* TransactionSendFailed */, data);
|
|
153
|
-
});
|
|
154
|
-
this.transactionWorker.on("transactionExecuted" /* TransactionExecuted */, async (data) => {
|
|
155
|
-
this.emit("transactionExecuted" /* TransactionExecuted */, data);
|
|
156
|
-
});
|
|
157
|
-
this.transactionWorker.on("transactionExecutionFailed" /* TransactionExecutionFailed */, async (data) => {
|
|
158
|
-
this.emit("transactionExecutionFailed" /* TransactionExecutionFailed */, data);
|
|
159
|
-
});
|
|
160
|
-
this.transactionWorker.on("executionFinish" /* ExecutionFinish */, async (data) => {
|
|
161
|
-
this.emit("executionFinish" /* ExecutionFinish */, data);
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Send batch transactions for a single account.
|
|
166
|
-
*
|
|
167
|
-
* This function uses a transaction worker that receives payloads to be processed
|
|
168
|
-
* and submitted to chain.
|
|
169
|
-
* Note that this process is best for submitting multiple transactions that
|
|
170
|
-
* don't rely on each other, i.e. batch funds, batch token mints, etc.
|
|
171
|
-
*
|
|
172
|
-
* If any worker failure, the functions throws an error.
|
|
173
|
-
*
|
|
174
|
-
* @param args.sender The sender account to sign and submit the transaction
|
|
175
|
-
* @param args.data An array of transaction payloads
|
|
176
|
-
* @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)
|
|
177
|
-
*
|
|
178
|
-
* @return void. Throws if any error
|
|
179
|
-
* @group Implementation
|
|
180
|
-
*/
|
|
181
|
-
forSingleAccount(args) {
|
|
182
|
-
try {
|
|
183
|
-
const { sender, data, options } = args;
|
|
184
|
-
this.start({ sender });
|
|
185
|
-
this.push({ data, options });
|
|
186
|
-
} catch (error) {
|
|
187
|
-
throw new Error(`failed to submit transactions with error: ${error}`);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
export {
|
|
193
|
-
TransactionManagement
|
|
194
|
-
};
|
|
195
|
-
//# sourceMappingURL=chunk-3DAVHDK4.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/api/transactionSubmission/management.ts"],"sourcesContent":["import EventEmitter from \"eventemitter3\";\nimport { TransactionWorkerEvents, TransactionWorker, TransactionWorkerEventsEnum } from \"../../transactions/management\";\nimport { InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from \"../../transactions\";\nimport { AptosConfig } from \"../aptosConfig\";\nimport { Account } from \"../../account\";\n\nexport class TransactionManagement extends EventEmitter<TransactionWorkerEvents> {\n account!: Account;\n\n transactionWorker!: TransactionWorker;\n\n readonly config: AptosConfig;\n\n /**\n * Initializes a new instance of the Aptos client with the provided configuration settings.\n * This allows you to interact with the Aptos blockchain using the specified network and options.\n *\n * @param config - The configuration settings for the Aptos client.\n * @param config.network - The network to connect to (e.g., TESTNET, MAINNET).\n * @param config.nodeUrl - The URL of the Aptos node to connect to.\n * @param config.account - Optional account settings for authentication.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * async function runExample() {\n * // Create a configuration for the Aptos client\n * const config = new AptosConfig({\n * network: Network.TESTNET, // specify the network to use\n * nodeUrl: \"https://testnet.aptos.dev\" // replace with your node URL\n * });\n *\n * // Initialize the Aptos client with the configuration\n * const aptos = new Aptos(config);\n *\n * console.log(\"Aptos client initialized successfully.\");\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\n constructor(config: AptosConfig) {\n super();\n this.config = config;\n }\n\n /**\n * Initializes the transaction worker using the provided sender account and begins listening for events.\n * This function is essential for setting up the transaction processing environment.\n *\n * @param args - The arguments for starting the transaction worker.\n * @param args.sender - The sender account to sign and submit the transaction.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network, Account } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * const sender = Account.generate(); // Generate a new account for sending transactions\n *\n * // Start the transaction worker with the sender account\n * aptos.start({ sender });\n *\n * console.log(\"Transaction worker started with sender:\", sender.accountAddress);\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\n private start(args: { sender: Account }): void {\n const { sender } = args;\n this.account = sender;\n this.transactionWorker = new TransactionWorker(this.config, sender);\n\n this.transactionWorker.start();\n this.registerToEvents();\n }\n\n /**\n * Pushes transaction data to the transaction worker for processing.\n *\n * @param args.data An array of transaction payloads to be processed.\n * @param args.options Optional. Transaction generation configurations (excluding accountSequenceNumber).\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Prepare transaction payloads\n * const payloads = [\n * {}, // Build your first transaction payload\n * {}, // Build your second transaction payload\n * ];\n *\n * // Push transaction data to the worker\n * aptos.push({\n * data: payloads,\n * {}, // Specify options as needed\n * });\n *\n * console.log(\"Transaction data pushed successfully.\");\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\n private push(args: {\n data: InputGenerateTransactionPayloadData[];\n options?: Omit<InputGenerateTransactionOptions, \"accountSequenceNumber\">;\n }): void {\n const { data, options } = args;\n\n for (const d of data) {\n this.transactionWorker.push(d, options);\n }\n }\n\n /**\n * Starts listening to transaction worker events, allowing the application to respond to transaction status changes.\n * This function enables the application to handle events such as transaction sent, execution success, or failure.\n *\n * @example\n * ```typescript\n * import { Aptos, AptosConfig, Network } from \"@aptos-labs/ts-sdk\";\n *\n * const config = new AptosConfig({ network: Network.TESTNET });\n * const aptos = new Aptos(config);\n *\n * async function runExample() {\n * // Register to listen for transaction events\n * aptos.registerToEvents();\n *\n * // You can send a transaction here to see the events in action\n * const sender = Account.generate(); // replace with a real account\n * const destination = Account.generate(); // replace with a real account\n *\n * const transaction = await aptos.transaction.build.simple({\n * sender: sender.accountAddress,\n * data: {\n * function: \"0x1::aptos_account::transfer\",\n * functionArguments: [destination.accountAddress, 100],\n * },\n * });\n *\n * await aptos.transaction.send(transaction);\n *\n * console.log(\"Transaction sent and events registered.\");\n * }\n * runExample().catch(console.error);\n * ```\n * @group Implementation\n */\n private registerToEvents() {\n // TODO - Should we ask events to listen to this as an input?\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionSent, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionSent, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionSendFailed, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionSendFailed, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionExecuted, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionExecuted, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.TransactionExecutionFailed, async (data) => {\n this.emit(TransactionWorkerEventsEnum.TransactionExecutionFailed, data);\n });\n this.transactionWorker.on(TransactionWorkerEventsEnum.ExecutionFinish, async (data) => {\n this.emit(TransactionWorkerEventsEnum.ExecutionFinish, data);\n });\n }\n\n /**\n * Send batch transactions for a single account.\n *\n * This function uses a transaction worker that receives payloads to be processed\n * and submitted to chain.\n * Note that this process is best for submitting multiple transactions that\n * don't rely on each other, i.e. batch funds, batch token mints, etc.\n *\n * If any worker failure, the functions throws an error.\n *\n * @param args.sender The sender account to sign and submit the transaction\n * @param args.data An array of transaction payloads\n * @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)\n *\n * @return void. Throws if any error\n * @group Implementation\n */\n forSingleAccount(args: {\n sender: Account;\n data: InputGenerateTransactionPayloadData[];\n options?: Omit<InputGenerateTransactionOptions, \"accountSequenceNumber\">;\n }): void {\n try {\n const { sender, data, options } = args;\n this.start({ sender });\n\n this.push({ data, options });\n } catch (error: any) {\n throw new Error(`failed to submit transactions with error: ${error}`);\n }\n }\n}\n"],"mappings":";;;;;AAAA,OAAO,kBAAkB;AAMlB,IAAM,wBAAN,cAAoC,aAAsC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoC/E,YAAY,QAAqB;AAC/B,UAAM;AACN,SAAK,SAAS;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA4BQ,MAAM,MAAiC;AAC7C,UAAM,EAAE,OAAO,IAAI;AACnB,SAAK,UAAU;AACf,SAAK,oBAAoB,IAAI,kBAAkB,KAAK,QAAQ,MAAM;AAElE,SAAK,kBAAkB,MAAM;AAC7B,SAAK,iBAAiB;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AA,EACF;AACF;","names":[]}
|
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AbstractMultiKey
|
|
3
|
-
} from "./chunk-DMFRIING.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Ed25519PublicKey,
|
|
6
|
-
Ed25519Signature
|
|
7
|
-
} from "./chunk-TFW6N66T.mjs";
|
|
8
|
-
import {
|
|
9
|
-
Signature
|
|
10
|
-
} from "./chunk-KLUO6XPE.mjs";
|
|
11
|
-
import {
|
|
12
|
-
AuthenticationKey
|
|
13
|
-
} from "./chunk-PKUXOBIV.mjs";
|
|
14
|
-
|
|
15
|
-
// src/core/crypto/multiEd25519.ts
|
|
16
|
-
var _MultiEd25519PublicKey = class _MultiEd25519PublicKey extends AbstractMultiKey {
|
|
17
|
-
/**
|
|
18
|
-
* Public key for a K-of-N multi-sig transaction. A K-of-N multi-sig transaction means that for such a
|
|
19
|
-
* transaction to be executed, at least K out of the N authorized signers have signed the transaction
|
|
20
|
-
* and passed the check conducted by the chain.
|
|
21
|
-
*
|
|
22
|
-
* @see {@link
|
|
23
|
-
* https://aptos.dev/integration/creating-a-signed-transaction/ | Creating a Signed Transaction}
|
|
24
|
-
* @param args - A wrapper to let you choose the param order.
|
|
25
|
-
* @param args.publicKeys A list of public keys
|
|
26
|
-
* @param args.threshold At least "threshold" signatures must be valid
|
|
27
|
-
* @group Implementation
|
|
28
|
-
* @category Serialization
|
|
29
|
-
*/
|
|
30
|
-
constructor(args) {
|
|
31
|
-
const { publicKeys, threshold } = args;
|
|
32
|
-
super({ publicKeys });
|
|
33
|
-
if (publicKeys.length > _MultiEd25519PublicKey.MAX_KEYS || publicKeys.length < _MultiEd25519PublicKey.MIN_KEYS) {
|
|
34
|
-
throw new Error(
|
|
35
|
-
`Must have between ${_MultiEd25519PublicKey.MIN_KEYS} and ${_MultiEd25519PublicKey.MAX_KEYS} public keys, inclusive`
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
if (threshold < _MultiEd25519PublicKey.MIN_THRESHOLD || threshold > publicKeys.length) {
|
|
39
|
-
throw new Error(
|
|
40
|
-
`Threshold must be between ${_MultiEd25519PublicKey.MIN_THRESHOLD} and ${publicKeys.length}, inclusive`
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
this.publicKeys = publicKeys;
|
|
44
|
-
this.threshold = threshold;
|
|
45
|
-
}
|
|
46
|
-
// region AccountPublicKey
|
|
47
|
-
/**
|
|
48
|
-
* Verifies a multi-signature against a given message.
|
|
49
|
-
* This function ensures that the provided signatures meet the required threshold and are valid for the given message.
|
|
50
|
-
*
|
|
51
|
-
* @param args - The arguments for verifying the signature.
|
|
52
|
-
* @param args.message - The message that was signed.
|
|
53
|
-
* @param args.signature - The multi-signature containing multiple signatures and a bitmap indicating which signatures are valid.
|
|
54
|
-
* @returns True if the signature is valid; otherwise, false.
|
|
55
|
-
* @throws Error if the bitmap and signatures length mismatch or if there are not enough valid signatures.
|
|
56
|
-
* @group Implementation
|
|
57
|
-
* @category Serialization
|
|
58
|
-
*/
|
|
59
|
-
verifySignature(args) {
|
|
60
|
-
const { message, signature } = args;
|
|
61
|
-
if (!(signature instanceof MultiEd25519Signature)) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
const indices = [];
|
|
65
|
-
for (let i = 0; i < 4; i += 1) {
|
|
66
|
-
for (let j = 0; j < 8; j += 1) {
|
|
67
|
-
const bitIsSet = (signature.bitmap[i] & 1 << 7 - j) !== 0;
|
|
68
|
-
if (bitIsSet) {
|
|
69
|
-
const index = i * 8 + j;
|
|
70
|
-
indices.push(index);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
if (indices.length !== signature.signatures.length) {
|
|
75
|
-
throw new Error("Bitmap and signatures length mismatch");
|
|
76
|
-
}
|
|
77
|
-
if (indices.length < this.threshold) {
|
|
78
|
-
throw new Error("Not enough signatures");
|
|
79
|
-
}
|
|
80
|
-
for (let i = 0; i < indices.length; i += 1) {
|
|
81
|
-
const publicKey = this.publicKeys[indices[i]];
|
|
82
|
-
if (!publicKey.verifySignature({ message, signature: signature.signatures[i] })) {
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Generates an authentication key based on the current instance's byte representation.
|
|
90
|
-
* This function is essential for creating a secure authentication key that can be used for various cryptographic operations.
|
|
91
|
-
*
|
|
92
|
-
* @returns {AuthenticationKey} The generated authentication key.
|
|
93
|
-
* @group Implementation
|
|
94
|
-
* @category Serialization
|
|
95
|
-
*/
|
|
96
|
-
authKey() {
|
|
97
|
-
return AuthenticationKey.fromSchemeAndBytes({
|
|
98
|
-
scheme: 1 /* MultiEd25519 */,
|
|
99
|
-
input: this.toUint8Array()
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Converts a PublicKeys into Uint8Array (bytes) with: bytes = p1_bytes | ... | pn_bytes | threshold
|
|
104
|
-
* @group Implementation
|
|
105
|
-
* @category Serialization
|
|
106
|
-
*/
|
|
107
|
-
toUint8Array() {
|
|
108
|
-
const bytes = new Uint8Array(this.publicKeys.length * Ed25519PublicKey.LENGTH + 1);
|
|
109
|
-
this.publicKeys.forEach((k, i) => {
|
|
110
|
-
bytes.set(k.toUint8Array(), i * Ed25519PublicKey.LENGTH);
|
|
111
|
-
});
|
|
112
|
-
bytes[this.publicKeys.length * Ed25519PublicKey.LENGTH] = this.threshold;
|
|
113
|
-
return bytes;
|
|
114
|
-
}
|
|
115
|
-
// endregion
|
|
116
|
-
// region Serializable
|
|
117
|
-
/**
|
|
118
|
-
* Serializes the current instance into bytes using the provided serializer.
|
|
119
|
-
* This allows for the conversion of the instance's data into a format suitable for transmission or storage.
|
|
120
|
-
*
|
|
121
|
-
* @param serializer - The serializer used to convert the instance into bytes.
|
|
122
|
-
* @group Implementation
|
|
123
|
-
* @category Serialization
|
|
124
|
-
*/
|
|
125
|
-
serialize(serializer) {
|
|
126
|
-
serializer.serializeBytes(this.toUint8Array());
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Deserializes a MultiEd25519Signature from the provided deserializer.
|
|
130
|
-
* This function helps in reconstructing a MultiEd25519Signature object from its serialized byte representation.
|
|
131
|
-
*
|
|
132
|
-
* @param deserializer - The deserializer instance used to read the serialized data.
|
|
133
|
-
* @group Implementation
|
|
134
|
-
* @category Serialization
|
|
135
|
-
*/
|
|
136
|
-
static deserialize(deserializer) {
|
|
137
|
-
const bytes = deserializer.deserializeBytes();
|
|
138
|
-
const threshold = bytes[bytes.length - 1];
|
|
139
|
-
const keys = [];
|
|
140
|
-
for (let i = 0; i < bytes.length - 1; i += Ed25519PublicKey.LENGTH) {
|
|
141
|
-
const begin = i;
|
|
142
|
-
keys.push(new Ed25519PublicKey(bytes.subarray(begin, begin + Ed25519PublicKey.LENGTH)));
|
|
143
|
-
}
|
|
144
|
-
return new _MultiEd25519PublicKey({ publicKeys: keys, threshold });
|
|
145
|
-
}
|
|
146
|
-
// endregion
|
|
147
|
-
/**
|
|
148
|
-
* Get the index of the provided public key.
|
|
149
|
-
*
|
|
150
|
-
* This function retrieves the index of a specified public key within the MultiKey.
|
|
151
|
-
* If the public key does not exist, it throws an error.
|
|
152
|
-
*
|
|
153
|
-
* @param publicKey - The public key to find the index for.
|
|
154
|
-
* @returns The corresponding index of the public key, if it exists.
|
|
155
|
-
* @throws Error - If the public key is not found in the MultiKey.
|
|
156
|
-
* @group Implementation
|
|
157
|
-
*/
|
|
158
|
-
getIndex(publicKey) {
|
|
159
|
-
return super.getIndex(publicKey);
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
/**
|
|
163
|
-
* Maximum number of public keys supported
|
|
164
|
-
* @group Implementation
|
|
165
|
-
* @category Serialization
|
|
166
|
-
*/
|
|
167
|
-
_MultiEd25519PublicKey.MAX_KEYS = 32;
|
|
168
|
-
/**
|
|
169
|
-
* Minimum number of public keys needed
|
|
170
|
-
* @group Implementation
|
|
171
|
-
* @category Serialization
|
|
172
|
-
*/
|
|
173
|
-
_MultiEd25519PublicKey.MIN_KEYS = 2;
|
|
174
|
-
/**
|
|
175
|
-
* Minimum threshold for the number of valid signatures required
|
|
176
|
-
* @group Implementation
|
|
177
|
-
* @category Serialization
|
|
178
|
-
*/
|
|
179
|
-
_MultiEd25519PublicKey.MIN_THRESHOLD = 1;
|
|
180
|
-
var MultiEd25519PublicKey = _MultiEd25519PublicKey;
|
|
181
|
-
var _MultiEd25519Signature = class _MultiEd25519Signature extends Signature {
|
|
182
|
-
/**
|
|
183
|
-
* Signature for a K-of-N multi-sig transaction.
|
|
184
|
-
*
|
|
185
|
-
* @see {@link
|
|
186
|
-
* https://aptos.dev/integration/creating-a-signed-transaction/#multisignature-transactions | Creating a Signed Transaction}
|
|
187
|
-
*
|
|
188
|
-
* @param args.signatures A list of signatures
|
|
189
|
-
* @param args.bitmap 4 bytes, at most 32 signatures are supported. If Nth bit value is `1`, the Nth
|
|
190
|
-
* signature should be provided in `signatures`. Bits are read from left to right.
|
|
191
|
-
* Alternatively, you can specify an array of bitmap positions.
|
|
192
|
-
* Valid position should range between 0 and 31.
|
|
193
|
-
* @see MultiEd25519Signature.createBitmap
|
|
194
|
-
* @group Implementation
|
|
195
|
-
* @category Serialization
|
|
196
|
-
*/
|
|
197
|
-
constructor(args) {
|
|
198
|
-
super();
|
|
199
|
-
const { signatures, bitmap } = args;
|
|
200
|
-
if (signatures.length > _MultiEd25519Signature.MAX_SIGNATURES_SUPPORTED) {
|
|
201
|
-
throw new Error(
|
|
202
|
-
`The number of signatures cannot be greater than ${_MultiEd25519Signature.MAX_SIGNATURES_SUPPORTED}`
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
this.signatures = signatures;
|
|
206
|
-
if (!(bitmap instanceof Uint8Array)) {
|
|
207
|
-
this.bitmap = _MultiEd25519Signature.createBitmap({ bits: bitmap });
|
|
208
|
-
} else if (bitmap.length !== _MultiEd25519Signature.BITMAP_LEN) {
|
|
209
|
-
throw new Error(`"bitmap" length should be ${_MultiEd25519Signature.BITMAP_LEN}`);
|
|
210
|
-
} else {
|
|
211
|
-
this.bitmap = bitmap;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
// region AccountSignature
|
|
215
|
-
/**
|
|
216
|
-
* Converts a MultiSignature into Uint8Array (bytes) with `bytes = s1_bytes | ... | sn_bytes | bitmap`
|
|
217
|
-
* @group Implementation
|
|
218
|
-
* @category Serialization
|
|
219
|
-
*/
|
|
220
|
-
toUint8Array() {
|
|
221
|
-
const bytes = new Uint8Array(this.signatures.length * Ed25519Signature.LENGTH + _MultiEd25519Signature.BITMAP_LEN);
|
|
222
|
-
this.signatures.forEach((k, i) => {
|
|
223
|
-
bytes.set(k.toUint8Array(), i * Ed25519Signature.LENGTH);
|
|
224
|
-
});
|
|
225
|
-
bytes.set(this.bitmap, this.signatures.length * Ed25519Signature.LENGTH);
|
|
226
|
-
return bytes;
|
|
227
|
-
}
|
|
228
|
-
// endregion
|
|
229
|
-
// region Serializable
|
|
230
|
-
serialize(serializer) {
|
|
231
|
-
serializer.serializeBytes(this.toUint8Array());
|
|
232
|
-
}
|
|
233
|
-
static deserialize(deserializer) {
|
|
234
|
-
const bytes = deserializer.deserializeBytes();
|
|
235
|
-
const bitmap = bytes.subarray(bytes.length - 4);
|
|
236
|
-
const signatures = [];
|
|
237
|
-
for (let i = 0; i < bytes.length - bitmap.length; i += Ed25519Signature.LENGTH) {
|
|
238
|
-
const begin = i;
|
|
239
|
-
signatures.push(new Ed25519Signature(bytes.subarray(begin, begin + Ed25519Signature.LENGTH)));
|
|
240
|
-
}
|
|
241
|
-
return new _MultiEd25519Signature({ signatures, bitmap });
|
|
242
|
-
}
|
|
243
|
-
// endregion
|
|
244
|
-
/**
|
|
245
|
-
* Helper method to create a bitmap out of the specified bit positions.
|
|
246
|
-
* This function allows you to set specific bits in a 32-bit long bitmap based on the provided positions.
|
|
247
|
-
*
|
|
248
|
-
* @param args The arguments for creating the bitmap.
|
|
249
|
-
* @param args.bits The bitmap positions that should be set. A position starts at index 0. Valid positions should range between 0 and 31.
|
|
250
|
-
*
|
|
251
|
-
* @example
|
|
252
|
-
* Here's an example of valid `bits`
|
|
253
|
-
* ```
|
|
254
|
-
* [0, 2, 31]
|
|
255
|
-
* ```
|
|
256
|
-
* `[0, 2, 31]` means the 1st, 3rd and 32nd bits should be set in the bitmap.
|
|
257
|
-
* The result bitmap should be 0b1010000000000000000000000000001
|
|
258
|
-
*
|
|
259
|
-
* @returns bitmap that is 32 bits long.
|
|
260
|
-
* @group Implementation
|
|
261
|
-
* @category Serialization
|
|
262
|
-
*/
|
|
263
|
-
static createBitmap(args) {
|
|
264
|
-
const { bits } = args;
|
|
265
|
-
const firstBitInByte = 128;
|
|
266
|
-
const bitmap = new Uint8Array([0, 0, 0, 0]);
|
|
267
|
-
const dupCheckSet = /* @__PURE__ */ new Set();
|
|
268
|
-
bits.forEach((bit, index) => {
|
|
269
|
-
if (bit >= _MultiEd25519Signature.MAX_SIGNATURES_SUPPORTED) {
|
|
270
|
-
throw new Error(`Cannot have a signature larger than ${_MultiEd25519Signature.MAX_SIGNATURES_SUPPORTED - 1}.`);
|
|
271
|
-
}
|
|
272
|
-
if (dupCheckSet.has(bit)) {
|
|
273
|
-
throw new Error("Duplicate bits detected.");
|
|
274
|
-
}
|
|
275
|
-
if (index > 0 && bit <= bits[index - 1]) {
|
|
276
|
-
throw new Error("The bits need to be sorted in ascending order.");
|
|
277
|
-
}
|
|
278
|
-
dupCheckSet.add(bit);
|
|
279
|
-
const byteOffset = Math.floor(bit / 8);
|
|
280
|
-
let byte = bitmap[byteOffset];
|
|
281
|
-
byte |= firstBitInByte >> bit % 8;
|
|
282
|
-
bitmap[byteOffset] = byte;
|
|
283
|
-
});
|
|
284
|
-
return bitmap;
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
|
-
/**
|
|
288
|
-
* Maximum number of Ed25519 signatures supported
|
|
289
|
-
* @group Implementation
|
|
290
|
-
* @category Serialization
|
|
291
|
-
*/
|
|
292
|
-
_MultiEd25519Signature.MAX_SIGNATURES_SUPPORTED = 32;
|
|
293
|
-
/**
|
|
294
|
-
* Number of bytes in the bitmap representing who signed the transaction (32-bits)
|
|
295
|
-
* @group Implementation
|
|
296
|
-
* @category Serialization
|
|
297
|
-
*/
|
|
298
|
-
_MultiEd25519Signature.BITMAP_LEN = 4;
|
|
299
|
-
var MultiEd25519Signature = _MultiEd25519Signature;
|
|
300
|
-
|
|
301
|
-
export {
|
|
302
|
-
MultiEd25519PublicKey,
|
|
303
|
-
MultiEd25519Signature
|
|
304
|
-
};
|
|
305
|
-
//# sourceMappingURL=chunk-3TUV6YMI.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/crypto/multiEd25519.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Deserializer, Serializer } from \"../../bcs\";\nimport { SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"./ed25519\";\nimport { AbstractMultiKey } from \"./multiKey\";\nimport { VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\n\n/**\n * Represents the public key of a K-of-N Ed25519 multi-sig transaction.\n *\n * A K-of-N multi-sig transaction requires at least K out of N authorized signers to sign the transaction\n * for it to be executed. This class encapsulates the logic for managing the public keys and the threshold\n * for valid signatures.\n *\n * @see {@link https://aptos.dev/integration/creating-a-signed-transaction/ | Creating a Signed Transaction}\n * @group Implementation\n * @category Serialization\n */\nexport class MultiEd25519PublicKey extends AbstractMultiKey {\n /**\n * Maximum number of public keys supported\n * @group Implementation\n * @category Serialization\n */\n static readonly MAX_KEYS = 32;\n\n /**\n * Minimum number of public keys needed\n * @group Implementation\n * @category Serialization\n */\n static readonly MIN_KEYS = 2;\n\n /**\n * Minimum threshold for the number of valid signatures required\n * @group Implementation\n * @category Serialization\n */\n static readonly MIN_THRESHOLD = 1;\n\n /**\n * List of Ed25519 public keys for this LegacyMultiEd25519PublicKey\n * @group Implementation\n * @category Serialization\n */\n public readonly publicKeys: Ed25519PublicKey[];\n\n /**\n * The minimum number of valid signatures required, for the number of public keys specified\n * @group Implementation\n * @category Serialization\n */\n public readonly threshold: number;\n\n /**\n * Public key for a K-of-N multi-sig transaction. A K-of-N multi-sig transaction means that for such a\n * transaction to be executed, at least K out of the N authorized signers have signed the transaction\n * and passed the check conducted by the chain.\n *\n * @see {@link\n * https://aptos.dev/integration/creating-a-signed-transaction/ | Creating a Signed Transaction}\n * @param args - A wrapper to let you choose the param order.\n * @param args.publicKeys A list of public keys\n * @param args.threshold At least \"threshold\" signatures must be valid\n * @group Implementation\n * @category Serialization\n */\n constructor(args: { publicKeys: Ed25519PublicKey[]; threshold: number }) {\n const { publicKeys, threshold } = args;\n super({ publicKeys });\n\n // Validate number of public keys\n if (publicKeys.length > MultiEd25519PublicKey.MAX_KEYS || publicKeys.length < MultiEd25519PublicKey.MIN_KEYS) {\n throw new Error(\n `Must have between ${MultiEd25519PublicKey.MIN_KEYS} and ` +\n `${MultiEd25519PublicKey.MAX_KEYS} public keys, inclusive`,\n );\n }\n\n // Validate threshold: must be between 1 and the number of public keys, inclusive\n if (threshold < MultiEd25519PublicKey.MIN_THRESHOLD || threshold > publicKeys.length) {\n throw new Error(\n `Threshold must be between ${MultiEd25519PublicKey.MIN_THRESHOLD} and ${publicKeys.length}, inclusive`,\n );\n }\n\n this.publicKeys = publicKeys;\n this.threshold = threshold;\n }\n\n // region AccountPublicKey\n\n /**\n * Verifies a multi-signature against a given message.\n * This function ensures that the provided signatures meet the required threshold and are valid for the given message.\n *\n * @param args - The arguments for verifying the signature.\n * @param args.message - The message that was signed.\n * @param args.signature - The multi-signature containing multiple signatures and a bitmap indicating which signatures are valid.\n * @returns True if the signature is valid; otherwise, false.\n * @throws Error if the bitmap and signatures length mismatch or if there are not enough valid signatures.\n * @group Implementation\n * @category Serialization\n */\n verifySignature(args: VerifySignatureArgs): boolean {\n const { message, signature } = args;\n if (!(signature instanceof MultiEd25519Signature)) {\n return false;\n }\n\n const indices: number[] = [];\n for (let i = 0; i < 4; i += 1) {\n for (let j = 0; j < 8; j += 1) {\n // eslint-disable-next-line no-bitwise\n const bitIsSet = (signature.bitmap[i] & (1 << (7 - j))) !== 0;\n if (bitIsSet) {\n const index = i * 8 + j;\n indices.push(index);\n }\n }\n }\n\n if (indices.length !== signature.signatures.length) {\n throw new Error(\"Bitmap and signatures length mismatch\");\n }\n\n if (indices.length < this.threshold) {\n throw new Error(\"Not enough signatures\");\n }\n\n for (let i = 0; i < indices.length; i += 1) {\n const publicKey = this.publicKeys[indices[i]];\n if (!publicKey.verifySignature({ message, signature: signature.signatures[i] })) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Generates an authentication key based on the current instance's byte representation.\n * This function is essential for creating a secure authentication key that can be used for various cryptographic operations.\n *\n * @returns {AuthenticationKey} The generated authentication key.\n * @group Implementation\n * @category Serialization\n */\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.MultiEd25519,\n input: this.toUint8Array(),\n });\n }\n\n /**\n * Converts a PublicKeys into Uint8Array (bytes) with: bytes = p1_bytes | ... | pn_bytes | threshold\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n const bytes = new Uint8Array(this.publicKeys.length * Ed25519PublicKey.LENGTH + 1);\n this.publicKeys.forEach((k: Ed25519PublicKey, i: number) => {\n bytes.set(k.toUint8Array(), i * Ed25519PublicKey.LENGTH);\n });\n\n bytes[this.publicKeys.length * Ed25519PublicKey.LENGTH] = this.threshold;\n\n return bytes;\n }\n\n // endregion\n\n // region Serializable\n\n /**\n * Serializes the current instance into bytes using the provided serializer.\n * This allows for the conversion of the instance's data into a format suitable for transmission or storage.\n *\n * @param serializer - The serializer used to convert the instance into bytes.\n * @group Implementation\n * @category Serialization\n */\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.toUint8Array());\n }\n\n /**\n * Deserializes a MultiEd25519Signature from the provided deserializer.\n * This function helps in reconstructing a MultiEd25519Signature object from its serialized byte representation.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n * @group Implementation\n * @category Serialization\n */\n static deserialize(deserializer: Deserializer): MultiEd25519PublicKey {\n const bytes = deserializer.deserializeBytes();\n const threshold = bytes[bytes.length - 1];\n\n const keys: Ed25519PublicKey[] = [];\n\n for (let i = 0; i < bytes.length - 1; i += Ed25519PublicKey.LENGTH) {\n const begin = i;\n keys.push(new Ed25519PublicKey(bytes.subarray(begin, begin + Ed25519PublicKey.LENGTH)));\n }\n return new MultiEd25519PublicKey({ publicKeys: keys, threshold });\n }\n\n // endregion\n\n /**\n * Get the index of the provided public key.\n *\n * This function retrieves the index of a specified public key within the MultiKey.\n * If the public key does not exist, it throws an error.\n *\n * @param publicKey - The public key to find the index for.\n * @returns The corresponding index of the public key, if it exists.\n * @throws Error - If the public key is not found in the MultiKey.\n * @group Implementation\n */\n getIndex(publicKey: Ed25519PublicKey): number {\n return super.getIndex(publicKey);\n }\n}\n\n/**\n * Represents the signature of a K-of-N Ed25519 multi-sig transaction.\n *\n * @see {@link https://aptos.dev/integration/creating-a-signed-transaction/#multisignature-transactions | Creating a Signed Transaction}\n * @group Implementation\n * @category Serialization\n */\nexport class MultiEd25519Signature extends Signature {\n /**\n * Maximum number of Ed25519 signatures supported\n * @group Implementation\n * @category Serialization\n */\n static MAX_SIGNATURES_SUPPORTED = 32;\n\n /**\n * Number of bytes in the bitmap representing who signed the transaction (32-bits)\n * @group Implementation\n * @category Serialization\n */\n static BITMAP_LEN: number = 4;\n\n /**\n * The list of underlying Ed25519 signatures\n * @group Implementation\n * @category Serialization\n */\n public readonly signatures: Ed25519Signature[];\n\n /**\n * 32-bit Bitmap representing who signed the transaction\n *\n * This is represented where each public key can be masked to determine whether the message was signed by that key.\n * @group Implementation\n * @category Serialization\n */\n public readonly bitmap: Uint8Array;\n\n /**\n * Signature for a K-of-N multi-sig transaction.\n *\n * @see {@link\n * https://aptos.dev/integration/creating-a-signed-transaction/#multisignature-transactions | Creating a Signed Transaction}\n *\n * @param args.signatures A list of signatures\n * @param args.bitmap 4 bytes, at most 32 signatures are supported. If Nth bit value is `1`, the Nth\n * signature should be provided in `signatures`. Bits are read from left to right.\n * Alternatively, you can specify an array of bitmap positions.\n * Valid position should range between 0 and 31.\n * @see MultiEd25519Signature.createBitmap\n * @group Implementation\n * @category Serialization\n */\n constructor(args: { signatures: Ed25519Signature[]; bitmap: Uint8Array | number[] }) {\n super();\n const { signatures, bitmap } = args;\n\n if (signatures.length > MultiEd25519Signature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(\n `The number of signatures cannot be greater than ${MultiEd25519Signature.MAX_SIGNATURES_SUPPORTED}`,\n );\n }\n this.signatures = signatures;\n\n if (!(bitmap instanceof Uint8Array)) {\n this.bitmap = MultiEd25519Signature.createBitmap({ bits: bitmap });\n } else if (bitmap.length !== MultiEd25519Signature.BITMAP_LEN) {\n throw new Error(`\"bitmap\" length should be ${MultiEd25519Signature.BITMAP_LEN}`);\n } else {\n this.bitmap = bitmap;\n }\n }\n\n // region AccountSignature\n\n /**\n * Converts a MultiSignature into Uint8Array (bytes) with `bytes = s1_bytes | ... | sn_bytes | bitmap`\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n const bytes = new Uint8Array(this.signatures.length * Ed25519Signature.LENGTH + MultiEd25519Signature.BITMAP_LEN);\n this.signatures.forEach((k: Ed25519Signature, i: number) => {\n bytes.set(k.toUint8Array(), i * Ed25519Signature.LENGTH);\n });\n\n bytes.set(this.bitmap, this.signatures.length * Ed25519Signature.LENGTH);\n\n return bytes;\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): MultiEd25519Signature {\n const bytes = deserializer.deserializeBytes();\n const bitmap = bytes.subarray(bytes.length - 4);\n\n const signatures: Ed25519Signature[] = [];\n\n for (let i = 0; i < bytes.length - bitmap.length; i += Ed25519Signature.LENGTH) {\n const begin = i;\n signatures.push(new Ed25519Signature(bytes.subarray(begin, begin + Ed25519Signature.LENGTH)));\n }\n return new MultiEd25519Signature({ signatures, bitmap });\n }\n\n // endregion\n\n /**\n * Helper method to create a bitmap out of the specified bit positions.\n * This function allows you to set specific bits in a 32-bit long bitmap based on the provided positions.\n *\n * @param args The arguments for creating the bitmap.\n * @param args.bits The bitmap positions that should be set. A position starts at index 0. Valid positions should range between 0 and 31.\n *\n * @example\n * Here's an example of valid `bits`\n * ```\n * [0, 2, 31]\n * ```\n * `[0, 2, 31]` means the 1st, 3rd and 32nd bits should be set in the bitmap.\n * The result bitmap should be 0b1010000000000000000000000000001\n *\n * @returns bitmap that is 32 bits long.\n * @group Implementation\n * @category Serialization\n */\n static createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number, index) => {\n if (bit >= MultiEd25519Signature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`Cannot have a signature larger than ${MultiEd25519Signature.MAX_SIGNATURES_SUPPORTED - 1}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(\"Duplicate bits detected.\");\n }\n\n if (index > 0 && bit <= bits[index - 1]) {\n throw new Error(\"The bits need to be sorted in ascending order.\");\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\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cAAM,IAAI,MAAM,gDAAgD;AAAA,MAClE;AAEA,kBAAY,IAAI,GAAG;AAEnB,YAAM,aAAa,KAAK,MAAM,MAAM,CAAC;AAErC,UAAI,OAAO,OAAO,UAAU;AAG5B,cAAQ,kBAAkB,MAAM;AAEhC,aAAO,UAAU,IAAI;AAAA,IACvB,CAAC;AAED,WAAO;AAAA,EACT;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAnKa,uBAMJ,2BAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AANvB,uBAaJ,aAAqB;AAbvB,IAAM,wBAAN;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-4NMDYPUD.mjs.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AccountAddress
|
|
3
|
-
} from "./chunk-CXLXUSCG.mjs";
|
|
4
|
-
import {
|
|
5
|
-
SigningScheme
|
|
6
|
-
} from "./chunk-SQNS4SFV.mjs";
|
|
7
|
-
|
|
8
|
-
// src/account/utils.ts
|
|
9
|
-
function deserializeSchemeAndAddress(deserializer) {
|
|
10
|
-
const signingScheme = deserializer.deserializeUleb128AsU32();
|
|
11
|
-
if (!Object.values(SigningScheme).includes(signingScheme)) {
|
|
12
|
-
throw new Error(`Deserialization of Account failed: SigningScheme variant ${signingScheme} is invalid`);
|
|
13
|
-
}
|
|
14
|
-
const address = AccountAddress.deserialize(deserializer);
|
|
15
|
-
return { address, signingScheme };
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
deserializeSchemeAndAddress
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=chunk-56UCIGTO.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/account/utils.ts"],"sourcesContent":["import { SigningScheme } from \"../types\";\nimport { AccountAddress } from \"../core\";\nimport { Deserializer } from \"../bcs/deserializer\";\n\nexport function deserializeSchemeAndAddress(deserializer: Deserializer): {\n address: AccountAddress;\n signingScheme: SigningScheme;\n} {\n const signingScheme = deserializer.deserializeUleb128AsU32();\n // Validate that signingScheme is a valid SigningScheme value\n if (!Object.values(SigningScheme).includes(signingScheme)) {\n throw new Error(`Deserialization of Account failed: SigningScheme variant ${signingScheme} is invalid`);\n }\n const address = AccountAddress.deserialize(deserializer);\n return { address, signingScheme };\n}\n"],"mappings":";;;;;;;;AAIO,SAAS,4BAA4B,cAG1C;AACA,QAAM,gBAAgB,aAAa,wBAAwB;AAE3D,MAAI,CAAC,OAAO,OAAO,aAAa,EAAE,SAAS,aAAa,GAAG;AACzD,UAAM,IAAI,MAAM,4DAA4D,aAAa,aAAa;AAAA,EACxG;AACA,QAAM,UAAU,eAAe,YAAY,YAAY;AACvD,SAAO,EAAE,SAAS,cAAc;AAClC;","names":[]}
|