@aptos-labs/ts-sdk 1.36.0 → 1.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/{accountAddress-jrha_M3l.d.ts → accountAddress-DU4ds4Bf.d.ts} +28 -1
- package/dist/common/chunk-MVCKMP5U.js +4 -0
- package/dist/common/chunk-MVCKMP5U.js.map +1 -0
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +9288 -8699
- package/dist/common/index.js +32 -32
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account-D4j3_WIS.d.mts → Ed25519Account-C-AS-Kgv.d.mts} +61 -5
- package/dist/esm/account/AbstractKeylessAccount.d.mts +23 -13
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
- package/dist/esm/account/AbstractedAccount.d.mts +10 -10
- package/dist/esm/account/AbstractedAccount.mjs +1 -1
- package/dist/esm/account/Account.d.mts +6 -6
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/AccountUtils.d.mts +11 -10
- package/dist/esm/account/AccountUtils.mjs +1 -1
- package/dist/esm/account/Ed25519Account.d.mts +5 -5
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.d.mts +3 -1
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/FederatedKeylessAccount.d.mts +12 -11
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
- package/dist/esm/account/KeylessAccount.d.mts +12 -11
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiEd25519Account.d.mts +31 -9
- package/dist/esm/account/MultiEd25519Account.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.d.mts +38 -12
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.d.mts +6 -6
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.d.mts +7 -6
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/account/utils.mjs +1 -1
- package/dist/esm/api/account/abstraction.d.mts +9 -9
- package/dist/esm/api/account/abstraction.mjs +1 -1
- package/dist/esm/api/account.d.mts +88 -9
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +13 -13
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +6 -5
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/coin.d.mts +9 -9
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +5 -5
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/experimental.d.mts +7 -7
- package/dist/esm/api/experimental.mjs +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.d.mts +13 -13
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +7 -7
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +6 -5
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +20 -19
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +4 -4
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +9 -9
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +8 -8
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +3 -3
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/simulate.d.mts +9 -9
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +3 -3
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.d.mts +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-2P27DDVV.mjs → chunk-2DISMLR6.mjs} +2 -2
- package/dist/esm/{chunk-ACE3NEV6.mjs → chunk-2RBINVFA.mjs} +2 -2
- package/dist/esm/chunk-3AS5BVKL.mjs +2 -0
- package/dist/esm/chunk-3AS5BVKL.mjs.map +1 -0
- package/dist/esm/{chunk-TKXEVD7A.mjs → chunk-4FBUZY6C.mjs} +2 -2
- package/dist/esm/chunk-5WNHYEW2.mjs +2 -0
- package/dist/esm/{chunk-2SAOCLIU.mjs → chunk-6QJWFV2M.mjs} +2 -2
- package/dist/esm/{chunk-PDAWVDI7.mjs → chunk-7JRZLDWV.mjs} +2 -2
- package/dist/esm/chunk-7WPEGMD6.mjs +2 -0
- package/dist/esm/chunk-7WPEGMD6.mjs.map +1 -0
- package/dist/esm/{chunk-R6QCPXQG.mjs → chunk-B373VRCY.mjs} +2 -2
- package/dist/esm/chunk-B373VRCY.mjs.map +1 -0
- package/dist/esm/{chunk-ZD2TY5N3.mjs → chunk-BE3OXYYX.mjs} +2 -2
- package/dist/esm/{chunk-ZD2TY5N3.mjs.map → chunk-BE3OXYYX.mjs.map} +1 -1
- package/dist/esm/{chunk-A3VO773Q.mjs → chunk-BRGQM252.mjs} +2 -2
- package/dist/esm/{chunk-ZVYTHOS5.mjs → chunk-CICJRLYU.mjs} +2 -2
- package/dist/esm/{chunk-RXHER6EA.mjs → chunk-CZOZTNXJ.mjs} +2 -2
- package/dist/esm/chunk-DC5IVW4W.mjs +2 -0
- package/dist/esm/chunk-DC5IVW4W.mjs.map +1 -0
- package/dist/esm/chunk-DCVGWCZD.mjs +2 -0
- package/dist/esm/chunk-DCVGWCZD.mjs.map +1 -0
- package/dist/esm/chunk-DFRHNDOS.mjs +2 -0
- package/dist/esm/chunk-DFRHNDOS.mjs.map +1 -0
- package/dist/esm/{chunk-ERLDXTIY.mjs → chunk-DGH7NXHM.mjs} +2 -2
- package/dist/esm/{chunk-ZOY6N6UM.mjs → chunk-DH32UXHB.mjs} +2 -2
- package/dist/esm/chunk-EXXY72UN.mjs +2 -0
- package/dist/esm/{chunk-AIPHJFJL.mjs → chunk-F2GWK4YJ.mjs} +2 -2
- package/dist/esm/{chunk-LS3IDL2N.mjs → chunk-FU65NEDT.mjs} +2 -2
- package/dist/esm/{chunk-HHWJHOFZ.mjs → chunk-H3NZHL45.mjs} +2 -2
- package/dist/esm/chunk-HEYMZZRE.mjs +2 -0
- package/dist/esm/chunk-HEYMZZRE.mjs.map +1 -0
- package/dist/esm/chunk-KIMU5PYJ.mjs +2 -0
- package/dist/esm/chunk-KIMU5PYJ.mjs.map +1 -0
- package/dist/esm/{chunk-TTY5GFMN.mjs → chunk-L5C44K6H.mjs} +2 -2
- package/dist/esm/{chunk-KBC4ECVP.mjs → chunk-M7W6FZ5Z.mjs} +2 -2
- package/dist/esm/chunk-NDXMDJV4.mjs +2 -0
- package/dist/esm/{chunk-X5YB74NB.mjs.map → chunk-NDXMDJV4.mjs.map} +1 -1
- package/dist/esm/{chunk-AEGA5N2W.mjs → chunk-P5CIZZDK.mjs} +2 -2
- package/dist/esm/chunk-SZYA6IG4.mjs +4 -0
- package/dist/esm/chunk-SZYA6IG4.mjs.map +1 -0
- package/dist/esm/{chunk-HWMMVLTP.mjs → chunk-TORMKDQG.mjs} +2 -2
- package/dist/esm/{chunk-RIINVEZA.mjs → chunk-UQKQH5C7.mjs} +2 -2
- package/dist/esm/chunk-URNCRLHO.mjs +4 -0
- package/dist/esm/chunk-URNCRLHO.mjs.map +1 -0
- package/dist/esm/chunk-V5IPL4SJ.mjs +2 -0
- package/dist/esm/chunk-V5IPL4SJ.mjs.map +1 -0
- package/dist/esm/chunk-YVRPD7Z6.mjs +2 -0
- package/dist/esm/{chunk-JLZGYZBX.mjs.map → chunk-YVRPD7Z6.mjs.map} +1 -1
- package/dist/esm/chunk-ZKOF4KST.mjs +7 -0
- package/dist/esm/chunk-ZKOF4KST.mjs.map +1 -0
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/localNode.mjs +1 -1
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +5 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account/index.mjs +1 -1
- package/dist/esm/core/account/utils/address.mjs +1 -1
- package/dist/esm/core/account/utils/index.mjs +1 -1
- package/dist/esm/core/accountAddress.d.mts +18 -0
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.d.mts +3 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/abstraction.d.mts +4 -1
- package/dist/esm/core/crypto/abstraction.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.d.mts +19 -2
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.d.mts +8 -1
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/federatedKeyless.d.mts +11 -87
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +8 -6
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.d.mts +13 -586
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.d.mts +14 -4
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +42 -3
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.d.mts +3 -1
- package/dist/esm/core/crypto/privateKey.mjs +1 -1
- package/dist/esm/core/crypto/proof.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.d.mts +3 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.d.mts +27 -3
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.d.mts +28 -3
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/index.d.mts +8 -6
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/errors/index.d.mts +10 -2
- package/dist/esm/errors/index.mjs +1 -1
- package/dist/esm/federatedKeyless-DVfVovSR.d.mts +875 -0
- package/dist/esm/index.d.mts +10 -9
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/abstraction.d.mts +9 -9
- package/dist/esm/internal/abstraction.mjs +1 -1
- package/dist/esm/internal/account.d.mts +51 -8
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +14 -14
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +11 -11
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +3 -3
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/experimental.d.mts +7 -7
- package/dist/esm/internal/experimental.mjs +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +2 -2
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.d.mts +9 -8
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/object.mjs +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +6 -6
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/utils/index.d.mts +1 -1
- package/dist/esm/internal/utils/index.mjs +1 -1
- package/dist/esm/internal/utils/utils.d.mts +2 -19
- package/dist/esm/internal/utils/utils.mjs +1 -1
- package/dist/esm/internal/view.d.mts +7 -7
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/{publicKey-BMtGNNLg.d.mts → publicKey-pDHBAZlT.d.mts} +27 -1
- package/dist/esm/transactions/authenticator/account.d.mts +3 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +3 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +4 -2
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +3 -3
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/index.d.mts +4 -2
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +3 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.d.mts +3 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +2 -2
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +2 -2
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +3 -3
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/scriptComposer/index.d.mts +7 -7
- package/dist/esm/transactions/scriptComposer/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +8 -8
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +7 -7
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +5 -5
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +7 -7
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +8 -8
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +6 -6
- package/dist/esm/types/index.d.mts +1 -1
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/indexer.d.mts +1 -1
- package/dist/esm/types/keyless.d.mts +1 -1
- package/dist/esm/types/types.d.mts +10 -1
- package/dist/esm/types/types.mjs +1 -1
- package/dist/esm/utils/helpers.d.mts +28 -1
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.d.mts +3 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +10 -4
- package/src/account/AbstractKeylessAccount.ts +33 -49
- package/src/account/Account.ts +20 -0
- package/src/account/Ed25519Account.ts +26 -1
- package/src/account/MultiEd25519Account.ts +28 -1
- package/src/account/MultiKeyAccount.ts +25 -16
- package/src/account/SingleKeyAccount.ts +35 -1
- package/src/api/account.ts +84 -4
- package/src/cli/localNode.ts +6 -15
- package/src/client/get.ts +45 -18
- package/src/core/accountAddress.ts +25 -0
- package/src/core/crypto/abstraction.ts +6 -1
- package/src/core/crypto/ed25519.ts +19 -1
- package/src/core/crypto/ephemeral.ts +9 -0
- package/src/core/crypto/federatedKeyless.ts +46 -4
- package/src/core/crypto/index.ts +4 -3
- package/src/core/crypto/keyless.ts +610 -17
- package/src/core/crypto/multiEd25519.ts +11 -3
- package/src/core/crypto/multiKey.ts +86 -5
- package/src/core/crypto/publicKey.ts +28 -0
- package/src/core/crypto/secp256k1.ts +25 -2
- package/src/core/crypto/singleKey.ts +41 -6
- package/src/errors/index.ts +50 -0
- package/src/internal/account.ts +84 -7
- package/src/internal/move/jwks/build/jwk/BuildInfo.yaml +56 -0
- 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 +1533 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aggregator.move +48 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aggregator_factory.move +66 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aggregator_v2.move +280 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aptos_account.move +443 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aptos_coin.move +204 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/aptos_governance.move +1387 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/block.move +394 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/chain_id.move +41 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/chain_status.move +48 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/code.move +367 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/coin.move +2214 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/config_buffer.move +101 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/consensus_config.move +77 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/create_signer.move +21 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/delegation_pool.move +5568 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/dispatchable_fungible_asset.move +228 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/dkg.move +121 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/event.move +92 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/execution_config.move +66 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/function_info.move +100 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/fungible_asset.move +1566 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/gas_schedule.move +176 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/genesis.move +550 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/governance_proposal.move +23 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/guid.move +68 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/jwk_consensus_config.move +148 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/jwks.move +817 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/keyless_account.move +312 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/managed_coin.move +205 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/multisig_account.move +2477 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/object.move +1073 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/object_code_deployment.move +147 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/optional_aggregator.move +295 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/primary_fungible_store.move +405 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/randomness.move +574 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/randomness_api_v0_config.move +57 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/randomness_config.move +153 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/randomness_config_seqnum.move +49 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/reconfiguration.move +237 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/reconfiguration_state.move +132 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/reconfiguration_with_dkg.move +69 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/resource_account.move +267 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/stake.move +3286 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/staking_config.move +686 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/staking_contract.move +1618 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/staking_proxy.move +228 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/state_storage.move +90 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/storage_gas.move +622 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/system_addresses.move +82 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/timestamp.move +88 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/transaction_context.move +262 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/transaction_fee.move +457 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/transaction_validation.move +501 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/util.move +16 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/validator_consensus_info.move +42 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/version.move +115 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/vesting.move +2183 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosFramework/voting.move +1279 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/any.move +57 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/aptos_hash.move +253 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/big_vector.move +469 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/bls12381.move +985 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/bls12381_algebra.move +802 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/bn254_algebra.move +855 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/capability.move +193 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/comparator.move +173 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/copyable_any.move +45 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/crypto_algebra.move +351 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/debug.move +278 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/ed25519.move +262 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/fixed_point64.move +447 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/from_bcs.move +91 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/math128.move +381 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/math64.move +336 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/math_fixed.move +139 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/math_fixed64.move +142 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/multi_ed25519.move +482 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/pool_u64.move +571 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/pool_u64_unbound.move +270 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/ristretto255.move +1310 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/ristretto255_bulletproofs.move +253 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/ristretto255_elgamal.move +234 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/ristretto255_pedersen.move +158 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/secp256k1.move +114 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/simple_map.move +319 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/smart_table.move +769 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/smart_vector.move +766 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/string_utils.move +148 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/table.move +152 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/table_with_length.move +141 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/AptosStdlib/type_info.move +351 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/acl.move +46 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/bcs.move +27 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/bit_vector.move +239 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/error.move +88 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/features.move +780 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/fixed_point32.move +295 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/hash.move +8 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/option.move +356 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/signer.move +21 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/string.move +93 -0
- package/src/internal/move/jwks/build/jwk/sources/dependencies/MoveStdlib/vector.move +669 -0
- package/src/internal/move/jwks/build/jwk/sources/main.move +20 -0
- package/src/internal/utils/utils.ts +2 -32
- package/src/types/keyless.ts +1 -1
- package/src/types/types.ts +10 -0
- package/src/utils/helpers.ts +61 -0
- package/src/version.ts +1 -1
- package/dist/common/chunk-PA2XFIP3.js +0 -4
- package/dist/common/chunk-PA2XFIP3.js.map +0 -1
- package/dist/esm/chunk-2N4EPY2J.mjs +0 -2
- package/dist/esm/chunk-2N4EPY2J.mjs.map +0 -1
- package/dist/esm/chunk-2OBSQ2FK.mjs +0 -2
- package/dist/esm/chunk-2OBSQ2FK.mjs.map +0 -1
- package/dist/esm/chunk-2V636AYW.mjs +0 -2
- package/dist/esm/chunk-36H47QOE.mjs +0 -2
- package/dist/esm/chunk-36H47QOE.mjs.map +0 -1
- package/dist/esm/chunk-3DHWWNJ3.mjs +0 -2
- package/dist/esm/chunk-3DHWWNJ3.mjs.map +0 -1
- package/dist/esm/chunk-4KKJ36IO.mjs +0 -2
- package/dist/esm/chunk-4KKJ36IO.mjs.map +0 -1
- package/dist/esm/chunk-4NMDYPUD.mjs +0 -1
- package/dist/esm/chunk-4NMDYPUD.mjs.map +0 -1
- package/dist/esm/chunk-4PW3JKQZ.mjs +0 -2
- package/dist/esm/chunk-4PW3JKQZ.mjs.map +0 -1
- package/dist/esm/chunk-4QK4SKAT.mjs +0 -2
- package/dist/esm/chunk-4QK4SKAT.mjs.map +0 -1
- package/dist/esm/chunk-4SWK3JHQ.mjs +0 -2
- package/dist/esm/chunk-4SWK3JHQ.mjs.map +0 -1
- package/dist/esm/chunk-553ZRNUL.mjs +0 -2
- package/dist/esm/chunk-553ZRNUL.mjs.map +0 -1
- package/dist/esm/chunk-5AD7ZF6G.mjs +0 -2
- package/dist/esm/chunk-5AD7ZF6G.mjs.map +0 -1
- package/dist/esm/chunk-5MVHOQKD.mjs +0 -2
- package/dist/esm/chunk-5MVHOQKD.mjs.map +0 -1
- package/dist/esm/chunk-5W5XV63W.mjs +0 -2
- package/dist/esm/chunk-5W5XV63W.mjs.map +0 -1
- package/dist/esm/chunk-5WWU3WSU.mjs +0 -2
- package/dist/esm/chunk-5WWU3WSU.mjs.map +0 -1
- package/dist/esm/chunk-6FQDCTMA.mjs +0 -2
- package/dist/esm/chunk-6FQDCTMA.mjs.map +0 -1
- package/dist/esm/chunk-6IULVNLQ.mjs +0 -2
- package/dist/esm/chunk-6IULVNLQ.mjs.map +0 -1
- package/dist/esm/chunk-6KI24ZRR.mjs +0 -2
- package/dist/esm/chunk-6KI24ZRR.mjs.map +0 -1
- package/dist/esm/chunk-6KZT3KFZ.mjs +0 -2
- package/dist/esm/chunk-6KZT3KFZ.mjs.map +0 -1
- package/dist/esm/chunk-6VGLRQBT.mjs +0 -2
- package/dist/esm/chunk-6VGLRQBT.mjs.map +0 -1
- package/dist/esm/chunk-6YPM7TK2.mjs +0 -2
- package/dist/esm/chunk-6YPM7TK2.mjs.map +0 -1
- package/dist/esm/chunk-7HC33TEX.mjs +0 -2
- package/dist/esm/chunk-7HC33TEX.mjs.map +0 -1
- package/dist/esm/chunk-7KHKP7DY.mjs +0 -2
- package/dist/esm/chunk-7KHKP7DY.mjs.map +0 -1
- package/dist/esm/chunk-7OUPEQRN.mjs +0 -2
- package/dist/esm/chunk-7OUPEQRN.mjs.map +0 -1
- package/dist/esm/chunk-APGCD5FH.mjs +0 -2
- package/dist/esm/chunk-APGCD5FH.mjs.map +0 -1
- package/dist/esm/chunk-BMPHQ3E7.mjs +0 -2
- package/dist/esm/chunk-BSCOVLWS.mjs +0 -1
- package/dist/esm/chunk-BSCOVLWS.mjs.map +0 -1
- package/dist/esm/chunk-CGTMSLVZ.mjs +0 -2
- package/dist/esm/chunk-CGTMSLVZ.mjs.map +0 -1
- package/dist/esm/chunk-CU6HQJSE.mjs +0 -2
- package/dist/esm/chunk-CU6HQJSE.mjs.map +0 -1
- package/dist/esm/chunk-DAR3R4UP.mjs +0 -2
- package/dist/esm/chunk-DAR3R4UP.mjs.map +0 -1
- package/dist/esm/chunk-DUJJUR7O.mjs +0 -2
- package/dist/esm/chunk-DUJJUR7O.mjs.map +0 -1
- package/dist/esm/chunk-E7FWVXGX.mjs +0 -1
- package/dist/esm/chunk-E7FWVXGX.mjs.map +0 -1
- package/dist/esm/chunk-EHTTY7EF.mjs +0 -2
- package/dist/esm/chunk-EHTTY7EF.mjs.map +0 -1
- package/dist/esm/chunk-FCHN3LT7.mjs +0 -2
- package/dist/esm/chunk-FCHN3LT7.mjs.map +0 -1
- package/dist/esm/chunk-GFPEB22G.mjs +0 -1
- package/dist/esm/chunk-GFPEB22G.mjs.map +0 -1
- package/dist/esm/chunk-GJOUTA7U.mjs +0 -2
- package/dist/esm/chunk-GJOUTA7U.mjs.map +0 -1
- package/dist/esm/chunk-H4YAL2IL.mjs +0 -2
- package/dist/esm/chunk-H4YAL2IL.mjs.map +0 -1
- package/dist/esm/chunk-HEZ2ZYZA.mjs +0 -1
- package/dist/esm/chunk-HEZ2ZYZA.mjs.map +0 -1
- package/dist/esm/chunk-HTP5ZVX5.mjs +0 -2
- package/dist/esm/chunk-HTP5ZVX5.mjs.map +0 -1
- package/dist/esm/chunk-HWNPKEOJ.mjs +0 -2
- package/dist/esm/chunk-HWNPKEOJ.mjs.map +0 -1
- package/dist/esm/chunk-IHYTP2EW.mjs +0 -1
- package/dist/esm/chunk-IHYTP2EW.mjs.map +0 -1
- package/dist/esm/chunk-ILUFGYLO.mjs +0 -2
- package/dist/esm/chunk-ILUFGYLO.mjs.map +0 -1
- package/dist/esm/chunk-IM4O756A.mjs +0 -2
- package/dist/esm/chunk-IM4O756A.mjs.map +0 -1
- package/dist/esm/chunk-IMYNN4TW.mjs +0 -2
- package/dist/esm/chunk-IMYNN4TW.mjs.map +0 -1
- package/dist/esm/chunk-JA7CXAVY.mjs +0 -2
- package/dist/esm/chunk-JA7CXAVY.mjs.map +0 -1
- package/dist/esm/chunk-JBARRS6K.mjs +0 -2
- package/dist/esm/chunk-JBARRS6K.mjs.map +0 -1
- package/dist/esm/chunk-JLZGYZBX.mjs +0 -2
- package/dist/esm/chunk-JNNFNYDO.mjs +0 -2
- package/dist/esm/chunk-JNNFNYDO.mjs.map +0 -1
- package/dist/esm/chunk-JXHGJ3AA.mjs +0 -2
- package/dist/esm/chunk-JXHGJ3AA.mjs.map +0 -1
- package/dist/esm/chunk-K4JUKMMY.mjs +0 -2
- package/dist/esm/chunk-K4JUKMMY.mjs.map +0 -1
- package/dist/esm/chunk-LET633ZK.mjs +0 -2
- package/dist/esm/chunk-LET633ZK.mjs.map +0 -1
- package/dist/esm/chunk-LQOSHBB7.mjs +0 -4
- package/dist/esm/chunk-LQOSHBB7.mjs.map +0 -1
- package/dist/esm/chunk-M2GGYCLU.mjs +0 -2
- package/dist/esm/chunk-M2GGYCLU.mjs.map +0 -1
- package/dist/esm/chunk-MY2BEHYF.mjs +0 -2
- package/dist/esm/chunk-MY2BEHYF.mjs.map +0 -1
- package/dist/esm/chunk-MZVVBJVV.mjs +0 -2
- package/dist/esm/chunk-MZVVBJVV.mjs.map +0 -1
- package/dist/esm/chunk-N73S2K2V.mjs +0 -2
- package/dist/esm/chunk-N73S2K2V.mjs.map +0 -1
- package/dist/esm/chunk-NIDF2LHF.mjs +0 -2
- package/dist/esm/chunk-NIDF2LHF.mjs.map +0 -1
- package/dist/esm/chunk-OSZWSLJA.mjs +0 -2
- package/dist/esm/chunk-OSZWSLJA.mjs.map +0 -1
- package/dist/esm/chunk-P265EC4T.mjs +0 -2
- package/dist/esm/chunk-P265EC4T.mjs.map +0 -1
- package/dist/esm/chunk-PE7KT5ZB.mjs +0 -2
- package/dist/esm/chunk-PE7KT5ZB.mjs.map +0 -1
- package/dist/esm/chunk-PICZWW35.mjs +0 -2
- package/dist/esm/chunk-PICZWW35.mjs.map +0 -1
- package/dist/esm/chunk-PWGTRRSJ.mjs +0 -2
- package/dist/esm/chunk-PWGTRRSJ.mjs.map +0 -1
- package/dist/esm/chunk-Q3AVJUBL.mjs +0 -2
- package/dist/esm/chunk-Q3AVJUBL.mjs.map +0 -1
- package/dist/esm/chunk-QLEZDMIK.mjs +0 -2
- package/dist/esm/chunk-QLEZDMIK.mjs.map +0 -1
- package/dist/esm/chunk-QXTQNFEQ.mjs +0 -2
- package/dist/esm/chunk-QXTQNFEQ.mjs.map +0 -1
- package/dist/esm/chunk-R6I6Z3AA.mjs +0 -2
- package/dist/esm/chunk-R6I6Z3AA.mjs.map +0 -1
- package/dist/esm/chunk-R6QCPXQG.mjs.map +0 -1
- package/dist/esm/chunk-RMMOF53Q.mjs +0 -1
- package/dist/esm/chunk-RMMOF53Q.mjs.map +0 -1
- package/dist/esm/chunk-SCLWOTHD.mjs +0 -2
- package/dist/esm/chunk-SCLWOTHD.mjs.map +0 -1
- package/dist/esm/chunk-SZU5Q6CF.mjs +0 -2
- package/dist/esm/chunk-SZU5Q6CF.mjs.map +0 -1
- package/dist/esm/chunk-T3VLXADE.mjs +0 -2
- package/dist/esm/chunk-T3VLXADE.mjs.map +0 -1
- package/dist/esm/chunk-TJICLFR2.mjs +0 -2
- package/dist/esm/chunk-TJICLFR2.mjs.map +0 -1
- package/dist/esm/chunk-U6ZD22B5.mjs +0 -2
- package/dist/esm/chunk-U6ZD22B5.mjs.map +0 -1
- package/dist/esm/chunk-UOBDL2BZ.mjs +0 -2
- package/dist/esm/chunk-UOBDL2BZ.mjs.map +0 -1
- package/dist/esm/chunk-UP36QQGG.mjs +0 -4
- package/dist/esm/chunk-UP36QQGG.mjs.map +0 -1
- package/dist/esm/chunk-VIXTXBYA.mjs +0 -2
- package/dist/esm/chunk-VIXTXBYA.mjs.map +0 -1
- package/dist/esm/chunk-WYV4W2IM.mjs +0 -2
- package/dist/esm/chunk-WYV4W2IM.mjs.map +0 -1
- package/dist/esm/chunk-X5ORWYVO.mjs +0 -7
- package/dist/esm/chunk-X5ORWYVO.mjs.map +0 -1
- package/dist/esm/chunk-X5UJYMJU.mjs +0 -2
- package/dist/esm/chunk-X5UJYMJU.mjs.map +0 -1
- package/dist/esm/chunk-X5YB74NB.mjs +0 -2
- package/dist/esm/chunk-X6H4G6NE.mjs +0 -2
- package/dist/esm/chunk-X6H4G6NE.mjs.map +0 -1
- package/dist/esm/chunk-XFL3B4WZ.mjs +0 -2
- package/dist/esm/chunk-XFL3B4WZ.mjs.map +0 -1
- package/dist/esm/chunk-XX4SFNZY.mjs +0 -2
- package/dist/esm/chunk-XX4SFNZY.mjs.map +0 -1
- package/dist/esm/chunk-YMXJ6GYE.mjs +0 -2
- package/dist/esm/chunk-YMXJ6GYE.mjs.map +0 -1
- package/dist/esm/chunk-ZJCTELB4.mjs +0 -2
- package/dist/esm/chunk-ZJCTELB4.mjs.map +0 -1
- /package/dist/esm/{chunk-2P27DDVV.mjs.map → chunk-2DISMLR6.mjs.map} +0 -0
- /package/dist/esm/{chunk-ACE3NEV6.mjs.map → chunk-2RBINVFA.mjs.map} +0 -0
- /package/dist/esm/{chunk-TKXEVD7A.mjs.map → chunk-4FBUZY6C.mjs.map} +0 -0
- /package/dist/esm/{chunk-BMPHQ3E7.mjs.map → chunk-5WNHYEW2.mjs.map} +0 -0
- /package/dist/esm/{chunk-2SAOCLIU.mjs.map → chunk-6QJWFV2M.mjs.map} +0 -0
- /package/dist/esm/{chunk-PDAWVDI7.mjs.map → chunk-7JRZLDWV.mjs.map} +0 -0
- /package/dist/esm/{chunk-A3VO773Q.mjs.map → chunk-BRGQM252.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZVYTHOS5.mjs.map → chunk-CICJRLYU.mjs.map} +0 -0
- /package/dist/esm/{chunk-RXHER6EA.mjs.map → chunk-CZOZTNXJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-ERLDXTIY.mjs.map → chunk-DGH7NXHM.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZOY6N6UM.mjs.map → chunk-DH32UXHB.mjs.map} +0 -0
- /package/dist/esm/{chunk-2V636AYW.mjs.map → chunk-EXXY72UN.mjs.map} +0 -0
- /package/dist/esm/{chunk-AIPHJFJL.mjs.map → chunk-F2GWK4YJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-LS3IDL2N.mjs.map → chunk-FU65NEDT.mjs.map} +0 -0
- /package/dist/esm/{chunk-HHWJHOFZ.mjs.map → chunk-H3NZHL45.mjs.map} +0 -0
- /package/dist/esm/{chunk-TTY5GFMN.mjs.map → chunk-L5C44K6H.mjs.map} +0 -0
- /package/dist/esm/{chunk-KBC4ECVP.mjs.map → chunk-M7W6FZ5Z.mjs.map} +0 -0
- /package/dist/esm/{chunk-AEGA5N2W.mjs.map → chunk-P5CIZZDK.mjs.map} +0 -0
- /package/dist/esm/{chunk-HWMMVLTP.mjs.map → chunk-TORMKDQG.mjs.map} +0 -0
- /package/dist/esm/{chunk-RIINVEZA.mjs.map → chunk-UQKQH5C7.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s,c as d,e as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s,c as d,e as t}from"./chunk-CZOZTNXJ.mjs";import{a as l,b as n,c as o,d as z,e as c,f as u}from"./chunk-56CNRT2K.mjs";var U=class i extends s{constructor(e){super(),d(e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}deserialize(e){return new a(e.deserializeU256())}static deserialize(e){return new i(e.deserializeBool())}},p=class i extends s{constructor(e){super(),t(e,0,l),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new i(e.deserializeU8())}},b=class i extends s{constructor(e){super(),t(e,0,n),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new i(e.deserializeU16())}},y=class i extends s{constructor(e){super(),t(e,0,o),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new i(e.deserializeU32())}},m=class i extends s{constructor(e){super(),t(e,BigInt(0),z),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new i(e.deserializeU64())}},B=class i extends s{constructor(e){super(),t(e,BigInt(0),c),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new i(e.deserializeU128())}},a=class i extends s{constructor(e){super(),t(e,BigInt(0),u),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new i(e.deserializeU256())}};export{U as a,p as b,b as c,y as d,m as e,B as f,a as g};
|
|
2
|
+
//# sourceMappingURL=chunk-4FBUZY6C.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as s}from"./chunk-M7W6FZ5Z.mjs";import{w as i,x as m}from"./chunk-VHNX2NUR.mjs";import{c as n}from"./chunk-2DISMLR6.mjs";async function b(t){let{aptosConfig:a,handle:e,data:o,options:r}=t;return(await n({aptosConfig:a,originMethod:"getTableItem",path:`tables/${e}/item`,params:{ledger_version:r?.ledgerVersion},body:o})).data}async function f(t){let{aptosConfig:a,options:e}=t,o={query:i,variables:{where_condition:e?.where,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await s({aptosConfig:a,query:o,originMethod:"getTableItemsData"})).table_items}async function T(t){let{aptosConfig:a,options:e}=t,o={query:m,variables:{where_condition:e?.where,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await s({aptosConfig:a,query:o,originMethod:"getTableItemsMetadata"})).table_metadatas}export{b as a,f as b,T as c};
|
|
2
|
+
//# sourceMappingURL=chunk-6QJWFV2M.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-CZOZTNXJ.mjs";var r=class t extends e{constructor(i){super(),this.identifier=i}serialize(i){i.serializeStr(this.identifier)}static deserialize(i){let s=i.deserializeStr();return new t(s)}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7JRZLDWV.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e}from"./chunk-CZOZTNXJ.mjs";import{b as r}from"./chunk-VHY6ZATX.mjs";var t=class extends e{toUint8Array(){return this.bcsToBytes()}toString(){let n=this.toUint8Array();return r.fromHexInput(n).toString()}},i=class extends t{};export{t as a,i as b};
|
|
2
|
+
//# sourceMappingURL=chunk-7WPEGMD6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/crypto/publicKey.ts"],"sourcesContent":["import { AptosConfig } from \"../../api\";\nimport { Serializable } from \"../../bcs\";\nimport { HexInput } from \"../../types\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Hex } from \"../hex\";\nimport { Signature } from \"./signature\";\n\n/**\n * Represents the arguments required to verify a digital signature.\n *\n * @param message - The original message that was signed.\n * @param signature - The signature to be verified against the message.\n * @group Implementation\n * @category Serialization\n */\nexport interface VerifySignatureArgs {\n message: HexInput;\n signature: Signature;\n}\n\n/**\n * Represents the arguments required to verify a digital signature asynchronously.\n *\n * The validity of certain types of signatures are dependent on network state. This is the case for\n * Keyless signatures which need to lookup the verification key and keyless configuration.\n *\n * @param aptosConfig - The Aptos configuration to use\n * @param message - The original message that was signed.\n * @param signature - The signature to be verified against the message.\n * @group Implementation\n * @category Serialization\n */\nexport type VerifySignatureAsyncArgs = VerifySignatureArgs & {\n aptosConfig: AptosConfig;\n options?: any;\n};\n\n/**\n * Represents an abstract public key.\n *\n * This class provides a common interface for verifying signatures associated with the public key.\n * It allows for the retrieval of the raw public key bytes and the public key in a hexadecimal string format.\n * @group Implementation\n * @category Serialization\n */\nexport abstract class PublicKey extends Serializable {\n /**\n * Verifies that the private key associated with this public key signed the message with the given signature.\n * @param args.message The message that was signed\n * @param args.signature The signature to verify\n * @group Implementation\n * @category Serialization\n */\n abstract verifySignature(args: VerifySignatureArgs): boolean;\n\n /**\n * Verifies signature with the public key and makes any network calls required to get state required to verify the signature.\n * @param args.aptosConfig The Aptos configuration\n * @param args.message The message that was signed\n * @param args.signature The signature to verify\n * @group Implementation\n * @category Serialization\n */\n abstract verifySignatureAsync(args: VerifySignatureAsyncArgs): Promise<boolean>;\n\n /**\n * Get the raw public key bytes\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.bcsToBytes();\n }\n\n /**\n * Get the public key as a hex string with a 0x prefix.\n *\n * @returns The public key in hex format.\n * @group Implementation\n * @category Serialization\n */\n toString(): string {\n const bytes = this.toUint8Array();\n return Hex.fromHexInput(bytes).toString();\n }\n}\n\n/**\n * An abstract representation of an account public key.\n *\n * Provides a common interface for deriving an authentication key.\n *\n * @abstract\n * @group Implementation\n * @category Serialization\n */\nexport abstract class AccountPublicKey extends PublicKey {\n /**\n * Get the authentication key associated with this public key\n * @group Implementation\n * @category Serialization\n */\n abstract authKey(): AuthenticationKey;\n}\n"],"mappings":"kFA6CO,IAAeA,EAAf,cAAiCC,CAAa,CAyBnD,cAA2B,CACzB,OAAO,KAAK,WAAW,CACzB,CASA,UAAmB,CACjB,IAAMC,EAAQ,KAAK,aAAa,EAChC,OAAOC,EAAI,aAAaD,CAAK,EAAE,SAAS,CAC1C,CACF,EAWsBE,EAAf,cAAwCJ,CAAU,CAOzD","names":["PublicKey","Serializable","bytes","Hex","AccountPublicKey"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var d=(e=>(e.JSON="application/json",e.BCS="application/x-bcs",e.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",e.BCS_VIEW_FUNCTION="application/x.aptos.view_function+bcs",e))(d||{}),
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
var d=(e=>(e.JSON="application/json",e.BCS="application/x-bcs",e.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",e.BCS_VIEW_FUNCTION="application/x.aptos.view_function+bcs",e))(d||{}),u=(t=>(t[t.Bool=0]="Bool",t[t.U8=1]="U8",t[t.U64=2]="U64",t[t.U128=3]="U128",t[t.Address=4]="Address",t[t.Signer=5]="Signer",t[t.Vector=6]="Vector",t[t.Struct=7]="Struct",t[t.U16=8]="U16",t[t.U32=9]="U32",t[t.U256=10]="U256",t[t.Reference=254]="Reference",t[t.Generic=255]="Generic",t))(u||{}),y=(r=>(r[r.U8=0]="U8",r[r.U64=1]="U64",r[r.U128=2]="U128",r[r.Address=3]="Address",r[r.U8Vector=4]="U8Vector",r[r.Bool=5]="Bool",r[r.U16=6]="U16",r[r.U32=7]="U32",r[r.U256=8]="U256",r[r.Serialized=9]="Serialized",r))(y||{}),c=(o=>(o[o.Script=0]="Script",o[o.EntryFunction=2]="EntryFunction",o[o.Multisig=3]="Multisig",o))(c||{}),l=(i=>(i[i.MultiAgentTransaction=0]="MultiAgentTransaction",i[i.FeePayerTransaction=1]="FeePayerTransaction",i))(l||{}),_=(n=>(n[n.Ed25519=0]="Ed25519",n[n.MultiEd25519=1]="MultiEd25519",n[n.MultiAgent=2]="MultiAgent",n[n.FeePayer=3]="FeePayer",n[n.SingleSender=4]="SingleSender",n))(_||{}),x=(p=>(p[p.Ed25519=0]="Ed25519",p[p.MultiEd25519=1]="MultiEd25519",p[p.SingleKey=2]="SingleKey",p[p.MultiKey=3]="MultiKey",p[p.NoAccountAuthenticator=4]="NoAccountAuthenticator",p[p.Abstraction=5]="Abstraction",p))(x||{}),h=(i=>(i.Ed25519="ed25519",i.Secp256k1="secp256k1",i))(h||{}),v=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1=1]="Secp256k1",e[e.Keyless=3]="Keyless",e[e.FederatedKeyless=4]="FederatedKeyless",e))(v||{}),R=(o=>(o[o.Ed25519=0]="Ed25519",o[o.Secp256k1=1]="Secp256k1",o[o.Keyless=3]="Keyless",o))(R||{}),m=(a=>(a[a.Ed25519=0]="Ed25519",a))(m||{}),M=(a=>(a[a.Ed25519=0]="Ed25519",a))(M||{}),b=(a=>(a[a.ZkProof=0]="ZkProof",a))(b||{}),k=(a=>(a[a.Groth16=0]="Groth16",a))(k||{}),f=(g=>(g.Pending="pending_transaction",g.User="user_transaction",g.Genesis="genesis_transaction",g.BlockMetadata="block_metadata_transaction",g.StateCheckpoint="state_checkpoint_transaction",g.Validator="validator_transaction",g.BlockEpilogue="block_epilogue_transaction",g))(f||{});function F(s){return s.type==="pending_transaction"}function B(s){return s.type==="user_transaction"}function I(s){return s.type==="genesis_transaction"}function G(s){return s.type==="block_metadata_transaction"}function O(s){return s.type==="state_checkpoint_transaction"}function P(s){return s.type==="validator_transaction"}function A(s){return s.type==="block_epilogue_transaction"}function q(s){return"signature"in s&&s.signature==="ed25519_signature"}function N(s){return"signature"in s&&s.signature==="secp256k1_ecdsa_signature"}function D(s){return s.type==="multi_agent_signature"}function H(s){return s.type==="fee_payer_signature"}function j(s){return s.type==="multi_ed25519_signature"}var S=(o=>(o.PRIVATE="private",o.PUBLIC="public",o.FRIEND="friend",o))(S||{}),C=(e=>(e.STORE="store",e.DROP="drop",e.KEY="key",e.COPY="copy",e))(C||{}),T=(i=>(i.VALIDATOR="validator",i.FULL_NODE="full_node",i))(T||{}),E=(e=>(e[e.Ed25519=0]="Ed25519",e[e.MultiEd25519=1]="MultiEd25519",e[e.SingleKey=2]="SingleKey",e[e.MultiKey=3]="MultiKey",e))(E||{}),U=(i=>(i[i.Ed25519=0]="Ed25519",i[i.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",i))(U||{}),W=(n=>(n[n.DeriveAuid=251]="DeriveAuid",n[n.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",n[n.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",n[n.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",n[n.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",n))(W||{});export{d as a,u as b,y as c,c as d,l as e,_ as f,x as g,h,v as i,R as j,m as k,M as l,b as m,k as n,f as o,F as p,B as q,I as r,G as s,O as t,P as u,A as v,q as w,N as x,D as y,H as z,j as A,S as B,C,T as D,E,U as F,W as G};
|
|
2
|
+
//# sourceMappingURL=chunk-B373VRCY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/types.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Network } from \"../utils/apiEndpoints\";\nimport { OrderBy, TokenStandard } from \"./indexer\";\n\n/**\n * Different MIME types used for data interchange in transactions and responses.\n */\nexport enum MimeType {\n /**\n * JSON representation, used for transaction submission and accept type JSON output\n */\n JSON = \"application/json\",\n /**\n * BCS representation, used for accept type BCS output\n */\n BCS = \"application/x-bcs\",\n /**\n * BCS representation, used for transaction submission in BCS input\n */\n BCS_SIGNED_TRANSACTION = \"application/x.aptos.signed_transaction+bcs\",\n BCS_VIEW_FUNCTION = \"application/x.aptos.view_function+bcs\",\n}\n\n/**\n * Hexadecimal data input for functions, supporting both string and Uint8Array formats.\n */\nexport type HexInput = string | Uint8Array;\n\n/**\n * Variants of type tags used in the system, encompassing various data types and structures.\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/language_storage.rs#L27}\n */\nexport enum TypeTagVariants {\n Bool = 0,\n U8 = 1,\n U64 = 2,\n U128 = 3,\n Address = 4,\n Signer = 5,\n Vector = 6,\n Struct = 7,\n U16 = 8,\n U32 = 9,\n U256 = 10,\n Reference = 254, // This is specifically a placeholder and does not represent a real type\n Generic = 255, // This is specifically a placeholder and does not represent a real type\n}\n\n/**\n * Variants of script transaction arguments used in Rust, encompassing various data types for transaction processing.\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/transaction_argument.rs#L11}\n */\nexport enum ScriptTransactionArgumentVariants {\n U8 = 0,\n U64 = 1,\n U128 = 2,\n Address = 3,\n U8Vector = 4,\n Bool = 5,\n U16 = 6,\n U32 = 7,\n U256 = 8,\n Serialized = 9,\n}\n\n/**\n * The payload for various transaction types in the system.\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L478}\n */\nexport enum TransactionPayloadVariants {\n Script = 0,\n EntryFunction = 2,\n Multisig = 3,\n}\n\n/**\n * Variants of transactions used in the system.\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/mod.rs#L440}\n */\nexport enum TransactionVariants {\n MultiAgentTransaction = 0,\n FeePayerTransaction = 1,\n}\n\n/**\n * Variants of transaction authenticators used in the system.\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L44}\n */\nexport enum TransactionAuthenticatorVariant {\n Ed25519 = 0,\n MultiEd25519 = 1,\n MultiAgent = 2,\n FeePayer = 3,\n SingleSender = 4,\n}\n\n/**\n * Variants of account authenticators used in transactions.\n * {@link https://github.com/aptos-labs/aptos-core/blob/main/types/src/transaction/authenticator.rs#L414}\n */\nexport enum AccountAuthenticatorVariant {\n Ed25519 = 0,\n MultiEd25519 = 1,\n SingleKey = 2,\n MultiKey = 3,\n NoAccountAuthenticator = 4,\n Abstraction = 5,\n}\n\n/**\n * Variants of private keys that can comply with the AIP-80 standard.\n * {@link https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md}\n */\nexport enum PrivateKeyVariants {\n Ed25519 = \"ed25519\",\n Secp256k1 = \"secp256k1\",\n}\n\n/**\n * Variants of public keys used in cryptographic operations.\n */\nexport enum AnyPublicKeyVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\n Keyless = 3,\n FederatedKeyless = 4,\n}\n\n/**\n * Variants of signature types used for cryptographic operations.\n */\nexport enum AnySignatureVariant {\n Ed25519 = 0,\n Secp256k1 = 1,\n Keyless = 3,\n}\n\n/**\n * Variants of ephemeral public keys used in cryptographic operations.\n */\nexport enum EphemeralPublicKeyVariant {\n Ed25519 = 0,\n}\n\n/**\n * Variants of ephemeral signatures used for secure communication.\n */\nexport enum EphemeralSignatureVariant {\n Ed25519 = 0,\n}\n\n/**\n * Variants of ephemeral certificates used in secure transactions.\n */\nexport enum EphemeralCertificateVariant {\n ZkProof = 0,\n}\n\n/**\n * Variants of zero-knowledge proofs used in cryptographic operations.\n */\nexport enum ZkpVariant {\n Groth16 = 0,\n}\n\n/**\n * BCS types\n */\nexport type Uint8 = number;\n\n/**\n * A 16-bit unsigned integer.\n */\nexport type Uint16 = number;\n\n/**\n * A 32-bit unsigned integer.\n */\nexport type Uint32 = number;\n\n/**\n * A 64-bit unsigned integer value.\n */\nexport type Uint64 = bigint;\n\n/**\n * A 128-bit unsigned integer used for precise arithmetic operations.\n */\nexport type Uint128 = bigint;\n\n/**\n * A 256-bit unsigned integer used for precise numerical calculations.\n */\nexport type Uint256 = bigint;\n\n/**\n * A number or a bigint value.\n */\nexport type AnyNumber = number | bigint;\n\n/**\n * Configuration options for initializing the SDK, allowing customization of its behavior and interaction with the Aptos network.\n */\nexport type AptosSettings = {\n readonly network?: Network;\n\n readonly fullnode?: string;\n\n readonly faucet?: string;\n\n readonly indexer?: string;\n\n readonly pepper?: string;\n\n readonly prover?: string;\n\n readonly clientConfig?: ClientConfig;\n\n readonly client?: Client;\n\n readonly fullnodeConfig?: FullNodeConfig;\n\n readonly indexerConfig?: IndexerConfig;\n\n readonly faucetConfig?: FaucetConfig;\n};\n\n/**\n * Defines the parameters for paginating query results, including the starting position and maximum number of items to return.\n * @param offset Specifies the starting position of the query result. Default is 0.\n * @param limit Specifies the maximum number of items to return. Default is 25.\n */\nexport interface PaginationArgs {\n offset?: AnyNumber;\n limit?: number;\n}\n\n/**\n * Defines the parameters for paginating query results, including the starting position and maximum number of items to return.\n * @param cursor Specifies the starting position of the query result. Default is at the beginning if undefined. This is not a number and must come from the API.\n * @param limit Specifies the maximum number of items to return. Default is 25.\n */\nexport interface CursorPaginationArgs {\n cursor?: string;\n limit?: number;\n}\n\n/**\n * Represents the arguments for specifying a token standard.\n *\n * @param tokenStandard - Optional standard of the token.\n */\nexport interface TokenStandardArg {\n tokenStandard?: TokenStandard;\n}\n\nexport interface OrderByArg<T extends {}> {\n orderBy?: OrderBy<T>;\n}\n\nexport interface WhereArg<T extends {}> {\n where?: T;\n}\n\n/**\n * QUERY TYPES\n */\n\n/**\n * A configuration object for requests to the server, including API key, extra headers, and cookie handling options.\n */\nexport type ClientConfig = ClientHeadersType & {\n WITH_CREDENTIALS?: boolean;\n API_KEY?: string;\n};\n\n/**\n * A configuration object for a Fullnode, allowing for the inclusion of extra headers in requests.\n */\nexport type FullNodeConfig = ClientHeadersType;\n\n/**\n * An Indexer configuration object for sending requests with additional headers.\n */\nexport type IndexerConfig = ClientHeadersType;\n\n/**\n * A configuration object for a faucet, including optional authentication and headers for requests.\n */\nexport type FaucetConfig = ClientHeadersType & {\n AUTH_TOKEN?: string;\n};\n\n/**\n * General type definition for client headers.\n */\nexport type ClientHeadersType = {\n HEADERS?: Record<string, string | number | boolean>;\n};\n\n/**\n * Represents a client for making requests to a service provider.\n *\n * @param Req - The type of the request payload.\n * @param Res - The type of the response payload.\n */\nexport interface ClientRequest<Req> {\n url: string;\n method: \"GET\" | \"POST\";\n originMethod?: string;\n body?: Req;\n contentType?: string;\n acceptType?: string;\n params?: any;\n overrides?: ClientConfig & FullNodeConfig & IndexerConfig & FaucetConfig;\n headers?: Record<string, any>;\n}\n\nexport interface ClientResponse<Res> {\n status: number;\n statusText: string;\n data: Res;\n config?: any;\n request?: any;\n response?: any;\n headers?: any;\n}\n\nexport interface Client {\n /**\n * Sends a request to the specified URL with the given options.\n *\n * @param requestOptions - The options for the request.\n * @param requestOptions.url - The URL to send the request to.\n * @param requestOptions.method - The HTTP method to use, either \"GET\" or \"POST\".\n * @param requestOptions.path - An optional path to append to the URL.\n * @param requestOptions.body - The body of the request, applicable for POST requests.\n * @param requestOptions.contentType - The content type of the request body.\n * @param requestOptions.acceptType - The expected content type of the response.\n * @param requestOptions.params - Optional parameters to include in the request.\n * @param requestOptions.originMethod - An optional method to specify the origin of the request.\n * @param requestOptions.overrides - Optional configuration overrides for the request.\n */\n provider<Req, Res>(requestOptions: ClientRequest<Req>): Promise<ClientResponse<Res>>;\n\n /**\n * Sends a request to the specified URL with the given options, that returns a binary response\n *\n * @experimental\n * @param requestOptions - The options for the request.\n * @param requestOptions.url - The URL to send the request to.\n * @param requestOptions.method - The HTTP method to use, either \"GET\" or \"POST\".\n * @param requestOptions.path - An optional path to append to the URL.\n * @param requestOptions.body - The body of the request, applicable for POST requests.\n * @param requestOptions.contentType - The content type of the request body.\n * @param requestOptions.acceptType - The expected content type of the response.\n * @param requestOptions.params - Optional parameters to include in the request.\n * @param requestOptions.originMethod - An optional method to specify the origin of the request.\n * @param requestOptions.overrides - Optional configuration overrides for the request.\n */\n binaryProvider?: <Req>(requestOptions: ClientRequest<Req>) => Promise<ClientResponse<Buffer>>;\n}\n\n/**\n * The API request type\n *\n * @param url - the url to make the request to, i.e. https://fullnode.devnet.aptoslabs.com/v1\n * @param method - the request method \"GET\" | \"POST\"\n * @param endpoint (optional) - the endpoint to make the request to, i.e. transactions\n * @param body (optional) - the body of the request\n * @param contentType (optional) - the content type to set the `content-type` header to,\n * by default is set to `application/json`\n * @param acceptType (optional) - the content type to set the `accept-type` header to,\n * by default is set to `application/json`\n * @param params (optional) - query params to add to the request\n * @param originMethod (optional) - the local method the request came from\n * @param overrides (optional) - a `ClientConfig` object type to override request data\n */\nexport type AptosRequest = {\n url: string;\n method: \"GET\" | \"POST\";\n path?: string;\n body?: any;\n contentType?: string;\n acceptType?: string;\n params?: Record<string, string | AnyNumber | boolean | undefined>;\n originMethod?: string;\n overrides?: ClientConfig & FullNodeConfig & IndexerConfig & FaucetConfig;\n};\n\n/**\n * The API response type\n *\n * @param status - the response status. i.e. 200\n * @param statusText - the response message\n * @param data the response data\n * @param url the url the request was made to\n * @param headers the response headers\n * @param config (optional) - the request object\n * @param request (optional) - the request object\n */\nexport interface AptosResponse<Req, Res> {\n status: number;\n statusText: string;\n data: Res;\n url: string;\n headers: any;\n config?: any;\n request?: Req;\n}\n\n/**\n * The ledger version of transactions, defaulting to the latest version if not specified.\n */\nexport type LedgerVersionArg = {\n ledgerVersion?: AnyNumber;\n};\n\n/**\n * RESPONSE TYPES\n */\n\n/**\n * The output of the estimate gas API, including the deprioritized estimate for the gas unit price.\n */\nexport type GasEstimation = {\n /**\n * The deprioritized estimate for the gas unit price\n */\n deprioritized_gas_estimate?: number;\n /**\n * The current estimate for the gas unit price\n */\n gas_estimate: number;\n /**\n * The prioritized estimate for the gas unit price\n */\n prioritized_gas_estimate?: number;\n};\n\nexport type MoveResource<T = {}> = {\n type: MoveStructId;\n data: T;\n};\n\n/**\n * The data associated with an account, including its sequence number.\n */\nexport type AccountData = {\n sequence_number: string;\n authentication_key: string;\n};\n\n/**\n * A Move module containing an address.\n */\nexport type MoveModuleBytecode = {\n bytecode: string;\n abi?: MoveModule;\n};\n\n/**\n * TRANSACTION TYPES\n */\n\n/**\n * Different types of transaction responses that can occur in the system.\n */\nexport enum TransactionResponseType {\n Pending = \"pending_transaction\",\n User = \"user_transaction\",\n Genesis = \"genesis_transaction\",\n BlockMetadata = \"block_metadata_transaction\",\n StateCheckpoint = \"state_checkpoint_transaction\",\n Validator = \"validator_transaction\",\n BlockEpilogue = \"block_epilogue_transaction\",\n}\n\n/**\n * The response for a transaction, which can be either pending or committed.\n */\nexport type TransactionResponse = PendingTransactionResponse | CommittedTransactionResponse;\n\n/**\n * The response for a committed transaction, which can be one of several transaction types.\n */\nexport type CommittedTransactionResponse =\n | UserTransactionResponse\n | GenesisTransactionResponse\n | BlockMetadataTransactionResponse\n | StateCheckpointTransactionResponse\n | ValidatorTransactionResponse\n | BlockEpilogueTransactionResponse;\n\n/**\n * Determine if the given transaction response is currently pending.\n *\n * @param response - The transaction response to evaluate.\n * @returns A boolean indicating whether the transaction is pending.\n */\nexport function isPendingTransactionResponse(response: TransactionResponse): response is PendingTransactionResponse {\n return response.type === TransactionResponseType.Pending;\n}\n\n/**\n * Determines if the given transaction response is a user transaction.\n *\n * @param response - The transaction response to evaluate.\n * @returns A boolean indicating whether the transaction is of type User.\n */\nexport function isUserTransactionResponse(response: TransactionResponse): response is UserTransactionResponse {\n return response.type === TransactionResponseType.User;\n}\n\n/**\n * Determines if the given transaction response is a Genesis transaction.\n *\n * @param response - The transaction response to evaluate.\n * @returns A boolean indicating whether the transaction is a Genesis transaction.\n */\nexport function isGenesisTransactionResponse(response: TransactionResponse): response is GenesisTransactionResponse {\n return response.type === TransactionResponseType.Genesis;\n}\n\n/**\n * Determine if the given transaction response is of type BlockMetadata.\n *\n * @param response - The transaction response to evaluate.\n * @returns A boolean indicating whether the response is a BlockMetadata transaction.\n */\nexport function isBlockMetadataTransactionResponse(\n response: TransactionResponse,\n): response is BlockMetadataTransactionResponse {\n return response.type === TransactionResponseType.BlockMetadata;\n}\n\n/**\n * Determines if the provided transaction response is a state checkpoint transaction.\n *\n * @param response - The transaction response to evaluate.\n * @returns A boolean indicating whether the transaction response is of type StateCheckpoint.\n */\nexport function isStateCheckpointTransactionResponse(\n response: TransactionResponse,\n): response is StateCheckpointTransactionResponse {\n return response.type === TransactionResponseType.StateCheckpoint;\n}\n\n/**\n * Determine if the given transaction response is of type Validator.\n *\n * @param response - The transaction response to evaluate.\n * @returns A boolean indicating whether the transaction response is a Validator type.\n */\nexport function isValidatorTransactionResponse(\n response: TransactionResponse,\n): response is ValidatorTransactionResponse {\n return response.type === TransactionResponseType.Validator;\n}\n\n/**\n * Determines if the given transaction response is of the type Block Epilogue.\n *\n * @param response - The transaction response to evaluate.\n * @returns A boolean indicating whether the response is a Block Epilogue transaction.\n */\nexport function isBlockEpilogueTransactionResponse(\n response: TransactionResponse,\n): response is BlockEpilogueTransactionResponse {\n return response.type === TransactionResponseType.BlockEpilogue;\n}\n\n/**\n * The response for a pending transaction, indicating that the transaction is still being processed.\n */\nexport type PendingTransactionResponse = {\n type: TransactionResponseType.Pending;\n hash: string;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: TransactionPayloadResponse;\n signature?: TransactionSignature;\n};\n\n/**\n * The response structure for a user transaction.\n */\nexport type UserTransactionResponse = {\n type: TransactionResponseType.User;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash: string | null;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n sender: string;\n sequence_number: string;\n max_gas_amount: string;\n gas_unit_price: string;\n expiration_timestamp_secs: string;\n payload: TransactionPayloadResponse;\n signature?: TransactionSignature;\n /**\n * Events generated by the transaction\n */\n events: Array<Event>;\n timestamp: string;\n};\n\n/**\n * The response for a genesis transaction, indicating the type of transaction.\n */\nexport type GenesisTransactionResponse = {\n type: TransactionResponseType.Genesis;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash?: string;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n payload: GenesisPayload;\n /**\n * Events emitted during genesis\n */\n events: Array<Event>;\n};\n\n/**\n * The structure representing a blockchain block with its height.\n */\nexport type BlockMetadataTransactionResponse = {\n type: TransactionResponseType.BlockMetadata;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash: string | null;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n id: string;\n epoch: string;\n round: string;\n /**\n * The events emitted at the block creation\n */\n events: Array<Event>;\n /**\n * Previous block votes\n */\n previous_block_votes_bitvec: Array<number>;\n proposer: string;\n /**\n * The indices of the proposers who failed to propose\n */\n failed_proposer_indices: Array<number>;\n timestamp: string;\n};\n\n/**\n * The response for a state checkpoint transaction, indicating the type of transaction.\n */\nexport type StateCheckpointTransactionResponse = {\n type: TransactionResponseType.StateCheckpoint;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash: string | null;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n timestamp: string;\n};\n\n/**\n * The response for a validator transaction, indicating the type of transaction.\n */\nexport type ValidatorTransactionResponse = {\n type: TransactionResponseType.Validator;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash: string | null;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n /**\n * The events emitted by the validator transaction\n */\n events: Array<Event>;\n timestamp: string;\n};\n\n/**\n * Describes the gas state of the block, indicating whether the block gas limit has been reached.\n */\nexport type BlockEndInfo = {\n block_gas_limit_reached: boolean;\n block_output_limit_reached: boolean;\n block_effective_block_gas_units: number;\n block_approx_output_size: number;\n};\n\n/**\n * A transaction executed at the end of a block that tracks data from the entire block.\n */\nexport type BlockEpilogueTransactionResponse = {\n type: TransactionResponseType.BlockEpilogue;\n version: string;\n hash: string;\n state_change_hash: string;\n event_root_hash: string;\n state_checkpoint_hash: string | null;\n gas_used: string;\n /**\n * Whether the transaction was successful\n */\n success: boolean;\n /**\n * The VM status of the transaction, can tell useful information in a failure\n */\n vm_status: string;\n accumulator_root_hash: string;\n /**\n * Final state of resources changed by the transaction\n */\n changes: Array<WriteSetChange>;\n timestamp: string;\n block_end_info: BlockEndInfo | null;\n};\n\n/**\n * WRITESET CHANGE TYPES\n */\n\n/**\n * A union type that encompasses both script and direct write sets for data operations.\n */\nexport type WriteSetChange =\n | WriteSetChangeDeleteModule\n | WriteSetChangeDeleteResource\n | WriteSetChangeDeleteTableItem\n | WriteSetChangeWriteModule\n | WriteSetChangeWriteResource\n | WriteSetChangeWriteTableItem;\n\n/**\n * The structure for a module deletion change in a write set.\n */\nexport type WriteSetChangeDeleteModule = {\n type: string;\n address: string;\n /**\n * State key hash\n */\n state_key_hash: string;\n module: MoveModuleId;\n};\n\n/**\n * The payload for a resource deletion in a write set change.\n */\nexport type WriteSetChangeDeleteResource = {\n type: string;\n address: string;\n state_key_hash: string;\n resource: string;\n};\n\n/**\n * The payload for a write set change that deletes a table item.\n */\nexport type WriteSetChangeDeleteTableItem = {\n type: string;\n state_key_hash: string;\n handle: string;\n key: string;\n data?: DeletedTableData;\n};\n\n/**\n * The structure for a write module change in a write set.\n */\nexport type WriteSetChangeWriteModule = {\n type: string;\n address: string;\n state_key_hash: string;\n data: MoveModuleBytecode;\n};\n\n/**\n * The resource associated with a write set change, identified by its type.\n */\nexport type WriteSetChangeWriteResource = {\n type: string;\n address: string;\n state_key_hash: string;\n data: MoveResource;\n};\n\n/**\n * The structure for a write operation on a table in a write set change.\n */\nexport type WriteSetChangeWriteTableItem = {\n type: string;\n state_key_hash: string;\n handle: string;\n key: string;\n value: string;\n data?: DecodedTableData;\n};\n\n/**\n * The decoded data for a table, including its key in JSON format.\n */\nexport type DecodedTableData = {\n /**\n * Key of table in JSON\n */\n key: any;\n /**\n * Type of key\n */\n key_type: string;\n /**\n * Value of table in JSON\n */\n value: any;\n /**\n * Type of value\n */\n value_type: string;\n};\n\n/**\n * Data for a deleted table entry.\n */\nexport type DeletedTableData = {\n /**\n * Deleted key\n */\n key: any;\n /**\n * Deleted key type\n */\n key_type: string;\n};\n\n/**\n * The payload for a transaction response, which can be an entry function, script, or multisig payload.\n */\nexport type TransactionPayloadResponse = EntryFunctionPayloadResponse | ScriptPayloadResponse | MultisigPayloadResponse;\n\n/**\n * The response payload for an entry function, containing the type of the entry.\n */\nexport type EntryFunctionPayloadResponse = {\n type: string;\n function: MoveFunctionId;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<string>;\n /**\n * Arguments of the function\n */\n arguments: Array<any>;\n};\n\n/**\n * The payload for a script response, containing the type of the script.\n */\nexport type ScriptPayloadResponse = {\n type: string;\n code: MoveScriptBytecode;\n /**\n * Type arguments of the function\n */\n type_arguments: Array<string>;\n /**\n * Arguments of the function\n */\n arguments: Array<any>;\n};\n\n/**\n * The response payload for a multisig transaction, containing the type of the transaction.\n */\nexport type MultisigPayloadResponse = {\n type: string;\n multisig_address: string;\n transaction_payload?: EntryFunctionPayloadResponse;\n};\n\n/**\n * The payload for the genesis block containing the type of the payload.\n */\nexport type GenesisPayload = {\n type: string;\n write_set: WriteSet;\n};\n\n/**\n * The bytecode for a Move script.\n */\nexport type MoveScriptBytecode = {\n bytecode: string;\n abi?: MoveFunction;\n};\n\n/**\n * JSON representations of transaction signatures returned from the node API.\n */\nexport type TransactionSignature =\n | TransactionEd25519Signature\n | TransactionSecp256k1Signature\n | TransactionMultiEd25519Signature\n | TransactionMultiAgentSignature\n | TransactionFeePayerSignature;\n\n/**\n * Determine if the provided signature is an Ed25519 signature.\n * This function checks for the presence of the \"signature\" property\n * and verifies that its value is \"ed25519_signature\".\n *\n * @param signature - The transaction signature to be checked.\n * @returns A boolean indicating whether the signature is an Ed25519 signature.\n */\nexport function isEd25519Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature {\n return \"signature\" in signature && signature.signature === \"ed25519_signature\";\n}\n\n/**\n * Determine if the provided signature is a valid secp256k1 ECDSA signature.\n *\n * @param signature - The transaction signature to validate.\n * @returns A boolean indicating whether the signature is a secp256k1 ECDSA signature.\n */\nexport function isSecp256k1Signature(signature: TransactionSignature): signature is TransactionFeePayerSignature {\n return \"signature\" in signature && signature.signature === \"secp256k1_ecdsa_signature\";\n}\n\n/**\n * Determine if the provided transaction signature is a multi-agent signature.\n *\n * @param signature - The transaction signature to evaluate.\n * @returns A boolean indicating whether the signature is a multi-agent signature.\n */\nexport function isMultiAgentSignature(signature: TransactionSignature): signature is TransactionMultiAgentSignature {\n return signature.type === \"multi_agent_signature\";\n}\n\n/**\n * Determine if the provided signature is a fee payer signature.\n *\n * @param signature - The transaction signature to evaluate.\n * @returns A boolean indicating whether the signature is a fee payer signature.\n */\nexport function isFeePayerSignature(signature: TransactionSignature): signature is TransactionFeePayerSignature {\n return signature.type === \"fee_payer_signature\";\n}\n\n/**\n * Determine if the provided signature is of type \"multi_ed25519_signature\".\n *\n * @param signature - The transaction signature to check.\n * @returns A boolean indicating whether the signature is a multi-ed25519 signature.\n */\nexport function isMultiEd25519Signature(\n signature: TransactionSignature,\n): signature is TransactionMultiEd25519Signature {\n return signature.type === \"multi_ed25519_signature\";\n}\n\n/**\n * The signature for a transaction using the Ed25519 algorithm.\n */\nexport type TransactionEd25519Signature = {\n type: string;\n public_key: string;\n signature: \"ed25519_signature\";\n};\n\n/**\n * The structure for a Secp256k1 signature in a transaction.\n */\nexport type TransactionSecp256k1Signature = {\n type: string;\n public_key: string;\n signature: \"secp256k1_ecdsa_signature\";\n};\n\n/**\n * The structure for a multi-signature transaction using Ed25519.\n */\nexport type TransactionMultiEd25519Signature = {\n type: \"multi_ed25519_signature\";\n /**\n * The public keys for the Ed25519 signature\n */\n public_keys: Array<string>;\n /**\n * Signature associated with the public keys in the same order\n */\n signatures: Array<string>;\n /**\n * The number of signatures required for a successful transaction\n */\n threshold: number;\n bitmap: string;\n};\n\n/**\n * The structure for a multi-agent signature in a transaction.\n */\nexport type TransactionMultiAgentSignature = {\n type: \"multi_agent_signature\";\n sender: AccountSignature;\n /**\n * The other involved parties' addresses\n */\n secondary_signer_addresses: Array<string>;\n /**\n * The associated signatures, in the same order as the secondary addresses\n */\n secondary_signers: Array<AccountSignature>;\n};\n\n/**\n * The signature of the fee payer in a transaction.\n */\nexport type TransactionFeePayerSignature = {\n type: \"fee_payer_signature\";\n sender: AccountSignature;\n /**\n * The other involved parties' addresses\n */\n secondary_signer_addresses: Array<string>;\n /**\n * The associated signatures, in the same order as the secondary addresses\n */\n secondary_signers: Array<AccountSignature>;\n fee_payer_address: string;\n fee_payer_signer: AccountSignature;\n};\n\n/**\n * The union of all single account signatures, including Ed25519, Secp256k1, and MultiEd25519 signatures.\n */\nexport type AccountSignature =\n | TransactionEd25519Signature\n | TransactionSecp256k1Signature\n | TransactionMultiEd25519Signature;\n\nexport type WriteSet = ScriptWriteSet | DirectWriteSet;\n\n/**\n * The set of properties for writing scripts, including the type of script.\n */\nexport type ScriptWriteSet = {\n type: string;\n execute_as: string;\n script: ScriptPayloadResponse;\n};\n\n/**\n * The set of direct write operations, identified by a type string.\n */\nexport type DirectWriteSet = {\n type: string;\n changes: Array<WriteSetChange>;\n events: Array<Event>;\n};\n\n/**\n * The structure for an event's unique identifier, including its creation number.\n */\n\n/**\n * The structure for an event, identified by a unique GUID.\n */\nexport type EventGuid = {\n creation_number: string;\n account_address: string;\n};\n\nexport type Event = {\n guid: EventGuid;\n sequence_number: string;\n type: string;\n /**\n * The JSON representation of the event\n */\n data: any;\n};\n\n/**\n * A number representing a Move uint8 type.\n */\nexport type MoveUint8Type = number;\n\n/**\n * A 16-bit unsigned integer used in the Move programming language.\n */\nexport type MoveUint16Type = number;\n\n/**\n * A 32-bit unsigned integer type used in Move programming.\n */\nexport type MoveUint32Type = number;\n\n/**\n * A string representation of a 64-bit unsigned integer used in Move programming.\n */\nexport type MoveUint64Type = string;\n\n/**\n * A string representing a 128-bit unsigned integer in the Move programming language.\n */\nexport type MoveUint128Type = string;\n\n/**\n * A string representation of a 256-bit unsigned integer used in Move programming.\n */\nexport type MoveUint256Type = string;\n\n/**\n * A string representing a Move address.\n */\nexport type MoveAddressType = string;\n\n/**\n * The type for identifying objects to be moved within the system.\n */\nexport type MoveObjectType = string;\n\n/**\n * The type for move options, which can be a MoveType, null, or undefined.\n */\nexport type MoveOptionType = MoveType | null | undefined;\n\n/**\n * A structure representing a move with a name.\n */\nexport type MoveStructId = `${string}::${string}::${string}`;\n\n/**\n * The move function containing its name. Same as MoveStructId since it reads weird to take a StructId for a Function.\n */\nexport type MoveFunctionId = MoveStructId;\n\n// TODO: Add support for looking up ABI to add proper typing\nexport type MoveStructType = {};\n\n/**\n * A union type that encompasses various data types used in Move, including primitive types, address types, object types, and\n * arrays of MoveType.\n */\nexport type MoveType =\n | boolean\n | string\n | MoveUint8Type\n | MoveUint16Type\n | MoveUint32Type\n | MoveUint64Type\n | MoveUint128Type\n | MoveUint256Type\n | MoveAddressType\n | MoveObjectType\n | MoveStructType\n | Array<MoveType>;\n\n/**\n * Possible Move values acceptable by move functions (entry, view)\n *\n * Map of a Move value to the corresponding TypeScript value\n *\n * `Bool -> boolean`\n *\n * `u8, u16, u32 -> number`\n *\n * `u64, u128, u256 -> string`\n *\n * `String -> string`\n *\n * `Address -> 0x${string}`\n *\n * `Struct - 0x${string}::${string}::${string}`\n *\n * `Object -> 0x${string}`\n *\n * `Vector -> Array<MoveValue>`\n *\n * `Option -> MoveValue | null | undefined`\n */\nexport type MoveValue =\n | boolean\n | string\n | MoveUint8Type\n | MoveUint16Type\n | MoveUint32Type\n | MoveUint64Type\n | MoveUint128Type\n | MoveUint256Type\n | MoveAddressType\n | MoveObjectType\n | MoveStructId\n | MoveOptionType\n | Array<MoveValue>;\n\n/**\n * A string representation of a Move module, formatted as `module_name::function_name`.\n * Module names are case-sensitive.\n */\nexport type MoveModuleId = `${string}::${string}`;\n\n/**\n * Specifies the visibility levels for move functions, controlling access permissions.\n */\nexport enum MoveFunctionVisibility {\n PRIVATE = \"private\",\n PUBLIC = \"public\",\n FRIEND = \"friend\",\n}\n\n/**\n * Abilities related to moving items within the system.\n */\nexport enum MoveAbility {\n STORE = \"store\",\n DROP = \"drop\",\n KEY = \"key\",\n COPY = \"copy\",\n}\n\n/**\n * Move abilities associated with the generic type parameter of a function.\n */\nexport type MoveFunctionGenericTypeParam = {\n constraints: Array<MoveAbility>;\n};\n\n/**\n * A field in a Move struct, identified by its name.\n */\nexport type MoveStructField = {\n name: string;\n type: string;\n};\n\n/**\n * A Move module\n */\nexport type MoveModule = {\n address: string;\n name: string;\n /**\n * Friends of the module\n */\n friends: Array<MoveModuleId>;\n /**\n * Public functions of the module\n */\n exposed_functions: Array<MoveFunction>;\n /**\n * Structs of the module\n */\n structs: Array<MoveStruct>;\n};\n\n/**\n * A move struct\n */\nexport type MoveStruct = {\n name: string;\n /**\n * Whether the struct is a native struct of Move\n */\n is_native: boolean;\n /**\n * Whether the struct is a module event (aka v2 event). This will be false for v1\n * events because the value is derived from the #[event] attribute on the struct in\n * the Move source code. This attribute is only relevant for v2 events.\n */\n is_event: boolean;\n /**\n * Abilities associated with the struct\n */\n abilities: Array<MoveAbility>;\n /**\n * Generic types associated with the struct\n */\n generic_type_params: Array<MoveFunctionGenericTypeParam>;\n /**\n * Fields associated with the struct\n */\n fields: Array<MoveStructField>;\n};\n\n/**\n * Move function\n */\nexport type MoveFunction = {\n name: string;\n visibility: MoveFunctionVisibility;\n /**\n * Whether the function can be called as an entry function directly in a transaction\n */\n is_entry: boolean;\n /**\n * Whether the function is a view function or not\n */\n is_view: boolean;\n /**\n * Generic type params associated with the Move function\n */\n generic_type_params: Array<MoveFunctionGenericTypeParam>;\n /**\n * Parameters associated with the move function\n */\n params: Array<string>;\n /**\n * Return type of the function\n */\n return: Array<string>;\n};\n\n/**\n * Roles that can be assigned within the system, indicating different levels of access and functionality.\n */\nexport enum RoleType {\n VALIDATOR = \"validator\",\n FULL_NODE = \"full_node\",\n}\n\n/**\n * Information about the current blockchain ledger, including its chain ID.\n */\nexport type LedgerInfo = {\n /**\n * Chain ID of the current chain\n */\n chain_id: number;\n epoch: string;\n ledger_version: string;\n oldest_ledger_version: string;\n ledger_timestamp: string;\n node_role: RoleType;\n oldest_block_height: string;\n block_height: string;\n /**\n * Git hash of the build of the API endpoint. Can be used to determine the exact\n * software version used by the API endpoint.\n */\n git_hash?: string;\n};\n\n/**\n * A Block type\n */\nexport type Block = {\n block_height: string;\n block_hash: string;\n block_timestamp: string;\n first_version: string;\n last_version: string;\n /**\n * The transactions in the block in sequential order\n */\n transactions?: Array<TransactionResponse>;\n};\n\n// REQUEST TYPES\n\n/**\n * The request payload for the GetTableItem API.\n */\nexport type TableItemRequest = {\n key_type: MoveValue;\n value_type: MoveValue;\n /**\n * The value of the table item's key\n */\n key: any;\n};\n\n/**\n * A list of supported Authentication Key schemes in Aptos, consisting of combinations of signing schemes and derive schemes.\n */\nexport type AuthenticationKeyScheme = SigningScheme | DeriveScheme;\n\n/**\n * Different schemes for signing keys used in cryptographic operations.\n */\nexport enum SigningScheme {\n /**\n * For Ed25519PublicKey\n */\n Ed25519 = 0,\n /**\n * For MultiEd25519PublicKey\n */\n MultiEd25519 = 1,\n /**\n * For SingleKey ecdsa\n */\n SingleKey = 2,\n\n MultiKey = 3,\n}\n\n/**\n * Specifies the signing schemes available for cryptographic operations.\n */\nexport enum SigningSchemeInput {\n /**\n * For Ed25519PublicKey\n */\n Ed25519 = 0,\n /**\n * For Secp256k1Ecdsa\n */\n Secp256k1Ecdsa = 2,\n}\n\n/**\n * Specifies the schemes for deriving account addresses from various data sources.\n */\nexport enum DeriveScheme {\n /**\n * Derives an address using an AUID, used for objects\n */\n DeriveAuid = 251,\n /**\n * Derives an address from another object address\n */\n DeriveObjectAddressFromObject = 252,\n /**\n * Derives an address from a GUID, used for objects\n */\n DeriveObjectAddressFromGuid = 253,\n /**\n * Derives an address from seed bytes, used for named objects\n */\n DeriveObjectAddressFromSeed = 254,\n /**\n * Derives an address from seed bytes, used for resource accounts\n */\n DeriveResourceAccountAddress = 255,\n}\n\n/**\n * Options for configuring the behavior of the waitForTransaction() function.\n */\nexport type WaitForTransactionOptions = {\n timeoutSecs?: number;\n checkSuccess?: boolean;\n // Default behavior is to wait for the indexer. Set this to false to disable waiting.\n waitForIndexer?: boolean;\n};\n\n/**\n * Input type to generate an account using the Ed25519 signing scheme.\n */\nexport type GenerateAccountWithEd25519 = {\n scheme: SigningSchemeInput.Ed25519;\n legacy: boolean;\n};\n\n/**\n * Input type to generate an account with a Single Signer using Secp256k1.\n */\nexport type GenerateAccountWithSingleSignerSecp256k1Key = {\n scheme: SigningSchemeInput.Secp256k1Ecdsa;\n legacy?: false;\n};\n\nexport type GenerateAccount = GenerateAccountWithEd25519 | GenerateAccountWithSingleSignerSecp256k1Key;\n"],"mappings":"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","names":["MimeType","TypeTagVariants","ScriptTransactionArgumentVariants","TransactionPayloadVariants","TransactionVariants","TransactionAuthenticatorVariant","AccountAuthenticatorVariant","PrivateKeyVariants","AnyPublicKeyVariant","AnySignatureVariant","EphemeralPublicKeyVariant","EphemeralSignatureVariant","EphemeralCertificateVariant","ZkpVariant","TransactionResponseType","isPendingTransactionResponse","response","isUserTransactionResponse","isGenesisTransactionResponse","isBlockMetadataTransactionResponse","isStateCheckpointTransactionResponse","isValidatorTransactionResponse","isBlockEpilogueTransactionResponse","isEd25519Signature","signature","isSecp256k1Signature","isMultiAgentSignature","isFeePayerSignature","isMultiEd25519Signature","MoveFunctionVisibility","MoveAbility","RoleType","SigningScheme","SigningSchemeInput","DeriveScheme"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as r}from"./chunk-56CNRT2K.mjs";import{b as s}from"./chunk-VHY6ZATX.mjs";var a=class d{constructor(e){this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e,0),this.offset=0}static fromHex(e){let i=s.hexInputToUint8Array(e);return new d(i)}read(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Reached to the end of buffer");let i=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,i}remaining(){return this.buffer.byteLength-this.offset}deserializeStr(){let e=this.deserializeBytes();return new TextDecoder().decode(e)}deserializeOptionStr(){return this.deserializeOption("string")}deserializeOption(e,i){if(this.deserializeBool()){if(e==="string")return this.deserializeStr();if(e==="bytes")return this.deserializeBytes();if(e==="fixedBytes"){if(i===void 0)throw new Error("Fixed bytes length not provided");return this.deserializeFixedBytes(i)}return this.deserialize(e)}}deserializeBytes(){let e=this.deserializeUleb128AsU32();return new Uint8Array(this.read(e))}deserializeFixedBytes(e){return new Uint8Array(this.read(e))}deserializeBool(){let e=new Uint8Array(this.read(1))[0];if(e!==1&&e!==0)throw new Error("Invalid boolean value");return e===1}deserializeU8(){return new DataView(this.read(1)).getUint8(0)}deserializeU16(){return new DataView(this.read(2)).getUint16(0,!0)}deserializeU32(){return new DataView(this.read(4)).getUint32(0,!0)}deserializeU64(){let e=this.deserializeU32(),i=this.deserializeU32();return BigInt(BigInt(i)<<BigInt(32)|BigInt(e))}deserializeU128(){let e=this.deserializeU64(),i=this.deserializeU64();return BigInt(i<<BigInt(64)|e)}deserializeU256(){let e=this.deserializeU128(),i=this.deserializeU128();return BigInt(i<<BigInt(128)|e)}deserializeUleb128AsU32(){let e=BigInt(0),i=0;for(;e<r;){let t=this.deserializeU8();if(e|=BigInt(t&127)<<BigInt(i),(t&128)===0)break;i+=7}if(e>r)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(e)}deserialize(e){return e.deserialize(this)}deserializeVector(e){let i=this.deserializeUleb128AsU32(),t=new Array;for(let n=0;n<i;n+=1)t.push(this.deserialize(e));return t}};export{a};
|
|
2
|
+
//# sourceMappingURL=chunk-BE3OXYYX.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bcs/deserializer.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable no-bitwise */\nimport { MAX_U32_NUMBER } from \"./consts\";\nimport { Uint8, Uint16, Uint32, Uint64, Uint128, Uint256, HexInput } from \"../types\";\nimport { Hex } from \"../core/hex\";\n\n/**\n * This interface exists to define Deserializable<T> inputs for functions that\n * deserialize a byte buffer into a type T.\n * It is not intended to be implemented or extended, because Typescript has no support\n * for static methods in interfaces.\n *\n * @template T - The type that this will deserialize into.\n * @group Implementation\n * @category BCS\n */\nexport interface Deserializable<T> {\n /**\n * Deserializes the buffered bytes into an instance of the specified class type.\n * This function provides an alternative syntax for deserialization, allowing users to call\n * `deserializer.deserialize(MyClass)` instead of `MyClass.deserialize(deserializer)`.\n *\n * @param deserializer - The deserializer instance with the buffered bytes.\n * @returns The deserialized value of class type T.\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));\n * const value = deserializer.deserialize(MyClass); // where MyClass has a `deserialize` function\n * // value is now an instance of MyClass\n * // equivalent to `const value = MyClass.deserialize(deserializer)`\n * ```\n * @group Implementation\n * @category BCS\n */\n deserialize(deserializer: Deserializer): T;\n}\n\n/**\n * A class that provides methods for deserializing various data types from a byte buffer.\n * It supports deserialization of primitive types, strings, and complex objects using a BCS (Binary Common Serialization) layout.\n * @group Implementation\n * @category BCS\n */\nexport class Deserializer {\n private buffer: ArrayBuffer;\n\n private offset: number;\n\n /**\n * Creates a new instance of the class with a copy of the provided data buffer.\n * This prevents outside mutation of the buffer.\n *\n * @param data - The data to be copied into the internal buffer as a Uint8Array.\n * @group Implementation\n * @category BCS\n */\n constructor(data: Uint8Array) {\n // copies data to prevent outside mutation of buffer.\n this.buffer = new ArrayBuffer(data.length);\n new Uint8Array(this.buffer).set(data, 0);\n this.offset = 0;\n }\n\n static fromHex(hex: HexInput): Deserializer {\n const data = Hex.hexInputToUint8Array(hex);\n return new Deserializer(data);\n }\n\n /**\n * Reads a specified number of bytes from the buffer and advances the offset.\n *\n * @param length - The number of bytes to read from the buffer.\n * @throws Throws an error if the read operation exceeds the buffer's length.\n * @group Implementation\n * @category BCS\n */\n private read(length: number): ArrayBuffer {\n if (this.offset + length > this.buffer.byteLength) {\n throw new Error(\"Reached to the end of buffer\");\n }\n\n const bytes = this.buffer.slice(this.offset, this.offset + length);\n this.offset += length;\n return bytes;\n }\n\n /**\n * Returns the number of bytes remaining in the buffer.\n *\n * This information is useful to determine if there's more data to be read.\n *\n * @returns The number of bytes remaining in the buffer.\n * @group Implementation\n * @category BCS\n */\n remaining(): number {\n return this.buffer.byteLength - this.offset;\n }\n\n /**\n * Deserializes a UTF-8 encoded string from a byte array. It first reads the length of the string in bytes,\n * followed by the actual byte content, and decodes it into a string.\n *\n * BCS layout for \"string\": string_length | string_content\n * where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.\n *\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));\n * assert(deserializer.deserializeStr() === \"1234abcd\");\n * ```\n * @group Implementation\n * @category BCS\n */\n deserializeStr(): string {\n const value = this.deserializeBytes();\n const textDecoder = new TextDecoder();\n return textDecoder.decode(value);\n }\n\n /**\n * @deprecated use `deserializeOption(\"string\")` instead.\n *\n * The BCS layout for Optional<String> is 0 if none, else 1 followed by the string length and string content.\n * @returns The deserialized string if it exists, otherwise undefined.\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([0x00]));\n * assert(deserializer.deserializeOptionStr() === undefined);\n * const deserializer = new Deserializer(new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));\n * assert(deserializer.deserializeOptionStr() === \"1234abcd\");\n * ```\n */\n deserializeOptionStr(): string | undefined {\n return this.deserializeOption(\"string\");\n }\n\n /**\n * Deserializes an optional value from the buffer.\n *\n * The BCS layout for Optional<T> starts with a boolean byte (0 if none, 1 if some),\n * followed by the value if present.\n *\n * @template T - The type of the value to deserialize\n * @param type - Either a Deserializable class or one of the string literals: \"string\", \"bytes\", or \"fixedBytes\"\n * @param len - Required length when type is \"fixedBytes\", ignored otherwise\n * @returns The deserialized value if present, undefined otherwise\n *\n * @throws {Error} When \"fixedBytes\" is specified without a length\n *\n * @example\n * ```typescript\n * // Deserialize an optional string\n * const deserializer = new Deserializer(new Uint8Array([1, 3, 97, 98, 99]));\n * const optStr = deserializer.deserializeOption(\"string\");\n * // optStr === \"abc\"\n *\n * // Deserialize an optional custom type\n * const deserializer = new Deserializer(new Uint8Array([0]));\n * const optValue = deserializer.deserializeOption(MyClass);\n * // optValue === undefined\n *\n * // Deserialize optional bytes\n * const deserializer = new Deserializer(new Uint8Array([1, 3, 1, 2, 3]));\n * const optBytes = deserializer.deserializeOption(\"bytes\");\n * // optBytes === Uint8Array[1, 2, 3]\n *\n * // Deserialize optional fixed bytes\n * const deserializer = new Deserializer(new Uint8Array([1, 1, 2, 3, 4]));\n * const optBytes = deserializer.deserializeOption(\"fixedBytes\", 4);\n * // optBytes === Uint8Array[1, 2, 3, 4]\n * ```\n * @group Implementation\n * @category BCS\n */\n deserializeOption(type: \"string\"): string | undefined;\n deserializeOption(type: \"bytes\"): Uint8Array | undefined;\n deserializeOption(type: \"fixedBytes\", len: number): Uint8Array | undefined;\n deserializeOption<T>(type: Deserializable<T>): T | undefined;\n deserializeOption<T>(\n type: Deserializable<T> | \"string\" | \"bytes\" | \"fixedBytes\",\n len?: number,\n ): T | string | Uint8Array | undefined {\n const exists = this.deserializeBool();\n if (!exists) return undefined;\n\n if (type === \"string\") {\n return this.deserializeStr();\n }\n if (type === \"bytes\") {\n return this.deserializeBytes();\n }\n if (type === \"fixedBytes\") {\n if (len === undefined) {\n throw new Error(\"Fixed bytes length not provided\");\n }\n return this.deserializeFixedBytes(len);\n }\n\n return this.deserialize(type);\n }\n\n /**\n * Deserializes an array of bytes.\n *\n * The BCS layout for \"bytes\" consists of a bytes_length followed by the bytes themselves, where bytes_length is a u32 integer\n * encoded as a uleb128 integer, indicating the length of the bytes array.\n *\n * @returns {Uint8Array} The deserialized array of bytes.\n * @group Implementation\n * @category BCS\n */\n deserializeBytes(): Uint8Array {\n const len = this.deserializeUleb128AsU32();\n return new Uint8Array(this.read(len));\n }\n\n /**\n * Deserializes an array of bytes of a specified length.\n *\n * @param len - The number of bytes to read from the source.\n * @group Implementation\n * @category BCS\n */\n deserializeFixedBytes(len: number): Uint8Array {\n return new Uint8Array(this.read(len));\n }\n\n /**\n * Deserializes a boolean value from a byte stream.\n *\n * The BCS layout for a boolean uses one byte, where \"0x01\" represents true and \"0x00\" represents false.\n * An error is thrown if the byte value is not valid.\n *\n * @returns The deserialized boolean value.\n * @throws Throws an error if the boolean value is invalid.\n * @group Implementation\n * @category BCS\n */\n deserializeBool(): boolean {\n const bool = new Uint8Array(this.read(1))[0];\n if (bool !== 1 && bool !== 0) {\n throw new Error(\"Invalid boolean value\");\n }\n return bool === 1;\n }\n\n /**\n * Deserializes a uint8 number from the binary data.\n *\n * BCS layout for \"uint8\": One byte. Binary format in little-endian representation.\n *\n * @returns {number} The deserialized uint8 number.\n * @group Implementation\n * @category BCS\n */\n deserializeU8(): Uint8 {\n return new DataView(this.read(1)).getUint8(0);\n }\n\n /**\n * Deserializes a uint16 number from a binary format in little-endian representation.\n *\n * BCS layout for \"uint16\": Two bytes.\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([0x34, 0x12]));\n * assert(deserializer.deserializeU16() === 4660);\n * ```\n * @group Implementation\n * @category BCS\n */\n deserializeU16(): Uint16 {\n return new DataView(this.read(2)).getUint16(0, true);\n }\n\n /**\n * Deserializes a uint32 number from a binary format in little-endian representation.\n *\n * BCS layout for \"uint32\": Four bytes.\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([0x78, 0x56, 0x34, 0x12]));\n * assert(deserializer.deserializeU32() === 305419896);\n * ```\n * @group Implementation\n * @category BCS\n */\n deserializeU32(): Uint32 {\n return new DataView(this.read(4)).getUint32(0, true);\n }\n\n /**\n * Deserializes a uint64 number.\n *\n * This function combines two 32-bit values to return a 64-bit unsigned integer in little-endian representation.\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));\n * assert(deserializer.deserializeU64() === 1311768467750121216);\n * ```\n * @group Implementation\n * @category BCS\n */\n deserializeU64(): Uint64 {\n const low = this.deserializeU32();\n const high = this.deserializeU32();\n\n // combine the two 32-bit values and return (little endian)\n return BigInt((BigInt(high) << BigInt(32)) | BigInt(low));\n }\n\n /**\n * Deserializes a uint128 number from its binary representation.\n * This function combines two 64-bit values to return a single uint128 value in little-endian format.\n *\n * @returns {BigInt} The deserialized uint128 number.\n * @group Implementation\n * @category BCS\n */\n deserializeU128(): Uint128 {\n const low = this.deserializeU64();\n const high = this.deserializeU64();\n\n // combine the two 64-bit values and return (little endian)\n return BigInt((high << BigInt(64)) | low);\n }\n\n /**\n * Deserializes a uint256 number from its binary representation.\n *\n * The BCS layout for \"uint256\" consists of thirty-two bytes in little-endian format.\n *\n * @returns {BigInt} The deserialized uint256 number.\n * @group Implementation\n * @category BCS\n */\n deserializeU256(): Uint256 {\n const low = this.deserializeU128();\n const high = this.deserializeU128();\n\n // combine the two 128-bit values and return (little endian)\n return BigInt((high << BigInt(128)) | low);\n }\n\n /**\n * Deserializes a uleb128 encoded uint32 number.\n *\n * This function is used for interpreting lengths of variable-length sequences and tags of enum values in BCS encoding.\n *\n * @throws {Error} Throws an error if the parsed value exceeds the maximum uint32 number.\n * @returns {number} The deserialized uint32 value.\n * @group Implementation\n * @category BCS\n */\n deserializeUleb128AsU32(): Uint32 {\n let value: bigint = BigInt(0);\n let shift = 0;\n\n while (value < MAX_U32_NUMBER) {\n const byte = this.deserializeU8();\n value |= BigInt(byte & 0x7f) << BigInt(shift);\n\n if ((byte & 0x80) === 0) {\n break;\n }\n shift += 7;\n }\n\n if (value > MAX_U32_NUMBER) {\n throw new Error(\"Overflow while parsing uleb128-encoded uint32 value\");\n }\n\n return Number(value);\n }\n\n /**\n * Helper function that primarily exists to support alternative syntax for deserialization.\n * That is, if we have a `const deserializer: new Deserializer(...)`, instead of having to use\n * `MyClass.deserialize(deserializer)`, we can call `deserializer.deserialize(MyClass)`.\n *\n * @example const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));\n * const value = deserializer.deserialize(MyClass); // where MyClass has a `deserialize` function\n * // value is now an instance of MyClass\n * // equivalent to `const value = MyClass.deserialize(deserializer)`\n * @param cls The BCS-deserializable class to deserialize the buffered bytes into.\n *\n * @returns the deserialized value of class type T\n * @group Implementation\n * @category BCS\n */\n deserialize<T>(cls: Deserializable<T>): T {\n // NOTE: `deserialize` in `cls.deserialize(this)` here is a static method defined in `cls`,\n // It is separate from the `deserialize` instance method defined here in Deserializer.\n return cls.deserialize(this);\n }\n\n /**\n * Deserializes an array of BCS Deserializable values given an existing Deserializer instance with a loaded byte buffer.\n *\n * @param cls The BCS-deserializable class to deserialize the buffered bytes into.\n * @returns An array of deserialized values of type T.\n * @example\n * // serialize a vector of addresses\n * const addresses = new Array<AccountAddress>(\n * AccountAddress.from(\"0x1\"),\n * AccountAddress.from(\"0x2\"),\n * AccountAddress.from(\"0xa\"),\n * AccountAddress.from(\"0xb\"),\n * );\n * const serializer = new Serializer();\n * serializer.serializeVector(addresses);\n * const serializedBytes = serializer.toUint8Array();\n *\n * // deserialize the bytes into an array of addresses\n * const deserializer = new Deserializer(serializedBytes);\n * const deserializedAddresses = deserializer.deserializeVector(AccountAddress);\n * // deserializedAddresses is now an array of AccountAddress instances\n * @group Implementation\n * @category BCS\n */\n deserializeVector<T>(cls: Deserializable<T>): Array<T> {\n const length = this.deserializeUleb128AsU32();\n const vector = new Array<T>();\n for (let i = 0; i < length; i += 1) {\n vector.push(this.deserialize(cls));\n }\n return vector;\n }\n}\n"],"mappings":"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","names":["Deserializer","_Deserializer","data","hex","Hex","length","bytes","value","type","len","bool","low","high","shift","MAX_U32_NUMBER","byte","cls","vector","i"]}
|
|
1
|
+
{"version":3,"sources":["../../src/bcs/deserializer.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable no-bitwise */\nimport { MAX_U32_NUMBER } from \"./consts\";\nimport { Uint8, Uint16, Uint32, Uint64, Uint128, Uint256, HexInput } from \"../types\";\nimport { Hex } from \"../core/hex\";\n\n/**\n * This interface exists to define Deserializable<T> inputs for functions that\n * deserialize a byte buffer into a type T.\n * It is not intended to be implemented or extended, because Typescript has no support\n * for static methods in interfaces.\n *\n * @template T - The type that this will deserialize into.\n * @group Implementation\n * @category BCS\n */\nexport interface Deserializable<T> {\n /**\n * Deserializes the buffered bytes into an instance of the specified class type.\n * This function provides an alternative syntax for deserialization, allowing users to call\n * `deserializer.deserialize(MyClass)` instead of `MyClass.deserialize(deserializer)`.\n *\n * @param deserializer - The deserializer instance with the buffered bytes.\n * @returns The deserialized value of class type T.\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));\n * const value = deserializer.deserialize(MyClass); // where MyClass has a `deserialize` function\n * // value is now an instance of MyClass\n * // equivalent to `const value = MyClass.deserialize(deserializer)`\n * ```\n * @group Implementation\n * @category BCS\n */\n deserialize(deserializer: Deserializer): T;\n}\n\n/**\n * A class that provides methods for deserializing various data types from a byte buffer.\n * It supports deserialization of primitive types, strings, and complex objects using a BCS (Binary Common Serialization) layout.\n * @group Implementation\n * @category BCS\n */\nexport class Deserializer {\n private buffer: ArrayBuffer;\n\n private offset: number;\n\n /**\n * Creates a new instance of the class with a copy of the provided data buffer.\n * This prevents outside mutation of the buffer.\n *\n * @param data - The data to be copied into the internal buffer as a Uint8Array.\n * @group Implementation\n * @category BCS\n */\n constructor(data: Uint8Array) {\n // copies data to prevent outside mutation of buffer.\n this.buffer = new ArrayBuffer(data.length);\n new Uint8Array(this.buffer).set(data, 0);\n this.offset = 0;\n }\n\n static fromHex(hex: HexInput): Deserializer {\n const data = Hex.hexInputToUint8Array(hex);\n return new Deserializer(data);\n }\n\n /**\n * Reads a specified number of bytes from the buffer and advances the offset.\n *\n * @param length - The number of bytes to read from the buffer.\n * @throws Throws an error if the read operation exceeds the buffer's length.\n * @group Implementation\n * @category BCS\n */\n private read(length: number): ArrayBuffer {\n if (this.offset + length > this.buffer.byteLength) {\n throw new Error(\"Reached to the end of buffer\");\n }\n\n const bytes = this.buffer.slice(this.offset, this.offset + length);\n this.offset += length;\n return bytes;\n }\n\n /**\n * Returns the number of bytes remaining in the buffer.\n *\n * This information is useful to determine if there's more data to be read.\n *\n * @returns The number of bytes remaining in the buffer.\n * @group Implementation\n * @category BCS\n */\n remaining(): number {\n return this.buffer.byteLength - this.offset;\n }\n\n /**\n * Deserializes a UTF-8 encoded string from a byte array. It first reads the length of the string in bytes,\n * followed by the actual byte content, and decodes it into a string.\n *\n * BCS layout for \"string\": string_length | string_content\n * where string_length is a u32 integer encoded as a uleb128 integer, equal to the number of bytes in string_content.\n *\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([8, 49, 50, 51, 52, 97, 98, 99, 100]));\n * assert(deserializer.deserializeStr() === \"1234abcd\");\n * ```\n * @group Implementation\n * @category BCS\n */\n deserializeStr(): string {\n const value = this.deserializeBytes();\n const textDecoder = new TextDecoder();\n return textDecoder.decode(value);\n }\n\n /**\n * @deprecated use `deserializeOption(\"string\")` instead.\n *\n * The BCS layout for Optional<String> is 0 if none, else 1 followed by the string length and string content.\n * @returns The deserialized string if it exists, otherwise undefined.\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([0x00]));\n * assert(deserializer.deserializeOptionStr() === undefined);\n * const deserializer = new Deserializer(new Uint8Array([1, 8, 49, 50, 51, 52, 97, 98, 99, 100]));\n * assert(deserializer.deserializeOptionStr() === \"1234abcd\");\n * ```\n */\n deserializeOptionStr(): string | undefined {\n return this.deserializeOption(\"string\");\n }\n\n /**\n * Deserializes an optional value from the buffer.\n *\n * The BCS layout for Optional<T> starts with a boolean byte (0 if none, 1 if some),\n * followed by the value if present.\n *\n * @template T - The type of the value to deserialize\n * @param type - Either a Deserializable class or one of the string literals: \"string\", \"bytes\", or \"fixedBytes\"\n * @param len - Required length when type is \"fixedBytes\", ignored otherwise\n * @returns The deserialized value if present, undefined otherwise\n *\n * @throws {Error} When \"fixedBytes\" is specified without a length\n *\n * @example\n * ```typescript\n * // Deserialize an optional string\n * const deserializer = new Deserializer(new Uint8Array([1, 3, 97, 98, 99]));\n * const optStr = deserializer.deserializeOption(\"string\");\n * // optStr === \"abc\"\n *\n * // Deserialize an optional custom type\n * const deserializer = new Deserializer(new Uint8Array([0]));\n * const optValue = deserializer.deserializeOption(MyClass);\n * // optValue === undefined\n *\n * // Deserialize optional bytes\n * const deserializer = new Deserializer(new Uint8Array([1, 3, 1, 2, 3]));\n * const optBytes = deserializer.deserializeOption(\"bytes\");\n * // optBytes === Uint8Array[1, 2, 3]\n *\n * // Deserialize optional fixed bytes\n * const deserializer = new Deserializer(new Uint8Array([1, 1, 2, 3, 4]));\n * const optBytes = deserializer.deserializeOption(\"fixedBytes\", 4);\n * // optBytes === Uint8Array[1, 2, 3, 4]\n * ```\n * @group Implementation\n * @category BCS\n */\n deserializeOption(type: \"string\"): string | undefined;\n deserializeOption(type: \"bytes\"): Uint8Array | undefined;\n deserializeOption(type: \"fixedBytes\", len: number): Uint8Array | undefined;\n deserializeOption<T>(type: Deserializable<T>): T | undefined;\n deserializeOption<T>(\n type: Deserializable<T> | \"string\" | \"bytes\" | \"fixedBytes\",\n len?: number,\n ): T | string | Uint8Array | undefined {\n const exists = this.deserializeBool();\n if (!exists) return undefined;\n\n if (type === \"string\") {\n return this.deserializeStr();\n }\n if (type === \"bytes\") {\n return this.deserializeBytes();\n }\n if (type === \"fixedBytes\") {\n if (len === undefined) {\n throw new Error(\"Fixed bytes length not provided\");\n }\n return this.deserializeFixedBytes(len);\n }\n\n return this.deserialize(type);\n }\n\n /**\n * Deserializes an array of bytes.\n *\n * The BCS layout for \"bytes\" consists of a bytes_length followed by the bytes themselves, where bytes_length is a u32 integer\n * encoded as a uleb128 integer, indicating the length of the bytes array.\n *\n * @returns {Uint8Array} The deserialized array of bytes.\n * @group Implementation\n * @category BCS\n */\n deserializeBytes(): Uint8Array {\n const len = this.deserializeUleb128AsU32();\n return new Uint8Array(this.read(len));\n }\n\n /**\n * Deserializes an array of bytes of a specified length.\n *\n * @param len - The number of bytes to read from the source.\n * @group Implementation\n * @category BCS\n */\n deserializeFixedBytes(len: number): Uint8Array {\n return new Uint8Array(this.read(len));\n }\n\n /**\n * Deserializes a boolean value from a byte stream.\n *\n * The BCS layout for a boolean uses one byte, where \"0x01\" represents true and \"0x00\" represents false.\n * An error is thrown if the byte value is not valid.\n *\n * @returns The deserialized boolean value.\n * @throws Throws an error if the boolean value is invalid.\n * @group Implementation\n * @category BCS\n */\n deserializeBool(): boolean {\n const bool = new Uint8Array(this.read(1))[0];\n if (bool !== 1 && bool !== 0) {\n throw new Error(\"Invalid boolean value\");\n }\n return bool === 1;\n }\n\n /**\n * Deserializes a uint8 number from the binary data.\n *\n * BCS layout for \"uint8\": One byte. Binary format in little-endian representation.\n *\n * @returns {number} The deserialized uint8 number.\n * @group Implementation\n * @category BCS\n */\n deserializeU8(): Uint8 {\n return new DataView(this.read(1)).getUint8(0);\n }\n\n /**\n * Deserializes a uint16 number from a binary format in little-endian representation.\n *\n * BCS layout for \"uint16\": Two bytes.\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([0x34, 0x12]));\n * assert(deserializer.deserializeU16() === 4660);\n * ```\n * @group Implementation\n * @category BCS\n */\n deserializeU16(): Uint16 {\n return new DataView(this.read(2)).getUint16(0, true);\n }\n\n /**\n * Deserializes a uint32 number from a binary format in little-endian representation.\n *\n * BCS layout for \"uint32\": Four bytes.\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([0x78, 0x56, 0x34, 0x12]));\n * assert(deserializer.deserializeU32() === 305419896);\n * ```\n * @group Implementation\n * @category BCS\n */\n deserializeU32(): Uint32 {\n return new DataView(this.read(4)).getUint32(0, true);\n }\n\n /**\n * Deserializes a uint64 number.\n *\n * This function combines two 32-bit values to return a 64-bit unsigned integer in little-endian representation.\n * @example\n * ```typescript\n * const deserializer = new Deserializer(new Uint8Array([0x00, 0xEF, 0xCD, 0xAB, 0x78, 0x56, 0x34, 0x12]));\n * assert(deserializer.deserializeU64() === 1311768467750121216);\n * ```\n * @group Implementation\n * @category BCS\n */\n deserializeU64(): Uint64 {\n const low = this.deserializeU32();\n const high = this.deserializeU32();\n\n // combine the two 32-bit values and return (little endian)\n return BigInt((BigInt(high) << BigInt(32)) | BigInt(low));\n }\n\n /**\n * Deserializes a uint128 number from its binary representation.\n * This function combines two 64-bit values to return a single uint128 value in little-endian format.\n *\n * @returns {BigInt} The deserialized uint128 number.\n * @group Implementation\n * @category BCS\n */\n deserializeU128(): Uint128 {\n const low = this.deserializeU64();\n const high = this.deserializeU64();\n\n // combine the two 64-bit values and return (little endian)\n return BigInt((high << BigInt(64)) | low);\n }\n\n /**\n * Deserializes a uint256 number from its binary representation.\n *\n * The BCS layout for \"uint256\" consists of thirty-two bytes in little-endian format.\n *\n * @returns {BigInt} The deserialized uint256 number.\n * @group Implementation\n * @category BCS\n */\n deserializeU256(): Uint256 {\n const low = this.deserializeU128();\n const high = this.deserializeU128();\n\n // combine the two 128-bit values and return (little endian)\n return BigInt((high << BigInt(128)) | low);\n }\n\n /**\n * Deserializes a uleb128 encoded uint32 number.\n *\n * This function is used for interpreting lengths of variable-length sequences and tags of enum values in BCS encoding.\n *\n * @throws {Error} Throws an error if the parsed value exceeds the maximum uint32 number.\n * @returns {number} The deserialized uint32 value.\n * @group Implementation\n * @category BCS\n */\n deserializeUleb128AsU32(): Uint32 {\n let value: bigint = BigInt(0);\n let shift = 0;\n\n while (value < MAX_U32_NUMBER) {\n const byte = this.deserializeU8();\n value |= BigInt(byte & 0x7f) << BigInt(shift);\n\n if ((byte & 0x80) === 0) {\n break;\n }\n shift += 7;\n }\n\n if (value > MAX_U32_NUMBER) {\n throw new Error(\"Overflow while parsing uleb128-encoded uint32 value\");\n }\n\n return Number(value);\n }\n\n /**\n * Helper function that primarily exists to support alternative syntax for deserialization.\n * That is, if we have a `const deserializer: new Deserializer(...)`, instead of having to use\n * `MyClass.deserialize(deserializer)`, we can call `deserializer.deserialize(MyClass)`.\n *\n * @example const deserializer = new Deserializer(new Uint8Array([1, 2, 3]));\n * const value = deserializer.deserialize(MyClass); // where MyClass has a `deserialize` function\n * // value is now an instance of MyClass\n * // equivalent to `const value = MyClass.deserialize(deserializer)`\n * @param cls The BCS-deserializable class to deserialize the buffered bytes into.\n *\n * @returns the deserialized value of class type T\n * @group Implementation\n * @category BCS\n */\n deserialize<T>(cls: Deserializable<T>): T {\n // NOTE: `deserialize` in `cls.deserialize(this)` here is a static method defined in `cls`,\n // It is separate from the `deserialize` instance method defined here in Deserializer.\n return cls.deserialize(this);\n }\n\n /**\n * Deserializes an array of BCS Deserializable values given an existing Deserializer instance with a loaded byte buffer.\n *\n * @param cls The BCS-deserializable class to deserialize the buffered bytes into.\n * @returns An array of deserialized values of type T.\n * @example\n * // serialize a vector of addresses\n * const addresses = new Array<AccountAddress>(\n * AccountAddress.from(\"0x1\"),\n * AccountAddress.from(\"0x2\"),\n * AccountAddress.from(\"0xa\"),\n * AccountAddress.from(\"0xb\"),\n * );\n * const serializer = new Serializer();\n * serializer.serializeVector(addresses);\n * const serializedBytes = serializer.toUint8Array();\n *\n * // deserialize the bytes into an array of addresses\n * const deserializer = new Deserializer(serializedBytes);\n * const deserializedAddresses = deserializer.deserializeVector(AccountAddress);\n * // deserializedAddresses is now an array of AccountAddress instances\n * @group Implementation\n * @category BCS\n */\n deserializeVector<T>(cls: Deserializable<T>): Array<T> {\n const length = this.deserializeUleb128AsU32();\n const vector = new Array<T>();\n for (let i = 0; i < length; i += 1) {\n vector.push(this.deserialize(cls));\n }\n return vector;\n }\n}\n"],"mappings":"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","names":["Deserializer","_Deserializer","data","hex","Hex","length","bytes","value","type","len","bool","low","high","shift","MAX_U32_NUMBER","byte","cls","vector","i"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from"./chunk-CZOZTNXJ.mjs";import{b as t}from"./chunk-VHY6ZATX.mjs";var o=class extends r{toUint8Array(){return this.bcsToBytes()}toString(){let i=this.toUint8Array();return t.fromHexInput(i).toString()}};export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BRGQM252.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as u}from"./chunk-ZKOF4KST.mjs";import{a as f}from"./chunk-NDXMDJV4.mjs";async function p(s,R){let{url:t,method:n,body:i,contentType:a,params:o,overrides:e,originMethod:r}=s,d={...e?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${f}`,"content-type":a??"application/json","x-aptos-typescript-sdk-origin-method":r};return e?.AUTH_TOKEN&&(d.Authorization=`Bearer ${e?.AUTH_TOKEN}`),e?.API_KEY&&(d.Authorization=`Bearer ${e?.API_KEY}`),R.provider({url:t,method:n,body:i,params:o,headers:d,overrides:e})}async function A(s,R){if(R.binaryProvider===void 0)throw new Error("Binary provider is not provided");let{url:t,method:n,body:i,contentType:a,acceptType:o,params:e,overrides:r,originMethod:d}=s,c={...r?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${f}`,"content-type":a??"application/json",accept:o??"application/x-bcs","x-aptos-typescript-sdk-origin-method":d};return r?.AUTH_TOKEN&&(c.Authorization=`Bearer ${r?.AUTH_TOKEN}`),r?.API_KEY&&(c.Authorization=`Bearer ${r?.API_KEY}`),R.binaryProvider({acceptType:"application/x-bcs",url:t,method:n,body:i,params:e,headers:c,overrides:r})}async function B(s,R,t){let{url:n,path:i}=s,a=i?`${n}/${i}`:n,o=await p({...s,url:a},R.client),e={status:o.status,statusText:o.statusText??"No status text provided",data:o.data,headers:o.headers,config:o.config,request:o.request,url:a};if(e.status===401)throw new u({apiType:t,aptosRequest:s,aptosResponse:e});if(t==="Indexer"){let r=e.data;if(r.errors)throw new u({apiType:t,aptosRequest:s,aptosResponse:e});e.data=r.data}else if((t==="Pepper"||t==="Prover")&&e.status>=400)throw new u({apiType:t,aptosRequest:s,aptosResponse:e});if(e.status>=200&&e.status<300)return e;throw new u({apiType:t,aptosRequest:s,aptosResponse:e})}async function b(s,R,t){let{url:n,path:i}=s,a=i?`${n}/${i}`:n,o=await A({...s,url:a},R.client),e={status:o.status,statusText:o.statusText??"No status text provided",data:o.data,headers:o.headers,config:o.config,request:o.request,url:a};if(e.status===401)throw new u({apiType:t,aptosRequest:s,aptosResponse:e});if(t==="Indexer"){let r=e.data;if(r.errors)throw new u({apiType:t,aptosRequest:s,aptosResponse:e});e.data=r.data}else if((t==="Pepper"||t==="Prover")&&e.status>=400)throw new u({apiType:t,aptosRequest:s,aptosResponse:e});if(e.status>=200&&e.status<300)return e;throw new u({apiType:t,aptosRequest:s,aptosResponse:e})}export{p as a,A as b,B as c,b as d};
|
|
2
|
+
//# sourceMappingURL=chunk-CICJRLYU.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as U,b,c as f,d as h,e as l,f as y}from"./chunk-56CNRT2K.mjs";import{b as c}from"./chunk-VHY6ZATX.mjs";import{a as s}from"./chunk-KDMSOCZY.mjs";var B=class{bcsToBytes(){let e=new n;return this.serialize(e),e.toUint8Array()}bcsToHex(){let e=this.bcsToBytes();return c.fromHexInput(e)}toStringWithoutPrefix(){return this.bcsToHex().toStringWithoutPrefix()}toString(){return`0x${this.toStringWithoutPrefix()}`}},n=class{constructor(e=64){if(e<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(e),this.offset=0}ensureBufferWillHandleSize(e){for(;this.buffer.byteLength<this.offset+e;){let t=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t}}appendToBuffer(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,t,i){this.ensureBufferWillHandleSize(t);let a=new DataView(this.buffer,this.offset);e.apply(a,[0,i,!0]),this.offset+=t}serializeStr(e){let t=new TextEncoder;this.serializeBytes(t.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.appendToBuffer(e)}serializeFixedBytes(e){this.appendToBuffer(e)}serializeBool(e){p(e);let t=e?1:0;this.appendToBuffer(new Uint8Array([t]))}serializeU8(e){this.appendToBuffer(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){let t=BigInt(e)&BigInt(f),i=BigInt(e)>>BigInt(32);this.serializeU32(Number(t)),this.serializeU32(Number(i))}serializeU128(e){let t=BigInt(e)&h,i=BigInt(e)>>BigInt(64);this.serializeU64(t),this.serializeU64(i)}serializeU256(e){let t=BigInt(e)&l,i=BigInt(e)>>BigInt(128);this.serializeU128(t),this.serializeU128(i)}serializeU32AsUleb128(e){let t=e,i=[];for(;t>>>7;)i.push(t&127|128),t>>>=7;i.push(t),this.appendToBuffer(new Uint8Array(i))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(e){e.serialize(this)}serializeVector(e){this.serializeU32AsUleb128(e.length),e.forEach(t=>{t.serialize(this)})}serializeOption(e,t){let i=e!==void 0;this.serializeBool(i),i&&(typeof e=="string"?this.serializeStr(e):e instanceof Uint8Array?t!==void 0?this.serializeFixedBytes(e):this.serializeBytes(e):e.serialize(this))}serializeOptionStr(e){e===void 0?this.serializeU32AsUleb128(0):(this.serializeU32AsUleb128(1),this.serializeStr(e))}};s([o(0,U)],n.prototype,"serializeU8",1),s([o(0,b)],n.prototype,"serializeU16",1),s([o(0,f)],n.prototype,"serializeU32",1),s([o(BigInt(0),h)],n.prototype,"serializeU64",1),s([o(BigInt(0),l)],n.prototype,"serializeU128",1),s([o(BigInt(0),y)],n.prototype,"serializeU256",1),s([o(0,f)],n.prototype,"serializeU32AsUleb128",1);function p(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var A=(r,e,t)=>`${r} is out of range: [${e}, ${t}]`;function z(r,e,t){let i=BigInt(r);if(i>BigInt(t)||i<BigInt(e))throw new Error(A(r,e,t))}function o(r,e){return(t,i,a)=>{let g=a.value;return a.value=function(u){return z(u,r,e),g.apply(this,[u])},a}}export{B as a,n as b,p as c,A as d,z as e};
|
|
2
|
+
//# sourceMappingURL=chunk-CZOZTNXJ.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as i}from"./chunk-F2GWK4YJ.mjs";import{b as r}from"./chunk-SZYA6IG4.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-DC5IVW4W.mjs.map
|
|
@@ -0,0 +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":"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","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
|
+
import{a as r}from"./chunk-DC5IVW4W.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-DCVGWCZD.mjs.map
|
|
@@ -0,0 +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":"yCAEA,OAAyC,SAAAA,MAAa,gBACtD,OAAOC,MAAU,YACjB,OAAS,YAAAC,MAAgB,KAWlB,IAAMC,EAAN,KAAgB,CASrB,YAAYC,EAAiC,CAR7C,KAAS,sBAAwB,GAEjC,KAAS,mBAAqB,yBAE9B,gBAAsB,GAEtB,aAAiD,KAG/C,KAAK,WAAaA,GAAM,YAAc,EACxC,CAUA,MAAM,MAAsB,CAC1B,MAAM,IAAI,QAAQ,CAACC,EAASC,IAAW,CAChC,KAAK,SAAS,KAYnBC,EAAK,KAAK,QAAQ,IAAMC,GAAQ,CAC1BA,EACFF,EAAOE,CAAG,EAEVH,EAAQ,EAAI,CAEhB,CAAC,CACH,CAAC,CACH,CAUA,MAAM,KAAqB,CACR,MAAM,KAAK,mBAAmB,IAI/C,KAAK,MAAM,EACX,MAAM,KAAK,qBAAqB,EAClC,CAWA,OAAc,CACZ,IAAMI,EAAa,MACbC,EAAU,CAAC,QAAS,OAAQ,eAAgB,kBAAmB,eAAgB,oBAAoB,EAEnGC,EAAkBC,EAAS,EAC3BC,EAAc,CAClB,IAAK,CAAE,GAAG,QAAQ,IAAK,uBAAwB,GAAI,EACnD,GAAIF,IAAoB,SAAW,CAAE,MAAO,EAAK,CACnD,EAEA,KAAK,QAAUG,EAAML,EAAYC,EAASG,CAAW,EAErD,KAAK,QAAQ,QAAQ,GAAG,OAASE,GAAc,CAC7C,IAAMC,EAAMD,EAAK,SAAS,EAEtB,KAAK,YACP,QAAQ,IAAIC,CAAG,CAEnB,CAAC,CACH,CAUA,MAAM,sBAAyC,CAC7C,IAAIC,EAAc,MAAM,KAAK,mBAAmB,EAC1CC,EAAQ,KAAK,IAAI,EAAI,IACvBC,EAAOD,EAEX,KAAO,CAACD,GAAeC,EAAQ,KAAK,sBAAwBC,GAE1D,MAAMC,EAAM,GAAI,EAEhBH,EAAc,MAAM,KAAK,mBAAmB,EAC5CE,EAAO,KAAK,IAAI,EAAI,IAKtB,GAAI,CAACF,EACH,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{b as o}from"./chunk-7WPEGMD6.mjs";import{a as s}from"./chunk-BRGQM252.mjs";import{a as t}from"./chunk-L5C44K6H.mjs";import{b as i}from"./chunk-VHY6ZATX.mjs";var n=class e extends s{constructor(r){super(),this.value=i.fromHexInput(r)}serialize(r){r.serializeBytes(this.value.toUint8Array())}static deserialize(r){return new e(r.deserializeBytes())}},a=class extends o{constructor(r){super(),this.accountAddress=r}authKey(){return new t({data:this.accountAddress.toUint8Array()})}verifySignature(r){throw new Error("This function is not implemented for AbstractPublicKey.")}async verifySignatureAsync(r){throw new Error("This function is not implemented for AbstractPublicKey.")}serialize(r){throw new Error("This function is not implemented for AbstractPublicKey.")}};export{n as a,a as b};
|
|
2
|
+
//# sourceMappingURL=chunk-DFRHNDOS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/crypto/abstraction.ts"],"sourcesContent":["import { Deserializer, Serializer } from \"../../bcs\";\nimport { HexInput } from \"../../types\";\nimport { AccountAddress } from \"../accountAddress\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Hex } from \"../hex\";\nimport { AccountPublicKey, VerifySignatureArgs, VerifySignatureAsyncArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\n\nexport class AbstractSignature extends Signature {\n readonly value: Hex;\n\n constructor(value: HexInput) {\n super();\n this.value = Hex.fromHexInput(value);\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.value.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): AbstractSignature {\n return new AbstractSignature(deserializer.deserializeBytes());\n }\n}\n\nexport class AbstractPublicKey extends AccountPublicKey {\n readonly accountAddress: AccountAddress;\n\n constructor(accountAddress: AccountAddress) {\n super();\n this.accountAddress = accountAddress;\n }\n\n authKey(): AuthenticationKey {\n return new AuthenticationKey({ data: this.accountAddress.toUint8Array() });\n }\n\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n verifySignature(args: VerifySignatureArgs): boolean {\n throw new Error(\"This function is not implemented for AbstractPublicKey.\");\n }\n\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n async verifySignatureAsync(args: VerifySignatureAsyncArgs): Promise<boolean> {\n throw new Error(\"This function is not implemented for AbstractPublicKey.\");\n }\n\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n serialize(serializer: Serializer): void {\n throw new Error(\"This function is not implemented for AbstractPublicKey.\");\n }\n}\n"],"mappings":"oKAQO,IAAMA,EAAN,MAAMC,UAA0BC,CAAU,CAG/C,YAAYC,EAAiB,CAC3B,MAAM,EACN,KAAK,MAAQC,EAAI,aAAaD,CAAK,CACrC,CAEA,UAAUE,EAA8B,CACtCA,EAAW,eAAe,KAAK,MAAM,aAAa,CAAC,CACrD,CAEA,OAAO,YAAYC,EAA+C,CAChE,OAAO,IAAIL,EAAkBK,EAAa,iBAAiB,CAAC,CAC9D,CACF,EAEaC,EAAN,cAAgCC,CAAiB,CAGtD,YAAYC,EAAgC,CAC1C,MAAM,EACN,KAAK,eAAiBA,CACxB,CAEA,SAA6B,CAC3B,OAAO,IAAIC,EAAkB,CAAE,KAAM,KAAK,eAAe,aAAa,CAAE,CAAC,CAC3E,CAGA,gBAAgBC,EAAoC,CAClD,MAAM,IAAI,MAAM,yDAAyD,CAC3E,CAGA,MAAM,qBAAqBA,EAAkD,CAC3E,MAAM,IAAI,MAAM,yDAAyD,CAC3E,CAGA,UAAUN,EAA8B,CACtC,MAAM,IAAI,MAAM,yDAAyD,CAC3E,CACF","names":["AbstractSignature","_AbstractSignature","Signature","value","Hex","serializer","deserializer","AbstractPublicKey","AccountPublicKey","accountAddress","AuthenticationKey","args"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-UQKQH5C7.mjs";import{a as r}from"./chunk-CZOZTNXJ.mjs";var t=class l extends r{constructor(e){super(),this.value=new i(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,s){let a=i.deserialize(e,s);return new l(a.value)}};export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DGH7NXHM.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as k}from"./chunk-YOZBVVKL.mjs";import{e as x,f as B}from"./chunk-M7W6FZ5Z.mjs";import{c as f,f as A}from"./chunk-YVRPD7Z6.mjs";import{e as b}from"./chunk-ZKOF4KST.mjs";import{d as C}from"./chunk-RJ7F4JDV.mjs";import{a as d}from"./chunk-DC5IVW4W.mjs";async function H(o){let{aptosConfig:n,options:t}=o;return A({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function W(o){let{aptosConfig:n}=o;return k(async()=>{let{data:t}=await f({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function O(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await f({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function y(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function q(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await y({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function R(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await f({aptosConfig:n,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return s}async function z(o){let{aptosConfig:n,transactionHash:t,options:s}=o,r=s?.timeoutSecs??20,u=s?.checkSuccess??!0,e=!0,p=0,i,g,l=200,h=1.5;function c(a){if(!(a instanceof b)||(g=a,a.status!==404&&a.status>=400&&a.status<500))throw a}try{i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(a){c(a)}if(e){let a=Date.now();try{i=await R({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction"}catch(w){c(w)}p=(Date.now()-a)/1e3}for(;e&&!(p>=r);){try{if(i=await y({aptosConfig:n,transactionHash:t}),e=i.type==="pending_transaction",!e)break}catch(a){c(a)}await d(l),p+=l/1e3,l*=h}if(i===void 0)throw g||new m(`Fetching transaction ${t} failed and timed out after ${r} seconds`,i);if(i.type==="pending_transaction")throw new m(`Transaction ${t} timed out in pending state after ${r} seconds`,i);if(!u)return i;if(!i.success)throw new T(`Transaction ${t} failed with an error: ${i.vm_status}`,i);return i}async function U(o){let{aptosConfig:n,processorType:t}=o,s=BigInt(o.minimumLedgerVersion),r=3e3,u=new Date().getTime(),e=BigInt(-1);for(;e<s;){if(new Date().getTime()-u>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?e=await x({aptosConfig:n}):e=(await B({aptosConfig:n,processorType:t})).last_success_version,e>=s)break;await d(200)}}var m=class extends Error{constructor(n,t){super(n),this.lastSubmittedTransaction=t}},T=class extends Error{constructor(n,t){super(n),this.transaction=t}};async function X(o){let{aptosConfig:n,ledgerVersion:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByVersion",path:`blocks/by_version/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function j(o){let{aptosConfig:n,blockHeight:t,options:s}=o,{data:r}=await f({aptosConfig:n,originMethod:"getBlockByHeight",path:`blocks/by_height/${t}`,params:{with_transactions:s?.withTransactions}});return P({block:r,...o})}async function P(o){let{aptosConfig:n,block:t,options:s}=o;if(s?.withTransactions){t.transactions=t.transactions??[];let r=t.transactions[t.transactions.length-1],u=BigInt(t.first_version),e=BigInt(t.last_version),p=r?.version,i;if(p===void 0?i=u-1n:i=BigInt(p),i===e)return t;let g=[],l=100n;for(let c=i+1n;c<e;c+=BigInt(100))g.push(H({aptosConfig:n,options:{offset:c,limit:Math.min(Number(l),Number(e-c+1n))}}));let h=await Promise.all(g);for(let c of h)t.transactions.push(...c)}return t}export{H as a,W as b,O as c,y as d,q as e,R as f,z as g,U as h,m as i,T as j,X as k,j as l};
|
|
2
|
+
//# sourceMappingURL=chunk-DH32UXHB.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c}from"./chunk-SZYA6IG4.mjs";import{sha3_256 as n}from"@noble/hashes/sha3";var d=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,254]);return new c(n(o))},f=(e,r)=>{let t=e.bcsToBytes(),s=typeof r=="string"?Buffer.from(r,"utf8"):r,o=new Uint8Array([...t,...s,255]);return new c(n(o))},a=(e,r,t)=>{let s=`${r}::${t}`;return d(e,s)};export{d as a,f as b,a as c};
|
|
2
|
+
//# sourceMappingURL=chunk-F2GWK4YJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-CZOZTNXJ.mjs";var r=class a extends i{constructor(e){super(),this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let s=e.deserializeU8();return new a(s)}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-FU65NEDT.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c,b as o,c as d,d as z,e as m,f as U,g as y}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as c,b as o,c as d,d as z,e as m,f as U,g as y}from"./chunk-4FBUZY6C.mjs";import{a as b}from"./chunk-BE3OXYYX.mjs";import{a as s}from"./chunk-CZOZTNXJ.mjs";import{b as u}from"./chunk-VHY6ZATX.mjs";var t=class i extends s{constructor(e){super(),this.values=e}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){if(this.values[0]!==void 0&&!(this.values[0]instanceof o)){new p(this.bcsToBytes()).serializeForScriptFunction(e);return}e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let r;if(Array.isArray(e)&&e.length===0)r=[];else if(Array.isArray(e)&&typeof e[0]=="number")r=e;else if(typeof e=="string"){let n=u.fromHexInput(e);r=Array.from(n.toUint8Array())}else if(e instanceof Uint8Array)r=Array.from(e);else throw new Error("Invalid input type, must be an number[], Uint8Array, or hex string");return new i(r.map(n=>new o(n)))}static U16(e){return new i(e.map(r=>new d(r)))}static U32(e){return new i(e.map(r=>new z(r)))}static U64(e){return new i(e.map(r=>new m(r)))}static U128(e){return new i(e.map(r=>new U(r)))}static U256(e){return new i(e.map(r=>new y(r)))}static Bool(e){return new i(e.map(r=>new c(r)))}static MoveString(e){return new i(e.map(r=>new a(r)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,r){let n=e.deserializeUleb128AsU32(),l=new Array;for(let w=0;w<n;w+=1)l.push(r.deserialize(e));return new i(l)}},p=class i extends s{constructor(e){super(),this.value=u.fromHexInput(e).toUint8Array()}serialize(e){e.serializeBytes(this.value)}serializeForEntryFunction(e){this.serialize(e)}serializeForScriptFunction(e){e.serializeU32AsUleb128(9),this.serialize(e)}static deserialize(e){return new i(e.deserializeBytes())}toMoveVector(e){let r=new b(this.bcsToBytes());r.deserializeUleb128AsU32();let n=r.deserializeVector(e);return new t(n)}},a=class i extends s{constructor(e){super(),this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){let n=new TextEncoder().encode(this.value);t.U8(n).serializeForScriptFunction(e)}static deserialize(e){return new i(e.deserializeStr())}},A=class i extends s{constructor(e){super(),typeof e<"u"&&e!==null?this.vec=new t([e]):this.vec=new t([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new i(e!=null?new o(e):void 0)}static U16(e){return new i(e!=null?new d(e):void 0)}static U32(e){return new i(e!=null?new z(e):void 0)}static U64(e){return new i(e!=null?new m(e):void 0)}static U128(e){return new i(e!=null?new U(e):void 0)}static U256(e){return new i(e!=null?new y(e):void 0)}static Bool(e){return new i(e!=null?new c(e):void 0)}static MoveString(e){return new i(e!=null?new a(e):void 0)}static deserialize(e,r){let n=t.deserialize(e,r);return new i(n.values[0])}};export{t as a,p as b,a as c,A as d};
|
|
2
|
+
//# sourceMappingURL=chunk-H3NZHL45.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as d}from"./chunk-DOVH6HPL.mjs";import{a as x}from"./chunk-7CRQNXR5.mjs";import{b as K}from"./chunk-7WPEGMD6.mjs";import{a as S}from"./chunk-BRGQM252.mjs";import{d as v,f as P,g as E,h as H,i as b,j as U}from"./chunk-C3Q23D22.mjs";import{a as A}from"./chunk-L5C44K6H.mjs";import{a as p}from"./chunk-CZOZTNXJ.mjs";import{b as o}from"./chunk-VHY6ZATX.mjs";import{ed25519 as y}from"@noble/curves/ed25519";var m=[237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16];function T(I){let e=I.toUint8Array().slice(32);for(let t=m.length-1;t>=0;t-=1){if(e[t]<m[t])return!0;if(e[t]>m[t])return!1}return!1}var n=class n extends K{constructor(e){super();let t=o.fromHexInput(e);if(t.toUint8Array().length!==n.LENGTH)throw new Error(`PublicKey length should be ${n.LENGTH}`);this.key=t}verifySignature(e){let{message:t,signature:i}=e;if(!T(i))return!1;let a=d(t),u=o.fromHexInput(a).toUint8Array(),c=i.toUint8Array(),l=this.key.toUint8Array();return y.verify(c,u,l)}async verifySignatureAsync(e){return this.verifySignature(e)}authKey(){return A.fromSchemeAndBytes({scheme:0,input:this.toUint8Array()})}toUint8Array(){return this.key.toUint8Array()}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new n(t)}static isPublicKey(e){return e instanceof n}static isInstance(e){return"key"in e&&e.key?.data?.length===n.LENGTH}};n.LENGTH=32;var f=n,r=class r extends p{constructor(e,t){super();let i=x.parseHexInput(e,"ed25519",t);if(i.toUint8Array().length!==r.LENGTH)throw new Error(`PrivateKey length should be ${r.LENGTH}`);this.signingKey=i}static generate(){let e=y.utils.randomPrivateKey();return new r(e,!1)}static fromDerivationPath(e,t){if(!P(e))throw new Error(`Invalid derivation path ${e}`);return r.fromDerivationPathInner(e,U(t))}static fromDerivationPathInner(e,t,i=v){let{key:a,chainCode:u}=E(r.SLIP_0010_SEED,t),c=b(e).map(g=>parseInt(g,10)),{key:l}=c.reduce((g,w)=>H(g,w+i),{key:a,chainCode:u});return new r(l,!1)}publicKey(){let e=y.getPublicKey(this.signingKey.toUint8Array());return new f(e)}sign(e){let t=d(e),i=o.fromHexInput(t).toUint8Array(),a=y.sign(i,this.signingKey.toUint8Array());return new h(a)}toUint8Array(){return this.signingKey.toUint8Array()}toString(){return this.toHexString()}toHexString(){return this.signingKey.toString()}toAIP80String(){return x.formatPrivateKey(this.signingKey.toString(),"ed25519")}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new r(t,!1)}static isPrivateKey(e){return e instanceof r}};r.LENGTH=32,r.SLIP_0010_SEED="ed25519 seed";var z=r,s=class s extends S{constructor(e){super();let t=o.fromHexInput(e);if(t.toUint8Array().length!==s.LENGTH)throw new Error(`Signature length should be ${s.LENGTH}`);this.data=t}toUint8Array(){return this.data.toUint8Array()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let t=e.deserializeBytes();return new s(t)}};s.LENGTH=64;var h=s;export{T as a,f as b,z as c,h as d};
|
|
2
|
+
//# sourceMappingURL=chunk-HEYMZZRE.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/crypto/ed25519.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ed25519 } from \"@noble/curves/ed25519\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializable, Serializer } from \"../../bcs/serializer\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { Hex } from \"../hex\";\nimport { HexInput, SigningScheme as AuthenticationKeyScheme, PrivateKeyVariants } from \"../../types\";\nimport { CKDPriv, deriveKey, HARDENED_OFFSET, isValidHardenedPath, mnemonicToSeed, splitPath } from \"./hdKey\";\nimport { PrivateKey } from \"./privateKey\";\nimport { AccountPublicKey, PublicKey, VerifySignatureArgs, VerifySignatureAsyncArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\nimport { convertSigningMessage } from \"./utils\";\n\n/**\n * L is the value that greater than or equal to will produce a non-canonical signature, and must be rejected\n * @group Implementation\n * @category Serialization\n */\nconst L: number[] = [\n 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,\n];\n\n/**\n * Checks if an ED25519 signature is non-canonical.\n * This function helps determine the validity of a signature by verifying its canonical form.\n *\n * @param signature - The signature to be checked for canonicality.\n * @returns A boolean indicating whether the signature is non-canonical.\n *\n * Comes from Aptos Core\n * https://github.com/aptos-labs/aptos-core/blob/main/crates/aptos-crypto/src/ed25519/ed25519_sigs.rs#L47-L85\n * @group Implementation\n * @category Serialization\n */\nexport function isCanonicalEd25519Signature(signature: Signature): boolean {\n const s = signature.toUint8Array().slice(32);\n for (let i = L.length - 1; i >= 0; i -= 1) {\n if (s[i] < L[i]) {\n return true;\n }\n if (s[i] > L[i]) {\n return false;\n }\n }\n // As this stage S == L which implies a non-canonical S.\n return false;\n}\n\n/**\n * Represents the public key of an Ed25519 key pair.\n *\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263) Aptos supports\n * `Legacy` and `Unified` authentication keys.\n *\n * Ed25519 scheme is represented in the SDK as `Legacy authentication key` and also\n * as `AnyPublicKey` that represents any `Unified authentication key`.\n * @group Implementation\n * @category Serialization\n */\nexport class Ed25519PublicKey extends AccountPublicKey {\n /**\n * Length of an Ed25519 public key\n * @group Implementation\n * @category Serialization\n */\n static readonly LENGTH: number = 32;\n\n /**\n * Bytes of the public key\n * @private\n * @group Implementation\n * @category Serialization\n */\n private readonly key: Hex;\n\n /**\n * Creates an instance of the Ed25519Signature class from a hex input.\n * This constructor validates the length of the signature to ensure it meets the required specifications.\n *\n * @param hexInput - The hex input representing the Ed25519 signature.\n * @throws Error if the signature length is not equal to Ed25519Signature.LENGTH.\n * @group Implementation\n * @category Serialization\n */\n constructor(hexInput: HexInput) {\n super();\n\n const hex = Hex.fromHexInput(hexInput);\n if (hex.toUint8Array().length !== Ed25519PublicKey.LENGTH) {\n throw new Error(`PublicKey length should be ${Ed25519PublicKey.LENGTH}`);\n }\n this.key = hex;\n }\n\n // region AccountPublicKey\n\n /**\n * Verifies a signed message using a public key.\n *\n * @param args - The arguments for verification.\n * @param args.message - A signed message as a Hex string or Uint8Array.\n * @param args.signature - The signature of the message.\n * @group Implementation\n * @category Serialization\n */\n verifySignature(args: VerifySignatureArgs): boolean {\n const { message, signature } = args;\n // Verify malleability\n if (!isCanonicalEd25519Signature(signature)) {\n return false;\n }\n\n const messageToVerify = convertSigningMessage(message);\n const messageBytes = Hex.fromHexInput(messageToVerify).toUint8Array();\n const signatureBytes = signature.toUint8Array();\n const publicKeyBytes = this.key.toUint8Array();\n return ed25519.verify(signatureBytes, messageBytes, publicKeyBytes);\n }\n\n /**\n * Note: Ed25519Signatures can be verified syncronously.\n *\n * Verifies the provided signature against the given message.\n * This function helps ensure the integrity and authenticity of the message by confirming that the signature is valid.\n *\n * @param args - The arguments for signature verification.\n * @param args.aptosConfig - The configuration object for connecting to the Aptos network\n * @param args.message - The message that was signed.\n * @param args.signature - The signature to verify, which must be an instance of Secp256k1Signature.\n * @returns A boolean indicating whether the signature is valid for the given message.\n * @group Implementation\n * @category Serialization\n */\n async verifySignatureAsync(args: VerifySignatureAsyncArgs): Promise<boolean> {\n return this.verifySignature(args);\n }\n\n /**\n * Generates an authentication key from the public key using the Ed25519 scheme.\n * This function is essential for creating a secure authentication key that can be used for further cryptographic operations.\n *\n * @returns {AuthenticationKey} The generated authentication key.\n * @group Implementation\n * @category Serialization\n */\n authKey(): AuthenticationKey {\n return AuthenticationKey.fromSchemeAndBytes({\n scheme: AuthenticationKeyScheme.Ed25519,\n input: this.toUint8Array(),\n });\n }\n\n /**\n * Convert the internal data representation to a Uint8Array.\n *\n * @returns Uint8Array representation of the data.\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.key.toUint8Array();\n }\n\n // endregion\n\n // region Serializable\n\n /**\n * Serializes the data into a byte array using the provided serializer.\n * This allows for the conversion of data into a format suitable for transmission or storage.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n * @group Implementation\n * @category Serialization\n */\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.key.toUint8Array());\n }\n\n /**\n * Deserialize bytes into an Ed25519Signature object.\n * This function is used to convert serialized byte data into a usable Ed25519Signature instance.\n *\n * @param deserializer - The deserializer instance used to read the byte data.\n * @group Implementation\n * @category Serialization\n */\n static deserialize(deserializer: Deserializer): Ed25519PublicKey {\n const bytes = deserializer.deserializeBytes();\n return new Ed25519PublicKey(bytes);\n }\n\n // endregion\n\n /**\n * Determine if the provided public key is an instance of Ed25519PublicKey.\n *\n * @param publicKey - The public key to check.\n * @returns True if the public key is an instance of Ed25519PublicKey, otherwise false.\n * @deprecated use `instanceof Ed25519PublicKey` instead.\n * @group Implementation\n * @category Serialization\n */\n static isPublicKey(publicKey: AccountPublicKey): publicKey is Ed25519PublicKey {\n return publicKey instanceof Ed25519PublicKey;\n }\n\n /**\n * Determines if the provided public key is a valid Ed25519 public key.\n * This function checks for the presence of the \"key\" property and verifies that its data length matches the expected length\n * for Ed25519 public keys.\n *\n * @param publicKey - The public key to validate.\n * @returns A boolean indicating whether the public key is a valid Ed25519 public key.\n * @group Implementation\n * @category Serialization\n */\n static isInstance(publicKey: PublicKey): publicKey is Ed25519PublicKey {\n return \"key\" in publicKey && (publicKey.key as any)?.data?.length === Ed25519PublicKey.LENGTH;\n }\n}\n\n/**\n * Represents the private key of an Ed25519 key pair.\n * @group Implementation\n * @category Serialization\n */\nexport class Ed25519PrivateKey extends Serializable implements PrivateKey {\n /**\n * Length of an Ed25519 private key\n * @group Implementation\n * @category Serialization\n */\n static readonly LENGTH: number = 32;\n\n /**\n * The Ed25519 key seed to use for BIP-32 compatibility\n * See more {@link https://github.com/satoshilabs/slips/blob/master/slip-0010.md}\n * @group Implementation\n * @category Serialization\n */\n static readonly SLIP_0010_SEED = \"ed25519 seed\";\n\n /**\n * The Ed25519 signing key\n * @private\n * @group Implementation\n * @category Serialization\n */\n private readonly signingKey: Hex;\n\n // region Constructors\n\n /**\n * Create a new PrivateKey instance from a Uint8Array or String.\n *\n * [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)\n *\n * @param hexInput HexInput (string or Uint8Array)\n * @param strict If true, private key must AIP-80 compliant.\n * @group Implementation\n * @category Serialization\n */\n constructor(hexInput: HexInput, strict?: boolean) {\n super();\n\n const privateKeyHex = PrivateKey.parseHexInput(hexInput, PrivateKeyVariants.Ed25519, strict);\n if (privateKeyHex.toUint8Array().length !== Ed25519PrivateKey.LENGTH) {\n throw new Error(`PrivateKey length should be ${Ed25519PrivateKey.LENGTH}`);\n }\n\n // Create keyPair from Private key in Uint8Array format\n this.signingKey = privateKeyHex;\n }\n\n /**\n * Generate a new random private key.\n *\n * @returns Ed25519PrivateKey A newly generated Ed25519 private key.\n * @group Implementation\n * @category Serialization\n */\n static generate(): Ed25519PrivateKey {\n const keyPair = ed25519.utils.randomPrivateKey();\n return new Ed25519PrivateKey(keyPair, false);\n }\n\n /**\n * Derives a private key from a mnemonic seed phrase using a specified BIP44 path.\n * To derive multiple keys from the same phrase, change the path\n *\n * IMPORTANT: Ed25519 supports hardened derivation only, as it lacks a key homomorphism, making non-hardened derivation impossible.\n *\n * @param path - The BIP44 path used for key derivation.\n * @param mnemonics - The mnemonic seed phrase from which the key will be derived.\n * @throws Error if the provided path is not a valid hardened path.\n * @group Implementation\n * @category Serialization\n */\n static fromDerivationPath(path: string, mnemonics: string): Ed25519PrivateKey {\n if (!isValidHardenedPath(path)) {\n throw new Error(`Invalid derivation path ${path}`);\n }\n return Ed25519PrivateKey.fromDerivationPathInner(path, mnemonicToSeed(mnemonics));\n }\n\n /**\n * Derives a child private key from a given BIP44 path and seed.\n * A private inner function so we can separate from the main fromDerivationPath() method\n * to add tests to verify we create the keys correctly.\n *\n * @param path - The BIP44 path used for key derivation.\n * @param seed - The seed phrase created by the mnemonics, represented as a Uint8Array.\n * @param offset - The offset used for key derivation, defaults to HARDENED_OFFSET.\n * @returns An instance of Ed25519PrivateKey derived from the specified path and seed.\n * @group Implementation\n * @category Serialization\n */\n private static fromDerivationPathInner(path: string, seed: Uint8Array, offset = HARDENED_OFFSET): Ed25519PrivateKey {\n const { key, chainCode } = deriveKey(Ed25519PrivateKey.SLIP_0010_SEED, seed);\n\n const segments = splitPath(path).map((el) => parseInt(el, 10));\n\n // Derive the child key based on the path\n const { key: privateKey } = segments.reduce((parentKeys, segment) => CKDPriv(parentKeys, segment + offset), {\n key,\n chainCode,\n });\n return new Ed25519PrivateKey(privateKey, false);\n }\n\n // endregion\n\n // region PrivateKey\n\n /**\n * Derive the Ed25519PublicKey for this private key.\n *\n * @returns Ed25519PublicKey - The derived public key corresponding to the private key.\n * @group Implementation\n * @category Serialization\n */\n publicKey(): Ed25519PublicKey {\n const bytes = ed25519.getPublicKey(this.signingKey.toUint8Array());\n return new Ed25519PublicKey(bytes);\n }\n\n /**\n * Sign the given message with the private key.\n * This function generates a digital signature for the specified message, ensuring its authenticity and integrity.\n *\n * @param message - A message as a string or Uint8Array in HexInput format.\n * @returns A digital signature for the provided message.\n * @group Implementation\n * @category Serialization\n */\n sign(message: HexInput): Ed25519Signature {\n const messageToSign = convertSigningMessage(message);\n const messageBytes = Hex.fromHexInput(messageToSign).toUint8Array();\n const signatureBytes = ed25519.sign(messageBytes, this.signingKey.toUint8Array());\n return new Ed25519Signature(signatureBytes);\n }\n\n /**\n * Get the private key in bytes (Uint8Array).\n *\n * @returns Uint8Array representation of the private key\n * @group Implementation\n * @category Serialization\n */\n toUint8Array(): Uint8Array {\n return this.signingKey.toUint8Array();\n }\n\n /**\n * Get the private key as a hex string with the 0x prefix.\n *\n * @returns string representation of the private key.\n * @group Implementation\n * @category Serialization\n */\n toString(): string {\n return this.toHexString();\n }\n\n /**\n * Get the private key as a hex string with the 0x prefix.\n *\n * @returns string representation of the private key.\n */\n toHexString(): string {\n return this.signingKey.toString();\n }\n\n /**\n * Get the private key as a AIP-80 compliant hex string.\n *\n * [Read about AIP-80](https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md)\n *\n * @returns AIP-80 compliant string representation of the private key.\n */\n toAIP80String(): string {\n return PrivateKey.formatPrivateKey(this.signingKey.toString(), PrivateKeyVariants.Ed25519);\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Ed25519PrivateKey {\n const bytes = deserializer.deserializeBytes();\n return new Ed25519PrivateKey(bytes, false);\n }\n\n // endregion\n\n /**\n * Determines if the provided private key is an instance of Ed25519PrivateKey.\n *\n * @param privateKey - The private key to check.\n * @returns A boolean indicating whether the private key is an Ed25519PrivateKey.\n *\n * @deprecated Use `instanceof Ed25519PrivateKey` instead.\n * @group Implementation\n * @category Serialization\n */\n static isPrivateKey(privateKey: PrivateKey): privateKey is Ed25519PrivateKey {\n return privateKey instanceof Ed25519PrivateKey;\n }\n}\n\n/**\n * Represents a signature of a message signed using an Ed25519 private key.\n * @group Implementation\n * @category Serialization\n */\nexport class Ed25519Signature extends Signature {\n /**\n * Length of an Ed25519 signature, which is 64 bytes.\n * @group Implementation\n * @category Serialization\n */\n static readonly LENGTH = 64;\n\n /**\n * The signature bytes\n * @private\n * @group Implementation\n * @category Serialization\n */\n private readonly data: Hex;\n\n // region Constructors\n\n constructor(hexInput: HexInput) {\n super();\n const data = Hex.fromHexInput(hexInput);\n if (data.toUint8Array().length !== Ed25519Signature.LENGTH) {\n throw new Error(`Signature length should be ${Ed25519Signature.LENGTH}`);\n }\n this.data = data;\n }\n\n // endregion\n\n // region Signature\n\n toUint8Array(): Uint8Array {\n return this.data.toUint8Array();\n }\n\n // endregion\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n serializer.serializeBytes(this.data.toUint8Array());\n }\n\n static deserialize(deserializer: Deserializer): Ed25519Signature {\n const bytes = deserializer.deserializeBytes();\n return new Ed25519Signature(bytes);\n }\n\n // endregion\n}\n"],"mappings":"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","names":["ed25519","L","isCanonicalEd25519Signature","signature","s","i","_Ed25519PublicKey","AccountPublicKey","hexInput","hex","Hex","args","message","messageToVerify","convertSigningMessage","messageBytes","signatureBytes","publicKeyBytes","ed25519","AuthenticationKey","serializer","deserializer","bytes","publicKey","Ed25519PublicKey","_Ed25519PrivateKey","Serializable","strict","privateKeyHex","PrivateKey","keyPair","path","mnemonics","isValidHardenedPath","mnemonicToSeed","seed","offset","HARDENED_OFFSET","key","chainCode","deriveKey","segments","splitPath","el","privateKey","parentKeys","segment","CKDPriv","messageToSign","Ed25519Signature","Ed25519PrivateKey","_Ed25519Signature","Signature","data"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as d}from"./chunk-YOZBVVKL.mjs";import{c as s}from"./chunk-YVRPD7Z6.mjs";import{b as r}from"./chunk-SZYA6IG4.mjs";async function g(o){let{aptosConfig:e,accountAddress:t}=o,{data:n}=await s({aptosConfig:e,originMethod:"getInfo",path:`accounts/${r.from(t).toString()}`});return n}async function f(o){return o.options?.ledgerVersion!==void 0?c(o):d(async()=>c(o),`module-${o.accountAddress}-${o.moduleName}`,1e3*60*5)()}async function c(o){let{aptosConfig:e,accountAddress:t,moduleName:n,options:i}=o,{data:u}=await s({aptosConfig:e,originMethod:"getModule",path:`accounts/${r.from(t).toString()}/module/${n}`,params:{ledger_version:i?.ledgerVersion}});return u}export{g as a,f as b};
|
|
2
|
+
//# sourceMappingURL=chunk-KIMU5PYJ.mjs.map
|