@aptos-labs/ts-sdk 3.0.0 → 3.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/{account-CEmLe1wW.d.ts → account-Bb5REyaT.d.ts} +60 -11
- package/dist/common/chunk-6MMUUJHX.js +4 -0
- package/dist/common/{chunk-5JIJXVJ5.js.map → chunk-6MMUUJHX.js.map} +1 -1
- package/dist/common/cli/index.d.ts +1 -1
- package/dist/common/cli/index.js +1 -1
- package/dist/common/index.d.ts +121 -9
- package/dist/common/index.js +55 -34
- package/dist/common/index.js.map +1 -1
- package/dist/esm/{Ed25519Account-Ccxj1zdx.d.mts → Ed25519Account-ndmdpFe9.d.mts} +1 -1
- package/dist/esm/account/AbstractKeylessAccount.d.mts +3 -3
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
- package/dist/esm/account/AbstractedAccount.d.mts +2 -2
- package/dist/esm/account/AbstractedAccount.mjs +1 -1
- package/dist/esm/account/Account.d.mts +2 -2
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/AccountUtils.d.mts +3 -3
- package/dist/esm/account/AccountUtils.mjs +1 -1
- package/dist/esm/account/DerivableAbstractedAccount.d.mts +2 -2
- package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -1
- package/dist/esm/account/Ed25519Account.d.mts +2 -2
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.d.mts +1 -1
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/FederatedKeylessAccount.d.mts +4 -3
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
- package/dist/esm/account/KeylessAccount.d.mts +4 -3
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiEd25519Account.d.mts +2 -2
- package/dist/esm/account/MultiEd25519Account.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.d.mts +3 -3
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.d.mts +2 -2
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.d.mts +3 -3
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/account/utils.d.mts +1 -1
- package/dist/esm/account/utils.mjs +1 -1
- package/dist/esm/{account-9G6tix5T.d.mts → account--Q9z_xMN.d.mts} +37 -3
- package/dist/esm/api/account/abstraction.d.mts +1 -1
- package/dist/esm/api/account/abstraction.mjs +1 -1
- package/dist/esm/api/account.d.mts +94 -3
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.d.mts +2 -2
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +6 -4
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +1 -1
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +1 -1
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.d.mts +2 -2
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.d.mts +1 -1
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.d.mts +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.d.mts +2 -2
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.d.mts +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +6 -4
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.d.mts +3 -3
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.d.mts +1 -1
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.d.mts +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.d.mts +1 -1
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +3 -2
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/helpers.d.mts +22 -9
- package/dist/esm/api/transactionSubmission/helpers.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.d.mts +2 -2
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/simulate.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.d.mts +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.d.mts +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/consts.d.mts +1 -1
- package/dist/esm/bcs/deserializer.d.mts +1 -1
- package/dist/esm/bcs/index.d.mts +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/entryFunctionBytes.d.mts +1 -1
- package/dist/esm/bcs/serializable/fixedBytes.d.mts +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.d.mts +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.d.mts +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/serializer.d.mts +1 -1
- package/dist/esm/{chunk-YHGGNYYL.mjs → chunk-2PF7UFKU.mjs} +2 -2
- package/dist/esm/chunk-5HXLZHDW.mjs +1 -0
- package/dist/esm/chunk-5HXLZHDW.mjs.map +1 -0
- package/dist/esm/chunk-75NVN2CG.mjs +2 -0
- package/dist/esm/{chunk-HMUIOIBG.mjs.map → chunk-75NVN2CG.mjs.map} +1 -1
- package/dist/esm/chunk-IJE2LVZG.mjs +2 -0
- package/dist/esm/chunk-IJE2LVZG.mjs.map +1 -0
- package/dist/esm/chunk-JCFTAG5Z.mjs +2 -0
- package/dist/esm/{chunk-RJ7F4JDV.mjs.map → chunk-JCFTAG5Z.mjs.map} +1 -1
- package/dist/esm/{chunk-FSP4QM2T.mjs → chunk-JL6RR7ML.mjs} +2 -2
- package/dist/esm/chunk-L3GEIX2R.mjs +6 -0
- package/dist/esm/chunk-L3GEIX2R.mjs.map +1 -0
- package/dist/esm/{chunk-WOTQ7227.mjs → chunk-LIS2GDBI.mjs} +2 -2
- package/dist/esm/{chunk-7T62PEFI.mjs → chunk-LJEERFEH.mjs} +2 -2
- package/dist/esm/{chunk-IDHVW7HS.mjs → chunk-O7WBNU4J.mjs} +2 -2
- package/dist/esm/{chunk-SAMHWS73.mjs → chunk-PXQPKCDD.mjs} +2 -2
- package/dist/esm/chunk-QREVMGQZ.mjs +2 -0
- package/dist/esm/chunk-QREVMGQZ.mjs.map +1 -0
- package/dist/esm/{chunk-R7NQJWDG.mjs → chunk-S335GK43.mjs} +2 -2
- package/dist/esm/{chunk-PFXXFUBL.mjs → chunk-SZE4RT4B.mjs} +2 -2
- package/dist/esm/{chunk-VHNX2NUR.mjs → chunk-UL777LTI.mjs} +47 -26
- package/dist/esm/chunk-UL777LTI.mjs.map +1 -0
- package/dist/esm/{chunk-2XQKGWHQ.mjs → chunk-V74WPKSY.mjs} +2 -2
- package/dist/esm/{chunk-5ZRPV4YI.mjs → chunk-VW26RFJ7.mjs} +2 -2
- package/dist/esm/{chunk-UIVX6WSC.mjs → chunk-Y7ZQTLH4.mjs} +2 -2
- package/dist/esm/cli/index.d.mts +1 -1
- package/dist/esm/cli/index.mjs +1 -1
- package/dist/esm/cli/localNode.mjs +1 -1
- package/dist/esm/cli/move.d.mts +1 -1
- package/dist/esm/client/core.d.mts +1 -1
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.d.mts +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.d.mts +1 -1
- package/dist/esm/client/post.mjs +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/utils/address.d.mts +1 -1
- package/dist/esm/core/account/utils/address.mjs +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/accountAddress.d.mts +1 -1
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.d.mts +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/abstraction.d.mts +1 -1
- package/dist/esm/core/crypto/abstraction.mjs +1 -1
- package/dist/esm/core/crypto/deserializationUtils.d.mts +1 -1
- package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.d.mts +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.d.mts +1 -1
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/federatedKeyless.d.mts +2 -2
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +3 -2
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.d.mts +2 -2
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.d.mts +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.d.mts +1 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/privateKey.d.mts +1 -1
- package/dist/esm/core/crypto/privateKey.mjs +1 -1
- package/dist/esm/core/crypto/proof.d.mts +1 -1
- package/dist/esm/core/crypto/proof.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.d.mts +1 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.d.mts +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/signature.d.mts +1 -1
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.d.mts +1 -1
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/crypto/types.d.mts +11 -0
- package/dist/esm/core/crypto/types.mjs +2 -0
- package/dist/esm/core/crypto/types.mjs.map +1 -0
- package/dist/esm/core/crypto/utils.d.mts +1 -1
- package/dist/esm/core/hex.d.mts +1 -1
- package/dist/esm/core/index.d.mts +3 -2
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/errors/index.d.mts +1 -1
- package/dist/esm/errors/index.mjs +1 -1
- package/dist/esm/{federatedKeyless-CVKW5pnz.d.mts → federatedKeyless-CiyplsOB.d.mts} +1 -1
- package/dist/esm/index.d.mts +6 -4
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/abstraction.d.mts +1 -1
- package/dist/esm/internal/abstraction.mjs +1 -1
- package/dist/esm/internal/account.d.mts +38 -8
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.d.mts +2 -2
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +2 -2
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.d.mts +1 -1
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.d.mts +2 -2
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.d.mts +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.d.mts +12 -3
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/object.d.mts +1 -1
- package/dist/esm/internal/object.mjs +1 -1
- package/dist/esm/internal/staking.d.mts +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.d.mts +1 -1
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.d.mts +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.d.mts +2 -2
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/utils/index.d.mts +1 -1
- package/dist/esm/internal/utils/index.mjs +1 -1
- package/dist/esm/internal/utils/utils.d.mts +1 -1
- package/dist/esm/internal/utils/utils.mjs +1 -1
- package/dist/esm/internal/view.d.mts +1 -1
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.d.mts +1 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.d.mts +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +1 -1
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.d.mts +1 -1
- package/dist/esm/transactions/instances/identifier.d.mts +1 -1
- package/dist/esm/transactions/instances/index.d.mts +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.d.mts +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.d.mts +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.d.mts +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionArgument.d.mts +1 -1
- package/dist/esm/transactions/instances/transactionPayload.d.mts +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.d.mts +2 -2
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +2 -2
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +2 -2
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.d.mts +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.d.mts +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +1 -1
- package/dist/esm/types/generated/operations.d.mts +37 -10
- package/dist/esm/types/generated/queries.d.mts +6 -2
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/generated/types.d.mts +584 -1172
- package/dist/esm/types/generated/types.mjs +1 -1
- package/dist/esm/types/generated/types.mjs.map +1 -1
- package/dist/esm/types/index.d.mts +2 -2
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/indexer.d.mts +8 -2
- package/dist/esm/types/types.d.mts +1 -1
- package/dist/esm/types/types.mjs +1 -1
- package/dist/esm/utils/const.d.mts +1 -0
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/helpers.d.mts +1 -1
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.d.mts +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.d.mts +1 -1
- package/dist/esm/utils/normalizeBundle.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/src/account/FederatedKeylessAccount.ts +7 -1
- package/src/account/KeylessAccount.ts +17 -2
- package/src/api/account.ts +135 -2
- package/src/api/transaction.ts +1 -0
- package/src/api/transactionSubmission/helpers.ts +26 -20
- package/src/api/transactionSubmission/submit.ts +3 -3
- package/src/core/crypto/index.ts +1 -0
- package/src/core/crypto/multiEd25519.ts +26 -0
- package/src/core/crypto/multiKey.ts +6 -0
- package/src/core/crypto/types.ts +9 -0
- package/src/internal/account.ts +526 -59
- package/src/internal/keyless.ts +10 -0
- package/src/internal/queries/getAccountAddressesForAuthKey.graphql +8 -0
- package/src/internal/queries/getAuthKeysForPublicKey.graphql +11 -0
- package/src/types/codegen.yaml +1 -1
- package/src/types/generated/operations.ts +39 -8
- package/src/types/generated/queries.ts +53 -0
- package/src/types/generated/types.ts +620 -1239
- package/src/types/indexer.ts +8 -0
- package/src/types/types.ts +40 -3
- package/src/utils/const.ts +1 -0
- package/src/version.ts +1 -1
- package/dist/common/chunk-5JIJXVJ5.js +0 -4
- package/dist/esm/chunk-4H2RMR7D.mjs +0 -2
- package/dist/esm/chunk-4H2RMR7D.mjs.map +0 -1
- package/dist/esm/chunk-GMDBBVDH.mjs +0 -6
- package/dist/esm/chunk-GMDBBVDH.mjs.map +0 -1
- package/dist/esm/chunk-HMUIOIBG.mjs +0 -2
- package/dist/esm/chunk-RJ7F4JDV.mjs +0 -2
- package/dist/esm/chunk-VHNX2NUR.mjs.map +0 -1
- package/dist/esm/chunk-W4BSN6SK.mjs +0 -2
- package/dist/esm/chunk-W4BSN6SK.mjs.map +0 -1
- /package/dist/esm/{chunk-YHGGNYYL.mjs.map → chunk-2PF7UFKU.mjs.map} +0 -0
- /package/dist/esm/{chunk-FSP4QM2T.mjs.map → chunk-JL6RR7ML.mjs.map} +0 -0
- /package/dist/esm/{chunk-WOTQ7227.mjs.map → chunk-LIS2GDBI.mjs.map} +0 -0
- /package/dist/esm/{chunk-7T62PEFI.mjs.map → chunk-LJEERFEH.mjs.map} +0 -0
- /package/dist/esm/{chunk-IDHVW7HS.mjs.map → chunk-O7WBNU4J.mjs.map} +0 -0
- /package/dist/esm/{chunk-SAMHWS73.mjs.map → chunk-PXQPKCDD.mjs.map} +0 -0
- /package/dist/esm/{chunk-R7NQJWDG.mjs.map → chunk-S335GK43.mjs.map} +0 -0
- /package/dist/esm/{chunk-PFXXFUBL.mjs.map → chunk-SZE4RT4B.mjs.map} +0 -0
- /package/dist/esm/{chunk-2XQKGWHQ.mjs.map → chunk-V74WPKSY.mjs.map} +0 -0
- /package/dist/esm/{chunk-5ZRPV4YI.mjs.map → chunk-VW26RFJ7.mjs.map} +0 -0
- /package/dist/esm/{chunk-UIVX6WSC.mjs.map → chunk-Y7ZQTLH4.mjs.map} +0 -0
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as xi}from"./chunk-2XQKGWHQ.mjs";import{a as zn,b as Pr}from"./chunk-A5L76YP7.mjs";import{a as kn}from"./chunk-XKUIMGKU.mjs";import{a as F}from"./chunk-N6YTF76Q.mjs";import{a as Qe,b as st,c as tn}from"./chunk-CO67Y6YE.mjs";import{a as Dn,b as Hi}from"./chunk-PFXXFUBL.mjs";import{a as Ke,b as vn,c as vt,d as mr,e as _t}from"./chunk-GOXRBEIJ.mjs";import{a as ai}from"./chunk-XJJVJOX5.mjs";import{a as gr,b as si}from"./chunk-RQX6JOEN.mjs";import{a as It,b as je}from"./chunk-CFQFFP6N.mjs";import{b as k,c as $,d as O}from"./chunk-UQWF24SS.mjs";import{b as We}from"./chunk-WSR5EBJM.mjs";import{a as xe}from"./chunk-WCMW2L3P.mjs";import{a as Tr,b as Sr}from"./chunk-W4BSN6SK.mjs";import{a as Y}from"./chunk-FGFLPH5K.mjs";import{a as xr}from"./chunk-FSP4QM2T.mjs";import{a as Li}from"./chunk-SAMHWS73.mjs";import{a as h}from"./chunk-7T62PEFI.mjs";import{a as qi,b as Rn,c as $i,d as Wi,e as ji,g as Je,h as Qi,k as Ji,l as Zi}from"./chunk-R7NQJWDG.mjs";import{a as Ut}from"./chunk-YOZBVVKL.mjs";import{a as Un,b as Bi,c as w,e as Mi,f as Vi}from"./chunk-IDHVW7HS.mjs";import{A as Ni,d as Ki,e as Ei,f as Ci,g as Ii,i as vi,j as _i,k as ki,m as Fi,n as Ui,o as Di,p as Ri,q as zi,r as Oi,s as Dt,t as br,u as Fn,y as Gi,z as wr}from"./chunk-VHNX2NUR.mjs";import{b as ot,d as wi,e as fr,f as hr}from"./chunk-YHGGNYYL.mjs";import{b as Ft,d as Ti,e as Si,f as Pi}from"./chunk-5ZRPV4YI.mjs";import{a as li}from"./chunk-CW35YAMN.mjs";import{d as b,e as bi}from"./chunk-6WDVDEQZ.mjs";import{a as en,b as gi,c as ke,d as mi,e as yi,f as Ai,i as fi,j as hi,k as pe,l as kt}from"./chunk-7DQDJ2SA.mjs";import{a as _n}from"./chunk-HNBVYE3N.mjs";import{b as c}from"./chunk-RGKRCZ36.mjs";import{a as P,b as oi,c as _,d as Z}from"./chunk-Q4W3WJ2U.mjs";import{a as B,b as Pe,c as xt,d as Kt,e as de,f as Et,g as Ct}from"./chunk-ORMOQWWH.mjs";import{a as ii}from"./chunk-TOBQ5UE6.mjs";import{a as Pt}from"./chunk-MT2RJ7H3.mjs";import{H as J}from"./chunk-4H2RMR7D.mjs";import{a as H}from"./chunk-FLZPUYXQ.mjs";import{a as S,b as Q}from"./chunk-EBMEXURY.mjs";import{b as T,c as ri}from"./chunk-STY74NUA.mjs";import{d as ni}from"./chunk-56CNRT2K.mjs";import{a as Yi}from"./chunk-UIVX6WSC.mjs";import{g as yr}from"./chunk-4RXKALLC.mjs";import{d as ci,e as _e,f as ui,g as di,h as Ar,j as pi}from"./chunk-RJ7F4JDV.mjs";import{a as St}from"./chunk-KDMSOCZY.mjs";import{jwtDecode as Ws}from"jwt-decode";import{sha3_256 as tc}from"@noble/hashes/sha3";import{bn254 as Se}from"@noble/curves/bn254";import{bytesToNumberBE as nc}from"@noble/curves/abstract/utils";var M=class n extends We{constructor(e,t){super(),this.jwkAddress=c.from(e),this.keylessPublicKey=t}authKey(){let e=new Q;return e.serializeU32AsUleb128(4),e.serializeFixedBytes(this.bcsToBytes()),Y.fromSchemeAndBytes({scheme:2,input:e.toUint8Array()})}verifySignature(e){try{return Gn({...e,publicKey:this}),!0}catch{return!1}}serialize(e){this.jwkAddress.serialize(e),this.keylessPublicKey.serialize(e)}static deserialize(e){let t=c.deserialize(e),r=E.deserialize(e);return new n(t,r)}static isPublicKey(e){return e instanceof n}async verifySignatureAsync(e){return Kr({...e,publicKey:this})}static create(e){return new n(e.jwkAddress,E.create(e))}static fromJwtAndPepper(e){return new n(e.jwkAddress,E.fromJwtAndPepper(e))}static isInstance(e){return"jwkAddress"in e&&e.jwkAddress instanceof c&&"keylessPublicKey"in e&&e.keylessPublicKey instanceof E}};import{encode as rc}from"js-base64";var I=class n extends We{constructor(e){if(super(),this.publicKey=e,e instanceof k)this.variant=0;else if(e instanceof Qe)this.variant=1;else if(e instanceof E)this.variant=3;else if(e instanceof M)this.variant=4;else throw new Error("Unsupported public key type")}verifySignature(e){let{message:t,signature:r}=e;if(this.publicKey instanceof E)throw new Error("Use verifySignatureAsync to verify Keyless signatures");return this.publicKey.verifySignature({message:t,signature:r.signature})}async verifySignatureAsync(e){if(!(e.signature instanceof U)){if(e.options?.throwErrorWithReason)throw new Error("Signature must be an instance of AnySignature");return!1}return await this.publicKey.verifySignatureAsync({...e,signature:e.signature.signature})}authKey(){return Y.fromSchemeAndBytes({scheme:2,input:this.toUint8Array()})}toUint8Array(){return this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.publicKey.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32(),r;switch(t){case 0:r=k.deserialize(e);break;case 1:r=Qe.deserialize(e);break;case 3:r=E.deserialize(e);break;case 4:r=M.deserialize(e);break;default:throw new Error(`Unknown variant index for AnyPublicKey: ${t}`)}return new n(r)}static isPublicKey(e){return e instanceof n}isEd25519(){return this.publicKey instanceof k}isSecp256k1PublicKey(){return this.publicKey instanceof Qe}static isInstance(e){return"publicKey"in e&&"variant"in e}},U=class n extends xe{constructor(e){if(super(),this.signature=e,e instanceof O)this.variant=0;else if(e instanceof tn)this.variant=1;else if(e instanceof X)this.variant=3;else throw new Error("Unsupported signature type")}toUint8Array(){return console.warn("[Aptos SDK] Calls to AnySignature.toUint8Array() will soon return the underlying signature bytes. Use AnySignature.bcsToBytes() instead."),this.bcsToBytes()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32(),r;switch(t){case 0:r=O.deserialize(e);break;case 1:r=tn.deserialize(e);break;case 3:r=X.deserialize(e);break;default:throw new Error(`Unknown variant index for AnySignature: ${t}`)}return new n(r)}static isInstance(e){return"signature"in e&&typeof e.signature=="object"&&e.signature!==null&&"toUint8Array"in e.signature}};function js(n){let e=n;return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>24}var Nn=3,nn=class extends We{constructor(e){super(),this.publicKeys=e.publicKeys}createBitmap(e){let{bits:t}=e,r=128,i=new Uint8Array([0,0,0,0]),o=new Set;return t.forEach((s,a)=>{if(a+1>this.publicKeys.length)throw new Error(`Signature index ${a+1} is out of public keys range, ${this.publicKeys.length}.`);if(o.has(s))throw new Error(`Duplicate bit ${s} detected.`);o.add(s);let u=Math.floor(s/8),d=i[u];d|=r>>s%8,i[u]=d}),i}getIndex(e){let t=this.publicKeys.findIndex(r=>r.toString()===e.toString());if(t!==-1)return t;throw new Error(`Public key ${e} not found in multi key set ${this.publicKeys}`)}},le=class n extends nn{constructor(e){let{publicKeys:t,signaturesRequired:r}=e;if(super({publicKeys:t}),r<1)throw new Error("The number of required signatures needs to be greater than 0");if(t.length<r)throw new Error(`Provided ${t.length} public keys is smaller than the ${r} required signatures`);if(this.publicKeys=t.map(i=>i instanceof I?i:new I(i)),r>Nn&&this.publicKeys.filter(o=>o.variant===3||o.variant===4).length>Nn)throw new Error(`Construction of MultiKey with more than ${Nn} keyless public keys is not allowed when signaturesRequired
|
|
2
|
-
is greater than ${Nn}. This is because a maximum of 3 keyless signatures are supported for a
|
|
3
|
-
K-of-N MultiKey transaction.`);this.signaturesRequired=r}verifySignature(e){let{message:t,signature:r}=e;if(r.signatures.length!==this.signaturesRequired)throw new Error("The number of signatures does not match the number of required signatures");let i=r.bitMapToSignerIndices();for(let o=0;o<r.signatures.length;o+=1){let s=r.signatures[o];if(!this.publicKeys[i[o]].verifySignature({message:t,signature:s}))return!1}return!0}async verifySignatureAsync(e){let{signature:t}=e;try{if(!(t instanceof ge))throw new Error("Signature is not a MultiKeySignature");if(t.signatures.length!==this.signaturesRequired)throw new Error("The number of signatures does not match the number of required signatures");let r=t.bitMapToSignerIndices();for(let i=0;i<t.signatures.length;i+=1){let o=t.signatures[i];if(!await this.publicKeys[r[i]].verifySignatureAsync({...e,signature:o}))return!1}return!0}catch(r){if(e.options?.throwErrorWithReason)throw r;return!1}}authKey(){return Y.fromSchemeAndBytes({scheme:3,input:this.toUint8Array()})}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let t=e.deserializeVector(I),r=e.deserializeU8();return new n({publicKeys:t,signaturesRequired:r})}getIndex(e){let t=e instanceof I?e:new I(e);return super.getIndex(t)}static isInstance(e){return"publicKeys"in e&&"signaturesRequired"in e}},ie=class ie extends xe{constructor(e){super();let{signatures:t,bitmap:r}=e;if(t.length>ie.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${ie.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=t.map(o=>o instanceof U?o:new U(o)),!(r instanceof Uint8Array))this.bitmap=ie.createBitmap({bits:r});else{if(r.length!==ie.BITMAP_LEN)throw new Error(`"bitmap" length should be ${ie.BITMAP_LEN}`);this.bitmap=r}let i=this.bitmap.reduce((o,s)=>o+js(s),0);if(i!==this.signatures.length)throw new Error(`Expecting ${i} signatures from the bitmap, but got ${this.signatures.length}`)}static createBitmap(e){let{bits:t}=e,r=128,i=new Uint8Array([0,0,0,0]),o=new Set;return t.forEach(s=>{if(s>=ie.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${ie.MAX_SIGNATURES_SUPPORTED-1}.`);if(o.has(s))throw new Error("Duplicate bits detected.");o.add(s);let a=Math.floor(s/8),u=i[a];u|=r>>s%8,i[a]=u}),i}bitMapToSignerIndices(){let e=[];for(let t=0;t<this.bitmap.length;t+=1){let r=this.bitmap[t];for(let i=0;i<8;i+=1)(r&128>>i)!==0&&e.push(t*8+i)}return e}serialize(e){e.serializeVector(this.signatures),e.serializeBytes(this.bitmap)}static deserialize(e){let t=e.deserializeVector(U),r=e.deserializeBytes();return new ie({signatures:t,bitmap:r})}};ie.BITMAP_LEN=4,ie.MAX_SIGNATURES_SUPPORTED=ie.BITMAP_LEN*8;var ge=ie;var me=class me extends nn{constructor(e){let{publicKeys:t,threshold:r}=e;if(super({publicKeys:t}),t.length>me.MAX_KEYS||t.length<me.MIN_KEYS)throw new Error(`Must have between ${me.MIN_KEYS} and ${me.MAX_KEYS} public keys, inclusive`);if(r<me.MIN_THRESHOLD||r>t.length)throw new Error(`Threshold must be between ${me.MIN_THRESHOLD} and ${t.length}, inclusive`);this.publicKeys=t,this.threshold=r}verifySignature(e){let{message:t,signature:r}=e;if(!(r instanceof he))return!1;let i=[];for(let o=0;o<4;o+=1)for(let s=0;s<8;s+=1)if((r.bitmap[o]&1<<7-s)!==0){let u=o*8+s;i.push(u)}if(i.length!==r.signatures.length)throw new Error("Bitmap and signatures length mismatch");if(i.length<this.threshold)throw new Error("Not enough signatures");for(let o=0;o<i.length;o+=1)if(!this.publicKeys[i[o]].verifySignature({message:t,signature:r.signatures[o]}))return!1;return!0}async verifySignatureAsync(e){return this.verifySignature(e)}authKey(){return Y.fromSchemeAndBytes({scheme:1,input:this.toUint8Array()})}toUint8Array(){let e=new Uint8Array(this.publicKeys.length*k.LENGTH+1);return this.publicKeys.forEach((t,r)=>{e.set(t.toUint8Array(),r*k.LENGTH)}),e[this.publicKeys.length*k.LENGTH]=this.threshold,e}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes(),r=t[t.length-1],i=[];for(let o=0;o<t.length-1;o+=k.LENGTH){let s=o;i.push(new k(t.subarray(s,s+k.LENGTH)))}return new me({publicKeys:i,threshold:r})}getIndex(e){return super.getIndex(e)}};me.MAX_KEYS=32,me.MIN_KEYS=2,me.MIN_THRESHOLD=1;var Ze=me,oe=class oe extends xe{constructor(e){super();let{signatures:t,bitmap:r}=e;if(t.length>oe.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${oe.MAX_SIGNATURES_SUPPORTED}`);if(this.signatures=t,!(r instanceof Uint8Array))this.bitmap=oe.createBitmap({bits:r});else{if(r.length!==oe.BITMAP_LEN)throw new Error(`"bitmap" length should be ${oe.BITMAP_LEN}`);this.bitmap=r}}toUint8Array(){let e=new Uint8Array(this.signatures.length*O.LENGTH+oe.BITMAP_LEN);return this.signatures.forEach((t,r)=>{e.set(t.toUint8Array(),r*O.LENGTH)}),e.set(this.bitmap,this.signatures.length*O.LENGTH),e}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let t=e.deserializeBytes(),r=t.subarray(t.length-4),i=[];for(let o=0;o<t.length-r.length;o+=O.LENGTH){let s=o;i.push(new O(t.subarray(s,s+O.LENGTH)))}return new oe({signatures:i,bitmap:r})}static createBitmap(e){let{bits:t}=e,r=128,i=new Uint8Array([0,0,0,0]),o=new Set;return t.forEach((s,a)=>{if(s>=oe.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${oe.MAX_SIGNATURES_SUPPORTED-1}.`);if(o.has(s))throw new Error("Duplicate bits detected.");if(a>0&&s<=t[a-1])throw new Error("The bits need to be sorted in ascending order.");o.add(s);let u=Math.floor(s/8),d=i[u];d|=r>>s%8,i[u]=d}),i}};oe.MAX_SIGNATURES_SUPPORTED=32,oe.BITMAP_LEN=4;var he=oe;var Bn="Multiple possible deserializations found";function hu(n){let e=[k,I,Ze,le,E,M,Qe],t;for(let r of e)try{let i=H.fromHex(n),o=r.deserialize(i);if(i.assertFinished(),t)throw new Error(`${Bn}: ${n}`);t=o}catch(i){if(i instanceof Error&&i.message.includes(Bn))throw i}if(!t)throw new Error(`Failed to deserialize public key: ${n}`);return t}function bu(n){let e=[O,U,he,ge,X,tn],t;for(let r of e)try{let i=H.fromHex(n),o=r.deserialize(i);if(i.assertFinished(),t)throw new Error(`${Bn}: ${n}`);t=o}catch(i){if(i instanceof Error&&i.message.includes(Bn))throw i}if(!t)throw new Error(`Failed to deserialize signature: ${n}`);return t}var L=class extends S{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return be.load(e);case 1:return Fe.load(e);case 2:return ee.load(e);case 3:return Ee.load(e);case 4:return Rt.load(e);case 5:return at.load(e);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${t}`)}}isEd25519(){return this instanceof be}isMultiEd25519(){return this instanceof Fe}isSingleKey(){return this instanceof ee}isMultiKey(){return this instanceof Ee}},be=class n extends L{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let t=k.deserialize(e),r=O.deserialize(e);return new n(t,r)}},Fe=class n extends L{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let t=Ze.deserialize(e),r=he.deserialize(e);return new n(t,r)}},ee=class n extends L{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(2),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let t=I.deserialize(e),r=U.deserialize(e);return new n(t,r)}},Ee=class n extends L{constructor(e,t){super(),this.public_keys=e,this.signatures=t}serialize(e){e.serializeU32AsUleb128(3),this.public_keys.serialize(e),this.signatures.serialize(e)}static load(e){let t=le.deserialize(e),r=ge.deserialize(e);return new n(t,r)}},Rt=class n extends L{serialize(e){e.serializeU32AsUleb128(4)}static load(e){return new n}},at=class n extends L{constructor(e,t,r,i){if(super(),!kt(e))throw new Error(`Invalid function info ${e} passed into AccountAuthenticatorAbstraction`);this.functionInfo=e,this.authenticator=r,this.signingMessageDigest=T.fromHexInput(T.fromHexInput(t).toUint8Array()),this.accountIdentity=i}serialize(e){e.serializeU32AsUleb128(5);let{moduleAddress:t,moduleName:r,functionName:i}=pe(this.functionInfo);c.fromString(t).serialize(e),e.serializeStr(r),e.serializeStr(i),this.accountIdentity?e.serializeU32AsUleb128(1):e.serializeU32AsUleb128(0),e.serializeBytes(this.signingMessageDigest.toUint8Array()),this.accountIdentity?e.serializeBytes(this.authenticator):e.serializeFixedBytes(this.authenticator),this.accountIdentity&&e.serializeBytes(this.accountIdentity)}static load(e){let t=c.deserialize(e),r=e.deserializeStr(),i=e.deserializeStr(),o=e.deserializeUleb128AsU32();if(o===0){let s=e.deserializeBytes(),a=e.deserializeFixedBytes(e.remaining());return new n(`${t}::${r}::${i}`,s,a)}if(o===1){let s=e.deserializeBytes(),a=e.deserializeBytes(),u=e.deserializeBytes();return new n(`${t}::${r}::${i}`,s,a,u)}throw new Error(`Unknown variant index for AccountAuthenticatorAbstraction: ${o}`)}};import{sha3_256 as Js}from"@noble/hashes/sha3";var rn=class n extends S{constructor(e,t){super(),this.address=e,this.name=t}static fromStr(e){let t=e.split("::");if(t.length!==2)throw new Error("Invalid module id.");return new n(c.fromString(t[0]),new F(t[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){let t=c.deserialize(e),r=F.deserialize(e);return new n(t,r)}};var R=class n extends S{deserialize(e){let t=c.deserialize(e),r=F.deserialize(e),i=F.deserialize(e),o=e.deserializeVector(n);return new Ce(t,r,i,o)}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return N.load(e);case 1:return se.load(e);case 2:return q.load(e);case 3:return Re.load(e);case 4:return D.load(e);case 5:return ct.load(e);case 6:return K.load(e);case 7:return m.load(e);case 8:return Ue.load(e);case 9:return De.load(e);case 10:return ze.load(e);case 255:return z.load(e);default:throw new Error(`Unknown variant index for TypeTag: ${t}`)}}isBool(){return this instanceof N}isAddress(){return this instanceof D}isGeneric(){return this instanceof z}isSigner(){return this instanceof ct}isVector(){return this instanceof K}isStruct(){return this instanceof m}isU8(){return this instanceof se}isU16(){return this instanceof Ue}isU32(){return this instanceof De}isU64(){return this instanceof q}isU128(){return this instanceof Re}isU256(){return this instanceof ze}isPrimitive(){return this instanceof ct||this instanceof D||this instanceof N||this instanceof se||this instanceof Ue||this instanceof De||this instanceof q||this instanceof Re||this instanceof ze}},N=class n extends R{toString(){return"bool"}serialize(e){e.serializeU32AsUleb128(0)}static load(e){return new n}},se=class n extends R{toString(){return"u8"}serialize(e){e.serializeU32AsUleb128(1)}static load(e){return new n}},Ue=class n extends R{toString(){return"u16"}serialize(e){e.serializeU32AsUleb128(8)}static load(e){return new n}},De=class n extends R{toString(){return"u32"}serialize(e){e.serializeU32AsUleb128(9)}static load(e){return new n}},q=class n extends R{toString(){return"u64"}serialize(e){e.serializeU32AsUleb128(2)}static load(e){return new n}},Re=class n extends R{toString(){return"u128"}serialize(e){e.serializeU32AsUleb128(3)}static load(e){return new n}},ze=class n extends R{toString(){return"u256"}serialize(e){e.serializeU32AsUleb128(10)}static load(e){return new n}},D=class n extends R{toString(){return"address"}serialize(e){e.serializeU32AsUleb128(4)}static load(e){return new n}},ct=class n extends R{toString(){return"signer"}serialize(e){e.serializeU32AsUleb128(5)}static load(e){return new n}},Mn=class n extends R{constructor(t){super();this.value=t}toString(){return`&${this.value.toString()}`}serialize(t){t.serializeU32AsUleb128(254)}static load(t){let r=R.deserialize(t);return new n(r)}},z=class n extends R{constructor(t){super();this.value=t;if(t<0)throw new Error("Generic type parameter index cannot be negative")}toString(){return`T${this.value}`}serialize(t){t.serializeU32AsUleb128(255),t.serializeU32(this.value)}static load(t){let r=t.deserializeU32();return new n(r)}},K=class n extends R{constructor(t){super();this.value=t}toString(){return`vector<${this.value.toString()}>`}static u8(){return new n(new se)}serialize(t){t.serializeU32AsUleb128(6),this.value.serialize(t)}static load(t){let r=R.deserialize(t);return new n(r)}},m=class n extends R{constructor(t){super();this.value=t}toString(){let t="";return this.value.typeArgs.length>0&&(t=`<${this.value.typeArgs.map(r=>r.toString()).join(", ")}>`),`${this.value.address.toString()}::${this.value.moduleName.identifier}::${this.value.name.identifier}${t}`}serialize(t){t.serializeU32AsUleb128(7),this.value.serialize(t)}static load(t){let r=Ce.deserialize(t);return new n(r)}isTypeTag(t,r,i){return this.value.moduleName.identifier===r&&this.value.name.identifier===i&&this.value.address.equals(t)}isString(){return this.isTypeTag(c.ONE,"string","String")}isOption(){return this.isTypeTag(c.ONE,"option","Option")}isObject(){return this.isTypeTag(c.ONE,"object","Object")}isDelegationKey(){return this.isTypeTag(c.ONE,"permissioned_delegation","DelegationKey")}isRateLimiter(){return this.isTypeTag(c.ONE,"rate_limiter","RateLimiter")}},Ce=class n extends S{constructor(e,t,r,i){super(),this.address=e,this.moduleName=t,this.name=r,this.typeArgs=i}serialize(e){e.serialize(this.address),e.serialize(this.moduleName),e.serialize(this.name),e.serializeVector(this.typeArgs)}static deserialize(e){let t=c.deserialize(e),r=F.deserialize(e),i=F.deserialize(e),o=e.deserializeVector(R);return new n(t,r,i,o)}};function dd(){return new Ce(c.ONE,new F("aptos_coin"),new F("AptosCoin"),[])}function x(){return new Ce(c.ONE,new F("string"),new F("String"),[])}function pd(n){return new Ce(c.ONE,new F("option"),new F("Option"),[n])}function ae(n){return new Ce(c.ONE,new F("object"),new F("Object"),[n])}function Qs(n){let e=n.deserializeUleb128AsU32();switch(e){case 0:return Pe.deserialize(n);case 1:return de.deserialize(n);case 2:return Et.deserialize(n);case 3:return c.deserialize(n);case 4:return P.deserialize(n,Pe);case 5:return B.deserialize(n);case 6:return xt.deserialize(n);case 7:return Kt.deserialize(n);case 8:return Ct.deserialize(n);case 9:return oi.deserialize(n);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${e}`)}}var Ye=class extends S{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return zt.load(e);case 2:return Ot.load(e);case 3:return Gt.load(e);case 4:return Vn.deserialize(e);default:throw new Error(`Unknown variant index for TransactionPayload: ${t}`)}}},zt=class n extends Ye{constructor(e){super(),this.script=e}serialize(e){e.serializeU32AsUleb128(0),this.script.serialize(e)}static load(e){let t=Nt.deserialize(e);return new n(t)}},Ot=class n extends Ye{constructor(e){super(),this.entryFunction=e}serialize(e){e.serializeU32AsUleb128(2),this.entryFunction.serialize(e)}static load(e){let t=Oe.deserialize(e);return new n(t)}},Gt=class n extends Ye{constructor(e){super(),this.multiSig=e}serialize(e){e.serializeU32AsUleb128(3),this.multiSig.serialize(e)}static load(e){let t=on.deserialize(e);return new n(t)}},Oe=class n{constructor(e,t,r,i){this.module_name=e,this.function_name=t,this.type_args=r,this.args=i}static build(e,t,r,i){return new n(rn.fromStr(e),new F(t),r,i)}serialize(e){this.module_name.serialize(e),this.function_name.serialize(e),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(t=>{t.serializeForEntryFunction(e)})}static deserialize(e){let t=rn.deserialize(e),r=F.deserialize(e),i=e.deserializeVector(R),o=e.deserializeUleb128AsU32(),s=new Array;for(let a=0;a<o;a+=1){let u=e.deserializeUleb128AsU32(),d=ii.deserialize(e,u);s.push(d)}return new n(t,r,i,s)}},Nt=class n{constructor(e,t,r){this.bytecode=e,this.type_args=t,this.args=r}serialize(e){e.serializeBytes(this.bytecode),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(t=>{t.serializeForScriptFunction(e)})}static deserialize(e){let t=e.deserializeBytes(),r=e.deserializeVector(R),i=e.deserializeUleb128AsU32(),o=new Array;for(let s=0;s<i;s+=1){let a=Qs(e);o.push(a)}return new n(t,r,o)}},on=class n{constructor(e,t){this.multisig_address=e,this.transaction_payload=t}serialize(e){this.multisig_address.serialize(e),this.transaction_payload===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.transaction_payload.serialize(e))}static deserialize(e){let t=c.deserialize(e),r=e.deserializeBool(),i;return r&&(i=sn.deserialize(e)),new n(t,i)}},sn=class n extends S{constructor(e){super(),this.transaction_payload=e}serialize(e){e.serializeU32AsUleb128(0),this.transaction_payload.serialize(e)}static deserialize(e){return e.deserializeUleb128AsU32(),new n(Oe.deserialize(e))}},Vn=class extends Ye{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return ut.load(e);default:throw new Error(`Unknown variant index for TransactionInnerPayload: ${t}`)}}},ut=class n extends Vn{constructor(e,t){super(),this.executable=e,this.extra_config=t}serialize(e){e.serializeU32AsUleb128(4),e.serializeU32AsUleb128(0),this.executable.serialize(e),this.extra_config.serialize(e)}static load(e){let t=Bt.deserialize(e),r=Hn.deserialize(e);return new n(t,r)}},Bt=class{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return an.load(e);case 1:return Mt.load(e);case 2:return cn.load(e);default:throw new Error(`Unknown variant index for TransactionExecutable: ${t}`)}}},an=class n extends Bt{constructor(e){super(),this.script=e}serialize(e){e.serializeU32AsUleb128(0),this.script.serialize(e)}static load(e){let t=Nt.deserialize(e);return new n(t)}},Mt=class n extends Bt{constructor(e){super(),this.entryFunction=e}serialize(e){e.serializeU32AsUleb128(1),this.entryFunction.serialize(e)}static load(e){let t=Oe.deserialize(e);return new n(t)}},cn=class n extends Bt{serialize(e){e.serializeU32AsUleb128(2)}static load(e){return new n}},Hn=class{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return dt.load(e);default:throw new Error(`Unknown variant index for TransactionExtraConfig: ${t}`)}}},dt=class n extends Hn{constructor(e,t){super(),this.multisigAddress=e,this.replayProtectionNonce=t!==void 0?BigInt(t):void 0}serialize(e){e.serializeU32AsUleb128(0),e.serializeOption(this.multisigAddress),e.serializeOption(this.replayProtectionNonce!==void 0?new de(this.replayProtectionNonce):void 0)}static load(e){let t=e.deserializeOption(c),r=e.deserializeOption(de);return new n(t,r?.value)}};var ye=class n extends S{constructor(e,t,r,i,o,s,a){super(),this.sender=e,this.sequence_number=t,this.payload=r,this.max_gas_amount=i,this.gas_unit_price=o,this.expiration_timestamp_secs=s,this.chain_id=a}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let t=c.deserialize(e),r=e.deserializeU64(),i=Ye.deserialize(e),o=e.deserializeU64(),s=e.deserializeU64(),a=e.deserializeU64(),u=kn.deserialize(e);return new n(t,r,i,o,s,a,u)}},Ln=class extends S{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return pt.load(e);case 1:return lt.load(e);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${t}`)}}},pt=class n extends Ln{constructor(e,t){super(),this.raw_txn=e,this.secondary_signer_addresses=t}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let t=ye.deserialize(e),r=e.deserializeVector(c);return new n(t,r)}},lt=class n extends Ln{constructor(e,t,r){super(),this.raw_txn=e,this.secondary_signer_addresses=t,this.fee_payer_address=r}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let t=ye.deserialize(e),r=e.deserializeVector(c),i=c.deserialize(e);return new n(t,r,i)}};var Ge=class extends S{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return gt.load(e);case 1:return Vt.load(e);case 2:return mt.load(e);case 3:return yt.load(e);case 4:return Xe.load(e);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${t}`)}}isEd25519(){return this instanceof gt}isMultiEd25519(){return this instanceof Vt}isMultiAgent(){return this instanceof mt}isFeePayer(){return this instanceof yt}isSingleSender(){return this instanceof Xe}},gt=class n extends Ge{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let t=k.deserialize(e),r=O.deserialize(e);return new n(t,r)}},Vt=class n extends Ge{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let t=Ze.deserialize(e),r=he.deserialize(e);return new n(t,r)}},mt=class n extends Ge{constructor(e,t,r){super(),this.sender=e,this.secondary_signer_addresses=t,this.secondary_signers=r}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let t=L.deserialize(e),r=e.deserializeVector(c),i=e.deserializeVector(L);return new n(t,r,i)}},yt=class n extends Ge{constructor(e,t,r,i){super(),this.sender=e,this.secondary_signer_addresses=t,this.secondary_signers=r,this.fee_payer=i}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let t=L.deserialize(e),r=e.deserializeVector(c),i=e.deserializeVector(L),o=c.deserialize(e),s=L.deserialize(e),a={address:o,authenticator:s};return new n(t,r,i,a)}},Xe=class n extends Ge{constructor(e){super(),this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let t=L.deserialize(e);return new n(t)}};var Ne=class n extends S{constructor(e,t){super(),this.raw_txn=e,this.authenticator=t}serialize(e){this.raw_txn.serialize(e),this.authenticator.serialize(e)}static deserialize(e){let t=ye.deserialize(e),r=Ge.deserialize(e);return new n(t,r)}};var qn=class n extends S{constructor(e,t){super(),this.rawTransaction=e,this.feePayerAddress=t}serialize(e){this.rawTransaction.serialize(e),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let t=ye.deserialize(e),r=e.deserializeBool(),i;return r&&(i=c.deserialize(e)),new n(t,i)}};var $n=class n extends S{constructor(e,t,r){super(),this.rawTransaction=e,this.feePayerAddress=r,this.secondarySignerAddresses=t}serialize(e){this.rawTransaction.serialize(e),e.serializeVector(this.secondarySignerAddresses),this.feePayerAddress===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.feePayerAddress.serialize(e))}static deserialize(e){let t=ye.deserialize(e),r=e.deserializeVector(c),i=e.deserializeBool(),o;return i&&(o=c.deserialize(e)),new n(t,r,o)}};function Wn(n){return n.feePayerAddress?new lt(n.rawTransaction,n.secondarySignerAddresses??[],n.feePayerAddress):n.secondarySignerAddresses?new pt(n.rawTransaction,n.secondarySignerAddresses):n.rawTransaction}function et(n,e){let t=Js.create();if(!e.startsWith("APTOS::"))throw new Error(`Domain separator needs to start with 'APTOS::'. Provided - ${e}`);t.update(e);let r=t.digest(),i=n,o=new Uint8Array(r.length+i.length);return o.set(r),o.set(i,r.length),o}function Kp(n){return et(n.bcsToBytes(),`APTOS::${n.constructor.name}`)}function we(n){let e=Wn(n);return n.feePayerAddress?et(e.bcsToBytes(),Ar):n.secondarySignerAddresses?et(e.bcsToBytes(),Ar):et(e.bcsToBytes(),di)}var te=class n{constructor(e){this.signingScheme=0;let{privateKey:t,address:r}=e;this.privateKey=t,this.publicKey=t.publicKey(),this.accountAddress=r?c.from(r):this.publicKey.authKey().derivedAddress()}static generate(){let e=$.generate();return new n({privateKey:e})}static fromDerivationPath(e){let{path:t,mnemonic:r}=e,i=$.fromDerivationPath(t,r);return new n({privateKey:i})}verifySignature(e){return this.publicKey.verifySignature(e)}async verifySignatureAsync(e){return this.publicKey.verifySignatureAsync({...e,signature:e.signature})}signWithAuthenticator(e){return new be(this.publicKey,this.privateKey.sign(e))}signTransactionWithAuthenticator(e){return new be(this.publicKey,this.signTransaction(e))}sign(e){return this.privateKey.sign(e)}signTransaction(e){return this.sign(we(e))}};function Er(n){return typeof n=="object"&&n!==null&&"getAnyPublicKey"in n&&typeof n.getAnyPublicKey=="function"}var Ae=class n{constructor(e){this.signingScheme=2;let{privateKey:t,address:r}=e;this.privateKey=t,this.publicKey=new I(t.publicKey()),this.accountAddress=r?c.from(r):this.publicKey.authKey().derivedAddress()}getAnyPublicKey(){return this.publicKey}static generate(e={}){let{scheme:t=0}=e,r;switch(t){case 0:r=$.generate();break;case 2:r=st.generate();break;default:throw new Error(`Unsupported signature scheme ${t}`)}return new n({privateKey:r})}static fromDerivationPath(e){let{scheme:t=0,path:r,mnemonic:i}=e,o;switch(t){case 0:o=$.fromDerivationPath(r,i);break;case 2:o=st.fromDerivationPath(r,i);break;default:throw new Error(`Unsupported signature scheme ${t}`)}return new n({privateKey:o})}verifySignature(e){return this.publicKey.verifySignature(e)}async verifySignatureAsync(e){return this.publicKey.verifySignatureAsync({...e,signature:e.signature})}signWithAuthenticator(e){return new ee(this.publicKey,this.sign(e))}signTransactionWithAuthenticator(e){return new ee(this.publicKey,this.signTransaction(e))}sign(e){return new U(this.privateKey.sign(e))}signTransaction(e){return this.sign(we(e))}static fromEd25519Account(e){return new n({privateKey:e.privateKey,address:e.accountAddress})}};var Be=class{static generate(e={}){let{scheme:t=0,legacy:r=!0}=e;return t===0&&r?te.generate():Ae.generate({scheme:t})}static fromPrivateKey(e){let{privateKey:t,address:r,legacy:i=!0}=e;return t instanceof $&&i?new te({privateKey:t,address:r}):new Ae({privateKey:t,address:r})}static fromPrivateKeyAndAddress(e){return this.fromPrivateKey(e)}static fromDerivationPath(e){let{scheme:t=0,mnemonic:r,path:i,legacy:o=!0}=e;return t===0&&o?te.fromDerivationPath({mnemonic:r,path:i}):Ae.fromDerivationPath({scheme:t,mnemonic:r,path:i})}static authKey(e){let{publicKey:t}=e;return t.authKey()}verifySignature(e){return this.publicKey.verifySignature(e)}async verifySignatureAsync(e){return this.publicKey.verifySignatureAsync(e)}};import{randomBytes as Ys}from"@noble/hashes/utils";var Xs=1209600,Ht=class Ht extends S{constructor(e){super();let{privateKey:t,expiryDateSecs:r,blinder:i}=e;this.privateKey=t,this.publicKey=new It(t.publicKey()),this.expiryDateSecs=r||mi(ke()+Xs),this.blinder=i!==void 0?T.fromHexInput(i).toUint8Array():ea();let o=vn(this.publicKey.bcsToBytes(),93);o.push(BigInt(this.expiryDateSecs)),o.push(vt(this.blinder));let s=_t(o);this.nonce=s.toString()}getPublicKey(){return this.publicKey}isExpired(){return Math.floor(Date.now()/1e3)>this.expiryDateSecs}serialize(e){e.serializeU32AsUleb128(this.publicKey.variant),e.serializeBytes(this.privateKey.toUint8Array()),e.serializeU64(this.expiryDateSecs),e.serializeFixedBytes(this.blinder)}static deserialize(e){let t=e.deserializeUleb128AsU32(),r;switch(t){case 0:r=$.deserialize(e);break;default:throw new Error(`Unknown variant index for EphemeralPublicKey: ${t}`)}let i=e.deserializeU64(),o=e.deserializeFixedBytes(31);return new Ht({privateKey:r,expiryDateSecs:Number(i),blinder:o})}static fromBytes(e){return Ht.deserialize(new H(e))}static generate(e){let t;switch(e?.scheme){case 0:default:t=$.generate()}return new Ht({privateKey:t,expiryDateSecs:e?.expiryDateSecs})}sign(e){if(this.isExpired())throw new Error("EphemeralKeyPair has expired");return new je(this.privateKey.sign(e))}};Ht.BLINDER_LENGTH=31;var At=Ht;function ea(){return Ys(At.BLINDER_LENGTH)}import na from"eventemitter3";import{jwtDecode as ra}from"jwt-decode";function Qn(n){return n!=null&&typeof n.checkKeylessAccountValidity=="function"}var Lt=class Lt extends S{constructor(t){super();this.signingScheme=2;let{address:r,ephemeralKeyPair:i,publicKey:o,uidKey:s,uidVal:a,aud:u,pepper:d,proof:l,proofFetchCallback:A,jwt:p,verificationKeyHash:g}=t;if(this.ephemeralKeyPair=i,this.publicKey=o,this.accountAddress=r?c.from(r):this.publicKey.authKey().derivedAddress(),this.uidKey=s,this.uidVal=a,this.aud=u,this.jwt=p,this.emitter=new na,this.proofOrPromise=l,l instanceof ce)this.proof=l;else{if(A===void 0)throw new Error("Must provide callback for async proof fetch");this.emitter.on("proofFetchFinish",async v=>{await A(v),this.emitter.removeAllListeners()}),this.init(l)}let f=T.fromHexInput(d).toUint8Array();if(f.length!==Lt.PEPPER_LENGTH)throw new Error(`Pepper length in bytes should be ${Lt.PEPPER_LENGTH}`);if(this.pepper=f,g!==void 0){if(T.hexInputToUint8Array(g).length!==32)throw new Error("verificationKeyHash must be 32 bytes");this.verificationKeyHash=T.hexInputToUint8Array(g)}}getAnyPublicKey(){return new I(this.publicKey)}async init(t){try{this.proof=await t,this.emitter.emit("proofFetchFinish",{status:"Success"})}catch(r){r instanceof Error?this.emitter.emit("proofFetchFinish",{status:"Failed",error:r.toString()}):this.emitter.emit("proofFetchFinish",{status:"Failed",error:"Unknown"})}}serialize(t){if(this.accountAddress.serialize(t),t.serializeStr(this.jwt),t.serializeStr(this.uidKey),t.serializeFixedBytes(this.pepper),this.ephemeralKeyPair.serialize(t),this.proof===void 0)throw new Error("Cannot serialize - proof undefined");this.proof.serialize(t),t.serializeOption(this.verificationKeyHash,32)}static partialDeserialize(t){let r=c.deserialize(t),i=t.deserializeStr(),o=t.deserializeStr(),s=t.deserializeFixedBytes(31),a=At.deserialize(t),u=ce.deserialize(t),d=t.deserializeOption("fixedBytes",32);return{address:r,jwt:i,uidKey:o,pepper:s,ephemeralKeyPair:a,proof:u,verificationKeyHash:d}}isExpired(){return this.ephemeralKeyPair.isExpired()}signWithAuthenticator(t){let r=new U(this.sign(t)),i=new I(this.publicKey);return new ee(i,r)}signTransactionWithAuthenticator(t){let r=new U(this.signTransaction(t)),i=new I(this.publicKey);return new ee(i,r)}async waitForProofFetch(){this.proofOrPromise instanceof Promise&&await this.proofOrPromise}async checkKeylessAccountValidity(t){if(this.isExpired())throw b.fromErrorType({type:0});if(await this.waitForProofFetch(),this.proof===void 0)throw b.fromErrorType({type:2});let r=ra(this.jwt,{header:!0});if(r.kid===void 0)throw b.fromErrorType({type:12,details:"checkKeylessAccountValidity failed. JWT is missing 'kid' in header. This should never happen."});if(this.verificationKeyHash!==void 0){let{verificationKey:i}=await $t({aptosConfig:t});if(T.hexInputToString(i.hash())!==T.hexInputToString(this.verificationKeyHash))throw b.fromErrorType({type:4})}else console.warn("[Aptos SDK] The verification key hash was not set. Proof may be invalid if the verification key has rotated.");await Lt.fetchJWK({aptosConfig:t,publicKey:this.publicKey,kid:r.kid})}sign(t){let{expiryDateSecs:r}=this.ephemeralKeyPair;if(this.isExpired())throw b.fromErrorType({type:0});if(this.proof===void 0)throw b.fromErrorType({type:1,details:"Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing."});let i=this.ephemeralKeyPair.getPublicKey(),o=this.ephemeralKeyPair.sign(t);return new X({jwtHeader:yi(this.jwt.split(".")[0]),ephemeralCertificate:new qt(this.proof,0),expiryDateSecs:r,ephemeralPublicKey:i,ephemeralSignature:o})}signTransaction(t){if(this.proof===void 0)throw b.fromErrorType({type:1,details:"Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing."});let r=Wn(t),o=new jn(r,this.proof.proof).hash();return this.sign(o)}getSigningMessage(t){if(this.proof===void 0)throw b.fromErrorType({type:1,details:"Proof not found - make sure to call `await account.checkKeylessAccountValidity()` before signing."});let r=Wn(t);return new jn(r,this.proof.proof).hash()}verifySignature(t){return this.publicKey.verifySignature(t)}async verifySignatureAsync(t){return this.publicKey.verifySignatureAsync({...t})}static async fetchJWK(t){return Cr(t)}};Lt.PEPPER_LENGTH=31;var ue=Lt,jn=class extends S{constructor(t,r){super();this.domainSeparator="APTOS::TransactionAndProof";this.transaction=t,this.proof=r}serialize(t){t.serializeFixedBytes(this.transaction.bcsToBytes()),t.serializeOption(this.proof)}hash(){return et(this.bcsToBytes(),this.domainSeparator)}};var Ve=class n extends ue{constructor(e){let t=E.create(e);super({publicKey:t,...e}),this.publicKey=t}serialize(e){super.serialize(e)}static deserialize(e){let{address:t,proof:r,ephemeralKeyPair:i,jwt:o,uidKey:s,pepper:a,verificationKeyHash:u}=ue.partialDeserialize(e),{iss:d,aud:l,uidVal:A}=Me({jwt:o,uidKey:s});return new n({address:t,proof:r,ephemeralKeyPair:i,iss:d,uidKey:s,uidVal:A,aud:l,pepper:a,jwt:o,verificationKeyHash:u})}static fromBytes(e){return n.deserialize(new H(T.hexInputToUint8Array(e)))}static create(e){let{address:t,proof:r,jwt:i,ephemeralKeyPair:o,pepper:s,uidKey:a="sub",proofFetchCallback:u,verificationKey:d}=e,{iss:l,aud:A,uidVal:p}=Me({jwt:i,uidKey:a});return new n({address:t,proof:r,ephemeralKeyPair:o,iss:l,uidKey:a,uidVal:p,aud:A,pepper:s,jwt:i,proofFetchCallback:u,verificationKeyHash:d?d.hash():void 0})}};var ft=class n extends ue{constructor(e){let t=M.create(e);super({publicKey:t,...e}),this.publicKey=t,this.audless=e.audless??!1}serialize(e){super.serialize(e),this.publicKey.jwkAddress.serialize(e)}static deserialize(e){let{address:t,proof:r,ephemeralKeyPair:i,jwt:o,uidKey:s,pepper:a,verificationKeyHash:u}=ue.partialDeserialize(e),d=c.deserialize(e),{iss:l,aud:A,uidVal:p}=Me({jwt:o,uidKey:s});return new n({address:t,proof:r,ephemeralKeyPair:i,iss:l,uidKey:s,uidVal:p,aud:A,pepper:a,jwt:o,verificationKeyHash:u,jwkAddress:d})}static fromBytes(e){return n.deserialize(H.fromHex(e))}static create(e){let{address:t,proof:r,jwt:i,ephemeralKeyPair:o,pepper:s,jwkAddress:a,uidKey:u="sub",proofFetchCallback:d,verificationKey:l}=e,{iss:A,aud:p,uidVal:g}=Me({jwt:i,uidKey:u});return new n({address:t,proof:r,ephemeralKeyPair:o,iss:A,uidKey:u,uidVal:g,aud:p,pepper:s,jwkAddress:c.from(a),jwt:i,proofFetchCallback:d,verificationKeyHash:l?l.hash():void 0})}};var un=class n{constructor(e){this.signingScheme=3;let{multiKey:t,address:r}=e,i=e.signers.map(a=>a instanceof te?Ae.fromEd25519Account(a):a);if(t.signaturesRequired>i.length)throw new Error(`Not enough signers provided to satisfy the required signatures. Need ${t.signaturesRequired} signers, but only ${i.length} provided`);if(t.signaturesRequired<i.length)throw new Error(`More signers provided than required. Need ${t.signaturesRequired} signers, but ${i.length} provided`);this.publicKey=t,this.accountAddress=r?c.from(r):this.publicKey.authKey().derivedAddress();let o=[];for(let a of i)o.push(this.publicKey.getIndex(a.getAnyPublicKey()));let s=i.map((a,u)=>[a,o[u]]);s.sort((a,u)=>a[1]-u[1]),this.signers=s.map(a=>a[0]),this.signerIndicies=s.map(a=>a[1]),this.signaturesBitmap=this.publicKey.createBitmap({bits:o})}static fromPublicKeysAndSigners(e){let{address:t,publicKeys:r,signaturesRequired:i,signers:o}=e,s=new le({publicKeys:r,signaturesRequired:i});return new n({multiKey:s,signers:o,address:t})}static isMultiKeySigner(e){return e instanceof n}signWithAuthenticator(e){return new Ee(this.publicKey,this.sign(e))}signTransactionWithAuthenticator(e){return new Ee(this.publicKey,this.signTransaction(e))}async waitForProofFetch(){let t=this.signers.filter(r=>r instanceof ue).map(async r=>r.waitForProofFetch());await Promise.all(t)}async checkKeylessAccountValidity(e){let r=this.signers.filter(i=>i instanceof ue).map(i=>i.checkKeylessAccountValidity(e));await Promise.all(r)}sign(e){let t=[];for(let r of this.signers)t.push(r.sign(e));return new ge({signatures:t,bitmap:this.signaturesBitmap})}signTransaction(e){let t=[];for(let r of this.signers)t.push(r.signTransaction(e));return new ge({signatures:t,bitmap:this.signaturesBitmap})}verifySignature(e){return this.publicKey.verifySignature(e)}async verifySignatureAsync(e){return await this.publicKey.verifySignatureAsync(e)}};var Jn=class{constructor(e){this.signingScheme=1;let{signers:t,publicKey:r,address:i}=e;if(this.publicKey=r,this.accountAddress=i?c.from(i):this.publicKey.authKey().derivedAddress(),r.threshold>t.length)throw new Error(`Not enough signers provided to satisfy the required signatures. Need ${r.threshold} signers, but only ${t.length} provided`);if(r.threshold<t.length)throw new Error(`More signers provided than required. Need ${r.threshold} signers, but ${t.length} provided`);let o=[];for(let a of t)o.push(this.publicKey.getIndex(a.publicKey()));let s=t.map((a,u)=>[a,o[u]]);s.sort((a,u)=>a[1]-u[1]),this.signers=s.map(a=>a[0]),this.signerIndices=s.map(a=>a[1]),this.signaturesBitmap=this.publicKey.createBitmap({bits:o})}verifySignature(e){return this.publicKey.verifySignature(e)}async verifySignatureAsync(e){return this.publicKey.verifySignatureAsync({...e,signature:e.signature})}signWithAuthenticator(e){return new Fe(this.publicKey,this.sign(e))}signTransactionWithAuthenticator(e){return new Fe(this.publicKey,this.signTransaction(e))}sign(e){let t=[];for(let r of this.signers)t.push(r.sign(e));return new he({signatures:t,bitmap:this.signaturesBitmap})}signTransaction(e){return this.sign(we(e))}};function eo(n){let e=n.deserializeUleb128AsU32();if(!Object.values(J).includes(e))throw new Error(`Deserialization of Account failed: SigningScheme variant ${e} is invalid`);return{address:c.deserialize(n),signingScheme:e}}function to(n,e){if(e.serializeStr(n.jwt),e.serializeStr(n.uidKey),e.serializeFixedBytes(n.pepper),n.ephemeralKeyPair.serialize(e),n.proof===void 0)throw new Error("Cannot serialize - proof undefined");n.proof.serialize(e),e.serializeOption(n.verificationKeyHash,32)}function no(n){let e=n.deserializeStr(),t=n.deserializeStr(),r=n.deserializeFixedBytes(31),i=At.deserialize(n),o=ce.deserialize(n),s=n.deserializeOption("fixedBytes",32);return{jwt:e,uidKey:t,pepper:r,ephemeralKeyPair:i,proof:o,verificationKeyHash:s}}var ro;(A=>{function n(p){let g=new Q;switch(g.serializeU32AsUleb128(p.signingScheme),p.accountAddress.serialize(g),p.signingScheme){case 0:return p.privateKey.serialize(g),g.toUint8Array();case 2:{if(!Er(p))throw new Error("Account is not a SingleKeySigner");let f=p.getAnyPublicKey();switch(g.serializeU32AsUleb128(f.variant),f.variant){case 3:return to(p,g),g.toUint8Array();case 4:{let v=p;return to(v,g),v.publicKey.jwkAddress.serialize(g),g.serializeBool(v.audless),g.toUint8Array()}case 1:case 0:return p.privateKey.serialize(g),g.toUint8Array();default:throw new Error(`Invalid public key variant: ${f.variant}`)}}case 3:{let f=p;return f.publicKey.serialize(g),g.serializeU32AsUleb128(f.signers.length),f.signers.forEach(v=>{g.serializeFixedBytes(n(v))}),g.toUint8Array()}default:throw new Error(`Deserialization of Account failed: invalid signingScheme value ${p.signingScheme}`)}}A.toBytes=n;function e(p){return T.hexInputToStringWithoutPrefix(n(p))}A.toHexStringWithoutPrefix=e;function t(p){return T.hexInputToString(n(p))}A.toHexString=t;function r(p){let{address:g,signingScheme:f}=eo(p);switch(f){case 0:{let v=$.deserialize(p);return new te({privateKey:v,address:g})}case 2:{let v=p.deserializeUleb128AsU32();switch(v){case 0:{let G=$.deserialize(p);return new Ae({privateKey:G,address:g})}case 1:{let G=st.deserialize(p);return new Ae({privateKey:G,address:g})}case 3:{let G=no(p),j=Me(G);return new Ve({...G,...j})}case 4:{let G=no(p),j=c.deserialize(p),ve=p.deserializeBool(),$e=Me(G);return new ft({...G,...$e,jwkAddress:j,audless:ve})}default:throw new Error(`Unsupported public key variant ${v}`)}}case 3:{let v=le.deserialize(p),G=p.deserializeUleb128AsU32(),j=new Array;for(let ve=0;ve<G;ve+=1){let $e=r(p);if(!Er($e)&&!($e instanceof te))throw new Error("Deserialization of MultiKeyAccount failed. Signer is not a SingleKeySigner or Ed25519Account");j.push($e)}return new un({multiKey:v,signers:j,address:g})}default:throw new Error(`Deserialization of Account failed: invalid signingScheme value ${f}`)}}A.deserialize=r;function i(p){let g=d(p);if(!(g instanceof Ve))throw new Error("Deserialization of KeylessAccount failed");return g}A.keylessAccountFromHex=i;function o(p){let g=d(p);if(!(g instanceof ft))throw new Error("Deserialization of FederatedKeylessAccount failed");return g}A.federatedKeylessAccountFromHex=o;function s(p){let g=d(p);if(!(g instanceof un))throw new Error("Deserialization of MultiKeyAccount failed");return g}A.multiKeyAccountFromHex=s;function a(p){let g=d(p);if(!(g instanceof Ae))throw new Error("Deserialization of SingleKeyAccount failed");return g}A.singleKeyAccountFromHex=a;function u(p){let g=d(p);if(!(g instanceof te))throw new Error("Deserialization of Ed25519Account failed");return g}A.ed25519AccountFromHex=u;function d(p){return r(H.fromHex(p))}A.fromHex=d;function l(p){return d(p)}A.fromBytes=l})(ro||(ro={}));import{sha3_256 as io}from"@noble/hashes/sha3";var Zn=class n extends Be{constructor({signer:t,accountAddress:r,authenticationFunction:i}){super();this.signingScheme=2;if(!kt(i))throw new Error(`Invalid authentication function ${i} passed into AbstractedAccount`);this.authenticationFunction=i,this.accountAddress=r,this.publicKey=new si(this.accountAddress),this.sign=o=>new gr(t(o))}static fromPermissionedSigner({signer:t,accountAddress:r}){return new n({signer:i=>{let o=new Q;return t.publicKey.serialize(o),t.sign(i).serialize(o),o.toUint8Array()},accountAddress:r??t.accountAddress,authenticationFunction:"0x1::permissioned_delegation::authenticate"})}signWithAuthenticator(t){return new at(this.authenticationFunction,io(t),this.sign(io(t)).toUint8Array())}signTransactionWithAuthenticator(t){return this.signWithAuthenticator(we(t))}signTransaction(t){return this.sign(we(t))}setSigner(t){this.sign=r=>new gr(t(r))}};import{sha3_256 as Ir}from"@noble/hashes/sha3";var dn=class dn extends Zn{constructor({signer:e,authenticationFunction:t,abstractPublicKey:r}){let i=new c(dn.computeAccountAddress(t,r));super({accountAddress:i,signer:e,authenticationFunction:t}),this.abstractPublicKey=r}static computeAccountAddress(e,t){if(!kt(e))throw new Error(`Invalid authentication function ${e} passed into DerivableAbstractedAccount`);let[r,i,o]=e.split("::"),s=Ir.create(),a=new Q;c.fromString(r).serialize(a),a.serializeStr(i),a.serializeStr(o),s.update(a.toUint8Array());let u=new Q;return u.serializeBytes(t),s.update(u.toUint8Array()),s.update(new Uint8Array([dn.ADDRESS_DOMAIN_SEPERATOR])),s.digest()}signWithAuthenticator(e){return new at(this.authenticationFunction,Ir(e),this.sign(Ir(e)).value,this.abstractPublicKey)}};dn.ADDRESS_DOMAIN_SEPERATOR=5;var oo=dn;import{sha3_256 as ma}from"@noble/hashes/sha3";function so(n){return!!n.match(/^[_a-zA-Z0-9]+$/)}function ao(n){return!!n.match(/\s/)}function ia(n){return!!n.match(/^T[0-9]+$/)}function oa(n){return!!n.match(/^&.+$/)}function sa(n){switch(n){case"signer":case"address":case"bool":case"u8":case"u16":case"u32":case"u64":case"u128":case"u256":return!0;default:return!1}}function aa(n,e){let t=e;for(;t<n.length;t+=1){let r=n[t];if(!ao(r))break}return t}var ca=(f=>(f.InvalidTypeTag="unknown type",f.UnexpectedGenericType="unexpected generic type",f.UnexpectedTypeArgumentClose="unexpected '>'",f.UnexpectedWhitespaceCharacter="unexpected whitespace character",f.UnexpectedComma="unexpected ','",f.TypeArgumentCountMismatch="type argument count doesn't match expected amount",f.MissingTypeArgumentClose="no matching '>' for '<'",f.MissingTypeArgument="no type argument before ','",f.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",f.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",f.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",f.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",f.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",f.InvalidAddress="struct address must be valid",f))(ca||{}),V=class extends Error{constructor(e,t){super(`Failed to parse typeTag '${e}', ${t}`)}};function Te(n,e){let t=e?.allowGenerics??!1,r=[],i=[],o=[],s=0,a="",u=1;for(;s<n.length;){let d=n[s];if(d==="<")r.push({savedExpectedTypes:u,savedStr:a,savedTypes:o}),a="",o=[],u=1;else if(d===">"){if(a!==""){let f=pn(a,i,t);o.push(f)}let l=r.pop();if(l===void 0)throw new V(n,"unexpected '>'");if(u!==o.length)throw new V(n,"type argument count doesn't match expected amount");let{savedStr:A,savedTypes:p,savedExpectedTypes:g}=l;i=o,o=p,a=A,u=g}else if(d===","){if(r.length===0)throw new V(n,"unexpected ','");if(a.length===0)throw new V(n,"no type argument before ','");let l=pn(a,i,t);i=[],o.push(l),a="",u+=1}else if(ao(d)){let l=!1;if(a.length!==0){let p=pn(a,i,t);i=[],o.push(p),a="",l=!0}s=aa(n,s);let A=n[s];if(s<n.length&&l&&A!==","&&A!==">")throw new V(n,"unexpected whitespace character");continue}else a+=d;s+=1}if(r.length>0)throw new V(n,"no matching '>' for '<'");switch(o.length){case 0:return pn(a,i,t);case 1:if(a==="")return o[0];throw new V(n,"unexpected ','");default:throw new V(n,"unexpected whitespace character")}}function pn(n,e,t){let r=n.trim(),i=r.toLowerCase();if(sa(i)&&e.length>0)throw new V(n,"primitive types not expected to have type arguments");switch(r.toLowerCase()){case"signer":return new ct;case"bool":return new N;case"address":return new D;case"u8":return new se;case"u16":return new Ue;case"u32":return new De;case"u64":return new q;case"u128":return new Re;case"u256":return new ze;case"vector":if(e.length!==1)throw new V(n,"vector type expected to have exactly one type argument");return new K(e[0]);default:if(oa(r)){let a=r.substring(1);return new Mn(pn(a,e,t))}if(ia(r)){if(t)return new z(Number(r.split("T")[1]));throw new V(n,"unexpected generic type")}if(!r.match(/:/))throw new V(n,"unknown type");let o=r.split("::");if(o.length!==3)throw new V(n,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");let s;try{s=c.fromString(o[0])}catch{throw new V(n,"struct address must be valid")}if(!so(o[1]))throw new V(n,"module name must only contain alphanumeric or '_' characters");if(!so(o[2]))throw new V(n,"struct name must only contain alphanumeric or '_' characters");return new m(new Ce(s,new F(o[1]),new F(o[2]),e))}}function co(n){return typeof n=="boolean"}function He(n){return typeof n=="string"}function ua(n){return typeof n=="number"}function Yn(n){if(ua(n))return n;if(He(n)&&n!=="")return Number.parseInt(n,10)}function Xn(n){return typeof n=="number"||typeof n=="bigint"||typeof n=="string"}function uo(n){return n==null}function po(n){return vr(n)||kr(n)||Fr(n)||Ur(n)||Dr(n)||Rr(n)||zr(n)||er(n)||_r(n)||da(n)||n instanceof P||n instanceof Z}function vr(n){return n instanceof B}function er(n){return n instanceof c}function _r(n){return n instanceof _}function da(n){return n instanceof Pt}function kr(n){return n instanceof Pe}function Fr(n){return n instanceof xt}function Ur(n){return n instanceof Kt}function Dr(n){return n instanceof de}function Rr(n){return n instanceof Et}function zr(n){return n instanceof Ct}function lo(n){return"bytecode"in n}function C(n,e){throw new Error(`Type mismatch for argument ${e}, expected '${n}'`)}function go(n){let e=n.params.findIndex(t=>t!=="signer"&&t!=="&signer");return e<0?n.params.length:e}var pa=new TextEncoder;function tr(n){return n?.map(e=>He(e)?Te(e):e)??[]}async function la(n,e,t){return(await nr({aptosConfig:t,accountAddress:n,moduleName:e})).abi}async function Gr(n,e,t,r){let i=await la(n,e,r);if(!i)throw new Error(`Could not find module ABI for '${n}::${e}'`);return i.exposed_functions.find(o=>o.name===t)}async function Fm(n,e,t,r){let i=await Gr(n,e,t,r);if(!i)throw new Error(`Could not find function ABI for '${n}::${e}::${t}'`);let o=[];for(let s=0;s<i.params.length;s+=1)o.push(Te(i.params[s],{allowGenerics:!0}));return{typeParameters:i.generic_type_params,parameters:o}}async function mo(n,e,t,r){let i=await Gr(n,e,t,r);if(!i)throw new Error(`Could not find entry function ABI for '${n}::${e}::${t}'`);if(!i.is_entry)throw new Error(`'${n}::${e}::${t}' is not an entry function`);let o=go(i),s=[];for(let a=o;a<i.params.length;a+=1)s.push(Te(i.params[a],{allowGenerics:!0}));return{signers:o,typeParameters:i.generic_type_params,parameters:s}}async function yo(n,e,t,r){let i=await Gr(n,e,t,r);if(!i)throw new Error(`Could not find view function ABI for '${n}::${e}::${t}'`);if(!i.is_view)throw new Error(`'${n}::${e}::${t}' is not an view function`);let o=[];for(let a=0;a<i.params.length;a+=1)o.push(Te(i.params[a],{allowGenerics:!0}));let s=[];for(let a=0;a<i.return.length;a+=1)s.push(Te(i.return[a],{allowGenerics:!0}));return{typeParameters:i.generic_type_params,parameters:o,returnTypes:s}}function Nr(n,e,t,r,i,o){let s;if("exposed_functions"in e){let a=e.exposed_functions.find(u=>u.name===n);if(!a)throw new Error(`Could not find function ABI for '${e.address}::${e.name}::${n}'`);if(r>=a.params.length)throw new Error(`Too many arguments for '${n}', expected ${a.params.length}`);s=Te(a.params[r],{allowGenerics:!0})}else{if(r>=e.parameters.length)throw new Error(`Too many arguments for '${n}', expected ${e.parameters.length}`);s=e.parameters[r]}return ht(t,s,r,i,"exposed_functions"in e?e:void 0,o)}function ht(n,e,t,r,i,o){return po(n)?(Or(e,n,t),n):ga(n,e,t,r,i,o)}function ga(n,e,t,r,i,o){if(e.isBool()){if(co(n))return new B(n);if(He(n)){if(n==="true")return new B(!0);if(n==="false")return new B(!1)}C("boolean",t)}if(e.isAddress()){if(He(n))return c.fromString(n);C("string | AccountAddress",t)}if(e.isU8()){let s=Yn(n);if(s!==void 0)return new Pe(s);C("number | string",t)}if(e.isU16()){let s=Yn(n);if(s!==void 0)return new xt(s);C("number | string",t)}if(e.isU32()){let s=Yn(n);if(s!==void 0)return new Kt(s);C("number | string",t)}if(e.isU64()){if(Xn(n))return new de(BigInt(n));C("bigint | number | string",t)}if(e.isU128()){if(Xn(n))return new Et(BigInt(n));C("bigint | number | string",t)}if(e.isU256()){if(Xn(n))return new Ct(BigInt(n));C("bigint | number | string",t)}if(e.isGeneric()){let s=e.value;if(s<0||s>=r.length)throw new Error(`Generic argument ${e.toString()} is invalid for argument ${t}`);return ht(n,r[s],t,r,i)}if(e.isVector()){if(e.value.isU8()){if(He(n))return P.U8(pa.encode(n));if(n instanceof Uint8Array)return P.U8(n);if(n instanceof ArrayBuffer)return P.U8(new Uint8Array(n))}if(He(n)&&n.startsWith("["))return ht(JSON.parse(n),e,t,r);if(Array.isArray(n))return new P(n.map(s=>ht(s,e.value,t,r,i)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(He(n))return new _(n);C("string",t)}if(e.isObject()){if(He(n))return c.fromString(n);C("string | AccountAddress",t)}if(e.isDelegationKey()||e.isRateLimiter()){if(n instanceof Uint8Array)return new Pt(n);C("Uint8Array",t)}if(e.isOption()){if(uo(n)){let a=e.value.typeArgs[0];return a instanceof N?new Z(null):a instanceof D?new Z(null):a instanceof se?new Z(null):a instanceof Ue?new Z(null):a instanceof De?new Z(null):a instanceof q?new Z(null):a instanceof Re?new Z(null):a instanceof ze?new Z(null):new Z(null)}return new Z(ht(n,e.value.typeArgs[0],t,r,i))}if(i?.structs.find(a=>a.name===e.value.name.identifier)?.fields.length===0&&n instanceof Uint8Array)return new Pt(n);if(n instanceof Uint8Array&&o?.allowUnknownStructs)return console.warn(`Unsupported struct input type for argument ${t}. Continuing since 'allowUnknownStructs' is enabled.`),new Pt(n);throw new Error(`Unsupported struct input type for argument ${t}, type '${e.toString()}'`)}throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}function Or(n,e,t){if(n.isBool()){if(vr(e))return;C("Bool",t)}if(n.isAddress()){if(er(e))return;C("AccountAddress",t)}if(n.isU8()){if(kr(e))return;C("U8",t)}if(n.isU16()){if(Fr(e))return;C("U16",t)}if(n.isU32()){if(Ur(e))return;C("U32",t)}if(n.isU64()){if(Dr(e))return;C("U64",t)}if(n.isU128()){if(Rr(e))return;C("U128",t)}if(n.isU256()){if(zr(e))return;C("U256",t)}if(n.isVector()){if(e instanceof P){e.values.length>0&&Or(n.value,e.values[0],t);return}C("MoveVector",t)}if(n instanceof m){if(n.isString()){if(_r(e))return;C("MoveString",t)}if(n.isObject()){if(er(e))return;C("AccountAddress",t)}if(n.isOption()){if(e instanceof Z){e.value!==void 0&&Or(n.value.typeArgs[0],e.value,t);return}C("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}async function rr(n){if(lo(n))return fa(n);let{moduleAddress:e,moduleName:t,functionName:r}=pe(n.function),i=await bo({key:"entry-function",moduleAddress:e,moduleName:t,functionName:r,aptosConfig:n.aptosConfig,abi:n.abi,fetch:mo});return ya({...n,abi:i})}function ya(n){let e=n.abi,{moduleAddress:t,moduleName:r,functionName:i}=pe(n.function),o=tr(n.typeArguments);if(o.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${o.length}`);let s=n.functionArguments.map((u,d)=>Nr(n.function,e,u,d,o));if(s.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${r}::${i}', expected ${e.parameters.length} but got ${s.length}`);let a=Oe.build(`${t}::${r}`,i,o,s);if("multisigAddress"in n){let u=c.from(n.multisigAddress);return new Gt(new on(u,new sn(a)))}return new Ot(a)}async function Ao(n){let{moduleAddress:e,moduleName:t,functionName:r}=pe(n.function),i=await bo({key:"view-function",moduleAddress:e,moduleName:t,functionName:r,aptosConfig:n.aptosConfig,abi:n.abi,fetch:yo});return Aa({abi:i,...n})}function Aa(n){let e=n.abi,{moduleAddress:t,moduleName:r,functionName:i}=pe(n.function),o=tr(n.typeArguments);if(o.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${o.length}`);let s=n?.functionArguments?.map((a,u)=>Nr(n.function,e,a,u,o))??[];if(s.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${r}::${i}', expected ${e.parameters.length} but got ${s.length}`);return Oe.build(`${t}::${r}`,i,o,s)}function fa(n){return new zt(new Nt(T.fromHexInput(n.bytecode).toUint8Array(),tr(n.typeArguments),n.functionArguments))}async function ha(n){let{aptosConfig:e,sender:t,payload:r,options:i,feePayerAddress:o}=n;if(i?.replayProtectionNonce!==void 0&&i?.accountSequenceNumber!==void 0)throw new Error("Cannot specify both replayProtectionNonce and accountSequenceNumber in options.");let s=async()=>yr[e.network]?{chainId:yr[e.network]}:{chainId:(await Un({aptosConfig:e})).chain_id},a=async()=>i?.gasUnitPrice?{gasEstimate:i.gasUnitPrice}:{gasEstimate:(await Rn({aptosConfig:e})).gas_estimate},u=async()=>{let j=async()=>i?.accountSequenceNumber!==void 0?i.accountSequenceNumber:i?.replayProtectionNonce!==void 0?0xdeadbeefn:(await Dn({aptosConfig:e,accountAddress:t})).sequence_number;if(o&&c.from(o).equals(c.ZERO))try{return await j()}catch{return 0}else return j()},[{chainId:d},{gasEstimate:l},A]=await Promise.all([s(),a(),u()]),{maxGasAmount:p,gasUnitPrice:g,expireTimestamp:f,replayProtectionNonce:v}={maxGasAmount:i?.maxGasAmount?BigInt(i.maxGasAmount):BigInt(e.getDefaultMaxGasAmount()),gasUnitPrice:i?.gasUnitPrice??BigInt(l),expireTimestamp:i?.expireTimestamp??BigInt(Math.floor(Date.now()/1e3)+e.getDefaultTxnExpirySecFromNow()),replayProtectionNonce:i?.replayProtectionNonce?BigInt(i.replayProtectionNonce):void 0},G=r;return v!==void 0&&(G=ba(r,v)),new ye(c.from(t),BigInt(A),G,BigInt(p),BigInt(g),BigInt(f),new kn(d))}function ba(n,e){if(n instanceof zt)return new ut(new an(n.script),new dt(void 0,e));if(n instanceof Ot)return new ut(new Mt(n.entryFunction),new dt(void 0,e));if(n instanceof Gt){let t=n.multiSig.transaction_payload,r;if(t===void 0||t?.transaction_payload===void 0)r=new cn;else if(t.transaction_payload instanceof Oe)r=new Mt(t.transaction_payload);else throw new Error("Scripts are not supported in multi-sig transactions.");return new ut(r,new dt(n.multiSig.multisig_address,e))}else throw new Error(`Unsupported payload type: ${n}`)}async function Br(n){let{aptosConfig:e,sender:t,payload:r,options:i,feePayerAddress:o}=n,s=await ha({aptosConfig:e,sender:t,payload:r,options:i,feePayerAddress:o});if("secondarySignerAddresses"in n){let a=n.secondarySignerAddresses?.map(u=>c.from(u))??[];return new $n(s,a,n.feePayerAddress?c.from(n.feePayerAddress):void 0)}return new qn(s,n.feePayerAddress?c.from(n.feePayerAddress):void 0)}function fo(n){let{signerPublicKey:e,transaction:t,secondarySignersPublicKeys:r,feePayerPublicKey:i}=n,o=Wt(e);if(t.feePayerAddress){let a=new lt(t.rawTransaction,t.secondarySignerAddresses??[],t.feePayerAddress),u=[];t.secondarySignerAddresses&&(r?u=r.map(A=>Wt(A)):u=Array.from({length:t.secondarySignerAddresses.length},()=>Wt(void 0)));let d=Wt(i),l=new yt(o,t.secondarySignerAddresses??[],u,{address:t.feePayerAddress,authenticator:d});return new Ne(a.raw_txn,l).bcsToBytes()}if(t.secondarySignerAddresses){let a=new pt(t.rawTransaction,t.secondarySignerAddresses),u=[];r?u=r.map(l=>Wt(l)):u=Array.from({length:t.secondarySignerAddresses.length},()=>Wt(void 0));let d=new mt(o,t.secondarySignerAddresses,u);return new Ne(a.raw_txn,d).bcsToBytes()}let s;if(o instanceof be)s=new gt(o.public_key,o.signature);else if(o instanceof ee||o instanceof Ee)s=new Xe(o);else if(o instanceof Rt)s=new Xe(o);else throw new Error("Invalid public key");return new Ne(t.rawTransaction,s).bcsToBytes()}function Wt(n){if(!n)return new Rt;let t=E.isInstance(n)||M.isInstance(n)||Qe.isInstance(n)?new I(n):n,r=new O(new Uint8Array(64));if(k.isInstance(t))return new be(t,r);if(I.isInstance(t))return E.isInstance(t.publicKey)?new ee(t,new U(X.getSimulationSignature())):new ee(t,new U(r));if(le.isInstance(t))return new Ee(t,new ge({signatures:t.publicKeys.map(i=>E.isInstance(i.publicKey)||M.isInstance(i.publicKey)?new U(X.getSimulationSignature()):new U(r)),bitmap:t.createBitmap({bits:Array(t.publicKeys.length).fill(0).map((i,o)=>o)})}));throw new Error("Unsupported PublicKey used for simulations")}function Mr(n){let{transaction:e,feePayerAuthenticator:t,additionalSignersAuthenticators:r}=n,i=li(L,n.senderAuthenticator),o;if(e.feePayerAddress){if(!t)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");o=new yt(i,e.secondarySignerAddresses??[],r??[],{address:e.feePayerAddress,authenticator:t})}else if(e.secondarySignerAddresses){if(!r)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");o=new mt(i,e.secondarySignerAddresses,r)}else i instanceof be?o=new gt(i.public_key,i.signature):i instanceof Fe?o=new Vt(i.public_key,i.signature):o=new Xe(i);return new Ne(e.rawTransaction,o).bcsToBytes()}function ho(n){let e=ma.create();for(let t of n)e.update(t);return e.digest()}var wa=ho(["APTOS::Transaction"]);function oy(n){let e=Mr(n);return new T(ho([wa,new Uint8Array([0]),e])).toString()}async function bo({key:n,moduleAddress:e,moduleName:t,functionName:r,aptosConfig:i,abi:o,fetch:s}){return o!==void 0?o:Ut(async()=>s(e,t,r,i),`${n}-${i.network}-${e}-${t}-${r}`,1e3*60*5)()}async function y(n){let e=await Sa(n);return Pa(n,e)}async function Sa(n){let{aptosConfig:e,data:t}=n,r,i;return"bytecode"in t?i=await rr(t):"multisigAddress"in t?(r={aptosConfig:e,multisigAddress:t.multisigAddress,function:t.function,functionArguments:t.functionArguments,typeArguments:t.typeArguments,abi:t.abi},i=await rr(r)):(r={aptosConfig:e,function:t.function,functionArguments:t.functionArguments,typeArguments:t.typeArguments,abi:t.abi},i=await rr(r)),i}async function Pa(n,e){let{aptosConfig:t,sender:r,options:i}=n,o;if(xa(n)&&(o=c.ZERO.toString()),Ka(n)){let{secondarySignerAddresses:s}=n;return Br({aptosConfig:t,sender:r,payload:e,options:i,secondarySignerAddresses:s,feePayerAddress:o})}return Br({aptosConfig:t,sender:r,payload:e,options:i,feePayerAddress:o})}function xa(n){return n.withFeePayer===!0}function Ka(n){return"secondarySignerAddresses"in n}function wo(n){let{transaction:e}=n;return we(e)}function ir(n){let{signer:e,transaction:t}=n;return e.signTransactionWithAuthenticator(t)}function or(n){let{signer:e,transaction:t}=n;if(!t.feePayerAddress)throw new Error(`Transaction ${t} is not a Fee Payer transaction`);return t.feePayerAddress=e.accountAddress,ir({signer:e,transaction:t})}async function Vr(n){let{aptosConfig:e,transaction:t,signerPublicKey:r,secondarySignersPublicKeys:i,feePayerPublicKey:o,options:s}=n,a=fo({transaction:t,signerPublicKey:r,secondarySignersPublicKeys:i,feePayerPublicKey:o,options:s}),{data:u}=await Ft({aptosConfig:e,body:a,path:"transactions/simulate",params:{estimate_gas_unit_price:n.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:n.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:n.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return u}async function ln(n){let{aptosConfig:e,transactionSubmitter:t}=n,r=t===void 0?e.getTransactionSubmitter():t;if(r)return r.submitTransaction(n);let i=Mr({...n});try{let{data:o}=await Ft({aptosConfig:e,body:i,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return o}catch(o){let s=Ne.deserialize(new H(i));throw s.authenticator.isSingleSender()&&s.authenticator.sender.isSingleKey()&&(s.authenticator.sender.public_key.publicKey instanceof E||s.authenticator.sender.public_key.publicKey instanceof M)&&await ue.fetchJWK({aptosConfig:e,publicKey:s.authenticator.sender.public_key.publicKey,kid:s.authenticator.sender.signature.signature.getJwkKid()}),o}}async function tt(n){let{aptosConfig:e,signer:t,feePayer:r,transaction:i,...o}=n;Qn(t)&&await t.checkKeylessAccountValidity(e),Qn(r)&&await r.checkKeylessAccountValidity(e);let s=n.feePayerAuthenticator||r&&or({signer:r,transaction:i}),a=ir({signer:t,transaction:i});return ln({aptosConfig:e,transaction:i,senderAuthenticator:a,feePayerAuthenticator:s,...o})}async function To(n){let{aptosConfig:e,senderAuthenticator:t,feePayer:r,transaction:i,...o}=n;Qn(r)&&await r.checkKeylessAccountValidity(e);let s=or({signer:r,transaction:i});return ln({aptosConfig:e,transaction:i,senderAuthenticator:t,feePayerAuthenticator:s,...o})}var Ea={typeParameters:[],parameters:[K.u8(),new K(K.u8())]};async function So(n){let{aptosConfig:e,account:t,metadataBytes:r,moduleBytecode:i,options:o}=n,s=i.map(a=>P.U8(a));return y({aptosConfig:e,sender:c.from(t),data:{function:"0x1::code::publish_package_txn",functionArguments:[P.U8(r),new P(s)],abi:Ea},options:o})}async function bt(n){return Dn(n)}async function xo(n){let{aptosConfig:e,accountAddress:t,options:r}=n;return fr({aptosConfig:e,originMethod:"getModules",path:`accounts/${c.from(t).toString()}/modules`,params:{ledger_version:r?.ledgerVersion,limit:r?.limit??1e3}})}async function Ko(n){let{aptosConfig:e,accountAddress:t,options:r}=n,{response:i,cursor:o}=await hr({aptosConfig:e,originMethod:"getModulesPage",path:`accounts/${c.from(t).toString()}/modules`,params:{ledger_version:r?.ledgerVersion,cursor:r?.cursor,limit:r?.limit??100}});return{modules:i.data,cursor:o}}async function nr(n){return Hi(n)}async function Eo(n){let{aptosConfig:e,accountAddress:t,options:r}=n;return wi({aptosConfig:e,originMethod:"getTransactions",path:`accounts/${c.from(t).toString()}/transactions`,params:{start:r?.offset,limit:r?.limit}})}async function Co(n){let{aptosConfig:e,accountAddress:t,options:r}=n;return fr({aptosConfig:e,originMethod:"getResources",path:`accounts/${c.from(t).toString()}/resources`,params:{ledger_version:r?.ledgerVersion,limit:r?.limit??999}})}async function Io(n){let{aptosConfig:e,accountAddress:t,options:r}=n,{response:i,cursor:o}=await hr({aptosConfig:e,originMethod:"getResourcesPage",path:`accounts/${c.from(t).toString()}/resources`,params:{ledger_version:r?.ledgerVersion,cursor:r?.cursor,limit:r?.limit??100}});return{resources:i.data,cursor:o}}async function Lr(n){let{aptosConfig:e,accountAddress:t,resourceType:r,options:i}=n,{data:o}=await ot({aptosConfig:e,originMethod:"getResource",path:`accounts/${c.from(t).toString()}/resource/${r}`,params:{ledger_version:i?.ledgerVersion}});return o.data}async function jt(n){let{aptosConfig:e,authenticationKey:t,options:r}=n,i=await Lr({aptosConfig:e,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:r}),{address_map:{handle:o}}=i,s=c.from(t);try{let a=await Li({aptosConfig:e,handle:o,data:{key:s.toString(),key_type:"address",value_type:"address"},options:r});return c.from(a)}catch(a){if(a instanceof bi&&a.data.error_code==="table_item_not_found")return s;throw a}}async function vo(n){let{aptosConfig:e,accountAddress:t}=n,i={owner_address:{_eq:c.from(t).toStringLong()},amount:{_gt:0}},s=await w({aptosConfig:e,query:{query:_i,variables:{where_condition:i}},originMethod:"getAccountTokensCount"});return s.current_token_ownerships_v2_aggregate.aggregate?s.current_token_ownerships_v2_aggregate.aggregate.count:0}async function _o(n){let{aptosConfig:e,accountAddress:t,options:r}=n,o={owner_address:{_eq:c.from(t).toStringLong()},amount:{_gt:0}};r?.tokenStandard&&(o.token_standard={_eq:r?.tokenStandard});let s={query:Ii,variables:{where_condition:o,offset:r?.offset,limit:r?.limit,order_by:r?.orderBy}};return(await w({aptosConfig:e,query:s,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function ko(n){let{aptosConfig:e,accountAddress:t,collectionAddress:r,options:i}=n,o=c.from(t).toStringLong(),s=c.from(r).toStringLong(),a={owner_address:{_eq:o},current_token_data:{collection_id:{_eq:s}},amount:{_gt:0}};i?.tokenStandard&&(a.token_standard={_eq:i?.tokenStandard});let u={query:vi,variables:{where_condition:a,offset:i?.offset,limit:i?.limit,order_by:i?.orderBy}};return(await w({aptosConfig:e,query:u,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function Fo(n){let{aptosConfig:e,accountAddress:t,options:r}=n,o={owner_address:{_eq:c.from(t).toStringLong()}};r?.tokenStandard&&(o.current_collection={token_standard:{_eq:r?.tokenStandard}});let s={query:Ci,variables:{where_condition:o,offset:r?.offset,limit:r?.limit,order_by:r?.orderBy}};return(await w({aptosConfig:e,query:s,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function Uo(n){let{aptosConfig:e,accountAddress:t}=n,r=c.from(t).toStringLong(),o=await w({aptosConfig:e,query:{query:ki,variables:{address:r}},originMethod:"getAccountTransactionsCount"});return o.account_transactions_aggregate.aggregate?o.account_transactions_aggregate.aggregate.count:0}async function nA(n){let{aptosConfig:e,accountAddress:t,coinType:r,faMetadataAddress:i}=n,o=r,s;if(r!==void 0&&i!==void 0)s=c.from(i).toStringLong();else if(r!==void 0&&i===void 0)r===_e?s=c.A.toStringLong():s=_n(c.A,r).toStringLong();else if(r===void 0&&i!==void 0){let l=c.from(i);s=l.toStringLong(),l===c.A&&(o=_e)}else throw new Error("Either coinType, fungibleAssetAddress, or both must be provided");let a=c.from(t).toStringLong(),u={asset_type:{_eq:s}};o!==void 0&&(u={asset_type:{_in:[o,s]}});let d=await qr({aptosConfig:e,accountAddress:a,options:{where:u}});return d[0]?d[0].amount:0}async function qr(n){let{aptosConfig:e,accountAddress:t,options:r}=n,i=c.from(t).toStringLong(),o={...r?.where,owner_address:{_eq:i}},s={query:Ei,variables:{where_condition:o,offset:r?.offset,limit:r?.limit,order_by:r?.orderBy}};return(await w({aptosConfig:e,query:s,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function Do(n){let{aptosConfig:e,accountAddress:t}=n,r=c.from(t).toStringLong(),o=await w({aptosConfig:e,query:{query:Ki,variables:{address:r}},originMethod:"getAccountCoinsCount"});if(!o.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return o.current_fungible_asset_balances_aggregate.aggregate.count}async function Ro(n){let{aptosConfig:e,accountAddress:t,options:r}=n,o={owner_address:{_eq:c.from(t).toStringLong()}},s={query:Fn,variables:{where_condition:o,offset:r?.offset,limit:r?.limit,order_by:r?.orderBy}};return(await w({aptosConfig:e,query:s,originMethod:"getAccountOwnedObjects"})).current_objects}async function zo(n){let{aptosConfig:e,privateKey:t}=n,r=new I(t.publicKey());if(t instanceof st){let o=Y.fromPublicKey({publicKey:r}).derivedAddress();return Be.fromPrivateKey({privateKey:t,address:o})}if(t instanceof $){let i=Y.fromPublicKey({publicKey:r.publicKey});if(await Po({authKey:i,aptosConfig:e})){let u=i.derivedAddress();return Be.fromPrivateKey({privateKey:t,address:u,legacy:!0})}let s=Y.fromPublicKey({publicKey:r});if(await Po({authKey:s,aptosConfig:e})){let u=s.derivedAddress();return Be.fromPrivateKey({privateKey:t,address:u,legacy:!1})}}throw new Error(`Can't derive account from private key ${t}`)}async function Po(n){let{aptosConfig:e,authKey:t}=n,r=await jt({aptosConfig:e,authenticationKey:t.derivedAddress()});try{return await bt({aptosConfig:e,accountAddress:r}),!0}catch(i){if(i.status===404)return!1;throw new Error(`Error while looking for an account info ${r.toString()}`)}}var Ca={typeParameters:[],parameters:[new se,K.u8(),new se,K.u8(),K.u8(),K.u8()]};async function Oo(n){let{aptosConfig:e,fromAccount:t,dangerouslySkipVerification:r}=n;if("toNewPrivateKey"in n)return Hr({aptosConfig:e,fromAccount:t,toNewPrivateKey:n.toNewPrivateKey});let i;if("toAccount"in n){if(n.toAccount instanceof te)return Hr({aptosConfig:e,fromAccount:t,toNewPrivateKey:n.toAccount.privateKey});if(n.toAccount instanceof Jn)return Hr({aptosConfig:e,fromAccount:t,toAccount:n.toAccount});i=n.toAccount.publicKey.authKey()}else if("toAuthKey"in n)i=n.toAuthKey;else throw new Error("Invalid arguments");let o=await va({aptosConfig:e,fromAccount:t,toAuthKey:i});if(r===!0)return o;let s=await Je({aptosConfig:e,transactionHash:o.hash});if(!s.success)throw new Error(`Failed to rotate authentication key - ${s}`);let a=await y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::account::set_originating_address",functionArguments:[]}});return tt({aptosConfig:e,signer:n.toAccount,transaction:a})}async function Hr(n){let{aptosConfig:e,fromAccount:t}=n,r=await bt({aptosConfig:e,accountAddress:t.accountAddress}),i;"toNewPrivateKey"in n?i=Be.fromPrivateKey({privateKey:n.toNewPrivateKey,legacy:!0}):i=n.toAccount;let s=new xi({sequenceNumber:BigInt(r.sequence_number),originator:t.accountAddress,currentAuthKey:c.from(r.authentication_key),newPublicKey:i.publicKey}).bcsToBytes(),a=t.sign(s),u=i.sign(s),d=await y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new Pe(t.signingScheme),P.U8(t.publicKey.toUint8Array()),new Pe(i.signingScheme),P.U8(i.publicKey.toUint8Array()),P.U8(a.toUint8Array()),P.U8(u.toUint8Array())],abi:Ca}});return tt({aptosConfig:e,signer:t,transaction:d})}var Ia={typeParameters:[],parameters:[K.u8()]};async function va(n){let{aptosConfig:e,fromAccount:t,toAuthKey:r}=n,i=r,o=await y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::account::rotate_authentication_key_call",functionArguments:[P.U8(i.toUint8Array())],abi:Ia}});return tt({aptosConfig:e,signer:t,transaction:o})}async function ne(n){let{aptosConfig:e,payload:t,options:r}=n,i=await Ao({...t,aptosConfig:e}),o=new Q;i.serialize(o);let s=o.toUint8Array(),{data:a}=await Ft({aptosConfig:e,path:"view",originMethod:"view",contentType:"application/x.aptos.view_function+bcs",params:{ledger_version:r?.ledgerVersion},body:s});return a}async function Go(n){let{aptosConfig:e,payload:t,options:r}=n,{data:i}=await Ft({aptosConfig:e,originMethod:"viewJson",path:"view",params:{ledger_version:r?.ledgerVersion},body:{function:t.function,type_arguments:t.typeArguments??[],arguments:t.functionArguments??[]}});return i}async function No(n){let{aptosConfig:e,sender:t,authenticationFunction:r,options:i}=n,{moduleAddress:o,moduleName:s,functionName:a}=pe(r);return y({aptosConfig:e,sender:t,data:{function:"0x1::account_abstraction::add_authentication_function",typeArguments:[],functionArguments:[o,s,a],abi:{typeParameters:[],parameters:[new D,new m(x()),new m(x())]}},options:i})}async function Bo(n){let{aptosConfig:e,sender:t,authenticationFunction:r,options:i}=n,{moduleAddress:o,moduleName:s,functionName:a}=pe(r);return y({aptosConfig:e,sender:t,data:{function:"0x1::account_abstraction::remove_authentication_function",typeArguments:[],functionArguments:[o,s,a],abi:{typeParameters:[],parameters:[new D,new m(x()),new m(x())]}},options:i})}async function Mo(n){let{aptosConfig:e,sender:t,options:r}=n;return y({aptosConfig:e,sender:t,data:{function:"0x1::account_abstraction::remove_authenticator",typeArguments:[],functionArguments:[],abi:{typeParameters:[],parameters:[]}},options:r})}var wt=class{constructor(e){this.config=e;this.isAccountAbstractionEnabled=async e=>{let t=await this.getAuthenticationFunction(e),{moduleAddress:r,moduleName:i,functionName:o}=pe(e.authenticationFunction);return t?.some(s=>c.fromString(r).equals(s.moduleAddress)&&i===s.moduleName&&o===s.functionName)??!1};this.enableAccountAbstractionTransaction=this.addAuthenticationFunctionTransaction;this.disableAccountAbstractionTransaction=async e=>{let{accountAddress:t,authenticationFunction:r,options:i}=e;return r?this.removeAuthenticationFunctionTransaction({accountAddress:t,authenticationFunction:r,options:i}):this.removeDispatchableAuthenticatorTransaction({accountAddress:t,options:i})}}async addAuthenticationFunctionTransaction(e){let{accountAddress:t,authenticationFunction:r,options:i}=e;return No({aptosConfig:this.config,authenticationFunction:r,sender:t,options:i})}async removeAuthenticationFunctionTransaction(e){let{accountAddress:t,authenticationFunction:r,options:i}=e;return Bo({aptosConfig:this.config,sender:t,authenticationFunction:r,options:i})}async removeDispatchableAuthenticatorTransaction(e){let{accountAddress:t,options:r}=e;return Mo({aptosConfig:this.config,sender:t,options:r})}async getAuthenticationFunction(e){let{accountAddress:t}=e,[{vec:r}]=await ne({aptosConfig:this.config,payload:{function:"0x1::account_abstraction::dispatchable_authenticator",functionArguments:[c.from(t)],abi:{typeParameters:[],parameters:[new D],returnTypes:[]}}});if(r.length!==0)return r[0].map(i=>({moduleAddress:c.fromString(i.module_address),moduleName:i.module_name,functionName:i.function_name}))}};var gn=class{constructor(e){this.config=e;this.abstraction=new wt(e)}async getAccountInfo(e){return bt({aptosConfig:this.config,...e})}async getAccountModules(e){return xo({aptosConfig:this.config,...e})}async getAccountModulesPage(e){return Ko({aptosConfig:this.config,...e})}async getAccountModule(e){return nr({aptosConfig:this.config,...e})}async getAccountTransactions(e){return Eo({aptosConfig:this.config,...e})}async getAccountResources(e){return Co({aptosConfig:this.config,...e})}async getAccountResourcesPage(e){return Io({aptosConfig:this.config,...e})}async getAccountResource(e){return Lr({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return jt({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),vo({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),_o({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),ko({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),Fo({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),Uo({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),qr({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),Do({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:_e,faMetadataAddress:ui,...e})}async getAccountCoinAmount(e){let{accountAddress:t,coinType:r,faMetadataAddress:i,minimumLedgerVersion:o}=e;o&&console.warn(`minimumLedgerVersion is not used anymore, here for backward
|
|
4
|
-
compatibility see https://github.com/aptos-labs/aptos-ts-sdk/pull/519,
|
|
5
|
-
will be removed in the near future`);let s=r;r===void 0&&i!==void 0&&(s=await Ut(async()=>{try{let d=(await ne({aptosConfig:this.config,payload:{function:"0x1::coin::paired_coin",functionArguments:[i]}})).at(0);if(d.vec.length>0&&hi(d.vec[0]))return fi(d.vec[0])}catch{}},`coin-mapping-${i.toString()}`,1e3*60*5)());let a;if(r!==void 0&&i!==void 0)a=c.from(i).toStringLong();else if(r!==void 0&&i===void 0)r===_e?a=c.A.toStringLong():a=_n(c.A,r).toStringLong();else if(r===void 0&&i!==void 0){let d=c.from(i);a=d.toStringLong(),d===c.A&&(s=_e)}else throw new Error("Either coinType, faMetadataAddress, or both must be provided");if(s!==void 0){let[d]=await ne({aptosConfig:this.config,payload:{function:"0x1::coin::balance",typeArguments:[s],functionArguments:[t]}});return parseInt(d,10)}let[u]=await ne({aptosConfig:this.config,payload:{function:"0x1::primary_fungible_store::balance",typeArguments:["0x1::object::ObjectCore"],functionArguments:[t,a]}});return parseInt(u,10)}async getAccountOwnedObjects(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),Ro({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return zo({aptosConfig:this.config,...e})}};var _a={typeParameters:[{constraints:[]}],parameters:[new D,new q]};async function Vo(n){let{aptosConfig:e,sender:t,recipient:r,amount:i,coinType:o,options:s}=n;return y({aptosConfig:e,sender:t,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[o??_e],functionArguments:[r,i],abi:_a},options:s})}var mn=class{constructor(e){this.config=e}async transferCoinTransaction(e){return Vo({aptosConfig:this.config,...e})}};var nt={BOOLEAN:"bool",U8:"u8",U16:"u16",U32:"u32",U64:"u64",U128:"u128",U256:"u256",ADDRESS:"address",STRING:"0x1::string::String",ARRAY:"vector<u8>"},fe="0x4::token::Token";async function Ho(n){let{aptosConfig:e,digitalAssetAddress:t}=n,r={token_data_id:{_eq:c.from(t).toStringLong()}};return(await w({aptosConfig:e,query:{query:Ni,variables:{where_condition:r}},originMethod:"getDigitalAssetData"})).current_token_datas_v2[0]}async function Lo(n){let{aptosConfig:e,digitalAssetAddress:t}=n,r={token_data_id:{_eq:c.from(t).toStringLong()},amount:{_gt:0}};return(await w({aptosConfig:e,query:{query:wr,variables:{where_condition:r}},originMethod:"getCurrentDigitalAssetOwnership"})).current_token_ownerships_v2[0]}async function qo(n){let{aptosConfig:e,ownerAddress:t,options:r}=n,i={owner_address:{_eq:c.from(t).toStringLong()},amount:{_gt:0}},o={query:wr,variables:{where_condition:i,offset:r?.offset,limit:r?.limit,order_by:r?.orderBy}};return(await w({aptosConfig:e,query:o,originMethod:"getOwnedDigitalAssets"})).current_token_ownerships_v2}async function $o(n){let{aptosConfig:e,digitalAssetAddress:t,options:r}=n,i={token_data_id:{_eq:c.from(t).toStringLong()}},o={query:Gi,variables:{where_condition:i,offset:r?.offset,limit:r?.limit,order_by:r?.orderBy}};return(await w({aptosConfig:e,query:o,originMethod:"getDigitalAssetActivity"})).token_activities_v2}var ka={typeParameters:[],parameters:[new m(x()),new q,new m(x()),new m(x()),new N,new N,new N,new N,new N,new N,new N,new N,new N,new q,new q]};async function Wo(n){let{aptosConfig:e,options:t,creator:r}=n;return y({aptosConfig:e,sender:r.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new _(n.description),new de(n.maxSupply??ni),new _(n.name),new _(n.uri),new B(n.mutableDescription??!0),new B(n.mutableRoyalty??!0),new B(n.mutableURI??!0),new B(n.mutableTokenDescription??!0),new B(n.mutableTokenName??!0),new B(n.mutableTokenProperties??!0),new B(n.mutableTokenURI??!0),new B(n.tokensBurnableByCreator??!0),new B(n.tokensFreezableByCreator??!0),new de(n.royaltyNumerator??0),new de(n.royaltyDenominator??1)],abi:ka},options:t})}async function Jt(n){let{aptosConfig:e,options:t}=n,r=t?.where;t?.tokenStandard&&(r.token_standard={_eq:t?.tokenStandard??"v2"});let i={query:Fi,variables:{where_condition:r,offset:t?.offset,limit:t?.limit}};return(await w({aptosConfig:e,query:i,originMethod:"getCollectionData"})).current_collections_v2[0]}async function jo(n){let{aptosConfig:e,creatorAddress:t,collectionName:r,options:i}=n,o=c.from(t),s={collection_name:{_eq:r},creator_address:{_eq:o.toStringLong()}};return i?.tokenStandard&&(s.token_standard={_eq:i?.tokenStandard??"v2"}),Jt({aptosConfig:e,options:{...i,where:s}})}async function Qo(n){let{aptosConfig:e,creatorAddress:t,options:r}=n,o={creator_address:{_eq:c.from(t).toStringLong()}};return r?.tokenStandard&&(o.token_standard={_eq:r?.tokenStandard??"v2"}),Jt({aptosConfig:e,options:{...r,where:o}})}async function Jo(n){let{aptosConfig:e,collectionId:t,options:r}=n,o={collection_id:{_eq:c.from(t).toStringLong()}};return r?.tokenStandard&&(o.token_standard={_eq:r?.tokenStandard??"v2"}),Jt({aptosConfig:e,options:{...r,where:o}})}async function Zo(n){let{creatorAddress:e,collectionName:t,options:r,aptosConfig:i}=n,o=c.from(e),s={collection_name:{_eq:t},creator_address:{_eq:o.toStringLong()}};return r?.tokenStandard&&(s.token_standard={_eq:r?.tokenStandard??"v2"}),(await Jt({aptosConfig:i,options:{where:s}})).collection_id}var Fa={typeParameters:[],parameters:[new m(x()),new m(x()),new m(x()),new m(x()),new K(new m(x())),new K(new m(x())),new K(K.u8())]};async function Yo(n){let{aptosConfig:e,options:t,creator:r,collection:i,description:o,name:s,uri:a,propertyKeys:u,propertyTypes:d,propertyValues:l}=n,A=d?.map(p=>nt[p]);return y({aptosConfig:e,sender:r.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new _(i),new _(o),new _(s),new _(a),P.MoveString(u??[]),P.MoveString(A??[]),ls(l??[],A??[])],abi:Fa},options:t})}var Ua={typeParameters:[{constraints:["key"]}],parameters:[new m(ae(new z(0))),new D]};async function Xo(n){let{aptosConfig:e,sender:t,digitalAssetAddress:r,recipient:i,digitalAssetType:o,options:s}=n;return y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::object::transfer",typeArguments:[o??fe],functionArguments:[c.from(r),c.from(i)],abi:Ua},options:s})}var Da={typeParameters:[],parameters:[new m(x()),new m(x()),new m(x()),new m(x()),new K(new m(x())),new K(new m(x())),new K(K.u8()),new D]};async function es(n){let{aptosConfig:e,account:t,collection:r,description:i,name:o,uri:s,recipient:a,propertyKeys:u,propertyTypes:d,propertyValues:l,options:A}=n;if(u?.length!==l?.length)throw new Error("Property keys and property values counts do not match");if(d?.length!==l?.length)throw new Error("Property types and property values counts do not match");let p=d?.map(g=>nt[g]);return y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::mint_soul_bound",functionArguments:[r,i,o,s,P.MoveString(u??[]),P.MoveString(p??[]),ls(l??[],p??[]),a],abi:Da},options:A})}var Ra={typeParameters:[{constraints:["key"]}],parameters:[new m(ae(new z(0)))]};async function ts(n){let{aptosConfig:e,creator:t,digitalAssetAddress:r,digitalAssetType:i,options:o}=n;return y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::burn",typeArguments:[i??fe],functionArguments:[c.from(r)],abi:Ra},options:o})}var za={typeParameters:[{constraints:["key"]}],parameters:[new m(ae(new z(0)))]};async function ns(n){let{aptosConfig:e,creator:t,digitalAssetAddress:r,digitalAssetType:i,options:o}=n;return y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::freeze_transfer",typeArguments:[i??fe],functionArguments:[r],abi:za},options:o})}var Oa={typeParameters:[{constraints:["key"]}],parameters:[new m(ae(new z(0)))]};async function rs(n){let{aptosConfig:e,creator:t,digitalAssetAddress:r,digitalAssetType:i,options:o}=n;return y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::unfreeze_transfer",typeArguments:[i??fe],functionArguments:[r],abi:Oa},options:o})}var Ga={typeParameters:[{constraints:["key"]}],parameters:[new m(ae(new z(0))),new m(x())]};async function is(n){let{aptosConfig:e,creator:t,description:r,digitalAssetAddress:i,digitalAssetType:o,options:s}=n;return y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::set_description",typeArguments:[o??fe],functionArguments:[c.from(i),new _(r)],abi:Ga},options:s})}var Na={typeParameters:[{constraints:["key"]}],parameters:[new m(ae(new z(0))),new m(x())]};async function os(n){let{aptosConfig:e,creator:t,name:r,digitalAssetAddress:i,digitalAssetType:o,options:s}=n;return y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::set_name",typeArguments:[o??fe],functionArguments:[c.from(i),new _(r)],abi:Na},options:s})}var Ba={typeParameters:[{constraints:["key"]}],parameters:[new m(ae(new z(0))),new m(x())]};async function ss(n){let{aptosConfig:e,creator:t,uri:r,digitalAssetAddress:i,digitalAssetType:o,options:s}=n;return y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::set_uri",typeArguments:[o??fe],functionArguments:[c.from(i),new _(r)],abi:Ba},options:s})}var Ma={typeParameters:[{constraints:["key"]}],parameters:[new m(ae(new z(0))),new m(x()),new m(x()),K.u8()]};async function as(n){let{aptosConfig:e,creator:t,propertyKey:r,propertyType:i,propertyValue:o,digitalAssetAddress:s,digitalAssetType:a,options:u}=n;return y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::add_property",typeArguments:[a??fe],functionArguments:[c.from(s),new _(r),new _(nt[i]),P.U8($r(o,nt[i]))],abi:Ma},options:u})}var Va={typeParameters:[{constraints:["key"]}],parameters:[new m(ae(new z(0))),new m(x())]};async function cs(n){let{aptosConfig:e,creator:t,propertyKey:r,digitalAssetAddress:i,digitalAssetType:o,options:s}=n;return y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::remove_property",typeArguments:[o??fe],functionArguments:[c.from(i),new _(r)],abi:Va},options:s})}var Ha={typeParameters:[{constraints:["key"]}],parameters:[new m(ae(new z(0))),new m(x()),new m(x()),K.u8()]};async function us(n){let{aptosConfig:e,creator:t,propertyKey:r,propertyType:i,propertyValue:o,digitalAssetAddress:s,digitalAssetType:a,options:u}=n;return y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::update_property",typeArguments:[a??fe],functionArguments:[c.from(s),new _(r),new _(nt[i]),$r(o,nt[i])],abi:Ha},options:u})}var La={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new m(ae(new z(0))),new m(x()),new z(1)]};async function ds(n){let{aptosConfig:e,creator:t,propertyKey:r,propertyType:i,propertyValue:o,digitalAssetAddress:s,digitalAssetType:a,options:u}=n;return y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::add_typed_property",typeArguments:[a??fe,nt[i]],functionArguments:[c.from(s),new _(r),o],abi:La},options:u})}var qa={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new m(ae(new z(0))),new m(x()),new z(1)]};async function ps(n){let{aptosConfig:e,creator:t,propertyKey:r,propertyType:i,propertyValue:o,digitalAssetAddress:s,digitalAssetType:a,options:u}=n;return y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::update_typed_property",typeArguments:[a??fe,nt[i]],functionArguments:[c.from(s),new _(r),o],abi:qa},options:u})}function ls(n,e){let t=new Array;return e.forEach((r,i)=>{t.push($r(n[i],r))}),t}function $r(n,e){let t=Te(e);return ht(n,t,0,[]).bcsToBytes()}var yn=class{constructor(e){this.config=e}async getCollectionData(e){await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"});let{creatorAddress:t,collectionName:r,options:i}=e,o=c.from(t),s={collection_name:{_eq:r},creator_address:{_eq:o.toStringLong()}};return i?.tokenStandard&&(s.token_standard={_eq:i?.tokenStandard??"v2"}),Jt({aptosConfig:this.config,options:{where:s}})}async getCollectionDataByCreatorAddressAndCollectionName(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),jo({aptosConfig:this.config,...e})}async getCollectionDataByCreatorAddress(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),Qo({aptosConfig:this.config,...e})}async getCollectionDataByCollectionId(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),Jo({aptosConfig:this.config,...e})}async getCollectionId(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),Zo({aptosConfig:this.config,...e})}async getDigitalAssetData(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),Ho({aptosConfig:this.config,...e})}async getCurrentDigitalAssetOwnership(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),Lo({aptosConfig:this.config,...e})}async getOwnedDigitalAssets(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),qo({aptosConfig:this.config,...e})}async getDigitalAssetActivity(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),$o({aptosConfig:this.config,...e})}async createCollectionTransaction(e){return Wo({aptosConfig:this.config,...e})}async mintDigitalAssetTransaction(e){return Yo({aptosConfig:this.config,...e})}async transferDigitalAssetTransaction(e){return Xo({aptosConfig:this.config,...e})}async mintSoulBoundTransaction(e){return es({aptosConfig:this.config,...e})}async burnDigitalAssetTransaction(e){return ts({aptosConfig:this.config,...e})}async freezeDigitalAssetTransaferTransaction(e){return ns({aptosConfig:this.config,...e})}async unfreezeDigitalAssetTransaferTransaction(e){return rs({aptosConfig:this.config,...e})}async setDigitalAssetDescriptionTransaction(e){return is({aptosConfig:this.config,...e})}async setDigitalAssetNameTransaction(e){return os({aptosConfig:this.config,...e})}async setDigitalAssetURITransaction(e){return ss({aptosConfig:this.config,...e})}async addDigitalAssetPropertyTransaction(e){return as({aptosConfig:this.config,...e})}async removeDigitalAssetPropertyTransaction(e){return cs({aptosConfig:this.config,...e})}async updateDigitalAssetPropertyTransaction(e){return us({aptosConfig:this.config,...e})}async addDigitalAssetTypedPropertyTransaction(e){return ds({aptosConfig:this.config,...e})}async updateDigitalAssetTypedPropertyTransaction(e){return ps({aptosConfig:this.config,...e})}};var gs=300,$a=n=>{if(n&&n.length>gs)throw new Error(`Event type length exceeds the maximum length of ${gs}`)};async function ms(n){let{aptosConfig:e,eventType:t,options:r}=n,i={_or:[{account_address:{_eq:t.split("::")[0]}},{account_address:{_eq:"0x0000000000000000000000000000000000000000000000000000000000000000"},sequence_number:{_eq:0},creation_number:{_eq:0}}],indexed_type:{_eq:t}};return An({aptosConfig:e,options:{...r,where:i}})}async function ys(n){let{accountAddress:e,aptosConfig:t,creationNumber:r,options:i}=n,s={account_address:{_eq:c.from(e).toStringLong()},creation_number:{_eq:r}};return An({aptosConfig:t,options:{...i,where:s}})}async function As(n){let{accountAddress:e,aptosConfig:t,eventType:r,options:i}=n,s={account_address:{_eq:c.from(e).toStringLong()},indexed_type:{_eq:r}};return An({aptosConfig:t,options:{...i,where:s}})}async function An(n){let{aptosConfig:e,options:t}=n;$a(t?.where?.indexed_type?._eq);let r={query:Ri,variables:{where_condition:t?.where,offset:t?.offset,limit:t?.limit,order_by:t?.orderBy}};return(await w({aptosConfig:e,query:r,originMethod:"getEvents"})).events}var fn=class{constructor(e){this.config=e}async getModuleEventsByEventType(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),ms({aptosConfig:this.config,...e})}async getAccountEventsByCreationNumber(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),ys({aptosConfig:this.config,...e})}async getAccountEventsByEventType(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),As({aptosConfig:this.config,...e})}async getEvents(e){return await h({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"events_processor"}),An({aptosConfig:this.config,...e})}};async function fs(n){let{aptosConfig:e,accountAddress:t,amount:r,options:i}=n,o=i?.timeoutSecs||20,{data:s}=await Ti({aptosConfig:e,path:"fund",body:{address:c.from(t).toString(),amount:r},originMethod:"fundAccount"}),a=s.txn_hashes[0],u=await Je({aptosConfig:e,transactionHash:a,options:{timeoutSecs:o,checkSuccess:i?.checkSuccess}});if(u.type==="user_transaction")return u;throw new Error(`Unexpected transaction received for fund account: ${u.type}`)}var hn=class{constructor(e){this.config=e}async fundAccount(e){let t=await fs({aptosConfig:this.config,...e});return(e.options?.waitForIndexer===void 0||e.options?.waitForIndexer)&&await Qi({aptosConfig:this.config,minimumLedgerVersion:BigInt(t.version),processorType:"fungible_asset_processor"}),t}};async function sr(n){let{aptosConfig:e,options:t}=n,r={query:Oi,variables:{where_condition:t?.where,limit:t?.limit,offset:t?.offset}};return(await w({aptosConfig:e,query:r,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function hs(n){let{aptosConfig:e,options:t}=n,r={query:zi,variables:{where_condition:t?.where,limit:t?.limit,offset:t?.offset}};return(await w({aptosConfig:e,query:r,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function bs(n){let{aptosConfig:e,options:t}=n,r={query:Ui,variables:{where_condition:t?.where,limit:t?.limit,offset:t?.offset}};return(await w({aptosConfig:e,query:r,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var ws={typeParameters:[{constraints:[]}],parameters:[Te("0x1::object::Object"),new D,new q]};async function Ts(n){let{aptosConfig:e,sender:t,fungibleAssetMetadataAddress:r,recipient:i,amount:o,options:s}=n;return y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::primary_fungible_store::transfer",typeArguments:["0x1::fungible_asset::Metadata"],functionArguments:[r,i,o],abi:ws},options:s})}async function Ss(n){let{aptosConfig:e,sender:t,fromStore:r,toStore:i,amount:o,options:s}=n;return y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::dispatchable_fungible_asset::transfer",typeArguments:["0x1::fungible_asset::FungibleStore"],functionArguments:[r,i,o],abi:ws},options:s})}var bn=class{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await h({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),sr({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await h({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),(await sr({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetMetadataByCreatorAddress(e){return await h({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),await sr({aptosConfig:this.config,options:{where:{creator_address:{_eq:c.from(e.creatorAddress).toStringLong()}}}})}async getFungibleAssetActivities(e){return await h({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),hs({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await h({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),bs({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return Ts({aptosConfig:this.config,...e})}async transferFungibleAssetBetweenStores(e){return Ss({aptosConfig:this.config,...e})}};var wn=class{constructor(e){this.config=e}async getLedgerInfo(){return Un({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(e){return Ji({aptosConfig:this.config,...e})}async getBlockByHeight(e){return Zi({aptosConfig:this.config,...e})}async view(e){return ne({aptosConfig:this.config,...e})}async viewJson(e){return Go({aptosConfig:this.config,...e})}async getChainTopUserTransactions(e){return Bi({aptosConfig:this.config,...e})}async queryIndexer(e){return w({aptosConfig:this.config,...e})}async getIndexerLastSuccessVersion(){return Mi({aptosConfig:this.config})}async getProcessorStatus(e){return Vi({aptosConfig:this.config,processorType:e})}};var Ps=["A name must be between 3 and 63 characters long,","and can only contain lowercase a-z, 0-9, and hyphens.","A name may not start or end with a hyphen."].join(" ");function xs(n){return!(!n||n.length<3||n.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(n))}function rt(n){let[e,t,...r]=n.replace(/\.apt$/,"").split(".");if(r.length>0)throw new Error(`${n} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!xs(e))throw new Error(`${e} is not valid. ${Ps}`);if(t&&!xs(t))throw new Error(`${t} is not valid. ${Ps}`);return{domainName:t||e,subdomainName:t?e:void 0}}var Wa=(t=>(t[t.Independent=0]="Independent",t[t.FollowsDomain=1]="FollowsDomain",t))(Wa||{});function Ks(n){if(!n)return!1;let e=new Date(n.domain_expiration_timestamp).getTime()<Date.now(),t=new Date(n.expiration_timestamp).getTime()<Date.now();return n.subdomain&&e?!1:n.subdomain&&n.subdomain_expiration_policy===1?!0:!t}var fh="0x37368b46ce665362562c6d1d4ec01a08c8644c488690df5a17e13ba163e20221",ja="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",Qa={testnet:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",mainnet:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",local:ja,custom:null,devnet:null};function Le(n){let e=Qa[n.network];if(!e)throw new Error(`The ANS contract is not deployed to ${n.network}`);return e}var ar=n=>{if(n&&typeof n=="object"&&"vec"in n&&Array.isArray(n.vec))return n.vec[0]};async function Es(n){let{aptosConfig:e,name:t}=n,r=Le(e),{domainName:i,subdomainName:o}=rt(t),s=await ne({aptosConfig:e,payload:{function:`${r}::router::get_owner_addr`,functionArguments:[i,o]}}),a=ar(s[0]);return a?c.from(a):void 0}async function Cs(n){let{aptosConfig:e,expiration:t,name:r,sender:i,targetAddress:o,toAddress:s,options:a,transferable:u}=n,d=Le(e),{domainName:l,subdomainName:A}=rt(r),p=t.policy==="subdomain:independent"||t.policy==="subdomain:follow-domain";if(A&&!p)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(p&&!A)throw new Error(`Policy is set to ${t.policy} but no subdomain was provided`);if(t.policy==="domain"){let G=t.years??1;if(G!==1)throw new Error("For now, names can only be registered for 1 year at a time");let ve=G*31536e3;return await y({aptosConfig:e,sender:i.accountAddress.toString(),data:{function:`${d}::router::register_domain`,functionArguments:[l,ve,o,s]},options:a})}if(!A)throw new Error(`${t.policy} requires a subdomain to be provided.`);let g=await Wr({aptosConfig:e,name:l});if(!g)throw new Error("The domain does not exist");let f=t.policy==="subdomain:independent"?t.expirationDate:g;if(f>g)throw new Error("The subdomain expiration time cannot be greater than the domain expiration time");return await y({aptosConfig:e,sender:i.accountAddress.toString(),data:{function:`${d}::router::register_subdomain`,functionArguments:[l,A,Math.round(f/1e3),t.policy==="subdomain:follow-domain"?1:0,!!u,o,s]},options:a})}async function Wr(n){let{aptosConfig:e,name:t}=n,r=Le(e),{domainName:i,subdomainName:o}=rt(t);try{let s=await ne({aptosConfig:e,payload:{function:`${r}::router::get_expiration`,functionArguments:[i,o]}});return Number(s[0])*1e3}catch{return}}async function Is(n){let{aptosConfig:e,address:t}=n,r=Le(e),i=await ne({aptosConfig:e,payload:{function:`${r}::router::get_primary_name`,functionArguments:[c.from(t).toString()]}}),o=ar(i[1]),s=ar(i[0]);if(o)return[s,o].filter(Boolean).join(".")}async function vs(n){let{aptosConfig:e,sender:t,name:r,options:i}=n,o=Le(e);if(!r)return await y({aptosConfig:e,sender:t.accountAddress.toString(),data:{function:`${o}::router::clear_primary_name`,functionArguments:[]},options:i});let{domainName:s,subdomainName:a}=rt(r);return await y({aptosConfig:e,sender:t.accountAddress.toString(),data:{function:`${o}::router::set_primary_name`,functionArguments:[s,a]},options:i})}async function _s(n){let{aptosConfig:e,name:t}=n,r=Le(e),{domainName:i,subdomainName:o}=rt(t),s=await ne({aptosConfig:e,payload:{function:`${r}::router::get_target_addr`,functionArguments:[i,o]}}),a=ar(s[0]);return a?c.from(a):void 0}async function ks(n){let{aptosConfig:e,sender:t,name:r,address:i,options:o}=n,s=Le(e),{domainName:a,subdomainName:u}=rt(r);return await y({aptosConfig:e,sender:t.accountAddress.toString(),data:{function:`${s}::router::set_target_addr`,functionArguments:[a,u,i]},options:o})}async function Fs(n){let{aptosConfig:e,name:t}=n,{domainName:r,subdomainName:i=""}=rt(t),a=(await w({aptosConfig:e,query:{query:Dt,variables:{where_condition:{domain:{_eq:r},subdomain:{_eq:i}},limit:1}},originMethod:"getName"})).current_aptos_names[0];return a&&(a=Tn(a)),Ks(a)?a:void 0}async function Us(n){let{aptosConfig:e,options:t,accountAddress:r}=n,i=await jr({aptosConfig:e});return(await w({aptosConfig:e,originMethod:"getAccountNames",query:{query:Dt,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...n.options?.where??{},owner_address:{_eq:r.toString()},expiration_timestamp:{_gte:i}}}}})).current_aptos_names.map(Tn)}async function Ds(n){let{aptosConfig:e,options:t,accountAddress:r}=n,i=await jr({aptosConfig:e});return(await w({aptosConfig:e,originMethod:"getAccountDomains",query:{query:Dt,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...n.options?.where??{},owner_address:{_eq:r.toString()},expiration_timestamp:{_gte:i},subdomain:{_eq:""}}}}})).current_aptos_names.map(Tn)}async function Rs(n){let{aptosConfig:e,options:t,accountAddress:r}=n,i=await jr({aptosConfig:e});return(await w({aptosConfig:e,originMethod:"getAccountSubdomains",query:{query:Dt,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...n.options?.where??{},owner_address:{_eq:r.toString()},expiration_timestamp:{_gte:i},subdomain:{_neq:""}}}}})).current_aptos_names.map(Tn)}async function zs(n){let{aptosConfig:e,options:t,domain:r}=n;return(await w({aptosConfig:e,originMethod:"getDomainSubdomains",query:{query:Dt,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...n.options?.where??{},domain:{_eq:r},subdomain:{_neq:""}}}}})).current_aptos_names.map(Tn).filter(Ks)}async function jr(n){let{aptosConfig:e}=n,t=Le(e),[r]=await ne({aptosConfig:e,payload:{function:`${t}::config::reregistration_grace_sec`,functionArguments:[]}}),i=r/60/60/24,o=()=>new Date;return new Date(o().setDate(o().getDate()-i)).toISOString()}async function Os(n){let{aptosConfig:e,sender:t,name:r,years:i=1,options:o}=n,s=Le(e),a=i*31536e3,{domainName:u,subdomainName:d}=rt(r);if(d)throw new Error("Subdomains cannot be renewed");if(i!==1)throw new Error("Currently, only 1 year renewals are supported");return await y({aptosConfig:e,sender:t.accountAddress.toString(),data:{function:`${s}::router::renew_domain`,functionArguments:[u,a]},options:o})}function Tn(n){return{...n,expiration_timestamp:new Date(n.expiration_timestamp).getTime()}}var Sn=class{constructor(e){this.config=e}async getOwnerAddress(e){return Es({aptosConfig:this.config,...e})}async getExpiration(e){return Wr({aptosConfig:this.config,...e})}async getTargetAddress(e){return _s({aptosConfig:this.config,...e})}async setTargetAddress(e){return ks({aptosConfig:this.config,...e})}async getPrimaryName(e){return Is({aptosConfig:this.config,...e})}async setPrimaryName(e){return vs({aptosConfig:this.config,...e})}async registerName(e){return Cs({aptosConfig:this.config,...e})}async renewDomain(e){return Os({aptosConfig:this.config,...e})}async getName(e){return Fs({aptosConfig:this.config,...e})}async getAccountNames(e){return Us({aptosConfig:this.config,...e})}async getAccountDomains(e){return Ds({aptosConfig:this.config,...e})}async getAccountSubdomains(e){return Rs({aptosConfig:this.config,...e})}async getDomainSubdomains(e){return zs({aptosConfig:this.config,...e})}};async function Gs(n){let{aptosConfig:e,poolAddress:t}=n,r=c.from(t).toStringLong(),o=await w({aptosConfig:e,query:{query:br,variables:{where_condition:{pool_address:{_eq:r}}}}});return o.num_active_delegator_per_pool[0]?o.num_active_delegator_per_pool[0].num_active_delegator:0}async function Ns(n){let{aptosConfig:e,options:t}=n,r={query:br,variables:{order_by:t?.orderBy}};return(await w({aptosConfig:e,query:r})).num_active_delegator_per_pool}async function Bs(n){let{aptosConfig:e,delegatorAddress:t,poolAddress:r}=n,i={query:Di,variables:{delegatorAddress:c.from(t).toStringLong(),poolAddress:c.from(r).toStringLong()}};return(await w({aptosConfig:e,query:i})).delegated_staking_activities}var Pn=class{constructor(e){this.config=e}async getNumberOfDelegators(e){return await h({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),Gs({aptosConfig:this.config,...e})}async getNumberOfDelegatorsForAllPools(e){return await h({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),Ns({aptosConfig:this.config,...e})}async getDelegatedStakingActivities(e){return await h({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),Bs({aptosConfig:this.config,...e})}};var cr=class{constructor(e){this.config=e}async simple(e){return y({aptosConfig:this.config,...e})}async multiAgent(e){return y({aptosConfig:this.config,...e})}};var Zt=class{constructor(e){this.config=e}async simple(e){return Vr({aptosConfig:this.config,...e})}async multiAgent(e){return Vr({aptosConfig:this.config,...e})}};St([Sr],Zt.prototype,"simple",1),St([Sr],Zt.prototype,"multiAgent",1);var Yt=class{constructor(e){this.config=e}async simple(e){return ln({aptosConfig:this.config,...e})}async multiAgent(e){return ln({aptosConfig:this.config,...e})}};St([Tr],Yt.prototype,"simple",1),St([Tr],Yt.prototype,"multiAgent",1);import Za from"eventemitter3";var ur=class{constructor(e,t,r,i,o){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=e,this.account=t,this.maxWaitTime=r,this.maximumInFlight=i,this.sleepTime=o}async nextSequenceNumber(){for(;this.lock;)await en(this.sleepTime);this.lock=!0;let e=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let t=ke();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await en(this.sleepTime),ke()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}e=this.currentNumber,this.currentNumber+=BigInt(1)}catch(t){console.error("error in getting next sequence number for this account",t)}finally{this.lock=!1}return e}async initialize(){let{sequence_number:e}=await bt({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(e),this.lastUncommintedNumber=BigInt(e)}async update(){let{sequence_number:e}=await bt({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(e),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await en(this.sleepTime);this.lock=!0;try{await this.update();let e=ke();for(;this.lastUncommintedNumber!==this.currentNumber;)ke()-e>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await en(this.sleepTime),await this.update())}catch(e){console.error("error in synchronizing this account sequence number with the one on chain",e)}finally{this.lock=!1}}}};import Ja from"eventemitter3";var Ms="fulfilled",Vs=(o=>(o.TransactionSent="transactionSent",o.TransactionSendFailed="transactionSendFailed",o.TransactionExecuted="transactionExecuted",o.TransactionExecutionFailed="transactionExecutionFailed",o.ExecutionFinish="executionFinish",o))(Vs||{}),dr=class extends Ja{constructor(t,r,i=30,o=100,s=10){super();this.taskQueue=new zn;this.transactionsQueue=new zn;this.outstandingTransactions=new zn;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=r,this.started=!1,this.accountSequnceNumber=new ur(t,r,i,o,s)}async submitNextTransaction(){try{for(;;){let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let r=await this.generateNextTransaction(this.account,t);if(!r)return;let i=tt({aptosConfig:this.aptosConfig,transaction:r,signer:this.account});await this.outstandingTransactions.enqueue([i,t])}}catch(t){if(t instanceof Pr)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],r=[],[i,o]=await this.outstandingTransactions.dequeue();for(t.push(i),r.push(o);!this.outstandingTransactions.isEmpty();)[i,o]=await this.outstandingTransactions.dequeue(),t.push(i),r.push(o);let s=await Promise.allSettled(t);for(let a=0;a<s.length&&a<r.length;a+=1){let u=s[a];o=r[a],u.status===Ms?(this.sentTransactions.push([u.value.hash,o,null]),this.emit("transactionSent",{message:`transaction hash ${u.value.hash} has been committed to chain`,transactionHash:u.value.hash}),await this.checkTransaction(u,o)):(this.sentTransactions.push([u.status,o,u.reason]),this.emit("transactionSendFailed",{message:`failed to commit transaction ${this.sentTransactions.length} with error ${u.reason}`,error:u.reason}))}this.emit("executionFinish",{message:`execute ${s.length} transactions finished`})}}catch(t){if(t instanceof Pr)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,r){try{let i=[];i.push(Je({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let o=await Promise.allSettled(i);for(let s=0;s<o.length;s+=1){let a=o[s];a.status===Ms?(this.executedTransactions.push([a.value.hash,r,null]),this.emit("transactionExecuted",{message:`transaction hash ${a.value.hash} has been executed on chain`,transactionHash:t.value.hash})):(this.executedTransactions.push([a.status,r,a.reason]),this.emit("transactionExecutionFailed",{message:`failed to execute transaction ${this.executedTransactions.length} with error ${a.reason}`,error:a.reason}))}}catch(i){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${i}`)}}async push(t,r){this.transactionsQueue.enqueue([t,r])}async generateNextTransaction(t,r){if(this.transactionsQueue.isEmpty())return;let[i,o]=await this.transactionsQueue.dequeue();return y({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:i,options:{...o,accountSequenceNumber:r,replayProtectionNonce:void 0}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}};var pr=class extends Za{constructor(e){super(),this.config=e}start(e){let{sender:t}=e;this.account=t,this.transactionWorker=new dr(this.config,t),this.transactionWorker.start(),this.registerToEvents()}push(e){let{data:t,options:r}=e;for(let i of t)this.transactionWorker.push(i,r)}registerToEvents(){this.transactionWorker.on("transactionSent",async e=>{this.emit("transactionSent",e)}),this.transactionWorker.on("transactionSendFailed",async e=>{this.emit("transactionSendFailed",e)}),this.transactionWorker.on("transactionExecuted",async e=>{this.emit("transactionExecuted",e)}),this.transactionWorker.on("transactionExecutionFailed",async e=>{this.emit("transactionExecutionFailed",e)}),this.transactionWorker.on("executionFinish",async e=>{this.emit("executionFinish",e)})}forSingleAccount(e){try{let{sender:t,data:r,options:i}=e;this.start({sender:t}),this.push({data:r,options:i})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}};var xn=class{constructor(e){this.config=e,this.build=new cr(this.config),this.simulate=new Zt(this.config),this.submit=new Yt(this.config),this.batch=new pr(this.config)}async getTransactions(e){return qi({aptosConfig:this.config,...e})}async getTransactionByVersion(e){return $i({aptosConfig:this.config,...e})}async getTransactionByHash(e){return Wi({aptosConfig:this.config,...e})}async isPendingTransaction(e){return ji({aptosConfig:this.config,...e})}async waitForTransaction(e){return Je({aptosConfig:this.config,...e})}async getGasPriceEstimation(){return Rn({aptosConfig:this.config})}getSigningMessage(e){return wo(e)}async publishPackageTransaction(e){return So({aptosConfig:this.config,...e})}async rotateAuthKey(e){return Oo({aptosConfig:this.config,...e})}sign(e){return ir({...e})}signAsFeePayer(e){return or({...e})}async batchTransactionsForSingleAccount(e){try{let{sender:t,data:r,options:i}=e;this.batch.forSingleAccount({sender:t,data:r,options:i})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(e){return tt({aptosConfig:this.config,...e})}async signAndSubmitAsFeePayer(e){return To({aptosConfig:this.config,...e})}};import{jwtDecode as Xa}from"jwt-decode";async function lr(n){let{aptosConfig:e,jwt:t,ephemeralKeyPair:r,uidKey:i="sub",derivationPath:o}=n,s={jwt_b64:t,epk:r.getPublicKey().bcsToHex().toStringWithoutPrefix(),exp_date_secs:r.expiryDateSecs,epk_blinder:T.fromHexInput(r.blinder).toStringWithoutPrefix(),uid_key:i,derivation_path:o},{data:a}=await Si({aptosConfig:e,path:"fetch",body:s,originMethod:"getPepper",overrides:{WITH_CREDENTIALS:!1}});return T.fromHexInput(a.pepper).toUint8Array()}async function Qr(n){let{aptosConfig:e,jwt:t,ephemeralKeyPair:r,pepper:i=await lr(n),uidKey:o="sub",maxExpHorizonSecs:s=(await $t({aptosConfig:e})).maxExpHorizonSecs}=n;if(T.fromHexInput(i).toUint8Array().length!==Ve.PEPPER_LENGTH)throw new Error(`Pepper needs to be ${Ve.PEPPER_LENGTH} bytes`);let a=Xa(t);if(typeof a.iat!="number")throw new Error("iat was not found");if(s<r.expiryDateSecs-a.iat)throw Error(`The EphemeralKeyPair is too long lived. It's lifespan must be less than ${s}`);let u={jwt_b64:t,epk:r.getPublicKey().bcsToHex().toStringWithoutPrefix(),epk_blinder:T.fromHexInput(r.blinder).toStringWithoutPrefix(),exp_date_secs:r.expiryDateSecs,exp_horizon_secs:s,pepper:T.fromHexInput(i).toStringWithoutPrefix(),uid_key:o},{data:d}=await Pi({aptosConfig:e,path:"prove",body:u,originMethod:"getProof",overrides:{WITH_CREDENTIALS:!1}}),l=d.proof,A=new it({a:l.a,b:l.b,c:l.c});return new ce({proof:new Xt(A,0),trainingWheelsSignature:je.fromHex(d.training_wheels_signature),expHorizonSecs:s})}async function Hs(n){let{aptosConfig:e,jwt:t,jwkAddress:r,uidKey:i,proofFetchCallback:o,pepper:s=await lr(n)}=n,{verificationKey:a,maxExpHorizonSecs:u}=await $t({aptosConfig:e}),d=Qr({...n,pepper:s,maxExpHorizonSecs:u}),l=o?d:await d;if(r!==void 0){let g=M.fromJwtAndPepper({jwt:t,pepper:s,jwkAddress:r,uidKey:i}),f=await jt({aptosConfig:e,authenticationKey:g.authKey().derivedAddress()});return ft.create({...n,address:f,proof:l,pepper:s,proofFetchCallback:o,jwkAddress:r,verificationKey:a})}let A=E.fromJwtAndPepper({jwt:t,pepper:s,uidKey:i}),p=await jt({aptosConfig:e,authenticationKey:A.authKey().derivedAddress()});return Ve.create({...n,address:p,proof:l,pepper:s,proofFetchCallback:o,verificationKey:a})}async function Ls(n){let{aptosConfig:e,sender:t,iss:r,options:i}=n,{jwksUrl:o}=n;o===void 0&&(pi.test(r)?o="https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com":o=r.endsWith("/")?`${r}.well-known/jwks.json`:`${r}/.well-known/jwks.json`);let s;try{if(s=await fetch(o),!s.ok)throw new Error(`${s.status} ${s.statusText}`)}catch(u){let d;throw u instanceof Error?d=`${u.message}`:d=`error unknown - ${u}`,b.fromErrorType({type:14,details:`Failed to fetch JWKS at ${o}: ${d}`})}let a=await s.json();return y({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::jwks::update_federated_jwk_set",functionArguments:[r,P.MoveString(a.keys.map(u=>u.kid)),P.MoveString(a.keys.map(u=>u.alg)),P.MoveString(a.keys.map(u=>u.e)),P.MoveString(a.keys.map(u=>u.n))]},options:i})}var Kn=class{constructor(e){this.config=e}async getPepper(e){return lr({aptosConfig:this.config,...e})}async getProof(e){return Qr({aptosConfig:this.config,...e})}async deriveKeylessAccount(e){return Hs({aptosConfig:this.config,...e})}async updateFederatedKeylessJwkSetTransaction(e){return Ls({aptosConfig:this.config,...e})}};async function ec(n){let{aptosConfig:e,options:t}=n,r={query:Fn,variables:{where_condition:t?.where,offset:t?.offset,limit:t?.limit,order_by:t?.orderBy}};return(await w({aptosConfig:e,query:r,originMethod:"getObjectData"})).current_objects}async function qs(n){let{aptosConfig:e,objectAddress:t,options:r}=n,o={object_address:{_eq:c.from(t).toStringLong()}};return(await ec({aptosConfig:e,options:{...r,where:o}}))[0]}var En=class{constructor(e){this.config=e}async getObjectDataByObjectAddress(e){return await h({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"objects_processor"}),qs({aptosConfig:this.config,...e})}};var W=class{constructor(e){this.config=e??new Yi,this.account=new gn(this.config),this.abstraction=new wt(this.config),this.ans=new Sn(this.config),this.coin=new mn(this.config),this.digitalAsset=new yn(this.config),this.event=new fn(this.config),this.faucet=new hn(this.config),this.fungibleAsset=new bn(this.config),this.general=new wn(this.config),this.staking=new Pn(this.config),this.transaction=new xn(this.config),this.table=new xr(this.config),this.keyless=new Kn(this.config),this.object=new En(this.config)}setIgnoreTransactionSubmitter(e){this.config.setIgnoreTransactionSubmitter(e)}};function re(n,e,t){Object.getOwnPropertyNames(e.prototype).forEach(r=>{let i=Object.getOwnPropertyDescriptor(e.prototype,r);i&&(i.value=function(...o){return this[t][r](...o)},Object.defineProperty(n.prototype,r,i))})}re(W,gn,"account");re(W,wt,"abstraction");re(W,Sn,"ans");re(W,mn,"coin");re(W,yn,"digitalAsset");re(W,fn,"event");re(W,hn,"faucet");re(W,bn,"fungibleAsset");re(W,wn,"general");re(W,Pn,"staking");re(W,xn,"transaction");re(W,xr,"table");re(W,Kn,"keyless");re(W,En,"object");var ic=1e7,Jr=120,oc=30,sc=330,ac=120,cc=350,uc=300,dc=93,Ie=class Ie extends We{constructor(e,t){super();let r=T.fromHexInput(t).toUint8Array();if(r.length!==Ie.ID_COMMITMENT_LENGTH)throw new Error(`Id Commitment length in bytes should be ${Ie.ID_COMMITMENT_LENGTH}`);this.iss=e,this.idCommitment=r}authKey(){let e=new Q;return e.serializeU32AsUleb128(3),e.serializeFixedBytes(this.bcsToBytes()),Y.fromSchemeAndBytes({scheme:2,input:e.toUint8Array()})}verifySignature(e){try{return Gn({...e,publicKey:this}),!0}catch(t){if(t instanceof b)return!1;throw t}}async verifySignatureAsync(e){return Kr({...e,publicKey:this})}serialize(e){e.serializeStr(this.iss),e.serializeBytes(this.idCommitment)}static deserialize(e){let t=e.deserializeStr(),r=e.deserializeBytes();return new Ie(t,r)}static load(e){let t=e.deserializeStr(),r=e.deserializeBytes();return new Ie(t,r)}static isPublicKey(e){return e instanceof Ie}static create(e){return $s(e),new Ie(e.iss,$s(e))}static fromJwtAndPepper(e){let{jwt:t,pepper:r,uidKey:i="sub"}=e,o=Ws(t);if(typeof o.iss!="string")throw new Error("iss was not found");if(typeof o.aud!="string")throw new Error("aud was not found or an array of values");let s=o[i];return Ie.create({iss:o.iss,uidKey:i,uidVal:s,aud:o.aud,pepper:r})}static isInstance(e){return"iss"in e&&typeof e.iss=="string"&&"idCommitment"in e&&e.idCommitment instanceof Uint8Array}};Ie.ID_COMMITMENT_LENGTH=32;var E=Ie;async function Kr(n){let{aptosConfig:e,publicKey:t,message:r,signature:i,jwk:o,keylessConfig:s=await $t({aptosConfig:e}),options:a}=n;try{if(!(i instanceof X))throw b.fromErrorType({type:26,details:"Not a keyless signature"});return Gn({message:r,publicKey:t,signature:i,jwk:o||await Cr({aptosConfig:e,publicKey:t,kid:i.getJwkKid()}),keylessConfig:s}),!0}catch(u){if(a?.throwErrorWithReason)throw u;return!1}}function Gn(n){let{publicKey:e,message:t,signature:r,keylessConfig:i,jwk:o}=n,{verificationKey:s,maxExpHorizonSecs:a,trainingWheelsPubkey:u}=i;if(!(r instanceof X))throw b.fromErrorType({type:26,details:"Not a keyless signature"});if(!(r.ephemeralCertificate.signature instanceof ce))throw b.fromErrorType({type:26,details:"Unsupported ephemeral certificate variant"});let d=r.ephemeralCertificate.signature;if(!(d.proof.proof instanceof it))throw b.fromErrorType({type:26,details:"Unsupported proof variant for ZeroKnowledgeSig"});let l=d.proof.proof;if(r.expiryDateSecs<ke())throw b.fromErrorType({type:27,details:"The expiryDateSecs is in the past"});if(d.expHorizonSecs>a)throw b.fromErrorType({type:28});if(!r.ephemeralPublicKey.verifySignature({message:t,signature:r.ephemeralSignature}))throw b.fromErrorType({type:29});let A=pc({publicKey:e,signature:r,jwk:o,keylessConfig:i});if(!s.verifyProof({publicInputsHash:A,groth16Proof:l}))throw b.fromErrorType({type:32});if(u){if(!d.trainingWheelsSignature)throw b.fromErrorType({type:30});let p=new Yr(l,A);if(!u.verifySignature({message:p.hash(),signature:d.trainingWheelsSignature}))throw b.fromErrorType({type:31})}}function pc(n){let{publicKey:e,signature:t,jwk:r,keylessConfig:i}=n,o=e instanceof E?e:e.keylessPublicKey;if(!(t.ephemeralCertificate.signature instanceof ce))throw new Error("Signature is not a ZeroKnowledgeSig");let s=t.ephemeralCertificate.signature,a=[];return a.push(...vn(t.ephemeralPublicKey.toUint8Array(),i.maxCommitedEpkBytes)),a.push(vt(o.idCommitment)),a.push(t.expiryDateSecs),a.push(s.expHorizonSecs),a.push(Ke(o.iss,i.maxIssValBytes)),s.extraField?(a.push(1n),a.push(Ke(s.extraField,i.maxExtraFieldBytes))):(a.push(0n),a.push(Ke(" ",i.maxExtraFieldBytes))),a.push(Ke(rc(t.jwtHeader,!0)+".",i.maxJwtHeaderB64Bytes)),a.push(r.toScalar()),s.overrideAudVal?(a.push(Ke(s.overrideAudVal,Jr)),a.push(1n)):(a.push(Ke("",Jr)),a.push(0n)),_t(a)}async function Cr(n){let{aptosConfig:e,publicKey:t,kid:r}=n,i=t instanceof E?t:t.keylessPublicKey,{iss:o}=i,s,a=t instanceof M?t.jwkAddress:void 0;try{s=await mc({aptosConfig:e,jwkAddr:a})}catch(l){throw b.fromErrorType({type:24,error:l,details:`Failed to fetch ${a?"Federated":"Patched"}JWKs ${a?`for address ${a}`:"0x1"}`})}let u=s.get(o);if(u===void 0)throw b.fromErrorType({type:7,details:`JWKs for issuer ${o} not found.`});let d=u.find(l=>l.kid===r);if(d===void 0)throw b.fromErrorType({type:6,details:`JWK with kid '${r}' for issuer '${o}' not found.`});return d}function $s(n){let{uidKey:e,uidVal:t,aud:r,pepper:i}=n,o=[vt(T.fromHexInput(i).toUint8Array()),Ke(r,Jr),Ke(t,sc),Ke(e,oc)];return mr(_t(o),E.ID_COMMITMENT_LENGTH)}var X=class n extends xe{constructor(e){super();let{jwtHeader:t,ephemeralCertificate:r,expiryDateSecs:i,ephemeralPublicKey:o,ephemeralSignature:s}=e;this.jwtHeader=t,this.ephemeralCertificate=r,this.expiryDateSecs=i,this.ephemeralPublicKey=o,this.ephemeralSignature=s}getJwkKid(){return Ac(this.jwtHeader).kid}serialize(e){this.ephemeralCertificate.serialize(e),e.serializeStr(this.jwtHeader),e.serializeU64(this.expiryDateSecs),this.ephemeralPublicKey.serialize(e),this.ephemeralSignature.serialize(e)}static deserialize(e){let t=qt.deserialize(e),r=e.deserializeStr(),i=e.deserializeU64(),o=It.deserialize(e),s=je.deserialize(e);return new n({jwtHeader:r,expiryDateSecs:Number(i),ephemeralCertificate:t,ephemeralPublicKey:o,ephemeralSignature:s})}static getSimulationSignature(){return new n({jwtHeader:"{}",ephemeralCertificate:new qt(new ce({proof:new Xt(new it({a:new Uint8Array(32),b:new Uint8Array(64),c:new Uint8Array(32)}),0),expHorizonSecs:0}),0),expiryDateSecs:0,ephemeralPublicKey:new It(new k(new Uint8Array(32))),ephemeralSignature:new je(new O(new Uint8Array(64)))})}static isSignature(e){return e instanceof n}},qt=class n extends xe{constructor(e,t){super(),this.signature=e,this.variant=t}toUint8Array(){return this.signature.toUint8Array()}serialize(e){e.serializeU32AsUleb128(this.variant),this.signature.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return new n(ce.deserialize(e),t);default:throw new Error(`Unknown variant index for EphemeralCertificate: ${t}`)}}},Cn=class Cn extends S{constructor(e){if(super(),this.data=T.fromHexInput(e).toUint8Array(),this.data.length!==32)throw new Error("Input needs to be 32 bytes")}serialize(e){e.serializeFixedBytes(this.data)}static deserialize(e){let t=e.deserializeFixedBytes(32);return new Cn(t)}toArray(){let e=this.toProjectivePoint();return[e.x.toString(),e.y.toString(),e.pz.toString()]}toProjectivePoint(){let e=new Uint8Array(this.data);e.reverse();let t=(e[0]&128)>>7,{Fp:r}=Se.fields,i=r.create(Zr(e)),o=r.sqrt(r.add(r.pow(i,3n),Cn.B)),s=r.neg(o),a=o>s==(t===1)?o:s;return Se.G1.ProjectivePoint.fromAffine({x:i,y:a})}};Cn.B=Se.fields.Fp.create(3n);var qe=Cn;function Zr(n){if(n.length!==32)throw new Error("Input should be 32 bytes");let e=new Uint8Array(n);return e[0]=e[0]&63,nc(e)}var In=class In extends S{constructor(e){if(super(),this.data=T.fromHexInput(e).toUint8Array(),this.data.length!==64)throw new Error("Input needs to be 64 bytes")}serialize(e){e.serializeFixedBytes(this.data)}static deserialize(e){let t=e.deserializeFixedBytes(64);return new In(t)}toArray(){let e=this.toProjectivePoint();return[[e.x.c0.toString(),e.x.c1.toString()],[e.y.c0.toString(),e.y.c1.toString()],[e.pz.c0.toString(),e.pz.c1.toString()]]}toProjectivePoint(){let e=new Uint8Array(this.data),t=e.slice(0,32).reverse(),r=e.slice(32,64).reverse(),i=(r[0]&128)>>7,{Fp2:o}=Se.fields,s=o.fromBigTuple([Zr(t),Zr(r)]),a=o.sqrt(o.add(o.pow(s,3n),In.B)),u=o.neg(a),l=(a.c1>u.c1||a.c1===u.c1&&a.c0>u.c0)===(i===1)?a:u;return Se.G2.ProjectivePoint.fromAffine({x:s,y:l})}};In.B=Se.fields.Fp2.fromBigTuple([19485874751759354771024239261021720505790618469301721065564631296452457478373n,266929791119991161246907387137283842545076965332900288569378510910307636690n]);var Tt=In,it=class n extends ai{constructor(e){super();let{a:t,b:r,c:i}=e;this.a=new qe(t),this.b=new Tt(r),this.c=new qe(i)}serialize(e){this.a.serialize(e),this.b.serialize(e),this.c.serialize(e)}static deserialize(e){let t=qe.deserialize(e).bcsToBytes(),r=Tt.deserialize(e).bcsToBytes(),i=qe.deserialize(e).bcsToBytes();return new n({a:t,b:r,c:i})}toSnarkJsJson(){return{protocol:"groth16",curve:"bn128",pi_a:this.a.toArray(),pi_b:this.b.toArray(),pi_c:this.c.toArray()}}},Yr=class n extends S{constructor(t,r){super();this.domainSeparator="APTOS::Groth16ProofAndStatement";if(this.proof=t,this.publicInputsHash=typeof r=="bigint"?mr(r,32):T.fromHexInput(r).toUint8Array(),this.publicInputsHash.length!==32)throw new Error("Invalid public inputs hash")}serialize(t){this.proof.serialize(t),t.serializeFixedBytes(this.publicInputsHash)}static deserialize(t){return new n(it.deserialize(t),t.deserializeFixedBytes(32))}hash(){return et(this.bcsToBytes(),this.domainSeparator)}},Xt=class n extends S{constructor(e,t){super(),this.proof=e,this.variant=t}serialize(e){e.serializeU32AsUleb128(this.variant),this.proof.serialize(e)}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return new n(it.deserialize(e),t);default:throw new Error(`Unknown variant index for ZkProof: ${t}`)}}},ce=class n extends xe{constructor(e){super();let{proof:t,expHorizonSecs:r,trainingWheelsSignature:i,extraField:o,overrideAudVal:s}=e;this.proof=t,this.expHorizonSecs=r,this.trainingWheelsSignature=i,this.extraField=o,this.overrideAudVal=s}static fromBytes(e){return n.deserialize(new H(e))}serialize(e){this.proof.serialize(e),e.serializeU64(this.expHorizonSecs),e.serializeOption(this.extraField),e.serializeOption(this.overrideAudVal),e.serializeOption(this.trainingWheelsSignature)}static deserialize(e){let t=Xt.deserialize(e),r=Number(e.deserializeU64()),i=e.deserializeOption("string"),o=e.deserializeOption("string"),s=e.deserializeOption(je);return new n({proof:t,expHorizonSecs:r,trainingWheelsSignature:s,extraField:i,overrideAudVal:o})}},Xr=class n{constructor(e){let{verificationKey:t,trainingWheelsPubkey:r,maxExpHorizonSecs:i=ic,maxExtraFieldBytes:o=cc,maxJwtHeaderB64Bytes:s=uc,maxIssValBytes:a=ac,maxCommitedEpkBytes:u=dc}=e;this.verificationKey=t,this.maxExpHorizonSecs=i,r&&(this.trainingWheelsPubkey=new It(new k(r))),this.maxExtraFieldBytes=o,this.maxJwtHeaderB64Bytes=s,this.maxIssValBytes=a,this.maxCommitedEpkBytes=u}static create(e,t){return new n({verificationKey:new ei({alphaG1:e.alpha_g1,betaG2:e.beta_g2,deltaG2:e.delta_g2,gammaAbcG1:e.gamma_abc_g1,gammaG2:e.gamma_g2}),maxExpHorizonSecs:Number(t.max_exp_horizon_secs),trainingWheelsPubkey:t.training_wheels_pubkey.vec[0],maxExtraFieldBytes:t.max_extra_field_bytes,maxJwtHeaderB64Bytes:t.max_jwt_header_b64_bytes,maxIssValBytes:t.max_iss_val_bytes,maxCommitedEpkBytes:t.max_commited_epk_bytes})}},ei=class n{constructor(e){let{alphaG1:t,betaG2:r,deltaG2:i,gammaAbcG1:o,gammaG2:s}=e;this.alphaG1=new qe(t),this.betaG2=new Tt(r),this.deltaG2=new Tt(i),this.gammaAbcG1=[new qe(o[0]),new qe(o[1])],this.gammaG2=new Tt(s)}hash(){let e=new Q;return this.serialize(e),tc.create().update(e.toUint8Array()).digest()}serialize(e){this.alphaG1.serialize(e),this.betaG2.serialize(e),this.deltaG2.serialize(e),this.gammaAbcG1[0].serialize(e),this.gammaAbcG1[1].serialize(e),this.gammaG2.serialize(e)}static fromGroth16VerificationKeyResponse(e){return new n({alphaG1:e.alpha_g1,betaG2:e.beta_g2,deltaG2:e.delta_g2,gammaAbcG1:e.gamma_abc_g1,gammaG2:e.gamma_g2})}verifyProof(e){let{publicInputsHash:t,groth16Proof:r}=e;try{let i=r.a.toProjectivePoint(),o=r.b.toProjectivePoint(),s=r.c.toProjectivePoint(),a=this.alphaG1.toProjectivePoint(),u=this.betaG2.toProjectivePoint(),d=this.gammaG2.toProjectivePoint(),l=this.deltaG2.toProjectivePoint(),A=this.gammaAbcG1.map($e=>$e.toProjectivePoint()),{Fp12:p}=Se.fields,g=A[0].add(A[1].multiply(t)),f=Se.pairing(g,d),v=Se.pairing(i,o),G=Se.pairing(a,u),j=Se.pairing(s,l),ve=p.mul(G,p.mul(f,j));return p.eql(v,ve)}catch(i){throw b.fromErrorType({type:32,error:i,details:"Error encountered when checking zero knowledge relation"})}}toSnarkJsJson(){return{protocol:"groth16",curve:"bn128",nPublic:1,vk_alpha_1:this.alphaG1.toArray(),vk_beta_2:this.betaG2.toArray(),vk_gamma_2:this.gammaG2.toArray(),vk_delta_2:this.deltaG2.toArray(),IC:this.gammaAbcG1.map(e=>e.toArray())}}};async function $t(n){let{aptosConfig:e}=n;try{return await Ut(async()=>{let[t,r]=await Promise.all([lc(n),gc(n)]);return Xr.create(r,t)},`keyless-configuration-${e.network}`,1e3*60*5)()}catch(t){throw t instanceof b?t:b.fromErrorType({type:25,error:t})}}function Me(n){let{jwt:e,uidKey:t="sub"}=n,r;try{r=Ws(e)}catch(o){throw b.fromErrorType({type:12,details:`Failed to parse JWT - ${gi(o)}`})}if(typeof r.iss!="string")throw b.fromErrorType({type:12,details:"JWT is missing 'iss' in the payload. This should never happen."});if(typeof r.aud!="string")throw b.fromErrorType({type:12,details:"JWT is missing 'aud' in the payload or 'aud' is an array of values."});let i=r[t];return{iss:r.iss,aud:r.aud,uidVal:i}}async function lc(n){let{aptosConfig:e,options:t}=n,r="0x1::keyless_account::Configuration";try{let{data:i}=await ot({aptosConfig:e,originMethod:"getKeylessConfigurationResource",path:`accounts/${c.from("0x1").toString()}/resource/${r}`,params:{ledger_version:t?.ledgerVersion}});return i.data}catch(i){throw b.fromErrorType({type:22,error:i})}}async function gc(n){let{aptosConfig:e,options:t}=n,r="0x1::keyless_account::Groth16VerificationKey";try{let{data:i}=await ot({aptosConfig:e,originMethod:"getGroth16VerificationKeyResource",path:`accounts/${c.from("0x1").toString()}/resource/${r}`,params:{ledger_version:t?.ledgerVersion}});return i.data}catch(i){throw b.fromErrorType({type:23,error:i})}}async function mc(n){let{aptosConfig:e,jwkAddr:t,options:r}=n,i;if(t){let s="0x1::jwks::FederatedJWKs",{data:a}=await ot({aptosConfig:e,originMethod:"getKeylessJWKs",path:`accounts/${c.from(t).toString()}/resource/${s}`,params:{ledger_version:r?.ledgerVersion}});i=a}else{let s="0x1::jwks::PatchedJWKs",{data:a}=await ot({aptosConfig:e,originMethod:"getKeylessJWKs",path:`accounts/0x1/resource/${s}`,params:{ledger_version:r?.ledgerVersion}});i=a}let o=new Map;for(let s of i.data.jwks.entries){let a=[];for(let u of s.jwks){let{data:d}=u.variant,l=new H(T.fromHexInput(d).toUint8Array()),A=ti.deserialize(l);a.push(A)}o.set(ri(s.issuer),a)}return o}var ti=class n extends S{constructor(e){super();let{kid:t,kty:r,alg:i,e:o,n:s}=e;this.kid=t,this.kty=r,this.alg=i,this.e=o,this.n=s}serialize(e){e.serializeStr(this.kid),e.serializeStr(this.kty),e.serializeStr(this.alg),e.serializeStr(this.e),e.serializeStr(this.n)}static fromMoveStruct(e){let{data:t}=e.variant,r=new H(T.fromHexInput(t).toUint8Array());return n.deserialize(r)}toScalar(){if(this.alg!=="RS256")throw b.fromErrorType({type:32,details:"Failed to convert JWK to scalar when calculating the public inputs hash. Only RSA 256 is supported currently"});let e=Ai(this.n),r=yc(e.reverse()).map(i=>vt(i));return r.push(256n),_t(r)}static deserialize(e){let t=e.deserializeStr(),r=e.deserializeStr(),i=e.deserializeStr(),o=e.deserializeStr(),s=e.deserializeStr();return new n({kid:t,kty:r,alg:i,n:s,e:o})}};function yc(n){let e=[];for(let t=0;t<n.length;t+=24){let r=n.slice(t,Math.min(t+24,n.length));if(r.length<24){let i=new Uint8Array(24);i.set(r),e.push(i)}else e.push(r)}return e}function Ac(n){try{let e=JSON.parse(n);if(e.kid===void 0)throw new Error("JWT header missing kid");return e}catch{throw new Error("Failed to parse JWT header.")}}export{ic as a,Jr as b,oc as c,sc as d,ac as e,cc as f,uc as g,dc as h,E as i,Kr as j,Gn as k,Cr as l,X as m,qt as n,it as o,Yr as p,Xt as q,ce as r,Xr as s,ei as t,$t as u,Me as v,mc as w,ti as x,Ac as y,M as z,I as A,U as B,nn as C,le as D,ge as E,Ze as F,he as G,hu as H,bu as I,L as J,be as K,Fe as L,ee as M,Ee as N,Rt as O,at as P,rn as Q,R,N as S,se as T,Ue as U,De as V,q as W,Re as X,ze as Y,D as Z,ct as _,Mn as $,z as aa,K as ba,m as ca,Ce as da,dd as ea,x as fa,pd as ga,ae as ha,Qs as ia,Ye as ja,zt as ka,Ot as la,Gt as ma,Oe as na,Nt as oa,on as pa,sn as qa,Vn as ra,ut as sa,Bt as ta,an as ua,Mt as va,cn as wa,Hn as xa,dt as ya,ye as za,Ln as Aa,pt as Ba,lt as Ca,Ge as Da,gt as Ea,Vt as Fa,mt as Ga,yt as Ha,Xe as Ia,Ne as Ja,qn as Ka,$n as La,Wn as Ma,et as Na,Kp as Oa,we as Pa,te as Qa,Er as Ra,Ae as Sa,Be as Ta,At as Ua,Qn as Va,ue as Wa,jn as Xa,Ve as Ya,ft as Za,un as _a,Jn as $a,eo as ab,ro as bb,Zn as cb,oo as db,ca as eb,V as fb,Te as gb,co as hb,He as ib,ua as jb,Yn as kb,Xn as lb,uo as mb,po as nb,vr as ob,er as pb,_r as qb,da as rb,kr as sb,Fr as tb,Ur as ub,Dr as vb,Rr as wb,zr as xb,lo as yb,C as zb,go as Ab,tr as Bb,la as Cb,Gr as Db,Fm as Eb,mo as Fb,yo as Gb,Nr as Hb,ht as Ib,rr as Jb,ya as Kb,Ao as Lb,Aa as Mb,ha as Nb,ba as Ob,Br as Pb,fo as Qb,Wt as Rb,Mr as Sb,ho as Tb,oy as Ub,y as Vb,Sa as Wb,Pa as Xb,wo as Yb,ir as Zb,or as _b,Vr as $b,ln as ac,tt as bc,To as cc,So as dc,bt as ec,xo as fc,Ko as gc,nr as hc,Eo as ic,Co as jc,Io as kc,Lr as lc,jt as mc,vo as nc,_o as oc,ko as pc,Fo as qc,Uo as rc,nA as sc,qr as tc,Do as uc,Ro as vc,zo as wc,Po as xc,Oo as yc,ne as zc,Go as Ac,No as Bc,Bo as Cc,Mo as Dc,wt as Ec,gn as Fc,Vo as Gc,mn as Hc,Ho as Ic,Lo as Jc,qo as Kc,$o as Lc,Wo as Mc,Jt as Nc,jo as Oc,Qo as Pc,Jo as Qc,Zo as Rc,Yo as Sc,Xo as Tc,es as Uc,ts as Vc,ns as Wc,rs as Xc,is as Yc,os as Zc,ss as _c,as as $c,cs as ad,us as bd,ds as cd,ps as dd,yn as ed,ms as fd,ys as gd,As as hd,An as id,fn as jd,fs as kd,hn as ld,sr as md,hs as nd,bs as od,Ts as pd,Ss as qd,bn as rd,wn as sd,Ps as td,xs as ud,rt as vd,Wa as wd,Ks as xd,fh as yd,ja as zd,Es as Ad,Cs as Bd,Wr as Cd,Is as Dd,vs as Ed,_s as Fd,ks as Gd,Fs as Hd,Us as Id,Ds as Jd,Rs as Kd,zs as Ld,Os as Md,Sn as Nd,Gs as Od,Ns as Pd,Bs as Qd,Pn as Rd,cr as Sd,Zt as Td,Yt as Ud,ur as Vd,Ms as Wd,Vs as Xd,dr as Yd,pr as Zd,xn as _d,lr as $d,Qr as ae,Hs as be,Ls as ce,Kn as de,ec as ee,qs as fe,En as ge,W as he};
|
|
6
|
-
//# sourceMappingURL=chunk-GMDBBVDH.mjs.map
|