@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,49 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AccountPublicKey
|
|
3
|
-
} from "./chunk-R4JTQQBX.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Signature
|
|
6
|
-
} from "./chunk-KLUO6XPE.mjs";
|
|
7
|
-
import {
|
|
8
|
-
AuthenticationKey
|
|
9
|
-
} from "./chunk-PKUXOBIV.mjs";
|
|
10
|
-
import {
|
|
11
|
-
Hex
|
|
12
|
-
} from "./chunk-BDM6FBUO.mjs";
|
|
13
|
-
|
|
14
|
-
// src/core/crypto/abstraction.ts
|
|
15
|
-
var AbstractSignature = class _AbstractSignature extends Signature {
|
|
16
|
-
constructor(value) {
|
|
17
|
-
super();
|
|
18
|
-
this.value = Hex.fromHexInput(value);
|
|
19
|
-
}
|
|
20
|
-
serialize(serializer) {
|
|
21
|
-
serializer.serializeBytes(this.value.toUint8Array());
|
|
22
|
-
}
|
|
23
|
-
static deserialize(deserializer) {
|
|
24
|
-
return new _AbstractSignature(deserializer.deserializeBytes());
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
var AbstractPublicKey = class extends AccountPublicKey {
|
|
28
|
-
constructor(accountAddress) {
|
|
29
|
-
super();
|
|
30
|
-
this.accountAddress = accountAddress;
|
|
31
|
-
}
|
|
32
|
-
authKey() {
|
|
33
|
-
return new AuthenticationKey({ data: this.accountAddress.toUint8Array() });
|
|
34
|
-
}
|
|
35
|
-
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars
|
|
36
|
-
verifySignature(args) {
|
|
37
|
-
throw new Error("This function is not implemented for AbstractPublicKey.");
|
|
38
|
-
}
|
|
39
|
-
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars
|
|
40
|
-
serialize(serializer) {
|
|
41
|
-
throw new Error("This function is not implemented for AbstractPublicKey.");
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export {
|
|
46
|
-
AbstractSignature,
|
|
47
|
-
AbstractPublicKey
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=chunk-AKXCFBYF.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/crypto/abstraction.ts"],"sourcesContent":["import { Deserializer, Serializer } from \"../../bcs\";\nimport { HexInput } from \"../../types\";\nimport { AccountAddress } from \"../accountAddress\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Hex } from \"../hex\";\nimport { AccountPublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\n\nexport class AbstractSignature extends Signature {\n readonly value: Hex;\n\n constructor(value: HexInput) {\n super();\n this.value = Hex.fromHexInput(value);\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.value.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): AbstractSignature {\n return new AbstractSignature(deserializer.deserializeBytes());\n }\n}\n\nexport class AbstractPublicKey extends AccountPublicKey {\n readonly accountAddress: AccountAddress;\n\n constructor(accountAddress: AccountAddress) {\n super();\n this.accountAddress = accountAddress;\n }\n\n authKey(): AuthenticationKey {\n return new AuthenticationKey({ data: this.accountAddress.toUint8Array() });\n }\n\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n verifySignature(args: VerifySignatureArgs): boolean {\n throw new Error(\"This function is not implemented for AbstractPublicKey.\");\n }\n\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n serialize(serializer: Serializer): void {\n throw new Error(\"This function is not implemented for AbstractPublicKey.\");\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAQO,IAAM,oBAAN,MAAM,2BAA0B,UAAU;AAAA,EAG/C,YAAY,OAAiB;AAC3B,UAAM;AACN,SAAK,QAAQ,IAAI,aAAa,KAAK;AAAA,EACrC;AAAA,EAEA,UAAU,YAA8B;AACtC,eAAW,eAAe,KAAK,MAAM,aAAa,CAAC;AAAA,EACrD;AAAA,EAEA,OAAO,YAAY,cAA+C;AAChE,WAAO,IAAI,mBAAkB,aAAa,iBAAiB,CAAC;AAAA,EAC9D;AACF;AAEO,IAAM,oBAAN,cAAgC,iBAAiB;AAAA,EAGtD,YAAY,gBAAgC;AAC1C,UAAM;AACN,SAAK,iBAAiB;AAAA,EACxB;AAAA,EAEA,UAA6B;AAC3B,WAAO,IAAI,kBAAkB,EAAE,MAAM,KAAK,eAAe,aAAa,EAAE,CAAC;AAAA,EAC3E;AAAA;AAAA,EAGA,gBAAgB,MAAoC;AAClD,UAAM,IAAI,MAAM,yDAAyD;AAAA,EAC3E;AAAA;AAAA,EAGA,UAAU,YAA8B;AACtC,UAAM,IAAI,MAAM,yDAAyD;AAAA,EAC3E;AACF;","names":[]}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
// src/core/crypto/poseidon.ts
|
|
2
|
-
import {
|
|
3
|
-
poseidon1,
|
|
4
|
-
poseidon2,
|
|
5
|
-
poseidon3,
|
|
6
|
-
poseidon4,
|
|
7
|
-
poseidon5,
|
|
8
|
-
poseidon6,
|
|
9
|
-
poseidon7,
|
|
10
|
-
poseidon8,
|
|
11
|
-
poseidon9,
|
|
12
|
-
poseidon10,
|
|
13
|
-
poseidon11,
|
|
14
|
-
poseidon12,
|
|
15
|
-
poseidon13,
|
|
16
|
-
poseidon14,
|
|
17
|
-
poseidon15,
|
|
18
|
-
poseidon16
|
|
19
|
-
} from "poseidon-lite";
|
|
20
|
-
var numInputsToPoseidonFunc = [
|
|
21
|
-
poseidon1,
|
|
22
|
-
poseidon2,
|
|
23
|
-
poseidon3,
|
|
24
|
-
poseidon4,
|
|
25
|
-
poseidon5,
|
|
26
|
-
poseidon6,
|
|
27
|
-
poseidon7,
|
|
28
|
-
poseidon8,
|
|
29
|
-
poseidon9,
|
|
30
|
-
poseidon10,
|
|
31
|
-
poseidon11,
|
|
32
|
-
poseidon12,
|
|
33
|
-
poseidon13,
|
|
34
|
-
poseidon14,
|
|
35
|
-
poseidon15,
|
|
36
|
-
poseidon16
|
|
37
|
-
];
|
|
38
|
-
var BYTES_PACKED_PER_SCALAR = 31;
|
|
39
|
-
var MAX_NUM_INPUT_SCALARS = 16;
|
|
40
|
-
var MAX_NUM_INPUT_BYTES = (MAX_NUM_INPUT_SCALARS - 1) * BYTES_PACKED_PER_SCALAR;
|
|
41
|
-
function hashStrToField(str, maxSizeBytes) {
|
|
42
|
-
const textEncoder = new TextEncoder();
|
|
43
|
-
const strBytes = textEncoder.encode(str);
|
|
44
|
-
return hashBytesWithLen(strBytes, maxSizeBytes);
|
|
45
|
-
}
|
|
46
|
-
function hashBytesWithLen(bytes, maxSizeBytes) {
|
|
47
|
-
if (bytes.length > maxSizeBytes) {
|
|
48
|
-
throw new Error(`Inputted bytes of length ${bytes} is longer than ${maxSizeBytes}`);
|
|
49
|
-
}
|
|
50
|
-
const packed = padAndPackBytesWithLen(bytes, maxSizeBytes);
|
|
51
|
-
return poseidonHash(packed);
|
|
52
|
-
}
|
|
53
|
-
function padAndPackBytesNoLen(bytes, maxSizeBytes) {
|
|
54
|
-
if (bytes.length > maxSizeBytes) {
|
|
55
|
-
throw new Error(`Input bytes of length ${bytes} is longer than ${maxSizeBytes}`);
|
|
56
|
-
}
|
|
57
|
-
const paddedStrBytes = padUint8ArrayWithZeros(bytes, maxSizeBytes);
|
|
58
|
-
return packBytes(paddedStrBytes);
|
|
59
|
-
}
|
|
60
|
-
function padAndPackBytesWithLen(bytes, maxSizeBytes) {
|
|
61
|
-
if (bytes.length > maxSizeBytes) {
|
|
62
|
-
throw new Error(`Input bytes of length ${bytes} is longer than ${maxSizeBytes}`);
|
|
63
|
-
}
|
|
64
|
-
return padAndPackBytesNoLen(bytes, maxSizeBytes).concat([BigInt(bytes.length)]);
|
|
65
|
-
}
|
|
66
|
-
function packBytes(bytes) {
|
|
67
|
-
if (bytes.length > MAX_NUM_INPUT_BYTES) {
|
|
68
|
-
throw new Error(`Can't pack more than ${MAX_NUM_INPUT_BYTES}. Was given ${bytes.length} bytes`);
|
|
69
|
-
}
|
|
70
|
-
return chunkUint8Array(bytes, BYTES_PACKED_PER_SCALAR).map((chunk) => bytesToBigIntLE(chunk));
|
|
71
|
-
}
|
|
72
|
-
function chunkUint8Array(array, chunkSize) {
|
|
73
|
-
const result = [];
|
|
74
|
-
for (let i = 0; i < array.length; i += chunkSize) {
|
|
75
|
-
result.push(array.subarray(i, i + chunkSize));
|
|
76
|
-
}
|
|
77
|
-
return result;
|
|
78
|
-
}
|
|
79
|
-
function bytesToBigIntLE(bytes) {
|
|
80
|
-
let result = BigInt(0);
|
|
81
|
-
for (let i = bytes.length - 1; i >= 0; i -= 1) {
|
|
82
|
-
result = result << BigInt(8) | BigInt(bytes[i]);
|
|
83
|
-
}
|
|
84
|
-
return result;
|
|
85
|
-
}
|
|
86
|
-
function bigIntToBytesLE(value, length) {
|
|
87
|
-
let val = BigInt(value);
|
|
88
|
-
const bytes = new Uint8Array(length);
|
|
89
|
-
for (let i = 0; i < length; i += 1) {
|
|
90
|
-
bytes[i] = Number(val & BigInt(255));
|
|
91
|
-
val >>= BigInt(8);
|
|
92
|
-
}
|
|
93
|
-
return bytes;
|
|
94
|
-
}
|
|
95
|
-
function padUint8ArrayWithZeros(inputArray, paddedSize) {
|
|
96
|
-
if (paddedSize < inputArray.length) {
|
|
97
|
-
throw new Error("Padded size must be greater than or equal to the input array size.");
|
|
98
|
-
}
|
|
99
|
-
const paddedArray = new Uint8Array(paddedSize);
|
|
100
|
-
paddedArray.set(inputArray);
|
|
101
|
-
for (let i = inputArray.length; i < paddedSize; i += 1) {
|
|
102
|
-
paddedArray[i] = 0;
|
|
103
|
-
}
|
|
104
|
-
return paddedArray;
|
|
105
|
-
}
|
|
106
|
-
function poseidonHash(inputs) {
|
|
107
|
-
if (inputs.length > numInputsToPoseidonFunc.length) {
|
|
108
|
-
throw new Error(
|
|
109
|
-
`Unable to hash input of length ${inputs.length}. Max input length is ${numInputsToPoseidonFunc.length}`
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
return numInputsToPoseidonFunc[inputs.length - 1](inputs);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export {
|
|
116
|
-
hashStrToField,
|
|
117
|
-
padAndPackBytesWithLen,
|
|
118
|
-
bytesToBigIntLE,
|
|
119
|
-
bigIntToBytesLE,
|
|
120
|
-
poseidonHash
|
|
121
|
-
};
|
|
122
|
-
//# sourceMappingURL=chunk-APM7OSLS.mjs.map
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ParsingError
|
|
3
|
-
} from "./chunk-QPT4BSAB.mjs";
|
|
4
|
-
|
|
5
|
-
// src/core/hex.ts
|
|
6
|
-
import { bytesToHex, hexToBytes } from "@noble/hashes/utils";
|
|
7
|
-
var HexInvalidReason = /* @__PURE__ */ ((HexInvalidReason2) => {
|
|
8
|
-
HexInvalidReason2["TOO_SHORT"] = "too_short";
|
|
9
|
-
HexInvalidReason2["INVALID_LENGTH"] = "invalid_length";
|
|
10
|
-
HexInvalidReason2["INVALID_HEX_CHARS"] = "invalid_hex_chars";
|
|
11
|
-
return HexInvalidReason2;
|
|
12
|
-
})(HexInvalidReason || {});
|
|
13
|
-
var Hex = class _Hex {
|
|
14
|
-
/**
|
|
15
|
-
* Create a new Hex instance from a Uint8Array.
|
|
16
|
-
*
|
|
17
|
-
* @param data - The Uint8Array containing the data to initialize the Hex instance.
|
|
18
|
-
* @group Implementation
|
|
19
|
-
* @category Serialization
|
|
20
|
-
*/
|
|
21
|
-
constructor(data) {
|
|
22
|
-
this.data = data;
|
|
23
|
-
}
|
|
24
|
-
// ===
|
|
25
|
-
// Methods for representing an instance of Hex as other types.
|
|
26
|
-
// ===
|
|
27
|
-
/**
|
|
28
|
-
* Get the inner hex data as a Uint8Array. The inner data is already a Uint8Array, so no conversion takes place.
|
|
29
|
-
*
|
|
30
|
-
* @returns Hex data as Uint8Array
|
|
31
|
-
* @group Implementation
|
|
32
|
-
* @category Serialization
|
|
33
|
-
*/
|
|
34
|
-
toUint8Array() {
|
|
35
|
-
return this.data;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Get the hex data as a string without the 0x prefix.
|
|
39
|
-
*
|
|
40
|
-
* @returns Hex string without 0x prefix
|
|
41
|
-
* @group Implementation
|
|
42
|
-
* @category Serialization
|
|
43
|
-
*/
|
|
44
|
-
toStringWithoutPrefix() {
|
|
45
|
-
return bytesToHex(this.data);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Get the hex data as a string with the 0x prefix.
|
|
49
|
-
*
|
|
50
|
-
* @returns Hex string with 0x prefix
|
|
51
|
-
* @group Implementation
|
|
52
|
-
* @category Serialization
|
|
53
|
-
*/
|
|
54
|
-
toString() {
|
|
55
|
-
return `0x${this.toStringWithoutPrefix()}`;
|
|
56
|
-
}
|
|
57
|
-
// ===
|
|
58
|
-
// Methods for creating an instance of Hex from other types.
|
|
59
|
-
// ===
|
|
60
|
-
/**
|
|
61
|
-
* Converts a hex string into a Hex instance, allowing for both prefixed and non-prefixed formats.
|
|
62
|
-
*
|
|
63
|
-
* @param str - A hex string, with or without the 0x prefix.
|
|
64
|
-
*
|
|
65
|
-
* @throws ParsingError - If the hex string is too short, has an odd number of characters, or contains invalid hex characters.
|
|
66
|
-
*
|
|
67
|
-
* @returns Hex - The resulting Hex instance created from the provided string.
|
|
68
|
-
* @group Implementation
|
|
69
|
-
* @category Serialization
|
|
70
|
-
*/
|
|
71
|
-
static fromHexString(str) {
|
|
72
|
-
let input = str;
|
|
73
|
-
if (input.startsWith("0x")) {
|
|
74
|
-
input = input.slice(2);
|
|
75
|
-
}
|
|
76
|
-
if (input.length === 0) {
|
|
77
|
-
throw new ParsingError(
|
|
78
|
-
"Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.",
|
|
79
|
-
"too_short" /* TOO_SHORT */
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
if (input.length % 2 !== 0) {
|
|
83
|
-
throw new ParsingError("Hex string must be an even number of hex characters.", "invalid_length" /* INVALID_LENGTH */);
|
|
84
|
-
}
|
|
85
|
-
try {
|
|
86
|
-
return new _Hex(hexToBytes(input));
|
|
87
|
-
} catch (error) {
|
|
88
|
-
throw new ParsingError(
|
|
89
|
-
`Hex string contains invalid hex characters: ${error?.message}`,
|
|
90
|
-
"invalid_hex_chars" /* INVALID_HEX_CHARS */
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Converts an instance of HexInput, which can be a string or a Uint8Array, into a Hex instance.
|
|
96
|
-
* This function is useful for transforming hexadecimal representations into a structured Hex object for further manipulation.
|
|
97
|
-
*
|
|
98
|
-
* @param hexInput - A HexInput which can be a string or Uint8Array.
|
|
99
|
-
* @returns A Hex instance created from the provided hexInput.
|
|
100
|
-
* @group Implementation
|
|
101
|
-
* @category Serialization
|
|
102
|
-
*/
|
|
103
|
-
static fromHexInput(hexInput) {
|
|
104
|
-
if (hexInput instanceof Buffer) return new _Hex(new Uint8Array(hexInput));
|
|
105
|
-
if (hexInput instanceof Uint8Array) return new _Hex(hexInput);
|
|
106
|
-
if (typeof hexInput === "string") return _Hex.fromHexString(hexInput);
|
|
107
|
-
throw new Error(`Invalid hex input type: ${typeof hexInput}`);
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Converts an instance of HexInput, which can be a string or a Uint8Array, into a Uint8Array.
|
|
111
|
-
*
|
|
112
|
-
* @param hexInput - A HexInput which can be a string or Uint8Array.
|
|
113
|
-
* @returns A Uint8Array created from the provided hexInput.
|
|
114
|
-
*/
|
|
115
|
-
static hexInputToUint8Array(hexInput) {
|
|
116
|
-
if (hexInput instanceof Uint8Array) return hexInput;
|
|
117
|
-
return _Hex.fromHexString(hexInput).toUint8Array();
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Converts a HexInput (string or Uint8Array) to a hex string with '0x' prefix.
|
|
121
|
-
*
|
|
122
|
-
* @param hexInput - The input to convert, either a hex string (with/without '0x' prefix) or Uint8Array
|
|
123
|
-
* @returns A hex string with '0x' prefix (e.g., "0x1234")
|
|
124
|
-
*
|
|
125
|
-
* @example
|
|
126
|
-
* ```typescript
|
|
127
|
-
* Hex.hexInputToString("1234") // returns "0x1234"
|
|
128
|
-
* Hex.hexInputToString("0x1234") // returns "0x1234"
|
|
129
|
-
* Hex.hexInputToString(new Uint8Array([0x12, 0x34])) // returns "0x1234"
|
|
130
|
-
* ```
|
|
131
|
-
*/
|
|
132
|
-
static hexInputToString(hexInput) {
|
|
133
|
-
return _Hex.fromHexInput(hexInput).toString();
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Converts a HexInput (string or Uint8Array) to a hex string without '0x' prefix.
|
|
137
|
-
*
|
|
138
|
-
* @param hexInput - The input to convert, either a hex string (with/without '0x' prefix) or Uint8Array
|
|
139
|
-
* @returns A hex string without '0x' prefix (e.g., "1234")
|
|
140
|
-
*
|
|
141
|
-
* @example
|
|
142
|
-
* ```typescript
|
|
143
|
-
* Hex.hexInputToStringWithoutPrefix("1234") // returns "1234"
|
|
144
|
-
* Hex.hexInputToStringWithoutPrefix("0x1234") // returns "1234"
|
|
145
|
-
* Hex.hexInputToStringWithoutPrefix(new Uint8Array([0x12, 0x34])) // returns "1234"
|
|
146
|
-
* ```
|
|
147
|
-
*/
|
|
148
|
-
static hexInputToStringWithoutPrefix(hexInput) {
|
|
149
|
-
return _Hex.fromHexInput(hexInput).toStringWithoutPrefix();
|
|
150
|
-
}
|
|
151
|
-
// ===
|
|
152
|
-
// Methods for checking validity.
|
|
153
|
-
// ===
|
|
154
|
-
/**
|
|
155
|
-
* Check if the provided string is a valid hexadecimal representation.
|
|
156
|
-
*
|
|
157
|
-
* @param str - A hex string representing byte data.
|
|
158
|
-
*
|
|
159
|
-
* @returns An object containing:
|
|
160
|
-
* - valid: A boolean indicating whether the string is valid.
|
|
161
|
-
* - invalidReason: The reason for invalidity if the string is not valid.
|
|
162
|
-
* - invalidReasonMessage: A message explaining why the string is invalid.
|
|
163
|
-
* @group Implementation
|
|
164
|
-
* @category Serialization
|
|
165
|
-
*/
|
|
166
|
-
static isValid(str) {
|
|
167
|
-
try {
|
|
168
|
-
_Hex.fromHexString(str);
|
|
169
|
-
return { valid: true };
|
|
170
|
-
} catch (error) {
|
|
171
|
-
return {
|
|
172
|
-
valid: false,
|
|
173
|
-
invalidReason: error?.invalidReason,
|
|
174
|
-
invalidReasonMessage: error?.message
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Determine if two Hex instances are equal by comparing their underlying byte data.
|
|
180
|
-
*
|
|
181
|
-
* @param other The Hex instance to compare to.
|
|
182
|
-
* @returns true if the Hex instances are equal, false if not.
|
|
183
|
-
* @group Implementation
|
|
184
|
-
* @category Serialization
|
|
185
|
-
*/
|
|
186
|
-
equals(other) {
|
|
187
|
-
if (this.data.length !== other.data.length) return false;
|
|
188
|
-
return this.data.every((value, index) => value === other.data[index]);
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
var hexToAsciiString = (hex) => new TextDecoder().decode(Hex.fromHexInput(hex).toUint8Array());
|
|
192
|
-
|
|
193
|
-
export {
|
|
194
|
-
HexInvalidReason,
|
|
195
|
-
Hex,
|
|
196
|
-
hexToAsciiString
|
|
197
|
-
};
|
|
198
|
-
//# sourceMappingURL=chunk-BDM6FBUO.mjs.map
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// src/utils/memoize.ts
|
|
2
|
-
var cache = /* @__PURE__ */ new Map();
|
|
3
|
-
function memoizeAsync(func, key, ttlMs) {
|
|
4
|
-
return async (...args) => {
|
|
5
|
-
if (cache.has(key)) {
|
|
6
|
-
const { value, timestamp } = cache.get(key);
|
|
7
|
-
if (ttlMs === void 0 || Date.now() - timestamp <= ttlMs) {
|
|
8
|
-
return value;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
const result = await func(...args);
|
|
12
|
-
cache.set(key, { value: result, timestamp: Date.now() });
|
|
13
|
-
return result;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
function memoize(func, key, ttlMs) {
|
|
17
|
-
return (...args) => {
|
|
18
|
-
if (cache.has(key)) {
|
|
19
|
-
const { value, timestamp } = cache.get(key);
|
|
20
|
-
if (ttlMs === void 0 || Date.now() - timestamp <= ttlMs) {
|
|
21
|
-
return value;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
const result = func(...args);
|
|
25
|
-
cache.set(key, { value: result, timestamp: Date.now() });
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export {
|
|
31
|
-
memoizeAsync,
|
|
32
|
-
memoize
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=chunk-BEYIOC2H.mjs.map
|
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
StructTag,
|
|
3
|
-
TypeTagAddress,
|
|
4
|
-
TypeTagBool,
|
|
5
|
-
TypeTagGeneric,
|
|
6
|
-
TypeTagReference,
|
|
7
|
-
TypeTagSigner,
|
|
8
|
-
TypeTagStruct,
|
|
9
|
-
TypeTagU128,
|
|
10
|
-
TypeTagU16,
|
|
11
|
-
TypeTagU256,
|
|
12
|
-
TypeTagU32,
|
|
13
|
-
TypeTagU64,
|
|
14
|
-
TypeTagU8,
|
|
15
|
-
TypeTagVector
|
|
16
|
-
} from "./chunk-DDZGHA66.mjs";
|
|
17
|
-
import {
|
|
18
|
-
Identifier
|
|
19
|
-
} from "./chunk-MFFBZ43D.mjs";
|
|
20
|
-
import {
|
|
21
|
-
AccountAddress
|
|
22
|
-
} from "./chunk-CXLXUSCG.mjs";
|
|
23
|
-
|
|
24
|
-
// src/transactions/typeTag/parser.ts
|
|
25
|
-
function isValidIdentifier(str) {
|
|
26
|
-
return !!str.match(/^[_a-zA-Z0-9]+$/);
|
|
27
|
-
}
|
|
28
|
-
function isValidWhitespaceCharacter(char) {
|
|
29
|
-
return !!char.match(/\s/);
|
|
30
|
-
}
|
|
31
|
-
function isGeneric(str) {
|
|
32
|
-
return !!str.match(/^T[0-9]+$/);
|
|
33
|
-
}
|
|
34
|
-
function isRef(str) {
|
|
35
|
-
return !!str.match(/^&.+$/);
|
|
36
|
-
}
|
|
37
|
-
function isPrimitive(str) {
|
|
38
|
-
switch (str) {
|
|
39
|
-
case "signer":
|
|
40
|
-
case "address":
|
|
41
|
-
case "bool":
|
|
42
|
-
case "u8":
|
|
43
|
-
case "u16":
|
|
44
|
-
case "u32":
|
|
45
|
-
case "u64":
|
|
46
|
-
case "u128":
|
|
47
|
-
case "u256":
|
|
48
|
-
return true;
|
|
49
|
-
default:
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function consumeWhitespace(tagStr, pos) {
|
|
54
|
-
let i = pos;
|
|
55
|
-
for (; i < tagStr.length; i += 1) {
|
|
56
|
-
const innerChar = tagStr[i];
|
|
57
|
-
if (!isValidWhitespaceCharacter(innerChar)) {
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return i;
|
|
62
|
-
}
|
|
63
|
-
var TypeTagParserErrorType = /* @__PURE__ */ ((TypeTagParserErrorType2) => {
|
|
64
|
-
TypeTagParserErrorType2["InvalidTypeTag"] = "unknown type";
|
|
65
|
-
TypeTagParserErrorType2["UnexpectedGenericType"] = "unexpected generic type";
|
|
66
|
-
TypeTagParserErrorType2["UnexpectedTypeArgumentClose"] = "unexpected '>'";
|
|
67
|
-
TypeTagParserErrorType2["UnexpectedWhitespaceCharacter"] = "unexpected whitespace character";
|
|
68
|
-
TypeTagParserErrorType2["UnexpectedComma"] = "unexpected ','";
|
|
69
|
-
TypeTagParserErrorType2["TypeArgumentCountMismatch"] = "type argument count doesn't match expected amount";
|
|
70
|
-
TypeTagParserErrorType2["MissingTypeArgumentClose"] = "no matching '>' for '<'";
|
|
71
|
-
TypeTagParserErrorType2["MissingTypeArgument"] = "no type argument before ','";
|
|
72
|
-
TypeTagParserErrorType2["UnexpectedPrimitiveTypeArguments"] = "primitive types not expected to have type arguments";
|
|
73
|
-
TypeTagParserErrorType2["UnexpectedVectorTypeArgumentCount"] = "vector type expected to have exactly one type argument";
|
|
74
|
-
TypeTagParserErrorType2["UnexpectedStructFormat"] = "unexpected struct format, must be of the form 0xaddress::module_name::struct_name";
|
|
75
|
-
TypeTagParserErrorType2["InvalidModuleNameCharacter"] = "module name must only contain alphanumeric or '_' characters";
|
|
76
|
-
TypeTagParserErrorType2["InvalidStructNameCharacter"] = "struct name must only contain alphanumeric or '_' characters";
|
|
77
|
-
TypeTagParserErrorType2["InvalidAddress"] = "struct address must be valid";
|
|
78
|
-
return TypeTagParserErrorType2;
|
|
79
|
-
})(TypeTagParserErrorType || {});
|
|
80
|
-
var TypeTagParserError = class extends Error {
|
|
81
|
-
/**
|
|
82
|
-
* Constructs an error indicating a failure to parse a type tag.
|
|
83
|
-
* This error provides details about the specific type tag that could not be parsed and the reason for the failure.
|
|
84
|
-
*
|
|
85
|
-
* @param typeTagStr - The string representation of the type tag that failed to parse.
|
|
86
|
-
* @param invalidReason - The reason why the type tag is considered invalid.
|
|
87
|
-
* @group Implementation
|
|
88
|
-
* @category Transactions
|
|
89
|
-
*/
|
|
90
|
-
constructor(typeTagStr, invalidReason) {
|
|
91
|
-
super(`Failed to parse typeTag '${typeTagStr}', ${invalidReason}`);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
function parseTypeTag(typeStr, options) {
|
|
95
|
-
const allowGenerics = options?.allowGenerics ?? false;
|
|
96
|
-
const saved = [];
|
|
97
|
-
let innerTypes = [];
|
|
98
|
-
let curTypes = [];
|
|
99
|
-
let cur = 0;
|
|
100
|
-
let currentStr = "";
|
|
101
|
-
let expectedTypes = 1;
|
|
102
|
-
while (cur < typeStr.length) {
|
|
103
|
-
const char = typeStr[cur];
|
|
104
|
-
if (char === "<") {
|
|
105
|
-
saved.push({
|
|
106
|
-
savedExpectedTypes: expectedTypes,
|
|
107
|
-
savedStr: currentStr,
|
|
108
|
-
savedTypes: curTypes
|
|
109
|
-
});
|
|
110
|
-
currentStr = "";
|
|
111
|
-
curTypes = [];
|
|
112
|
-
expectedTypes = 1;
|
|
113
|
-
} else if (char === ">") {
|
|
114
|
-
if (currentStr !== "") {
|
|
115
|
-
const newType = parseTypeTagInner(currentStr, innerTypes, allowGenerics);
|
|
116
|
-
curTypes.push(newType);
|
|
117
|
-
}
|
|
118
|
-
const savedPop = saved.pop();
|
|
119
|
-
if (savedPop === void 0) {
|
|
120
|
-
throw new TypeTagParserError(typeStr, "unexpected '>'" /* UnexpectedTypeArgumentClose */);
|
|
121
|
-
}
|
|
122
|
-
if (expectedTypes !== curTypes.length) {
|
|
123
|
-
throw new TypeTagParserError(typeStr, "type argument count doesn't match expected amount" /* TypeArgumentCountMismatch */);
|
|
124
|
-
}
|
|
125
|
-
const { savedStr, savedTypes, savedExpectedTypes } = savedPop;
|
|
126
|
-
innerTypes = curTypes;
|
|
127
|
-
curTypes = savedTypes;
|
|
128
|
-
currentStr = savedStr;
|
|
129
|
-
expectedTypes = savedExpectedTypes;
|
|
130
|
-
} else if (char === ",") {
|
|
131
|
-
if (saved.length === 0) {
|
|
132
|
-
throw new TypeTagParserError(typeStr, "unexpected ','" /* UnexpectedComma */);
|
|
133
|
-
}
|
|
134
|
-
if (currentStr.length === 0) {
|
|
135
|
-
throw new TypeTagParserError(typeStr, "no type argument before ','" /* MissingTypeArgument */);
|
|
136
|
-
}
|
|
137
|
-
const newType = parseTypeTagInner(currentStr, innerTypes, allowGenerics);
|
|
138
|
-
innerTypes = [];
|
|
139
|
-
curTypes.push(newType);
|
|
140
|
-
currentStr = "";
|
|
141
|
-
expectedTypes += 1;
|
|
142
|
-
} else if (isValidWhitespaceCharacter(char)) {
|
|
143
|
-
let parsedTypeTag = false;
|
|
144
|
-
if (currentStr.length !== 0) {
|
|
145
|
-
const newType = parseTypeTagInner(currentStr, innerTypes, allowGenerics);
|
|
146
|
-
innerTypes = [];
|
|
147
|
-
curTypes.push(newType);
|
|
148
|
-
currentStr = "";
|
|
149
|
-
parsedTypeTag = true;
|
|
150
|
-
}
|
|
151
|
-
cur = consumeWhitespace(typeStr, cur);
|
|
152
|
-
const nextChar = typeStr[cur];
|
|
153
|
-
if (cur < typeStr.length && parsedTypeTag && nextChar !== "," && nextChar !== ">") {
|
|
154
|
-
throw new TypeTagParserError(typeStr, "unexpected whitespace character" /* UnexpectedWhitespaceCharacter */);
|
|
155
|
-
}
|
|
156
|
-
continue;
|
|
157
|
-
} else {
|
|
158
|
-
currentStr += char;
|
|
159
|
-
}
|
|
160
|
-
cur += 1;
|
|
161
|
-
}
|
|
162
|
-
if (saved.length > 0) {
|
|
163
|
-
throw new TypeTagParserError(typeStr, "no matching '>' for '<'" /* MissingTypeArgumentClose */);
|
|
164
|
-
}
|
|
165
|
-
switch (curTypes.length) {
|
|
166
|
-
case 0:
|
|
167
|
-
return parseTypeTagInner(currentStr, innerTypes, allowGenerics);
|
|
168
|
-
case 1:
|
|
169
|
-
if (currentStr === "") {
|
|
170
|
-
return curTypes[0];
|
|
171
|
-
}
|
|
172
|
-
throw new TypeTagParserError(typeStr, "unexpected ','" /* UnexpectedComma */);
|
|
173
|
-
default:
|
|
174
|
-
throw new TypeTagParserError(typeStr, "unexpected whitespace character" /* UnexpectedWhitespaceCharacter */);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
function parseTypeTagInner(str, types, allowGenerics) {
|
|
178
|
-
const trimmedStr = str.trim();
|
|
179
|
-
const lowerCaseTrimmed = trimmedStr.toLowerCase();
|
|
180
|
-
if (isPrimitive(lowerCaseTrimmed)) {
|
|
181
|
-
if (types.length > 0) {
|
|
182
|
-
throw new TypeTagParserError(str, "primitive types not expected to have type arguments" /* UnexpectedPrimitiveTypeArguments */);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
switch (trimmedStr.toLowerCase()) {
|
|
186
|
-
case "signer":
|
|
187
|
-
return new TypeTagSigner();
|
|
188
|
-
case "bool":
|
|
189
|
-
return new TypeTagBool();
|
|
190
|
-
case "address":
|
|
191
|
-
return new TypeTagAddress();
|
|
192
|
-
case "u8":
|
|
193
|
-
return new TypeTagU8();
|
|
194
|
-
case "u16":
|
|
195
|
-
return new TypeTagU16();
|
|
196
|
-
case "u32":
|
|
197
|
-
return new TypeTagU32();
|
|
198
|
-
case "u64":
|
|
199
|
-
return new TypeTagU64();
|
|
200
|
-
case "u128":
|
|
201
|
-
return new TypeTagU128();
|
|
202
|
-
case "u256":
|
|
203
|
-
return new TypeTagU256();
|
|
204
|
-
case "vector":
|
|
205
|
-
if (types.length !== 1) {
|
|
206
|
-
throw new TypeTagParserError(str, "vector type expected to have exactly one type argument" /* UnexpectedVectorTypeArgumentCount */);
|
|
207
|
-
}
|
|
208
|
-
return new TypeTagVector(types[0]);
|
|
209
|
-
default:
|
|
210
|
-
if (isRef(trimmedStr)) {
|
|
211
|
-
const actualType = trimmedStr.substring(1);
|
|
212
|
-
return new TypeTagReference(parseTypeTagInner(actualType, types, allowGenerics));
|
|
213
|
-
}
|
|
214
|
-
if (isGeneric(trimmedStr)) {
|
|
215
|
-
if (allowGenerics) {
|
|
216
|
-
return new TypeTagGeneric(Number(trimmedStr.split("T")[1]));
|
|
217
|
-
}
|
|
218
|
-
throw new TypeTagParserError(str, "unexpected generic type" /* UnexpectedGenericType */);
|
|
219
|
-
}
|
|
220
|
-
if (!trimmedStr.match(/:/)) {
|
|
221
|
-
throw new TypeTagParserError(str, "unknown type" /* InvalidTypeTag */);
|
|
222
|
-
}
|
|
223
|
-
const structParts = trimmedStr.split("::");
|
|
224
|
-
if (structParts.length !== 3) {
|
|
225
|
-
throw new TypeTagParserError(str, "unexpected struct format, must be of the form 0xaddress::module_name::struct_name" /* UnexpectedStructFormat */);
|
|
226
|
-
}
|
|
227
|
-
let address;
|
|
228
|
-
try {
|
|
229
|
-
address = AccountAddress.fromString(structParts[0]);
|
|
230
|
-
} catch (error) {
|
|
231
|
-
throw new TypeTagParserError(str, "struct address must be valid" /* InvalidAddress */);
|
|
232
|
-
}
|
|
233
|
-
if (!isValidIdentifier(structParts[1])) {
|
|
234
|
-
throw new TypeTagParserError(str, "module name must only contain alphanumeric or '_' characters" /* InvalidModuleNameCharacter */);
|
|
235
|
-
}
|
|
236
|
-
if (!isValidIdentifier(structParts[2])) {
|
|
237
|
-
throw new TypeTagParserError(str, "struct name must only contain alphanumeric or '_' characters" /* InvalidStructNameCharacter */);
|
|
238
|
-
}
|
|
239
|
-
return new TypeTagStruct(
|
|
240
|
-
new StructTag(address, new Identifier(structParts[1]), new Identifier(structParts[2]), types)
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
export {
|
|
246
|
-
TypeTagParserErrorType,
|
|
247
|
-
TypeTagParserError,
|
|
248
|
-
parseTypeTag
|
|
249
|
-
};
|
|
250
|
-
//# sourceMappingURL=chunk-BMM72IIP.mjs.map
|