@aptos-labs/ts-sdk 5.1.1-side-effect-free.0 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/chunk-A2XB7TVI.js +4 -0
- package/dist/common/chunk-A2XB7TVI.js.map +1 -0
- package/dist/common/cli/index.js +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.d.ts +1 -12
- package/dist/common/index.js +34 -34
- package/dist/common/index.js.map +1 -1
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
- package/dist/esm/account/AbstractKeylessAccount.mjs.map +1 -1
- package/dist/esm/account/AbstractedAccount.mjs +1 -1
- package/dist/esm/account/AbstractedAccount.mjs.map +1 -1
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/Account.mjs.map +1 -1
- package/dist/esm/account/AccountUtils.mjs +1 -1
- package/dist/esm/account/AccountUtils.mjs.map +1 -1
- package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -1
- package/dist/esm/account/DerivableAbstractedAccount.mjs.map +1 -1
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/Ed25519Account.mjs.map +1 -1
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.mjs.map +1 -1
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
- package/dist/esm/account/FederatedKeylessAccount.mjs.map +1 -1
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/KeylessAccount.mjs.map +1 -1
- package/dist/esm/account/MultiEd25519Account.mjs +1 -1
- package/dist/esm/account/MultiEd25519Account.mjs.map +1 -1
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.mjs.map +1 -1
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.mjs.map +1 -1
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/account/index.mjs.map +1 -1
- package/dist/esm/account/utils.mjs +1 -1
- package/dist/esm/account/utils.mjs.map +1 -1
- package/dist/esm/api/account/abstraction.mjs +1 -1
- package/dist/esm/api/account/abstraction.mjs.map +1 -1
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/account.mjs.map +1 -1
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/ans.mjs.map +1 -1
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptos.mjs.map +1 -1
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/aptosConfig.mjs.map +1 -1
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/coin.mjs.map +1 -1
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/digitalAsset.mjs.map +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/faucet.mjs.map +1 -1
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/fungibleAsset.mjs.map +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/general.mjs.map +1 -1
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/index.mjs.map +1 -1
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/keyless.mjs.map +1 -1
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/object.mjs.map +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/staking.mjs.map +1 -1
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/table.mjs.map +1 -1
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transaction.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
- package/dist/esm/api/transactionSubmission/helpers.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.mjs.map +1 -1
- 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.mjs +1 -1
- package/dist/esm/api/transactionSubmission/simulate.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs.map +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/api/utils.mjs.map +1 -1
- package/dist/esm/bcs/consts.mjs +1 -1
- package/dist/esm/bcs/consts.mjs.map +1 -1
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/deserializer.mjs.map +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/index.mjs.map +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs.map +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.mjs.map +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs.map +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs.map +1 -1
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/bcs/serializer.mjs.map +1 -1
- package/dist/esm/chunk-2PASUPUO.mjs +2 -0
- package/dist/esm/chunk-2PASUPUO.mjs.map +1 -0
- package/dist/esm/chunk-35DKMW7Q.mjs +2 -0
- package/dist/esm/chunk-35DKMW7Q.mjs.map +1 -0
- package/dist/esm/chunk-3LJVXUPB.mjs +2 -0
- package/dist/esm/chunk-3LJVXUPB.mjs.map +1 -0
- package/dist/esm/chunk-4QMXOWHP.mjs +1 -0
- package/dist/esm/chunk-4QMXOWHP.mjs.map +1 -0
- package/dist/esm/chunk-4WPQQPUF.mjs +1 -0
- package/dist/esm/chunk-4WPQQPUF.mjs.map +1 -0
- package/dist/esm/chunk-56CNRT2K.mjs +2 -0
- package/dist/esm/chunk-56CNRT2K.mjs.map +1 -0
- package/dist/esm/chunk-57YZ7I7V.mjs +2 -0
- package/dist/esm/chunk-57YZ7I7V.mjs.map +1 -0
- package/dist/esm/chunk-5HXLZHDW.mjs +1 -0
- package/dist/esm/chunk-5HXLZHDW.mjs.map +1 -0
- package/dist/esm/chunk-6WDVDEQZ.mjs +7 -0
- package/dist/esm/chunk-6WDVDEQZ.mjs.map +1 -0
- package/dist/esm/chunk-7DQDJ2SA.mjs +2 -0
- package/dist/esm/chunk-7DQDJ2SA.mjs.map +1 -0
- package/dist/esm/chunk-7ECCT6PK.mjs +1 -0
- package/dist/esm/chunk-7ECCT6PK.mjs.map +1 -0
- package/dist/esm/chunk-7ZESTCBD.mjs +2 -0
- package/dist/esm/chunk-7ZESTCBD.mjs.map +1 -0
- package/dist/esm/chunk-A5L76YP7.mjs +2 -0
- package/dist/esm/chunk-A5L76YP7.mjs.map +1 -0
- package/dist/esm/chunk-ADJMFL73.mjs +2 -0
- package/dist/esm/chunk-ADJMFL73.mjs.map +1 -0
- package/dist/esm/chunk-B563XRSZ.mjs +2 -0
- package/dist/esm/chunk-B563XRSZ.mjs.map +1 -0
- package/dist/esm/chunk-C3Q23D22.mjs +2 -0
- package/dist/esm/chunk-C3Q23D22.mjs.map +1 -0
- package/dist/esm/chunk-CW35YAMN.mjs +2 -0
- package/dist/esm/chunk-CW35YAMN.mjs.map +1 -0
- package/dist/esm/chunk-CZDNBI5K.mjs +2 -0
- package/dist/esm/chunk-CZDNBI5K.mjs.map +1 -0
- package/dist/esm/chunk-DHCGYW3W.mjs +2 -0
- package/dist/esm/chunk-DHCGYW3W.mjs.map +1 -0
- package/dist/esm/chunk-EBMEXURY.mjs +2 -0
- package/dist/esm/chunk-EBMEXURY.mjs.map +1 -0
- package/dist/esm/chunk-EF4FA5I6.mjs +2 -0
- package/dist/esm/chunk-EF4FA5I6.mjs.map +1 -0
- package/dist/esm/chunk-EMR3S3VO.mjs +2 -0
- package/dist/esm/chunk-EMR3S3VO.mjs.map +1 -0
- package/dist/esm/chunk-FD6FGKYY.mjs +1 -0
- package/dist/esm/chunk-FD6FGKYY.mjs.map +1 -0
- package/dist/esm/chunk-FGFLPH5K.mjs +2 -0
- package/dist/esm/chunk-FGFLPH5K.mjs.map +1 -0
- package/dist/esm/chunk-FLZPUYXQ.mjs +2 -0
- package/dist/esm/chunk-FLZPUYXQ.mjs.map +1 -0
- package/dist/esm/chunk-FZY4PMEE.mjs +1 -0
- package/dist/esm/chunk-FZY4PMEE.mjs.map +1 -0
- package/dist/esm/chunk-G3MHXDYA.mjs +1 -0
- package/dist/esm/chunk-G3MHXDYA.mjs.map +1 -0
- package/dist/esm/chunk-GOXRBEIJ.mjs +2 -0
- package/dist/esm/chunk-GOXRBEIJ.mjs.map +1 -0
- package/dist/esm/chunk-GUPVZIYS.mjs +2 -0
- package/dist/esm/chunk-GUPVZIYS.mjs.map +1 -0
- package/dist/esm/chunk-HGLO5LDS.mjs +1 -0
- package/dist/esm/chunk-HGLO5LDS.mjs.map +1 -0
- package/dist/esm/chunk-HNBVYE3N.mjs +2 -0
- package/dist/esm/chunk-HNBVYE3N.mjs.map +1 -0
- package/dist/esm/chunk-I7XT6L7S.mjs +2 -0
- package/dist/esm/chunk-I7XT6L7S.mjs.map +1 -0
- package/dist/esm/chunk-IF4UU2MT.mjs +2 -0
- package/dist/esm/chunk-IF4UU2MT.mjs.map +1 -0
- package/dist/esm/chunk-KB4XOTCR.mjs +2 -0
- package/dist/esm/chunk-KB4XOTCR.mjs.map +1 -0
- package/dist/esm/chunk-KDMSOCZY.mjs +2 -0
- package/dist/esm/chunk-KDMSOCZY.mjs.map +1 -0
- package/dist/esm/chunk-MCFQE4GC.mjs +2 -0
- package/dist/esm/chunk-MCFQE4GC.mjs.map +1 -0
- package/dist/esm/chunk-MT2RJ7H3.mjs +2 -0
- package/dist/esm/chunk-MT2RJ7H3.mjs.map +1 -0
- package/dist/esm/chunk-N6YTF76Q.mjs +2 -0
- package/dist/esm/chunk-N6YTF76Q.mjs.map +1 -0
- package/dist/esm/chunk-NECL5FCQ.mjs +1 -0
- package/dist/esm/chunk-NECL5FCQ.mjs.map +1 -0
- package/dist/esm/chunk-O26BHE5H.mjs +2 -0
- package/dist/esm/chunk-O26BHE5H.mjs.map +1 -0
- package/dist/esm/chunk-OLILO7VD.mjs +2 -0
- package/dist/esm/chunk-OLILO7VD.mjs.map +1 -0
- package/dist/esm/chunk-ORMOQWWH.mjs +2 -0
- package/dist/esm/chunk-ORMOQWWH.mjs.map +1 -0
- package/dist/esm/chunk-PGUSBALH.mjs +4 -0
- package/dist/esm/chunk-PGUSBALH.mjs.map +1 -0
- package/dist/esm/chunk-Q4W3WJ2U.mjs +2 -0
- package/dist/esm/chunk-Q4W3WJ2U.mjs.map +1 -0
- package/dist/esm/chunk-QREVMGQZ.mjs +2 -0
- package/dist/esm/chunk-QREVMGQZ.mjs.map +1 -0
- package/dist/esm/chunk-RGKRCZ36.mjs +4 -0
- package/dist/esm/chunk-RGKRCZ36.mjs.map +1 -0
- package/dist/esm/chunk-STY74NUA.mjs +2 -0
- package/dist/esm/chunk-STY74NUA.mjs.map +1 -0
- package/dist/esm/chunk-TOBQ5UE6.mjs +2 -0
- package/dist/esm/chunk-TOBQ5UE6.mjs.map +1 -0
- package/dist/esm/chunk-TSEAIF34.mjs +2 -0
- package/dist/esm/chunk-TSEAIF34.mjs.map +1 -0
- package/dist/esm/chunk-TT3MPSBB.mjs +2 -0
- package/dist/esm/chunk-TT3MPSBB.mjs.map +1 -0
- package/dist/esm/chunk-UL777LTI.mjs +494 -0
- package/dist/esm/chunk-UL777LTI.mjs.map +1 -0
- package/dist/esm/chunk-UYVPNUH3.mjs +1 -0
- package/dist/esm/chunk-UYVPNUH3.mjs.map +1 -0
- package/dist/esm/chunk-V3MBJJTL.mjs +1 -0
- package/dist/esm/chunk-V3MBJJTL.mjs.map +1 -0
- package/dist/esm/chunk-V74WPKSY.mjs +2 -0
- package/dist/esm/chunk-V74WPKSY.mjs.map +1 -0
- package/dist/esm/chunk-WCMW2L3P.mjs +2 -0
- package/dist/esm/chunk-WCMW2L3P.mjs.map +1 -0
- package/dist/esm/chunk-WSR5EBJM.mjs +2 -0
- package/dist/esm/chunk-WSR5EBJM.mjs.map +1 -0
- package/dist/esm/chunk-XJJVJOX5.mjs +2 -0
- package/dist/esm/chunk-XJJVJOX5.mjs.map +1 -0
- package/dist/esm/chunk-XKUIMGKU.mjs +2 -0
- package/dist/esm/chunk-XKUIMGKU.mjs.map +1 -0
- package/dist/esm/chunk-YOZBVVKL.mjs +2 -0
- package/dist/esm/chunk-YOZBVVKL.mjs.map +1 -0
- package/dist/esm/chunk-ZP4DWSQA.mjs +2 -0
- package/dist/esm/chunk-ZP4DWSQA.mjs.map +1 -0
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/index.mjs.map +1 -1
- package/dist/esm/cli/localNode.mjs +1 -1
- package/dist/esm/cli/localNode.mjs.map +1 -1
- package/dist/esm/cli/move.mjs +1 -1
- package/dist/esm/cli/move.mjs.map +1 -1
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/core.mjs.map +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/get.mjs.map +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/index.mjs.map +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/client/post.mjs.map +1 -1
- package/dist/esm/core/account/index.d.mts +1 -1
- package/dist/esm/core/account/index.mjs +1 -1
- package/dist/esm/core/account/index.mjs.map +1 -1
- package/dist/esm/core/account/utils/address.d.mts +1 -12
- package/dist/esm/core/account/utils/address.mjs +1 -1
- package/dist/esm/core/account/utils/address.mjs.map +1 -1
- package/dist/esm/core/account/utils/index.d.mts +1 -1
- package/dist/esm/core/account/utils/index.mjs +1 -1
- package/dist/esm/core/account/utils/index.mjs.map +1 -1
- package/dist/esm/core/accountAddress.mjs +1 -3
- package/dist/esm/core/accountAddress.mjs.map +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/authenticationKey.mjs.map +1 -1
- package/dist/esm/core/common.mjs +1 -1
- package/dist/esm/core/common.mjs.map +1 -1
- package/dist/esm/core/crypto/abstraction.mjs +1 -1
- package/dist/esm/core/crypto/abstraction.mjs.map +1 -1
- package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
- package/dist/esm/core/crypto/deserializationUtils.mjs.map +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.mjs.map +1 -1
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.mjs.map +1 -1
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
- package/dist/esm/core/crypto/federatedKeyless.mjs.map +1 -1
- package/dist/esm/core/crypto/hdKey.mjs +1 -1
- package/dist/esm/core/crypto/hdKey.mjs.map +1 -1
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/index.mjs.map +1 -1
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/keyless.mjs.map +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs.map +1 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -3
- package/dist/esm/core/crypto/multiKey.mjs.map +1 -1
- package/dist/esm/core/crypto/poseidon.mjs +1 -1
- package/dist/esm/core/crypto/poseidon.mjs.map +1 -1
- package/dist/esm/core/crypto/privateKey.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.mjs.map +1 -1
- package/dist/esm/core/crypto/proof.mjs +1 -1
- package/dist/esm/core/crypto/proof.mjs.map +1 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.mjs.map +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs.map +1 -1
- package/dist/esm/core/crypto/secp256r1.mjs +1 -1
- package/dist/esm/core/crypto/secp256r1.mjs.map +1 -1
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/signature.mjs.map +1 -1
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.mjs.map +1 -1
- package/dist/esm/core/crypto/types.mjs +1 -0
- package/dist/esm/core/crypto/utils.mjs +1 -1
- package/dist/esm/core/crypto/utils.mjs.map +1 -1
- package/dist/esm/core/hex.mjs +1 -1
- package/dist/esm/core/hex.mjs.map +1 -1
- package/dist/esm/core/index.d.mts +1 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/core/index.mjs.map +1 -1
- package/dist/esm/errors/index.mjs +1 -6
- package/dist/esm/errors/index.mjs.map +1 -1
- package/dist/esm/index.d.mts +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/internal/abstraction.mjs +1 -1
- package/dist/esm/internal/abstraction.mjs.map +1 -1
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/account.mjs.map +1 -1
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/ans.mjs.map +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/coin.mjs.map +1 -1
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/digitalAsset.mjs.map +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/faucet.mjs.map +1 -1
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.mjs.map +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/general.mjs.map +1 -1
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/keyless.mjs.map +1 -1
- package/dist/esm/internal/object.mjs +1 -1
- package/dist/esm/internal/object.mjs.map +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/staking.mjs.map +1 -1
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/table.mjs.map +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transaction.mjs.map +1 -1
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.mjs.map +1 -1
- package/dist/esm/internal/utils/index.mjs +1 -1
- package/dist/esm/internal/utils/index.mjs.map +1 -1
- package/dist/esm/internal/utils/utils.mjs +1 -1
- package/dist/esm/internal/utils/utils.mjs.map +1 -1
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/internal/view.mjs.map +1 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.mjs.map +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.mjs.map +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs.map +1 -1
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/index.mjs.map +1 -1
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.mjs.map +1 -1
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/identifier.mjs.map +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/index.mjs.map +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs.map +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs.map +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs.map +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs.map +1 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs.map +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.mjs.map +1 -1
- package/dist/esm/transactions/instances/transactionArgument.mjs +1 -0
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs.map +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.mjs.map +1 -1
- package/dist/esm/transactions/management/asyncQueue.mjs +1 -1
- package/dist/esm/transactions/management/asyncQueue.mjs.map +1 -1
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/index.mjs.map +1 -1
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.mjs.map +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs.map +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs.map +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs.map +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs.map +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs.map +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs.map +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs.map +1 -1
- package/dist/esm/transactions/types.mjs +1 -0
- package/dist/esm/types/abstraction.mjs +1 -1
- package/dist/esm/types/abstraction.mjs.map +1 -1
- package/dist/esm/types/generated/queries.mjs +1 -493
- package/dist/esm/types/generated/queries.mjs.map +1 -1
- package/dist/esm/types/generated/types.mjs +1 -1
- package/dist/esm/types/generated/types.mjs.map +1 -1
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/index.mjs.map +1 -1
- package/dist/esm/types/indexer.mjs +1 -0
- package/dist/esm/types/types.mjs +1 -1
- package/dist/esm/types/types.mjs.map +1 -1
- package/dist/esm/utils/apiEndpoints.mjs +1 -1
- package/dist/esm/utils/apiEndpoints.mjs.map +1 -1
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/const.mjs.map +1 -1
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/helpers.mjs.map +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/index.mjs.map +1 -1
- package/dist/esm/utils/memoize.mjs +1 -1
- package/dist/esm/utils/memoize.mjs.map +1 -1
- package/dist/esm/utils/normalizeBundle.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.mjs.map +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/esm/version.mjs.map +1 -1
- package/package.json +20 -39
- package/src/api/aptos.ts +14 -25
- package/src/core/account/utils/address.ts +0 -22
- package/dist/common/chunk-AWFAHZSB.js +0 -4
- package/dist/common/chunk-AWFAHZSB.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{gb as a,hb as b,ib as c}from"../chunk-PGUSBALH.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-O26BHE5H.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-I7XT6L7S.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-EF4FA5I6.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-ADJMFL73.mjs";import"../chunk-TT3MPSBB.mjs";import"../chunk-TSEAIF34.mjs";import"../chunk-57YZ7I7V.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-DHCGYW3W.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-KB4XOTCR.mjs";import"../chunk-3LJVXUPB.mjs";import"../chunk-CZDNBI5K.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-7ZESTCBD.mjs";import"../chunk-EMR3S3VO.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-GUPVZIYS.mjs";import"../chunk-KDMSOCZY.mjs";export{b as AbstractKeylessAccount,c as TransactionAndProof,a as isKeylessSigner};
|
|
2
2
|
//# sourceMappingURL=AbstractKeylessAccount.mjs.map
|
|
@@ -1 +1 @@
|
|
|
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 MoveJWK,\n getKeylessConfig,\n fetchJWK,\n KeylessConfiguration,\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 getSigningMessage(transaction: AnyRawTransaction): Uint8Array {\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 return txnAndProof.hash();\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 * @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: {\n message: HexInput;\n signature: KeylessSignature;\n jwk: MoveJWK;\n keylessConfig: KeylessConfiguration;\n }): boolean {\n return this.publicKey.verifySignature(args);\n }\n\n async verifySignatureAsync(args: {\n aptosConfig: AptosConfig;\n message: HexInput;\n signature: KeylessSignature;\n options?: { throwErrorWithReason?: boolean };\n }): Promise<boolean> {\n return this.publicKey.verifySignatureAsync({\n ...args,\n });\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 return fetchJWK(args);\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":"AAGA,OAAOA,MAAkB,gBACzB,OAAS,aAAAC,MAAiB,aAC1B,OAAS,+BAAAC,EAAuC,iBAAAC,MAAqB,WACrE,OAAS,kBAAAC,MAAsB,yBAC/B,OACE,gBAAAC,EACA,gBAAAC,EAEA,oBAAAC,EACA,wBAAAC,EACA,oBAAAC,EAGA,oBAAAC,EACA,YAAAC,MAEK,iBAEP,OAAS,oBAAAC,MAAwB,qBACjC,OAAS,OAAAC,MAAW,cACpB,OAAS,iCAAAC,MAAqC,wCAC9C,OAAuB,gBAAAC,MAAgC,SACvD,OAAS,yBAAAC,EAAuB,0BAAAC,MAA8B,oDAE9D,OAAS,mBAAAC,MAAuB,mBAIhC,OAAS,gBAAAC,EAAc,oBAAAC,MAAwB,YAUxC,SAASC,GAAgBC,EAAgC,CAC9D,OAAOA,GAAQ,MAA6B,OAAOA,EAAI,6BAAgC,UACzF,CAQO,MAAeC,EAAf,MAAeA,UAA+BR,CAAuD,CAkHhG,YAAYS,EAanB,CACD,MAAM,EAvDR,KAAS,cAA+BrB,EAAc,UAwDpD,KAAM,CACJ,QAAAsB,EACA,iBAAAC,EACA,UAAAC,EACA,OAAAC,EACA,OAAAC,EACA,IAAAC,EACA,OAAAC,EAC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","KeylessSignature","EphemeralCertificate","ZeroKnowledgeSig","getKeylessConfig","fetchJWK","EphemeralKeyPair","Hex","AccountAuthenticatorSingleKey","Serializable","deriveTransactionType","generateSigningMessage","base64UrlDecode","KeylessError","KeylessErrorType","isKeylessSigner","obj","_AbstractKeylessAccount","args","address","ephemeralKeyPair","publicKey","uidKey","uidVal","aud","pepper","proof","proofFetchCallback","jwt","verificationKeyHash","status","pepperBytes","promise","error","serializer","deserializer","message","signature","transaction","aptosConfig","header","verificationKey","expiryDateSecs","ephemeralPublicKey","ephemeralSignature","raw","signMess","TransactionAndProof","AbstractKeylessAccount"]}
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{pb as a}from"../chunk-PGUSBALH.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-O26BHE5H.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-I7XT6L7S.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-EF4FA5I6.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-ADJMFL73.mjs";import"../chunk-TT3MPSBB.mjs";import"../chunk-TSEAIF34.mjs";import"../chunk-57YZ7I7V.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-DHCGYW3W.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-KB4XOTCR.mjs";import"../chunk-3LJVXUPB.mjs";import"../chunk-CZDNBI5K.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-7ZESTCBD.mjs";import"../chunk-EMR3S3VO.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-GUPVZIYS.mjs";import"../chunk-KDMSOCZY.mjs";export{a as AbstractedAccount};
|
|
2
2
|
//# sourceMappingURL=AbstractedAccount.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{eb as a}from"../chunk-PGUSBALH.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-O26BHE5H.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-I7XT6L7S.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-EF4FA5I6.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-ADJMFL73.mjs";import"../chunk-TT3MPSBB.mjs";import"../chunk-TSEAIF34.mjs";import"../chunk-57YZ7I7V.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-DHCGYW3W.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-KB4XOTCR.mjs";import"../chunk-3LJVXUPB.mjs";import"../chunk-CZDNBI5K.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-7ZESTCBD.mjs";import"../chunk-EMR3S3VO.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-GUPVZIYS.mjs";import"../chunk-KDMSOCZY.mjs";export{a as Account};
|
|
2
2
|
//# sourceMappingURL=Account.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/account/Account.ts"],"sourcesContent":["import type { AccountAuthenticator } from \"../transactions/authenticator/account\";\nimport { HexInput, SigningScheme, SigningSchemeInput } from \"../types\";\nimport type { AccountAddress, AccountAddressInput } from \"../core/accountAddress\";\nimport { AuthenticationKey } from \"../core/authenticationKey\";\nimport { AccountPublicKey, Ed25519PrivateKey, PrivateKeyInput, Signature, VerifySignatureArgs } from \"../core/crypto\";\nimport { Ed25519Account } from \"./Ed25519Account\";\nimport { SingleKeyAccount } from \"./SingleKeyAccount\";\nimport { AnyRawTransaction } from \"../transactions/types\";\nimport { AptosConfig } from \"../api\";\n\n/**\n * Arguments for creating an `Ed25519Account` from an `Ed25519PrivateKey`.\n * To use the SingleKey authentication scheme, set `legacy` to false.\n *\n * @param privateKey - The private key used to create the account.\n * @param address - Optional address for the account.\n * @param legacy - Indicates whether to use legacy authentication (default is true).\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport interface CreateEd25519AccountFromPrivateKeyArgs {\n privateKey: Ed25519PrivateKey;\n address?: AccountAddressInput;\n legacy?: true;\n}\n\n/**\n * Arguments for creating a `SingleKeyAccount` using an `Ed25519PrivateKey`.\n * The `legacy` property must be set to false to utilize the `SingleKey` authentication scheme.\n *\n * @param privateKey - The Ed25519 private key used for account creation.\n * @param address - Optional account address input.\n * @param legacy - Must be false to enable the `SingleKey` authentication scheme.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport interface CreateEd25519SingleKeyAccountFromPrivateKeyArgs {\n privateKey: Ed25519PrivateKey;\n address?: AccountAddressInput;\n legacy: false;\n}\n\n/**\n * Arguments for creating a `SingleKeyAccount` from a supported private key, excluding `Ed25519PrivateKey`.\n * The `legacy` argument is always false and cannot be set to true.\n *\n * @param privateKey - The private key used to create the account.\n * @param address - Optional address input for the account.\n * @param legacy - Always false; cannot be explicitly set to true.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport interface CreateSingleKeyAccountFromPrivateKeyArgs {\n privateKey: PrivateKeyInput;\n address?: AccountAddressInput;\n legacy?: false;\n}\n\n/**\n * Arguments for creating an `Account` from a private key when the key type is unknown at compile time.\n *\n * @param privateKey - The private key used to create the account.\n * @param address - Optional address for the account.\n * @param legacy - Optional flag indicating if the account is a legacy account.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport interface CreateAccountFromPrivateKeyArgs {\n privateKey: PrivateKeyInput;\n address?: AccountAddressInput;\n legacy?: boolean;\n}\n\n/**\n * Arguments for generating an Ed25519 account, specifying the signing scheme and legacy option.\n *\n * @param scheme - The signing scheme to use for the account.\n * @param legacy - Indicates if the account should be created in legacy mode.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport interface GenerateEd25519AccountArgs {\n scheme?: SigningSchemeInput.Ed25519;\n legacy?: true;\n}\n\n/**\n * Arguments for generating a `SingleKeyAccount` with an underlying `Ed25519PrivateKey`.\n * The `legacy` argument must be set to false to ensure an `Ed25519SingleKeyAccount` is returned.\n *\n * @param scheme - Optional signing scheme input for the account.\n * @param legacy - Indicates whether to use legacy account generation.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport interface GenerateEd25519SingleKeyAccountArgs {\n scheme?: SigningSchemeInput.Ed25519;\n legacy: false;\n}\n\n/**\n * Arguments for generating a `SingleKeyAccount` using a supported private key other than `Ed25519PrivateKey`.\n * The `legacy` argument is optional and defaults to false, and cannot be set to true.\n *\n * @param scheme - The signing scheme to use for the account.\n * @param legacy - Indicates whether to use legacy account generation (defaults to false).\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport interface GenerateSingleKeyAccountArgs {\n scheme: Exclude<SigningSchemeInput, SigningSchemeInput.Ed25519>;\n legacy?: false;\n}\n\n/**\n * Arguments for generating an opaque `Account` when the input signature scheme is unknown at compile time.\n *\n * @param scheme - The signing scheme to use for account generation.\n * @param legacy - Indicates whether to use legacy account generation methods.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport interface GenerateAccountArgs {\n scheme?: SigningSchemeInput;\n legacy?: boolean;\n}\n\n/**\n * Arguments for deriving a private key using a mnemonic phrase and a specified BIP44 path.\n *\n * @param path - The BIP44 derivation path for the key.\n * @param mnemonic - The mnemonic phrase used for key generation.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport interface PrivateKeyFromDerivationPathArgs {\n path: string;\n mnemonic: string;\n}\n\n/**\n * Abstract class representing a generic Aptos account.\n *\n * This class serves as a single entry point for account generation, allowing accounts to be created\n * either through `Account.generate()` or `Account.fromDerivationPath`. Although it is defined as an\n * abstract class, it should be treated as an interface and enforced using the `implements` keyword.\n *\n * Note: Generating an account instance does not create the account on-chain.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport abstract class Account {\n /**\n * Public key associated with the account\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n abstract readonly publicKey: AccountPublicKey;\n\n /**\n * Account address associated with the account\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n abstract readonly accountAddress: AccountAddress;\n\n /**\n * Signing scheme used to sign transactions\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n abstract signingScheme: SigningScheme;\n\n /**\n * Generates a new account based on the specified signing scheme and legacy option.\n * This function allows you to create an account with either the Ed25519 signing scheme or a different scheme as specified.\n *\n * @param args - The arguments for generating the account.\n * @param args.scheme - The signing scheme to use for account generation. Defaults to Ed25519.\n * @param args.legacy - Indicates whether to use the legacy account generation method. Defaults to true.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static generate(args?: GenerateEd25519AccountArgs): Ed25519Account;\n static generate(args: GenerateEd25519SingleKeyAccountArgs): SingleKeyAccount;\n static generate(args: GenerateSingleKeyAccountArgs): SingleKeyAccount;\n static generate(args: GenerateAccountArgs): Account;\n static generate(args: GenerateAccountArgs = {}) {\n const { scheme = SigningSchemeInput.Ed25519, legacy = true } = args;\n if (scheme === SigningSchemeInput.Ed25519 && legacy) {\n return Ed25519Account.generate();\n }\n return SingleKeyAccount.generate({ scheme });\n }\n\n /**\n * Creates an account from a given private key and address.\n * This function allows you to instantiate an account based on the provided private key,\n * and it can differentiate between legacy and non-legacy accounts.\n *\n * @param args - The arguments for creating the account.\n * @param args.privateKey - The private key used to create the account.\n * @param args.address - The address associated with the account.\n * @param args.legacy - A boolean indicating whether to create a legacy account (default is true).\n * @returns An instance of either Ed25519Account or SingleKeyAccount based on the provided private key.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static fromPrivateKey(args: CreateEd25519AccountFromPrivateKeyArgs): Ed25519Account;\n static fromPrivateKey(args: CreateSingleKeyAccountFromPrivateKeyArgs): SingleKeyAccount;\n static fromPrivateKey(args: CreateAccountFromPrivateKeyArgs): SingleKeyAccount;\n static fromPrivateKey(args: CreateAccountFromPrivateKeyArgs): Ed25519Account | SingleKeyAccount {\n const { privateKey, address, legacy = true } = args;\n if (privateKey instanceof Ed25519PrivateKey && legacy) {\n return new Ed25519Account({\n privateKey,\n address,\n });\n }\n return new SingleKeyAccount({ privateKey, address });\n }\n\n /**\n * @deprecated use `fromPrivateKey` instead.\n * Instantiates an account using a private key and a specified account address. This is primarily used to instantiate an\n * `Account` that has had its authentication key rotated.\n *\n * @param args - The arguments required to create an account from a private key.\n * @param args.privateKey - The underlying private key for the account.\n * @param args.address - The account address the `Account` will sign for.\n * @param args.legacy - Optional. If set to false, the keypair generated is a Unified keypair. Defaults to generating a Legacy\n * Ed25519 keypair.\n *\n * @returns Account\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static fromPrivateKeyAndAddress(args: CreateAccountFromPrivateKeyArgs) {\n return this.fromPrivateKey(args);\n }\n\n /**\n * Generates an account from a specified derivation path and mnemonic.\n * This function allows you to create an account using different signing schemes based on the provided arguments.\n *\n * @param args - The arguments for generating the account.\n * @param args.scheme - The signing scheme to use for account generation. Defaults to Ed25519.\n * @param args.mnemonic - The mnemonic phrase used to derive the account.\n * @param args.path - The derivation path used to generate the account.\n * @param args.legacy - A boolean indicating whether to use the legacy account generation method. Defaults to true.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static fromDerivationPath(args: GenerateEd25519AccountArgs & PrivateKeyFromDerivationPathArgs): Ed25519Account;\n static fromDerivationPath(\n args: GenerateEd25519SingleKeyAccountArgs & PrivateKeyFromDerivationPathArgs,\n ): SingleKeyAccount;\n static fromDerivationPath(args: GenerateSingleKeyAccountArgs & PrivateKeyFromDerivationPathArgs): SingleKeyAccount;\n static fromDerivationPath(args: GenerateAccountArgs & PrivateKeyFromDerivationPathArgs): Account;\n static fromDerivationPath(args: GenerateAccountArgs & PrivateKeyFromDerivationPathArgs) {\n const { scheme = SigningSchemeInput.Ed25519, mnemonic, path, legacy = true } = args;\n if (scheme === SigningSchemeInput.Ed25519 && legacy) {\n return Ed25519Account.fromDerivationPath({ mnemonic, path });\n }\n return SingleKeyAccount.fromDerivationPath({ scheme, mnemonic, path });\n }\n\n /**\n * Retrieve the authentication key for the associated account using the provided public key.\n * This key enables account owners to rotate their private key(s) associated with the account without changing the address that\n * hosts their account.\n * See here for more info: {@link https://aptos.dev/concepts/accounts#single-signer-authentication}\n *\n * @param args - The arguments for retrieving the authentication key.\n * @param args.publicKey - The public key of the account.\n * @returns The authentication key for the associated account.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static authKey(args: { publicKey: AccountPublicKey }): AuthenticationKey {\n const { publicKey } = args;\n return publicKey.authKey();\n }\n\n /**\n * Sign a message using the available signing capabilities.\n * @param message the signing message, 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 abstract signWithAuthenticator(message: HexInput): AccountAuthenticator;\n\n /**\n * Sign a transaction using the available signing capabilities.\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 abstract signTransactionWithAuthenticator(transaction: AnyRawTransaction): AccountAuthenticator;\n\n /**\n * Sign the given message using the available signing capabilities.\n * @param message in HexInput format\n * @returns Signature\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n abstract sign(message: HexInput): Signature;\n\n /**\n * Sign the given transaction using the available signing capabilities.\n * @param transaction the transaction to be signed\n * @returns Signature\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n abstract signTransaction(transaction: AnyRawTransaction): Signature;\n\n /**\n * Verify the given message and signature with the public key.\n * This function helps ensure the integrity and authenticity of a message by validating its signature.\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 signature.\n * @returns A boolean indicating whether the signature is valid.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n verifySignature(args: VerifySignatureArgs): boolean {\n return this.publicKey.verifySignature(args);\n }\n\n /**\n * Verify the given message and signature with the public key. It fetches any on chain state if needed for verification.\n *\n * @param args - The arguments for verifying the signature.\n * @param args.aptosConfig - The configuration object for connecting to the Aptos network\n * @param args.message - Raw message data in HexInput format.\n * @param args.signature - Signed message signature.\n * @returns A boolean indicating whether the signature is valid.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n async verifySignatureAsync(args: {\n aptosConfig: AptosConfig;\n message: HexInput;\n signature: Signature;\n }): Promise<boolean> {\n return this.publicKey.verifySignatureAsync(args);\n }\n}\n"],"mappings":"AACA,OAAkC,sBAAAA,MAA0B,WAG5D,OAA2B,qBAAAC,MAA0E,iBACrG,OAAS,kBAAAC,MAAsB,mBAC/B,OAAS,oBAAAC,MAAwB,qBAiJ1B,MAAeC,CAAQ,CAoC5B,OAAO,SAASC,EAA4B,CAAC,EAAG,CAC9C,KAAM,CAAE,OAAAC,EAASN,EAAmB,QAAS,OAAAO,EAAS,EAAK,EAAIF,EAC/D,OAAIC,IAAWN,EAAmB,SAAWO,EACpCL,EAAe,SAAS,EAE1BC,EAAiB,SAAS,CAAE,OAAAG,CAAO,CAAC,CAC7C,CAkBA,OAAO,eAAeD,EAA0E,CAC9F,KAAM,CAAE,WAAAG,EAAY,QAAAC,EAAS,OAAAF,EAAS,EAAK,EAAIF,EAC/C,OAAIG,aAAsBP,GAAqBM,EACtC,IAAIL,EAAe,CACxB,WAAAM,EACA,QAAAC,CACF,CAAC,EAEI,IAAIN,EAAiB,CAAE,WAAAK,EAAY,QAAAC,CAAQ,CAAC,CACrD,CAiBA,OAAO,yBAAyBJ,EAAuC,CACrE,OAAO,KAAK,eAAeA,CAAI,CACjC,CAoBA,OAAO,mBAAmBA,EAA8D,CACtF,KAAM,CAAE,OAAAC,EAASN,EAAmB,QAAS,SAAAU,EAAU,KAAAC,EAAM,OAAAJ,EAAS,EAAK,EAAIF,EAC/E,OAAIC,IAAWN,EAAmB,SAAWO,EACpCL,EAAe,mBAAmB,CAAE,SAAAQ,EAAU,KAAAC,CAAK,CAAC,EAEtDR,EAAiB,mBAAmB,CAAE,OAAAG,EAAQ,SAAAI,EAAU,KAAAC,CAAK,CAAC,CACvE,CAcA,OAAO,QAAQN,EAA0D,CACvE,KAAM,CAAE,UAAAO,CAAU,EAAIP,EACtB,OAAOO,EAAU,QAAQ,CAC3B,CAiDA,gBAAgBP,EAAoC,CAClD,OAAO,KAAK,UAAU,gBAAgBA,CAAI,CAC5C,CAaA,MAAM,qBAAqBA,EAIN,CACnB,OAAO,KAAK,UAAU,qBAAqBA,CAAI,CACjD,CACF","names":["SigningSchemeInput","Ed25519PrivateKey","Ed25519Account","SingleKeyAccount","Account","args","scheme","legacy","privateKey","address","mnemonic","path","publicKey"]}
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ob as a}from"../chunk-PGUSBALH.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-O26BHE5H.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-I7XT6L7S.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-EF4FA5I6.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-ADJMFL73.mjs";import"../chunk-TT3MPSBB.mjs";import"../chunk-TSEAIF34.mjs";import"../chunk-57YZ7I7V.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-DHCGYW3W.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-KB4XOTCR.mjs";import"../chunk-3LJVXUPB.mjs";import"../chunk-CZDNBI5K.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-7ZESTCBD.mjs";import"../chunk-EMR3S3VO.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-GUPVZIYS.mjs";import"../chunk-KDMSOCZY.mjs";export{a as AccountUtils};
|
|
2
2
|
//# sourceMappingURL=AccountUtils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/account/AccountUtils.ts"],"sourcesContent":["import { Deserializer, Serializer } from \"../bcs\";\nimport { AnyPublicKeyVariant, HexInput, SigningScheme } from \"../types\";\nimport { MultiKeyAccount } from \"./MultiKeyAccount\";\nimport { Account } from \"./Account\";\nimport { Ed25519Account } from \"./Ed25519Account\";\nimport { isSingleKeySigner, SingleKeyAccount, SingleKeySignerOrLegacyEd25519Account } from \"./SingleKeyAccount\";\nimport { KeylessAccount } from \"./KeylessAccount\";\nimport { FederatedKeylessAccount } from \"./FederatedKeylessAccount\";\nimport { AbstractKeylessAccount } from \"./AbstractKeylessAccount\";\nimport {\n AccountAddress,\n Ed25519PrivateKey,\n getIssAudAndUidVal,\n Hex,\n MultiKey,\n Secp256k1PrivateKey,\n ZeroKnowledgeSig,\n} from \"../core\";\nimport { deserializeSchemeAndAddress } from \"./utils\";\nimport { EphemeralKeyPair } from \"./EphemeralKeyPair\";\n\nfunction serializeKeylessAccountCommon(account: AbstractKeylessAccount, serializer: Serializer): void {\n serializer.serializeStr(account.jwt);\n serializer.serializeStr(account.uidKey);\n serializer.serializeFixedBytes(account.pepper);\n account.ephemeralKeyPair.serialize(serializer);\n if (account.proof === undefined) {\n throw new Error(\"Cannot serialize - proof undefined\");\n }\n account.proof.serialize(serializer);\n serializer.serializeOption(account.verificationKeyHash, 32);\n}\n\nfunction deserializeKeylessAccountCommon(deserializer: Deserializer): {\n jwt: string;\n uidKey: string;\n pepper: Uint8Array;\n ephemeralKeyPair: EphemeralKeyPair;\n proof: ZeroKnowledgeSig;\n verificationKeyHash?: Uint8Array;\n} {\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 return { jwt, uidKey, pepper, ephemeralKeyPair, proof, verificationKeyHash };\n}\n\n/**\n * Utility functions for working with accounts.\n */\nexport namespace AccountUtils {\n export function toBytes(account: Account): Uint8Array {\n const serializer = new Serializer();\n serializer.serializeU32AsUleb128(account.signingScheme);\n account.accountAddress.serialize(serializer);\n switch (account.signingScheme) {\n case SigningScheme.Ed25519:\n (account as Ed25519Account).privateKey.serialize(serializer);\n return serializer.toUint8Array();\n case SigningScheme.SingleKey: {\n if (!isSingleKeySigner(account)) {\n throw new Error(\"Account is not a SingleKeySigner\");\n }\n const anyPublicKey = account.getAnyPublicKey();\n serializer.serializeU32AsUleb128(anyPublicKey.variant);\n switch (anyPublicKey.variant) {\n case AnyPublicKeyVariant.Keyless: {\n const keylessAccount = account as KeylessAccount;\n serializeKeylessAccountCommon(keylessAccount, serializer);\n return serializer.toUint8Array();\n }\n case AnyPublicKeyVariant.FederatedKeyless: {\n const federatedKeylessAccount = account as FederatedKeylessAccount;\n serializeKeylessAccountCommon(federatedKeylessAccount, serializer);\n federatedKeylessAccount.publicKey.jwkAddress.serialize(serializer);\n serializer.serializeBool(federatedKeylessAccount.audless);\n return serializer.toUint8Array();\n }\n case AnyPublicKeyVariant.Secp256k1:\n case AnyPublicKeyVariant.Ed25519: {\n const singleKeyAccount = account as SingleKeyAccount;\n singleKeyAccount.privateKey.serialize(serializer);\n return serializer.toUint8Array();\n }\n default: {\n throw new Error(`Invalid public key variant: ${anyPublicKey.variant}`);\n }\n }\n }\n case SigningScheme.MultiKey: {\n const multiKeyAccount = account as MultiKeyAccount;\n multiKeyAccount.publicKey.serialize(serializer);\n serializer.serializeU32AsUleb128(multiKeyAccount.signers.length);\n multiKeyAccount.signers.forEach((signer) => {\n serializer.serializeFixedBytes(toBytes(signer));\n });\n return serializer.toUint8Array();\n }\n default:\n throw new Error(`Deserialization of Account failed: invalid signingScheme value ${account.signingScheme}`);\n }\n }\n\n export function toHexStringWithoutPrefix(account: Account): string {\n return Hex.hexInputToStringWithoutPrefix(toBytes(account));\n }\n\n export function toHexString(account: Account): string {\n return Hex.hexInputToString(toBytes(account));\n }\n\n export function deserialize(deserializer: Deserializer): Account {\n const { address, signingScheme } = deserializeSchemeAndAddress(deserializer);\n switch (signingScheme) {\n case SigningScheme.Ed25519: {\n const privateKey = Ed25519PrivateKey.deserialize(deserializer);\n return new Ed25519Account({ privateKey, address });\n }\n case SigningScheme.SingleKey: {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n switch (variantIndex) {\n case AnyPublicKeyVariant.Ed25519: {\n const privateKey = Ed25519PrivateKey.deserialize(deserializer);\n return new SingleKeyAccount({ privateKey, address });\n }\n case AnyPublicKeyVariant.Secp256k1: {\n const privateKey = Secp256k1PrivateKey.deserialize(deserializer);\n return new SingleKeyAccount({ privateKey, address });\n }\n case AnyPublicKeyVariant.Keyless: {\n const keylessComponents = deserializeKeylessAccountCommon(deserializer);\n const jwtClaims = getIssAudAndUidVal(keylessComponents);\n return new KeylessAccount({ ...keylessComponents, ...jwtClaims });\n }\n case AnyPublicKeyVariant.FederatedKeyless: {\n const keylessComponents = deserializeKeylessAccountCommon(deserializer);\n const jwkAddress = AccountAddress.deserialize(deserializer);\n const audless = deserializer.deserializeBool();\n const jwtClaims = getIssAudAndUidVal(keylessComponents);\n return new FederatedKeylessAccount({ ...keylessComponents, ...jwtClaims, jwkAddress, audless });\n }\n default:\n throw new Error(`Unsupported public key variant ${variantIndex}`);\n }\n }\n case SigningScheme.MultiKey: {\n const multiKey = MultiKey.deserialize(deserializer);\n const length = deserializer.deserializeUleb128AsU32();\n const signers = new Array<SingleKeySignerOrLegacyEd25519Account>();\n for (let i = 0; i < length; i += 1) {\n const signer = deserialize(deserializer);\n if (!isSingleKeySigner(signer) && !(signer instanceof Ed25519Account)) {\n throw new Error(\n \"Deserialization of MultiKeyAccount failed. Signer is not a SingleKeySigner or Ed25519Account\",\n );\n }\n signers.push(signer);\n }\n return new MultiKeyAccount({ multiKey, signers, address });\n }\n default:\n throw new Error(`Deserialization of Account failed: invalid signingScheme value ${signingScheme}`);\n }\n }\n\n export function keylessAccountFromHex(hex: HexInput): KeylessAccount {\n const account = fromHex(hex);\n if (!(account instanceof KeylessAccount)) {\n throw new Error(\"Deserialization of KeylessAccount failed\");\n }\n return account;\n }\n\n export function federatedKeylessAccountFromHex(hex: HexInput): FederatedKeylessAccount {\n const account = fromHex(hex);\n if (!(account instanceof FederatedKeylessAccount)) {\n throw new Error(\"Deserialization of FederatedKeylessAccount failed\");\n }\n return account;\n }\n\n export function multiKeyAccountFromHex(hex: HexInput): MultiKeyAccount {\n const account = fromHex(hex);\n if (!(account instanceof MultiKeyAccount)) {\n throw new Error(\"Deserialization of MultiKeyAccount failed\");\n }\n return account;\n }\n\n export function singleKeyAccountFromHex(hex: HexInput): SingleKeyAccount {\n const account = fromHex(hex);\n if (!(account instanceof SingleKeyAccount)) {\n throw new Error(\"Deserialization of SingleKeyAccount failed\");\n }\n return account;\n }\n\n export function ed25519AccountFromHex(hex: HexInput): Ed25519Account {\n const account = fromHex(hex);\n if (!(account instanceof Ed25519Account)) {\n throw new Error(\"Deserialization of Ed25519Account failed\");\n }\n return account;\n }\n\n export function fromHex(hex: HexInput): Account {\n return deserialize(Deserializer.fromHex(hex));\n }\n\n export function fromBytes(bytes: Uint8Array): Account {\n return fromHex(bytes);\n }\n}\n"],"mappings":"AAAA,OAAS,gBAAAA,EAAc,cAAAC,MAAkB,SACzC,OAAS,uBAAAC,EAA+B,iBAAAC,MAAqB,WAC7D,OAAS,mBAAAC,MAAuB,oBAEhC,OAAS,kBAAAC,MAAsB,mBAC/B,OAAS,qBAAAC,EAAmB,oBAAAC,MAA+D,qBAC3F,OAAS,kBAAAC,MAAsB,mBAC/B,OAAS,2BAAAC,MAA+B,4BAExC,OACE,kBAAAC,EACA,qBAAAC,EACA,sBAAAC,EACA,OAAAC,EACA,YAAAC,EACA,uBAAAC,EACA,oBAAAC,MACK,UACP,OAAS,+BAAAC,MAAmC,UAC5C,OAAS,oBAAAC,MAAwB,qBAEjC,SAASC,EAA8BC,EAAiCC,EAA8B,CAKpG,GAJAA,EAAW,aAAaD,EAAQ,GAAG,EACnCC,EAAW,aAAaD,EAAQ,MAAM,EACtCC,EAAW,oBAAoBD,EAAQ,MAAM,EAC7CA,EAAQ,iBAAi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MAAM,0CAA0C,EAE5D,OAAOY,CACT,CANOU,EAAS,sBAAAqB,EAQT,SAASG,EAA+BF,EAAwC,CACrF,MAAMhC,EAAUiC,EAAQD,CAAG,EAC3B,GAAI,EAAEhC,aAAmBX,GACvB,MAAM,IAAI,MAAM,mDAAmD,EAErE,OAAOW,CACT,CANOU,EAAS,+BAAAwB,EAQT,SAASC,EAAuBH,EAAgC,CACrE,MAAMhC,EAAUiC,EAAQD,CAAG,EAC3B,GAAI,EAAEhC,aAAmBhB,GACvB,MAAM,IAAI,MAAM,2CAA2C,EAE7D,OAAOgB,CACT,CANOU,EAAS,uBAAAyB,EAQT,SAASC,EAAwBJ,EAAiC,CACvE,MAAMhC,EAAUiC,EAAQD,CAAG,EAC3B,GAAI,EAAEhC,aAAmBb,GACvB,MAAM,IAAI,MAAM,4CAA4C,EAE9D,OAAOa,CACT,CANOU,EAAS,wBAAA0B,EAQT,SAASC,EAAsBL,EAA+B,CACnE,MAAMhC,EAAUiC,EAAQD,CAAG,EAC3B,GAAI,EAAEhC,aAAmBf,GACvB,MAAM,IAAI,MAAM,0CAA0C,EAE5D,OAAOe,CACT,CANOU,EAAS,sBAAA2B,EAQT,SAASJ,EAAQD,EAAwB,CAC9C,OAAOd,EAAYtC,EAAa,QAAQoD,CAAG,CAAC,CAC9C,CAFOtB,EAAS,QAAAuB,EAIT,SAASK,EAAUC,EAA4B,CACpD,OAAON,EAAQM,CAAK,CACtB,CAFO7B,EAAS,UAAA4B,IA/JD5B,MAAA","names":["Deserializer","Serializer","AnyPublicKeyVariant","SigningScheme","MultiKeyAccount","Ed25519Account","isSingleKeySigner","SingleKeyAccount","KeylessAccount","FederatedKeylessAccount","AccountAddress","Ed25519PrivateKey","getIssAudAndUidVal","Hex","MultiKey","Secp256k1PrivateKey","ZeroKnowledgeSig","deserializeSchemeAndAddress","EphemeralKeyPair","serializeKeylessAccountCommon","account","serializer","deserializeKeylessAccountCommon","deserializer","jwt","uidKey","pepper","ephemeralKeyPair","proof","verificationKeyHash","AccountUtils","toBytes","anyPublicKey","federatedKeylessAccount","multiKeyAccount","signer","toHexStringWithoutPrefix","toHexString","deserialize","address","signingScheme","privateKey","variantIndex","keylessComponents","jwtClaims","jwkAddress","audless","multiKey","length","signers","i","keylessAccountFromHex","hex","fromHex","federatedKeylessAccountFromHex","multiKeyAccountFromHex","singleKeyAccountFromHex","ed25519AccountFromHex","fromBytes","bytes"]}
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{qb as a}from"../chunk-PGUSBALH.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-O26BHE5H.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-I7XT6L7S.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-EF4FA5I6.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-ADJMFL73.mjs";import"../chunk-TT3MPSBB.mjs";import"../chunk-TSEAIF34.mjs";import"../chunk-57YZ7I7V.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-DHCGYW3W.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-KB4XOTCR.mjs";import"../chunk-3LJVXUPB.mjs";import"../chunk-CZDNBI5K.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-7ZESTCBD.mjs";import"../chunk-EMR3S3VO.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-GUPVZIYS.mjs";import"../chunk-KDMSOCZY.mjs";export{a as DerivableAbstractedAccount};
|
|
2
2
|
//# sourceMappingURL=DerivableAbstractedAccount.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bb as a}from"../chunk-PGUSBALH.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-O26BHE5H.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-I7XT6L7S.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-EF4FA5I6.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-ADJMFL73.mjs";import"../chunk-TT3MPSBB.mjs";import"../chunk-TSEAIF34.mjs";import"../chunk-57YZ7I7V.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-DHCGYW3W.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-KB4XOTCR.mjs";import"../chunk-3LJVXUPB.mjs";import"../chunk-CZDNBI5K.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-7ZESTCBD.mjs";import"../chunk-EMR3S3VO.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-GUPVZIYS.mjs";import"../chunk-KDMSOCZY.mjs";export{a as Ed25519Account};
|
|
2
2
|
//# sourceMappingURL=Ed25519Account.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{fb as a}from"../chunk-PGUSBALH.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-O26BHE5H.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-I7XT6L7S.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-EF4FA5I6.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-ADJMFL73.mjs";import"../chunk-TT3MPSBB.mjs";import"../chunk-TSEAIF34.mjs";import"../chunk-57YZ7I7V.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-DHCGYW3W.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-KB4XOTCR.mjs";import"../chunk-3LJVXUPB.mjs";import"../chunk-CZDNBI5K.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-7ZESTCBD.mjs";import"../chunk-EMR3S3VO.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-GUPVZIYS.mjs";import"../chunk-KDMSOCZY.mjs";export{a as EphemeralKeyPair};
|
|
2
2
|
//# sourceMappingURL=EphemeralKeyPair.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/account/EphemeralKeyPair.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { randomBytes } from \"@noble/hashes/utils\";\n\nimport {\n bytesToBigIntLE,\n padAndPackBytesWithLen,\n poseidonHash,\n Ed25519PrivateKey,\n EphemeralPublicKey,\n EphemeralSignature,\n PrivateKey,\n} from \"../core/crypto\";\nimport { Hex } from \"../core/hex\";\nimport { EphemeralPublicKeyVariant, HexInput } from \"../types\";\nimport { Deserializer, Serializable, Serializer } from \"../bcs\";\nimport { floorToWholeHour, nowInSeconds } from \"../utils/helpers\";\n\nconst TWO_WEEKS_IN_SECONDS = 1_209_600;\n\n/**\n * Represents an ephemeral key pair used for signing transactions via the Keyless authentication scheme.\n * This key pair is temporary and includes an expiration time.\n * For more details on how this class is used, refer to the documentation:\n * https://aptos.dev/guides/keyless-accounts/#1-present-the-user-with-a-sign-in-with-idp-button-on-the-ui\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nexport class EphemeralKeyPair extends Serializable {\n static readonly BLINDER_LENGTH: number = 31;\n\n /**\n * A byte array of length BLINDER_LENGTH used to obfuscate the public key from the IdP.\n * Used in calculating the nonce passed to the IdP and as a secret witness in proof generation.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly blinder: Uint8Array;\n\n /**\n * A timestamp in seconds indicating when the ephemeral key pair is expired. After expiry, a new\n * EphemeralKeyPair must be generated and a new JWT needs to be created.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly expiryDateSecs: number;\n\n /**\n * The value passed to the IdP when the user authenticates. It consists of a hash of the\n * ephemeral public key, expiry date, and blinder.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n readonly nonce: string;\n\n /**\n * A private key used to sign transactions. This private key is not tied to any account on the chain as it\n * is ephemeral (not permanent) in nature.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n private privateKey: PrivateKey;\n\n /**\n * A public key used to verify transactions. This public key is not tied to any account on the chain as it\n * is ephemeral (not permanent) in nature.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n private publicKey: EphemeralPublicKey;\n\n /**\n * Creates an instance of the class with a specified private key, optional expiry date, and optional blinder.\n * This constructor initializes the public key, sets the expiry date to a default value if not provided,\n * generates a blinder if not supplied, and calculates the nonce based on the public key, expiry date, and blinder.\n *\n * @param args - The parameters for constructing the instance.\n * @param args.privateKey - The private key used for creating the instance.\n * @param args.expiryDateSecs - Optional expiry date in seconds from the current time. Defaults to two weeks from now.\n * @param args.blinder - Optional blinder value. If not provided, a new blinder will be generated.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n constructor(args: { privateKey: PrivateKey; expiryDateSecs?: number; blinder?: HexInput }) {\n super();\n const { privateKey, expiryDateSecs, blinder } = args;\n this.privateKey = privateKey;\n this.publicKey = new EphemeralPublicKey(privateKey.publicKey());\n // By default, we set the expiry date to be two weeks in the future floored to the nearest hour\n this.expiryDateSecs = expiryDateSecs || floorToWholeHour(nowInSeconds() + TWO_WEEKS_IN_SECONDS);\n // Generate the blinder if not provided\n this.blinder = blinder !== undefined ? Hex.fromHexInput(blinder).toUint8Array() : generateBlinder();\n // Calculate the nonce\n const fields = padAndPackBytesWithLen(this.publicKey.bcsToBytes(), 93);\n fields.push(BigInt(this.expiryDateSecs));\n fields.push(bytesToBigIntLE(this.blinder));\n const nonceHash = poseidonHash(fields);\n this.nonce = nonceHash.toString();\n }\n\n /**\n * Returns the public key of the key pair.\n * @return EphemeralPublicKey\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n getPublicKey(): EphemeralPublicKey {\n return this.publicKey;\n }\n\n /**\n * Checks if the current time has surpassed the expiry date of the key pair.\n * @return boolean - Returns true if the key pair is expired, otherwise false.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n isExpired(): boolean {\n const currentTimeSecs: number = Math.floor(Date.now() / 1000);\n return currentTimeSecs > this.expiryDateSecs;\n }\n\n /**\n * Serializes the object's properties into a format suitable for transmission or storage.\n * This function is essential for preparing the object data for serialization processes.\n *\n * @param serializer - The serializer instance used to serialize the object's properties.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n serialize(serializer: Serializer): void {\n serializer.serializeU32AsUleb128(this.publicKey.variant);\n serializer.serializeBytes(this.privateKey.toUint8Array());\n serializer.serializeU64(this.expiryDateSecs);\n serializer.serializeFixedBytes(this.blinder);\n }\n\n /**\n * Deserializes an ephemeral key pair from the provided deserializer.\n * This function helps in reconstructing an ephemeral key pair, which is essential for cryptographic operations.\n *\n * @param deserializer - The deserializer instance used to read the serialized data.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static deserialize(deserializer: Deserializer): EphemeralKeyPair {\n const variantIndex = deserializer.deserializeUleb128AsU32();\n let privateKey: PrivateKey;\n switch (variantIndex) {\n case EphemeralPublicKeyVariant.Ed25519:\n privateKey = Ed25519PrivateKey.deserialize(deserializer);\n break;\n default:\n throw new Error(`Unknown variant index for EphemeralPublicKey: ${variantIndex}`);\n }\n const expiryDateSecs = deserializer.deserializeU64();\n const blinder = deserializer.deserializeFixedBytes(31);\n return new EphemeralKeyPair({ privateKey, expiryDateSecs: Number(expiryDateSecs), blinder });\n }\n\n /**\n * Deserialize a byte array into an EphemeralKeyPair object.\n * This function allows you to reconstruct an EphemeralKeyPair from its serialized byte representation.\n *\n * @param bytes - The byte array representing the serialized EphemeralKeyPair.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static fromBytes(bytes: Uint8Array): EphemeralKeyPair {\n return EphemeralKeyPair.deserialize(new Deserializer(bytes));\n }\n\n /**\n * Generates a new ephemeral key pair with an optional expiry date.\n * This function allows you to create a temporary key pair for secure operations.\n *\n * @param args - Optional parameters for key pair generation.\n * @param args.scheme - The type of key pair to use for the EphemeralKeyPair. Only Ed25519 is supported for now.\n * @param args.expiryDateSecs - The date of expiry for the key pair in seconds.\n * @returns An instance of EphemeralKeyPair containing the generated private key and expiry date.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n static generate(args?: { scheme?: EphemeralPublicKeyVariant; expiryDateSecs?: number }): EphemeralKeyPair {\n let privateKey: PrivateKey;\n\n switch (args?.scheme) {\n case EphemeralPublicKeyVariant.Ed25519:\n default:\n privateKey = Ed25519PrivateKey.generate();\n }\n\n return new EphemeralKeyPair({ privateKey, expiryDateSecs: args?.expiryDateSecs });\n }\n\n /**\n * Sign the given data using the private key, returning an ephemeral signature.\n * This function is essential for creating a secure signature that can be used for authentication or verification purposes.\n *\n * @param data - The data to be signed, provided in HexInput format.\n * @returns EphemeralSignature - The resulting ephemeral signature.\n * @throws Error - Throws an error if the EphemeralKeyPair has expired.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n sign(data: HexInput): EphemeralSignature {\n if (this.isExpired()) {\n throw new Error(\"EphemeralKeyPair has expired\");\n }\n return new EphemeralSignature(this.privateKey.sign(data));\n }\n}\n\n/**\n * Generates a random byte array of length EphemeralKeyPair.BLINDER_LENGTH.\n * @returns Uint8Array A random byte array used for blinding.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\nfunction generateBlinder(): Uint8Array {\n return randomBytes(EphemeralKeyPair.BLINDER_LENGTH);\n}\n"],"mappings":"AAGA,OAAS,eAAAA,MAAmB,sBAE5B,OACE,mBAAAC,EACA,0BAAAC,EACA,gBAAAC,EACA,qBAAAC,EACA,sBAAAC,EACA,sBAAAC,MAEK,iBACP,OAAS,OAAAC,MAAW,cACpB,OAAS,6BAAAC,MAA2C,WACpD,OAAS,gBAAAC,EAAc,gBAAAC,MAAgC,SACvD,OAAS,oBAAAC,EAAkB,gBAAAC,MAAoB,mBAE/C,MAAMC,EAAuB,QAUhBC,EAAN,MAAMA,UAAyBJ,CAAa,CAuDjD,YAAYK,EAA+E,CACz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AiB,YAAY,IAAIL,EAAagB,CAAK,CAAC,CAC7D,CAaA,OAAO,SAASV,EAA0F,CACxG,IAAIC,EAEJ,OAAQD,GAAM,OAAQ,CACpB,KAAKP,EAA0B,QAC/B,QACEQ,EAAaZ,EAAkB,SAAS,CAC5C,CAEA,OAAO,IAAIU,EAAiB,CAAE,WAAAE,EAAY,eAAgBD,GAAM,cAAe,CAAC,CAClF,CAYA,KAAKW,EAAoC,CACvC,GAAI,KAAK,UAAU,EACjB,MAAM,IAAI,MAAM,8BAA8B,EAEhD,OAAO,IAAIpB,EAAmB,KAAK,WAAW,KAAKoB,CAAI,CAAC,CAC1D,CACF,EAtLaZ,EACK,eAAyB,GADpC,IAAMa,EAANb,EA8LP,SAASK,GAA8B,CACrC,OAAOnB,EAAY2B,EAAiB,cAAc,CACpD","names":["randomBytes","bytesToBigIntLE","padAndPackBytesWithLen","poseidonHash","Ed25519PrivateKey","EphemeralPublicKey","EphemeralSignature","Hex","EphemeralPublicKeyVariant","Deserializer","Serializable","floorToWholeHour","nowInSeconds","TWO_WEEKS_IN_SECONDS","_EphemeralKeyPair","args","privateKey","expiryDateSecs","blinder","generateBlinder","fields","nonceHash","serializer","deserializer","variantIndex","bytes","data","EphemeralKeyPair"]}
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{kb as a}from"../chunk-PGUSBALH.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-O26BHE5H.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-I7XT6L7S.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-EF4FA5I6.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-ADJMFL73.mjs";import"../chunk-TT3MPSBB.mjs";import"../chunk-TSEAIF34.mjs";import"../chunk-57YZ7I7V.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-DHCGYW3W.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-KB4XOTCR.mjs";import"../chunk-3LJVXUPB.mjs";import"../chunk-CZDNBI5K.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-7ZESTCBD.mjs";import"../chunk-EMR3S3VO.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-GUPVZIYS.mjs";import"../chunk-KDMSOCZY.mjs";export{a as FederatedKeylessAccount};
|
|
2
2
|
//# sourceMappingURL=FederatedKeylessAccount.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jb as a}from"../chunk-PGUSBALH.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-O26BHE5H.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-I7XT6L7S.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-EF4FA5I6.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-ADJMFL73.mjs";import"../chunk-TT3MPSBB.mjs";import"../chunk-TSEAIF34.mjs";import"../chunk-57YZ7I7V.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-DHCGYW3W.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-KB4XOTCR.mjs";import"../chunk-3LJVXUPB.mjs";import"../chunk-CZDNBI5K.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-7ZESTCBD.mjs";import"../chunk-EMR3S3VO.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-GUPVZIYS.mjs";import"../chunk-KDMSOCZY.mjs";export{a as KeylessAccount};
|
|
2
2
|
//# sourceMappingURL=KeylessAccount.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{mb as a}from"../chunk-PGUSBALH.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-O26BHE5H.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-I7XT6L7S.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-EF4FA5I6.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-ADJMFL73.mjs";import"../chunk-TT3MPSBB.mjs";import"../chunk-TSEAIF34.mjs";import"../chunk-57YZ7I7V.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-DHCGYW3W.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-KB4XOTCR.mjs";import"../chunk-3LJVXUPB.mjs";import"../chunk-CZDNBI5K.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-7ZESTCBD.mjs";import"../chunk-EMR3S3VO.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-GUPVZIYS.mjs";import"../chunk-KDMSOCZY.mjs";export{a as MultiEd25519Account};
|
|
2
2
|
//# sourceMappingURL=MultiEd25519Account.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{lb as a}from"../chunk-PGUSBALH.mjs";import"../chunk-UYVPNUH3.mjs";import"../chunk-XKUIMGKU.mjs";import"../chunk-N6YTF76Q.mjs";import"../chunk-V74WPKSY.mjs";import"../chunk-G3MHXDYA.mjs";import"../chunk-O26BHE5H.mjs";import"../chunk-A5L76YP7.mjs";import"../chunk-I7XT6L7S.mjs";import"../chunk-5HXLZHDW.mjs";import"../chunk-GOXRBEIJ.mjs";import"../chunk-2PASUPUO.mjs";import"../chunk-XJJVJOX5.mjs";import"../chunk-NECL5FCQ.mjs";import"../chunk-4QMXOWHP.mjs";import"../chunk-EF4FA5I6.mjs";import"../chunk-WCMW2L3P.mjs";import"../chunk-WSR5EBJM.mjs";import"../chunk-C3Q23D22.mjs";import"../chunk-ZP4DWSQA.mjs";import"../chunk-QREVMGQZ.mjs";import"../chunk-V3MBJJTL.mjs";import"../chunk-FGFLPH5K.mjs";import"../chunk-ADJMFL73.mjs";import"../chunk-TT3MPSBB.mjs";import"../chunk-TSEAIF34.mjs";import"../chunk-57YZ7I7V.mjs";import"../chunk-YOZBVVKL.mjs";import"../chunk-DHCGYW3W.mjs";import"../chunk-UL777LTI.mjs";import"../chunk-7ECCT6PK.mjs";import"../chunk-KB4XOTCR.mjs";import"../chunk-3LJVXUPB.mjs";import"../chunk-CZDNBI5K.mjs";import"../chunk-HGLO5LDS.mjs";import"../chunk-CW35YAMN.mjs";import"../chunk-6WDVDEQZ.mjs";import"../chunk-FZY4PMEE.mjs";import"../chunk-TOBQ5UE6.mjs";import"../chunk-MT2RJ7H3.mjs";import"../chunk-Q4W3WJ2U.mjs";import"../chunk-ORMOQWWH.mjs";import"../chunk-FLZPUYXQ.mjs";import"../chunk-7DQDJ2SA.mjs";import"../chunk-HNBVYE3N.mjs";import"../chunk-RGKRCZ36.mjs";import"../chunk-FD6FGKYY.mjs";import"../chunk-4WPQQPUF.mjs";import"../chunk-MCFQE4GC.mjs";import"../chunk-EBMEXURY.mjs";import"../chunk-STY74NUA.mjs";import"../chunk-IF4UU2MT.mjs";import"../chunk-56CNRT2K.mjs";import"../chunk-7ZESTCBD.mjs";import"../chunk-EMR3S3VO.mjs";import"../chunk-OLILO7VD.mjs";import"../chunk-GUPVZIYS.mjs";import"../chunk-KDMSOCZY.mjs";export{a as MultiKeyAccount};
|
|
2
2
|
//# sourceMappingURL=MultiKeyAccount.mjs.map
|
|
@@ -1 +1 @@
|
|
|
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 * Note: If you are using KeylessAccounts, you must use `verifySignatureAsync` instead.\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: { message: HexInput; signature: MultiKeySignature }): boolean {\n return this.publicKey.verifySignature(args);\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 * @param args.options.throwErrorWithReason - Whether to throw an error with the reason for the verification failure.\n * @returns A boolean indicating whether the signatures are valid for the message.\n * @group Implementation\n * @category Account (On-Chain Model)\n */\n async verifySignatureAsync(args: {\n aptosConfig: AptosConfig;\n message: HexInput;\n signature: MultiKeySignature;\n options?: { throwErrorWithReason?: boolean };\n }): Promise<boolean> {\n return await this.publicKey.verifySignatureAsync(args);\n }\n}\n"],"mappings":"AAIA,OAAS,YAAAA,EAAU,qBAAAC,MAAoC,iBACvD,OAAS,kBAAAC,MAA2C,yBACpD,OAAmB,iBAAAC,MAAqB,WACxC,OAAS,gCAAAC,MAAoC,wCAE7C,OAAS,0BAAAC,MAA6C,2BAEtD,OAAS,oBAAAC,MAAgF,qBACzF,OAAS,kBAAAC,MAAsB,mBAyBxB,MAAMC,CAAkD,CAmD7D,YAAYC,EAIT,CAnCH,KAAS,cAA+BN,EAAc,SAoCpD,KAAM,CAAE,SAAAO,EAAU,QAAAC,CAAQ,EAAIF,EAExBG,EAA6BH,EAAK,QAAQ,IAAKI,GACnDA,aAAkBN,EAAiBD,EAAiB,mBAAmBO,CAAM,EAAIA,CACnF,EAEA,GAAIH,EAAS,mBAAqBE,EAAQ,OACxC,MAAM,IAAI,MAER,wEAAwEF,EAAS,kBAAkB,sBAAsBE,EAAQ,MAAM,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AAmC,CAIvC,MAAMC,EAHiB,KAAK,QAAQ,OACjCZ,GAAWA,aAAkBR,CAChC,EACgC,IAAI,MAAOQ,GAAWA,EAAO,kBAAkB,CAAC,EAChF,MAAM,QAAQ,IAAIY,CAAQ,CAC5B,CAQA,MAAM,4BAA4BC,EAAyC,CAIzE,MAAMD,EAHiB,KAAK,QAAQ,OACjCZ,GAAWA,aAAkBR,CAChC,EACgC,IAAKQ,GAAWA,EAAO,4BAA4Ba,CAAW,CAAC,EAC/F,MAAM,QAAQ,IAAID,CAAQ,CAC5B,CASA,KAAKE,EAAmC,CACtC,MAAMC,EAAa,CAAC,EACpB,UAAWf,KAAU,KAAK,QACxBe,EAAW,KAAKf,EAAO,KAAKc,CAAI,CAAC,EAEnC,OAAO,IAAI1B,EAAkB,CAAE,WAAA2B,EAAY,OAAQ,KAAK,gBAAiB,CAAC,CAC5E,CAWA,gBAAgBJ,EAAmD,CACjE,MAAMI,EAAa,CAAC,EACpB,UAAWf,KAAU,KAAK,QACxBe,EAAW,KAAKf,EAAO,gBAAgBW,CAAW,CAAC,EAErD,OAAO,IAAIvB,EAAkB,CAAE,WAAA2B,EAAY,OAAQ,KAAK,gBAAiB,CAAC,CAC5E,CAeA,gBAAgBnB,EAAoE,CAClF,OAAO,KAAK,UAAU,gBAAgBA,CAAI,CAC5C,CAeA,MAAM,qBAAqBA,EAKN,CACnB,OAAO,MAAM,KAAK,UAAU,qBAAqBA,CAAI,CACvD,CACF","names":["MultiKey","MultiKeySignature","AccountAddress","SigningScheme","AccountAuthenticatorMultiKey","AbstractKeylessAccount","SingleKeyAccount","Ed25519Account","MultiKeyAccount","args","multiKey","address","signers","signer","bitPositions","signersAndBitPosition","index","a","b","value","publicKeys","signaturesRequired","account","message","transaction","promises","aptosConfig","data","signatures"]}
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|