@aptos-labs/ts-sdk 1.36.0 → 1.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/{accountAddress-jrha_M3l.d.ts → accountAddress-DZH9Wn5l.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-CDURCT1q.d.mts} +59 -3
- 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 +11 -11
- 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/index.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/{chunk-AIPHJFJL.mjs → chunk-3IGJ2IMB.mjs} +2 -2
- package/dist/esm/{chunk-2P27DDVV.mjs → chunk-5MMTP427.mjs} +2 -2
- package/dist/esm/chunk-6374Q7AG.mjs +2 -0
- package/dist/esm/{chunk-JLZGYZBX.mjs.map → chunk-6374Q7AG.mjs.map} +1 -1
- package/dist/esm/{chunk-AEGA5N2W.mjs → chunk-6J64BOS7.mjs} +2 -2
- package/dist/esm/chunk-7H44HTYE.mjs +4 -0
- package/dist/esm/chunk-7H44HTYE.mjs.map +1 -0
- package/dist/esm/chunk-7VEWPUCH.mjs +2 -0
- package/dist/esm/chunk-7VEWPUCH.mjs.map +1 -0
- package/dist/esm/chunk-ANTUWHYB.mjs +2 -0
- package/dist/esm/chunk-ANTUWHYB.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-TTY5GFMN.mjs → chunk-BSH7B2QT.mjs} +2 -2
- package/dist/esm/chunk-EYLZD4JU.mjs +4 -0
- package/dist/esm/chunk-EYLZD4JU.mjs.map +1 -0
- package/dist/esm/chunk-GPG64UZT.mjs +2 -0
- package/dist/esm/{chunk-X5YB74NB.mjs.map → chunk-GPG64UZT.mjs.map} +1 -1
- package/dist/esm/{chunk-KBC4ECVP.mjs → chunk-HRHICHDX.mjs} +2 -2
- package/dist/esm/{chunk-HWMMVLTP.mjs → chunk-JG4T5BDZ.mjs} +2 -2
- package/dist/esm/chunk-LBA4CTUV.mjs +2 -0
- package/dist/esm/chunk-LBA4CTUV.mjs.map +1 -0
- package/dist/esm/{chunk-H4YAL2IL.mjs → chunk-LGC2JORV.mjs} +2 -2
- package/dist/esm/chunk-LGC2JORV.mjs.map +1 -0
- package/dist/esm/chunk-MIW45ADL.mjs +2 -0
- package/dist/esm/chunk-MIW45ADL.mjs.map +1 -0
- package/dist/esm/{chunk-ZOY6N6UM.mjs → chunk-NZXPT44W.mjs} +2 -2
- package/dist/esm/{chunk-2SAOCLIU.mjs → chunk-POELQOLD.mjs} +2 -2
- package/dist/esm/chunk-PR72YXRK.mjs +2 -0
- package/dist/esm/chunk-PR72YXRK.mjs.map +1 -0
- package/dist/esm/{chunk-ZVYTHOS5.mjs → chunk-PXG3WJIU.mjs} +2 -2
- package/dist/esm/chunk-TTFYJM6A.mjs +2 -0
- package/dist/esm/chunk-TTFYJM6A.mjs.map +1 -0
- package/dist/esm/{chunk-ACE3NEV6.mjs → chunk-VNUNIQAY.mjs} +2 -2
- package/dist/esm/chunk-YHJHXLYS.mjs +7 -0
- package/dist/esm/chunk-YHJHXLYS.mjs.map +1 -0
- package/dist/esm/chunk-YHKWV7NV.mjs +2 -0
- package/dist/esm/chunk-YHKWV7NV.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 +18 -1
- 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 +26 -2
- 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-J5bdbbLQ.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 +13 -13
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +7 -7
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +2 -2
- 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/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.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 +5 -5
- package/dist/esm/types/index.d.mts +1 -1
- package/dist/esm/types/index.mjs +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 +8 -2
- 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-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-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.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-AIPHJFJL.mjs.map → chunk-3IGJ2IMB.mjs.map} +0 -0
- /package/dist/esm/{chunk-2P27DDVV.mjs.map → chunk-5MMTP427.mjs.map} +0 -0
- /package/dist/esm/{chunk-AEGA5N2W.mjs.map → chunk-6J64BOS7.mjs.map} +0 -0
- /package/dist/esm/{chunk-TTY5GFMN.mjs.map → chunk-BSH7B2QT.mjs.map} +0 -0
- /package/dist/esm/{chunk-KBC4ECVP.mjs.map → chunk-HRHICHDX.mjs.map} +0 -0
- /package/dist/esm/{chunk-HWMMVLTP.mjs.map → chunk-JG4T5BDZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZOY6N6UM.mjs.map → chunk-NZXPT44W.mjs.map} +0 -0
- /package/dist/esm/{chunk-2SAOCLIU.mjs.map → chunk-POELQOLD.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZVYTHOS5.mjs.map → chunk-PXG3WJIU.mjs.map} +0 -0
- /package/dist/esm/{chunk-ACE3NEV6.mjs.map → chunk-VNUNIQAY.mjs.map} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{b as T}from"./chunk-CU6HQJSE.mjs";var N=(r=>(r[r.API_ERROR=0]="API_ERROR",r[r.EXTERNAL_API_ERROR=1]="EXTERNAL_API_ERROR",r[r.SESSION_EXPIRED=2]="SESSION_EXPIRED",r[r.INVALID_STATE=3]="INVALID_STATE",r[r.UNKNOWN=4]="UNKNOWN",r))(N||{}),l=(s=>(s.REAUTHENTICATE="Re-authentiate to continue using your keyless account",s.REAUTHENTICATE_UNSURE="Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support",s.UPDATE_REQUEST_PARAMS="Update the invalid request parameters and reauthenticate.",s.RATE_LIMIT_EXCEEDED="Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest.",s.SERVER_ERROR="Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",s.CALL_PRECHECK="Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing.",s.REINSTANTIATE="Try instantiating the account again. Avoid manipulating the account object directly",s.JOIN_SUPPORT_GROUP="For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",s.UNKNOWN="Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",s))(l||{}),u=(e=>(e[e.EPHEMERAL_KEY_PAIR_EXPIRED=0]="EPHEMERAL_KEY_PAIR_EXPIRED",e[e.PROOF_NOT_FOUND=1]="PROOF_NOT_FOUND",e[e.ASYNC_PROOF_FETCH_FAILED=2]="ASYNC_PROOF_FETCH_FAILED",e[e.INVALID_PROOF_VERIFICATION_FAILED=3]="INVALID_PROOF_VERIFICATION_FAILED",e[e.INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND=4]="INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND",e[e.INVALID_JWT_SIG=5]="INVALID_JWT_SIG",e[e.INVALID_JWT_JWK_NOT_FOUND=6]="INVALID_JWT_JWK_NOT_FOUND",e[e.INVALID_JWT_ISS_NOT_RECOGNIZED=7]="INVALID_JWT_ISS_NOT_RECOGNIZED",e[e.INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED=8]="INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED",e[e.INVALID_TW_SIG_VERIFICATION_FAILED=9]="INVALID_TW_SIG_VERIFICATION_FAILED",e[e.INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND=10]="INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND",e[e.INVALID_EXPIRY_HORIZON=11]="INVALID_EXPIRY_HORIZON",e[e.JWT_PARSING_ERROR=12]="JWT_PARSING_ERROR",e[e.JWK_FETCH_FAILED=13]="JWK_FETCH_FAILED",e[e.JWK_FETCH_FAILED_FEDERATED=14]="JWK_FETCH_FAILED_FEDERATED",e[e.RATE_LIMIT_EXCEEDED=15]="RATE_LIMIT_EXCEEDED",e[e.PEPPER_SERVICE_INTERNAL_ERROR=16]="PEPPER_SERVICE_INTERNAL_ERROR",e[e.PEPPER_SERVICE_BAD_REQUEST=17]="PEPPER_SERVICE_BAD_REQUEST",e[e.PEPPER_SERVICE_OTHER=18]="PEPPER_SERVICE_OTHER",e[e.PROVER_SERVICE_INTERNAL_ERROR=19]="PROVER_SERVICE_INTERNAL_ERROR",e[e.PROVER_SERVICE_BAD_REQUEST=20]="PROVER_SERVICE_BAD_REQUEST",e[e.PROVER_SERVICE_OTHER=21]="PROVER_SERVICE_OTHER",e[e.FULL_NODE_CONFIG_LOOKUP_ERROR=22]="FULL_NODE_CONFIG_LOOKUP_ERROR",e[e.FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR=23]="FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR",e[e.FULL_NODE_JWKS_LOOKUP_ERROR=24]="FULL_NODE_JWKS_LOOKUP_ERROR",e[e.FULL_NODE_OTHER=25]="FULL_NODE_OTHER",e[e.UNKNOWN=26]="UNKNOWN",e))(u||{}),A={0:["The ephemeral keypair has expired.",2,"Re-authentiate to continue using your keyless account"],1:["The required proof could not be found.",3,"Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing."],2:["The required proof failed to fetch.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],3:["The provided proof is invalid.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],4:["The verification key used to authenticate was updated.",2,"Re-authentiate to continue using your keyless account"],5:["The JWK was found, but JWT failed verification",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],6:["The JWK required to verify the JWT could not be found. The JWK may have been rotated out.",2,"Re-authentiate to continue using your keyless account"],7:["The JWT issuer is not recognized.",3,"Update the invalid request parameters and reauthenticate."],8:["The JWT issuer is not supported by the Federated Keyless ",0,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],9:["The training wheels signature is invalid.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],10:["The public key used to verify the training wheels signature was not found.",2,"Re-authentiate to continue using your keyless account"],11:["The expiry horizon is invalid.",2,"Re-authentiate to continue using your keyless account"],13:["Failed to fetch JWKS.",1,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],14:["Failed to fetch JWKS for Federated Keyless provider.",1,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],15:["Rate limit exceeded. Too many requests in a short period.",0,"Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest."],16:["Internal error from Pepper service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],17:["Bad request sent to Pepper service.",0,"Update the invalid request parameters and reauthenticate."],18:["Unknown error from Pepper service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],19:["Internal error from Prover service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],20:["Bad request sent to Prover service.",0,"Update the invalid request parameters and reauthenticate."],21:["Unknown error from Prover service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],12:["Error when parsing JWT. This should never happen. Join https://t.me/+h5CN-W35yUFiYzkx for support",3,"Try instantiating the account again. Avoid manipulating the account object directly"],22:["Error when looking up on-chain keyless configuration.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],23:["Error when looking up on-chain verification key.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],24:["Error when looking up on-chain JWKS.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],25:["Unknown error from full node.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],26:["An unknown error has occurred.",4,"Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"]},O=class i extends Error{constructor(o){let{innerError:E,category:t,resolutionTip:R,type:r,message:_=A[r][0],details:n}=o;super(_),this.name="KeylessError",this.innerError=E,this.category=t,this.resolutionTip=R,this.type=r,this.details=n,this.message=i.constructMessage(_,R,E,n)}static constructMessage(o,E,t,R){let r=`
|
|
2
|
-
Message: ${o}`;return R&&(r+=`
|
|
3
|
-
Details: ${R}`),t instanceof I?r+=`
|
|
4
|
-
AptosApiError: ${t.message}`:t!==void 0&&(r+=`
|
|
5
|
-
Error: ${T(t)}`),r+=`
|
|
6
|
-
KeylessErrorResolutionTip: ${E}`,r}static fromErrorType(o){let{error:E,type:t,details:R}=o,[r,_,n]=A[t];return new i({message:r,details:R,innerError:E,category:_,resolutionTip:n,type:t})}},I=class extends Error{constructor({apiType:o,aptosRequest:E,aptosResponse:t}){super(P({apiType:o,aptosRequest:E,aptosResponse:t})),this.name="AptosApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.data=t.data,this.request=E}};function P({apiType:i,aptosRequest:o,aptosResponse:E}){let t=E.headers?.traceparent?.split("-")[1],R=t?`(trace_id:${t}) `:"",r=`Request to [${i}]: ${o.method} ${E.url??o.url} ${R}failed with`;return i==="Indexer"&&E.data?.errors?.[0]?.message!=null?`${r}: ${E.data.errors[0].message}`:E.data?.message!=null&&E.data?.error_code!=null?`${r}: ${JSON.stringify(E.data)}`:`${r} status: ${E.statusText}(code:${E.status}) and response body: ${S(E.data)}`}var a=400;function S(i){let o=JSON.stringify(i);return o.length<=a?o:`truncated(original_size:${o.length}): ${o.slice(0,a/2)}...${o.slice(-a/2)}`}export{N as a,l as b,u as c,O as d,I as e};
|
|
7
|
-
//# sourceMappingURL=chunk-X5ORWYVO.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/errors/index.ts"],"sourcesContent":["import { AptosApiType } from \"../utils/const\";\nimport { getErrorMessage } from \"../utils/helpers\";\nimport { AptosRequest, AptosResponse } from \"../types\";\n\nexport enum KeylessErrorCategory {\n API_ERROR,\n EXTERNAL_API_ERROR,\n SESSION_EXPIRED,\n INVALID_STATE,\n UNKNOWN,\n}\n\nexport enum KeylessErrorResolutionTip {\n REAUTHENTICATE = \"Re-authentiate to continue using your keyless account\",\n // eslint-disable-next-line max-len\n REAUTHENTICATE_UNSURE = \"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support\",\n UPDATE_REQUEST_PARAMS = \"Update the invalid request parameters and reauthenticate.\",\n // eslint-disable-next-line max-len\n RATE_LIMIT_EXCEEDED = \"Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest.\",\n // eslint-disable-next-line max-len\n SERVER_ERROR = \"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx\",\n // eslint-disable-next-line max-len\n CALL_PRECHECK = \"Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing.\",\n REINSTANTIATE = \"Try instantiating the account again. Avoid manipulating the account object directly\",\n JOIN_SUPPORT_GROUP = \"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx\",\n UNKNOWN = \"Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx\",\n}\n\nexport enum KeylessErrorType {\n EPHEMERAL_KEY_PAIR_EXPIRED,\n\n PROOF_NOT_FOUND,\n\n ASYNC_PROOF_FETCH_FAILED,\n\n INVALID_PROOF_VERIFICATION_FAILED,\n\n INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND,\n\n INVALID_JWT_SIG,\n\n INVALID_JWT_JWK_NOT_FOUND,\n\n INVALID_JWT_ISS_NOT_RECOGNIZED,\n\n INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED,\n\n INVALID_TW_SIG_VERIFICATION_FAILED,\n\n INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND,\n\n INVALID_EXPIRY_HORIZON,\n\n JWT_PARSING_ERROR,\n\n JWK_FETCH_FAILED,\n\n JWK_FETCH_FAILED_FEDERATED,\n\n RATE_LIMIT_EXCEEDED,\n\n PEPPER_SERVICE_INTERNAL_ERROR,\n\n PEPPER_SERVICE_BAD_REQUEST,\n\n PEPPER_SERVICE_OTHER,\n\n PROVER_SERVICE_INTERNAL_ERROR,\n\n PROVER_SERVICE_BAD_REQUEST,\n\n PROVER_SERVICE_OTHER,\n\n FULL_NODE_CONFIG_LOOKUP_ERROR,\n\n FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR,\n\n FULL_NODE_JWKS_LOOKUP_ERROR,\n\n FULL_NODE_OTHER,\n\n UNKNOWN,\n}\n\nconst KeylessErrors: { [key in KeylessErrorType]: [string, KeylessErrorCategory, KeylessErrorResolutionTip] } = {\n [KeylessErrorType.EPHEMERAL_KEY_PAIR_EXPIRED]: [\n \"The ephemeral keypair has expired.\",\n KeylessErrorCategory.SESSION_EXPIRED,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.PROOF_NOT_FOUND]: [\n \"The required proof could not be found.\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.CALL_PRECHECK,\n ],\n [KeylessErrorType.ASYNC_PROOF_FETCH_FAILED]: [\n \"The required proof failed to fetch.\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.REAUTHENTICATE_UNSURE,\n ],\n [KeylessErrorType.INVALID_PROOF_VERIFICATION_FAILED]: [\n \"The provided proof is invalid.\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.REAUTHENTICATE_UNSURE,\n ],\n [KeylessErrorType.INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND]: [\n \"The verification key used to authenticate was updated.\",\n KeylessErrorCategory.SESSION_EXPIRED,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.INVALID_JWT_SIG]: [\n \"The JWK was found, but JWT failed verification\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.REAUTHENTICATE_UNSURE,\n ],\n [KeylessErrorType.INVALID_JWT_JWK_NOT_FOUND]: [\n \"The JWK required to verify the JWT could not be found. The JWK may have been rotated out.\",\n KeylessErrorCategory.SESSION_EXPIRED,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.INVALID_JWT_ISS_NOT_RECOGNIZED]: [\n \"The JWT issuer is not recognized.\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.UPDATE_REQUEST_PARAMS,\n ],\n [KeylessErrorType.INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED]: [\n \"The JWT issuer is not supported by the Federated Keyless \",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.REAUTHENTICATE_UNSURE,\n ],\n [KeylessErrorType.INVALID_TW_SIG_VERIFICATION_FAILED]: [\n \"The training wheels signature is invalid.\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.REAUTHENTICATE_UNSURE,\n ],\n [KeylessErrorType.INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND]: [\n \"The public key used to verify the training wheels signature was not found.\",\n KeylessErrorCategory.SESSION_EXPIRED,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.INVALID_EXPIRY_HORIZON]: [\n \"The expiry horizon is invalid.\",\n KeylessErrorCategory.SESSION_EXPIRED,\n KeylessErrorResolutionTip.REAUTHENTICATE,\n ],\n [KeylessErrorType.JWK_FETCH_FAILED]: [\n \"Failed to fetch JWKS.\",\n KeylessErrorCategory.EXTERNAL_API_ERROR,\n KeylessErrorResolutionTip.JOIN_SUPPORT_GROUP,\n ],\n [KeylessErrorType.JWK_FETCH_FAILED_FEDERATED]: [\n \"Failed to fetch JWKS for Federated Keyless provider.\",\n KeylessErrorCategory.EXTERNAL_API_ERROR,\n KeylessErrorResolutionTip.JOIN_SUPPORT_GROUP,\n ],\n [KeylessErrorType.RATE_LIMIT_EXCEEDED]: [\n \"Rate limit exceeded. Too many requests in a short period.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.RATE_LIMIT_EXCEEDED,\n ],\n [KeylessErrorType.PEPPER_SERVICE_INTERNAL_ERROR]: [\n \"Internal error from Pepper service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.PEPPER_SERVICE_BAD_REQUEST]: [\n \"Bad request sent to Pepper service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.UPDATE_REQUEST_PARAMS,\n ],\n [KeylessErrorType.PEPPER_SERVICE_OTHER]: [\n \"Unknown error from Pepper service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.PROVER_SERVICE_INTERNAL_ERROR]: [\n \"Internal error from Prover service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.PROVER_SERVICE_BAD_REQUEST]: [\n \"Bad request sent to Prover service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.UPDATE_REQUEST_PARAMS,\n ],\n [KeylessErrorType.PROVER_SERVICE_OTHER]: [\n \"Unknown error from Prover service.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.JWT_PARSING_ERROR]: [\n \"Error when parsing JWT. This should never happen. Join https://t.me/+h5CN-W35yUFiYzkx for support\",\n KeylessErrorCategory.INVALID_STATE,\n KeylessErrorResolutionTip.REINSTANTIATE,\n ],\n [KeylessErrorType.FULL_NODE_CONFIG_LOOKUP_ERROR]: [\n \"Error when looking up on-chain keyless configuration.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR]: [\n \"Error when looking up on-chain verification key.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.FULL_NODE_JWKS_LOOKUP_ERROR]: [\n \"Error when looking up on-chain JWKS.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.FULL_NODE_OTHER]: [\n \"Unknown error from full node.\",\n KeylessErrorCategory.API_ERROR,\n KeylessErrorResolutionTip.SERVER_ERROR,\n ],\n [KeylessErrorType.UNKNOWN]: [\n \"An unknown error has occurred.\",\n KeylessErrorCategory.UNKNOWN,\n KeylessErrorResolutionTip.UNKNOWN,\n ],\n};\n\nexport class KeylessError extends Error {\n readonly innerError?: unknown;\n\n readonly category: KeylessErrorCategory;\n\n readonly resolutionTip: KeylessErrorResolutionTip;\n\n readonly type: KeylessErrorType;\n\n readonly details?: string;\n\n /** @internal this constructor is for sdk internal use - do not instantiate outside of the SDK codebase */\n constructor(args: {\n innerError?: unknown;\n category: KeylessErrorCategory;\n resolutionTip: KeylessErrorResolutionTip;\n type: KeylessErrorType;\n message?: string;\n details?: string;\n }) {\n const { innerError, category, resolutionTip, type, message = KeylessErrors[type][0], details } = args;\n super(message);\n this.name = \"KeylessError\";\n this.innerError = innerError;\n this.category = category;\n this.resolutionTip = resolutionTip;\n this.type = type;\n this.details = details;\n this.message = KeylessError.constructMessage(message, resolutionTip, innerError, details);\n }\n\n static constructMessage(\n message: string,\n tip: KeylessErrorResolutionTip,\n innerError?: unknown,\n details?: string,\n ): string {\n let result = `\\nMessage: ${message}`;\n if (details) {\n result += `\\nDetails: ${details}`;\n }\n if (innerError instanceof AptosApiError) {\n result += `\\nAptosApiError: ${innerError.message}`;\n } else if (innerError !== undefined) {\n result += `\\nError: ${getErrorMessage(innerError)}`;\n }\n result += `\\nKeylessErrorResolutionTip: ${tip}`;\n return result;\n }\n\n /**\n * Static constructor that creates a KeylessError instance using the KeylessErrors constant\n * @param args.type The type of KeylessError\n * @param args.aptosApiError optional AptosApiError supplied for api errors\n * @param args.details optional details to include in the error message\n * @returns A new KeylessError instance\n */\n static fromErrorType(args: { type: KeylessErrorType; error?: unknown; details?: string }): KeylessError {\n const { error, type, details } = args;\n\n const [message, category, resolutionTip] = KeylessErrors[type];\n return new KeylessError({\n message,\n details,\n innerError: error,\n category,\n resolutionTip,\n type,\n });\n }\n}\n\n/**\n * Options for handling errors in the Aptos API.\n */\ntype AptosApiErrorOpts = {\n apiType: AptosApiType;\n aptosRequest: AptosRequest;\n aptosResponse: AptosResponse<any, any>;\n};\n\n/**\n * Represents an error returned from the Aptos API.\n * This class encapsulates the details of the error, including the request URL, response status, and additional data.\n *\n * @param name - The name of the error, which is always \"AptosApiError\".\n * @param url - The URL to which the request was made.\n * @param status - The HTTP response status code (e.g., 400).\n * @param statusText - The message associated with the response status.\n * @param data - The response data returned from the API.\n * @param request - The original AptosRequest that triggered the error.\n */\nexport class AptosApiError extends Error {\n readonly url: string;\n\n readonly status: number;\n\n readonly statusText: string;\n\n readonly data: any;\n\n readonly request: AptosRequest;\n\n /**\n * Constructs an instance of AptosApiError with relevant error details.\n *\n * @param opts - The options for creating the AptosApiError.\n * @param opts.apiType - The type of API that generated the error.\n * @param opts.aptosRequest - The request object that caused the error.\n * @param opts.aptosResponse - The response object containing error details.\n *\n * @internal This constructor is for SDK internal use - do not instantiate outside the SDK codebase.\n */\n constructor({ apiType, aptosRequest, aptosResponse }: AptosApiErrorOpts) {\n super(deriveErrorMessage({ apiType, aptosRequest, aptosResponse }));\n\n this.name = \"AptosApiError\";\n this.url = aptosResponse.url;\n this.status = aptosResponse.status;\n this.statusText = aptosResponse.statusText;\n this.data = aptosResponse.data;\n this.request = aptosRequest;\n }\n}\n\n/**\n * Derives an error message from the Aptos API response, providing context for debugging.\n * This function helps in understanding the nature of the error encountered during an API request.\n *\n * @param {AptosApiErrorOpts} opts - The options for deriving the error message.\n * @param {AptosApiType} opts.apiType - The type of API being called.\n * @param {AptosRequest} opts.aptosRequest - The original request made to the Aptos API.\n * @param {AptosResponse} opts.aptosResponse - The response received from the Aptos API.\n */\nfunction deriveErrorMessage({ apiType, aptosRequest, aptosResponse }: AptosApiErrorOpts): string {\n // eslint-disable-next-line max-len\n // extract the W3C trace_id from the response headers if it exists. Some services set this in the response, and it's useful for debugging.\n // See https://www.w3.org/TR/trace-context/#relationship-between-the-headers .\n const traceId = aptosResponse.headers?.traceparent?.split(\"-\")[1];\n const traceIdString = traceId ? `(trace_id:${traceId}) ` : \"\";\n\n const errorPrelude: string = `Request to [${apiType}]: ${aptosRequest.method} ${\n aptosResponse.url ?? aptosRequest.url\n } ${traceIdString}failed with`;\n\n // handle graphql responses from indexer api and extract the error message of the first error\n if (apiType === AptosApiType.INDEXER && aptosResponse.data?.errors?.[0]?.message != null) {\n return `${errorPrelude}: ${aptosResponse.data.errors[0].message}`;\n }\n\n // Received well-known structured error response body - simply serialize and return it.\n // We don't need http status codes etc. in this case.\n if (aptosResponse.data?.message != null && aptosResponse.data?.error_code != null) {\n return `${errorPrelude}: ${JSON.stringify(aptosResponse.data)}`;\n }\n\n // This is the generic/catch-all case. We received some response from the API, but it doesn't appear to be a well-known structure.\n // We print http status codes and the response body (after some trimming),\n // in the hope that this gives enough context what went wrong without printing overly huge messages.\n return `${errorPrelude} status: ${aptosResponse.statusText}(code:${\n aptosResponse.status\n }) and response body: ${serializeAnyPayloadForErrorMessage(aptosResponse.data)}`;\n}\n\nconst SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH = 400;\n\n/**\n * This function accepts a payload of any type (probably an object) and serializes it to a string\n * Since we don't know the type or size of the payload, and we don't want to add a huge object in full to the error message\n * we limit the to the first 200 and last 200 characters of the serialized payload and put a \"...\" in the middle.\n * @param payload - The payload to serialize, which can be of any type.\n *\n * @returns A string representation of the serialized payload, potentially truncated.\n */\nfunction serializeAnyPayloadForErrorMessage(payload: any): string {\n const serializedPayload = JSON.stringify(payload);\n if (serializedPayload.length <= SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH) {\n return serializedPayload;\n }\n return `truncated(original_size:${serializedPayload.length}): ${serializedPayload.slice(\n 0,\n SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH / 2,\n )}...${serializedPayload.slice(-SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH / 2)}`;\n}\n"],"mappings":"yCAIO,IAAKA,OACVA,IAAA,yBACAA,IAAA,2CACAA,IAAA,qCACAA,IAAA,iCACAA,IAAA,qBALUA,OAAA,IAQAC,OACVA,EAAA,eAAiB,wDAEjBA,EAAA,sBAAwB,4HACxBA,EAAA,sBAAwB,4DAExBA,EAAA,oBAAsB,iPAEtBA,EAAA,aAAe,+IAEfA,EAAA,cAAgB,mJAChBA,EAAA,cAAgB,uFAChBA,EAAA,mBAAqB,wEACrBA,EAAA,QAAU,uFAbAA,OAAA,IAgBAC,OACVA,IAAA,2DAEAA,IAAA,qCAEAA,IAAA,uDAEAA,IAAA,yEAEAA,IAAA,uFAEAA,IAAA,qCAEAA,IAAA,yDAEAA,IAAA,mEAEAA,IAAA,qFAEAA,IAAA,2EAEAA,IAAA,8EAEAA,IAAA,oDAEAA,IAAA,0CAEAA,IAAA,wCAEAA,IAAA,4DAEAA,IAAA,8CAEAA,IAAA,kEAEAA,IAAA,4DAEAA,IAAA,gDAEAA,IAAA,kEAEAA,IAAA,4DAEAA,IAAA,gDAEAA,IAAA,kEAEAA,IAAA,sFAEAA,IAAA,8DAEAA,IAAA,sCAEAA,IAAA,sBArDUA,OAAA,IAwDNC,EAA0G,CAC7G,EAA8C,CAC7C,qCACA,EACA,uDACF,EACC,EAAmC,CAClC,yCACA,EACA,kJACF,EACC,EAA4C,CAC3C,sCACA,EACA,2HACF,EACC,EAAqD,CACpD,iCACA,EACA,2HACF,EACC,EAA4D,CAC3D,yDACA,EACA,uDACF,EACC,EAAmC,CAClC,iDACA,EACA,2HACF,EACC,EAA6C,CAC5C,4FACA,EACA,uDACF,EACC,EAAkD,CACjD,oCACA,EACA,2DACF,EACC,EAA2D,CAC1D,4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AYJ,EAAc,UAAU,SACxDA,EAAc,MAChB,wBAAwBK,EAAmCL,EAAc,IAAI,CAAC,EAChF,CAEA,IAAMM,EAAwC,IAU9C,SAASD,EAAmCE,EAAsB,CAChE,IAAMC,EAAoB,KAAK,UAAUD,CAAO,EAChD,OAAIC,EAAkB,QAAUF,EACvBE,EAEF,2BAA2BA,EAAkB,MAAM,MAAMA,EAAkB,MAChF,EACAF,EAAwC,CAC1C,CAAC,MAAME,EAAkB,MAAM,CAACF,EAAwC,CAAC,CAAC,EAC5E","names":["KeylessErrorCategory","KeylessErrorResolutionTip","KeylessErrorType","KeylessErrors","KeylessError","_KeylessError","args","innerError","category","resolutionTip","type","message","details","tip","result","AptosApiError","getErrorMessage","error","apiType","aptosRequest","aptosResponse","deriveErrorMessage","traceId","traceIdString","errorPrelude","serializeAnyPayloadForErrorMessage","SERIALIZED_PAYLOAD_TRIM_TO_MAX_LENGTH","payload","serializedPayload"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as g}from"./chunk-5WWU3WSU.mjs";import{c as u}from"./chunk-6VGLRQBT.mjs";import{b as d}from"./chunk-UOBDL2BZ.mjs";import{b as c}from"./chunk-LQOSHBB7.mjs";var l=class{constructor(t){this.signingScheme=1;let{signers:e,publicKey:r,address:a}=t;if(this.publicKey=r,this.accountAddress=a?c.from(a):this.publicKey.authKey().derivedAddress(),r.threshold>e.length)throw new Error(`Not enough signers provided to satisfy the required signatures. Need ${r.threshold} signers, but only ${e.length} provided`);if(r.threshold<e.length)throw new Error(`More signers provided than required. Need ${r.threshold} signers, but ${e.length} provided`);let n=[];for(let i of e)n.push(this.publicKey.getIndex(i.publicKey()));let s=e.map((i,o)=>[i,n[o]]);s.sort((i,o)=>i[1]-o[1]),this.signers=s.map(i=>i[0]),this.signerIndices=s.map(i=>i[1]),this.signaturesBitmap=this.publicKey.createBitmap({bits:n})}verifySignature(t){return this.publicKey.verifySignature(t)}signWithAuthenticator(t){return new u(this.publicKey,this.sign(t))}signTransactionWithAuthenticator(t){return new u(this.publicKey,this.signTransaction(t))}sign(t){let e=[];for(let r of this.signers)e.push(r.sign(t));return new d({signatures:e,bitmap:this.signaturesBitmap})}signTransaction(t){return this.sign(g(t))}};export{l as a};
|
|
2
|
-
//# sourceMappingURL=chunk-X5UJYMJU.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/account/MultiEd25519Account.ts"],"sourcesContent":["import { AccountAddress, AccountAddressInput } from \"../core/accountAddress\";\nimport { Ed25519PrivateKey } from \"../core/crypto\";\nimport { MultiEd25519PublicKey, MultiEd25519Signature } from \"../core/crypto/multiEd25519\";\nimport { AccountAuthenticatorMultiEd25519 } from \"../transactions/authenticator/account\";\nimport { generateSigningMessageForTransaction } from \"../transactions/transactionBuilder/signingMessage\";\nimport { AnyRawTransaction } from \"../transactions/types\";\nimport { HexInput, SigningScheme } from \"../types\";\nimport type { Account } from \"./Account\";\n\nexport interface MultiEd25519SignerConstructorArgs {\n publicKey: MultiEd25519PublicKey;\n signers: Ed25519PrivateKey[];\n address?: AccountAddressInput;\n}\n\nexport interface VerifyMultiEd25519SignatureArgs {\n message: HexInput;\n signature: MultiEd25519Signature;\n}\n\n/**\n * Signer implementation for the Multi-Ed25519 authentication scheme.\n *\n * Note: This authentication scheme is a legacy authentication scheme. Prefer using MultiKeyAccounts as a\n * MultiKeyAccount can support any type of signer, not just Ed25519. Generating a signer instance does not\n * create the account on-chain.\n */\nexport class MultiEd25519Account implements Account {\n readonly publicKey: MultiEd25519PublicKey;\n\n readonly accountAddress: AccountAddress;\n\n readonly signingScheme = SigningScheme.MultiEd25519;\n\n /**\n * The signers used to sign messages. These signers should correspond to public keys in the\n * MultiEd25519Account. The number of signers should be equal to this.publicKey.threshold.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly signers: Ed25519PrivateKey[];\n\n /**\n * An array of indices where for signer[i], signerIndicies[i] is the index of the corresponding public key in\n * publicKey.publicKeys. Used to derive the right public key to use for verification.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly signerIndices: number[];\n\n readonly signaturesBitmap: Uint8Array;\n\n // region Constructors\n\n constructor(args: MultiEd25519SignerConstructorArgs) {\n const { signers, publicKey, address } = args;\n this.publicKey = publicKey;\n this.accountAddress = address ? AccountAddress.from(address) : this.publicKey.authKey().derivedAddress();\n\n if (publicKey.threshold > signers.length) {\n throw new Error(\n // eslint-disable-next-line max-len\n `Not enough signers provided to satisfy the required signatures. Need ${publicKey.threshold} signers, but only ${signers.length} provided`,\n );\n } else if (publicKey.threshold < signers.length) {\n throw new Error(\n // eslint-disable-next-line max-len\n `More signers provided than required. Need ${publicKey.threshold} signers, but ${signers.length} provided`,\n );\n }\n\n // For each signer, find its corresponding position in the public keys array\n const bitPositions: number[] = [];\n for (const signer of signers) {\n bitPositions.push(this.publicKey.getIndex(signer.publicKey()));\n }\n\n // Create pairs of [signer, position] and sort them by position\n // This sorting is critical because:\n // 1. The on-chain verification expects signatures to be in ascending order by bit position\n // 2. The bitmap must match the order of signatures when verifying\n const signersAndBitPosition: [Ed25519PrivateKey, number][] = signers.map((signer, index) => [\n signer,\n bitPositions[index],\n ]);\n signersAndBitPosition.sort((a, b) => a[1] - b[1]);\n\n // Extract the sorted signers and their positions into separate arrays\n this.signers = signersAndBitPosition.map((value) => value[0]);\n this.signerIndices = signersAndBitPosition.map((value) => value[1]);\n\n // Create a bitmap representing which public keys from the MultiEd25519PublicKey are being used\n // This bitmap is used during signature verification to identify which public keys\n // should be used to verify each signature\n this.signaturesBitmap = this.publicKey.createBitmap({ bits: bitPositions });\n }\n\n // endregion\n\n // region Account\n\n /**\n * Verify the given message and signature with the public key.\n *\n * @param args.message raw message data in HexInput format\n * @param args.signature signed message Signature\n * @returns\n */\n verifySignature(args: VerifyMultiEd25519SignatureArgs): boolean {\n return this.publicKey.verifySignature(args);\n }\n\n /**\n * Sign a message using the account's Ed25519 private key.\n * @param message the signing message, as binary input\n * @return the AccountAuthenticator containing the signature, together with the account's public key\n */\n signWithAuthenticator(message: HexInput): AccountAuthenticatorMultiEd25519 {\n return new AccountAuthenticatorMultiEd25519(this.publicKey, this.sign(message));\n }\n\n /**\n * Sign a transaction using the account's Ed25519 private keys.\n * @param transaction the raw transaction\n * @return the AccountAuthenticator containing the signature of the transaction, together with the account's public key\n */\n signTransactionWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticatorMultiEd25519 {\n return new AccountAuthenticatorMultiEd25519(this.publicKey, this.signTransaction(transaction));\n }\n\n /**\n * Sign the given message using the account's Ed25519 private keys.\n * @param message in HexInput format\n * @returns MultiEd25519Signature\n */\n sign(message: HexInput): MultiEd25519Signature {\n const signatures = [];\n for (const signer of this.signers) {\n signatures.push(signer.sign(message));\n }\n return new MultiEd25519Signature({ signatures, bitmap: this.signaturesBitmap });\n }\n\n /**\n * Sign the given transaction using the available signing capabilities.\n * @param transaction the transaction to be signed\n * @returns Signature\n */\n signTransaction(transaction: AnyRawTransaction): MultiEd25519Signature {\n return this.sign(generateSigningMessageForTransaction(transaction));\n }\n\n // endregion\n}\n"],"mappings":"oKA2BO,IAAMA,EAAN,KAA6C,CA2BlD,YAAYC,EAAyC,CAtBrD,KAAS,cAAgB,EAuBvB,GAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,QAAAC,CAAQ,EAAIH,EAIxC,GAHA,KAAK,UAAYE,EACjB,KAAK,eAAiBC,EAAUC,EAAe,KAAKD,CAAO,EAAI,KAAK,UAAU,QAAQ,EAAE,eAAe,EAEnGD,EAAU,UAAYD,EAAQ,OAChC,MAAM,IAAI,MAER,wEAAwEC,EAAU,SAAS,sBAAsBD,EAAQ,MAAM,WACjI,EACK,GAAIC,EAAU,UAAYD,EAAQ,OACvC,MAAM,IAAI,MAER,6CAA6CC,EAAU,SAAS,iBAAiBD,EAAQ,MAAM,WACjG,EAIF,IAAMI,EAAyB,CAAC,EAChC,QAAWC,KAAUL,EACnBI,EAAa,KAAK,KAAK,UAAU,SAASC,EAAO,UAAU,CAAC,CAAC,EAO/D,IAAMC,EAAuDN,EAAQ,IAAI,CAACK,EAAQE,IAAU,CAC1FF,EACAD,EAAaG,CAAK,CACpB,CAAC,EACDD,EAAsB,KAAK,CAACE,EAAGC,IAAMD,EAAE,CAAC,EAAIC,EAAE,CAAC,CAAC,EAGhD,KAAK,QAAUH,EAAsB,IAAKI,GAAUA,EAAM,CAAC,CAAC,EAC5D,KAAK,cAAgBJ,EAAsB,IAAKI,GAAUA,EAAM,CAAC,CAAC,EAKlE,KAAK,iBAAmB,KAAK,UAAU,aAAa,CAAE,KAAMN,CAAa,CAAC,CAC5E,CAaA,gBAAgBL,EAAgD,CAC9D,OAAO,KAAK,UAAU,gBAAgBA,CAAI,CAC5C,CAOA,sBAAsBY,EAAqD,CACzE,OAAO,IAAIC,EAAiC,KAAK,UAAW,KAAK,KAAKD,CAAO,CAAC,CAChF,CAOA,iCAAiCE,EAAkE,CACjG,OAAO,IAAID,EAAiC,KAAK,UAAW,KAAK,gBAAgBC,CAAW,CAAC,CAC/F,CAOA,KAAKF,EAA0C,CAC7C,IAAMG,EAAa,CAAC,EACpB,QAAWT,KAAU,KAAK,QACxBS,EAAW,KAAKT,EAAO,KAAKM,CAAO,CAAC,EAEtC,OAAO,IAAII,EAAsB,CAAE,WAAAD,EAAY,OAAQ,KAAK,gBAAiB,CAAC,CAChF,CAOA,gBAAgBD,EAAuD,CACrE,OAAO,KAAK,KAAKG,EAAqCH,CAAW,CAAC,CACpE,CAGF","names":["MultiEd25519Account","args","signers","publicKey","address","AccountAddress","bitPositions","signer","signersAndBitPosition","index","a","b","value","message","AccountAuthenticatorMultiEd25519","transaction","signatures","MultiEd25519Signature","generateSigningMessageForTransaction"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as u,b}from"./chunk-6KI24ZRR.mjs";import{b as p}from"./chunk-H4YAL2IL.mjs";import{a as g}from"./chunk-A3VO773Q.mjs";import{a as m}from"./chunk-TTY5GFMN.mjs";function S(l){let e=l;return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>24}var h=class extends p{constructor(e){super(),this.publicKeys=e.publicKeys}createBitmap(e){let{bits:t}=e,r=128,i=new Uint8Array([0,0,0,0]),a=new Set;return t.forEach((n,o)=>{if(o+1>this.publicKeys.length)throw new Error(`Signature index ${o+1} is out of public keys range, ${this.publicKeys.length}.`);if(a.has(n))throw new Error(`Duplicate bit ${n} detected.`);a.add(n);let c=Math.floor(n/8),y=i[c];y|=r>>n%8,i[c]=y}),i}getIndex(e){let t=this.publicKeys.findIndex(r=>r.toString()===e.toString());if(t!==-1)return t;throw new Error(`Public key ${e} not found in multi key set ${this.publicKeys}`)}},f=class l extends h{constructor(e){let{publicKeys:t,signaturesRequired:r}=e;if(super({publicKeys:t}),r<1)throw new Error("The number of required signatures needs to be greater than 0");if(t.length<r)throw new Error(`Provided ${t.length} public keys is smaller than the ${r} required signatures`);this.publicKeys=t.map(i=>i instanceof u?i:new u(i)),this.signaturesRequired=r}verifySignature(e){throw new Error("not implemented")}authKey(){return m.fromSchemeAndBytes({scheme:3,input:this.toUint8Array()})}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let t=e.deserializeVector(u),r=e.deserializeU8();return new l({publicKeys:t,signaturesRequired:r})}getIndex(e){let t=e instanceof u?e:new u(e);return super.getIndex(t)}static isInstance(e){return"publicKeys"in e&&"signaturesRequired"in e}},s=class s extends g{constructor(e){super();let{signatures:t,bitmap:r}=e;if(t.length>s.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${s.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=t.map(a=>a instanceof b?a:new b(a)),!(r instanceof Uint8Array))this.bitmap=s.createBitmap({bits:r});else{if(r.length!==s.BITMAP_LEN)throw new Error(`"bitmap" length should be ${s.BITMAP_LEN}`);this.bitmap=r}let i=this.bitmap.reduce((a,n)=>a+S(n),0);if(i!==this.signatures.length)throw new Error(`Expecting ${i} signatures from the bitmap, but got ${this.signatures.length}`)}static createBitmap(e){let{bits:t}=e,r=128,i=new Uint8Array([0,0,0,0]),a=new Set;return t.forEach(n=>{if(n>=s.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${s.MAX_SIGNATURES_SUPPORTED-1}.`);if(a.has(n))throw new Error("Duplicate bits detected.");a.add(n);let o=Math.floor(n/8),c=i[o];c|=r>>n%8,i[o]=c}),i}serialize(e){e.serializeVector(this.signatures),e.serializeBytes(this.bitmap)}static deserialize(e){let t=e.deserializeVector(b),r=e.deserializeBytes();return new s({signatures:t,bitmap:r})}};s.BITMAP_LEN=4,s.MAX_SIGNATURES_SUPPORTED=s.BITMAP_LEN*8;var d=s;export{h as a,f as b,d as c};
|
|
2
|
-
//# sourceMappingURL=chunk-X6H4G6NE.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/crypto/multiKey.ts"],"sourcesContent":["import { SigningScheme as AuthenticationKeyScheme } from \"../../types\";\nimport { Deserializer } from \"../../bcs/deserializer\";\nimport { Serializer } from \"../../bcs/serializer\";\nimport { AuthenticationKey } from \"../authenticationKey\";\nimport { AccountPublicKey, PublicKey, VerifySignatureArgs } from \"./publicKey\";\nimport { Signature } from \"./signature\";\nimport { AnyPublicKey, AnySignature } from \"./singleKey\";\n\n/**\n * Counts the number of set bits (1s) in a byte.\n * This function can help you determine the population count of a given byte value.\n *\n * @param byte - The byte value for which to count the number of set bits.\n * @group Implementation\n * @category Serialization\n */\n/* eslint-disable no-bitwise */\nfunction bitCount(byte: number) {\n let n = byte;\n n -= (n >> 1) & 0x55555555;\n n = (n & 0x33333333) + ((n >> 2) & 0x33333333);\n return (((n + (n >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24;\n}\n/* eslint-enable no-bitwise */\n\nexport abstract class AbstractMultiKey extends AccountPublicKey {\n publicKeys: PublicKey[];\n\n constructor(args: { publicKeys: PublicKey[] }) {\n super();\n this.publicKeys = args.publicKeys;\n }\n\n /**\n * Create a bitmap that holds the mapping from the original public keys\n * to the signatures passed in\n *\n * @param args.bits array of the index mapping to the matching public keys\n * @returns Uint8array bit map\n * @group Implementation\n * @category Serialization\n */\n createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number, idx: number) => {\n if (idx + 1 > this.publicKeys.length) {\n throw new Error(`Signature index ${idx + 1} is out of public keys range, ${this.publicKeys.length}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(`Duplicate bit ${bit} detected.`);\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n /**\n * Get the index of the provided public key.\n *\n * This function retrieves the index of a specified public key within the MultiKey.\n * If the public key does not exist, it throws an error.\n *\n * @param publicKey - The public key to find the index for.\n * @returns The corresponding index of the public key, if it exists.\n * @throws Error - If the public key is not found in the MultiKey.\n * @group Implementation\n * @category Serialization\n */\n getIndex(publicKey: PublicKey): number {\n const index = this.publicKeys.findIndex((pk) => pk.toString() === publicKey.toString());\n\n if (index !== -1) {\n return index;\n }\n throw new Error(`Public key ${publicKey} not found in multi key set ${this.publicKeys}`);\n }\n}\n\n/**\n * Represents a multi-key authentication scheme for accounts, allowing multiple public keys\n * to be associated with a single account. This class enforces a minimum number of valid signatures\n * required to authorize actions, ensuring enhanced security for multi-agent accounts.\n *\n * The public keys of each individual agent can be any type of public key supported by Aptos.\n * Since [AIP-55](https://github.com/aptos-foundation/AIPs/pull/263), Aptos supports\n * `Legacy` and `Unified` authentication keys.\n * @group Implementation\n * @category Serialization\n */\nexport class MultiKey extends AbstractMultiKey {\n /**\n * List of any public keys\n * @group Implementation\n * @category Serialization\n */\n public readonly publicKeys: AnyPublicKey[];\n\n /**\n * The minimum number of valid signatures required, for the number of public keys specified\n * @group Implementation\n * @category Serialization\n */\n public readonly signaturesRequired: number;\n\n /**\n * Signature for a K-of-N multi-sig transaction.\n * This constructor initializes a multi-signature transaction with the provided signatures and bitmap.\n *\n * @param args An object containing the parameters for the multi-signature transaction.\n * @param args.signatures A list of signatures.\n * @param args.bitmap A bitmap represented as a Uint8Array or an array of numbers, where each bit indicates whether a\n * corresponding signature is present. A maximum of 32 signatures is supported, and the length of the bitmap must be 4 bytes.\n *\n * @throws Error if the number of signatures exceeds the maximum supported, if the bitmap length is incorrect, or if the number\n * of signatures does not match the bitmap.\n * @group Implementation\n * @category Serialization\n */\n // region Constructors\n constructor(args: { publicKeys: Array<PublicKey>; signaturesRequired: number }) {\n const { publicKeys, signaturesRequired } = args;\n super({ publicKeys });\n\n // Validate number of public keys is greater than signature required\n if (signaturesRequired < 1) {\n throw new Error(\"The number of required signatures needs to be greater than 0\");\n }\n\n // Validate number of public keys is greater than signature required\n if (publicKeys.length < signaturesRequired) {\n throw new Error(\n `Provided ${publicKeys.length} public keys is smaller than the ${signaturesRequired} required signatures`,\n );\n }\n\n // Make sure that all keys are normalized to the SingleKey authentication scheme\n this.publicKeys = publicKeys.map((publicKey) =>\n publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey),\n );\n\n this.signaturesRequired = signaturesRequired;\n }\n\n // endregion\n\n // region AccountPublicKey\n\n /**\n * Verifies the provided signature against the given message.\n * This function helps ensure the integrity and authenticity of the message by checking if the signature is valid.\n *\n * @param args - The arguments for verifying the 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 // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n verifySignature(args: VerifySignatureArgs): boolean {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Generates an authentication key based on the current instance's byte representation.\n * This key can be used for secure authentication processes within the system.\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.MultiKey,\n input: this.toUint8Array(),\n });\n }\n\n // endregion\n\n // region Serializable\n\n /**\n * Serializes the object by writing its signatures and bitmap to the provided serializer.\n * This allows the object to be converted 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.serializeVector(this.publicKeys);\n serializer.serializeU8(this.signaturesRequired);\n }\n\n /**\n * Deserializes a MultiKeySignature from the provided deserializer.\n * This function retrieves the signatures and bitmap necessary for creating a MultiKeySignature object.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n * @group Implementation\n * @category Serialization\n */\n static deserialize(deserializer: Deserializer): MultiKey {\n const keys = deserializer.deserializeVector(AnyPublicKey);\n const signaturesRequired = deserializer.deserializeU8();\n\n return new MultiKey({ publicKeys: keys, signaturesRequired });\n }\n\n // endregion\n\n /**\n * Get the index of the provided public key.\n *\n * This function retrieves the index of a specified public key within the MultiKey.\n * If the public key does not exist, it throws an error.\n *\n * @param publicKey - The public key to find the index for.\n * @returns The corresponding index of the public key, if it exists.\n * @throws Error - If the public key is not found in the MultiKey.\n * @group Implementation\n */\n getIndex(publicKey: PublicKey): number {\n const anyPublicKey = publicKey instanceof AnyPublicKey ? publicKey : new AnyPublicKey(publicKey);\n return super.getIndex(anyPublicKey);\n }\n\n public static isInstance(value: PublicKey): value is MultiKey {\n return \"publicKeys\" in value && \"signaturesRequired\" in value;\n }\n}\n\n/**\n * Represents a multi-signature transaction using Ed25519 signatures.\n * This class allows for the creation and management of a K-of-N multi-signature scheme,\n * where a specified number of signatures are required to authorize a transaction.\n *\n * It includes functionality to validate the number of signatures against a bitmap,\n * which indicates which public keys have signed the transaction.\n * @group Implementation\n * @category Serialization\n */\nexport class MultiKeySignature extends Signature {\n /**\n * Number of bytes in the bitmap representing who signed the transaction (32-bits)\n * @group Implementation\n * @category Serialization\n */\n static BITMAP_LEN: number = 4;\n\n /**\n * Maximum number of Ed25519 signatures supported\n * @group Implementation\n * @category Serialization\n */\n static MAX_SIGNATURES_SUPPORTED = MultiKeySignature.BITMAP_LEN * 8;\n\n /**\n * The list of underlying Ed25519 signatures\n * @group Implementation\n * @category Serialization\n */\n public readonly signatures: AnySignature[];\n\n /**\n * 32-bit Bitmap representing who signed the transaction\n *\n * This is represented where each public key can be masked to determine whether the message was signed by that key.\n * @group Implementation\n * @category Serialization\n */\n public readonly bitmap: Uint8Array;\n\n /**\n * Signature for a K-of-N multi-sig transaction.\n *\n * @see {@link\n * https://aptos.dev/integration/creating-a-signed-transaction/#multisignature-transactions | Creating a Signed Transaction}\n *\n * @param args.signatures A list of signatures\n * @param args.bitmap 4 bytes, at most 32 signatures are supported. If Nth bit value is `1`, the Nth\n * signature should be provided in `signatures`. Bits are read from left to right\n * @group Implementation\n * @category Serialization\n */\n constructor(args: { signatures: Array<Signature | AnySignature>; bitmap: Uint8Array | number[] }) {\n super();\n const { signatures, bitmap } = args;\n\n if (signatures.length > MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`The number of signatures cannot be greater than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED}`);\n }\n\n // Make sure that all signatures are normalized to the SingleKey authentication scheme\n this.signatures = signatures.map((signature) =>\n signature instanceof AnySignature ? signature : new AnySignature(signature),\n );\n\n if (!(bitmap instanceof Uint8Array)) {\n this.bitmap = MultiKeySignature.createBitmap({ bits: bitmap });\n } else if (bitmap.length !== MultiKeySignature.BITMAP_LEN) {\n throw new Error(`\"bitmap\" length should be ${MultiKeySignature.BITMAP_LEN}`);\n } else {\n this.bitmap = bitmap;\n }\n\n const nSignatures = this.bitmap.reduce((acc, byte) => acc + bitCount(byte), 0);\n if (nSignatures !== this.signatures.length) {\n throw new Error(`Expecting ${nSignatures} signatures from the bitmap, but got ${this.signatures.length}`);\n }\n }\n\n /**\n * Helper method to create a bitmap out of the specified bit positions\n * @param args.bits The bitmap positions that should be set. A position starts at index 0.\n * Valid position should range between 0 and 31.\n * @example\n * Here's an example of valid `bits`\n * ```\n * [0, 2, 31]\n * ```\n * `[0, 2, 31]` means the 1st, 3rd and 32nd bits should be set in the bitmap.\n * The result bitmap should be 0b1010000000000000000000000000001\n *\n * @returns bitmap that is 32bit long\n * @group Implementation\n * @category Serialization\n */\n static createBitmap(args: { bits: number[] }): Uint8Array {\n const { bits } = args;\n // Bits are read from left to right. e.g. 0b10000000 represents the first bit is set in one byte.\n // The decimal value of 0b10000000 is 128.\n const firstBitInByte = 128;\n const bitmap = new Uint8Array([0, 0, 0, 0]);\n\n // Check if duplicates exist in bits\n const dupCheckSet = new Set();\n\n bits.forEach((bit: number) => {\n if (bit >= MultiKeySignature.MAX_SIGNATURES_SUPPORTED) {\n throw new Error(`Cannot have a signature larger than ${MultiKeySignature.MAX_SIGNATURES_SUPPORTED - 1}.`);\n }\n\n if (dupCheckSet.has(bit)) {\n throw new Error(\"Duplicate bits detected.\");\n }\n\n dupCheckSet.add(bit);\n\n const byteOffset = Math.floor(bit / 8);\n\n let byte = bitmap[byteOffset];\n\n // eslint-disable-next-line no-bitwise\n byte |= firstBitInByte >> bit % 8;\n\n bitmap[byteOffset] = byte;\n });\n\n return bitmap;\n }\n\n // region Serializable\n\n serialize(serializer: Serializer): void {\n // Note: we should not need to serialize the vector length, as it can be derived from the bitmap\n serializer.serializeVector(this.signatures);\n serializer.serializeBytes(this.bitmap);\n }\n\n static deserialize(deserializer: Deserializer): MultiKeySignature {\n const signatures = deserializer.deserializeVector(AnySignature);\n const bitmap = deserializer.deserializeBytes();\n return new MultiKeySignature({ signatures, bitmap });\n }\n\n // endregion\n}\n"],"mappings":"sKAi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bstractMultiKey","AccountPublicKey","args","bits","firstBitInByte","bitmap","dupCheckSet","bit","idx","byteOffset","publicKey","index","pk","MultiKey","_MultiKey","publicKeys","signaturesRequired","AnyPublicKey","AuthenticationKey","serializer","deserializer","keys","anyPublicKey","value","_MultiKeySignature","Signature","signatures","signature","AnySignature","nSignatures","acc","MultiKeySignature"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as i}from"./chunk-6VGLRQBT.mjs";import{a as g,b}from"./chunk-UOBDL2BZ.mjs";import{b as y,d as p}from"./chunk-7OUPEQRN.mjs";import{b as c}from"./chunk-LQOSHBB7.mjs";import{a as h}from"./chunk-RXHER6EA.mjs";var n=class extends h{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return o.load(e);case 1:return d.load(e);case 2:return u.load(e);case 3:return l.load(e);case 4:return A.load(e);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${t}`)}}isEd25519(){return this instanceof o}isMultiEd25519(){return this instanceof d}isMultiAgent(){return this instanceof u}isFeePayer(){return this instanceof l}isSingleSender(){return this instanceof A}},o=class r extends n{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let t=y.deserialize(e),s=p.deserialize(e);return new r(t,s)}},d=class r extends n{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let t=g.deserialize(e),s=b.deserialize(e);return new r(t,s)}},u=class r extends n{constructor(e,t,s){super(),this.sender=e,this.secondary_signer_addresses=t,this.secondary_signers=s}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let t=i.deserialize(e),s=e.deserializeVector(c),a=e.deserializeVector(i);return new r(t,s,a)}},l=class r extends n{constructor(e,t,s,a){super(),this.sender=e,this.secondary_signer_addresses=t,this.secondary_signers=s,this.fee_payer=a}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let t=i.deserialize(e),s=e.deserializeVector(c),a=e.deserializeVector(i),_=c.deserialize(e),z=i.deserialize(e),S={address:_,authenticator:z};return new r(t,s,a,S)}},A=class r extends n{constructor(e){super(),this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let t=i.deserialize(e);return new r(t)}};export{n as a,o as b,d as c,u as d,l as e,A as f};
|
|
2
|
-
//# sourceMappingURL=chunk-XFL3B4WZ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/transactions/authenticator/transaction.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/* eslint-disable @typescript-eslint/naming-convention */\n\nimport { AccountAuthenticator } from \"./account\";\nimport { Deserializer, Serializable, Serializer } from \"../../bcs\";\nimport { AccountAddress } from \"../../core\";\nimport { Ed25519PublicKey, Ed25519Signature } from \"../../core/crypto/ed25519\";\nimport { MultiEd25519PublicKey, MultiEd25519Signature } from \"../../core/crypto/multiEd25519\";\nimport { TransactionAuthenticatorVariant } from \"../../types\";\n\n/**\n * Represents an abstract base class for transaction authenticators.\n * This class provides methods for serializing and deserializing different types of transaction authenticators.\n *\n * @extends Serializable\n * @group Implementation\n * @category Transactions\n */\nexport abstract class TransactionAuthenticator extends Serializable {\n abstract serialize(serializer: Serializer): void;\n\n /**\n * Deserializes a TransactionAuthenticator from the provided deserializer.\n * This function helps in reconstructing the TransactionAuthenticator based on the variant index found in the serialized data.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n * @group Implementation\n * @category Transactions\n */\n static deserialize(deserializer: Deserializer): TransactionAuthenticator {\n const index = deserializer.deserializeUleb128AsU32();\n switch (index) {\n case TransactionAuthenticatorVariant.Ed25519:\n return TransactionAuthenticatorEd25519.load(deserializer);\n case TransactionAuthenticatorVariant.MultiEd25519:\n return TransactionAuthenticatorMultiEd25519.load(deserializer);\n case TransactionAuthenticatorVariant.MultiAgent:\n return TransactionAuthenticatorMultiAgent.load(deserializer);\n case TransactionAuthenticatorVariant.FeePayer:\n return TransactionAuthenticatorFeePayer.load(deserializer);\n case TransactionAuthenticatorVariant.SingleSender:\n return TransactionAuthenticatorSingleSender.load(deserializer);\n default:\n throw new Error(`Unknown variant index for TransactionAuthenticator: ${index}`);\n }\n }\n\n isEd25519(): this is TransactionAuthenticatorEd25519 {\n return this instanceof TransactionAuthenticatorEd25519;\n }\n\n isMultiEd25519(): this is TransactionAuthenticatorMultiEd25519 {\n return this instanceof TransactionAuthenticatorMultiEd25519;\n }\n\n isMultiAgent(): this is TransactionAuthenticatorMultiAgent {\n return this instanceof TransactionAuthenticatorMultiAgent;\n }\n\n isFeePayer(): this is TransactionAuthenticatorFeePayer {\n return this instanceof TransactionAuthenticatorFeePayer;\n }\n\n isSingleSender(): this is TransactionAuthenticatorSingleSender {\n return this instanceof TransactionAuthenticatorSingleSender;\n }\n}\n\n/**\n * Represents a transaction authenticator using Ed25519 for a single signer transaction.\n * This class encapsulates the client's public key and the Ed25519 signature of a raw transaction.\n *\n * @param public_key - The client's public key.\n * @param signature - The Ed25519 signature of a raw transaction.\n * @see {@link https://aptos.dev/integration/creating-a-signed-transaction | Creating a Signed Transaction}\n * for details about generating a signature.\n * @group Implementation\n * @category Transactions\n */\nexport class TransactionAuthenticatorEd25519 extends TransactionAuthenticator {\n public readonly public_key: Ed25519PublicKey;\n\n public readonly signature: Ed25519Signature;\n\n /**\n * Creates an instance of the class with the specified account authenticator.\n *\n * @param public_key - The Ed25519PublicKey that will be used for authentication.\n * @param signature - The Ed25519Signature that will be used for authentication.\n * @group Implementation\n * @category Transactions\n */\n constructor(public_key: Ed25519PublicKey, signature: Ed25519Signature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\n\n /**\n * Serializes the transaction authenticator by encoding the sender information.\n *\n * @param serializer - The serializer instance used to perform the serialization.\n * @group Implementation\n * @category Transactions\n */\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionAuthenticatorVariant.Ed25519);\n this.public_key.serialize(serializer);\n this.signature.serialize(serializer);\n }\n\n /**\n * Loads a TransactionAuthenticatorSingleSender instance from the provided deserializer.\n * This function helps in deserializing the sender information to create a transaction authenticator.\n *\n * @param deserializer - The deserializer used to extract the sender data.\n * @group Implementation\n * @category Transactions\n */\n static load(deserializer: Deserializer): TransactionAuthenticatorEd25519 {\n const public_key = Ed25519PublicKey.deserialize(deserializer);\n const signature = Ed25519Signature.deserialize(deserializer);\n return new TransactionAuthenticatorEd25519(public_key, signature);\n }\n}\n\n/**\n * Represents a transaction authenticator for multi-signature transactions using Ed25519.\n * This class is used to validate transactions that require multiple signatures from different signers.\n *\n * @param public_key - The public key of the client involved in the transaction.\n * @param signature - The multi-signature of the raw transaction.\n * @group Implementation\n * @category Transactions\n */\nexport class TransactionAuthenticatorMultiEd25519 extends TransactionAuthenticator {\n public readonly public_key: MultiEd25519PublicKey;\n\n public readonly signature: MultiEd25519Signature;\n\n constructor(public_key: MultiEd25519PublicKey, signature: MultiEd25519Signature) {\n super();\n this.public_key = public_key;\n this.signature = signature;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionAuthenticatorVariant.MultiEd25519);\n this.public_key.serialize(serializer);\n this.signature.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TransactionAuthenticatorMultiEd25519 {\n const public_key = MultiEd25519PublicKey.deserialize(deserializer);\n const signature = MultiEd25519Signature.deserialize(deserializer);\n return new TransactionAuthenticatorMultiEd25519(public_key, signature);\n }\n}\n\n/**\n * Represents a transaction authenticator for a multi-agent transaction.\n *\n * This class manages the authentication process involving a primary sender and multiple secondary signers.\n *\n * @param sender - The authenticator for the sender account.\n * @param secondary_signer_addresses - An array of addresses for the secondary signers.\n * @param secondary_signers - An array of authenticators for the secondary signer accounts.\n * @group Implementation\n * @category Transactions\n */\nexport class TransactionAuthenticatorMultiAgent extends TransactionAuthenticator {\n public readonly sender: AccountAuthenticator;\n\n public readonly secondary_signer_addresses: Array<AccountAddress>;\n\n public readonly secondary_signers: Array<AccountAuthenticator>;\n\n constructor(\n sender: AccountAuthenticator,\n secondary_signer_addresses: Array<AccountAddress>,\n secondary_signers: Array<AccountAuthenticator>,\n ) {\n super();\n this.sender = sender;\n this.secondary_signer_addresses = secondary_signer_addresses;\n this.secondary_signers = secondary_signers;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionAuthenticatorVariant.MultiAgent);\n this.sender.serialize(serializer);\n serializer.serializeVector<AccountAddress>(this.secondary_signer_addresses);\n serializer.serializeVector<AccountAuthenticator>(this.secondary_signers);\n }\n\n static load(deserializer: Deserializer): TransactionAuthenticatorMultiAgent {\n const sender = AccountAuthenticator.deserialize(deserializer);\n const secondary_signer_addresses = deserializer.deserializeVector(AccountAddress);\n const secondary_signers = deserializer.deserializeVector(AccountAuthenticator);\n return new TransactionAuthenticatorMultiAgent(sender, secondary_signer_addresses, secondary_signers);\n }\n}\n\n/**\n * Represents a transaction authenticator specifically for fee payer transactions.\n * It encapsulates the sender's account authenticator, addresses of secondary signers,\n * their respective authenticators, and the fee payer's account information.\n *\n * @param sender - The authenticator for the sender's account.\n * @param secondary_signer_addresses - An array of addresses for secondary signers.\n * @param secondary_signers - An array of authenticators for secondary signers' accounts.\n * @param fee_payer - An object containing the fee payer's account address and authenticator.\n * @group Implementation\n * @category Transactions\n */\nexport class TransactionAuthenticatorFeePayer extends TransactionAuthenticator {\n public readonly sender: AccountAuthenticator;\n\n public readonly secondary_signer_addresses: Array<AccountAddress>;\n\n public readonly secondary_signers: Array<AccountAuthenticator>;\n\n public readonly fee_payer: {\n address: AccountAddress;\n authenticator: AccountAuthenticator;\n };\n\n constructor(\n sender: AccountAuthenticator,\n secondary_signer_addresses: Array<AccountAddress>,\n secondary_signers: Array<AccountAuthenticator>,\n fee_payer: { address: AccountAddress; authenticator: AccountAuthenticator },\n ) {\n super();\n this.sender = sender;\n this.secondary_signer_addresses = secondary_signer_addresses;\n this.secondary_signers = secondary_signers;\n this.fee_payer = fee_payer;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionAuthenticatorVariant.FeePayer);\n this.sender.serialize(serializer);\n serializer.serializeVector<AccountAddress>(this.secondary_signer_addresses);\n serializer.serializeVector<AccountAuthenticator>(this.secondary_signers);\n this.fee_payer.address.serialize(serializer);\n this.fee_payer.authenticator.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TransactionAuthenticatorMultiAgent {\n const sender = AccountAuthenticator.deserialize(deserializer);\n const secondary_signer_addresses = deserializer.deserializeVector(AccountAddress);\n const secondary_signers = deserializer.deserializeVector(AccountAuthenticator);\n const address = AccountAddress.deserialize(deserializer);\n const authenticator = AccountAuthenticator.deserialize(deserializer);\n const fee_payer = { address, authenticator };\n return new TransactionAuthenticatorFeePayer(sender, secondary_signer_addresses, secondary_signers, fee_payer);\n }\n}\n\n/**\n * Represents a single sender authenticator for transactions that require a single signer.\n * This class is responsible for managing the authentication of a transaction initiated by a single sender.\n *\n * @param sender - An instance of AccountAuthenticator that represents the account of the sender.\n * @group Implementation\n * @category Transactions\n */\nexport class TransactionAuthenticatorSingleSender extends TransactionAuthenticator {\n public readonly sender: AccountAuthenticator;\n\n constructor(sender: AccountAuthenticator) {\n super();\n this.sender = sender;\n }\n\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(TransactionAuthenticatorVariant.SingleSender);\n this.sender.serialize(serializer);\n }\n\n static load(deserializer: Deserializer): TransactionAuthenticatorSingleSender {\n const sender = AccountAuthenticator.deserialize(deserializer);\n return new TransactionAuthenticatorSingleSender(sender);\n }\n}\n"],"mappings":"sNAoBO,IAAeA,EAAf,cAAgDC,CAAa,CAWlE,OAAO,YAA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EAC7DuB,EAAY,CAAE,QAAAC,EAAS,cAAAC,CAAc,EAC3C,OAAO,IAAIH,EAAiCL,EAAQC,EAA4BC,EAAmBI,CAAS,CAC9G,CACF,EAUajB,EAAN,MAAMoB,UAA6C5B,CAAyB,CAGjF,YAAYmB,EAA8B,CACxC,MAAM,EACN,KAAK,OAASA,CAChB,CAEA,UAAUP,EAA8B,CACtCA,EAAW,uBAAkE,EAC7E,KAAK,OAAO,UAAUA,CAAU,CAClC,CAEA,OAAO,KAAKV,EAAkE,CAC5E,IAAMiB,EAASG,EAAqB,YAAYpB,CAAY,EAC5D,OAAO,IAAI0B,EAAqCT,CAAM,CACxD,CACF","names":["TransactionAuthenticator","Serializable","deserializer","index","TransactionAuthenticatorEd25519","TransactionAuthenticatorMultiEd25519","TransactionAuthenticatorMultiAgent","TransactionAuthenticatorFeePayer","TransactionAuthenticatorSingleSender","_TransactionAuthenticatorEd25519","public_key","signature","serializer","Ed25519PublicKey","Ed25519Signature","_TransactionAuthenticatorMultiEd25519","MultiEd25519PublicKey","MultiEd25519Signature","_TransactionAuthenticatorMultiAgent","sender","secondary_signer_addresses","secondary_signers","AccountAuthenticator","AccountAddress","_TransactionAuthenticatorFeePayer","fee_payer","address","authenticator","_TransactionAuthenticatorSingleSender"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{g as e}from"./chunk-ZOY6N6UM.mjs";import{f as c}from"./chunk-2P27DDVV.mjs";import{d as r}from"./chunk-RJ7F4JDV.mjs";import{b as s}from"./chunk-LQOSHBB7.mjs";async function x(a){let{aptosConfig:t,accountAddress:i,amount:p,options:n}=a,u=n?.timeoutSecs||20,{data:d}=await c({aptosConfig:t,path:"fund",body:{address:s.from(i).toString(),amount:p},originMethod:"fundAccount"}),m=d.txn_hashes[0],o=await e({aptosConfig:t,transactionHash:m,options:{timeoutSecs:u,checkSuccess:n?.checkSuccess}});if(o.type==="user_transaction")return o;throw new Error(`Unexpected transaction received for fund account: ${o.type}`)}export{x as a};
|
|
2
|
-
//# sourceMappingURL=chunk-XX4SFNZY.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/internal/faucet.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This file contains the underlying implementations for exposed API surface in\n * the {@link api/faucet}. By moving the methods out into a separate file,\n * other namespaces and processes can access these methods without depending on the entire\n * faucet namespace and without having a dependency cycle error.\n * @group Implementation\n */\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { postAptosFaucet } from \"../client\";\nimport { AccountAddress, AccountAddressInput } from \"../core\";\nimport { TransactionResponseType, UserTransactionResponse, WaitForTransactionOptions } from \"../types\";\nimport { DEFAULT_TXN_TIMEOUT_SEC } from \"../utils/const\";\nimport { waitForTransaction } from \"./transaction\";\n\n/**\n * Funds an account with a specified amount of tokens from the Aptos faucet.\n * This function is useful for quickly providing a new or existing account with tokens to facilitate transactions.\n *\n * Note that only devnet has a publicly accessible faucet. For testnet, you must use\n * the minting page at https://aptos.dev/network/faucet.\n *\n * @param args - The arguments for funding the account.\n * @param args.aptosConfig - The configuration settings for connecting to the Aptos network.\n * @param args.accountAddress - The address of the account to be funded.\n * @param args.amount - The amount of tokens to fund the account with.\n * @param args.options - Optional parameters for the transaction.\n * @param args.options.timeoutSecs - The maximum time to wait for the transaction to complete, in seconds.\n * @param args.options.checkSuccess - A flag indicating whether to check if the transaction was successful.\n *\n * @throws Error if the transaction does not return a user transaction type.\n * @group Implementation\n */\nexport async function fundAccount(args: {\n aptosConfig: AptosConfig;\n accountAddress: AccountAddressInput;\n amount: number;\n options?: WaitForTransactionOptions;\n}): Promise<UserTransactionResponse> {\n const { aptosConfig, accountAddress, amount, options } = args;\n const timeout = options?.timeoutSecs || DEFAULT_TXN_TIMEOUT_SEC;\n const { data } = await postAptosFaucet<any, { txn_hashes: Array<string> }>({\n aptosConfig,\n path: \"fund\",\n body: {\n address: AccountAddress.from(accountAddress).toString(),\n amount,\n },\n originMethod: \"fundAccount\",\n });\n\n const txnHash = data.txn_hashes[0];\n\n const res = await waitForTransaction({\n aptosConfig,\n transactionHash: txnHash,\n options: {\n timeoutSecs: timeout,\n checkSuccess: options?.checkSuccess,\n },\n });\n\n // Response is always User transaction for a user submitted transaction\n if (res.type === TransactionResponseType.User) {\n return res;\n }\n\n throw new Error(`Unexpected transaction received for fund account: ${res.type}`);\n}\n"],"mappings":"oKAoCA,eAAsBA,EAAYC,EAKG,CACnC,GAAM,CAAE,YAAAC,EAAa,eAAAC,EAAgB,OAAAC,EAAQ,QAAAC,CAAQ,EAAIJ,EACnDK,EAAUD,GAAS,aAAe,GAClC,CAAE,KAAAE,CAAK,EAAI,MAAMC,EAAoD,CACzE,YAAAN,EACA,KAAM,OACN,KAAM,CACJ,QAASO,EAAe,KAAKN,CAAc,EAAE,SAAS,EACtD,OAAAC,CACF,EACA,aAAc,aAChB,CAAC,EAEKM,EAAUH,EAAK,WAAW,CAAC,EAE3BI,EAAM,MAAMC,EAAmB,CACnC,YAAAV,EACA,gBAAiBQ,EACjB,QAAS,CACP,YAAaJ,EACb,aAAcD,GAAS,YACzB,CACF,CAAC,EAGD,GAAIM,EAAI,OAAS,mBACf,OAAOA,EAGT,MAAM,IAAI,MAAM,qDAAqDA,EAAI,IAAI,EAAE,CACjF","names":["fundAccount","args","aptosConfig","accountAddress","amount","options","timeout","data","postAptosFaucet","AccountAddress","txnHash","res","waitForTransaction"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as O,b as _}from"./chunk-5WWU3WSU.mjs";import{d as A}from"./chunk-6VGLRQBT.mjs";import{a as R}from"./chunk-6IULVNLQ.mjs";import{a as u,b as w}from"./chunk-6KI24ZRR.mjs";import{a as I}from"./chunk-553ZRNUL.mjs";import{i as b,j as T,k as x,n as P,q as v,s as k}from"./chunk-SZU5Q6CF.mjs";import{d as r}from"./chunk-X5ORWYVO.mjs";import{e as F}from"./chunk-CU6HQJSE.mjs";import{b as g}from"./chunk-LQOSHBB7.mjs";import{a as m}from"./chunk-RXHER6EA.mjs";import{b as y}from"./chunk-VHY6ZATX.mjs";import D from"eventemitter3";import{jwtDecode as W}from"jwt-decode";function ne(f){return f!=null&&typeof f.checkKeylessAccountValidity=="function"}var p=class p extends m{constructor(e){super();this.signingScheme=2;let{address:i,ephemeralKeyPair:t,publicKey:o,uidKey:l,uidVal:n,aud:c,pepper:s,proof:a,proofFetchCallback:h,jwt:d,verificationKeyHash:K}=e;if(this.ephemeralKeyPair=t,this.publicKey=o,this.accountAddress=i?g.from(i):this.publicKey.authKey().derivedAddress(),this.uidKey=l,this.uidVal=n,this.aud=c,this.jwt=d,this.emitter=new D,this.proofOrPromise=a,a instanceof P)this.proof=a;else{if(h===void 0)throw new Error("Must provide callback for async proof fetch");this.emitter.on("proofFetchFinish",async C=>{await h(C),this.emitter.removeAllListeners()}),this.init(a)}let S=y.fromHexInput(s).toUint8Array();if(S.length!==p.PEPPER_LENGTH)throw new Error(`Pepper length in bytes should be ${p.PEPPER_LENGTH}`);if(this.pepper=S,K!==void 0){if(y.hexInputToUint8Array(K).length!==32)throw new Error("verificationKeyHash must be 32 bytes");this.verificationKeyHash=y.hexInputToUint8Array(K)}}getAnyPublicKey(){return new u(this.publicKey)}async init(e){try{this.proof=await e,this.emitter.emit("proofFetchFinish",{status:"Success"})}catch(i){i instanceof Error?this.emitter.emit("proofFetchFinish",{status:"Failed",error:i.toString()}):this.emitter.emit("proofFetchFinish",{status:"Failed",error:"Unknown"})}}serialize(e){if(this.accountAddress.serialize(e),e.serializeStr(this.jwt),e.serializeStr(this.uidKey),e.serializeFixedBytes(this.pepper),this.ephemeralKeyPair.serialize(e),this.proof===void 0)throw new Error("Cannot serialize - proof undefined");this.proof.serialize(e),e.serializeOption(this.verificationKeyHash,32)}static partialDeserialize(e){let i=g.deserialize(e),t=e.deserializeStr(),o=e.deserializeStr(),l=e.deserializeFixedBytes(31),n=R.deserialize(e),c=P.deserialize(e),s=e.deserializeOption("fixedBytes",32);return{address:i,jwt:t,uidKey:o,pepper:l,ephemeralKeyPair:n,proof:c,verificationKeyHash:s}}isExpired(){return this.ephemeralKeyPair.isExpired()}signWithAuthenticator(e){let i=new w(this.sign(e)),t=new u(this.publicKey);return new A(t,i)}signTransactionWithAuthenticator(e){let i=new w(this.signTransaction(e)),t=new u(this.publicKey);return new A(t,i)}async waitForProofFetch(){this.proofOrPromise instanceof Promise&&await this.proofOrPromise}async checkKeylessAccountValidity(e){if(this.isExpired())throw r.fromErrorType({type:0});if(await this.waitForProofFetch(),this.proof===void 0)throw r.fromErrorType({type:2});let i=W(this.jwt,{header:!0});if(i.kid===void 0)throw r.fromErrorType({type:12,details:"checkKeylessAccountValidity failed. JWT is missing 'kid' in header. This should never happen."});if(this.verificationKeyHash!==void 0){let{verificationKey:t}=await v({aptosConfig:e});if(y.hexInputToString(t.hash())!==y.hexInputToString(this.verificationKeyHash))throw r.fromErrorType({type:4})}else console.warn("[Aptos SDK] The verification key hash was not set. Proof may be invalid if the verification key has rotated.");await p.fetchJWK({aptosConfig:e,publicKey:this.publicKey,kid:i.kid})}sign(e){let{expiryDateSecs:i}=this.ephemeralKeyPair;if(this.isExpired())throw r.fromErrorType({type:0});if(this.proof===void 0)throw r.fromErrorType({type:1,details:"Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing."});let t=this.ephemeralKeyPair.getPublicKey(),o=this.ephemeralKeyPair.sign(e);return new T({jwtHeader:F(this.jwt.split(".")[0]),ephemeralCertificate:new x(this.proof,0),expiryDateSecs:i,ephemeralPublicKey:t,ephemeralSignature:o})}signTransaction(e){if(this.proof===void 0)throw r.fromErrorType({type:1,details:"Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing."});let i=O(e),o=new E(i,this.proof.proof).hash();return this.sign(o)}verifySignature(e){let{message:i,signature:t}=e;return!(this.isExpired()||!this.ephemeralKeyPair.getPublicKey().verifySignature({message:i,signature:t.ephemeralSignature}))}static async fetchJWK(e){let{aptosConfig:i,publicKey:t,kid:o}=e,l=t instanceof b?t:t.keylessPublicKey,{iss:n}=l,c,s=t instanceof I?t.jwkAddress:void 0;try{c=await k({aptosConfig:i,jwkAddr:s})}catch(d){throw r.fromErrorType({type:24,error:d,details:`Failed to fetch ${s?"Federated":"Patched"}JWKs ${s?`for address ${s}`:"0x1"}`})}let a=c.get(n);if(a===void 0)throw r.fromErrorType({type:7,details:`JWKs for issuer ${n} not found.`});let h=a.find(d=>d.kid===o);if(h===void 0)throw r.fromErrorType({type:6,details:`JWK with kid '${o}' for issuer '${n}' not found.`});return h}};p.PEPPER_LENGTH=31;var H=p,E=class extends m{constructor(e,i){super();this.domainSeparator="APTOS::TransactionAndProof";this.transaction=e,this.proof=i}serialize(e){e.serializeFixedBytes(this.transaction.bcsToBytes()),e.serializeOption(this.proof)}hash(){return _(this.bcsToBytes(),this.domainSeparator)}};export{ne as a,H as b,E as c};
|
|
2
|
-
//# sourceMappingURL=chunk-YMXJ6GYE.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/account/AbstractKeylessAccount.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport EventEmitter from \"eventemitter3\";\nimport { jwtDecode } from \"jwt-decode\";\nimport { EphemeralCertificateVariant, HexInput, SigningScheme } from \"../types\";\nimport { AccountAddress } from \"../core/accountAddress\";\nimport {\n AnyPublicKey,\n AnySignature,\n KeylessPublicKey,\n KeylessSignature,\n EphemeralCertificate,\n ZeroKnowledgeSig,\n ZkProof,\n getKeylessJWKs,\n MoveJWK,\n getKeylessConfig,\n} from \"../core/crypto\";\n\nimport { EphemeralKeyPair } from \"./EphemeralKeyPair\";\nimport { Hex } from \"../core/hex\";\nimport { AccountAuthenticatorSingleKey } from \"../transactions/authenticator/account\";\nimport { Deserializer, Serializable, Serializer } from \"../bcs\";\nimport { deriveTransactionType, generateSigningMessage } from \"../transactions/transactionBuilder/signingMessage\";\nimport { AnyRawTransaction, AnyRawTransactionInstance } from \"../transactions/types\";\nimport { base64UrlDecode } from \"../utils/helpers\";\nimport { FederatedKeylessPublicKey } from \"../core/crypto/federatedKeyless\";\nimport { Account } from \"./Account\";\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { KeylessError, KeylessErrorType } from \"../errors\";\nimport type { SingleKeySigner } from \"./SingleKeyAccount\";\n\n/**\n * An interface which defines if an Account utilizes Keyless signing.\n */\nexport interface KeylessSigner extends Account {\n checkKeylessAccountValidity(aptosConfig: AptosConfig): Promise<void>;\n}\n\nexport function isKeylessSigner(obj: any): obj is KeylessSigner {\n return obj !== null && obj !== undefined && typeof obj.checkKeylessAccountValidity === \"function\";\n}\n\n/**\n * Account implementation for the Keyless authentication scheme. This abstract class is used for standard Keyless Accounts\n * and Federated Keyless Accounts.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport abstract class AbstractKeylessAccount extends Serializable implements KeylessSigner, SingleKeySigner {\n static readonly PEPPER_LENGTH: number = 31;\n\n /**\n * The KeylessPublicKey associated with the account\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly publicKey: KeylessPublicKey | FederatedKeylessPublicKey;\n\n /**\n * The EphemeralKeyPair used to generate sign.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly ephemeralKeyPair: EphemeralKeyPair;\n\n /**\n * The claim on the JWT to identify a user. This is typically 'sub' or 'email'.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly uidKey: string;\n\n /**\n * The value of the uidKey claim on the JWT. This intended to be a stable user identifier.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly uidVal: string;\n\n /**\n * The value of the 'aud' claim on the JWT, also known as client ID. This is the identifier for the dApp's\n * OIDC registration with the identity provider.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly aud: string;\n\n /**\n * A value contains 31 bytes of entropy that preserves privacy of the account. Typically fetched from a pepper provider.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly pepper: Uint8Array;\n\n /**\n * Account address associated with the account\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly accountAddress: AccountAddress;\n\n /**\n * The zero knowledge signature (if ready) which contains the proof used to validate the EphemeralKeyPair.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n proof: ZeroKnowledgeSig | undefined;\n\n /**\n * The proof of the EphemeralKeyPair or a promise that provides the proof. This is used to allow for awaiting on\n * fetching the proof.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly proofOrPromise: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n\n /**\n * Signing scheme used to sign transactions\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly signingScheme: SigningScheme = SigningScheme.SingleKey;\n\n /**\n * The JWT token used to derive the account\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly jwt: string;\n\n /**\n * The hash of the verification key used to verify the proof. This is optional and can be used to check verifying key\n * rotations which may invalidate the proof.\n */\n readonly verificationKeyHash?: Uint8Array;\n\n /**\n * An event emitter used to assist in handling asynchronous proof fetching.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n private readonly emitter: EventEmitter<ProofFetchEvents>;\n\n /**\n * Use the static generator `create(...)` instead.\n * Creates an instance of the KeylessAccount with an optional proof.\n *\n * @param args - The parameters for creating a KeylessAccount.\n * @param args.address - Optional account address associated with the KeylessAccount.\n * @param args.publicKey - A KeylessPublicKey or FederatedKeylessPublicKey.\n * @param args.ephemeralKeyPair - The ephemeral key pair used in the account creation.\n * @param args.iss - A JWT issuer.\n * @param args.uidKey - The claim on the JWT to identify a user. This is typically 'sub' or 'email'.\n * @param args.uidVal - The unique id for this user, intended to be a stable user identifier.\n * @param args.aud - The value of the 'aud' claim on the JWT, also known as client ID. This is the identifier for the dApp's\n * OIDC registration with the identity provider.\n * @param args.pepper - A hexadecimal input used for additional security.\n * @param args.proof - A Zero Knowledge Signature or a promise that resolves to one.\n * @param args.proofFetchCallback - Optional callback function for fetching proof.\n * @param args.jwt - A JSON Web Token used for authentication.\n * @param args.verificationKeyHash Optional 32-byte verification key hash as hex input used to check proof validity.\n */\n protected constructor(args: {\n address?: AccountAddress;\n publicKey: KeylessPublicKey | FederatedKeylessPublicKey;\n ephemeralKeyPair: EphemeralKeyPair;\n iss: string;\n uidKey: string;\n uidVal: string;\n aud: string;\n pepper: HexInput;\n proof: ZeroKnowledgeSig | Promise<ZeroKnowledgeSig>;\n proofFetchCallback?: ProofFetchCallback;\n jwt: string;\n verificationKeyHash?: HexInput;\n }) {\n super();\n const {\n address,\n ephemeralKeyPair,\n publicKey,\n uidKey,\n uidVal,\n aud,\n pepper,\n proof,\n proofFetchCallback,\n jwt,\n verificationKeyHash,\n } = args;\n this.ephemeralKeyPair = ephemeralKeyPair;\n this.publicKey = publicKey;\n this.accountAddress = address ? AccountAddress.from(address) : this.publicKey.authKey().derivedAddress();\n this.uidKey = uidKey;\n this.uidVal = uidVal;\n this.aud = aud;\n this.jwt = jwt;\n this.emitter = new EventEmitter<ProofFetchEvents>();\n this.proofOrPromise = proof;\n if (proof instanceof ZeroKnowledgeSig) {\n this.proof = proof;\n } else {\n if (proofFetchCallback === undefined) {\n throw new Error(\"Must provide callback for async proof fetch\");\n }\n this.emitter.on(\"proofFetchFinish\", async (status) => {\n await proofFetchCallback(status);\n this.emitter.removeAllListeners();\n });\n // Note, this is purposely not awaited to be non-blocking. The caller should await on the proofFetchCallback.\n this.init(proof);\n }\n const pepperBytes = Hex.fromHexInput(pepper).toUint8Array();\n if (pepperBytes.length !== AbstractKeylessAccount.PEPPER_LENGTH) {\n throw new Error(`Pepper length in bytes should be ${AbstractKeylessAccount.PEPPER_LENGTH}`);\n }\n this.pepper = pepperBytes;\n if (verificationKeyHash !== undefined) {\n if (Hex.hexInputToUint8Array(verificationKeyHash).length !== 32) {\n throw new Error(\"verificationKeyHash must be 32 bytes\");\n }\n this.verificationKeyHash = Hex.hexInputToUint8Array(verificationKeyHash);\n }\n }\n\n getAnyPublicKey(): AnyPublicKey {\n return new AnyPublicKey(this.publicKey);\n }\n\n /**\n * This initializes the asynchronous proof fetch\n * @return Emits whether the proof succeeds or fails, but has no return.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n async init(promise: Promise<ZeroKnowledgeSig>) {\n try {\n this.proof = await promise;\n this.emitter.emit(\"proofFetchFinish\", { status: \"Success\" });\n } catch (error) {\n if (error instanceof Error) {\n this.emitter.emit(\"proofFetchFinish\", { status: \"Failed\", error: error.toString() });\n } else {\n this.emitter.emit(\"proofFetchFinish\", { status: \"Failed\", error: \"Unknown\" });\n }\n }\n }\n\n /**\n * Serializes the jwt data into a format suitable for transmission or storage.\n * This function ensures that both the jwt data and the proof are properly serialized.\n *\n * @param serializer - The serializer instance used to convert the jwt data into bytes.\n */\n serialize(serializer: Serializer): void {\n this.accountAddress.serialize(serializer);\n serializer.serializeStr(this.jwt);\n serializer.serializeStr(this.uidKey);\n serializer.serializeFixedBytes(this.pepper);\n this.ephemeralKeyPair.serialize(serializer);\n if (this.proof === undefined) {\n throw new Error(\"Cannot serialize - proof undefined\");\n }\n this.proof.serialize(serializer);\n serializer.serializeOption(this.verificationKeyHash, 32);\n }\n\n static partialDeserialize(deserializer: Deserializer): {\n address: AccountAddress;\n jwt: string;\n uidKey: string;\n pepper: Uint8Array;\n ephemeralKeyPair: EphemeralKeyPair;\n proof: ZeroKnowledgeSig;\n verificationKeyHash?: Uint8Array;\n } {\n const address = AccountAddress.deserialize(deserializer);\n const jwt = deserializer.deserializeStr();\n const uidKey = deserializer.deserializeStr();\n const pepper = deserializer.deserializeFixedBytes(31);\n const ephemeralKeyPair = EphemeralKeyPair.deserialize(deserializer);\n const proof = ZeroKnowledgeSig.deserialize(deserializer);\n const verificationKeyHash = deserializer.deserializeOption(\"fixedBytes\", 32);\n\n return { address, jwt, uidKey, pepper, ephemeralKeyPair, proof, verificationKeyHash };\n }\n\n /**\n * Checks if the proof is expired. If so the account must be re-derived with a new EphemeralKeyPair\n * and JWT token.\n * @return boolean\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n isExpired(): boolean {\n return this.ephemeralKeyPair.isExpired();\n }\n\n /**\n * Sign a message using Keyless.\n * @param message the message to sign, as binary input\n * @return the AccountAuthenticator containing the signature, together with the account's public key\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n signWithAuthenticator(message: HexInput): AccountAuthenticatorSingleKey {\n const signature = new AnySignature(this.sign(message));\n const publicKey = new AnyPublicKey(this.publicKey);\n return new AccountAuthenticatorSingleKey(publicKey, signature);\n }\n\n /**\n * Sign a transaction using Keyless.\n * @param transaction the raw transaction\n * @return the AccountAuthenticator containing the signature of the transaction, together with the account's public key\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n signTransactionWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticatorSingleKey {\n const signature = new AnySignature(this.signTransaction(transaction));\n const publicKey = new AnyPublicKey(this.publicKey);\n return new AccountAuthenticatorSingleKey(publicKey, signature);\n }\n\n /**\n * Waits for asynchronous proof fetching to finish.\n * @return\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n async waitForProofFetch() {\n if (this.proofOrPromise instanceof Promise) {\n await this.proofOrPromise;\n }\n }\n\n /**\n * Validates that the Keyless Account can be used to sign transactions.\n * @return\n */\n async checkKeylessAccountValidity(aptosConfig: AptosConfig): Promise<void> {\n if (this.isExpired()) {\n throw KeylessError.fromErrorType({\n type: KeylessErrorType.EPHEMERAL_KEY_PAIR_EXPIRED,\n });\n }\n await this.waitForProofFetch();\n if (this.proof === undefined) {\n throw KeylessError.fromErrorType({\n type: KeylessErrorType.ASYNC_PROOF_FETCH_FAILED,\n });\n }\n const header = jwtDecode(this.jwt, { header: true });\n if (header.kid === undefined) {\n throw KeylessError.fromErrorType({\n type: KeylessErrorType.JWT_PARSING_ERROR,\n details: \"checkKeylessAccountValidity failed. JWT is missing 'kid' in header. This should never happen.\",\n });\n }\n if (this.verificationKeyHash !== undefined) {\n const { verificationKey } = await getKeylessConfig({ aptosConfig });\n if (Hex.hexInputToString(verificationKey.hash()) !== Hex.hexInputToString(this.verificationKeyHash)) {\n throw KeylessError.fromErrorType({\n type: KeylessErrorType.INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND,\n });\n }\n } else {\n // eslint-disable-next-line no-console\n console.warn(\n \"[Aptos SDK] The verification key hash was not set. Proof may be invalid if the verification key has rotated.\",\n );\n }\n await AbstractKeylessAccount.fetchJWK({ aptosConfig, publicKey: this.publicKey, kid: header.kid });\n }\n\n /**\n * Sign the given message using Keyless.\n * @param message in HexInput format\n * @returns Signature\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n sign(message: HexInput): KeylessSignature {\n const { expiryDateSecs } = this.ephemeralKeyPair;\n if (this.isExpired()) {\n throw KeylessError.fromErrorType({\n type: KeylessErrorType.EPHEMERAL_KEY_PAIR_EXPIRED,\n });\n }\n if (this.proof === undefined) {\n throw KeylessError.fromErrorType({\n type: KeylessErrorType.PROOF_NOT_FOUND,\n details: \"Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing.\",\n });\n }\n const ephemeralPublicKey = this.ephemeralKeyPair.getPublicKey();\n const ephemeralSignature = this.ephemeralKeyPair.sign(message);\n\n return new KeylessSignature({\n jwtHeader: base64UrlDecode(this.jwt.split(\".\")[0]),\n ephemeralCertificate: new EphemeralCertificate(this.proof, EphemeralCertificateVariant.ZkProof),\n expiryDateSecs,\n ephemeralPublicKey,\n ephemeralSignature,\n });\n }\n\n /**\n * Sign the given transaction with Keyless.\n * Signs the transaction and proof to guard against proof malleability.\n * @param transaction the transaction to be signed\n * @returns KeylessSignature\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n signTransaction(transaction: AnyRawTransaction): KeylessSignature {\n if (this.proof === undefined) {\n throw KeylessError.fromErrorType({\n type: KeylessErrorType.PROOF_NOT_FOUND,\n details: \"Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing.\",\n });\n }\n const raw = deriveTransactionType(transaction);\n const txnAndProof = new TransactionAndProof(raw, this.proof.proof);\n const signMess = txnAndProof.hash();\n return this.sign(signMess);\n }\n\n /**\n * Note - This function is currently incomplete and should only be used to verify ownership of the KeylessAccount\n *\n * Verifies a signature given the message.\n *\n * TODO: Groth16 proof verification\n *\n * @param args.message the message that was signed.\n * @param args.signature the KeylessSignature to verify\n * @returns boolean\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n verifySignature(args: { message: HexInput; signature: KeylessSignature }): boolean {\n const { message, signature } = args;\n if (this.isExpired()) {\n return false;\n }\n if (!this.ephemeralKeyPair.getPublicKey().verifySignature({ message, signature: signature.ephemeralSignature })) {\n return false;\n }\n return true;\n }\n\n /**\n * Fetches the JWK from the issuer's well-known JWKS endpoint.\n *\n * @param args.publicKey The keyless public key to query\n * @param args.kid The kid of the JWK to fetch\n * @returns A JWK matching the `kid` in the JWT header.\n * @throws {KeylessError} If the JWK cannot be fetched\n */\n static async fetchJWK(args: {\n aptosConfig: AptosConfig;\n publicKey: KeylessPublicKey | FederatedKeylessPublicKey;\n kid: string;\n }): Promise<MoveJWK> {\n const { aptosConfig, publicKey, kid } = args;\n const keylessPubKey = publicKey instanceof KeylessPublicKey ? publicKey : publicKey.keylessPublicKey;\n const { iss } = keylessPubKey;\n\n let allJWKs: Map<string, MoveJWK[]>;\n const jwkAddr = publicKey instanceof FederatedKeylessPublicKey ? publicKey.jwkAddress : undefined;\n try {\n allJWKs = await getKeylessJWKs({ aptosConfig, jwkAddr });\n } catch (error) {\n throw KeylessError.fromErrorType({\n type: KeylessErrorType.FULL_NODE_JWKS_LOOKUP_ERROR,\n error,\n details: `Failed to fetch ${jwkAddr ? \"Federated\" : \"Patched\"}JWKs ${jwkAddr ? `for address ${jwkAddr}` : \"0x1\"}`,\n });\n }\n\n // Find the corresponding JWK set by `iss`\n const jwksForIssuer = allJWKs.get(iss);\n\n if (jwksForIssuer === undefined) {\n throw KeylessError.fromErrorType({\n type: KeylessErrorType.INVALID_JWT_ISS_NOT_RECOGNIZED,\n details: `JWKs for issuer ${iss} not found.`,\n });\n }\n\n // Find the corresponding JWK by `kid`\n const jwk = jwksForIssuer.find((key) => key.kid === kid);\n\n if (jwk === undefined) {\n throw KeylessError.fromErrorType({\n type: KeylessErrorType.INVALID_JWT_JWK_NOT_FOUND,\n details: `JWK with kid '${kid}' for issuer '${iss}' not found.`,\n });\n }\n\n return jwk;\n }\n}\n\n/**\n * A container class to hold a transaction and a proof. It implements CryptoHashable which is used to create\n * the signing message for Keyless transactions. We sign over the proof to ensure non-malleability.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport class TransactionAndProof extends Serializable {\n /**\n * The transaction to sign.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n transaction: AnyRawTransactionInstance;\n\n /**\n * The zero knowledge proof used in signing the transaction.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n proof?: ZkProof;\n\n /**\n * The domain separator prefix used when hashing.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly domainSeparator = \"APTOS::TransactionAndProof\";\n\n constructor(transaction: AnyRawTransactionInstance, proof?: ZkProof) {\n super();\n this.transaction = transaction;\n this.proof = proof;\n }\n\n /**\n * Serializes the transaction data into a format suitable for transmission or storage.\n * This function ensures that both the transaction bytes and the proof are properly serialized.\n *\n * @param serializer - The serializer instance used to convert the transaction data into bytes.\n */\n serialize(serializer: Serializer): void {\n serializer.serializeFixedBytes(this.transaction.bcsToBytes());\n serializer.serializeOption(this.proof);\n }\n\n /**\n * Hashes the bcs serialized from of the class. This is the typescript corollary to the BCSCryptoHash macro in aptos-core.\n *\n * @returns Uint8Array\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n hash(): Uint8Array {\n return generateSigningMessage(this.bcsToBytes(), this.domainSeparator);\n }\n}\n/**\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport type ProofFetchSuccess = {\n status: \"Success\";\n};\n/**\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport type ProofFetchFailure = {\n status: \"Failed\";\n error: string;\n};\n/**\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport type ProofFetchStatus = ProofFetchSuccess | ProofFetchFailure;\n/**\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport type ProofFetchCallback = (status: ProofFetchStatus) => Promise<void>;\n/**\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport interface ProofFetchEvents {\n proofFetchFinish: (status: ProofFetchStatus) => void;\n}\n"],"mappings":"ofAGA,OAAOA,MAAkB,gBACzB,OAAS,aAAAC,MAAiB,aAoCnB,SAASC,GAAgBC,EAAgC,CAC9D,OAAOA,GAAQ,MAA6B,OAAOA,EAAI,6BAAgC,UACzF,CAQO,IAAeC,EAAf,MAAeA,UAA+BC,CAAuD,CAkHhG,YAAYC,EAanB,CACD,MAAM,EAvDR,KAAS,cAA+B,EAwDtC,GAAM,CACJ,QAAAC,EACA,iBAAAC,EACA,UAAAC,EACA,OAAAC,EACA,OAAAC,EACA,IAAAC,EACA,OAAAC,EACA,MAAAC,EACA,mBAAAC,EACA,IAAAC,EACA,oBAAAC,CACF,EAAIX,EAUJ,GATA,KAAK,iBAAmBE,EACxB,KAAK,UAAYC,EACjB,KAAK,eAAiBF,EAAUW,EAAe,KAAKX,CAAO,EAAI,KAAK,UAAU,QAAQ,EAAE,eAAe,EACvG,KAAK,OAASG,EACd,KAAK,OAASC,EACd,KAAK,IAAMC,EACX,KAAK,IAAMI,EACX,KAAK,QAAU,IAAIG,EACnB,KAAK,eAAiBL,EAClBA,aAAiBM,EACnB,KAAK,MAAQN,MACR,CACL,GAAIC,IAAuB,OACzB,MAAM,IAAI,MAAM,6CAA6C,EAE/D,KAAK,QAAQ,GAAG,mBAAoB,MAAOM,GAAW,CACpD,MAAMN,EAAmBM,CAAM,EAC/B,KAAK,QAAQ,mBAAmB,CAClC,CAAC,EAED,KAAK,KAAKP,CAAK,CACjB,CACA,IAAMQ,EAAcC,EAAI,aAAaV,CAAM,EAAE,aAAa,EAC1D,GAAIS,EAAY,SAAWlB,EAAuB,cAChD,MAAM,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AAE,YAAAvB,EAAa,QAAAqB,CAAQ,CAAC,CACzD,OAAS9B,EAAO,CACd,MAAMU,EAAa,cAAc,CAC/B,QACA,MAAAV,EACA,QAAS,mBAAmB8B,EAAU,YAAc,SAAS,QAAQA,EAAU,eAAeA,CAAO,GAAK,KAAK,EACjH,CAAC,CACH,CAGA,IAAMG,EAAgBJ,EAAQ,IAAID,CAAG,EAErC,GAAIK,IAAkB,OACpB,MAAMvB,EAAa,cAAc,CAC/B,OACA,QAAS,mBAAmBkB,CAAG,aACjC,CAAC,EAIH,IAAMM,EAAMD,EAAc,KAAME,GAAQA,EAAI,MAAQV,CAAG,EAEvD,GAAIS,IAAQ,OACV,MAAMxB,EAAa,cAAc,CAC/B,OACA,QAAS,iBAAiBe,CAAG,iBAAiBG,CAAG,cACnD,CAAC,EAGH,OAAOM,CACT,CACF,EAvcsBxD,EACJ,cAAwB,GADnC,IAAe0D,EAAf1D,EA+cM8C,EAAN,cAAkC7C,CAAa,CAsBpD,YAAY6B,EAAwCpB,EAAiB,CACnE,MAAM,EAHR,KAAS,gBAAkB,6BAIzB,KAAK,YAAcoB,EACnB,KAAK,MAAQpB,CACf,CAQA,UAAUa,EAA8B,CACtCA,EAAW,oBAAoB,KAAK,YAAY,WAAW,CAAC,EAC5DA,EAAW,gBAAgB,KAAK,KAAK,CACvC,CASA,MAAmB,CACjB,OAAOoC,EAAuB,KAAK,WAAW,EAAG,KAAK,eAAe,CACvE,CACF","names":["EventEmitter","jwtDecode","isKeylessSigner","obj","_AbstractKeylessAccount","Serializable","args","address","ephemeralKeyPair","publicKey","uidKey","uidVal","aud","pepper","proof","proofFetchCallback","jwt","verificationKeyHash","AccountAddress","EventEmitter","ZeroKnowledgeSig","status","pepperBytes","Hex","AnyPublicKey","promise","error","serializer","deserializer","EphemeralKeyPair","message","signature","AnySignature","AccountAuthenticatorSingleKey","transaction","aptosConfig","KeylessError","header","jwtDecode","verificationKey","getKeylessConfig","expiryDateSecs","ephemeralPublicKey","ephemeralSignature","KeylessSignature","base64UrlDecode","EphemeralCertificate","raw","deriveTransactionType","signMess","TransactionAndProof","kid","keylessPubKey","KeylessPublicKey","iss","allJWKs","jwkAddr","FederatedKeylessPublicKey","getKeylessJWKs","jwksForIssuer","jwk","key","AbstractKeylessAccount","generateSigningMessage"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as g}from"./chunk-YMXJ6GYE.mjs";import{b as m}from"./chunk-TJICLFR2.mjs";import{a as p}from"./chunk-MZVVBJVV.mjs";import{e as a}from"./chunk-6VGLRQBT.mjs";import{b as d,c as u}from"./chunk-X6H4G6NE.mjs";import{b as y}from"./chunk-LQOSHBB7.mjs";var A=class l{constructor(e){this.signingScheme=3;let{multiKey:i,address:s}=e,n=e.signers.map(t=>t instanceof p?m.fromEd25519Account(t):t);if(i.signaturesRequired>n.length)throw new Error(`Not enough signers provided to satisfy the required signatures. Need ${i.signaturesRequired} signers, but only ${n.length} provided`);if(i.signaturesRequired<n.length)throw new Error(`More signers provided than required. Need ${i.signaturesRequired} signers, but ${n.length} provided`);this.publicKey=i,this.accountAddress=s?y.from(s):this.publicKey.authKey().derivedAddress();let r=[];for(let t of n)r.push(this.publicKey.getIndex(t.getAnyPublicKey()));let o=n.map((t,c)=>[t,r[c]]);o.sort((t,c)=>t[1]-c[1]),this.signers=o.map(t=>t[0]),this.signerIndicies=o.map(t=>t[1]),this.signaturesBitmap=this.publicKey.createBitmap({bits:r})}static fromPublicKeysAndSigners(e){let{address:i,publicKeys:s,signaturesRequired:n,signers:r}=e,o=new d({publicKeys:s,signaturesRequired:n});return new l({multiKey:o,signers:r,address:i})}static isMultiKeySigner(e){return e instanceof l}signWithAuthenticator(e){return new a(this.publicKey,this.sign(e))}signTransactionWithAuthenticator(e){return new a(this.publicKey,this.signTransaction(e))}async waitForProofFetch(){let i=this.signers.filter(s=>s instanceof g).map(async s=>s.waitForProofFetch());await Promise.all(i)}async checkKeylessAccountValidity(e){let s=this.signers.filter(n=>n instanceof g).map(n=>n.checkKeylessAccountValidity(e));await Promise.all(s)}sign(e){let i=[];for(let s of this.signers)i.push(s.sign(e));return new u({signatures:i,bitmap:this.signaturesBitmap})}signTransaction(e){let i=[];for(let s of this.signers)i.push(s.signTransaction(e));return new u({signatures:i,bitmap:this.signaturesBitmap})}verifySignature(e){let{message:i,signature:s}=e;if(!this.signerIndicies.every((r,o)=>o===0||r>=this.signerIndicies[o-1]))return!1;for(let r=0;r<s.signatures.length;r+=1){let o=s.signatures[r];if(!this.publicKey.publicKeys[this.signerIndicies[r]].verifySignature({message:i,signature:o}))return!1}return!0}};export{A as a};
|
|
2
|
-
//# sourceMappingURL=chunk-ZJCTELB4.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/account/MultiKeyAccount.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Account } from \"./Account\";\nimport { MultiKey, MultiKeySignature, PublicKey } from \"../core/crypto\";\nimport { AccountAddress, AccountAddressInput } from \"../core/accountAddress\";\nimport { HexInput, SigningScheme } from \"../types\";\nimport { AccountAuthenticatorMultiKey } from \"../transactions/authenticator/account\";\nimport { AnyRawTransaction } from \"../transactions/types\";\nimport { AbstractKeylessAccount, KeylessSigner } from \"./AbstractKeylessAccount\";\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { SingleKeyAccount, SingleKeySigner, SingleKeySignerOrLegacyEd25519Account } from \"./SingleKeyAccount\";\nimport { Ed25519Account } from \"./Ed25519Account\";\n\n/**\n * Arguments required to verify a multi-key signature against a given message.\n *\n * @param message - The original message that was signed.\n * @param signature - The multi-key signature to be verified.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport interface VerifyMultiKeySignatureArgs {\n message: HexInput;\n signature: MultiKeySignature;\n}\n\n/**\n * Signer implementation for the MultiKey authentication scheme.\n *\n * This account utilizes an M of N signing scheme, where M and N are specified in the {@link MultiKey}.\n * It signs messages using an array of M accounts, each corresponding to a public key in the {@link MultiKey}.\n *\n * Note: Generating a signer instance does not create the account on-chain.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport class MultiKeyAccount implements Account, KeylessSigner {\n /**\n * Public key associated with the account\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly publicKey: MultiKey;\n\n /**\n * Account address associated with the account\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly accountAddress: AccountAddress;\n\n /**\n * Signing scheme used to sign transactions\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly signingScheme: SigningScheme = SigningScheme.MultiKey;\n\n /**\n * The signers used to sign messages. These signers should correspond to public keys in the\n * MultiKeyAccount's public key. The number of signers should be equal to this.publicKey.signaturesRequired.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly signers: Account[];\n\n /**\n * An array of indices where for signer[i], signerIndicies[i] is the index of the corresponding public key in\n * publicKey.publicKeys. Used to derive the right public key to use for verification.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n // TODO: Rename Indicies to Indices\n readonly signerIndicies: number[];\n\n readonly signaturesBitmap: Uint8Array;\n\n /**\n * Constructs a MultiKeyAccount instance, which requires multiple signatures for transactions.\n *\n * @param args - The arguments for creating a MultiKeyAccount.\n * @param args.multiKey - The multikey of the account consisting of N public keys and a number M representing the required signatures.\n * @param args.signers - An array of M signers that will be used to sign the transaction.\n * @param args.address - An optional account address input. If not provided, the derived address from the public key will be used.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n constructor(args: {\n multiKey: MultiKey;\n signers: SingleKeySignerOrLegacyEd25519Account[];\n address?: AccountAddressInput;\n }) {\n const { multiKey, address } = args;\n\n const signers: SingleKeySigner[] = args.signers.map((signer) =>\n signer instanceof Ed25519Account ? SingleKeyAccount.fromEd25519Account(signer) : signer,\n );\n\n if (multiKey.signaturesRequired > signers.length) {\n throw new Error(\n // eslint-disable-next-line max-len\n `Not enough signers provided to satisfy the required signatures. Need ${multiKey.signaturesRequired} signers, but only ${signers.length} provided`,\n );\n } else if (multiKey.signaturesRequired < signers.length) {\n throw new Error(\n // eslint-disable-next-line max-len\n `More signers provided than required. Need ${multiKey.signaturesRequired} signers, but ${signers.length} provided`,\n );\n }\n\n this.publicKey = multiKey;\n\n this.accountAddress = address ? AccountAddress.from(address) : this.publicKey.authKey().derivedAddress();\n\n // For each signer, find its corresponding position in the MultiKey's public keys array\n const bitPositions: number[] = [];\n for (const signer of signers) {\n bitPositions.push(this.publicKey.getIndex(signer.getAnyPublicKey()));\n }\n\n // Create pairs of [signer, position] and sort them by position\n // This sorting is critical because:\n // 1. The on-chain verification expects signatures to be in ascending order by bit position\n // 2. The bitmap must match the order of signatures when verifying\n const signersAndBitPosition: [Account, number][] = signers.map((signer, index) => [signer, bitPositions[index]]);\n signersAndBitPosition.sort((a, b) => a[1] - b[1]);\n\n // Extract the sorted signers and their positions into separate arrays\n this.signers = signersAndBitPosition.map((value) => value[0]);\n this.signerIndicies = signersAndBitPosition.map((value) => value[1]);\n\n // Create a bitmap representing which public keys from the MultiKey are being used\n // This bitmap is used during signature verification to identify which public keys\n // should be used to verify each signature\n this.signaturesBitmap = this.publicKey.createBitmap({ bits: bitPositions });\n }\n\n /**\n * Static constructor to create a MultiKeyAccount using the provided public keys and signers.\n *\n * @param args - The arguments for creating a MultiKeyAccount.\n * @param args.publicKeys - The N public keys of the MultiKeyAccount.\n * @param args.signaturesRequired - The number of signatures required to authorize a transaction.\n * @param args.signers - An array of M signers that will be used to sign the transaction.\n * @returns MultiKeyAccount - The newly created MultiKeyAccount.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static fromPublicKeysAndSigners(args: {\n address?: AccountAddressInput;\n publicKeys: PublicKey[];\n signaturesRequired: number;\n signers: SingleKeySignerOrLegacyEd25519Account[];\n }): MultiKeyAccount {\n const { address, publicKeys, signaturesRequired, signers } = args;\n const multiKey = new MultiKey({ publicKeys, signaturesRequired });\n return new MultiKeyAccount({ multiKey, signers, address });\n }\n\n /**\n * Determines if the provided account is a multi-key account.\n *\n * @param account - The account to check.\n * @returns A boolean indicating whether the account is a multi-key account.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static isMultiKeySigner(account: Account): account is MultiKeyAccount {\n return account instanceof MultiKeyAccount;\n }\n\n /**\n * Sign a message using the account's signers and return an AccountAuthenticator containing the signature along with the\n * account's public key.\n * @param message - The signing message, represented as binary input in hexadecimal format.\n * @returns An instance of AccountAuthenticatorMultiKey that includes the signature and the public key.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n signWithAuthenticator(message: HexInput): AccountAuthenticatorMultiKey {\n return new AccountAuthenticatorMultiKey(this.publicKey, this.sign(message));\n }\n\n /**\n * Sign a transaction using the account's signers, returning an AccountAuthenticator that contains the signature and the\n * account's public key.\n * @param transaction - The raw transaction to be signed.\n * @returns An AccountAuthenticatorMultiKey containing the signature of the transaction along with the account's public key.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n signTransactionWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticatorMultiKey {\n return new AccountAuthenticatorMultiKey(this.publicKey, this.signTransaction(transaction));\n }\n\n /**\n * Waits for any proofs on KeylessAccount signers to be fetched. This ensures that signing with the KeylessAccount does not\n * fail due to missing proofs.\n * @return {Promise<void>} A promise that resolves when all proofs have been fetched.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n async waitForProofFetch(): Promise<void> {\n const keylessSigners = this.signers.filter(\n (signer) => signer instanceof AbstractKeylessAccount,\n ) as AbstractKeylessAccount[];\n const promises = keylessSigners.map(async (signer) => signer.waitForProofFetch());\n await Promise.all(promises);\n }\n\n /**\n * Validates that the Keyless Account can be used to sign transactions.\n * @return\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n async checkKeylessAccountValidity(aptosConfig: AptosConfig): Promise<void> {\n const keylessSigners = this.signers.filter(\n (signer) => signer instanceof AbstractKeylessAccount,\n ) as AbstractKeylessAccount[];\n const promises = keylessSigners.map((signer) => signer.checkKeylessAccountValidity(aptosConfig));\n await Promise.all(promises);\n }\n\n /**\n * Sign the given message using the MultiKeyAccount's signers\n * @param data - The data to be signed in HexInput format.\n * @returns MultiKeySignature\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n sign(data: HexInput): MultiKeySignature {\n const signatures = [];\n for (const signer of this.signers) {\n signatures.push(signer.sign(data));\n }\n return new MultiKeySignature({ signatures, bitmap: this.signaturesBitmap });\n }\n\n /**\n * Sign the given transaction using the MultiKeyAccount's signers.\n * This function aggregates signatures from all signers associated with the MultiKeyAccount.\n *\n * @param transaction - The transaction to be signed.\n * @returns MultiKeySignature - An object containing the aggregated signatures and a bitmap of the signatures.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n signTransaction(transaction: AnyRawTransaction): MultiKeySignature {\n const signatures = [];\n for (const signer of this.signers) {\n signatures.push(signer.signTransaction(transaction));\n }\n return new MultiKeySignature({ signatures, bitmap: this.signaturesBitmap });\n }\n\n /**\n * Verify the given message and signature with the public keys.\n *\n * This function checks if the provided signatures are valid for the given message using the corresponding public keys.\n *\n * @param args - The arguments for verifying the signature.\n * @param args.message - The raw message data in HexInput format.\n * @param args.signature - The signed message MultiKeySignature containing multiple signatures.\n * @returns A boolean indicating whether the signatures are valid for the message.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n verifySignature(args: VerifyMultiKeySignatureArgs): boolean {\n const { message, signature } = args;\n const isSignerIndicesSorted = this.signerIndicies.every(\n (value, i) => i === 0 || value >= this.signerIndicies[i - 1],\n );\n if (!isSignerIndicesSorted) {\n return false;\n }\n for (let i = 0; i < signature.signatures.length; i += 1) {\n const singleSignature = signature.signatures[i];\n const publicKey = this.publicKey.publicKeys[this.signerIndicies[i]];\n if (!publicKey.verifySignature({ message, signature: singleSignature })) {\n return false;\n }\n }\n return true;\n }\n}\n"],"mappings":"6PAqCO,IAAMA,EAAN,MAAMC,CAAkD,CAmD7D,YAAYC,EAIT,CAnCH,KAAS,cAA+B,EAoCtC,GAAM,CAAE,SAAAC,EAAU,QAAAC,CA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EAAG,CACvD,IAAMC,EAAkBF,EAAU,WAAWC,CAAC,EAE9C,GAAI,CADc,KAAK,UAAU,WAAW,KAAK,eAAeA,CAAC,CAAC,EACnD,gBAAgB,CAAE,QAAAV,EAAS,UAAWW,CAAgB,CAAC,EACpE,MAAO,EAEX,CACA,MAAO,EACT,CACF","names":["MultiKeyAccount","_MultiKeyAccount","args","multiKey","address","signers","signer","Ed25519Account","SingleKeyAccount","AccountAddress","bitPositions","signersAndBitPosition","index","a","b","value","publicKeys","signaturesRequired","MultiKey","account","message","AccountAuthenticatorMultiKey","transaction","promises","AbstractKeylessAccount","aptosConfig","data","signatures","MultiKeySignature","signature","i","singleSignature"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|