@aptos-labs/ts-sdk 4.0.0-zeta.0 → 5.0.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/{account-D4dsN-1K.d.ts → account-BDwBREvt.d.ts} +29 -3
- package/dist/common/chunk-6MMUUJHX.js +4 -0
- package/dist/common/chunk-6MMUUJHX.js.map +1 -0
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js +1 -480
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +195 -463
- package/dist/common/index.js +447 -19859
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account-ndmdpFe9.d.mts → Ed25519Account-8ETkcAk_.d.mts} +1 -1
- package/dist/esm/account/AbstractKeylessAccount.d.mts +3 -3
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -66
- package/dist/esm/account/AbstractedAccount.d.mts +3 -2
- package/dist/esm/account/AbstractedAccount.mjs +1 -62
- package/dist/esm/account/Account.d.mts +2 -2
- package/dist/esm/account/Account.mjs +1 -62
- package/dist/esm/account/AccountUtils.d.mts +3 -3
- package/dist/esm/account/AccountUtils.mjs +1 -62
- package/dist/esm/account/DerivableAbstractedAccount.d.mts +2 -2
- package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -62
- package/dist/esm/account/Ed25519Account.d.mts +2 -2
- package/dist/esm/account/Ed25519Account.mjs +1 -62
- package/dist/esm/account/EphemeralKeyPair.d.mts +1 -1
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -62
- package/dist/esm/account/FederatedKeylessAccount.d.mts +3 -3
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -62
- package/dist/esm/account/KeylessAccount.d.mts +3 -3
- package/dist/esm/account/KeylessAccount.mjs +1 -62
- package/dist/esm/account/MultiEd25519Account.d.mts +2 -2
- package/dist/esm/account/MultiEd25519Account.mjs +1 -62
- package/dist/esm/account/MultiKeyAccount.d.mts +3 -3
- package/dist/esm/account/MultiKeyAccount.mjs +1 -62
- package/dist/esm/account/SingleKeyAccount.d.mts +2 -2
- package/dist/esm/account/SingleKeyAccount.mjs +1 -64
- package/dist/esm/account/index.d.mts +3 -3
- package/dist/esm/account/index.mjs +1 -90
- package/dist/esm/account/utils.d.mts +1 -1
- package/dist/esm/account/utils.mjs +1 -62
- package/dist/esm/{account--Q9z_xMN.d.mts → account-ClxOwjdh.d.mts} +28 -3
- package/dist/esm/api/account/abstraction.d.mts +1 -1
- package/dist/esm/api/account/abstraction.mjs +1 -62
- package/dist/esm/api/account.d.mts +2 -6
- package/dist/esm/api/account.mjs +1 -62
- package/dist/esm/api/ans.d.mts +2 -2
- package/dist/esm/api/ans.mjs +1 -62
- package/dist/esm/api/aptos.d.mts +6 -6
- package/dist/esm/api/aptos.mjs +1 -62
- package/dist/esm/api/aptosConfig.d.mts +1 -1
- package/dist/esm/api/aptosConfig.mjs +1 -9
- package/dist/esm/api/coin.d.mts +1 -1
- package/dist/esm/api/coin.mjs +1 -62
- package/dist/esm/api/digitalAsset.d.mts +2 -2
- package/dist/esm/api/digitalAsset.mjs +1 -62
- package/dist/esm/api/faucet.d.mts +1 -1
- package/dist/esm/api/faucet.mjs +1 -62
- package/dist/esm/api/fungibleAsset.d.mts +2 -2
- package/dist/esm/api/fungibleAsset.mjs +1 -62
- package/dist/esm/api/general.d.mts +1 -1
- package/dist/esm/api/general.mjs +1 -62
- package/dist/esm/api/index.d.mts +3 -4
- package/dist/esm/api/index.mjs +1 -67
- package/dist/esm/api/keyless.d.mts +3 -3
- package/dist/esm/api/keyless.mjs +1 -62
- package/dist/esm/api/object.d.mts +1 -1
- package/dist/esm/api/object.mjs +1 -62
- package/dist/esm/api/staking.d.mts +1 -1
- package/dist/esm/api/staking.mjs +1 -62
- package/dist/esm/api/table.d.mts +1 -1
- package/dist/esm/api/table.mjs +1 -39
- package/dist/esm/api/transaction.d.mts +2 -2
- package/dist/esm/api/transaction.mjs +1 -62
- package/dist/esm/api/transactionSubmission/build.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/build.mjs +1 -62
- package/dist/esm/api/transactionSubmission/helpers.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/helpers.mjs +1 -9
- package/dist/esm/api/transactionSubmission/management.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/management.mjs +1 -62
- package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -182
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/simulate.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -62
- package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -62
- package/dist/esm/api/utils.d.mts +1 -1
- package/dist/esm/api/utils.mjs +1 -37
- package/dist/esm/bcs/consts.d.mts +1 -1
- package/dist/esm/bcs/consts.mjs +1 -17
- package/dist/esm/bcs/deserializer.d.mts +1 -1
- package/dist/esm/bcs/deserializer.mjs +1 -10
- package/dist/esm/bcs/index.d.mts +1 -1
- package/dist/esm/bcs/index.mjs +1 -60
- package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -12
- package/dist/esm/bcs/serializable/fixedBytes.d.mts +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -11
- package/dist/esm/bcs/serializable/movePrimitives.d.mts +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -26
- package/dist/esm/bcs/serializable/moveStructs.d.mts +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -22
- package/dist/esm/bcs/serializer.d.mts +1 -1
- package/dist/esm/bcs/serializer.mjs +1 -18
- 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-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-5FI4545P.mjs +2 -0
- package/dist/esm/{chunk-DTLPTPJW.mjs.map → chunk-5FI4545P.mjs.map} +1 -1
- package/dist/esm/chunk-6WDVDEQZ.mjs +7 -0
- package/dist/esm/{chunk-A4IKXI43.mjs.map → chunk-6WDVDEQZ.mjs.map} +1 -1
- package/dist/esm/chunk-7DQDJ2SA.mjs +2 -0
- package/dist/esm/{chunk-SCWOUBOV.mjs.map → chunk-7DQDJ2SA.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-B563XRSZ.mjs +2 -0
- package/dist/esm/{chunk-Q5W46UAQ.mjs.map → chunk-B563XRSZ.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-CW35YAMN.mjs +2 -0
- package/dist/esm/{chunk-2EQWS4BO.mjs.map → chunk-CW35YAMN.mjs.map} +1 -1
- package/dist/esm/chunk-DIGP2ALY.mjs +4 -0
- package/dist/esm/chunk-DIGP2ALY.mjs.map +1 -0
- package/dist/esm/chunk-DNRUDMMV.mjs +2 -0
- package/dist/esm/{chunk-KJY6HBMF.mjs.map → chunk-DNRUDMMV.mjs.map} +1 -1
- package/dist/esm/chunk-EBMEXURY.mjs +2 -0
- package/dist/esm/{chunk-FJJ3KCPC.mjs.map → chunk-EBMEXURY.mjs.map} +1 -1
- package/dist/esm/chunk-EM52Z7T7.mjs +2 -0
- package/dist/esm/{chunk-XBBBLYRH.mjs.map → chunk-EM52Z7T7.mjs.map} +1 -1
- package/dist/esm/chunk-ES2KP6BS.mjs +2 -0
- package/dist/esm/{chunk-EPKBDH2H.mjs.map → chunk-ES2KP6BS.mjs.map} +1 -1
- package/dist/esm/chunk-FGFLPH5K.mjs +2 -0
- package/dist/esm/{chunk-6ZZZXQX5.mjs.map → chunk-FGFLPH5K.mjs.map} +1 -1
- package/dist/esm/chunk-FLZPUYXQ.mjs +2 -0
- package/dist/esm/{chunk-YJJUYS67.mjs.map → chunk-FLZPUYXQ.mjs.map} +1 -1
- package/dist/esm/chunk-GFFKEZ56.mjs +2 -0
- package/dist/esm/{chunk-GREMFKLA.mjs.map → chunk-GFFKEZ56.mjs.map} +1 -1
- package/dist/esm/chunk-GMQCQDW4.mjs +2 -0
- package/dist/esm/{chunk-QIM243UU.mjs.map → chunk-GMQCQDW4.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-HNBKTJPN.mjs +2 -0
- package/dist/esm/{chunk-SQ3VDIBO.mjs.map → chunk-HNBKTJPN.mjs.map} +1 -1
- package/dist/esm/chunk-HNBVYE3N.mjs +2 -0
- package/dist/esm/{chunk-DUYTCDXO.mjs.map → chunk-HNBVYE3N.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-IJE2LVZG.mjs +2 -0
- package/dist/esm/{chunk-O3EP3HB3.mjs.map → chunk-IJE2LVZG.mjs.map} +1 -1
- package/dist/esm/chunk-KDMSOCZY.mjs +2 -0
- package/dist/esm/chunk-LWL57YFU.mjs +2 -0
- package/dist/esm/{chunk-ORIVGO5I.mjs.map → chunk-LWL57YFU.mjs.map} +1 -1
- package/dist/esm/chunk-MT2RJ7H3.mjs +2 -0
- package/dist/esm/{chunk-HKXZMGVA.mjs.map → chunk-MT2RJ7H3.mjs.map} +1 -1
- package/dist/esm/chunk-N3O3ULF7.mjs +2 -0
- package/dist/esm/{chunk-4OAWQT57.mjs.map → chunk-N3O3ULF7.mjs.map} +1 -1
- package/dist/esm/chunk-N6YTF76Q.mjs +2 -0
- package/dist/esm/{chunk-NATYEXGE.mjs.map → chunk-N6YTF76Q.mjs.map} +1 -1
- package/dist/esm/chunk-OLILO7VD.mjs +2 -0
- package/dist/esm/{chunk-FHHBIGGL.mjs.map → chunk-OLILO7VD.mjs.map} +1 -1
- package/dist/esm/chunk-ORMOQWWH.mjs +2 -0
- package/dist/esm/{chunk-TSXVHRQB.mjs.map → chunk-ORMOQWWH.mjs.map} +1 -1
- package/dist/esm/chunk-Q4W3WJ2U.mjs +2 -0
- package/dist/esm/{chunk-TPJY5GTS.mjs.map → chunk-Q4W3WJ2U.mjs.map} +1 -1
- package/dist/esm/chunk-QREVMGQZ.mjs +2 -0
- package/dist/esm/{chunk-BQCCGCK4.mjs.map → chunk-QREVMGQZ.mjs.map} +1 -1
- package/dist/esm/chunk-RCSJFTST.mjs +2 -0
- package/dist/esm/{chunk-3WEOSEUE.mjs.map → chunk-RCSJFTST.mjs.map} +1 -1
- package/dist/esm/chunk-RGKRCZ36.mjs +4 -0
- package/dist/esm/{chunk-P6RWWRGG.mjs.map → chunk-RGKRCZ36.mjs.map} +1 -1
- package/dist/esm/chunk-ROT6S6BM.mjs +2 -0
- package/dist/esm/{chunk-UKXKN5YN.mjs.map → chunk-ROT6S6BM.mjs.map} +1 -1
- package/dist/esm/chunk-RQX6JOEN.mjs +2 -0
- package/dist/esm/{chunk-WZD3K77H.mjs.map → chunk-RQX6JOEN.mjs.map} +1 -1
- package/dist/esm/chunk-STY74NUA.mjs +2 -0
- package/dist/esm/{chunk-GHQTJGG6.mjs.map → chunk-STY74NUA.mjs.map} +1 -1
- package/dist/esm/chunk-TGRLDWXV.mjs +2 -0
- package/dist/esm/{chunk-UAXZDOSV.mjs.map → chunk-TGRLDWXV.mjs.map} +1 -1
- package/dist/esm/chunk-TOBQ5UE6.mjs +2 -0
- package/dist/esm/{chunk-IBRCEHIR.mjs.map → chunk-TOBQ5UE6.mjs.map} +1 -1
- package/dist/esm/{chunk-A5FS7NAD.mjs → chunk-UL777LTI.mjs} +31 -380
- package/dist/esm/{chunk-A5FS7NAD.mjs.map → chunk-UL777LTI.mjs.map} +1 -1
- package/dist/esm/chunk-V74WPKSY.mjs +2 -0
- package/dist/esm/{chunk-CYKMZPCW.mjs.map → chunk-V74WPKSY.mjs.map} +1 -1
- package/dist/esm/chunk-WCMW2L3P.mjs +2 -0
- package/dist/esm/{chunk-MOQKSDHO.mjs.map → chunk-WCMW2L3P.mjs.map} +1 -1
- package/dist/esm/chunk-WSR5EBJM.mjs +2 -0
- package/dist/esm/{chunk-ITS22VZT.mjs.map → chunk-WSR5EBJM.mjs.map} +1 -1
- package/dist/esm/chunk-XJJVJOX5.mjs +2 -0
- package/dist/esm/{chunk-53SXUNRK.mjs.map → chunk-XJJVJOX5.mjs.map} +1 -1
- package/dist/esm/chunk-XKUIMGKU.mjs +2 -0
- package/dist/esm/{chunk-55VEYGKK.mjs.map → chunk-XKUIMGKU.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-ZP4DWSQA.mjs +2 -0
- package/dist/esm/chunk-ZP4DWSQA.mjs.map +1 -0
- package/dist/esm/cli/index.d.mts +1 -1
- package/dist/esm/cli/index.mjs +1 -21
- package/dist/esm/cli/localNode.mjs +1 -17
- package/dist/esm/cli/move.d.mts +1 -1
- package/dist/esm/cli/move.mjs +1 -7
- package/dist/esm/client/core.d.mts +1 -1
- package/dist/esm/client/core.mjs +1 -31
- package/dist/esm/client/get.d.mts +1 -1
- package/dist/esm/client/get.mjs +1 -40
- package/dist/esm/client/index.d.mts +1 -1
- package/dist/esm/client/index.mjs +1 -60
- package/dist/esm/client/post.d.mts +1 -1
- package/dist/esm/client/post.mjs +1 -40
- package/dist/esm/core/account/index.d.mts +1 -1
- package/dist/esm/core/account/index.mjs +1 -21
- package/dist/esm/core/account/utils/address.d.mts +1 -1
- package/dist/esm/core/account/utils/address.mjs +1 -19
- package/dist/esm/core/account/utils/index.d.mts +1 -1
- package/dist/esm/core/account/utils/index.mjs +1 -20
- package/dist/esm/core/accountAddress.d.mts +1 -1
- package/dist/esm/core/accountAddress.mjs +1 -16
- package/dist/esm/core/authenticationKey.d.mts +1 -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 +1 -1
- package/dist/esm/core/crypto/abstraction.mjs +1 -26
- package/dist/esm/core/crypto/deserializationUtils.d.mts +1 -1
- package/dist/esm/core/crypto/deserializationUtils.mjs +1 -64
- package/dist/esm/core/crypto/ed25519.d.mts +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -68
- package/dist/esm/core/crypto/ephemeral.d.mts +1 -1
- package/dist/esm/core/crypto/ephemeral.mjs +1 -64
- package/dist/esm/core/crypto/federatedKeyless.d.mts +2 -2
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -62
- package/dist/esm/core/crypto/hdKey.mjs +1 -25
- package/dist/esm/core/crypto/index.d.mts +2 -2
- package/dist/esm/core/crypto/index.mjs +1 -196
- package/dist/esm/core/crypto/keyless.d.mts +2 -2
- package/dist/esm/core/crypto/keyless.mjs +1 -110
- package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -64
- package/dist/esm/core/crypto/multiKey.d.mts +1 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -66
- package/dist/esm/core/crypto/poseidon.mjs +1 -15
- package/dist/esm/core/crypto/privateKey.d.mts +1 -1
- package/dist/esm/core/crypto/privateKey.mjs +1 -12
- package/dist/esm/core/crypto/proof.d.mts +1 -1
- package/dist/esm/core/crypto/proof.mjs +1 -20
- package/dist/esm/core/crypto/publicKey.d.mts +1 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -22
- package/dist/esm/core/crypto/secp256k1.d.mts +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -66
- package/dist/esm/core/crypto/signature.d.mts +1 -1
- package/dist/esm/core/crypto/signature.mjs +1 -20
- package/dist/esm/core/crypto/singleKey.d.mts +1 -1
- package/dist/esm/core/crypto/singleKey.mjs +1 -64
- package/dist/esm/core/crypto/types.d.mts +1 -1
- package/dist/esm/core/crypto/types.mjs +1 -1
- package/dist/esm/core/crypto/utils.d.mts +1 -1
- package/dist/esm/core/crypto/utils.mjs +1 -66
- package/dist/esm/core/hex.d.mts +1 -1
- package/dist/esm/core/hex.mjs +1 -12
- package/dist/esm/core/index.d.mts +2 -2
- package/dist/esm/core/index.mjs +1 -221
- package/dist/esm/errors/index.d.mts +1 -1
- package/dist/esm/errors/index.mjs +1 -26
- package/dist/esm/{federatedKeyless-CiyplsOB.d.mts → federatedKeyless-CUPEnP-W.d.mts} +1 -1
- package/dist/esm/index.d.mts +4 -5
- package/dist/esm/index.mjs +1 -716
- package/dist/esm/internal/abstraction.d.mts +1 -1
- package/dist/esm/internal/abstraction.mjs +1 -66
- package/dist/esm/internal/account.d.mts +2 -2
- package/dist/esm/internal/account.mjs +1 -108
- package/dist/esm/internal/ans.d.mts +2 -2
- package/dist/esm/internal/ans.mjs +1 -100
- package/dist/esm/internal/coin.d.mts +1 -1
- package/dist/esm/internal/coin.mjs +1 -62
- package/dist/esm/internal/digitalAsset.d.mts +2 -2
- package/dist/esm/internal/digitalAsset.mjs +1 -108
- package/dist/esm/internal/faucet.d.mts +1 -1
- package/dist/esm/internal/faucet.mjs +1 -62
- package/dist/esm/internal/fungibleAsset.d.mts +2 -2
- package/dist/esm/internal/fungibleAsset.mjs +1 -70
- package/dist/esm/internal/general.d.mts +1 -1
- package/dist/esm/internal/general.mjs +1 -44
- package/dist/esm/internal/keyless.d.mts +3 -3
- package/dist/esm/internal/keyless.mjs +1 -68
- package/dist/esm/internal/object.d.mts +1 -1
- package/dist/esm/internal/object.mjs +1 -64
- package/dist/esm/internal/staking.d.mts +1 -1
- package/dist/esm/internal/staking.mjs +1 -66
- package/dist/esm/internal/table.d.mts +1 -1
- package/dist/esm/internal/table.mjs +1 -39
- package/dist/esm/internal/transaction.d.mts +1 -1
- package/dist/esm/internal/transaction.mjs +1 -58
- package/dist/esm/internal/transactionSubmission.d.mts +2 -2
- package/dist/esm/internal/transactionSubmission.mjs +1 -82
- package/dist/esm/internal/utils/index.d.mts +1 -1
- package/dist/esm/internal/utils/index.mjs +1 -37
- package/dist/esm/internal/utils/utils.d.mts +1 -1
- package/dist/esm/internal/utils/utils.mjs +1 -36
- package/dist/esm/internal/view.d.mts +1 -1
- package/dist/esm/internal/view.mjs +1 -64
- package/dist/esm/transactions/authenticator/account.d.mts +1 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -74
- package/dist/esm/transactions/authenticator/index.d.mts +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -86
- package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -72
- package/dist/esm/transactions/index.d.mts +1 -1
- package/dist/esm/transactions/index.mjs +1 -277
- package/dist/esm/transactions/instances/chainId.d.mts +1 -1
- package/dist/esm/transactions/instances/chainId.mjs +1 -11
- package/dist/esm/transactions/instances/identifier.d.mts +1 -1
- package/dist/esm/transactions/instances/identifier.mjs +1 -11
- package/dist/esm/transactions/instances/index.d.mts +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -119
- package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -62
- package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -62
- package/dist/esm/transactions/instances/rawTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -68
- package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -21
- package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -62
- package/dist/esm/transactions/instances/simpleTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -62
- package/dist/esm/transactions/instances/transactionArgument.d.mts +1 -1
- package/dist/esm/transactions/instances/transactionArgument.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -94
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +2 -2
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -62
- 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 -68
- package/dist/esm/transactions/management/transactionWorker.d.mts +2 -2
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -66
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -100
- package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -148
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -76
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -68
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -84
- package/dist/esm/transactions/typeTag/index.d.mts +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -98
- package/dist/esm/transactions/typeTag/parser.d.mts +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -66
- package/dist/esm/transactions/types.d.mts +1 -1
- package/dist/esm/transactions/types.mjs +1 -1
- package/dist/esm/types/abstraction.d.mts +9 -3
- package/dist/esm/types/abstraction.mjs +1 -7
- package/dist/esm/types/generated/queries.mjs +1 -65
- package/dist/esm/types/generated/types.mjs +1 -758
- package/dist/esm/types/generated/types.mjs.map +1 -1
- package/dist/esm/types/index.d.mts +1 -1
- package/dist/esm/types/index.mjs +1 -83
- package/dist/esm/types/indexer.mjs +1 -1
- package/dist/esm/types/types.d.mts +1 -1
- package/dist/esm/types/types.mjs +1 -81
- package/dist/esm/utils/apiEndpoints.mjs +1 -21
- package/dist/esm/utils/const.d.mts +2 -1
- package/dist/esm/utils/const.mjs +1 -25
- package/dist/esm/utils/helpers.d.mts +1 -1
- package/dist/esm/utils/helpers.mjs +1 -42
- package/dist/esm/utils/index.d.mts +2 -2
- package/dist/esm/utils/index.mjs +1 -93
- package/dist/esm/utils/memoize.mjs +1 -9
- package/dist/esm/utils/normalizeBundle.d.mts +1 -1
- 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 +26 -26
- package/src/account/AbstractedAccount.ts +16 -3
- package/src/account/DerivableAbstractedAccount.ts +3 -1
- package/src/api/account.ts +4 -16
- package/src/api/index.ts +0 -1
- package/src/transactions/authenticator/account.ts +71 -17
- package/src/types/abstraction.ts +9 -2
- package/src/utils/const.ts +2 -0
- package/src/version.ts +1 -1
- package/dist/common/chunk-MU4IJVW5.js +0 -1390
- package/dist/common/chunk-MU4IJVW5.js.map +0 -1
- package/dist/esm/api/manager.d.mts +0 -313
- package/dist/esm/api/manager.mjs +0 -63
- package/dist/esm/chunk-2EQWS4BO.mjs +0 -15
- package/dist/esm/chunk-3WEOSEUE.mjs +0 -221
- package/dist/esm/chunk-4OAWQT57.mjs +0 -281
- package/dist/esm/chunk-53SXUNRK.mjs +0 -12
- package/dist/esm/chunk-55VEYGKK.mjs +0 -46
- package/dist/esm/chunk-6ZZZXQX5.mjs +0 -138
- package/dist/esm/chunk-A4IKXI43.mjs +0 -339
- package/dist/esm/chunk-APM7OSLS.mjs +0 -122
- package/dist/esm/chunk-BEYIOC2H.mjs +0 -34
- package/dist/esm/chunk-BQCCGCK4.mjs +0 -22
- package/dist/esm/chunk-CYKMZPCW.mjs +0 -71
- package/dist/esm/chunk-DTLPTPJW.mjs +0 -7
- package/dist/esm/chunk-DUYTCDXO.mjs +0 -29
- package/dist/esm/chunk-EPKBDH2H.mjs +0 -177
- package/dist/esm/chunk-F7W7KS5C.mjs +0 -52
- package/dist/esm/chunk-FHHBIGGL.mjs +0 -43
- package/dist/esm/chunk-FJJ3KCPC.mjs +0 -376
- package/dist/esm/chunk-GHQTJGG6.mjs +0 -196
- package/dist/esm/chunk-GREMFKLA.mjs +0 -84
- package/dist/esm/chunk-GUA5YTIK.mjs +0 -362
- package/dist/esm/chunk-HKXZMGVA.mjs +0 -73
- package/dist/esm/chunk-HXS6ZS4S.mjs +0 -16311
- package/dist/esm/chunk-HXS6ZS4S.mjs.map +0 -1
- package/dist/esm/chunk-IBRCEHIR.mjs +0 -77
- package/dist/esm/chunk-ITS22VZT.mjs +0 -48
- package/dist/esm/chunk-KJY6HBMF.mjs +0 -114
- package/dist/esm/chunk-MOQKSDHO.mjs +0 -33
- package/dist/esm/chunk-NATYEXGE.mjs +0 -45
- package/dist/esm/chunk-O3EP3HB3.mjs +0 -257
- package/dist/esm/chunk-ORIVGO5I.mjs +0 -73
- package/dist/esm/chunk-OWG3TOG6.mjs +0 -11
- package/dist/esm/chunk-OWG3TOG6.mjs.map +0 -1
- package/dist/esm/chunk-P6RWWRGG.mjs +0 -440
- package/dist/esm/chunk-PT2QHUB6.mjs +0 -96
- package/dist/esm/chunk-Q5W46UAQ.mjs +0 -123
- package/dist/esm/chunk-QIM243UU.mjs +0 -89
- package/dist/esm/chunk-QPT4BSAB.mjs +0 -20
- 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-SCWOUBOV.mjs +0 -101
- package/dist/esm/chunk-SFLQPB72.mjs +0 -63
- package/dist/esm/chunk-SQ3VDIBO.mjs +0 -47
- package/dist/esm/chunk-TPJY5GTS.mjs +0 -502
- package/dist/esm/chunk-TSXVHRQB.mjs +0 -216
- package/dist/esm/chunk-UAXZDOSV.mjs +0 -19
- package/dist/esm/chunk-UKXKN5YN.mjs +0 -72
- package/dist/esm/chunk-WZD3K77H.mjs +0 -53
- package/dist/esm/chunk-XBBBLYRH.mjs +0 -66
- package/dist/esm/chunk-YJJUYS67.mjs +0 -329
- package/src/api/manager.ts +0 -872
- package/src/internal/move/jwks/build/jwk/BuildInfo.yaml +0 -56
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/account.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/aggregator.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/aggregator_factory.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/aggregator_v2.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/aptos_account.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/aptos_coin.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/aptos_governance.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/block.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/chain_id.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/chain_status.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/code.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/coin.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/config_buffer.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/consensus_config.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/create_signer.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/delegation_pool.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/dispatchable_fungible_asset.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/dkg.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/event.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/execution_config.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/function_info.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/fungible_asset.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/gas_schedule.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/genesis.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/governance_proposal.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/guid.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/jwk_consensus_config.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/jwks.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/keyless_account.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/managed_coin.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/multisig_account.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/object.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/object_code_deployment.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/optional_aggregator.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/primary_fungible_store.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/randomness.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/randomness_api_v0_config.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/randomness_config.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/randomness_config_seqnum.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/reconfiguration.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/reconfiguration_state.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/reconfiguration_with_dkg.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/resource_account.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/stake.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/staking_config.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/staking_contract.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/staking_proxy.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/state_storage.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/storage_gas.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/system_addresses.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/timestamp.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/transaction_context.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/transaction_fee.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/transaction_validation.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/util.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/validator_consensus_info.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/version.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/vesting.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosFramework/voting.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/any.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/aptos_hash.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/big_vector.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/bls12381.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/bls12381_algebra.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/bn254_algebra.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/capability.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/comparator.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/copyable_any.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/crypto_algebra.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/debug.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/ed25519.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/fixed_point64.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/from_bcs.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/math128.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/math64.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/math_fixed.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/math_fixed64.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/multi_ed25519.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/pool_u64.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/pool_u64_unbound.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/ristretto255.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/ristretto255_bulletproofs.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/ristretto255_elgamal.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/ristretto255_pedersen.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/secp256k1.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/simple_map.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/smart_table.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/smart_vector.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/string_utils.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/table.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/table_with_length.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/AptosStdlib/type_info.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/acl.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/bcs.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/bit_vector.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/error.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/features.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/fixed_point32.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/hash.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/option.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/signer.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/string.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_modules/dependencies/MoveStdlib/vector.mv +0 -0
- package/src/internal/move/jwks/build/jwk/bytecode_scripts/main.mv +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/account.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/aggregator.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/aggregator_factory.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/aggregator_v2.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/aptos_account.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/aptos_coin.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/aptos_governance.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/block.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/chain_id.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/chain_status.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/code.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/coin.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/config_buffer.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/consensus_config.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/create_signer.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/delegation_pool.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/dispatchable_fungible_asset.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/dkg.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/event.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/execution_config.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/function_info.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/fungible_asset.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/gas_schedule.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/genesis.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/governance_proposal.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/guid.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/jwk_consensus_config.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/jwks.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/keyless_account.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/managed_coin.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/multisig_account.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/object.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/object_code_deployment.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/optional_aggregator.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/primary_fungible_store.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/randomness.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/randomness_api_v0_config.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/randomness_config.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/randomness_config_seqnum.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/reconfiguration.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/reconfiguration_state.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/reconfiguration_with_dkg.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/resource_account.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/stake.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/staking_config.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/staking_contract.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/staking_proxy.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/state_storage.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/storage_gas.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/system_addresses.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/timestamp.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/transaction_context.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/transaction_fee.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/transaction_validation.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/util.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/validator_consensus_info.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/version.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/vesting.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosFramework/voting.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/any.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/aptos_hash.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/big_vector.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/bls12381.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/bls12381_algebra.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/bn254_algebra.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/capability.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/comparator.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/copyable_any.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/crypto_algebra.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/debug.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/ed25519.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/fixed_point64.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/from_bcs.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/math128.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/math64.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/math_fixed.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/math_fixed64.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/multi_ed25519.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/pool_u64.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/pool_u64_unbound.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/ristretto255.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/ristretto255_bulletproofs.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/ristretto255_elgamal.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/ristretto255_pedersen.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/secp256k1.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/simple_map.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/smart_table.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/smart_vector.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/string_utils.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/table.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/table_with_length.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/AptosStdlib/type_info.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/acl.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/bcs.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/bit_vector.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/error.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/features.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/fixed_point32.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/hash.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/option.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/signer.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/string.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/dependencies/MoveStdlib/vector.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/source_maps/main.mvsm +0 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/account.move +0 -1533
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aggregator.move +0 -48
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aggregator_factory.move +0 -66
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aggregator_v2.move +0 -280
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aptos_account.move +0 -443
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aptos_coin.move +0 -204
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aptos_governance.move +0 -1387
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/block.move +0 -394
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/chain_id.move +0 -41
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/chain_status.move +0 -48
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/code.move +0 -367
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/coin.move +0 -2214
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/config_buffer.move +0 -101
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/consensus_config.move +0 -77
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/create_signer.move +0 -21
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/delegation_pool.move +0 -5568
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/dispatchable_fungible_asset.move +0 -228
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/dkg.move +0 -121
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/event.move +0 -92
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/execution_config.move +0 -66
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/function_info.move +0 -100
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/fungible_asset.move +0 -1566
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/gas_schedule.move +0 -176
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/genesis.move +0 -550
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/governance_proposal.move +0 -23
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/guid.move +0 -68
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/jwk_consensus_config.move +0 -148
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/jwks.move +0 -817
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/keyless_account.move +0 -312
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/managed_coin.move +0 -205
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/multisig_account.move +0 -2477
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/object.move +0 -1073
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/object_code_deployment.move +0 -147
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/optional_aggregator.move +0 -295
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/primary_fungible_store.move +0 -405
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/randomness.move +0 -574
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/randomness_api_v0_config.move +0 -57
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/randomness_config.move +0 -153
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/randomness_config_seqnum.move +0 -49
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/reconfiguration.move +0 -237
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/reconfiguration_state.move +0 -132
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/reconfiguration_with_dkg.move +0 -69
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/resource_account.move +0 -267
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/stake.move +0 -3286
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/staking_config.move +0 -686
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/staking_contract.move +0 -1618
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/staking_proxy.move +0 -228
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/state_storage.move +0 -90
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/storage_gas.move +0 -622
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/system_addresses.move +0 -82
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/timestamp.move +0 -88
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/transaction_context.move +0 -262
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/transaction_fee.move +0 -457
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/transaction_validation.move +0 -501
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/util.move +0 -16
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/validator_consensus_info.move +0 -42
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/version.move +0 -115
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/vesting.move +0 -2183
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/voting.move +0 -1279
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/any.move +0 -57
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/aptos_hash.move +0 -253
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/big_vector.move +0 -469
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/bls12381.move +0 -985
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/bls12381_algebra.move +0 -802
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/bn254_algebra.move +0 -855
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/capability.move +0 -193
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/comparator.move +0 -173
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/copyable_any.move +0 -45
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/crypto_algebra.move +0 -351
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/debug.move +0 -278
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/ed25519.move +0 -262
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/fixed_point64.move +0 -447
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/from_bcs.move +0 -91
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/math128.move +0 -381
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/math64.move +0 -336
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/math_fixed.move +0 -139
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/math_fixed64.move +0 -142
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/multi_ed25519.move +0 -482
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/pool_u64.move +0 -571
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/pool_u64_unbound.move +0 -270
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/ristretto255.move +0 -1310
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/ristretto255_bulletproofs.move +0 -253
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/ristretto255_elgamal.move +0 -234
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/ristretto255_pedersen.move +0 -158
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/secp256k1.move +0 -114
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/simple_map.move +0 -319
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/smart_table.move +0 -769
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/smart_vector.move +0 -766
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/string_utils.move +0 -148
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/table.move +0 -152
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/table_with_length.move +0 -141
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/type_info.move +0 -351
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/acl.move +0 -46
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/bcs.move +0 -27
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/bit_vector.move +0 -239
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/error.move +0 -88
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/features.move +0 -780
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/fixed_point32.move +0 -295
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/hash.move +0 -8
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/option.move +0 -356
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/signer.move +0 -21
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/string.move +0 -93
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/vector.move +0 -669
- package/src/internal/move/jwks/build/jwk/sources/main.move +0 -20
- /package/dist/esm/{api/manager.mjs.map → chunk-KDMSOCZY.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/errors/index.ts"],"sourcesContent":["import { AptosApiType } from \"../utils/const\";\nimport { getErrorMessage } from \"../utils/helpers\";\nimport { AptosRequest, AptosResponse } from \"../types\";\n\nexport enum KeylessErrorCategory {\n API_ERROR,\n EXTERNAL_API_ERROR,\n SESSION_EXPIRED,\n INVALID_STATE,\n INVALID_SIGNATURE,\n UNKNOWN,\n}\n\nexport enum KeylessErrorResolutionTip {\n REAUTHENTICATE = \"Re-authentiate to continue using your keyless account\",\n // eslint-disable-next-line max-len\n REAUTHENTICATE_UNSURE = \"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support\",\n UPDATE_REQUEST_PARAMS = \"Update the invalid request parameters and reauthenticate.\",\n // eslint-disable-next-line max-len\n RATE_LIMIT_EXCEEDED = \"Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest.\",\n // eslint-disable-next-line max-len\n SERVER_ERROR = \"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx\",\n // eslint-disable-next-line max-len\n CALL_PRECHECK = \"Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing.\",\n REINSTANTIATE = \"Try instantiating the account again. Avoid manipulating the account object directly\",\n JOIN_SUPPORT_GROUP = \"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx\",\n UNKNOWN = \"Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx\",\n}\n\nexport enum KeylessErrorType {\n EPHEMERAL_KEY_PAIR_EXPIRED,\n\n PROOF_NOT_FOUND,\n\n ASYNC_PROOF_FETCH_FAILED,\n\n INVALID_PROOF_VERIFICATION_FAILED,\n\n INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND,\n\n INVALID_JWT_SIG,\n\n INVALID_JWT_JWK_NOT_FOUND,\n\n INVALID_JWT_ISS_NOT_RECOGNIZED,\n\n INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED,\n\n INVALID_TW_SIG_VERIFICATION_FAILED,\n\n INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND,\n\n INVALID_EXPIRY_HORIZON,\n\n JWT_PARSING_ERROR,\n\n JWK_FETCH_FAILED,\n\n JWK_FETCH_FAILED_FEDERATED,\n\n RATE_LIMIT_EXCEEDED,\n\n PEPPER_SERVICE_INTERNAL_ERROR,\n\n PEPPER_SERVICE_BAD_REQUEST,\n\n PEPPER_SERVICE_OTHER,\n\n PROVER_SERVICE_INTERNAL_ERROR,\n\n PROVER_SERVICE_BAD_REQUEST,\n\n PROVER_SERVICE_OTHER,\n\n FULL_NODE_CONFIG_LOOKUP_ERROR,\n\n FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR,\n\n FULL_NODE_JWKS_LOOKUP_ERROR,\n\n FULL_NODE_OTHER,\n\n SIGNATURE_TYPE_INVALID,\n\n SIGNATURE_EXPIRED,\n\n MAX_EXPIRY_HORIZON_EXCEEDED,\n\n EPHEMERAL_SIGNATURE_VERIFICATION_FAILED,\n\n TRAINING_WHEELS_SIGNATURE_MISSING,\n\n TRAINING_WHEELS_SIGNATURE_VERIFICATION_FAILED,\n\n PROOF_VERIFICATION_FAILED,\n\n UNKNOWN,\n}\n\nconst KeylessErrors: { [key in KeylessErrorType]: [string, KeylessErrorCategory, KeylessErrorResolutionTip] } = {\n [KeylessErrorType.EPHEMERAL_KEY_PAIR_EXPIRED]: [\n \"The ephemeral keypair has expired.\",\n KeylessErrorCategory.SESSION_EXPIRED,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.PROOF_NOT_FOUND]: [\n \"The required proof could not be found.\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.CALL_PRECHECK,\n ],\n [KeylessErrorType.ASYNC_PROOF_FETCH_FAILED]: [\n \"The required proof failed to fetch.\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.REAUTHENTICATE_UNSURE,\n ],\n [KeylessErrorType.INVALID_PROOF_VERIFICATION_FAILED]: [\n \"The provided proof is invalid.\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.REAUTHENTICATE_UNSURE,\n ],\n [KeylessErrorType.INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND]: [\n \"The verification key used to authenticate was updated.\",\n KeylessErrorCategory.SESSION_EXPIRED,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.INVALID_JWT_SIG]: [\n \"The JWK was found, but JWT failed verification\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.REAUTHENTICATE_UNSURE,\n ],\n [KeylessErrorType.INVALID_JWT_JWK_NOT_FOUND]: [\n \"The JWK required to verify the JWT could not be found. The JWK may have been rotated out.\",\n KeylessErrorCategory.SESSION_EXPIRED,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.INVALID_JWT_ISS_NOT_RECOGNIZED]: [\n \"The JWT issuer is not recognized.\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.UPDATE_REQUEST_PARAMS,\n ],\n [KeylessErrorType.INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED]: [\n \"The JWT issuer is not supported by the Federated Keyless \",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.REAUTHENTICATE_UNSURE,\n ],\n [KeylessErrorType.INVALID_TW_SIG_VERIFICATION_FAILED]: [\n \"The training wheels signature is invalid.\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.REAUTHENTICATE_UNSURE,\n ],\n [KeylessErrorType.INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND]: [\n \"The public key used to verify the training wheels signature was not found.\",\n KeylessErrorCategory.SESSION_EXPIRED,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.INVALID_EXPIRY_HORIZON]: [\n \"The expiry horizon is invalid.\",\n KeylessErrorCategory.SESSION_EXPIRED,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.JWK_FETCH_FAILED]: [\n \"Failed to fetch JWKS.\",\n KeylessErrorCategory.EXTERNAL_API_ERROR,\n KeylessErrorResolutionTip.JOIN_SUPPORT_GROUP,\n ],\n [KeylessErrorType.JWK_FETCH_FAILED_FEDERATED]: [\n \"Failed to fetch JWKS for Federated Keyless provider.\",\n KeylessErrorCategory.EXTERNAL_API_ERROR,\n KeylessErrorResolutionTip.JOIN_SUPPORT_GROUP,\n ],\n [KeylessErrorType.RATE_LIMIT_EXCEEDED]: [\n \"Rate limit exceeded. Too many requests in a short period.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.RATE_LIMIT_EXCEEDED,\n ],\n [KeylessErrorType.PEPPER_SERVICE_INTERNAL_ERROR]: [\n \"Internal error from Pepper service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.PEPPER_SERVICE_BAD_REQUEST]: [\n \"Bad request sent to Pepper service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.UPDATE_REQUEST_PARAMS,\n ],\n [KeylessErrorType.PEPPER_SERVICE_OTHER]: [\n \"Unknown error from Pepper service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.PROVER_SERVICE_INTERNAL_ERROR]: [\n \"Internal error from Prover service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.PROVER_SERVICE_BAD_REQUEST]: [\n \"Bad request sent to Prover service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.UPDATE_REQUEST_PARAMS,\n ],\n [KeylessErrorType.PROVER_SERVICE_OTHER]: [\n \"Unknown error from Prover service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.JWT_PARSING_ERROR]: [\n \"Error when parsing JWT. This should never happen. Join https://t.me/+h5CN-W35yUFiYzkx for support\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.REINSTANTIATE,\n ],\n [KeylessErrorType.FULL_NODE_CONFIG_LOOKUP_ERROR]: [\n \"Error when looking up on-chain keyless configuration.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR]: [\n \"Error when looking up on-chain verification key.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.FULL_NODE_JWKS_LOOKUP_ERROR]: [\n \"Error when looking up on-chain JWKS.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.FULL_NODE_OTHER]: [\n \"Unknown error from full node.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.SIGNATURE_TYPE_INVALID]: [\n \"The signature is not a valid Keyless signature.\",\n KeylessErrorCategory.INVALID_SIGNATURE,\n KeylessErrorResolutionTip.JOIN_SUPPORT_GROUP,\n ],\n [KeylessErrorType.SIGNATURE_EXPIRED]: [\n \"The ephemeral key pair used to sign the message has expired.\",\n KeylessErrorCategory.INVALID_SIGNATURE,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.MAX_EXPIRY_HORIZON_EXCEEDED]: [\n \"The expiry horizon on the signature exceeds the maximum allowed value.\",\n KeylessErrorCategory.INVALID_SIGNATURE,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.EPHEMERAL_SIGNATURE_VERIFICATION_FAILED]: [\n \"Failed to verify the ephemeral signature with the ephemeral public key.\",\n KeylessErrorCategory.INVALID_SIGNATURE,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.TRAINING_WHEELS_SIGNATURE_MISSING]: [\n \"The training wheels signature is missing but is required by the Keyless configuration.\",\n KeylessErrorCategory.INVALID_SIGNATURE,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.TRAINING_WHEELS_SIGNATURE_VERIFICATION_FAILED]: [\n \"Failed to verify the training wheels signature with the training wheels public key.\",\n KeylessErrorCategory.INVALID_SIGNATURE,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.PROOF_VERIFICATION_FAILED]: [\n \"The proof verification failed.\",\n KeylessErrorCategory.INVALID_SIGNATURE,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.UNKNOWN]: [\n \"An unknown error has occurred.\",\n KeylessErrorCategory.UNKNOWN,\n KeylessErrorResolutionTip.UNKNOWN,\n ],\n};\n\nexport class KeylessError extends Error {\n readonly innerError?: unknown;\n\n readonly category: KeylessErrorCategory;\n\n readonly resolutionTip: KeylessErrorResolutionTip;\n\n readonly type: KeylessErrorType;\n\n readonly details?: string;\n\n /** @internal this constructor is for sdk internal use - do not instantiate outside of the SDK codebase */\n constructor(args: {\n innerError?: unknown;\n category: KeylessErrorCategory;\n resolutionTip: KeylessErrorResolutionTip;\n type: KeylessErrorType;\n message?: string;\n details?: string;\n }) {\n const { innerError, category, resolutionTip, type, message = KeylessErrors[type][0], details } = args;\n super(message);\n this.name = \"KeylessError\";\n this.innerError = innerError;\n this.category = category;\n this.resolutionTip = resolutionTip;\n this.type = type;\n this.details = details;\n this.message = KeylessError.constructMessage(message, resolutionTip, innerError, details);\n }\n\n static constructMessage(\n message: string,\n tip: KeylessErrorResolutionTip,\n innerError?: unknown,\n details?: string,\n ): string {\n let result = `\\nMessage: ${message}`;\n if (details) {\n result += `\\nDetails: ${details}`;\n }\n if (innerError instanceof AptosApiError) {\n result += `\\nAptosApiError: ${innerError.message}`;\n } else if (innerError !== undefined) {\n result += `\\nError: ${getErrorMessage(innerError)}`;\n }\n result += `\\nKeylessErrorResolutionTip: ${tip}`;\n return result;\n }\n\n /**\n * Static constructor that creates a KeylessError instance using the KeylessErrors constant\n * @param args.type The type of KeylessError\n * @param args.aptosApiError optional AptosApiError supplied for api errors\n * @param args.details optional details to include in the error message\n * @returns A new KeylessError instance\n */\n static fromErrorType(args: { type: KeylessErrorType; error?: unknown; details?: string }): KeylessError {\n const { error, type, details } = args;\n\n const [message, category, resolutionTip] = KeylessErrors[type];\n return new KeylessError({\n message,\n details,\n innerError: error,\n category,\n resolutionTip,\n type,\n });\n }\n}\n\n/**\n * Options for handling errors in the Aptos API.\n */\ntype AptosApiErrorOpts = {\n apiType: AptosApiType;\n aptosRequest: AptosRequest;\n aptosResponse: AptosResponse<any, any>;\n};\n\n/**\n * Represents an error returned from the Aptos API.\n * This class encapsulates the details of the error, including the request URL, response status, and additional data.\n *\n * @param name - The name of the error, which is always \"AptosApiError\".\n * @param url - The URL to which the request was made.\n * @param status - The HTTP response status code (e.g., 400).\n * @param statusText - The message associated with the response status.\n * @param data - The response data returned from the API.\n * @param request - The original AptosRequest that triggered the error.\n */\nexport class AptosApiError extends Error {\n readonly url: string;\n\n readonly status: number;\n\n readonly statusText: string;\n\n readonly data: any;\n\n readonly request: AptosRequest;\n\n /**\n * Constructs an instance of AptosApiError with relevant error details.\n *\n * @param opts - The options for creating the AptosApiError.\n * @param opts.apiType - The type of API that generated the error.\n * @param opts.aptosRequest - The request object that caused the error.\n * @param opts.aptosResponse - The response object containing error details.\n *\n * @internal This constructor is for SDK internal use - do not instantiate outside the SDK codebase.\n */\n constructor({ apiType, aptosRequest, aptosResponse }: AptosApiErrorOpts) {\n super(deriveErrorMessage({ apiType, aptosRequest, aptosResponse }));\n\n this.name = \"AptosApiError\";\n this.url = aptosResponse.url;\n this.status = aptosResponse.status;\n this.statusText = aptosResponse.statusText;\n this.data = aptosResponse.data;\n this.request = aptosRequest;\n }\n}\n\n/**\n * Derives an error message from the Aptos API response, providing context for debugging.\n * This function helps in understanding the nature of the error encountered during an API request.\n *\n * @param {AptosApiErrorOpts} opts - The options for deriving the error message.\n * @param {AptosApiType} opts.apiType - The type of API being called.\n * @param {AptosRequest} opts.aptosRequest - The original request made to the Aptos API.\n * @param {AptosResponse} opts.aptosResponse - The response received from the Aptos API.\n */\nfunction deriveErrorMessage({ apiType, aptosRequest, aptosResponse }: AptosApiErrorOpts): string {\n // eslint-disable-next-line max-len\n // extract the W3C trace_id from the response headers if it exists. Some services set this in the response, and it's useful for debugging.\n // See https://www.w3.org/TR/trace-context/#relationship-between-the-headers .\n const traceId = aptosResponse.headers?.traceparent?.split(\"-\")[1];\n const traceIdString = traceId ? `(trace_id:${traceId}) ` : \"\";\n\n const errorPrelude: string = `Request to [${apiType}]: ${aptosRequest.method} ${\n aptosResponse.url ?? aptosRequest.url\n } ${traceIdString}failed with`;\n\n // handle graphql responses from indexer api and extract the error message of the first error\n if (apiType === AptosApiType.INDEXER && aptosResponse.data?.errors?.[0]?.message != null) {\n return `${errorPrelude}: ${aptosResponse.data.errors[0].message}`;\n }\n\n // Received well-known structured error response body - simply serialize and return it.\n // We don't need http status codes etc. in this case.\n if (aptosResponse.data?.message != null && aptosResponse.data?.error_code != null) {\n return `${errorPrelude}: ${JSON.stringify(aptosResponse.data)}`;\n }\n\n // This is the generic/catch-all case. We received some response from the API, but it doesn't appear to be a well-known structure.\n // We print http status codes and the response body (after some trimming),\n // in the hope that this gives enough context what went wrong without printing overly huge messages.\n return `${errorPrelude} status: ${aptosResponse.statusText}(code:${\n aptosResponse.status\n }) and response body: ${serializeAnyPayloadForErrorMessage(aptosResponse.data)}`;\n}\n\nconst SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH = 400;\n\n/**\n * This function accepts a payload of any type (probably an object) and serializes it to a string\n * Since we don't know the type or size of the payload, and we don't want to add a huge object in full to the error message\n * we limit the to the first 200 and last 200 characters of the serialized payload and put a \"...\" in the middle.\n * @param payload - The payload to serialize, which can be of any type.\n *\n * @returns A string representation of the serialized payload, potentially truncated.\n */\nfunction serializeAnyPayloadForErrorMessage(payload: any): string {\n const serializedPayload = JSON.stringify(payload);\n if (serializedPayload.length <= SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH) {\n return serializedPayload;\n }\n return `truncated(original_size:${serializedPayload.length}): ${serializedPayload.slice(\n 0,\n SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH / 2,\n )}...${serializedPayload.slice(-SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH / 2)}`;\n}\n"],"mappings":";;;;;AAIO,IAAK,uBAAL,kBAAKA,0BAAL;AACL,EAAAA,4CAAA;AACA,EAAAA,4CAAA;AACA,EAAAA,4CAAA;AACA,EAAAA,4CAAA;AACA,EAAAA,4CAAA;AACA,EAAAA,4CAAA;AANU,SAAAA;AAAA,GAAA;AASL,IAAK,4BAAL,kBAAKC,+BAAL;AACL,EAAAA,2BAAA,oBAAiB;AAEjB,EAAAA,2BAAA,2BAAwB;AACxB,EAAAA,2BAAA,2BAAwB;AAExB,EAAAA,2BAAA,yBAAsB;AAEtB,EAAAA,2BAAA,kBAAe;AAEf,EAAAA,2BAAA,mBAAgB;AAChB,EAAAA,2BAAA,mBAAgB;AAChB,EAAAA,2BAAA,wBAAqB;AACrB,EAAAA,2BA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AAO;AAE3D,QAAM,eAAuB,eAAe,OAAO,MAAM,aAAa,MAAM,IAC1E,cAAc,OAAO,aAAa,GACpC,IAAI,aAAa;AAGjB,MAAI,uCAAoC,cAAc,MAAM,SAAS,CAAC,GAAG,WAAW,MAAM;AACxF,WAAO,GAAG,YAAY,KAAK,cAAc,KAAK,OAAO,CAAC,EAAE,OAAO;AAAA,EACjE;AAIA,MAAI,cAAc,MAAM,WAAW,QAAQ,cAAc,MAAM,cAAc,MAAM;AACjF,WAAO,GAAG,YAAY,KAAK,KAAK,UAAU,cAAc,IAAI,CAAC;AAAA,EAC/D;AAKA,SAAO,GAAG,YAAY,YAAY,cAAc,UAAU,SACxD,cAAc,MAChB,wBAAwB,mCAAmC,cAAc,IAAI,CAAC;AAChF;AAEA,IAAM,wCAAwC;AAU9C,SAAS,mCAAmC,SAAsB;AAChE,QAAM,oBAAoB,KAAK,UAAU,OAAO;AAChD,MAAI,kBAAkB,UAAU,uCAAuC;AACrE,WAAO;AAAA,EACT;AACA,SAAO,2BAA2B,kBAAkB,MAAM,MAAM,kBAAkB;AAAA,IAChF;AAAA,IACA,wCAAwC;AAAA,EAC1C,CAAC,MAAM,kBAAkB,MAAM,CAAC,wCAAwC,CAAC,CAAC;AAC5E;","names":["KeylessErrorCategory","KeylessErrorResolutionTip","KeylessErrorType"]}
|
|
1
|
+
{"version":3,"sources":["../../src/errors/index.ts"],"sourcesContent":["import { AptosApiType } from \"../utils/const\";\nimport { getErrorMessage } from \"../utils/helpers\";\nimport { AptosRequest, AptosResponse } from \"../types\";\n\nexport enum KeylessErrorCategory {\n API_ERROR,\n EXTERNAL_API_ERROR,\n SESSION_EXPIRED,\n INVALID_STATE,\n INVALID_SIGNATURE,\n UNKNOWN,\n}\n\nexport enum KeylessErrorResolutionTip {\n REAUTHENTICATE = \"Re-authentiate to continue using your keyless account\",\n // eslint-disable-next-line max-len\n REAUTHENTICATE_UNSURE = \"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support\",\n UPDATE_REQUEST_PARAMS = \"Update the invalid request parameters and reauthenticate.\",\n // eslint-disable-next-line max-len\n RATE_LIMIT_EXCEEDED = \"Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest.\",\n // eslint-disable-next-line max-len\n SERVER_ERROR = \"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx\",\n // eslint-disable-next-line max-len\n CALL_PRECHECK = \"Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing.\",\n REINSTANTIATE = \"Try instantiating the account again. Avoid manipulating the account object directly\",\n JOIN_SUPPORT_GROUP = \"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx\",\n UNKNOWN = \"Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx\",\n}\n\nexport enum KeylessErrorType {\n EPHEMERAL_KEY_PAIR_EXPIRED,\n\n PROOF_NOT_FOUND,\n\n ASYNC_PROOF_FETCH_FAILED,\n\n INVALID_PROOF_VERIFICATION_FAILED,\n\n INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND,\n\n INVALID_JWT_SIG,\n\n INVALID_JWT_JWK_NOT_FOUND,\n\n INVALID_JWT_ISS_NOT_RECOGNIZED,\n\n INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED,\n\n INVALID_TW_SIG_VERIFICATION_FAILED,\n\n INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND,\n\n INVALID_EXPIRY_HORIZON,\n\n JWT_PARSING_ERROR,\n\n JWK_FETCH_FAILED,\n\n JWK_FETCH_FAILED_FEDERATED,\n\n RATE_LIMIT_EXCEEDED,\n\n PEPPER_SERVICE_INTERNAL_ERROR,\n\n PEPPER_SERVICE_BAD_REQUEST,\n\n PEPPER_SERVICE_OTHER,\n\n PROVER_SERVICE_INTERNAL_ERROR,\n\n PROVER_SERVICE_BAD_REQUEST,\n\n PROVER_SERVICE_OTHER,\n\n FULL_NODE_CONFIG_LOOKUP_ERROR,\n\n FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR,\n\n FULL_NODE_JWKS_LOOKUP_ERROR,\n\n FULL_NODE_OTHER,\n\n SIGNATURE_TYPE_INVALID,\n\n SIGNATURE_EXPIRED,\n\n MAX_EXPIRY_HORIZON_EXCEEDED,\n\n EPHEMERAL_SIGNATURE_VERIFICATION_FAILED,\n\n TRAINING_WHEELS_SIGNATURE_MISSING,\n\n TRAINING_WHEELS_SIGNATURE_VERIFICATION_FAILED,\n\n PROOF_VERIFICATION_FAILED,\n\n UNKNOWN,\n}\n\nconst KeylessErrors: { [key in KeylessErrorType]: [string, KeylessErrorCategory, KeylessErrorResolutionTip] } = {\n [KeylessErrorType.EPHEMERAL_KEY_PAIR_EXPIRED]: [\n \"The ephemeral keypair has expired.\",\n KeylessErrorCategory.SESSION_EXPIRED,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.PROOF_NOT_FOUND]: [\n \"The required proof could not be found.\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.CALL_PRECHECK,\n ],\n [KeylessErrorType.ASYNC_PROOF_FETCH_FAILED]: [\n \"The required proof failed to fetch.\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.REAUTHENTICATE_UNSURE,\n ],\n [KeylessErrorType.INVALID_PROOF_VERIFICATION_FAILED]: [\n \"The provided proof is invalid.\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.REAUTHENTICATE_UNSURE,\n ],\n [KeylessErrorType.INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND]: [\n \"The verification key used to authenticate was updated.\",\n KeylessErrorCategory.SESSION_EXPIRED,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.INVALID_JWT_SIG]: [\n \"The JWK was found, but JWT failed verification\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.REAUTHENTICATE_UNSURE,\n ],\n [KeylessErrorType.INVALID_JWT_JWK_NOT_FOUND]: [\n \"The JWK required to verify the JWT could not be found. The JWK may have been rotated out.\",\n KeylessErrorCategory.SESSION_EXPIRED,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.INVALID_JWT_ISS_NOT_RECOGNIZED]: [\n \"The JWT issuer is not recognized.\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.UPDATE_REQUEST_PARAMS,\n ],\n [KeylessErrorType.INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED]: [\n \"The JWT issuer is not supported by the Federated Keyless \",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.REAUTHENTICATE_UNSURE,\n ],\n [KeylessErrorType.INVALID_TW_SIG_VERIFICATION_FAILED]: [\n \"The training wheels signature is invalid.\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.REAUTHENTICATE_UNSURE,\n ],\n [KeylessErrorType.INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND]: [\n \"The public key used to verify the training wheels signature was not found.\",\n KeylessErrorCategory.SESSION_EXPIRED,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.INVALID_EXPIRY_HORIZON]: [\n \"The expiry horizon is invalid.\",\n KeylessErrorCategory.SESSION_EXPIRED,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.JWK_FETCH_FAILED]: [\n \"Failed to fetch JWKS.\",\n KeylessErrorCategory.EXTERNAL_API_ERROR,\n KeylessErrorResolutionTip.JOIN_SUPPORT_GROUP,\n ],\n [KeylessErrorType.JWK_FETCH_FAILED_FEDERATED]: [\n \"Failed to fetch JWKS for Federated Keyless provider.\",\n KeylessErrorCategory.EXTERNAL_API_ERROR,\n KeylessErrorResolutionTip.JOIN_SUPPORT_GROUP,\n ],\n [KeylessErrorType.RATE_LIMIT_EXCEEDED]: [\n \"Rate limit exceeded. Too many requests in a short period.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.RATE_LIMIT_EXCEEDED,\n ],\n [KeylessErrorType.PEPPER_SERVICE_INTERNAL_ERROR]: [\n \"Internal error from Pepper service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.PEPPER_SERVICE_BAD_REQUEST]: [\n \"Bad request sent to Pepper service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.UPDATE_REQUEST_PARAMS,\n ],\n [KeylessErrorType.PEPPER_SERVICE_OTHER]: [\n \"Unknown error from Pepper service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.PROVER_SERVICE_INTERNAL_ERROR]: [\n \"Internal error from Prover service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.PROVER_SERVICE_BAD_REQUEST]: [\n \"Bad request sent to Prover service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.UPDATE_REQUEST_PARAMS,\n ],\n [KeylessErrorType.PROVER_SERVICE_OTHER]: [\n \"Unknown error from Prover service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.JWT_PARSING_ERROR]: [\n \"Error when parsing JWT. This should never happen. Join https://t.me/+h5CN-W35yUFiYzkx for support\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.REINSTANTIATE,\n ],\n [KeylessErrorType.FULL_NODE_CONFIG_LOOKUP_ERROR]: [\n \"Error when looking up on-chain keyless configuration.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR]: [\n \"Error when looking up on-chain verification key.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.FULL_NODE_JWKS_LOOKUP_ERROR]: [\n \"Error when looking up on-chain JWKS.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.FULL_NODE_OTHER]: [\n \"Unknown error from full node.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.SIGNATURE_TYPE_INVALID]: [\n \"The signature is not a valid Keyless signature.\",\n KeylessErrorCategory.INVALID_SIGNATURE,\n KeylessErrorResolutionTip.JOIN_SUPPORT_GROUP,\n ],\n [KeylessErrorType.SIGNATURE_EXPIRED]: [\n \"The ephemeral key pair used to sign the message has expired.\",\n KeylessErrorCategory.INVALID_SIGNATURE,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.MAX_EXPIRY_HORIZON_EXCEEDED]: [\n \"The expiry horizon on the signature exceeds the maximum allowed value.\",\n KeylessErrorCategory.INVALID_SIGNATURE,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.EPHEMERAL_SIGNATURE_VERIFICATION_FAILED]: [\n \"Failed to verify the ephemeral signature with the ephemeral public key.\",\n KeylessErrorCategory.INVALID_SIGNATURE,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.TRAINING_WHEELS_SIGNATURE_MISSING]: [\n \"The training wheels signature is missing but is required by the Keyless configuration.\",\n KeylessErrorCategory.INVALID_SIGNATURE,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.TRAINING_WHEELS_SIGNATURE_VERIFICATION_FAILED]: [\n \"Failed to verify the training wheels signature with the training wheels public key.\",\n KeylessErrorCategory.INVALID_SIGNATURE,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.PROOF_VERIFICATION_FAILED]: [\n \"The proof verification failed.\",\n KeylessErrorCategory.INVALID_SIGNATURE,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.UNKNOWN]: [\n \"An unknown error has occurred.\",\n KeylessErrorCategory.UNKNOWN,\n KeylessErrorResolutionTip.UNKNOWN,\n ],\n};\n\nexport class KeylessError extends Error {\n readonly innerError?: unknown;\n\n readonly category: KeylessErrorCategory;\n\n readonly resolutionTip: KeylessErrorResolutionTip;\n\n readonly type: KeylessErrorType;\n\n readonly details?: string;\n\n /** @internal this constructor is for sdk internal use - do not instantiate outside of the SDK codebase */\n constructor(args: {\n innerError?: unknown;\n category: KeylessErrorCategory;\n resolutionTip: KeylessErrorResolutionTip;\n type: KeylessErrorType;\n message?: string;\n details?: string;\n }) {\n const { innerError, category, resolutionTip, type, message = KeylessErrors[type][0], details } = args;\n super(message);\n this.name = \"KeylessError\";\n this.innerError = innerError;\n this.category = category;\n this.resolutionTip = resolutionTip;\n this.type = type;\n this.details = details;\n this.message = KeylessError.constructMessage(message, resolutionTip, innerError, details);\n }\n\n static constructMessage(\n message: string,\n tip: KeylessErrorResolutionTip,\n innerError?: unknown,\n details?: string,\n ): string {\n let result = `\\nMessage: ${message}`;\n if (details) {\n result += `\\nDetails: ${details}`;\n }\n if (innerError instanceof AptosApiError) {\n result += `\\nAptosApiError: ${innerError.message}`;\n } else if (innerError !== undefined) {\n result += `\\nError: ${getErrorMessage(innerError)}`;\n }\n result += `\\nKeylessErrorResolutionTip: ${tip}`;\n return result;\n }\n\n /**\n * Static constructor that creates a KeylessError instance using the KeylessErrors constant\n * @param args.type The type of KeylessError\n * @param args.aptosApiError optional AptosApiError supplied for api errors\n * @param args.details optional details to include in the error message\n * @returns A new KeylessError instance\n */\n static fromErrorType(args: { type: KeylessErrorType; error?: unknown; details?: string }): KeylessError {\n const { error, type, details } = args;\n\n const [message, category, resolutionTip] = KeylessErrors[type];\n return new KeylessError({\n message,\n details,\n innerError: error,\n category,\n resolutionTip,\n type,\n });\n }\n}\n\n/**\n * Options for handling errors in the Aptos API.\n */\ntype AptosApiErrorOpts = {\n apiType: AptosApiType;\n aptosRequest: AptosRequest;\n aptosResponse: AptosResponse<any, any>;\n};\n\n/**\n * Represents an error returned from the Aptos API.\n * This class encapsulates the details of the error, including the request URL, response status, and additional data.\n *\n * @param name - The name of the error, which is always \"AptosApiError\".\n * @param url - The URL to which the request was made.\n * @param status - The HTTP response status code (e.g., 400).\n * @param statusText - The message associated with the response status.\n * @param data - The response data returned from the API.\n * @param request - The original AptosRequest that triggered the error.\n */\nexport class AptosApiError extends Error {\n readonly url: string;\n\n readonly status: number;\n\n readonly statusText: string;\n\n readonly data: any;\n\n readonly request: AptosRequest;\n\n /**\n * Constructs an instance of AptosApiError with relevant error details.\n *\n * @param opts - The options for creating the AptosApiError.\n * @param opts.apiType - The type of API that generated the error.\n * @param opts.aptosRequest - The request object that caused the error.\n * @param opts.aptosResponse - The response object containing error details.\n *\n * @internal This constructor is for SDK internal use - do not instantiate outside the SDK codebase.\n */\n constructor({ apiType, aptosRequest, aptosResponse }: AptosApiErrorOpts) {\n super(deriveErrorMessage({ apiType, aptosRequest, aptosResponse }));\n\n this.name = \"AptosApiError\";\n this.url = aptosResponse.url;\n this.status = aptosResponse.status;\n this.statusText = aptosResponse.statusText;\n this.data = aptosResponse.data;\n this.request = aptosRequest;\n }\n}\n\n/**\n * Derives an error message from the Aptos API response, providing context for debugging.\n * This function helps in understanding the nature of the error encountered during an API request.\n *\n * @param {AptosApiErrorOpts} opts - The options for deriving the error message.\n * @param {AptosApiType} opts.apiType - The type of API being called.\n * @param {AptosRequest} opts.aptosRequest - The original request made to the Aptos API.\n * @param {AptosResponse} opts.aptosResponse - The response received from the Aptos API.\n */\nfunction deriveErrorMessage({ apiType, aptosRequest, aptosResponse }: AptosApiErrorOpts): string {\n // eslint-disable-next-line max-len\n // extract the W3C trace_id from the response headers if it exists. Some services set this in the response, and it's useful for debugging.\n // See https://www.w3.org/TR/trace-context/#relationship-between-the-headers .\n const traceId = aptosResponse.headers?.traceparent?.split(\"-\")[1];\n const traceIdString = traceId ? `(trace_id:${traceId}) ` : \"\";\n\n const errorPrelude: string = `Request to [${apiType}]: ${aptosRequest.method} ${\n aptosResponse.url ?? aptosRequest.url\n } ${traceIdString}failed with`;\n\n // handle graphql responses from indexer api and extract the error message of the first error\n if (apiType === AptosApiType.INDEXER && aptosResponse.data?.errors?.[0]?.message != null) {\n return `${errorPrelude}: ${aptosResponse.data.errors[0].message}`;\n }\n\n // Received well-known structured error response body - simply serialize and return it.\n // We don't need http status codes etc. in this case.\n if (aptosResponse.data?.message != null && aptosResponse.data?.error_code != null) {\n return `${errorPrelude}: ${JSON.stringify(aptosResponse.data)}`;\n }\n\n // This is the generic/catch-all case. We received some response from the API, but it doesn't appear to be a well-known structure.\n // We print http status codes and the response body (after some trimming),\n // in the hope that this gives enough context what went wrong without printing overly huge messages.\n return `${errorPrelude} status: ${aptosResponse.statusText}(code:${\n aptosResponse.status\n }) and response body: ${serializeAnyPayloadForErrorMessage(aptosResponse.data)}`;\n}\n\nconst SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH = 400;\n\n/**\n * This function accepts a payload of any type (probably an object) and serializes it to a string\n * Since we don't know the type or size of the payload, and we don't want to add a huge object in full to the error message\n * we limit the to the first 200 and last 200 characters of the serialized payload and put a \"...\" in the middle.\n * @param payload - The payload to serialize, which can be of any type.\n *\n * @returns A string representation of the serialized payload, potentially truncated.\n */\nfunction serializeAnyPayloadForErrorMessage(payload: any): string {\n const serializedPayload = JSON.stringify(payload);\n if (serializedPayload.length <= SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH) {\n return serializedPayload;\n }\n return `truncated(original_size:${serializedPayload.length}): ${serializedPayload.slice(\n 0,\n SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH / 2,\n )}...${serializedPayload.slice(-SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH / 2)}`;\n}\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ACtD,6EACA,EACA,uDACF,EACC,GAA0C,CACzC,iCACA,EACA,uDACF,EACC,GAAoC,CACnC,wBACA,EACA,uEACF,EACC,GAA8C,CAC7C,uDACA,EACA,uEACF,EACC,GAAuC,CACtC,4DACA,EACA,gPACF,EACC,GAAiD,CAChD,sCACA,EACA,8IACF,EACC,GAA8C,CAC7C,sCACA,EACA,2DACF,EACC,GAAwC,CACvC,qCACA,EACA,8IACF,EACC,GAAiD,CAChD,sCACA,EACA,8IACF,EACC,GAA8C,CAC7C,sCACA,EACA,2DACF,EACC,GAAwC,CACvC,qCACA,EACA,8IACF,EACC,GAAqC,CACpC,oGACA,EACA,sFACF,EACC,GAAiD,CAChD,wDACA,EACA,8IACF,EACC,GAA2D,CAC1D,mDACA,EACA,8IACF,EACC,GAA+C,CAC9C,uCACA,EACA,8IACF,EACC,GAAmC,CAClC,gCACA,EACA,8IACF,EACC,GAA0C,CACzC,kDACA,EACA,uEACF,EACC,GAAqC,CACpC,+DACA,EACA,uDACF,EACC,GAA+C,CAC9C,yEACA,EACA,uDACF,EACC,GAA2D,CAC1D,0EACA,EACA,uDACF,EACC,GAAqD,CACpD,yFACA,EACA,uDACF,EACC,GAAiE,CAChE,sFACA,EACA,uDACF,EACC,GAA6C,CAC5C,iCACA,EACA,uDACF,EACC,GAA2B,CAC1B,iCACA,EACA,sFACF,CACF,EAEaC,EAAN,MAAMC,UAAqB,KAAM,CAYtC,YAAYC,EAOT,CACD,GAAM,CAAE,WAAAC,EAAY,SAAAC,EAAU,cAAAC,EAAe,KAAAC,EAAM,QAAAC,EAAUR,EAAcO,CAAI,EAAE,CAAC,EAAG,QAAAE,CAAQ,EAAIN,EACjG,MAAMK,CAAO,EACb,KAAK,KAAO,eACZ,KAAK,WAAaJ,EAClB,KAAK,SAAWC,EAChB,KAAK,cAAgBC,EACrB,KAAK,KAAOC,EACZ,KAAK,QAAUE,EACf,KAAK,QAAUP,EAAa,iBAAiBM,EAASF,EAAeF,EAAYK,CAAO,CAC1F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,CAAY,KAAKJ,EAAc,KAAK,OAAO,CAAC,EAAE,OAAO,GAK7DA,EAAc,MAAM,SAAW,MAAQA,EAAc,MAAM,YAAc,KACpE,GAAGI,CAAY,KAAK,KAAK,UAAUJ,EAAc,IAAI,CAAC,GAMxD,GAAGI,CAAY,YAAYJ,EAAc,UAAU,SACxDA,EAAc,MAChB,wBAAwBK,EAAmCL,EAAc,IAAI,CAAC,EAChF,CAEA,IAAMM,EAAwC,IAU9C,SAASD,EAAmCE,EAAsB,CAChE,IAAMC,EAAoB,KAAK,UAAUD,CAAO,EAChD,OAAIC,EAAkB,QAAUF,EACvBE,EAEF,2BAA2BA,EAAkB,MAAM,MAAMA,EAAkB,MAChF,EACAF,EAAwC,CAC1C,CAAC,MAAME,EAAkB,MAAM,CAACF,EAAwC,CAAC,CAAC,EAC5E","names":["KeylessErrorCategory","KeylessErrorResolutionTip","KeylessErrorType","KeylessErrors","KeylessError","_KeylessError","args","innerError","category","resolutionTip","type","message","details","tip","result","AptosApiError","getErrorMessage","error","apiType","aptosRequest","aptosResponse","deriveErrorMessage","traceId","traceIdString","errorPrelude","serializeAnyPayloadForErrorMessage","SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH","payload","serializedPayload"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as i}from"./chunk-HNBVYE3N.mjs";import{b as r}from"./chunk-RGKRCZ36.mjs";import{decode as u}from"js-base64";async function f(n){return new Promise(e=>{setTimeout(e,n)})}function A(n){return n instanceof Error?n.message:String(n)}var _=()=>Math.floor(Date.now()/1e3);function x(n){let e=new Date(n*1e3);return e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),Math.floor(e.getTime()/1e3)}function S(n){let e=n.replace(/-/g,"+").replace(/_/g,"/"),t=e+"==".substring(0,(3-e.length%3)%3);return u(t)}function h(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");for(;e.length%4!==0;)e+="=";return new Uint8Array(Buffer.from(e,"base64"))}var T=(n,e)=>n*10**e,b=(n,e)=>n/10**e,a=n=>{let e="";for(let t=2;t<n.length;t+=2)e+=String.fromCharCode(parseInt(n.substring(t,t+2),16));return e},M=n=>{let{account_address:e,module_name:t,struct_name:o}=n,s=a(t),c=a(o);return`${e}::${s}::${c}`},y=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null&&"account_address"in n&&"module_name"in n&&"struct_name"in n&&typeof n.account_address=="string"&&typeof n.module_name=="string"&&typeof n.struct_name=="string";function v(n){let e=n.split("::");if(e.length!==3)throw new Error(`Invalid function ${n}`);let t=e[0],o=e[1],s=e[2];return{moduleAddress:t,moduleName:o,functionName:s}}function w(n){let e=n.split("::");return e.length===3&&r.isValid({input:e[0]}).valid}function E(n,e=6,t=5){return`${n.slice(0,e)}...${n.slice(-t)}`}var d="0x1::aptos_coin::AptosCoin",I=r.A.toStringLong();function m(n){let e=/0x[0-9a-fA-F]+/g;return n.replace(e,t=>r.from(t,{maxMissingChars:63}).toStringShort())}function $(n){let e=m(n);return e===d?r.A:i(r.A,e)}export{f as a,A as b,_ as c,x as d,S as e,h as f,T as g,b as h,M as i,y as j,v as k,w as l,E as m,$ as n};
|
|
2
|
+
//# sourceMappingURL=chunk-7DQDJ2SA.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/helpers.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { decode } from \"js-base64\";\nimport { MoveFunctionId, MoveStructId } from \"../types\";\nimport { AccountAddress } from \"../core/accountAddress\";\nimport { createObjectAddress } from \"../core/account/utils/address\";\n\n/**\n * Sleep for the specified amount of time in milliseconds.\n * This function can be used to introduce delays in asynchronous operations.\n *\n * @param timeMs - The time in milliseconds to sleep.\n * @group Implementation\n * @category Utils\n */\nexport async function sleep(timeMs: number): Promise<null> {\n return new Promise((resolve) => {\n setTimeout(resolve, timeMs);\n });\n}\n\n/**\n * Get the error message from an unknown error.\n *\n * @param error The error to get the message from\n * @returns The error message\n * @group Implementation\n * @category Utils\n */\nexport function getErrorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\n/**\n * @group Implementation\n * @category Utils\n */\nexport const nowInSeconds = () => Math.floor(Date.now() / 1000);\n\n/**\n * Floors the given timestamp to the nearest whole hour.\n * This function is useful for normalizing timestamps to hourly intervals.\n *\n * @param timestampInSeconds - The timestamp in seconds to be floored.\n * @group Implementation\n * @category Utils\n */\nexport function floorToWholeHour(timestampInSeconds: number): number {\n const date = new Date(timestampInSeconds * 1000);\n // Reset minutes and seconds to zero\n date.setMinutes(0);\n date.setSeconds(0);\n date.setMilliseconds(0);\n return Math.floor(date.getTime() / 1000);\n}\n\n/**\n * Decodes a base64 URL-encoded string into its original form.\n * This function is useful for converting base64 URL-encoded data back to a readable format.\n *\n * @param base64Url - The base64 URL-encoded string to decode.\n * @returns The decoded string.\n * @group Implementation\n * @category Utils\n */\nexport function base64UrlDecode(base64Url: string): string {\n // Replace base64url-specific characters\n const base64 = base64Url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n // Pad the string with '=' characters if needed\n const paddedBase64 = base64 + \"==\".substring(0, (3 - (base64.length % 3)) % 3);\n const decodedString = decode(paddedBase64);\n return decodedString;\n}\n\nexport function base64UrlToBytes(base64Url: string): Uint8Array {\n // Convert Base64Url to Base64\n let base64 = base64Url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n // Add padding if needed\n while (base64.length % 4 !== 0) {\n base64 += \"=\";\n }\n // Use Buffer to convert base64 to Uint8Array\n return new Uint8Array(Buffer.from(base64, \"base64\"));\n}\n\n/**\n * Amount is represented in the smallest unit format on chain, this function converts\n * a human-readable amount format to the smallest unit format\n * @example\n * human-readable amount format: 500\n * on chain amount format when decimal is 8: 50000000000\n *\n * @param value The value in human-readable format\n * @param decimal The token decimal\n * @returns The value in the smallest units\n * @group Implementation\n * @category Utils\n */\nexport const convertAmountFromHumanReadableToOnChain = (value: number, decimal: number) => value * 10 ** decimal;\n\n/**\n * Amount is represented in the smallest unit format on chain, this function converts\n * the smallest unit format to a human-readable amount format\n * @example\n * human-readable amount format: 500\n * on chain amount format when decimal is 8: 50000000000\n *\n * @param value The value in human-readable format\n * @param decimal The token decimal\n * @returns The value in the smallest units\n * @group Implementation\n * @category Utils\n */\nexport const convertAmountFromOnChainToHumanReadable = (value: number, decimal: number) => value / 10 ** decimal;\n\n/**\n * Convert a hex string to an ascii string with the `0x` prefix.\n *\n * `0x6170746f735f636f696e` --> `aptos_coin`\n *\n * @param hex The hex string to convert (e.g. `0x6170746f735f636f696e`)\n * @returns The ascii string\n * @group Implementation\n * @category Utils\n */\nconst hexToAscii = (hex: string) => {\n let str = \"\";\n for (let n = 2; n < hex.length; n += 2) {\n str += String.fromCharCode(parseInt(hex.substring(n, n + 2), 16));\n }\n return str;\n};\n\n/**\n * Convert an encoded struct to a MoveStructId.\n *\n * @example\n * const structObj = {\n * account_address: \"0x1\",\n * module_name: \"0x6170746f735f636f696e\",\n * struct_name: \"0x4170746f73436f696e\",\n * };\n * // structId is \"0x1::aptos_coin::AptosCoin\"\n * const structId = parseEncodedStruct(structObj);\n *\n * @param structObj The struct with account_address, module_name, and struct_name properties\n * @returns The MoveStructId\n * @group Implementation\n * @category Utils\n */\nexport const parseEncodedStruct = (structObj: {\n account_address: string;\n module_name: string;\n struct_name: string;\n}): MoveStructId => {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { account_address, module_name, struct_name } = structObj;\n const moduleName = hexToAscii(module_name);\n const structName = hexToAscii(struct_name);\n return `${account_address}::${moduleName}::${structName}`;\n};\n\n/**\n * Determines whether the given object is an encoded struct type with the following properties:\n * - account_address: string\n * - module_name: string\n * - struct_name: string\n *\n * @param structObj The object to check\n * @returns Whether the object is an encoded struct type\n * @group Implementation\n * @category Utils\n */\nexport const isEncodedStruct = (\n structObj: any,\n): structObj is {\n account_address: string;\n module_name: string;\n struct_name: string;\n} =>\n typeof structObj === \"object\" &&\n !Array.isArray(structObj) &&\n structObj !== null &&\n \"account_address\" in structObj &&\n \"module_name\" in structObj &&\n \"struct_name\" in structObj &&\n typeof structObj.account_address === \"string\" &&\n typeof structObj.module_name === \"string\" &&\n typeof structObj.struct_name === \"string\";\n\n/**\n * Splits a function identifier into its constituent parts: module address, module name, and function name.\n * This function helps in validating and extracting details from a function identifier string.\n *\n * @param functionArg - The function identifier string in the format \"moduleAddress::moduleName::functionName\".\n * @returns An object containing the module address, module name, and function name.\n * @throws Error if the function identifier does not contain exactly three parts.\n * @group Implementation\n * @category Transactions\n */\nexport function getFunctionParts(functionArg: MoveFunctionId) {\n const funcNameParts = functionArg.split(\"::\");\n if (funcNameParts.length !== 3) {\n throw new Error(`Invalid function ${functionArg}`);\n }\n const moduleAddress = funcNameParts[0];\n const moduleName = funcNameParts[1];\n const functionName = funcNameParts[2];\n return { moduleAddress, moduleName, functionName };\n}\n\n/**\n * Validates the provided function information.\n *\n * @param functionInfo - The function information to validate.\n * @returns Whether the function information is valid.\n * @group Implementation\n * @category Utils\n */\nexport function isValidFunctionInfo(functionInfo: string): boolean {\n const parts = functionInfo.split(\"::\");\n return parts.length === 3 && AccountAddress.isValid({ input: parts[0] }).valid;\n}\n\n/**\n * Truncates the provided wallet address at the middle with an ellipsis.\n *\n * @param address - The wallet address to truncate.\n * @param start - The number of characters to show at the beginning of the address.\n * @param end - The number of characters to show at the end of the address.\n * @returns The truncated address.\n * @group Implementation\n * @category Utils\n */\nexport function truncateAddress(address: string, start: number = 6, end: number = 5) {\n return `${address.slice(0, start)}...${address.slice(-end)}`;\n}\n\n/**\n * Constants for metadata address calculation\n */\nconst APTOS_COIN_TYPE_STR = \"0x1::aptos_coin::AptosCoin\";\nconst APT_METADATA_ADDRESS_HEX = AccountAddress.A.toStringLong();\n\n/**\n * Helper function to standardize Move type string by converting all addresses to short form,\n * including addresses within nested type parameters\n */\nfunction standardizeMoveTypeString(input: string): string {\n // Regular expression to match addresses in the type string, including those within type parameters\n // This regex matches \"0x\" followed by hex digits, handling both standalone addresses and those within <>\n const addressRegex = /0x[0-9a-fA-F]+/g;\n\n return input.replace(addressRegex, (match) => {\n // Use AccountAddress to handle the address\n return AccountAddress.from(match, { maxMissingChars: 63 }).toStringShort();\n });\n}\n\n/**\n * Calculates the paired FA metadata address for a given coin type.\n * This function is tolerant of various address formats in the coin type string,\n * including complex nested types.\n *\n * @example\n * // All these formats are valid and will produce the same result:\n * pairedFaMetadataAddress(\"0x1::aptos_coin::AptosCoin\") // simple form\n * pairedFaMetadataAddress(\"0x0000000000000000000000000000000000000000000000000000000000000001::aptos_coin::AptosCoin\") // long form\n * pairedFaMetadataAddress(\"0x00001::aptos_coin::AptosCoin\") // with leading zeros\n * pairedFaMetadataAddress(\"0x1::coin::Coin<0x1412::a::struct<0x0001::aptos_coin::AptosCoin>>\") // nested type parameters\n *\n * @param coinType - The coin type string in any of these formats:\n * - Short form address: \"0x1::aptos_coin::AptosCoin\"\n * - Long form address: \"0x0000000000000000000000000000000000000000000000000000000000000001::aptos_coin::AptosCoin\"\n * - With leading zeros: \"0x00001::aptos_coin::AptosCoin\"\n * - With nested types: \"0x1::coin::Coin<0x1412::a::struct<0x0001::aptos_coin::AptosCoin>>\"\n * @returns The calculated metadata address as an AccountAddress instance\n */\nexport function pairedFaMetadataAddress(coinType: `0x${string}::${string}::${string}`): AccountAddress {\n // Standardize the coin type string to handle any address format\n const standardizedMoveTypeName = standardizeMoveTypeString(coinType);\n\n return standardizedMoveTypeName === APTOS_COIN_TYPE_STR\n ? AccountAddress.A\n : createObjectAddress(AccountAddress.A, standardizedMoveTypeName);\n}\n"],"mappings":";;;;;;;;AAGA,SAAS,cAAc;AAavB,eAAsB,MAAM,QAA+B;AACzD,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,eAAW,SAAS,MAAM;AAAA,EAC5B,CAAC;AACH;AAUO,SAAS,gBAAgB,OAAwB;AACtD,SAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D;AAMO,IAAM,eAAe,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ptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { decode } from \"js-base64\";\nimport { MoveFunctionId, MoveStructId } from \"../types\";\nimport { AccountAddress } from \"../core/accountAddress\";\nimport { createObjectAddress } from \"../core/account/utils/address\";\n\n/**\n * Sleep for the specified amount of time in milliseconds.\n * This function can be used to introduce delays in asynchronous operations.\n *\n * @param timeMs - The time in milliseconds to sleep.\n * @group Implementation\n * @category Utils\n */\nexport async function sleep(timeMs: number): Promise<null> {\n return new Promise((resolve) => {\n setTimeout(resolve, timeMs);\n });\n}\n\n/**\n * Get the error message from an unknown error.\n *\n * @param error The error to get the message from\n * @returns The error message\n * @group Implementation\n * @category Utils\n */\nexport function getErrorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\n/**\n * @group Implementation\n * @category Utils\n */\nexport const nowInSeconds = () => Math.floor(Date.now() / 1000);\n\n/**\n * Floors the given timestamp to the nearest whole hour.\n * This function is useful for normalizing timestamps to hourly intervals.\n *\n * @param timestampInSeconds - The timestamp in seconds to be floored.\n * @group Implementation\n * @category Utils\n */\nexport function floorToWholeHour(timestampInSeconds: number): number {\n const date = new Date(timestampInSeconds * 1000);\n // Reset minutes and seconds to zero\n date.setMinutes(0);\n date.setSeconds(0);\n date.setMilliseconds(0);\n return Math.floor(date.getTime() / 1000);\n}\n\n/**\n * Decodes a base64 URL-encoded string into its original form.\n * This function is useful for converting base64 URL-encoded data back to a readable format.\n *\n * @param base64Url - The base64 URL-encoded string to decode.\n * @returns The decoded string.\n * @group Implementation\n * @category Utils\n */\nexport function base64UrlDecode(base64Url: string): string {\n // Replace base64url-specific characters\n const base64 = base64Url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n // Pad the string with '=' characters if needed\n const paddedBase64 = base64 + \"==\".substring(0, (3 - (base64.length % 3)) % 3);\n const decodedString = decode(paddedBase64);\n return decodedString;\n}\n\nexport function base64UrlToBytes(base64Url: string): Uint8Array {\n // Convert Base64Url to Base64\n let base64 = base64Url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n // Add padding if needed\n while (base64.length % 4 !== 0) {\n base64 += \"=\";\n }\n // Use Buffer to convert base64 to Uint8Array\n return new Uint8Array(Buffer.from(base64, \"base64\"));\n}\n\n/**\n * Amount is represented in the smallest unit format on chain, this function converts\n * a human-readable amount format to the smallest unit format\n * @example\n * human-readable amount format: 500\n * on chain amount format when decimal is 8: 50000000000\n *\n * @param value The value in human-readable format\n * @param decimal The token decimal\n * @returns The value in the smallest units\n * @group Implementation\n * @category Utils\n */\nexport const convertAmountFromHumanReadableToOnChain = (value: number, decimal: number) => value * 10 ** decimal;\n\n/**\n * Amount is represented in the smallest unit format on chain, this function converts\n * the smallest unit format to a human-readable amount format\n * @example\n * human-readable amount format: 500\n * on chain amount format when decimal is 8: 50000000000\n *\n * @param value The value in human-readable format\n * @param decimal The token decimal\n * @returns The value in the smallest units\n * @group Implementation\n * @category Utils\n */\nexport const convertAmountFromOnChainToHumanReadable = (value: number, decimal: number) => value / 10 ** decimal;\n\n/**\n * Convert a hex string to an ascii string with the `0x` prefix.\n *\n * `0x6170746f735f636f696e` --> `aptos_coin`\n *\n * @param hex The hex string to convert (e.g. `0x6170746f735f636f696e`)\n * @returns The ascii string\n * @group Implementation\n * @category Utils\n */\nconst hexToAscii = (hex: string) => {\n let str = \"\";\n for (let n = 2; n < hex.length; n += 2) {\n str += String.fromCharCode(parseInt(hex.substring(n, n + 2), 16));\n }\n return str;\n};\n\n/**\n * Convert an encoded struct to a MoveStructId.\n *\n * @example\n * const structObj = {\n * account_address: \"0x1\",\n * module_name: \"0x6170746f735f636f696e\",\n * struct_name: \"0x4170746f73436f696e\",\n * };\n * // structId is \"0x1::aptos_coin::AptosCoin\"\n * const structId = parseEncodedStruct(structObj);\n *\n * @param structObj The struct with account_address, module_name, and struct_name properties\n * @returns The MoveStructId\n * @group Implementation\n * @category Utils\n */\nexport const parseEncodedStruct = (structObj: {\n account_address: string;\n module_name: string;\n struct_name: string;\n}): MoveStructId => {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const { account_address, module_name, struct_name } = structObj;\n const moduleName = hexToAscii(module_name);\n const structName = hexToAscii(struct_name);\n return `${account_address}::${moduleName}::${structName}`;\n};\n\n/**\n * Determines whether the given object is an encoded struct type with the following properties:\n * - account_address: string\n * - module_name: string\n * - struct_name: string\n *\n * @param structObj The object to check\n * @returns Whether the object is an encoded struct type\n * @group Implementation\n * @category Utils\n */\nexport const isEncodedStruct = (\n structObj: any,\n): structObj is {\n account_address: string;\n module_name: string;\n struct_name: string;\n} =>\n typeof structObj === \"object\" &&\n !Array.isArray(structObj) &&\n structObj !== null &&\n \"account_address\" in structObj &&\n \"module_name\" in structObj &&\n \"struct_name\" in structObj &&\n typeof structObj.account_address === \"string\" &&\n typeof structObj.module_name === \"string\" &&\n typeof structObj.struct_name === \"string\";\n\n/**\n * Splits a function identifier into its constituent parts: module address, module name, and function name.\n * This function helps in validating and extracting details from a function identifier string.\n *\n * @param functionArg - The function identifier string in the format \"moduleAddress::moduleName::functionName\".\n * @returns An object containing the module address, module name, and function name.\n * @throws Error if the function identifier does not contain exactly three parts.\n * @group Implementation\n * @category Transactions\n */\nexport function getFunctionParts(functionArg: MoveFunctionId) {\n const funcNameParts = functionArg.split(\"::\");\n if (funcNameParts.length !== 3) {\n throw new Error(`Invalid function ${functionArg}`);\n }\n const moduleAddress = funcNameParts[0];\n const moduleName = funcNameParts[1];\n const functionName = funcNameParts[2];\n return { moduleAddress, moduleName, functionName };\n}\n\n/**\n * Validates the provided function information.\n *\n * @param functionInfo - The function information to validate.\n * @returns Whether the function information is valid.\n * @group Implementation\n * @category Utils\n */\nexport function isValidFunctionInfo(functionInfo: string): boolean {\n const parts = functionInfo.split(\"::\");\n return parts.length === 3 && AccountAddress.isValid({ input: parts[0] }).valid;\n}\n\n/**\n * Truncates the provided wallet address at the middle with an ellipsis.\n *\n * @param address - The wallet address to truncate.\n * @param start - The number of characters to show at the beginning of the address.\n * @param end - The number of characters to show at the end of the address.\n * @returns The truncated address.\n * @group Implementation\n * @category Utils\n */\nexport function truncateAddress(address: string, start: number = 6, end: number = 5) {\n return `${address.slice(0, start)}...${address.slice(-end)}`;\n}\n\n/**\n * Constants for metadata address calculation\n */\nconst APTOS_COIN_TYPE_STR = \"0x1::aptos_coin::AptosCoin\";\nconst APT_METADATA_ADDRESS_HEX = AccountAddress.A.toStringLong();\n\n/**\n * Helper function to standardize Move type string by converting all addresses to short form,\n * including addresses within nested type parameters\n */\nfunction standardizeMoveTypeString(input: string): string {\n // Regular expression to match addresses in the type string, including those within type parameters\n // This regex matches \"0x\" followed by hex digits, handling both standalone addresses and those within <>\n const addressRegex = /0x[0-9a-fA-F]+/g;\n\n return input.replace(addressRegex, (match) => {\n // Use AccountAddress to handle the address\n return AccountAddress.from(match, { maxMissingChars: 63 }).toStringShort();\n });\n}\n\n/**\n * Calculates the paired FA metadata address for a given coin type.\n * This function is tolerant of various address formats in the coin type string,\n * including complex nested types.\n *\n * @example\n * // All these formats are valid and will produce the same result:\n * pairedFaMetadataAddress(\"0x1::aptos_coin::AptosCoin\") // simple form\n * pairedFaMetadataAddress(\"0x0000000000000000000000000000000000000000000000000000000000000001::aptos_coin::AptosCoin\") // long form\n * pairedFaMetadataAddress(\"0x00001::aptos_coin::AptosCoin\") // with leading zeros\n * pairedFaMetadataAddress(\"0x1::coin::Coin<0x1412::a::struct<0x0001::aptos_coin::AptosCoin>>\") // nested type parameters\n *\n * @param coinType - The coin type string in any of these formats:\n * - Short form address: \"0x1::aptos_coin::AptosCoin\"\n * - Long form address: \"0x0000000000000000000000000000000000000000000000000000000000000001::aptos_coin::AptosCoin\"\n * - With leading zeros: \"0x00001::aptos_coin::AptosCoin\"\n * - With nested types: \"0x1::coin::Coin<0x1412::a::struct<0x0001::aptos_coin::AptosCoin>>\"\n * @returns The calculated metadata address as an AccountAddress instance\n */\nexport function pairedFaMetadataAddress(coinType: `0x${string}::${string}::${string}`): AccountAddress {\n // Standardize the coin type string to handle any address format\n const standardizedMoveTypeName = standardizeMoveTypeString(coinType);\n\n return standardizedMoveTypeName === APTOS_COIN_TYPE_STR\n ? AccountAddress.A\n : createObjectAddress(AccountAddress.A, standardizedMoveTypeName);\n}\n"],"mappings":"kFAGA,OAAS,UAAAA,MAAc,YAavB,eAAsBC,EAAMC,EAA+B,CACzD,OAAO,IAAI,QAASC,GAAY,CAC9B,WAAWA,EAASD,CAAM,CAC5B,CAAC,CACH,CAUO,SAASE,EAAgBC,EAAwB,CACtD,OAAOA,aAAiB,MAAQA,EAAM,QAAU,OAAOA,CAAK,CAC9D,CAMO,IAAMC,EAAe,IAAM,KAAK,MAAM,KAAK,IAAI,EAAI,GAAI,EAUvD,SAASC,EAAiBC,EAAoC,CACnE,IAAMC,EAAO,IAAI,KAAKD,EAAqB,GAAI,EAE/C,OAAAC,EAAK,WAAW,CAAC,EACjBA,EAAK,WAAW,CAAC,EACjBA,EAAK,gBAAgB,CAAC,EACf,KAAK,MAAMA,EAAK,QAAQ,EAAI,GAAI,CACzC,CAWO,SAASC,EAAgBC,EAA2B,CAEzD,IAAMC,EAASD,EAAU,QAAQ,KAAM,GAAG,EAAE,QAAQ,KAAM,GAAG,EAEvDE,EAAeD,EAAS,KAAK,UAAU,GAAI,EAAKA,EAAO,OAAS,GAAM,CAAC,EAE7E,OADsBE,EAAOD,CAAY,CAE3C,CAEO,SAASE,EAAiBJ,EAA+B,CAE9D,IAAIC,EAASD,EAAU,QAAQ,KAAM,GAAG,EAAE,QAAQ,KAAM,GAAG,EAE3D,KAAOC,EAAO,OAAS,IAAM,GAC3BA,GAAU,IAGZ,OAAO,IAAI,WAAW,OAAO,KAAKA,EAAQ,QAAQ,CAAC,CACrD,CAeO,IAAMI,EAA0C,CAACC,EAAeC,IAAoBD,EAAQ,IAAMC,EAe5FC,EAA0C,CAACF,EAAeC,IAAoBD,EAAQ,IAAMC,EAYnGE,EAAcC,GAAgB,CAClC,IAAIC,EAAM,GACV,QAASC,EAAI,EAAGA,EAAIF,EAAI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EAAe,kBAErB,OAAOD,EAAM,QAAQC,EAAeC,GAE3BV,EAAe,KAAKU,EAAO,CAAE,gBAAiB,EAAG,CAAC,EAAE,cAAc,CAC1E,CACH,CAqBO,SAASC,EAAwBC,EAA+D,CAErG,IAAMC,EAA2BN,EAA0BK,CAAQ,EAEnE,OAAOC,IAA6BR,EAChCL,EAAe,EACfc,EAAoBd,EAAe,EAAGa,CAAwB,CACpE","names":["decode","sleep","timeMs","resolve","getErrorMessage","error","nowInSeconds","floorToWholeHour","timestampInSeconds","date","base64UrlDecode","base64Url","base64","paddedBase64","decode","base64UrlToBytes","convertAmountFromHumanReadableToOnChain","value","decimal","convertAmountFromOnChainToHumanReadable","hexToAscii","hex","str","n","parseEncodedStruct","structObj","account_address","module_name","struct_name","moduleName","structName","isEncodedStruct","getFunctionParts","functionArg","funcNameParts","moduleAddress","functionName","isValidFunctionInfo","functionInfo","parts","AccountAddress","truncateAddress","address","start","end","APTOS_COIN_TYPE_STR","APT_METADATA_ADDRESS_HEX","standardizeMoveTypeString","input","addressRegex","match","pairedFaMetadataAddress","coinType","standardizedMoveTypeName","createObjectAddress"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var i=class{constructor(){this.queue=[];this.pendingDequeue=[];this.cancelled=!1}enqueue(e){if(this.cancelled=!1,this.pendingDequeue.length>0){this.pendingDequeue.shift()?.resolve(e);return}this.queue.push(e)}async dequeue(){return this.queue.length>0?Promise.resolve(this.queue.shift()):new Promise((e,u)=>{this.pendingDequeue.push({resolve:e,reject:u})})}isEmpty(){return this.queue.length===0}cancel(){this.cancelled=!0,this.pendingDequeue.forEach(async({reject:e})=>{e(new n("Task cancelled"))}),this.pendingDequeue=[],this.queue.length=0}isCancelled(){return this.cancelled}pendingDequeueLength(){return this.pendingDequeue.length}},n=class extends Error{};export{i as a,n as b};
|
|
2
|
+
//# sourceMappingURL=chunk-A5L76YP7.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/transactions/management/asyncQueue.ts"],"sourcesContent":["/**\n * The AsyncQueue class is an async-aware data structure that provides a queue-like\n * behavior for managing asynchronous tasks or operations.\n * It allows to enqueue items and dequeue them asynchronously.\n * This is not thread-safe, but it is async concurrency safe, and\n * it does not guarantee ordering for those that call into and await on enqueue.\n * @group Implementation\n * @category Transactions\n */\n\ninterface PendingDequeue<T> {\n resolve: (value: T) => void;\n reject: (reason?: AsyncQueueCancelledError) => void;\n}\n\nexport class AsyncQueue<T> {\n readonly queue: T[] = [];\n\n // The pendingDequeue is used to handle the resolution of promises when items are enqueued and dequeued.\n private pendingDequeue: PendingDequeue<T>[] = [];\n\n private cancelled: boolean = false;\n\n /**\n * Adds an item to the queue. If there are pending dequeued promises, it resolves the oldest promise with the enqueued item\n * immediately; otherwise, it adds the item to the queue.\n *\n * @param item - The item to be added to the queue.\n * @group Implementation\n * @category Transactions\n */\n enqueue(item: T): void {\n this.cancelled = false;\n\n if (this.pendingDequeue.length > 0) {\n const promise = this.pendingDequeue.shift();\n\n promise?.resolve(item);\n\n return;\n }\n\n this.queue.push(item);\n }\n\n /**\n * Dequeues the next item from the queue and returns a promise that resolves to it.\n * If the queue is empty, it creates a new promise that will be resolved when an item is enqueued.\n *\n * @returns Promise<T>\n * @group Implementation\n * @category Transactions\n */\n async dequeue(): Promise<T> {\n if (this.queue.length > 0) {\n return Promise.resolve(this.queue.shift()!);\n }\n\n return new Promise<T>((resolve, reject) => {\n this.pendingDequeue.push({ resolve, reject });\n });\n }\n\n /**\n * Determine whether the queue is empty.\n *\n * @returns boolean - Returns true if the queue has no elements, otherwise false.\n * @group Implementation\n * @category Transactions\n */\n isEmpty(): boolean {\n return this.queue.length === 0;\n }\n\n /**\n * Cancels all pending promises in the queue and rejects them with an AsyncQueueCancelledError.\n * This ensures that any awaiting code can handle the cancellation appropriately.\n *\n * @returns {void}\n * @group Implementation\n * @category Transactions\n */\n cancel(): void {\n this.cancelled = true;\n\n this.pendingDequeue.forEach(async ({ reject }) => {\n reject(new AsyncQueueCancelledError(\"Task cancelled\"));\n });\n\n this.pendingDequeue = [];\n\n this.queue.length = 0;\n }\n\n /**\n * Determine whether the queue has been cancelled.\n *\n * @returns boolean - Returns true if the queue is cancelled, otherwise false.\n * @group Implementation\n * @category Transactions\n */\n isCancelled(): boolean {\n return this.cancelled;\n }\n\n /**\n * Retrieve the length of the pending dequeue.\n *\n * @returns number - The number of items currently in the pending dequeue.\n * @group Implementation\n * @category Transactions\n */\n pendingDequeueLength(): number {\n return this.pendingDequeue.length;\n }\n}\n\n/**\n * Represents an error that occurs when an asynchronous queue operation is cancelled.\n * This error extends the built-in Error class to provide additional context for cancellation events.\n *\n * @extends Error\n * @group Implementation\n * @category Transactions\n */\nexport class AsyncQueueCancelledError extends Error {}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/transactions/management/asyncQueue.ts"],"sourcesContent":["/**\n * The AsyncQueue class is an async-aware data structure that provides a queue-like\n * behavior for managing asynchronous tasks or operations.\n * It allows to enqueue items and dequeue them asynchronously.\n * This is not thread-safe, but it is async concurrency safe, and\n * it does not guarantee ordering for those that call into and await on enqueue.\n * @group Implementation\n * @category Transactions\n */\n\ninterface PendingDequeue<T> {\n resolve: (value: T) => void;\n reject: (reason?: AsyncQueueCancelledError) => void;\n}\n\nexport class AsyncQueue<T> {\n readonly queue: T[] = [];\n\n // The pendingDequeue is used to handle the resolution of promises when items are enqueued and dequeued.\n private pendingDequeue: PendingDequeue<T>[] = [];\n\n private cancelled: boolean = false;\n\n /**\n * Adds an item to the queue. If there are pending dequeued promises, it resolves the oldest promise with the enqueued item\n * immediately; otherwise, it adds the item to the queue.\n *\n * @param item - The item to be added to the queue.\n * @group Implementation\n * @category Transactions\n */\n enqueue(item: T): void {\n this.cancelled = false;\n\n if (this.pendingDequeue.length > 0) {\n const promise = this.pendingDequeue.shift();\n\n promise?.resolve(item);\n\n return;\n }\n\n this.queue.push(item);\n }\n\n /**\n * Dequeues the next item from the queue and returns a promise that resolves to it.\n * If the queue is empty, it creates a new promise that will be resolved when an item is enqueued.\n *\n * @returns Promise<T>\n * @group Implementation\n * @category Transactions\n */\n async dequeue(): Promise<T> {\n if (this.queue.length > 0) {\n return Promise.resolve(this.queue.shift()!);\n }\n\n return new Promise<T>((resolve, reject) => {\n this.pendingDequeue.push({ resolve, reject });\n });\n }\n\n /**\n * Determine whether the queue is empty.\n *\n * @returns boolean - Returns true if the queue has no elements, otherwise false.\n * @group Implementation\n * @category Transactions\n */\n isEmpty(): boolean {\n return this.queue.length === 0;\n }\n\n /**\n * Cancels all pending promises in the queue and rejects them with an AsyncQueueCancelledError.\n * This ensures that any awaiting code can handle the cancellation appropriately.\n *\n * @returns {void}\n * @group Implementation\n * @category Transactions\n */\n cancel(): void {\n this.cancelled = true;\n\n this.pendingDequeue.forEach(async ({ reject }) => {\n reject(new AsyncQueueCancelledError(\"Task cancelled\"));\n });\n\n this.pendingDequeue = [];\n\n this.queue.length = 0;\n }\n\n /**\n * Determine whether the queue has been cancelled.\n *\n * @returns boolean - Returns true if the queue is cancelled, otherwise false.\n * @group Implementation\n * @category Transactions\n */\n isCancelled(): boolean {\n return this.cancelled;\n }\n\n /**\n * Retrieve the length of the pending dequeue.\n *\n * @returns number - The number of items currently in the pending dequeue.\n * @group Implementation\n * @category Transactions\n */\n pendingDequeueLength(): number {\n return this.pendingDequeue.length;\n }\n}\n\n/**\n * Represents an error that occurs when an asynchronous queue operation is cancelled.\n * This error extends the built-in Error class to provide additional context for cancellation events.\n *\n * @extends Error\n * @group Implementation\n * @category Transactions\n */\nexport class AsyncQueueCancelledError extends Error {}\n"],"mappings":"AAeO,IAAMA,EAAN,KAAoB,CAApB,cACL,KAAS,MAAa,CAAC,EAGvB,KAAQ,eAAsC,CAAC,EAE/C,KAAQ,UAAqB,GAU7B,QAAQC,EAAe,CAGrB,GAFA,KAAK,UAAY,GAEb,KAAK,eAAe,OAAS,EAAG,CAClB,KAAK,eAAe,MAAM,GAEjC,QAAQA,CAAI,EAErB,MACF,CAEA,KAAK,MAAM,KAAKA,CAAI,CACtB,CAUA,MAAM,SAAsB,CAC1B,OAAI,KAAK,MAAM,OAAS,EACf,QAAQ,QAAQ,KAAK,MAAM,MAAM,CAAE,EAGrC,IAAI,QAAW,CAACC,EAASC,IAAW,CACzC,KAAK,eAAe,KAAK,CAAE,QAAAD,EAAS,OAAAC,CAAO,CAAC,CAC9C,CAAC,CACH,CASA,SAAmB,CACjB,OAAO,KAAK,MAAM,SAAW,CAC/B,CAUA,QAAe,CACb,KAAK,UAAY,GAEjB,KAAK,eAAe,QAAQ,MAAO,CAAE,OAAAA,CAAO,IAAM,CAChDA,EAAO,IAAIC,EAAyB,gBAAgB,CAAC,CACvD,CAAC,EAED,KAAK,eAAiB,CAAC,EAEvB,KAAK,MAAM,OAAS,CACtB,CASA,aAAuB,CACrB,OAAO,KAAK,SACd,CASA,sBAA+B,CAC7B,OAAO,KAAK,eAAe,MAC7B,CACF,EAUaA,EAAN,cAAuC,KAAM,CAAC","names":["AsyncQueue","item","resolve","reject","AsyncQueueCancelledError"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as r}from"./chunk-7DQDJ2SA.mjs";import{spawn as c}from"child_process";import l from"tree-kill";import{platform as h}from"os";var e=class{constructor(t){this.MAXIMUM_WAIT_TIME_SEC=75;this.READINESS_ENDPOINT="http://127.0.0.1:8070/";this.showStdout=!0;this.process=null;this.showStdout=t?.showStdout??!0}async stop(){await new Promise((t,o)=>{this.process?.pid&&l(this.process.pid,s=>{s?o(s):t(!0)})})}async run(){await this.checkIfProcessIsUp()||(this.start(),await this.waitUntilProcessIsUp())}start(){let t="npx",o=["aptos","node","run-localnet","--force-restart","--assume-yes","--with-indexer-api"],s=h(),a={env:{...process.env,ENABLE_KEYLESS_DEFAULT:"1"},...s==="win32"&&{shell:!0}};this.process=c(t,o,a),this.process.stdout?.on("data",i=>{let n=i.toString();this.showStdout&&console.log(n)})}async waitUntilProcessIsUp(){let t=await this.checkIfProcessIsUp(),o=Date.now()/1e3,s=o;for(;!t&&o+this.MAXIMUM_WAIT_TIME_SEC>s;)await r(1e3),t=await this.checkIfProcessIsUp(),s=Date.now()/1e3;if(!t)throw new Error("Process failed to start");return!0}async checkIfProcessIsUp(){try{return(await fetch(this.READINESS_ENDPOINT)).status===200}catch{return!1}}};export{e as a};
|
|
2
|
+
//# sourceMappingURL=chunk-B563XRSZ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/localNode.ts"],"sourcesContent":["/* eslint-disable no-console */\n\nimport { ChildProcessWithoutNullStreams, spawn } from \"child_process\";\nimport kill from \"tree-kill\";\nimport { platform } from \"os\";\n\nimport { sleep } from \"../utils/helpers\";\n\n/**\n * Represents a local node for running a localnet environment.\n * This class provides methods to start, stop, and check the status of the localnet process.\n * It manages the lifecycle of the node process and ensures that it is operational before executing tests.\n * @group Implementation\n * @category CLI\n */\nexport class LocalNode {\n readonly MAXIMUM_WAIT_TIME_SEC = 75;\n\n readonly READINESS_ENDPOINT = \"http://127.0.0.1:8070/\";\n\n showStdout: boolean = true;\n\n process: ChildProcessWithoutNullStreams | null = null;\n\n constructor(args?: { showStdout?: boolean }) {\n this.showStdout = args?.showStdout ?? true;\n }\n\n /**\n * Kills the current process and all its descendant processes.\n *\n * @returns {Promise<void>} A promise that resolves to true if the process was successfully killed.\n * @throws {Error} If there is an error while attempting to kill the process.\n * @group Implementation\n * @category CLI\n */\n async stop(): Promise<void> {\n await new Promise((resolve, reject) => {\n if (!this.process?.pid) return;\n\n /**\n * Terminates the process associated with the given process ID.\n *\n * @param pid - The process ID of the process to be terminated.\n * @param callback - A function that is called after the termination attempt is complete.\n * @param callback.err - An error object if the termination failed; otherwise, null.\n * @param callback.resolve - A boolean indicating whether the termination was successful.\n * @group Implementation\n * @category CLI\n */\n kill(this.process.pid, (err) => {\n if (err) {\n reject(err);\n } else {\n resolve(true);\n }\n });\n });\n }\n\n /**\n * Runs a localnet and waits for the process to be up.\n * If the local node process is already running, it returns without starting the process.\n *\n * @returns {Promise<void>} A promise that resolves when the process is up.\n * @group Implementation\n * @category CLI\n */\n async run(): Promise<void> {\n const nodeIsUp = await this.checkIfProcessIsUp();\n if (nodeIsUp) {\n return;\n }\n this.start();\n await this.waitUntilProcessIsUp();\n }\n\n /**\n * Starts the localnet by running the Aptos node with the specified command-line arguments.\n *\n * @returns {void}\n *\n * @throws {Error} If there is an issue starting the localnet.\n * @group Implementation\n * @category CLI\n */\n start(): void {\n const cliCommand = \"npx\";\n const cliArgs = [\"aptos\", \"node\", \"run-localnet\", \"--force-restart\", \"--assume-yes\", \"--with-indexer-api\"];\n\n const currentPlatform = platform();\n const spawnConfig = {\n env: { ...process.env, ENABLE_KEYLESS_DEFAULT: \"1\" },\n ...(currentPlatform === \"win32\" && { shell: true }),\n };\n\n this.process = spawn(cliCommand, cliArgs, spawnConfig);\n\n this.process.stdout?.on(\"data\", (data: any) => {\n const str = data.toString();\n // Print local node output log\n if (this.showStdout) {\n console.log(str);\n }\n });\n }\n\n /**\n * Waits for the localnet process to be operational within a specified maximum wait time.\n * This function continuously checks if the process is up and will throw an error if it fails to start.\n *\n * @returns Promise<boolean> - Resolves to true if the process is up, otherwise throws an error.\n * @group Implementation\n * @category CLI\n */\n async waitUntilProcessIsUp(): Promise<boolean> {\n let operational = await this.checkIfProcessIsUp();\n const start = Date.now() / 1000;\n let last = start;\n\n while (!operational && start + this.MAXIMUM_WAIT_TIME_SEC > last) {\n // eslint-disable-next-line no-await-in-loop\n await sleep(1000);\n // eslint-disable-next-line no-await-in-loop\n operational = await this.checkIfProcessIsUp();\n last = Date.now() / 1000;\n }\n\n // If we are here it means something blocks the process to start.\n // Might worth checking if another process is running on port 8080\n if (!operational) {\n throw new Error(\"Process failed to start\");\n }\n\n return true;\n }\n\n /**\n * Checks if the localnet is up by querying the readiness endpoint.\n *\n * @returns Promise<boolean> - A promise that resolves to true if the localnet is up, otherwise false.\n * @group Implementation\n * @category CLI\n */\n async checkIfProcessIsUp(): Promise<boolean> {\n try {\n // Query readiness endpoint\n const data = await fetch(this.READINESS_ENDPOINT);\n if (data.status === 200) {\n return true;\n }\n return false;\n } catch (err: any) {\n return false;\n }\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/cli/localNode.ts"],"sourcesContent":["/* eslint-disable no-console */\n\nimport { ChildProcessWithoutNullStreams, spawn } from \"child_process\";\nimport kill from \"tree-kill\";\nimport { platform } from \"os\";\n\nimport { sleep } from \"../utils/helpers\";\n\n/**\n * Represents a local node for running a localnet environment.\n * This class provides methods to start, stop, and check the status of the localnet process.\n * It manages the lifecycle of the node process and ensures that it is operational before executing tests.\n * @group Implementation\n * @category CLI\n */\nexport class LocalNode {\n readonly MAXIMUM_WAIT_TIME_SEC = 75;\n\n readonly READINESS_ENDPOINT = \"http://127.0.0.1:8070/\";\n\n showStdout: boolean = true;\n\n process: ChildProcessWithoutNullStreams | null = null;\n\n constructor(args?: { showStdout?: boolean }) {\n this.showStdout = args?.showStdout ?? true;\n }\n\n /**\n * Kills the current process and all its descendant processes.\n *\n * @returns {Promise<void>} A promise that resolves to true if the process was successfully killed.\n * @throws {Error} If there is an error while attempting to kill the process.\n * @group Implementation\n * @category CLI\n */\n async stop(): Promise<void> {\n await new Promise((resolve, reject) => {\n if (!this.process?.pid) return;\n\n /**\n * Terminates the process associated with the given process ID.\n *\n * @param pid - The process ID of the process to be terminated.\n * @param callback - A function that is called after the termination attempt is complete.\n * @param callback.err - An error object if the termination failed; otherwise, null.\n * @param callback.resolve - A boolean indicating whether the termination was successful.\n * @group Implementation\n * @category CLI\n */\n kill(this.process.pid, (err) => {\n if (err) {\n reject(err);\n } else {\n resolve(true);\n }\n });\n });\n }\n\n /**\n * Runs a localnet and waits for the process to be up.\n * If the local node process is already running, it returns without starting the process.\n *\n * @returns {Promise<void>} A promise that resolves when the process is up.\n * @group Implementation\n * @category CLI\n */\n async run(): Promise<void> {\n const nodeIsUp = await this.checkIfProcessIsUp();\n if (nodeIsUp) {\n return;\n }\n this.start();\n await this.waitUntilProcessIsUp();\n }\n\n /**\n * Starts the localnet by running the Aptos node with the specified command-line arguments.\n *\n * @returns {void}\n *\n * @throws {Error} If there is an issue starting the localnet.\n * @group Implementation\n * @category CLI\n */\n start(): void {\n const cliCommand = \"npx\";\n const cliArgs = [\"aptos\", \"node\", \"run-localnet\", \"--force-restart\", \"--assume-yes\", \"--with-indexer-api\"];\n\n const currentPlatform = platform();\n const spawnConfig = {\n env: { ...process.env, ENABLE_KEYLESS_DEFAULT: \"1\" },\n ...(currentPlatform === \"win32\" && { shell: true }),\n };\n\n this.process = spawn(cliCommand, cliArgs, spawnConfig);\n\n this.process.stdout?.on(\"data\", (data: any) => {\n const str = data.toString();\n // Print local node output log\n if (this.showStdout) {\n console.log(str);\n }\n });\n }\n\n /**\n * Waits for the localnet process to be operational within a specified maximum wait time.\n * This function continuously checks if the process is up and will throw an error if it fails to start.\n *\n * @returns Promise<boolean> - Resolves to true if the process is up, otherwise throws an error.\n * @group Implementation\n * @category CLI\n */\n async waitUntilProcessIsUp(): Promise<boolean> {\n let operational = await this.checkIfProcessIsUp();\n const start = Date.now() / 1000;\n let last = start;\n\n while (!operational && start + this.MAXIMUM_WAIT_TIME_SEC > last) {\n // eslint-disable-next-line no-await-in-loop\n await sleep(1000);\n // eslint-disable-next-line no-await-in-loop\n operational = await this.checkIfProcessIsUp();\n last = Date.now() / 1000;\n }\n\n // If we are here it means something blocks the process to start.\n // Might worth checking if another process is running on port 8080\n if (!operational) {\n throw new Error(\"Process failed to start\");\n }\n\n return true;\n }\n\n /**\n * Checks if the localnet is up by querying the readiness endpoint.\n *\n * @returns Promise<boolean> - A promise that resolves to true if the localnet is up, otherwise false.\n * @group Implementation\n * @category CLI\n */\n async checkIfProcessIsUp(): Promise<boolean> {\n try {\n // Query readiness endpoint\n const data = await fetch(this.READINESS_ENDPOINT);\n if (data.status === 200) {\n return true;\n }\n return false;\n } catch (err: any) {\n return false;\n }\n }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ACH,MAAM,IAAI,MAAM,yBAAyB,EAG3C,MAAO,EACT,CASA,MAAM,oBAAuC,CAC3C,GAAI,CAGF,OADa,MAAM,MAAM,KAAK,kBAAkB,GACvC,SAAW,GAItB,MAAmB,CACjB,MAAO,EACT,CACF,CACF","names":["spawn","kill","platform","LocalNode","args","resolve","reject","kill","err","cliCommand","cliArgs","currentPlatform","platform","spawnConfig","spawn","data","str","operational","start","last","sleep"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{hmac as c}from"@noble/hashes/hmac";import{sha512 as p}from"@noble/hashes/sha512";import*as i from"@scure/bip39";var d=/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'?$/,m=/^m\/44'\/637'\/[0-9]+'\/[0-9]+\/[0-9]+$/,y=(t=>(t.ED25519="ed25519 seed",t))(y||{}),u=2147483648;function D(e){return m.test(e)}function E(e){return d.test(e)}var A=(e,t)=>{let r=c.create(p,e).update(t).digest();return{key:r.slice(0,32),chainCode:r.slice(32)}},f=({key:e,chainCode:t},r)=>{let n=new ArrayBuffer(4);new DataView(n).setUint32(0,r);let o=new Uint8Array(n),s=new Uint8Array([0]),a=new Uint8Array([...s,...e,...o]);return A(t,a)},x=e=>e.replace(/'/g,""),U=e=>e.split("/").slice(1).map(x),h=e=>{let t=e.trim().split(/\s+/).map(r=>r.toLowerCase()).join(" ");return i.mnemonicToSeedSync(t)};export{d as a,m as b,y as c,u as d,D as e,E as f,A as g,f as h,U as i,h as j};
|
|
2
|
+
//# sourceMappingURL=chunk-C3Q23D22.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/crypto/hdKey.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { sha512 } from \"@noble/hashes/sha512\";\nimport * as bip39 from \"@scure/bip39\";\n\n/**\n * Contains the derived cryptographic key as a Uint8Array.\n * @group Implementation\n * @category Serialization\n */\nexport type DerivedKeys = {\n key: Uint8Array;\n chainCode: Uint8Array;\n};\n\n/**\n * Aptos derive path is 637\n * @group Implementation\n * @category Serialization\n */\nexport const APTOS_HARDENED_REGEX = /^m\\/44'\\/637'\\/[0-9]+'\\/[0-9]+'\\/[0-9]+'?$/;\n\n/**\n * @group Implementation\n * @category Serialization\n */\nexport const APTOS_BIP44_REGEX = /^m\\/44'\\/637'\\/[0-9]+'\\/[0-9]+\\/[0-9]+$/;\n\n/**\n * Supported key types and their associated seeds.\n * @group Implementation\n * @category Serialization\n */\nexport enum KeyType {\n ED25519 = \"ed25519 seed\",\n}\n\n/**\n * @group Implementation\n * @category Serialization\n */\nexport const HARDENED_OFFSET = 0x80000000;\n\n/**\n * Validate a BIP-44 derivation path string to ensure it meets the required format.\n * This function checks if the provided path adheres to the BIP-44 standard for Secp256k1.\n * Parse and validate a path that is compliant to BIP-44 in form m/44'/637'/{account_index}'/{change_index}/{address_index}\n * for Secp256k1\n *\n * Note that for Secp256k1, the last two components must be non-hardened.\n *\n * @param path - The path string to validate (e.g. `m/44'/637'/0'/0/0`).\n * @group Implementation\n * @category Serialization\n */\nexport function isValidBIP44Path(path: string): boolean {\n return APTOS_BIP44_REGEX.test(path);\n}\n\n/**\n * Aptos derive path is 637\n *\n * Parse and validate a path that is compliant to SLIP-0010 and BIP-44\n * in form m/44'/637'/{account_index}'/{change_index}'/{address_index}'.\n * See SLIP-0010 {@link https://github.com/satoshilabs/slips/blob/master/slip-0044.md}\n * See BIP-44 {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}\n *\n * Note that for Ed25519, all components must be hardened.\n * This is because non-hardened [PK] derivation would not work due to Ed25519's lack of a key homomorphism.\n * Specifically, you cannot derive the PK associated with derivation path a/b/c given the PK of a/b.\n * This is because the PK in Ed25519 is, more or less, computed as 𝑔𝐻(𝑠𝑘),\n * with the hash function breaking the homomorphism.\n *\n * @param path - The derivation path string to validate (e.g. `m/44'/637'/0'/0'/0'`).\n * @group Implementation\n * @category Serialization\n */\nexport function isValidHardenedPath(path: string): boolean {\n return APTOS_HARDENED_REGEX.test(path);\n}\n\n/**\n * @group Implementation\n * @category Serialization\n */\nexport const deriveKey = (hashSeed: Uint8Array | string, data: Uint8Array | string): DerivedKeys => {\n const digest = hmac.create(sha512, hashSeed).update(data).digest();\n return {\n key: digest.slice(0, 32),\n chainCode: digest.slice(32),\n };\n};\n\n/**\n * Derive a child key from the private key\n * @param key\n * @param chainCode\n * @param index\n * @group Implementation\n * @category Serialization\n */\nexport const CKDPriv = ({ key, chainCode }: DerivedKeys, index: number): DerivedKeys => {\n const buffer = new ArrayBuffer(4);\n new DataView(buffer).setUint32(0, index);\n const indexBytes = new Uint8Array(buffer);\n const zero = new Uint8Array([0]);\n const data = new Uint8Array([...zero, ...key, ...indexBytes]);\n return deriveKey(chainCode, data);\n};\n\nconst removeApostrophes = (val: string): string => val.replace(/'/g, \"\");\n\n/**\n * Splits derive path into segments\n * @param path\n * @group Implementation\n * @category Serialization\n */\nexport const splitPath = (path: string): Array<string> => path.split(\"/\").slice(1).map(removeApostrophes);\n\n/**\n * Normalizes the mnemonic by removing extra whitespace and making it lowercase\n * @param mnemonic the mnemonic seed phrase\n * @group Implementation\n * @category Serialization\n */\nexport const mnemonicToSeed = (mnemonic: string): Uint8Array => {\n const normalizedMnemonic = mnemonic\n .trim()\n .split(/\\s+/)\n .map((part) => part.toLowerCase())\n .join(\" \");\n return bip39.mnemonicToSeedSync(normalizedMnemonic);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/core/crypto/hdKey.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { sha512 } from \"@noble/hashes/sha512\";\nimport * as bip39 from \"@scure/bip39\";\n\n/**\n * Contains the derived cryptographic key as a Uint8Array.\n * @group Implementation\n * @category Serialization\n */\nexport type DerivedKeys = {\n key: Uint8Array;\n chainCode: Uint8Array;\n};\n\n/**\n * Aptos derive path is 637\n * @group Implementation\n * @category Serialization\n */\nexport const APTOS_HARDENED_REGEX = /^m\\/44'\\/637'\\/[0-9]+'\\/[0-9]+'\\/[0-9]+'?$/;\n\n/**\n * @group Implementation\n * @category Serialization\n */\nexport const APTOS_BIP44_REGEX = /^m\\/44'\\/637'\\/[0-9]+'\\/[0-9]+\\/[0-9]+$/;\n\n/**\n * Supported key types and their associated seeds.\n * @group Implementation\n * @category Serialization\n */\nexport enum KeyType {\n ED25519 = \"ed25519 seed\",\n}\n\n/**\n * @group Implementation\n * @category Serialization\n */\nexport const HARDENED_OFFSET = 0x80000000;\n\n/**\n * Validate a BIP-44 derivation path string to ensure it meets the required format.\n * This function checks if the provided path adheres to the BIP-44 standard for Secp256k1.\n * Parse and validate a path that is compliant to BIP-44 in form m/44'/637'/{account_index}'/{change_index}/{address_index}\n * for Secp256k1\n *\n * Note that for Secp256k1, the last two components must be non-hardened.\n *\n * @param path - The path string to validate (e.g. `m/44'/637'/0'/0/0`).\n * @group Implementation\n * @category Serialization\n */\nexport function isValidBIP44Path(path: string): boolean {\n return APTOS_BIP44_REGEX.test(path);\n}\n\n/**\n * Aptos derive path is 637\n *\n * Parse and validate a path that is compliant to SLIP-0010 and BIP-44\n * in form m/44'/637'/{account_index}'/{change_index}'/{address_index}'.\n * See SLIP-0010 {@link https://github.com/satoshilabs/slips/blob/master/slip-0044.md}\n * See BIP-44 {@link https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki}\n *\n * Note that for Ed25519, all components must be hardened.\n * This is because non-hardened [PK] derivation would not work due to Ed25519's lack of a key homomorphism.\n * Specifically, you cannot derive the PK associated with derivation path a/b/c given the PK of a/b.\n * This is because the PK in Ed25519 is, more or less, computed as 𝑔𝐻(𝑠𝑘),\n * with the hash function breaking the homomorphism.\n *\n * @param path - The derivation path string to validate (e.g. `m/44'/637'/0'/0'/0'`).\n * @group Implementation\n * @category Serialization\n */\nexport function isValidHardenedPath(path: string): boolean {\n return APTOS_HARDENED_REGEX.test(path);\n}\n\n/**\n * @group Implementation\n * @category Serialization\n */\nexport const deriveKey = (hashSeed: Uint8Array | string, data: Uint8Array | string): DerivedKeys => {\n const digest = hmac.create(sha512, hashSeed).update(data).digest();\n return {\n key: digest.slice(0, 32),\n chainCode: digest.slice(32),\n };\n};\n\n/**\n * Derive a child key from the private key\n * @param key\n * @param chainCode\n * @param index\n * @group Implementation\n * @category Serialization\n */\nexport const CKDPriv = ({ key, chainCode }: DerivedKeys, index: number): DerivedKeys => {\n const buffer = new ArrayBuffer(4);\n new DataView(buffer).setUint32(0, index);\n const indexBytes = new Uint8Array(buffer);\n const zero = new Uint8Array([0]);\n const data = new Uint8Array([...zero, ...key, ...indexBytes]);\n return deriveKey(chainCode, data);\n};\n\nconst removeApostrophes = (val: string): string => val.replace(/'/g, \"\");\n\n/**\n * Splits derive path into segments\n * @param path\n * @group Implementation\n * @category Serialization\n */\nexport const splitPath = (path: string): Array<string> => path.split(\"/\").slice(1).map(removeApostrophes);\n\n/**\n * Normalizes the mnemonic by removing extra whitespace and making it lowercase\n * @param mnemonic the mnemonic seed phrase\n * @group Implementation\n * @category Serialization\n */\nexport const mnemonicToSeed = (mnemonic: string): Uint8Array => {\n const normalizedMnemonic = mnemonic\n .trim()\n .split(/\\s+/)\n .map((part) => part.toLowerCase())\n .join(\" \");\n return bip39.mnemonicToSeedSync(normalizedMnemonic);\n};\n"],"mappings":"AAGA,OAAS,QAAAA,MAAY,qBACrB,OAAS,UAAAC,MAAc,uBACvB,UAAYC,MAAW,eAiBhB,IAAMC,EAAuB,6CAMvBC,EAAoB,0CAOrBC,OACVA,EAAA,QAAU,eADAA,OAAA,IAQCC,EAAkB,WAcxB,SAASC,EAAiBC,EAAuB,CACtD,OAAOJ,EAAkB,KAAKI,CAAI,CACpC,CAoBO,SAASC,EAAoBD,EAAuB,CACzD,OAAOL,EAAqB,KAAKK,CAAI,CACvC,CAMO,IAAME,EAAY,CAACC,EAA+BC,IAA2C,CAClG,IAAMC,EAASb,EAAK,OAAOC,EAAQU,CAAQ,EAAE,OAAOC,CAAI,EAAE,OAAO,EACjE,MAAO,CACL,IAAKC,EAAO,MAAM,EAAG,EAAE,EACvB,UAAWA,EAAO,MAAM,EAAE,CAC5B,CACF,EAUaC,EAAU,CAAC,CAAE,IAAAC,EAAK,UAAAC,CAAU,EAAgBC,IAA+B,CACtF,IAAMC,EAAS,IAAI,YAAY,CAAC,EAChC,IAAI,SAASA,CAAM,EAAE,UAAU,EAAGD,CAAK,EACvC,IAAME,EAAa,IAAI,WAAWD,CAAM,EAClCE,EAAO,IAAI,WAAW,CAAC,CAAC,CAAC,EACzBR,EAAO,IAAI,WAAW,CAAC,GAAGQ,EAAM,GAAGL,EAAK,GAAGI,CAAU,CAAC,EAC5D,OAAOT,EAAUM,EAAWJ,CAAI,CAClC,EAEMS,EAAqBC,GAAwBA,EAAI,QAAQ,KAAM,EAAE,EAQ1DC,EAAaf,GAAgCA,EAAK,MAAM,GAAG,EAAE,MAAM,CAAC,EAAE,IAAIa,CAAiB,EAQ3FG,EAAkBC,GAAiC,CAC9D,IAAMC,EAAqBD,EACxB,KAAK,EACL,MAAM,KAAK,EACX,IAAKE,GAASA,EAAK,YAAY,CAAC,EAChC,KAAK,GAAG,EACX,OAAa,qBAAmBD,CAAkB,CACpD","names":["hmac","sha512","bip39","APTOS_HARDENED_REGEX","APTOS_BIP44_REGEX","KeyType","HARDENED_OFFSET","isValidBIP44Path","path","isValidHardenedPath","deriveKey","hashSeed","data","digest","CKDPriv","key","chainCode","index","buffer","indexBytes","zero","removeApostrophes","val","splitPath","mnemonicToSeed","mnemonic","normalizedMnemonic","part"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/normalizeBundle.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Deserializer, Serializable } from \"../bcs\";\n/**\n * @group Implementation\n * @category Utils\n */\nexport type DeserializableClass<T extends Serializable> = {\n /**\n * Deserializes a serialized object using the provided deserializer.\n * This function allows you to reconstruct an object from its serialized form.\n *\n * @param deserializer - An instance of the Deserializer used to read the serialized data.\n * @group Implementation\n * @category Utils\n */\n deserialize(deserializer: Deserializer): T;\n};\n\n/**\n * Normalizes an instance of a class by deserializing it from its byte representation.\n * This function allows the `instanceof` operator to work correctly when the input objects originate from a different bundle.\n *\n * @param cls - The class of the object to normalize.\n * @param value - The instance to normalize.\n * @group Implementation\n * @category Utils\n */\nexport function normalizeBundle<T extends Serializable>(cls: DeserializableClass<T>, value: T) {\n const serializedBytes = value.bcsToBytes();\n const deserializer = new Deserializer(serializedBytes);\n return cls.deserialize(deserializer);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/utils/normalizeBundle.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Deserializer, Serializable } from \"../bcs\";\n/**\n * @group Implementation\n * @category Utils\n */\nexport type DeserializableClass<T extends Serializable> = {\n /**\n * Deserializes a serialized object using the provided deserializer.\n * This function allows you to reconstruct an object from its serialized form.\n *\n * @param deserializer - An instance of the Deserializer used to read the serialized data.\n * @group Implementation\n * @category Utils\n */\n deserialize(deserializer: Deserializer): T;\n};\n\n/**\n * Normalizes an instance of a class by deserializing it from its byte representation.\n * This function allows the `instanceof` operator to work correctly when the input objects originate from a different bundle.\n *\n * @param cls - The class of the object to normalize.\n * @param value - The instance to normalize.\n * @group Implementation\n * @category Utils\n */\nexport function normalizeBundle<T extends Serializable>(cls: DeserializableClass<T>, value: T) {\n const serializedBytes = value.bcsToBytes();\n const deserializer = new Deserializer(serializedBytes);\n return cls.deserialize(deserializer);\n}\n"],"mappings":"yCA6BO,SAASA,EAAwCC,EAA6BC,EAAU,CAC7F,IAAMC,EAAkBD,EAAM,WAAW,EACnCE,EAAe,IAAIC,EAAaF,CAAe,EACrD,OAAOF,EAAI,YAAYG,CAAY,CACrC","names":["normalizeBundle","cls","value","serializedBytes","deserializer","Deserializer"]}
|