@aa-sdk/core 4.0.0-alpha.8 → 4.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/abis/EntryPointAbi_v7.js +1 -0
- package/dist/esm/abis/EntryPointAbi_v7.js.map +1 -1
- package/dist/esm/account/smartContractAccount.d.ts +50 -1
- package/dist/esm/account/smartContractAccount.js +111 -2
- package/dist/esm/account/smartContractAccount.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperation.d.ts +23 -0
- package/dist/esm/actions/smartAccount/buildUserOperation.js +23 -0
- package/dist/esm/actions/smartAccount/buildUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperationFromTx.d.ts +39 -0
- package/dist/esm/actions/smartAccount/buildUserOperationFromTx.js +39 -0
- package/dist/esm/actions/smartAccount/buildUserOperationFromTx.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.d.ts +54 -0
- package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.js +55 -0
- package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.js.map +1 -1
- package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.d.ts +28 -0
- package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.js +28 -0
- package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -1
- package/dist/esm/actions/smartAccount/dropAndReplaceUserOperation.d.ts +22 -0
- package/dist/esm/actions/smartAccount/dropAndReplaceUserOperation.js +27 -6
- package/dist/esm/actions/smartAccount/dropAndReplaceUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/estimateUserOperationGas.d.ts +13 -0
- package/dist/esm/actions/smartAccount/estimateUserOperationGas.js +13 -0
- package/dist/esm/actions/smartAccount/estimateUserOperationGas.js.map +1 -1
- package/dist/esm/actions/smartAccount/internal/initUserOperation.d.ts +13 -0
- package/dist/esm/actions/smartAccount/internal/initUserOperation.js +14 -1
- package/dist/esm/actions/smartAccount/internal/initUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/internal/runMiddlewareStack.js +2 -1
- package/dist/esm/actions/smartAccount/internal/runMiddlewareStack.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendTransaction.d.ts +24 -0
- package/dist/esm/actions/smartAccount/sendTransaction.js +24 -0
- package/dist/esm/actions/smartAccount/sendTransaction.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendTransactions.d.ts +23 -0
- package/dist/esm/actions/smartAccount/sendTransactions.js +23 -0
- package/dist/esm/actions/smartAccount/sendTransactions.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendUserOperation.d.ts +21 -0
- package/dist/esm/actions/smartAccount/sendUserOperation.js +21 -0
- package/dist/esm/actions/smartAccount/sendUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/types.d.ts +14 -0
- package/dist/esm/actions/smartAccount/types.js +1 -0
- package/dist/esm/actions/smartAccount/types.js.map +1 -1
- package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.d.ts +24 -0
- package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.js +24 -0
- package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.js.map +1 -1
- package/dist/esm/client/bundlerClient.d.ts +21 -0
- package/dist/esm/client/bundlerClient.js +32 -0
- package/dist/esm/client/bundlerClient.js.map +1 -1
- package/dist/esm/client/decorators/bundlerClient.d.ts +41 -0
- package/dist/esm/client/decorators/bundlerClient.js +10 -0
- package/dist/esm/client/decorators/bundlerClient.js.map +1 -1
- package/dist/esm/client/decorators/smartAccountClient.d.ts +8 -0
- package/dist/esm/client/decorators/smartAccountClient.js +12 -1
- package/dist/esm/client/decorators/smartAccountClient.js.map +1 -1
- package/dist/esm/client/isSmartAccountClient.d.ts +16 -0
- package/dist/esm/client/isSmartAccountClient.js +16 -0
- package/dist/esm/client/isSmartAccountClient.js.map +1 -1
- package/dist/esm/client/schema.d.ts +12 -0
- package/dist/esm/client/schema.js +14 -0
- package/dist/esm/client/schema.js.map +1 -1
- package/dist/esm/client/smartAccountClient.js +53 -0
- package/dist/esm/client/smartAccountClient.js.map +1 -1
- package/dist/esm/client/types.js +1 -0
- package/dist/esm/client/types.js.map +1 -1
- package/dist/esm/ens/utils.d.ts +45 -0
- package/dist/esm/ens/utils.js +49 -0
- package/dist/esm/ens/utils.js.map +1 -1
- package/dist/esm/entrypoint/index.d.ts +14 -0
- package/dist/esm/entrypoint/index.js +30 -0
- package/dist/esm/entrypoint/index.js.map +1 -1
- package/dist/esm/entrypoint/types.d.ts +17 -0
- package/dist/esm/errors/account.d.ts +87 -4
- package/dist/esm/errors/account.js +88 -4
- package/dist/esm/errors/account.js.map +1 -1
- package/dist/esm/errors/base.d.ts +5 -0
- package/dist/esm/errors/base.js +5 -0
- package/dist/esm/errors/base.js.map +1 -1
- package/dist/esm/errors/client.d.ts +24 -0
- package/dist/esm/errors/client.js +24 -0
- package/dist/esm/errors/client.js.map +1 -1
- package/dist/esm/errors/entrypoint.d.ts +18 -0
- package/dist/esm/errors/entrypoint.js +18 -0
- package/dist/esm/errors/entrypoint.js.map +1 -1
- package/dist/esm/errors/signer.d.ts +8 -0
- package/dist/esm/errors/signer.js +8 -0
- package/dist/esm/errors/signer.js.map +1 -1
- package/dist/esm/errors/transaction.d.ts +14 -1
- package/dist/esm/errors/transaction.js +14 -1
- package/dist/esm/errors/transaction.js.map +1 -1
- package/dist/esm/errors/useroperation.d.ts +25 -0
- package/dist/esm/errors/useroperation.js +26 -0
- package/dist/esm/errors/useroperation.js.map +1 -1
- package/dist/esm/index.d.ts +0 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/logger.d.ts +91 -0
- package/dist/esm/logger.js +91 -0
- package/dist/esm/logger.js.map +1 -1
- package/dist/esm/middleware/actions.d.ts +14 -0
- package/dist/esm/middleware/actions.js +7 -0
- package/dist/esm/middleware/actions.js.map +1 -1
- package/dist/esm/middleware/defaults/feeEstimator.d.ts +20 -0
- package/dist/esm/middleware/defaults/feeEstimator.js +28 -0
- package/dist/esm/middleware/defaults/feeEstimator.js.map +1 -1
- package/dist/esm/middleware/defaults/gasEstimator.d.ts +8 -0
- package/dist/esm/middleware/defaults/gasEstimator.js +10 -1
- package/dist/esm/middleware/defaults/gasEstimator.js.map +1 -1
- package/dist/esm/middleware/defaults/paymasterAndData.d.ts +8 -0
- package/dist/esm/middleware/defaults/paymasterAndData.js +8 -0
- package/dist/esm/middleware/defaults/paymasterAndData.js.map +1 -1
- package/dist/esm/middleware/defaults/userOpSigner.d.ts +10 -0
- package/dist/esm/middleware/defaults/userOpSigner.js +10 -0
- package/dist/esm/middleware/defaults/userOpSigner.js.map +1 -1
- package/dist/esm/middleware/erc7677middleware.d.ts +21 -0
- package/dist/esm/middleware/erc7677middleware.js +23 -0
- package/dist/esm/middleware/erc7677middleware.js.map +1 -1
- package/dist/esm/middleware/noopMiddleware.d.ts +6 -0
- package/dist/esm/middleware/noopMiddleware.js +6 -0
- package/dist/esm/middleware/noopMiddleware.js.map +1 -1
- package/dist/esm/middleware/types.js +1 -0
- package/dist/esm/middleware/types.js.map +1 -1
- package/dist/esm/signer/local-account.d.ts +96 -1
- package/dist/esm/signer/local-account.js +97 -2
- package/dist/esm/signer/local-account.js.map +1 -1
- package/dist/esm/signer/schema.d.ts +14 -0
- package/dist/esm/signer/schema.js +14 -0
- package/dist/esm/signer/schema.js.map +1 -1
- package/dist/esm/signer/types.d.ts +12 -0
- package/dist/esm/signer/types.js +1 -0
- package/dist/esm/signer/types.js.map +1 -1
- package/dist/esm/signer/utils.d.ts +20 -0
- package/dist/esm/signer/utils.js +27 -0
- package/dist/esm/signer/utils.js.map +1 -1
- package/dist/esm/signer/wallet-client.d.ts +92 -0
- package/dist/esm/signer/wallet-client.js +92 -0
- package/dist/esm/signer/wallet-client.js.map +1 -1
- package/dist/esm/transport/split.d.ts +32 -0
- package/dist/esm/transport/split.js +32 -0
- package/dist/esm/transport/split.js.map +1 -1
- package/dist/esm/types.d.ts +17 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/bigint.d.ts +45 -0
- package/dist/esm/utils/bigint.js +46 -0
- package/dist/esm/utils/bigint.js.map +1 -1
- package/dist/esm/utils/bytes.d.ts +9 -0
- package/dist/esm/utils/bytes.js +10 -1
- package/dist/esm/utils/bytes.js.map +1 -1
- package/dist/esm/utils/index.d.ts +86 -0
- package/dist/esm/utils/index.js +86 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/schema.d.ts +3 -0
- package/dist/esm/utils/schema.js +9 -0
- package/dist/esm/utils/schema.js.map +1 -1
- package/dist/esm/utils/stateOverride.js +2 -0
- package/dist/esm/utils/stateOverride.js.map +1 -1
- package/dist/esm/utils/types.d.ts +22 -0
- package/dist/esm/utils/types.js +1 -0
- package/dist/esm/utils/types.js.map +1 -1
- package/dist/esm/utils/userop.d.ts +79 -0
- package/dist/esm/utils/userop.js +83 -0
- package/dist/esm/utils/userop.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +3 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/account/smartContractAccount.d.ts +1 -1
- package/dist/types/account/smartContractAccount.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/buildUserOperationFromTx.d.ts +1 -1
- package/dist/types/actions/smartAccount/dropAndReplaceUserOperation.d.ts.map +1 -1
- package/dist/types/client/smartAccountClient.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/middleware/defaults/gasEstimator.d.ts.map +1 -1
- package/dist/types/transport/split.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +11 -12
- package/src/account/smartContractAccount.ts +3 -4
- package/src/actions/smartAccount/buildUserOperationFromTx.ts +1 -1
- package/src/actions/smartAccount/dropAndReplaceUserOperation.ts +10 -10
- package/src/actions/smartAccount/internal/initUserOperation.ts +1 -1
- package/src/client/smartAccountClient.ts +7 -0
- package/src/index.ts +0 -1
- package/src/middleware/defaults/gasEstimator.ts +2 -1
- package/src/transport/split.ts +1 -1
- package/src/version.ts +1 -1
- package/dist/cjs/abis/EntryPointAbi_v6.d.ts +0 -1018
- package/dist/cjs/abis/EntryPointAbi_v6.js +0 -1313
- package/dist/cjs/abis/EntryPointAbi_v6.js.map +0 -1
- package/dist/cjs/abis/EntryPointAbi_v7.d.ts +0 -775
- package/dist/cjs/abis/EntryPointAbi_v7.js +0 -661
- package/dist/cjs/abis/EntryPointAbi_v7.js.map +0 -1
- package/dist/cjs/abis/SimpleAccountAbi_v6.d.ts +0 -405
- package/dist/cjs/abis/SimpleAccountAbi_v6.js +0 -528
- package/dist/cjs/abis/SimpleAccountAbi_v6.js.map +0 -1
- package/dist/cjs/abis/SimpleAccountAbi_v7.d.ts +0 -410
- package/dist/cjs/abis/SimpleAccountAbi_v7.js +0 -538
- package/dist/cjs/abis/SimpleAccountAbi_v7.js.map +0 -1
- package/dist/cjs/abis/SimpleAccountFactoryAbi.d.ts +0 -55
- package/dist/cjs/abis/SimpleAccountFactoryAbi.js +0 -78
- package/dist/cjs/abis/SimpleAccountFactoryAbi.js.map +0 -1
- package/dist/cjs/account/smartContractAccount.d.ts +0 -74
- package/dist/cjs/account/smartContractAccount.js +0 -180
- package/dist/cjs/account/smartContractAccount.js.map +0 -1
- package/dist/cjs/actions/bundler/estimateUserOperationGas.d.ts +0 -8
- package/dist/cjs/actions/bundler/estimateUserOperationGas.js +0 -18
- package/dist/cjs/actions/bundler/estimateUserOperationGas.js.map +0 -1
- package/dist/cjs/actions/bundler/getSupportedEntryPoints.d.ts +0 -3
- package/dist/cjs/actions/bundler/getSupportedEntryPoints.js +0 -11
- package/dist/cjs/actions/bundler/getSupportedEntryPoints.js.map +0 -1
- package/dist/cjs/actions/bundler/getUserOperationByHash.d.ts +0 -6
- package/dist/cjs/actions/bundler/getUserOperationByHash.js +0 -11
- package/dist/cjs/actions/bundler/getUserOperationByHash.js.map +0 -1
- package/dist/cjs/actions/bundler/getUserOperationReceipt.d.ts +0 -6
- package/dist/cjs/actions/bundler/getUserOperationReceipt.js +0 -11
- package/dist/cjs/actions/bundler/getUserOperationReceipt.js.map +0 -1
- package/dist/cjs/actions/bundler/sendRawUserOperation.d.ts +0 -7
- package/dist/cjs/actions/bundler/sendRawUserOperation.js +0 -11
- package/dist/cjs/actions/bundler/sendRawUserOperation.js.map +0 -1
- package/dist/cjs/actions/smartAccount/buildUserOperation.d.ts +0 -5
- package/dist/cjs/actions/smartAccount/buildUserOperation.js +0 -25
- package/dist/cjs/actions/smartAccount/buildUserOperation.js.map +0 -1
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.d.ts +0 -5
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.js +0 -39
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.js.map +0 -1
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.d.ts +0 -4
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.js +0 -62
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.js.map +0 -1
- package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.d.ts +0 -4
- package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.js +0 -34
- package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.js.map +0 -1
- package/dist/cjs/actions/smartAccount/dropAndReplaceUserOperation.d.ts +0 -5
- package/dist/cjs/actions/smartAccount/dropAndReplaceUserOperation.js +0 -64
- package/dist/cjs/actions/smartAccount/dropAndReplaceUserOperation.js.map +0 -1
- package/dist/cjs/actions/smartAccount/estimateUserOperationGas.d.ts +0 -5
- package/dist/cjs/actions/smartAccount/estimateUserOperationGas.js +0 -23
- package/dist/cjs/actions/smartAccount/estimateUserOperationGas.js.map +0 -1
- package/dist/cjs/actions/smartAccount/getAddress.d.ts +0 -4
- package/dist/cjs/actions/smartAccount/getAddress.js +0 -13
- package/dist/cjs/actions/smartAccount/getAddress.js.map +0 -1
- package/dist/cjs/actions/smartAccount/internal/initUserOperation.d.ts +0 -7
- package/dist/cjs/actions/smartAccount/internal/initUserOperation.js +0 -42
- package/dist/cjs/actions/smartAccount/internal/initUserOperation.js.map +0 -1
- package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.d.ts +0 -10
- package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.js +0 -47
- package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.js.map +0 -1
- package/dist/cjs/actions/smartAccount/internal/sendUserOperation.d.ts +0 -10
- package/dist/cjs/actions/smartAccount/internal/sendUserOperation.js +0 -28
- package/dist/cjs/actions/smartAccount/internal/sendUserOperation.js.map +0 -1
- package/dist/cjs/actions/smartAccount/sendTransaction.d.ts +0 -5
- package/dist/cjs/actions/smartAccount/sendTransaction.js +0 -35
- package/dist/cjs/actions/smartAccount/sendTransaction.js.map +0 -1
- package/dist/cjs/actions/smartAccount/sendTransactions.d.ts +0 -4
- package/dist/cjs/actions/smartAccount/sendTransactions.js +0 -36
- package/dist/cjs/actions/smartAccount/sendTransactions.js.map +0 -1
- package/dist/cjs/actions/smartAccount/sendUserOperation.d.ts +0 -5
- package/dist/cjs/actions/smartAccount/sendUserOperation.js +0 -31
- package/dist/cjs/actions/smartAccount/sendUserOperation.js.map +0 -1
- package/dist/cjs/actions/smartAccount/signMessage.d.ts +0 -6
- package/dist/cjs/actions/smartAccount/signMessage.js +0 -12
- package/dist/cjs/actions/smartAccount/signMessage.js.map +0 -1
- package/dist/cjs/actions/smartAccount/signMessageWith6492.d.ts +0 -4
- package/dist/cjs/actions/smartAccount/signMessageWith6492.js +0 -12
- package/dist/cjs/actions/smartAccount/signMessageWith6492.js.map +0 -1
- package/dist/cjs/actions/smartAccount/signTypedData.d.ts +0 -10
- package/dist/cjs/actions/smartAccount/signTypedData.js +0 -12
- package/dist/cjs/actions/smartAccount/signTypedData.js.map +0 -1
- package/dist/cjs/actions/smartAccount/signTypedDataWith6492.d.ts +0 -6
- package/dist/cjs/actions/smartAccount/signTypedDataWith6492.js +0 -12
- package/dist/cjs/actions/smartAccount/signTypedDataWith6492.js.map +0 -1
- package/dist/cjs/actions/smartAccount/signUserOperation.d.ts +0 -5
- package/dist/cjs/actions/smartAccount/signUserOperation.js +0 -30
- package/dist/cjs/actions/smartAccount/signUserOperation.js.map +0 -1
- package/dist/cjs/actions/smartAccount/types.d.ts +0 -42
- package/dist/cjs/actions/smartAccount/types.js +0 -3
- package/dist/cjs/actions/smartAccount/types.js.map +0 -1
- package/dist/cjs/actions/smartAccount/upgradeAccount.d.ts +0 -4
- package/dist/cjs/actions/smartAccount/upgradeAccount.js +0 -38
- package/dist/cjs/actions/smartAccount/upgradeAccount.js.map +0 -1
- package/dist/cjs/actions/smartAccount/waitForUserOperationTransacation.d.ts +0 -3
- package/dist/cjs/actions/smartAccount/waitForUserOperationTransacation.js +0 -36
- package/dist/cjs/actions/smartAccount/waitForUserOperationTransacation.js.map +0 -1
- package/dist/cjs/client/bundlerClient.d.ts +0 -10
- package/dist/cjs/client/bundlerClient.js +0 -51
- package/dist/cjs/client/bundlerClient.js.map +0 -1
- package/dist/cjs/client/decorators/bundlerClient.d.ts +0 -41
- package/dist/cjs/client/decorators/bundlerClient.js +0 -17
- package/dist/cjs/client/decorators/bundlerClient.js.map +0 -1
- package/dist/cjs/client/decorators/smartAccountClient.d.ts +0 -35
- package/dist/cjs/client/decorators/smartAccountClient.js +0 -43
- package/dist/cjs/client/decorators/smartAccountClient.js.map +0 -1
- package/dist/cjs/client/isSmartAccountClient.d.ts +0 -5
- package/dist/cjs/client/isSmartAccountClient.js +0 -18
- package/dist/cjs/client/isSmartAccountClient.js.map +0 -1
- package/dist/cjs/client/schema.d.ts +0 -767
- package/dist/cjs/client/schema.js +0 -63
- package/dist/cjs/client/schema.js.map +0 -1
- package/dist/cjs/client/smartAccountClient.d.ts +0 -33
- package/dist/cjs/client/smartAccountClient.js +0 -93
- package/dist/cjs/client/smartAccountClient.js.map +0 -1
- package/dist/cjs/client/types.d.ts +0 -21
- package/dist/cjs/client/types.js +0 -3
- package/dist/cjs/client/types.js.map +0 -1
- package/dist/cjs/ens/utils.d.ts +0 -6
- package/dist/cjs/ens/utils.js +0 -53
- package/dist/cjs/ens/utils.js.map +0 -1
- package/dist/cjs/entrypoint/0.6.d.ts +0 -1029
- package/dist/cjs/entrypoint/0.6.js +0 -49
- package/dist/cjs/entrypoint/0.6.js.map +0 -1
- package/dist/cjs/entrypoint/0.7.d.ts +0 -792
- package/dist/cjs/entrypoint/0.7.js +0 -88
- package/dist/cjs/entrypoint/0.7.js.map +0 -1
- package/dist/cjs/entrypoint/index.d.ts +0 -8
- package/dist/cjs/entrypoint/index.js +0 -53
- package/dist/cjs/entrypoint/index.js.map +0 -1
- package/dist/cjs/entrypoint/types.d.ts +0 -46
- package/dist/cjs/entrypoint/types.js +0 -3
- package/dist/cjs/entrypoint/types.js.map +0 -1
- package/dist/cjs/errors/account.d.ts +0 -47
- package/dist/cjs/errors/account.js +0 -140
- package/dist/cjs/errors/account.js.map +0 -1
- package/dist/cjs/errors/base.d.ts +0 -18
- package/dist/cjs/errors/base.js +0 -39
- package/dist/cjs/errors/base.js.map +0 -1
- package/dist/cjs/errors/client.d.ts +0 -14
- package/dist/cjs/errors/client.js +0 -44
- package/dist/cjs/errors/client.js.map +0 -1
- package/dist/cjs/errors/entrypoint.d.ts +0 -10
- package/dist/cjs/errors/entrypoint.js +0 -32
- package/dist/cjs/errors/entrypoint.js.map +0 -1
- package/dist/cjs/errors/signer.d.ts +0 -5
- package/dist/cjs/errors/signer.js +0 -20
- package/dist/cjs/errors/signer.js.map +0 -1
- package/dist/cjs/errors/transaction.d.ts +0 -10
- package/dist/cjs/errors/transaction.js +0 -29
- package/dist/cjs/errors/transaction.js.map +0 -1
- package/dist/cjs/errors/useroperation.d.ts +0 -10
- package/dist/cjs/errors/useroperation.js +0 -34
- package/dist/cjs/errors/useroperation.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -60
- package/dist/cjs/index.js +0 -170
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/logger.d.ts +0 -20
- package/dist/cjs/logger.js +0 -60
- package/dist/cjs/logger.js.map +0 -1
- package/dist/cjs/middleware/actions.d.ts +0 -12
- package/dist/cjs/middleware/actions.js +0 -21
- package/dist/cjs/middleware/actions.js.map +0 -1
- package/dist/cjs/middleware/defaults/feeEstimator.d.ts +0 -3
- package/dist/cjs/middleware/defaults/feeEstimator.js +0 -23
- package/dist/cjs/middleware/defaults/feeEstimator.js.map +0 -1
- package/dist/cjs/middleware/defaults/gasEstimator.d.ts +0 -3
- package/dist/cjs/middleware/defaults/gasEstimator.js +0 -27
- package/dist/cjs/middleware/defaults/gasEstimator.js.map +0 -1
- package/dist/cjs/middleware/defaults/paymasterAndData.d.ts +0 -2
- package/dist/cjs/middleware/defaults/paymasterAndData.js +0 -12
- package/dist/cjs/middleware/defaults/paymasterAndData.js.map +0 -1
- package/dist/cjs/middleware/defaults/userOpSigner.d.ts +0 -2
- package/dist/cjs/middleware/defaults/userOpSigner.js +0 -26
- package/dist/cjs/middleware/defaults/userOpSigner.js.map +0 -1
- package/dist/cjs/middleware/erc7677middleware.d.ts +0 -40
- package/dist/cjs/middleware/erc7677middleware.js +0 -77
- package/dist/cjs/middleware/erc7677middleware.js.map +0 -1
- package/dist/cjs/middleware/noopMiddleware.d.ts +0 -3
- package/dist/cjs/middleware/noopMiddleware.js +0 -8
- package/dist/cjs/middleware/noopMiddleware.js.map +0 -1
- package/dist/cjs/middleware/types.d.ts +0 -22
- package/dist/cjs/middleware/types.js +0 -3
- package/dist/cjs/middleware/types.js.map +0 -1
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/signer/local-account.d.ts +0 -219
- package/dist/cjs/signer/local-account.js +0 -56
- package/dist/cjs/signer/local-account.js.map +0 -1
- package/dist/cjs/signer/schema.d.ts +0 -4
- package/dist/cjs/signer/schema.js +0 -16
- package/dist/cjs/signer/schema.js.map +0 -1
- package/dist/cjs/signer/types.d.ts +0 -15
- package/dist/cjs/signer/types.js +0 -3
- package/dist/cjs/signer/types.js.map +0 -1
- package/dist/cjs/signer/utils.d.ts +0 -7
- package/dist/cjs/signer/utils.js +0 -16
- package/dist/cjs/signer/utils.js.map +0 -1
- package/dist/cjs/signer/wallet-client.d.ts +0 -217
- package/dist/cjs/signer/wallet-client.js +0 -58
- package/dist/cjs/signer/wallet-client.js.map +0 -1
- package/dist/cjs/transport/split.d.ts +0 -9
- package/dist/cjs/transport/split.js +0 -26
- package/dist/cjs/transport/split.js.map +0 -1
- package/dist/cjs/types.d.ts +0 -158
- package/dist/cjs/types.js +0 -3
- package/dist/cjs/types.js.map +0 -1
- package/dist/cjs/utils/bigint.d.ts +0 -10
- package/dist/cjs/utils/bigint.js +0 -55
- package/dist/cjs/utils/bigint.js.map +0 -1
- package/dist/cjs/utils/bytes.d.ts +0 -7
- package/dist/cjs/utils/bytes.js +0 -11
- package/dist/cjs/utils/bytes.js.map +0 -1
- package/dist/cjs/utils/defaults.d.ts +0 -4
- package/dist/cjs/utils/defaults.js +0 -19
- package/dist/cjs/utils/defaults.js.map +0 -1
- package/dist/cjs/utils/index.d.ts +0 -19
- package/dist/cjs/utils/index.js +0 -95
- package/dist/cjs/utils/index.js.map +0 -1
- package/dist/cjs/utils/schema.d.ts +0 -25
- package/dist/cjs/utils/schema.js +0 -35
- package/dist/cjs/utils/schema.js.map +0 -1
- package/dist/cjs/utils/stateOverride.d.ts +0 -4
- package/dist/cjs/utils/stateOverride.js +0 -52
- package/dist/cjs/utils/stateOverride.js.map +0 -1
- package/dist/cjs/utils/testUtils.d.ts +0 -6
- package/dist/cjs/utils/testUtils.js +0 -33
- package/dist/cjs/utils/testUtils.js.map +0 -1
- package/dist/cjs/utils/types.d.ts +0 -16
- package/dist/cjs/utils/types.js +0 -3
- package/dist/cjs/utils/types.js.map +0 -1
- package/dist/cjs/utils/userop.d.ts +0 -49
- package/dist/cjs/utils/userop.js +0 -75
- package/dist/cjs/utils/userop.js.map +0 -1
- package/dist/cjs/version.d.ts +0 -1
- package/dist/cjs/version.js +0 -5
- package/dist/cjs/version.js.map +0 -1
- package/dist/esm/package.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntryPointAbi_v7.js","sourceRoot":"","sources":["../../../src/abis/EntryPointAbi_v7.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE;YACvD,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE;SACtD;QACD,IAAI,EAAE,mBAAmB;QACzB,IAAI,EAAE,OAAO;KACd;IACD;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YAC7D,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC3D;QACD,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,OAAO;KACd;IACD;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YAC7D,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC1D,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE;SACxD;QACD,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,OAAO;KACd;IACD;QACE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,YAA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E,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QACzE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC3D,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE;YACN;gBACE,YAAY,EAAE,iBAAiB;gBAC/B,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE;YACN;gBACE,YAAY,EAAE,iBAAiB;gBAC/B,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,SAAS;aAChB;YACD,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE;SACrE;QACD,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;IACD,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;CACvC,CAAC","sourcesContent":["// https://etherscan.io/address/0x0000000071727de22e5e9d8baf0edac6f37da032\nexport const EntryPointAbi_v7 = [\n {\n inputs: [\n { internalType: \"bool\", name: \"success\", type: \"bool\" },\n { internalType: \"bytes\", name: \"ret\", type: \"bytes\" },\n ],\n name: \"DelegateAndRevert\",\n type: \"error\",\n },\n {\n inputs: [\n { internalType: \"uint256\", name: \"opIndex\", type: \"uint256\" },\n { internalType: \"string\", name: \"reason\", type: \"string\" },\n ],\n name: \"FailedOp\",\n type: \"error\",\n },\n {\n inputs: [\n { internalType: \"uint256\", name: \"opIndex\", type: \"uint256\" },\n { internalType: \"string\", name: \"reason\", type: \"string\" },\n { internalType: \"bytes\", name: \"inner\", type: \"bytes\" },\n ],\n name: \"FailedOpWithRevert\",\n type: \"error\",\n },\n {\n inputs: [{ internalType: \"bytes\", name: \"returnData\", type: \"bytes\" }],\n name: \"PostOpReverted\",\n type: \"error\",\n },\n { inputs: [], name: \"ReentrancyGuardReentrantCall\", type: \"error\" },\n {\n inputs: [{ internalType: \"address\", name: \"sender\", type: \"address\" }],\n name: \"SenderAddressResult\",\n type: \"error\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"aggregator\", type: \"address\" }],\n name: \"SignatureValidationFailed\",\n type: \"error\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"userOpHash\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"factory\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"paymaster\",\n type: \"address\",\n },\n ],\n name: \"AccountDeployed\",\n type: \"event\",\n },\n { anonymous: false, inputs: [], name: \"BeforeExecution\", type: \"event\" },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"totalDeposit\",\n type: \"uint256\",\n },\n ],\n name: \"Deposited\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"userOpHash\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"nonce\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"revertReason\",\n type: \"bytes\",\n },\n ],\n name: \"PostOpRevertReason\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"aggregator\",\n type: \"address\",\n },\n ],\n name: \"SignatureAggregatorChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"totalStaked\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"unstakeDelaySec\",\n type: \"uint256\",\n },\n ],\n name: \"StakeLocked\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"withdrawTime\",\n type: \"uint256\",\n },\n ],\n name: \"StakeUnlocked\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"withdrawAddress\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"StakeWithdrawn\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"userOpHash\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"paymaster\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"nonce\",\n type: \"uint256\",\n },\n { indexed: false, internalType: \"bool\", name: \"success\", type: \"bool\" },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"actualGasCost\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"actualGasUsed\",\n type: \"uint256\",\n },\n ],\n name: \"UserOperationEvent\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"userOpHash\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"nonce\",\n type: \"uint256\",\n },\n ],\n name: \"UserOperationPrefundTooLow\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"userOpHash\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"nonce\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"revertReason\",\n type: \"bytes\",\n },\n ],\n name: \"UserOperationRevertReason\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"withdrawAddress\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"Withdrawn\",\n type: \"event\",\n },\n {\n inputs: [\n { internalType: \"uint32\", name: \"unstakeDelaySec\", type: \"uint32\" },\n ],\n name: \"addStake\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"account\", type: \"address\" }],\n name: \"balanceOf\",\n outputs: [{ internalType: \"uint256\", name: \"\", type: \"uint256\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"target\", type: \"address\" },\n { internalType: \"bytes\", name: \"data\", type: \"bytes\" },\n ],\n name: \"delegateAndRevert\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"account\", type: \"address\" }],\n name: \"depositTo\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"\", type: \"address\" }],\n name: \"deposits\",\n outputs: [\n { internalType: \"uint256\", name: \"deposit\", type: \"uint256\" },\n { internalType: \"bool\", name: \"staked\", type: \"bool\" },\n { internalType: \"uint112\", name: \"stake\", type: \"uint112\" },\n { internalType: \"uint32\", name: \"unstakeDelaySec\", type: \"uint32\" },\n { internalType: \"uint48\", name: \"withdrawTime\", type: \"uint48\" },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"account\", type: \"address\" }],\n name: \"getDepositInfo\",\n outputs: [\n {\n components: [\n { internalType: \"uint256\", name: \"deposit\", type: \"uint256\" },\n { internalType: \"bool\", name: \"staked\", type: \"bool\" },\n { internalType: \"uint112\", name: \"stake\", type: \"uint112\" },\n { internalType: \"uint32\", name: \"unstakeDelaySec\", type: \"uint32\" },\n { internalType: \"uint48\", name: \"withdrawTime\", type: \"uint48\" },\n ],\n internalType: \"struct IStakeManager.DepositInfo\",\n name: \"info\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"sender\", type: \"address\" },\n { internalType: \"uint192\", name: \"key\", type: \"uint192\" },\n ],\n name: \"getNonce\",\n outputs: [{ internalType: \"uint256\", name: \"nonce\", type: \"uint256\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"bytes\", name: \"initCode\", type: \"bytes\" }],\n name: \"getSenderAddress\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n { internalType: \"address\", name: \"sender\", type: \"address\" },\n { internalType: \"uint256\", name: \"nonce\", type: \"uint256\" },\n { internalType: \"bytes\", name: \"initCode\", type: \"bytes\" },\n { internalType: \"bytes\", name: \"callData\", type: \"bytes\" },\n {\n internalType: \"bytes32\",\n name: \"accountGasLimits\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"preVerificationGas\",\n type: \"uint256\",\n },\n { internalType: \"bytes32\", name: \"gasFees\", type: \"bytes32\" },\n { internalType: \"bytes\", name: \"paymasterAndData\", type: \"bytes\" },\n { internalType: \"bytes\", name: \"signature\", type: \"bytes\" },\n ],\n internalType: \"struct PackedUserOperation\",\n name: \"userOp\",\n type: \"tuple\",\n },\n ],\n name: \"getUserOpHash\",\n outputs: [{ internalType: \"bytes32\", name: \"\", type: \"bytes32\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n components: [\n { internalType: \"address\", name: \"sender\", type: \"address\" },\n { internalType: \"uint256\", name: \"nonce\", type: \"uint256\" },\n { internalType: \"bytes\", name: \"initCode\", type: \"bytes\" },\n { internalType: \"bytes\", name: \"callData\", type: \"bytes\" },\n {\n internalType: \"bytes32\",\n name: \"accountGasLimits\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"preVerificationGas\",\n type: \"uint256\",\n },\n { internalType: \"bytes32\", name: \"gasFees\", type: \"bytes32\" },\n {\n internalType: \"bytes\",\n name: \"paymasterAndData\",\n type: \"bytes\",\n },\n { internalType: \"bytes\", name: \"signature\", type: \"bytes\" },\n ],\n internalType: \"struct PackedUserOperation[]\",\n name: \"userOps\",\n type: \"tuple[]\",\n },\n {\n internalType: \"contract IAggregator\",\n name: \"aggregator\",\n type: \"address\",\n },\n { internalType: \"bytes\", name: \"signature\", type: \"bytes\" },\n ],\n internalType: \"struct IEntryPoint.UserOpsPerAggregator[]\",\n name: \"opsPerAggregator\",\n type: \"tuple[]\",\n },\n { internalType: \"address payable\", name: \"beneficiary\", type: \"address\" },\n ],\n name: \"handleAggregatedOps\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n { internalType: \"address\", name: \"sender\", type: \"address\" },\n { internalType: \"uint256\", name: \"nonce\", type: \"uint256\" },\n { internalType: \"bytes\", name: \"initCode\", type: \"bytes\" },\n { internalType: \"bytes\", name: \"callData\", type: \"bytes\" },\n {\n internalType: \"bytes32\",\n name: \"accountGasLimits\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"preVerificationGas\",\n type: \"uint256\",\n },\n { internalType: \"bytes32\", name: \"gasFees\", type: \"bytes32\" },\n { internalType: \"bytes\", name: \"paymasterAndData\", type: \"bytes\" },\n { internalType: \"bytes\", name: \"signature\", type: \"bytes\" },\n ],\n internalType: \"struct PackedUserOperation[]\",\n name: \"ops\",\n type: \"tuple[]\",\n },\n { internalType: \"address payable\", name: \"beneficiary\", type: \"address\" },\n ],\n name: \"handleOps\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"uint192\", name: \"key\", type: \"uint192\" }],\n name: \"incrementNonce\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"bytes\", name: \"callData\", type: \"bytes\" },\n {\n components: [\n {\n components: [\n { internalType: \"address\", name: \"sender\", type: \"address\" },\n { internalType: \"uint256\", name: \"nonce\", type: \"uint256\" },\n {\n internalType: \"uint256\",\n name: \"verificationGasLimit\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"callGasLimit\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"paymasterVerificationGasLimit\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"paymasterPostOpGasLimit\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"preVerificationGas\",\n type: \"uint256\",\n },\n { internalType: \"address\", name: \"paymaster\", type: \"address\" },\n {\n internalType: \"uint256\",\n name: \"maxFeePerGas\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"maxPriorityFeePerGas\",\n type: \"uint256\",\n },\n ],\n internalType: \"struct EntryPoint.MemoryUserOp\",\n name: \"mUserOp\",\n type: \"tuple\",\n },\n { internalType: \"bytes32\", name: \"userOpHash\", type: \"bytes32\" },\n { internalType: \"uint256\", name: \"prefund\", type: \"uint256\" },\n { internalType: \"uint256\", name: \"contextOffset\", type: \"uint256\" },\n { internalType: \"uint256\", name: \"preOpGas\", type: \"uint256\" },\n ],\n internalType: \"struct EntryPoint.UserOpInfo\",\n name: \"opInfo\",\n type: \"tuple\",\n },\n { internalType: \"bytes\", name: \"context\", type: \"bytes\" },\n ],\n name: \"innerHandleOp\",\n outputs: [\n { internalType: \"uint256\", name: \"actualGasCost\", type: \"uint256\" },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"\", type: \"address\" },\n { internalType: \"uint192\", name: \"\", type: \"uint192\" },\n ],\n name: \"nonceSequenceNumber\",\n outputs: [{ internalType: \"uint256\", name: \"\", type: \"uint256\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"bytes4\", name: \"interfaceId\", type: \"bytes4\" }],\n name: \"supportsInterface\",\n outputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"unlockStake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address payable\",\n name: \"withdrawAddress\",\n type: \"address\",\n },\n ],\n name: \"withdrawStake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address payable\",\n name: \"withdrawAddress\",\n type: \"address\",\n },\n { internalType: \"uint256\", name: \"withdrawAmount\", type: \"uint256\" },\n ],\n name: \"withdrawTo\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n { stateMutability: \"payable\", type: \"receive\" },\n] as const;\n"]}
|
|
1
|
+
{"version":3,"file":"EntryPointAbi_v7.js","sourceRoot":"","sources":["../../../src/abis/EntryPointAbi_v7.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE;YACvD,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE;SACtD;QACD,IAAI,EAAE,mBAAmB;QACzB,IAAI,EAAE,OAAO;KACd;IACD;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YAC7D,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC3D;QACD,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,OAAO;KACd;IACD;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YAC7D,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC1D,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE;SACxD;QACD,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,OAAO;KACd;IACD;QACE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QACtE,IAAI,EAAE,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ACE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QACzE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC3D,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE;YACN;gBACE,YAAY,EAAE,iBAAiB;gBAC/B,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE;YACN;gBACE,YAAY,EAAE,iBAAiB;gBAC/B,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,SAAS;aAChB;YACD,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE;SACrE;QACD,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;IACD,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;CACvC,CAAC","sourcesContent":["// https://etherscan.io/address/0x0000000071727de22e5e9d8baf0edac6f37da032\nexport const EntryPointAbi_v7 = [\n {\n inputs: [\n { internalType: \"bool\", name: \"success\", type: \"bool\" },\n { internalType: \"bytes\", name: \"ret\", type: \"bytes\" },\n ],\n name: \"DelegateAndRevert\",\n type: \"error\",\n },\n {\n inputs: [\n { internalType: \"uint256\", name: \"opIndex\", type: \"uint256\" },\n { internalType: \"string\", name: \"reason\", type: \"string\" },\n ],\n name: \"FailedOp\",\n type: \"error\",\n },\n {\n inputs: [\n { internalType: \"uint256\", name: \"opIndex\", type: \"uint256\" },\n { internalType: \"string\", name: \"reason\", type: \"string\" },\n { internalType: \"bytes\", name: \"inner\", type: \"bytes\" },\n ],\n name: \"FailedOpWithRevert\",\n type: \"error\",\n },\n {\n inputs: [{ internalType: \"bytes\", name: \"returnData\", type: \"bytes\" }],\n name: \"PostOpReverted\",\n type: \"error\",\n },\n { inputs: [], name: \"ReentrancyGuardReentrantCall\", type: \"error\" },\n {\n inputs: [{ internalType: \"address\", name: \"sender\", type: \"address\" }],\n name: \"SenderAddressResult\",\n type: \"error\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"aggregator\", type: \"address\" }],\n name: \"SignatureValidationFailed\",\n type: \"error\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"userOpHash\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"factory\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"paymaster\",\n type: \"address\",\n },\n ],\n name: \"AccountDeployed\",\n type: \"event\",\n },\n { anonymous: false, inputs: [], name: \"BeforeExecution\", type: \"event\" },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"totalDeposit\",\n type: \"uint256\",\n },\n ],\n name: \"Deposited\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"userOpHash\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"nonce\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"revertReason\",\n type: \"bytes\",\n },\n ],\n name: \"PostOpRevertReason\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"aggregator\",\n type: \"address\",\n },\n ],\n name: \"SignatureAggregatorChanged\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"totalStaked\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"unstakeDelaySec\",\n type: \"uint256\",\n },\n ],\n name: \"StakeLocked\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"withdrawTime\",\n type: \"uint256\",\n },\n ],\n name: \"StakeUnlocked\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"withdrawAddress\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"StakeWithdrawn\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"userOpHash\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"paymaster\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"nonce\",\n type: \"uint256\",\n },\n { indexed: false, internalType: \"bool\", name: \"success\", type: \"bool\" },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"actualGasCost\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"actualGasUsed\",\n type: \"uint256\",\n },\n ],\n name: \"UserOperationEvent\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"userOpHash\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"nonce\",\n type: \"uint256\",\n },\n ],\n name: \"UserOperationPrefundTooLow\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"bytes32\",\n name: \"userOpHash\",\n type: \"bytes32\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"nonce\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"revertReason\",\n type: \"bytes\",\n },\n ],\n name: \"UserOperationRevertReason\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"address\",\n name: \"withdrawAddress\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"Withdrawn\",\n type: \"event\",\n },\n {\n inputs: [\n { internalType: \"uint32\", name: \"unstakeDelaySec\", type: \"uint32\" },\n ],\n name: \"addStake\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"account\", type: \"address\" }],\n name: \"balanceOf\",\n outputs: [{ internalType: \"uint256\", name: \"\", type: \"uint256\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"target\", type: \"address\" },\n { internalType: \"bytes\", name: \"data\", type: \"bytes\" },\n ],\n name: \"delegateAndRevert\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"account\", type: \"address\" }],\n name: \"depositTo\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"\", type: \"address\" }],\n name: \"deposits\",\n outputs: [\n { internalType: \"uint256\", name: \"deposit\", type: \"uint256\" },\n { internalType: \"bool\", name: \"staked\", type: \"bool\" },\n { internalType: \"uint112\", name: \"stake\", type: \"uint112\" },\n { internalType: \"uint32\", name: \"unstakeDelaySec\", type: \"uint32\" },\n { internalType: \"uint48\", name: \"withdrawTime\", type: \"uint48\" },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"account\", type: \"address\" }],\n name: \"getDepositInfo\",\n outputs: [\n {\n components: [\n { internalType: \"uint256\", name: \"deposit\", type: \"uint256\" },\n { internalType: \"bool\", name: \"staked\", type: \"bool\" },\n { internalType: \"uint112\", name: \"stake\", type: \"uint112\" },\n { internalType: \"uint32\", name: \"unstakeDelaySec\", type: \"uint32\" },\n { internalType: \"uint48\", name: \"withdrawTime\", type: \"uint48\" },\n ],\n internalType: \"struct IStakeManager.DepositInfo\",\n name: \"info\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"sender\", type: \"address\" },\n { internalType: \"uint192\", name: \"key\", type: \"uint192\" },\n ],\n name: \"getNonce\",\n outputs: [{ internalType: \"uint256\", name: \"nonce\", type: \"uint256\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"bytes\", name: \"initCode\", type: \"bytes\" }],\n name: \"getSenderAddress\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n { internalType: \"address\", name: \"sender\", type: \"address\" },\n { internalType: \"uint256\", name: \"nonce\", type: \"uint256\" },\n { internalType: \"bytes\", name: \"initCode\", type: \"bytes\" },\n { internalType: \"bytes\", name: \"callData\", type: \"bytes\" },\n {\n internalType: \"bytes32\",\n name: \"accountGasLimits\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"preVerificationGas\",\n type: \"uint256\",\n },\n { internalType: \"bytes32\", name: \"gasFees\", type: \"bytes32\" },\n { internalType: \"bytes\", name: \"paymasterAndData\", type: \"bytes\" },\n { internalType: \"bytes\", name: \"signature\", type: \"bytes\" },\n ],\n internalType: \"struct PackedUserOperation\",\n name: \"userOp\",\n type: \"tuple\",\n },\n ],\n name: \"getUserOpHash\",\n outputs: [{ internalType: \"bytes32\", name: \"\", type: \"bytes32\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n {\n components: [\n { internalType: \"address\", name: \"sender\", type: \"address\" },\n { internalType: \"uint256\", name: \"nonce\", type: \"uint256\" },\n { internalType: \"bytes\", name: \"initCode\", type: \"bytes\" },\n { internalType: \"bytes\", name: \"callData\", type: \"bytes\" },\n {\n internalType: \"bytes32\",\n name: \"accountGasLimits\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"preVerificationGas\",\n type: \"uint256\",\n },\n { internalType: \"bytes32\", name: \"gasFees\", type: \"bytes32\" },\n {\n internalType: \"bytes\",\n name: \"paymasterAndData\",\n type: \"bytes\",\n },\n { internalType: \"bytes\", name: \"signature\", type: \"bytes\" },\n ],\n internalType: \"struct PackedUserOperation[]\",\n name: \"userOps\",\n type: \"tuple[]\",\n },\n {\n internalType: \"contract IAggregator\",\n name: \"aggregator\",\n type: \"address\",\n },\n { internalType: \"bytes\", name: \"signature\", type: \"bytes\" },\n ],\n internalType: \"struct IEntryPoint.UserOpsPerAggregator[]\",\n name: \"opsPerAggregator\",\n type: \"tuple[]\",\n },\n { internalType: \"address payable\", name: \"beneficiary\", type: \"address\" },\n ],\n name: \"handleAggregatedOps\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n components: [\n { internalType: \"address\", name: \"sender\", type: \"address\" },\n { internalType: \"uint256\", name: \"nonce\", type: \"uint256\" },\n { internalType: \"bytes\", name: \"initCode\", type: \"bytes\" },\n { internalType: \"bytes\", name: \"callData\", type: \"bytes\" },\n {\n internalType: \"bytes32\",\n name: \"accountGasLimits\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"preVerificationGas\",\n type: \"uint256\",\n },\n { internalType: \"bytes32\", name: \"gasFees\", type: \"bytes32\" },\n { internalType: \"bytes\", name: \"paymasterAndData\", type: \"bytes\" },\n { internalType: \"bytes\", name: \"signature\", type: \"bytes\" },\n ],\n internalType: \"struct PackedUserOperation[]\",\n name: \"ops\",\n type: \"tuple[]\",\n },\n { internalType: \"address payable\", name: \"beneficiary\", type: \"address\" },\n ],\n name: \"handleOps\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"uint192\", name: \"key\", type: \"uint192\" }],\n name: \"incrementNonce\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"bytes\", name: \"callData\", type: \"bytes\" },\n {\n components: [\n {\n components: [\n { internalType: \"address\", name: \"sender\", type: \"address\" },\n { internalType: \"uint256\", name: \"nonce\", type: \"uint256\" },\n {\n internalType: \"uint256\",\n name: \"verificationGasLimit\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"callGasLimit\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"paymasterVerificationGasLimit\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"paymasterPostOpGasLimit\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"preVerificationGas\",\n type: \"uint256\",\n },\n { internalType: \"address\", name: \"paymaster\", type: \"address\" },\n {\n internalType: \"uint256\",\n name: \"maxFeePerGas\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"maxPriorityFeePerGas\",\n type: \"uint256\",\n },\n ],\n internalType: \"struct EntryPoint.MemoryUserOp\",\n name: \"mUserOp\",\n type: \"tuple\",\n },\n { internalType: \"bytes32\", name: \"userOpHash\", type: \"bytes32\" },\n { internalType: \"uint256\", name: \"prefund\", type: \"uint256\" },\n { internalType: \"uint256\", name: \"contextOffset\", type: \"uint256\" },\n { internalType: \"uint256\", name: \"preOpGas\", type: \"uint256\" },\n ],\n internalType: \"struct EntryPoint.UserOpInfo\",\n name: \"opInfo\",\n type: \"tuple\",\n },\n { internalType: \"bytes\", name: \"context\", type: \"bytes\" },\n ],\n name: \"innerHandleOp\",\n outputs: [\n { internalType: \"uint256\", name: \"actualGasCost\", type: \"uint256\" },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"\", type: \"address\" },\n { internalType: \"uint192\", name: \"\", type: \"uint192\" },\n ],\n name: \"nonceSequenceNumber\",\n outputs: [{ internalType: \"uint256\", name: \"\", type: \"uint256\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"bytes4\", name: \"interfaceId\", type: \"bytes4\" }],\n name: \"supportsInterface\",\n outputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"unlockStake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address payable\",\n name: \"withdrawAddress\",\n type: \"address\",\n },\n ],\n name: \"withdrawStake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address payable\",\n name: \"withdrawAddress\",\n type: \"address\",\n },\n { internalType: \"uint256\", name: \"withdrawAmount\", type: \"uint256\" },\n ],\n name: \"withdrawTo\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n { stateMutability: \"payable\", type: \"receive\" },\n] as const;\n"]}
|
|
@@ -26,6 +26,21 @@ export type UpgradeToAndCallParams = {
|
|
|
26
26
|
export type SmartContractAccountWithSigner<Name extends string = string, TSigner extends SmartAccountSigner = SmartAccountSigner, TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = SmartContractAccount<Name, TEntryPointVersion> & {
|
|
27
27
|
getSigner: () => TSigner;
|
|
28
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Determines if the given SmartContractAccount has a signer associated with it.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { toSmartContractAccount } from "@aa-sdk/core";
|
|
35
|
+
*
|
|
36
|
+
* const account = await toSmartContractAccount(...);
|
|
37
|
+
*
|
|
38
|
+
* console.log(isSmartAccountWithSigner(account)); // false: the base account does not have a publicly accessible signer
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @param {SmartContractAccount} account The account to check.
|
|
42
|
+
* @returns {boolean} true if the account has a signer, otherwise false.
|
|
43
|
+
*/
|
|
29
44
|
export declare const isSmartAccountWithSigner: (account: SmartContractAccount) => account is SmartContractAccountWithSigner<string, SmartAccountSigner<any>, keyof EntryPointRegistryBase<unknown>>;
|
|
30
45
|
export type SmartContractAccount<Name extends string = string, TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = LocalAccount<Name> & {
|
|
31
46
|
source: Name;
|
|
@@ -38,7 +53,7 @@ export type SmartContractAccount<Name extends string = string, TEntryPointVersio
|
|
|
38
53
|
}) => Promise<Hex>;
|
|
39
54
|
signTypedDataWith6492: <const typedData extends TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(typedDataDefinition: TypedDataDefinition<typedData, primaryType>) => Promise<Hex>;
|
|
40
55
|
encodeUpgradeToAndCall: (params: UpgradeToAndCallParams) => Promise<Hex>;
|
|
41
|
-
|
|
56
|
+
getAccountNonce(nonceKey?: bigint): Promise<bigint>;
|
|
42
57
|
getInitCode: () => Promise<Hex>;
|
|
43
58
|
isAccountDeployed: () => Promise<boolean>;
|
|
44
59
|
getFactoryAddress: () => Promise<Address>;
|
|
@@ -63,6 +78,19 @@ export type ToSmartContractAccountParams<Name extends string = string, TTranspor
|
|
|
63
78
|
signUserOperationHash?: (uoHash: Hex) => Promise<Hex>;
|
|
64
79
|
encodeUpgradeToAndCall?: (params: UpgradeToAndCallParams) => Promise<Hex>;
|
|
65
80
|
} & Omit<CustomSource, "signTransaction" | "address">;
|
|
81
|
+
/**
|
|
82
|
+
* Parses the factory address and factory calldata from the provided account initialization code (initCode).
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* import { parseFactoryAddressFromAccountInitCode } from "@aa-sdk/core";
|
|
87
|
+
*
|
|
88
|
+
* const [address, calldata] = parseFactoryAddressFromAccountInitCode("0xAddressCalldata");
|
|
89
|
+
* ```
|
|
90
|
+
*
|
|
91
|
+
* @param {Hex} initCode The initialization code from which to parse the factory address and calldata
|
|
92
|
+
* @returns {[Address, Hex]} A tuple containing the parsed factory address and factory calldata
|
|
93
|
+
*/
|
|
66
94
|
export declare const parseFactoryAddressFromAccountInitCode: (initCode: Hex) => [Address, Hex];
|
|
67
95
|
export type GetAccountAddressParams = {
|
|
68
96
|
client: PublicClient;
|
|
@@ -70,5 +98,26 @@ export type GetAccountAddressParams = {
|
|
|
70
98
|
accountAddress?: Address;
|
|
71
99
|
getAccountInitCode: () => Promise<Hex>;
|
|
72
100
|
};
|
|
101
|
+
/**
|
|
102
|
+
* Retrieves the account address. Uses a provided `accountAddress` if available; otherwise, it computes the address using the entry point contract and the initial code.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* import { getEntryPoint, getAccountAddress } from "@aa-sdk/core";
|
|
107
|
+
*
|
|
108
|
+
* const accountAddress = await getAccountAddress({
|
|
109
|
+
* client,
|
|
110
|
+
* entryPoint: getEntryPoint(chain),
|
|
111
|
+
* getAccountInitCode: async () => "0x{factoryAddress}{factoryCallData}",
|
|
112
|
+
* });
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* @param {GetAccountAddressParams} params The configuration object
|
|
116
|
+
* @param {PublicClient} params.client A public client instance to interact with the blockchain
|
|
117
|
+
* @param {EntryPointDef} params.entryPoint The entry point definition which includes the address and ABI
|
|
118
|
+
* @param {Address} params.accountAddress Optional existing account address
|
|
119
|
+
* @param {() => Promise<Hex>} params.getAccountInitCode A function that returns a Promise resolving to a Hex string representing the initial code of the account
|
|
120
|
+
* @returns {Promise<Address>} A promise that resolves to the account address
|
|
121
|
+
*/
|
|
73
122
|
export declare const getAccountAddress: ({ client, entryPoint, accountAddress, getAccountInitCode, }: GetAccountAddressParams) => Promise<`0x${string}`>;
|
|
74
123
|
export declare function toSmartContractAccount<Name extends string = string, TTransport extends Transport = Transport, TChain extends Chain = Chain, TEntryPointVersion extends EntryPointVersion = EntryPointVersion>({ transport, chain, entryPoint, source, accountAddress, getAccountInitCode, signMessage, signTypedData, encodeBatchExecute, encodeExecute, getDummySignature, signUserOperationHash, encodeUpgradeToAndCall, }: ToSmartContractAccountParams<Name, TTransport, TChain, TEntryPointVersion>): Promise<SmartContractAccount<Name, TEntryPointVersion>>;
|
|
@@ -12,14 +12,64 @@ export var DeploymentState;
|
|
|
12
12
|
DeploymentState["NOT_DEPLOYED"] = "0x1";
|
|
13
13
|
DeploymentState["DEPLOYED"] = "0x2";
|
|
14
14
|
})(DeploymentState || (DeploymentState = {}));
|
|
15
|
+
/**
|
|
16
|
+
* Determines if the given SmartContractAccount has a signer associated with it.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { toSmartContractAccount } from "@aa-sdk/core";
|
|
21
|
+
*
|
|
22
|
+
* const account = await toSmartContractAccount(...);
|
|
23
|
+
*
|
|
24
|
+
* console.log(isSmartAccountWithSigner(account)); // false: the base account does not have a publicly accessible signer
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @param {SmartContractAccount} account The account to check.
|
|
28
|
+
* @returns {boolean} true if the account has a signer, otherwise false.
|
|
29
|
+
*/
|
|
15
30
|
export const isSmartAccountWithSigner = (account) => {
|
|
16
31
|
return "getSigner" in account;
|
|
17
32
|
};
|
|
33
|
+
// [!endregion ToSmartContractAccountParams]
|
|
34
|
+
/**
|
|
35
|
+
* Parses the factory address and factory calldata from the provided account initialization code (initCode).
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { parseFactoryAddressFromAccountInitCode } from "@aa-sdk/core";
|
|
40
|
+
*
|
|
41
|
+
* const [address, calldata] = parseFactoryAddressFromAccountInitCode("0xAddressCalldata");
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @param {Hex} initCode The initialization code from which to parse the factory address and calldata
|
|
45
|
+
* @returns {[Address, Hex]} A tuple containing the parsed factory address and factory calldata
|
|
46
|
+
*/
|
|
18
47
|
export const parseFactoryAddressFromAccountInitCode = (initCode) => {
|
|
19
48
|
const factoryAddress = `0x${initCode.substring(2, 42)}`;
|
|
20
49
|
const factoryCalldata = `0x${initCode.substring(42)}`;
|
|
21
50
|
return [factoryAddress, factoryCalldata];
|
|
22
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* Retrieves the account address. Uses a provided `accountAddress` if available; otherwise, it computes the address using the entry point contract and the initial code.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* import { getEntryPoint, getAccountAddress } from "@aa-sdk/core";
|
|
58
|
+
*
|
|
59
|
+
* const accountAddress = await getAccountAddress({
|
|
60
|
+
* client,
|
|
61
|
+
* entryPoint: getEntryPoint(chain),
|
|
62
|
+
* getAccountInitCode: async () => "0x{factoryAddress}{factoryCallData}",
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @param {GetAccountAddressParams} params The configuration object
|
|
67
|
+
* @param {PublicClient} params.client A public client instance to interact with the blockchain
|
|
68
|
+
* @param {EntryPointDef} params.entryPoint The entry point definition which includes the address and ABI
|
|
69
|
+
* @param {Address} params.accountAddress Optional existing account address
|
|
70
|
+
* @param {() => Promise<Hex>} params.getAccountInitCode A function that returns a Promise resolving to a Hex string representing the initial code of the account
|
|
71
|
+
* @returns {Promise<Address>} A promise that resolves to the account address
|
|
72
|
+
*/
|
|
23
73
|
export const getAccountAddress = async ({ client, entryPoint, accountAddress, getAccountInitCode, }) => {
|
|
24
74
|
if (accountAddress)
|
|
25
75
|
return accountAddress;
|
|
@@ -45,9 +95,65 @@ export const getAccountAddress = async ({ client, entryPoint, accountAddress, ge
|
|
|
45
95
|
}
|
|
46
96
|
throw new GetCounterFactualAddressError();
|
|
47
97
|
};
|
|
98
|
+
// [!endregion toSmartContractAccount]
|
|
99
|
+
/**
|
|
100
|
+
* Converts an account to a smart contract account and sets up various account-related methods using the provided parameters like transport, chain, entry point, and other utilities.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* import { http, type SignableMessage } from "viem";
|
|
105
|
+
* import { sepolia } from "viem/chains";
|
|
106
|
+
*
|
|
107
|
+
* const myAccount = await toSmartContractAccount({
|
|
108
|
+
* /// REQUIRED PARAMS ///
|
|
109
|
+
* source: "MyAccount",
|
|
110
|
+
* transport: http("RPC_URL"),
|
|
111
|
+
* chain: sepolia,
|
|
112
|
+
* // The EntryPointDef that your account is com"patible with
|
|
113
|
+
* entryPoint: getEntryPoint(sepolia, { version: "0.6.0" }),
|
|
114
|
+
* // This should return a concatenation of your `factoryAddress` and the `callData` for your factory's create account method
|
|
115
|
+
* getAccountInitCode: async () => "0x{factoryAddress}{callData}",
|
|
116
|
+
* // an invalid signature that doesn't cause your account to revert during validation
|
|
117
|
+
* getDummySignature: () => "0x1234...",
|
|
118
|
+
* // given a UO in the form of {target, data, value} should output the calldata for calling your contract's execution method
|
|
119
|
+
* encodeExecute: async (uo) => "0xcalldata",
|
|
120
|
+
* signMessage: async ({ message }: { message: SignableMessage }) => "0x...",
|
|
121
|
+
* signTypedData: async (typedData) => "0x000",
|
|
122
|
+
*
|
|
123
|
+
* /// OPTIONAL PARAMS ///
|
|
124
|
+
* // if you already know your account's address, pass that in here to avoid generating a new counterfactual
|
|
125
|
+
* accountAddress: "0xaddressoverride",
|
|
126
|
+
* // if your account supports batching, this should take an array of UOs and return the calldata for calling your contract's batchExecute method
|
|
127
|
+
* encodeBatchExecute: async (uos) => "0x...",
|
|
128
|
+
* // if your contract expects a different signing scheme than the default signMessage scheme, you can override that here
|
|
129
|
+
* signUserOperationHash: async (hash) => "0x...",
|
|
130
|
+
* // allows you to define the calldata for upgrading your account
|
|
131
|
+
* encodeUpgradeToAndCall: async (params) => "0x...",
|
|
132
|
+
* });
|
|
133
|
+
* ```
|
|
134
|
+
*
|
|
135
|
+
* @param {ToSmartContractAccountParams} params the parameters required for converting to a smart contract account
|
|
136
|
+
* @param {Transport} params.transport the transport mechanism used for communication
|
|
137
|
+
* @param {Chain} params.chain the blockchain chain used in the account
|
|
138
|
+
* @param {EntryPoint} params.entryPoint the entry point of the smart contract
|
|
139
|
+
* @param {string} params.source the source identifier for the account
|
|
140
|
+
* @param {Address} [params.accountAddress] the address of the account
|
|
141
|
+
* @param {() => Promise<Hex>} params.getAccountInitCode a function to get the initial state code of the account
|
|
142
|
+
* @param {(message: { message: SignableMessage }) => Promise<Hex>} params.signMessage a function to sign a message
|
|
143
|
+
* @param {(typedDataDefinition: TypedDataDefinition<typedData, primaryType>) => Promise<Hex>} params.signTypedData a function to sign typed data
|
|
144
|
+
* @param {(transactions: Transaction[]) => Hex} [params.encodeBatchExecute] a function to encode batch transactions
|
|
145
|
+
* @param {(tx: Transaction) => Hex} params.encodeExecute a function to encode a single transaction
|
|
146
|
+
* @param {() => Promise<Hex>} params.getDummySignature a function to get a dummy signature
|
|
147
|
+
* @param {(uoHash: Hex) => Promise<Hex>} [params.signUserOperationHash] a function to sign user operations
|
|
148
|
+
* @param {(implementationAddress: Address, implementationCallData: Hex) => Hex} [params.encodeUpgradeToAndCall] a function to encode upgrade call
|
|
149
|
+
* @returns {Promise<SmartContractAccount>} a promise that resolves to a SmartContractAccount object with methods and properties for interacting with the smart contract account
|
|
150
|
+
*/
|
|
48
151
|
export async function toSmartContractAccount(params) {
|
|
49
152
|
const { transport, chain, entryPoint, source, accountAddress, getAccountInitCode, signMessage, signTypedData, encodeBatchExecute, encodeExecute, getDummySignature, signUserOperationHash, encodeUpgradeToAndCall, } = params;
|
|
50
153
|
const client = createBundlerClient({
|
|
154
|
+
// we set the retry count to 0 so that viem doesn't retry during
|
|
155
|
+
// getting the address. That call always reverts and without this
|
|
156
|
+
// viem will retry 3 times, making this call very slow
|
|
51
157
|
transport: (opts) => transport({ ...opts, chain, retryCount: 0 }),
|
|
52
158
|
chain,
|
|
53
159
|
});
|
|
@@ -67,7 +173,7 @@ export async function toSmartContractAccount(params) {
|
|
|
67
173
|
if (deploymentState === DeploymentState.DEPLOYED) {
|
|
68
174
|
return "0x";
|
|
69
175
|
}
|
|
70
|
-
const contractCode = await client.
|
|
176
|
+
const contractCode = await client.getCode({
|
|
71
177
|
address: accountAddress_,
|
|
72
178
|
});
|
|
73
179
|
if ((contractCode?.length ?? 0) > 2) {
|
|
@@ -138,6 +244,7 @@ export async function toSmartContractAccount(params) {
|
|
|
138
244
|
const getImplementationAddress = async () => {
|
|
139
245
|
const storage = await client.getStorageAt({
|
|
140
246
|
address: account.address,
|
|
247
|
+
// This is the default slot for the implementation address for Proxies
|
|
141
248
|
slot: "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc",
|
|
142
249
|
});
|
|
143
250
|
if (storage == null) {
|
|
@@ -151,6 +258,8 @@ export async function toSmartContractAccount(params) {
|
|
|
151
258
|
return {
|
|
152
259
|
...account,
|
|
153
260
|
source,
|
|
261
|
+
// TODO: I think this should probably be signUserOperation instead
|
|
262
|
+
// and allow for generating the UO hash based on the EP version
|
|
154
263
|
signUserOperationHash: signUserOperationHash_,
|
|
155
264
|
getFactoryAddress,
|
|
156
265
|
getFactoryData,
|
|
@@ -164,7 +273,7 @@ export async function toSmartContractAccount(params) {
|
|
|
164
273
|
encodeUpgradeToAndCall: encodeUpgradeToAndCall_,
|
|
165
274
|
getEntryPoint: () => entryPoint,
|
|
166
275
|
isAccountDeployed,
|
|
167
|
-
getNonce,
|
|
276
|
+
getAccountNonce: getNonce,
|
|
168
277
|
signMessageWith6492,
|
|
169
278
|
signTypedDataWith6492,
|
|
170
279
|
getImplementationAddress,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartContractAccount.js","sourceRoot":"","sources":["../../../src/account/smartContractAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,UAAU,EACV,IAAI,GAWL,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAMjE,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,EAC3B,6BAA6B,EAC7B,gCAAgC,EAChC,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAU3D,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,uCAAoB,CAAA;IACpB,mCAAgB,CAAA;AAClB,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B;AAiDD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,OAA6B,EACc,EAAE;IAC7C,OAAO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AC,OAAO;YAExB,IAAI,EAAE,oEAAoE;SAC3E,CAAC,CAAC;QAEH,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YACpB,MAAM,IAAI,2BAA2B,CACnC,oEAAoE,EACpE,8BAA8B,CAC/B,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC,CAAC;IAEF,IAAI,UAAU,CAAC,OAAO,KAAK,OAAO,IAAI,UAAU,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;QACrE,MAAM,IAAI,sBAAsB,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO;QACL,GAAG,OAAO;QACV,MAAM;QAGN,qBAAqB,EAAE,sBAAsB;QAC7C,iBAAiB;QACjB,cAAc;QACd,kBAAkB,EAChB,kBAAkB;YAClB,CAAC,GAAG,EAAE;gBACJ,MAAM,IAAI,+BAA+B,CAAC,MAAM,CAAC,CAAC;YACpD,CAAC,CAAC;QACJ,aAAa;QACb,iBAAiB;QACjB,WAAW;QACX,sBAAsB,EAAE,uBAAuB;QAC/C,aAAa,EAAE,GAAG,EAAE,CAAC,UAAU;QAC/B,iBAAiB;QACjB,QAAQ;QACR,mBAAmB;QACnB,qBAAqB;QACrB,wBAAwB;KACzB,CAAC;AACJ,CAAC","sourcesContent":["import {\n getContract,\n hexToBytes,\n trim,\n type Address,\n type Chain,\n type CustomSource,\n type Hex,\n type LocalAccount,\n type PublicClient,\n type SignableMessage,\n type Transport,\n type TypedData,\n type TypedDataDefinition,\n} from \"viem\";\nimport { toAccount } from \"viem/accounts\";\nimport { createBundlerClient } from \"../client/bundlerClient.js\";\nimport type {\n EntryPointDef,\n EntryPointRegistryBase,\n EntryPointVersion,\n} from \"../entrypoint/types.js\";\nimport {\n BatchExecutionNotSupportedError,\n FailedToGetStorageSlotError,\n GetCounterFactualAddressError,\n SignTransactionNotSupportedError,\n UpgradesNotSupportedError,\n} from \"../errors/account.js\";\nimport { InvalidRpcUrlError } from \"../errors/client.js\";\nimport { InvalidEntryPointError } from \"../errors/entrypoint.js\";\nimport { Logger } from \"../logger.js\";\nimport type { SmartAccountSigner } from \"../signer/types.js\";\nimport { wrapSignatureWith6492 } from \"../signer/utils.js\";\nimport type { NullAddress } from \"../types.js\";\nimport type { IsUndefined } from \"../utils/types.js\";\n\nexport type AccountOp = {\n target: Address;\n value?: bigint;\n data: Hex | \"0x\";\n};\n\nexport enum DeploymentState {\n UNDEFINED = \"0x0\",\n NOT_DEPLOYED = \"0x1\",\n DEPLOYED = \"0x2\",\n}\n\nexport type GetEntryPointFromAccount<\n TAccount extends SmartContractAccount | undefined,\n TAccountOverride extends SmartContractAccount = SmartContractAccount\n> = GetAccountParameter<\n TAccount,\n TAccountOverride\n> extends SmartContractAccount<string, infer TEntryPointVersion>\n ? TEntryPointVersion\n : EntryPointVersion;\n\nexport type GetAccountParameter<\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TAccountOverride extends SmartContractAccount = SmartContractAccount\n> = IsUndefined<TAccount> extends true\n ? { account: TAccountOverride }\n : { account?: TAccountOverride };\n\nexport type UpgradeToAndCallParams = {\n upgradeToAddress: Address;\n upgradeToInitData: Hex;\n};\n\nexport type SmartContractAccountWithSigner<\n Name extends string = string,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = SmartContractAccount<Name, TEntryPointVersion> & {\n getSigner: () => TSigner;\n};\n\n/**\n * Determines if the given SmartContractAccount has a signer associated with it.\n *\n * @example\n * ```ts\n * import { toSmartContractAccount } from \"@aa-sdk/core\";\n *\n * const account = await toSmartContractAccount(...);\n *\n * console.log(isSmartAccountWithSigner(account)); // false: the base account does not have a publicly accessible signer\n * ```\n *\n * @param {SmartContractAccount} account The account to check.\n * @returns {boolean} true if the account has a signer, otherwise false.\n */\nexport const isSmartAccountWithSigner = (\n account: SmartContractAccount\n): account is SmartContractAccountWithSigner => {\n return \"getSigner\" in account;\n};\n\n// [!region SmartContractAccount]\nexport type SmartContractAccount<\n Name extends string = string,\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = LocalAccount<Name> & {\n source: Name;\n getDummySignature: () => Hex | Promise<Hex>;\n encodeExecute: (tx: AccountOp) => Promise<Hex>;\n encodeBatchExecute: (txs: AccountOp[]) => Promise<Hex>;\n signUserOperationHash: (uoHash: Hex) => Promise<Hex>;\n signMessageWith6492: (params: { message: SignableMessage }) => Promise<Hex>;\n signTypedDataWith6492: <\n const typedData extends TypedData | Record<string, unknown>,\n primaryType extends keyof typedData | \"EIP712Domain\" = keyof typedData\n >(\n typedDataDefinition: TypedDataDefinition<typedData, primaryType>\n ) => Promise<Hex>;\n encodeUpgradeToAndCall: (params: UpgradeToAndCallParams) => Promise<Hex>;\n getNonce(nonceKey?: bigint): Promise<bigint>;\n getInitCode: () => Promise<Hex>;\n isAccountDeployed: () => Promise<boolean>;\n getFactoryAddress: () => Promise<Address>;\n getFactoryData: () => Promise<Hex>;\n getEntryPoint: () => EntryPointDef<TEntryPointVersion>;\n getImplementationAddress: () => Promise<NullAddress | Address>;\n};\n// [!endregion SmartContractAccount]\n\nexport interface AccountEntryPointRegistry<Name extends string = string>\n extends EntryPointRegistryBase<\n SmartContractAccount<Name, EntryPointVersion>\n > {\n \"0.6.0\": SmartContractAccount<Name, \"0.6.0\">;\n \"0.7.0\": SmartContractAccount<Name, \"0.7.0\">;\n}\n\n// [!region ToSmartContractAccountParams]\nexport type ToSmartContractAccountParams<\n Name extends string = string,\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = {\n source: Name;\n transport: TTransport;\n chain: TChain;\n entryPoint: EntryPointDef<TEntryPointVersion, TChain>;\n accountAddress?: Address;\n getAccountInitCode: () => Promise<Hex>;\n getDummySignature: () => Hex | Promise<Hex>;\n encodeExecute: (tx: AccountOp) => Promise<Hex>;\n encodeBatchExecute?: (txs: AccountOp[]) => Promise<Hex>;\n // if not provided, will default to just using signMessage over the Hex\n signUserOperationHash?: (uoHash: Hex) => Promise<Hex>;\n encodeUpgradeToAndCall?: (params: UpgradeToAndCallParams) => Promise<Hex>;\n} & Omit<CustomSource, \"signTransaction\" | \"address\">;\n// [!endregion ToSmartContractAccountParams]\n\n/**\n * Parses the factory address and factory calldata from the provided account initialization code (initCode).\n *\n * @example\n * ```ts\n * import { parseFactoryAddressFromAccountInitCode } from \"@aa-sdk/core\";\n *\n * const [address, calldata] = parseFactoryAddressFromAccountInitCode(\"0xAddressCalldata\");\n * ```\n *\n * @param {Hex} initCode The initialization code from which to parse the factory address and calldata\n * @returns {[Address, Hex]} A tuple containing the parsed factory address and factory calldata\n */\nexport const parseFactoryAddressFromAccountInitCode = (\n initCode: Hex\n): [Address, Hex] => {\n const factoryAddress: Address = `0x${initCode.substring(2, 42)}`;\n const factoryCalldata: Hex = `0x${initCode.substring(42)}`;\n return [factoryAddress, factoryCalldata];\n};\n\nexport type GetAccountAddressParams = {\n client: PublicClient;\n entryPoint: EntryPointDef;\n accountAddress?: Address;\n getAccountInitCode: () => Promise<Hex>;\n};\n\n/**\n * Retrieves the account address. Uses a provided `accountAddress` if available; otherwise, it computes the address using the entry point contract and the initial code.\n *\n * @example\n * ```ts\n * import { getEntryPoint, getAccountAddress } from \"@aa-sdk/core\";\n *\n * const accountAddress = await getAccountAddress({\n * client,\n * entryPoint: getEntryPoint(chain),\n * getAccountInitCode: async () => \"0x{factoryAddress}{factoryCallData}\",\n * });\n * ```\n *\n * @param {GetAccountAddressParams} params The configuration object\n * @param {PublicClient} params.client A public client instance to interact with the blockchain\n * @param {EntryPointDef} params.entryPoint The entry point definition which includes the address and ABI\n * @param {Address} params.accountAddress Optional existing account address\n * @param {() => Promise<Hex>} params.getAccountInitCode A function that returns a Promise resolving to a Hex string representing the initial code of the account\n * @returns {Promise<Address>} A promise that resolves to the account address\n */\nexport const getAccountAddress = async ({\n client,\n entryPoint,\n accountAddress,\n getAccountInitCode,\n}: GetAccountAddressParams) => {\n if (accountAddress) return accountAddress;\n\n const entryPointContract = getContract({\n address: entryPoint.address,\n abi: entryPoint.abi,\n client,\n });\n\n const initCode = await getAccountInitCode();\n Logger.verbose(\"[BaseSmartContractAccount](getAddress) initCode: \", initCode);\n\n try {\n await entryPointContract.simulate.getSenderAddress([initCode]);\n } catch (err: any) {\n Logger.verbose(\n \"[BaseSmartContractAccount](getAddress) getSenderAddress err: \",\n err\n );\n if (err.cause?.data?.errorName === \"SenderAddressResult\") {\n Logger.verbose(\n \"[BaseSmartContractAccount](getAddress) entryPoint.getSenderAddress result:\",\n err.cause.data.args[0]\n );\n\n return err.cause.data.args[0] as Address;\n }\n\n if (err.details === \"Invalid URL\") {\n throw new InvalidRpcUrlError();\n }\n }\n\n throw new GetCounterFactualAddressError();\n};\n\n// [!region toSmartContractAccount]\nexport async function toSmartContractAccount<\n Name extends string = string,\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n>({\n transport,\n chain,\n entryPoint,\n source,\n accountAddress,\n getAccountInitCode,\n signMessage,\n signTypedData,\n encodeBatchExecute,\n encodeExecute,\n getDummySignature,\n signUserOperationHash,\n encodeUpgradeToAndCall,\n}: ToSmartContractAccountParams<\n Name,\n TTransport,\n TChain,\n TEntryPointVersion\n>): Promise<SmartContractAccount<Name, TEntryPointVersion>>;\n// [!endregion toSmartContractAccount]\n\n/**\n * Converts an account to a smart contract account and sets up various account-related methods using the provided parameters like transport, chain, entry point, and other utilities.\n *\n * @example\n * ```ts\n * import { http, type SignableMessage } from \"viem\";\n * import { sepolia } from \"viem/chains\";\n *\n * const myAccount = await toSmartContractAccount({\n * /// REQUIRED PARAMS ///\n * source: \"MyAccount\",\n * transport: http(\"RPC_URL\"),\n * chain: sepolia,\n * // The EntryPointDef that your account is com\"patible with\n * entryPoint: getEntryPoint(sepolia, { version: \"0.6.0\" }),\n * // This should return a concatenation of your `factoryAddress` and the `callData` for your factory's create account method\n * getAccountInitCode: async () => \"0x{factoryAddress}{callData}\",\n * // an invalid signature that doesn't cause your account to revert during validation\n * getDummySignature: () => \"0x1234...\",\n * // given a UO in the form of {target, data, value} should output the calldata for calling your contract's execution method\n * encodeExecute: async (uo) => \"0xcalldata\",\n * signMessage: async ({ message }: { message: SignableMessage }) => \"0x...\",\n * signTypedData: async (typedData) => \"0x000\",\n *\n * /// OPTIONAL PARAMS ///\n * // if you already know your account's address, pass that in here to avoid generating a new counterfactual\n * accountAddress: \"0xaddressoverride\",\n * // if your account supports batching, this should take an array of UOs and return the calldata for calling your contract's batchExecute method\n * encodeBatchExecute: async (uos) => \"0x...\",\n * // if your contract expects a different signing scheme than the default signMessage scheme, you can override that here\n * signUserOperationHash: async (hash) => \"0x...\",\n * // allows you to define the calldata for upgrading your account\n * encodeUpgradeToAndCall: async (params) => \"0x...\",\n * });\n * ```\n *\n * @param {ToSmartContractAccountParams} params the parameters required for converting to a smart contract account\n * @param {Transport} params.transport the transport mechanism used for communication\n * @param {Chain} params.chain the blockchain chain used in the account\n * @param {EntryPoint} params.entryPoint the entry point of the smart contract\n * @param {string} params.source the source identifier for the account\n * @param {Address} [params.accountAddress] the address of the account\n * @param {() => Promise<Hex>} params.getAccountInitCode a function to get the initial state code of the account\n * @param {(message: { message: SignableMessage }) => Promise<Hex>} params.signMessage a function to sign a message\n * @param {(typedDataDefinition: TypedDataDefinition<typedData, primaryType>) => Promise<Hex>} params.signTypedData a function to sign typed data\n * @param {(transactions: Transaction[]) => Hex} [params.encodeBatchExecute] a function to encode batch transactions\n * @param {(tx: Transaction) => Hex} params.encodeExecute a function to encode a single transaction\n * @param {() => Promise<Hex>} params.getDummySignature a function to get a dummy signature\n * @param {(uoHash: Hex) => Promise<Hex>} [params.signUserOperationHash] a function to sign user operations\n * @param {(implementationAddress: Address, implementationCallData: Hex) => Hex} [params.encodeUpgradeToAndCall] a function to encode upgrade call\n * @returns {Promise<SmartContractAccount>} a promise that resolves to a SmartContractAccount object with methods and properties for interacting with the smart contract account\n */\nexport async function toSmartContractAccount(\n params: ToSmartContractAccountParams\n): Promise<SmartContractAccount> {\n const {\n transport,\n chain,\n entryPoint,\n source,\n accountAddress,\n getAccountInitCode,\n signMessage,\n signTypedData,\n encodeBatchExecute,\n encodeExecute,\n getDummySignature,\n signUserOperationHash,\n encodeUpgradeToAndCall,\n } = params;\n\n const client = createBundlerClient({\n // we set the retry count to 0 so that viem doesn't retry during\n // getting the address. That call always reverts and without this\n // viem will retry 3 times, making this call very slow\n transport: (opts) => transport({ ...opts, chain, retryCount: 0 }),\n chain,\n });\n\n const entryPointContract = getContract({\n address: entryPoint.address,\n abi: entryPoint.abi,\n client,\n });\n\n const accountAddress_ = await getAccountAddress({\n client,\n entryPoint: entryPoint,\n accountAddress,\n getAccountInitCode,\n });\n\n let deploymentState = DeploymentState.UNDEFINED;\n\n const getInitCode = async () => {\n if (deploymentState === DeploymentState.DEPLOYED) {\n return \"0x\";\n }\n\n const contractCode = await client.getBytecode({\n address: accountAddress_,\n });\n\n if ((contractCode?.length ?? 0) > 2) {\n deploymentState = DeploymentState.DEPLOYED;\n return \"0x\";\n } else {\n deploymentState = DeploymentState.NOT_DEPLOYED;\n }\n\n return getAccountInitCode();\n };\n\n const signUserOperationHash_ =\n signUserOperationHash ??\n (async (uoHash: Hex) => {\n return signMessage({ message: { raw: hexToBytes(uoHash) } });\n });\n\n const getFactoryAddress = async (): Promise<Address> =>\n parseFactoryAddressFromAccountInitCode(await getAccountInitCode())[0];\n\n const getFactoryData = async (): Promise<Hex> =>\n parseFactoryAddressFromAccountInitCode(await getAccountInitCode())[1];\n\n const encodeUpgradeToAndCall_ =\n encodeUpgradeToAndCall ??\n (() => {\n throw new UpgradesNotSupportedError(source);\n });\n\n const isAccountDeployed = async () => {\n const initCode = await getInitCode();\n return initCode === \"0x\";\n };\n\n const getNonce = async (nonceKey = 0n): Promise<bigint> => {\n if (!(await isAccountDeployed())) {\n return 0n;\n }\n\n return entryPointContract.read.getNonce([\n accountAddress_,\n nonceKey,\n ]) as Promise<bigint>;\n };\n\n const account = toAccount({\n address: accountAddress_,\n signMessage,\n signTypedData,\n signTransaction: () => {\n throw new SignTransactionNotSupportedError();\n },\n });\n\n const create6492Signature = async (isDeployed: boolean, signature: Hex) => {\n if (isDeployed) {\n return signature;\n }\n\n const [factoryAddress, factoryCalldata] =\n parseFactoryAddressFromAccountInitCode(await getAccountInitCode());\n\n return wrapSignatureWith6492({\n factoryAddress,\n factoryCalldata,\n signature,\n });\n };\n\n const signMessageWith6492 = async (message: { message: SignableMessage }) => {\n const [isDeployed, signature] = await Promise.all([\n isAccountDeployed(),\n account.signMessage(message),\n ]);\n\n return create6492Signature(isDeployed, signature);\n };\n\n const signTypedDataWith6492 = async <\n const typedData extends TypedData | Record<string, unknown>,\n primaryType extends keyof typedData | \"EIP712Domain\" = keyof typedData\n >(\n typedDataDefinition: TypedDataDefinition<typedData, primaryType>\n ): Promise<Hex> => {\n const [isDeployed, signature] = await Promise.all([\n isAccountDeployed(),\n account.signTypedData(typedDataDefinition),\n ]);\n\n return create6492Signature(isDeployed, signature);\n };\n\n const getImplementationAddress = async (): Promise<NullAddress | Address> => {\n const storage = await client.getStorageAt({\n address: account.address,\n // This is the default slot for the implementation address for Proxies\n slot: \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\",\n });\n\n if (storage == null) {\n throw new FailedToGetStorageSlotError(\n \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\",\n \"Proxy Implementation Address\"\n );\n }\n\n return trim(storage);\n };\n\n if (entryPoint.version !== \"0.6.0\" && entryPoint.version !== \"0.7.0\") {\n throw new InvalidEntryPointError(chain, entryPoint.version);\n }\n\n return {\n ...account,\n source,\n // TODO: I think this should probably be signUserOperation instead\n // and allow for generating the UO hash based on the EP version\n signUserOperationHash: signUserOperationHash_,\n getFactoryAddress,\n getFactoryData,\n encodeBatchExecute:\n encodeBatchExecute ??\n (() => {\n throw new BatchExecutionNotSupportedError(source);\n }),\n encodeExecute,\n getDummySignature,\n getInitCode,\n encodeUpgradeToAndCall: encodeUpgradeToAndCall_,\n getEntryPoint: () => entryPoint,\n isAccountDeployed,\n getNonce,\n signMessageWith6492,\n signTypedDataWith6492,\n getImplementationAddress,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"smartContractAccount.js","sourceRoot":"","sources":["../../../src/account/smartContractAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,UAAU,EACV,IAAI,GAWL,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAMjE,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,EAC3B,6BAA6B,EAC7B,gCAAgC,EAChC,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAU3D,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,uCAAoB,CAAA;IACpB,mCAAgB,CAAA;AAClB,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B;AAkCD;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,OAA6B,EACc,EAAE;IAC7C,OAAO,WAAW,IAAI,OAAO,CAAC;AAChC,CAAC,CAAC;AA0DF,4CAA4C;AAE5C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,CACpD,QAAa,EACG,EAAE;IAClB,MAAM,cAAc,GAAY,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AAC;YACxC,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,sEAAsE;YACtE,IAAI,EAAE,oEAAoE;SAC3E,CAAC,CAAC;QAEH,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YACpB,MAAM,IAAI,2BAA2B,CACnC,oEAAoE,EACpE,8BAA8B,CAC/B,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC,CAAC;IAEF,IAAI,UAAU,CAAC,OAAO,KAAK,OAAO,IAAI,UAAU,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;QACrE,MAAM,IAAI,sBAAsB,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO;QACL,GAAG,OAAO;QACV,MAAM;QACN,kEAAkE;QAClE,+DAA+D;QAC/D,qBAAqB,EAAE,sBAAsB;QAC7C,iBAAiB;QACjB,cAAc;QACd,kBAAkB,EAChB,kBAAkB;YAClB,CAAC,GAAG,EAAE;gBACJ,MAAM,IAAI,+BAA+B,CAAC,MAAM,CAAC,CAAC;YACpD,CAAC,CAAC;QACJ,aAAa;QACb,iBAAiB;QACjB,WAAW;QACX,sBAAsB,EAAE,uBAAuB;QAC/C,aAAa,EAAE,GAAG,EAAE,CAAC,UAAU;QAC/B,iBAAiB;QACjB,eAAe,EAAE,QAAQ;QACzB,mBAAmB;QACnB,qBAAqB;QACrB,wBAAwB;KACzB,CAAC;AACJ,CAAC","sourcesContent":["import {\n getContract,\n hexToBytes,\n trim,\n type Address,\n type Chain,\n type CustomSource,\n type Hex,\n type LocalAccount,\n type PublicClient,\n type SignableMessage,\n type Transport,\n type TypedData,\n type TypedDataDefinition,\n} from \"viem\";\nimport { toAccount } from \"viem/accounts\";\nimport { createBundlerClient } from \"../client/bundlerClient.js\";\nimport type {\n EntryPointDef,\n EntryPointRegistryBase,\n EntryPointVersion,\n} from \"../entrypoint/types.js\";\nimport {\n BatchExecutionNotSupportedError,\n FailedToGetStorageSlotError,\n GetCounterFactualAddressError,\n SignTransactionNotSupportedError,\n UpgradesNotSupportedError,\n} from \"../errors/account.js\";\nimport { InvalidRpcUrlError } from \"../errors/client.js\";\nimport { InvalidEntryPointError } from \"../errors/entrypoint.js\";\nimport { Logger } from \"../logger.js\";\nimport type { SmartAccountSigner } from \"../signer/types.js\";\nimport { wrapSignatureWith6492 } from \"../signer/utils.js\";\nimport type { NullAddress } from \"../types.js\";\nimport type { IsUndefined } from \"../utils/types.js\";\n\nexport type AccountOp = {\n target: Address;\n value?: bigint;\n data: Hex | \"0x\";\n};\n\nexport enum DeploymentState {\n UNDEFINED = \"0x0\",\n NOT_DEPLOYED = \"0x1\",\n DEPLOYED = \"0x2\",\n}\n\nexport type GetEntryPointFromAccount<\n TAccount extends SmartContractAccount | undefined,\n TAccountOverride extends SmartContractAccount = SmartContractAccount\n> = GetAccountParameter<\n TAccount,\n TAccountOverride\n> extends SmartContractAccount<string, infer TEntryPointVersion>\n ? TEntryPointVersion\n : EntryPointVersion;\n\nexport type GetAccountParameter<\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TAccountOverride extends SmartContractAccount = SmartContractAccount\n> = IsUndefined<TAccount> extends true\n ? { account: TAccountOverride }\n : { account?: TAccountOverride };\n\nexport type UpgradeToAndCallParams = {\n upgradeToAddress: Address;\n upgradeToInitData: Hex;\n};\n\nexport type SmartContractAccountWithSigner<\n Name extends string = string,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = SmartContractAccount<Name, TEntryPointVersion> & {\n getSigner: () => TSigner;\n};\n\n/**\n * Determines if the given SmartContractAccount has a signer associated with it.\n *\n * @example\n * ```ts\n * import { toSmartContractAccount } from \"@aa-sdk/core\";\n *\n * const account = await toSmartContractAccount(...);\n *\n * console.log(isSmartAccountWithSigner(account)); // false: the base account does not have a publicly accessible signer\n * ```\n *\n * @param {SmartContractAccount} account The account to check.\n * @returns {boolean} true if the account has a signer, otherwise false.\n */\nexport const isSmartAccountWithSigner = (\n account: SmartContractAccount\n): account is SmartContractAccountWithSigner => {\n return \"getSigner\" in account;\n};\n\n// [!region SmartContractAccount]\nexport type SmartContractAccount<\n Name extends string = string,\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = LocalAccount<Name> & {\n source: Name;\n getDummySignature: () => Hex | Promise<Hex>;\n encodeExecute: (tx: AccountOp) => Promise<Hex>;\n encodeBatchExecute: (txs: AccountOp[]) => Promise<Hex>;\n signUserOperationHash: (uoHash: Hex) => Promise<Hex>;\n signMessageWith6492: (params: { message: SignableMessage }) => Promise<Hex>;\n signTypedDataWith6492: <\n const typedData extends TypedData | Record<string, unknown>,\n primaryType extends keyof typedData | \"EIP712Domain\" = keyof typedData\n >(\n typedDataDefinition: TypedDataDefinition<typedData, primaryType>\n ) => Promise<Hex>;\n encodeUpgradeToAndCall: (params: UpgradeToAndCallParams) => Promise<Hex>;\n getAccountNonce(nonceKey?: bigint): Promise<bigint>;\n getInitCode: () => Promise<Hex>;\n isAccountDeployed: () => Promise<boolean>;\n getFactoryAddress: () => Promise<Address>;\n getFactoryData: () => Promise<Hex>;\n getEntryPoint: () => EntryPointDef<TEntryPointVersion>;\n getImplementationAddress: () => Promise<NullAddress | Address>;\n};\n// [!endregion SmartContractAccount]\n\nexport interface AccountEntryPointRegistry<Name extends string = string>\n extends EntryPointRegistryBase<\n SmartContractAccount<Name, EntryPointVersion>\n > {\n \"0.6.0\": SmartContractAccount<Name, \"0.6.0\">;\n \"0.7.0\": SmartContractAccount<Name, \"0.7.0\">;\n}\n\n// [!region ToSmartContractAccountParams]\nexport type ToSmartContractAccountParams<\n Name extends string = string,\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = {\n source: Name;\n transport: TTransport;\n chain: TChain;\n entryPoint: EntryPointDef<TEntryPointVersion, TChain>;\n accountAddress?: Address;\n getAccountInitCode: () => Promise<Hex>;\n getDummySignature: () => Hex | Promise<Hex>;\n encodeExecute: (tx: AccountOp) => Promise<Hex>;\n encodeBatchExecute?: (txs: AccountOp[]) => Promise<Hex>;\n // if not provided, will default to just using signMessage over the Hex\n signUserOperationHash?: (uoHash: Hex) => Promise<Hex>;\n encodeUpgradeToAndCall?: (params: UpgradeToAndCallParams) => Promise<Hex>;\n} & Omit<CustomSource, \"signTransaction\" | \"address\">;\n// [!endregion ToSmartContractAccountParams]\n\n/**\n * Parses the factory address and factory calldata from the provided account initialization code (initCode).\n *\n * @example\n * ```ts\n * import { parseFactoryAddressFromAccountInitCode } from \"@aa-sdk/core\";\n *\n * const [address, calldata] = parseFactoryAddressFromAccountInitCode(\"0xAddressCalldata\");\n * ```\n *\n * @param {Hex} initCode The initialization code from which to parse the factory address and calldata\n * @returns {[Address, Hex]} A tuple containing the parsed factory address and factory calldata\n */\nexport const parseFactoryAddressFromAccountInitCode = (\n initCode: Hex\n): [Address, Hex] => {\n const factoryAddress: Address = `0x${initCode.substring(2, 42)}`;\n const factoryCalldata: Hex = `0x${initCode.substring(42)}`;\n return [factoryAddress, factoryCalldata];\n};\n\nexport type GetAccountAddressParams = {\n client: PublicClient;\n entryPoint: EntryPointDef;\n accountAddress?: Address;\n getAccountInitCode: () => Promise<Hex>;\n};\n\n/**\n * Retrieves the account address. Uses a provided `accountAddress` if available; otherwise, it computes the address using the entry point contract and the initial code.\n *\n * @example\n * ```ts\n * import { getEntryPoint, getAccountAddress } from \"@aa-sdk/core\";\n *\n * const accountAddress = await getAccountAddress({\n * client,\n * entryPoint: getEntryPoint(chain),\n * getAccountInitCode: async () => \"0x{factoryAddress}{factoryCallData}\",\n * });\n * ```\n *\n * @param {GetAccountAddressParams} params The configuration object\n * @param {PublicClient} params.client A public client instance to interact with the blockchain\n * @param {EntryPointDef} params.entryPoint The entry point definition which includes the address and ABI\n * @param {Address} params.accountAddress Optional existing account address\n * @param {() => Promise<Hex>} params.getAccountInitCode A function that returns a Promise resolving to a Hex string representing the initial code of the account\n * @returns {Promise<Address>} A promise that resolves to the account address\n */\nexport const getAccountAddress = async ({\n client,\n entryPoint,\n accountAddress,\n getAccountInitCode,\n}: GetAccountAddressParams) => {\n if (accountAddress) return accountAddress;\n\n const entryPointContract = getContract({\n address: entryPoint.address,\n abi: entryPoint.abi,\n client,\n });\n\n const initCode = await getAccountInitCode();\n Logger.verbose(\"[BaseSmartContractAccount](getAddress) initCode: \", initCode);\n\n try {\n await entryPointContract.simulate.getSenderAddress([initCode]);\n } catch (err: any) {\n Logger.verbose(\n \"[BaseSmartContractAccount](getAddress) getSenderAddress err: \",\n err\n );\n if (err.cause?.data?.errorName === \"SenderAddressResult\") {\n Logger.verbose(\n \"[BaseSmartContractAccount](getAddress) entryPoint.getSenderAddress result:\",\n err.cause.data.args[0]\n );\n\n return err.cause.data.args[0] as Address;\n }\n\n if (err.details === \"Invalid URL\") {\n throw new InvalidRpcUrlError();\n }\n }\n\n throw new GetCounterFactualAddressError();\n};\n\n// [!region toSmartContractAccount]\nexport async function toSmartContractAccount<\n Name extends string = string,\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n>({\n transport,\n chain,\n entryPoint,\n source,\n accountAddress,\n getAccountInitCode,\n signMessage,\n signTypedData,\n encodeBatchExecute,\n encodeExecute,\n getDummySignature,\n signUserOperationHash,\n encodeUpgradeToAndCall,\n}: ToSmartContractAccountParams<\n Name,\n TTransport,\n TChain,\n TEntryPointVersion\n>): Promise<SmartContractAccount<Name, TEntryPointVersion>>;\n// [!endregion toSmartContractAccount]\n\n/**\n * Converts an account to a smart contract account and sets up various account-related methods using the provided parameters like transport, chain, entry point, and other utilities.\n *\n * @example\n * ```ts\n * import { http, type SignableMessage } from \"viem\";\n * import { sepolia } from \"viem/chains\";\n *\n * const myAccount = await toSmartContractAccount({\n * /// REQUIRED PARAMS ///\n * source: \"MyAccount\",\n * transport: http(\"RPC_URL\"),\n * chain: sepolia,\n * // The EntryPointDef that your account is com\"patible with\n * entryPoint: getEntryPoint(sepolia, { version: \"0.6.0\" }),\n * // This should return a concatenation of your `factoryAddress` and the `callData` for your factory's create account method\n * getAccountInitCode: async () => \"0x{factoryAddress}{callData}\",\n * // an invalid signature that doesn't cause your account to revert during validation\n * getDummySignature: () => \"0x1234...\",\n * // given a UO in the form of {target, data, value} should output the calldata for calling your contract's execution method\n * encodeExecute: async (uo) => \"0xcalldata\",\n * signMessage: async ({ message }: { message: SignableMessage }) => \"0x...\",\n * signTypedData: async (typedData) => \"0x000\",\n *\n * /// OPTIONAL PARAMS ///\n * // if you already know your account's address, pass that in here to avoid generating a new counterfactual\n * accountAddress: \"0xaddressoverride\",\n * // if your account supports batching, this should take an array of UOs and return the calldata for calling your contract's batchExecute method\n * encodeBatchExecute: async (uos) => \"0x...\",\n * // if your contract expects a different signing scheme than the default signMessage scheme, you can override that here\n * signUserOperationHash: async (hash) => \"0x...\",\n * // allows you to define the calldata for upgrading your account\n * encodeUpgradeToAndCall: async (params) => \"0x...\",\n * });\n * ```\n *\n * @param {ToSmartContractAccountParams} params the parameters required for converting to a smart contract account\n * @param {Transport} params.transport the transport mechanism used for communication\n * @param {Chain} params.chain the blockchain chain used in the account\n * @param {EntryPoint} params.entryPoint the entry point of the smart contract\n * @param {string} params.source the source identifier for the account\n * @param {Address} [params.accountAddress] the address of the account\n * @param {() => Promise<Hex>} params.getAccountInitCode a function to get the initial state code of the account\n * @param {(message: { message: SignableMessage }) => Promise<Hex>} params.signMessage a function to sign a message\n * @param {(typedDataDefinition: TypedDataDefinition<typedData, primaryType>) => Promise<Hex>} params.signTypedData a function to sign typed data\n * @param {(transactions: Transaction[]) => Hex} [params.encodeBatchExecute] a function to encode batch transactions\n * @param {(tx: Transaction) => Hex} params.encodeExecute a function to encode a single transaction\n * @param {() => Promise<Hex>} params.getDummySignature a function to get a dummy signature\n * @param {(uoHash: Hex) => Promise<Hex>} [params.signUserOperationHash] a function to sign user operations\n * @param {(implementationAddress: Address, implementationCallData: Hex) => Hex} [params.encodeUpgradeToAndCall] a function to encode upgrade call\n * @returns {Promise<SmartContractAccount>} a promise that resolves to a SmartContractAccount object with methods and properties for interacting with the smart contract account\n */\nexport async function toSmartContractAccount(\n params: ToSmartContractAccountParams\n): Promise<SmartContractAccount> {\n const {\n transport,\n chain,\n entryPoint,\n source,\n accountAddress,\n getAccountInitCode,\n signMessage,\n signTypedData,\n encodeBatchExecute,\n encodeExecute,\n getDummySignature,\n signUserOperationHash,\n encodeUpgradeToAndCall,\n } = params;\n\n const client = createBundlerClient({\n // we set the retry count to 0 so that viem doesn't retry during\n // getting the address. That call always reverts and without this\n // viem will retry 3 times, making this call very slow\n transport: (opts) => transport({ ...opts, chain, retryCount: 0 }),\n chain,\n });\n\n const entryPointContract = getContract({\n address: entryPoint.address,\n abi: entryPoint.abi,\n client,\n });\n\n const accountAddress_ = await getAccountAddress({\n client,\n entryPoint: entryPoint,\n accountAddress,\n getAccountInitCode,\n });\n\n let deploymentState = DeploymentState.UNDEFINED;\n\n const getInitCode = async () => {\n if (deploymentState === DeploymentState.DEPLOYED) {\n return \"0x\";\n }\n const contractCode = await client.getCode({\n address: accountAddress_,\n });\n\n if ((contractCode?.length ?? 0) > 2) {\n deploymentState = DeploymentState.DEPLOYED;\n return \"0x\";\n } else {\n deploymentState = DeploymentState.NOT_DEPLOYED;\n }\n\n return getAccountInitCode();\n };\n\n const signUserOperationHash_ =\n signUserOperationHash ??\n (async (uoHash: Hex) => {\n return signMessage({ message: { raw: hexToBytes(uoHash) } });\n });\n\n const getFactoryAddress = async (): Promise<Address> =>\n parseFactoryAddressFromAccountInitCode(await getAccountInitCode())[0];\n\n const getFactoryData = async (): Promise<Hex> =>\n parseFactoryAddressFromAccountInitCode(await getAccountInitCode())[1];\n\n const encodeUpgradeToAndCall_ =\n encodeUpgradeToAndCall ??\n (() => {\n throw new UpgradesNotSupportedError(source);\n });\n\n const isAccountDeployed = async () => {\n const initCode = await getInitCode();\n return initCode === \"0x\";\n };\n\n const getNonce = async (nonceKey = 0n): Promise<bigint> => {\n if (!(await isAccountDeployed())) {\n return 0n;\n }\n\n return entryPointContract.read.getNonce([\n accountAddress_,\n nonceKey,\n ]) as Promise<bigint>;\n };\n\n const account = toAccount({\n address: accountAddress_,\n signMessage,\n signTypedData,\n signTransaction: () => {\n throw new SignTransactionNotSupportedError();\n },\n });\n\n const create6492Signature = async (isDeployed: boolean, signature: Hex) => {\n if (isDeployed) {\n return signature;\n }\n\n const [factoryAddress, factoryCalldata] =\n parseFactoryAddressFromAccountInitCode(await getAccountInitCode());\n\n return wrapSignatureWith6492({\n factoryAddress,\n factoryCalldata,\n signature,\n });\n };\n\n const signMessageWith6492 = async (message: { message: SignableMessage }) => {\n const [isDeployed, signature] = await Promise.all([\n isAccountDeployed(),\n account.signMessage(message),\n ]);\n\n return create6492Signature(isDeployed, signature);\n };\n\n const signTypedDataWith6492 = async <\n const typedData extends TypedData | Record<string, unknown>,\n primaryType extends keyof typedData | \"EIP712Domain\" = keyof typedData\n >(\n typedDataDefinition: TypedDataDefinition<typedData, primaryType>\n ): Promise<Hex> => {\n const [isDeployed, signature] = await Promise.all([\n isAccountDeployed(),\n account.signTypedData(typedDataDefinition),\n ]);\n\n return create6492Signature(isDeployed, signature);\n };\n\n const getImplementationAddress = async (): Promise<NullAddress | Address> => {\n const storage = await client.getStorageAt({\n address: account.address,\n // This is the default slot for the implementation address for Proxies\n slot: \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\",\n });\n\n if (storage == null) {\n throw new FailedToGetStorageSlotError(\n \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\",\n \"Proxy Implementation Address\"\n );\n }\n\n return trim(storage);\n };\n\n if (entryPoint.version !== \"0.6.0\" && entryPoint.version !== \"0.7.0\") {\n throw new InvalidEntryPointError(chain, entryPoint.version);\n }\n\n return {\n ...account,\n source,\n // TODO: I think this should probably be signUserOperation instead\n // and allow for generating the UO hash based on the EP version\n signUserOperationHash: signUserOperationHash_,\n getFactoryAddress,\n getFactoryData,\n encodeBatchExecute:\n encodeBatchExecute ??\n (() => {\n throw new BatchExecutionNotSupportedError(source);\n }),\n encodeExecute,\n getDummySignature,\n getInitCode,\n encodeUpgradeToAndCall: encodeUpgradeToAndCall_,\n getEntryPoint: () => entryPoint,\n isAccountDeployed,\n getAccountNonce: getNonce,\n signMessageWith6492,\n signTypedDataWith6492,\n getImplementationAddress,\n };\n}\n"]}
|
|
@@ -2,4 +2,27 @@ import type { Chain, Client, Transport } from "viem";
|
|
|
2
2
|
import { type GetEntryPointFromAccount, type SmartContractAccount } from "../../account/smartContractAccount.js";
|
|
3
3
|
import type { UserOperationStruct } from "../../types.js";
|
|
4
4
|
import type { BuildUserOperationParameters, UserOperationContext } from "./types";
|
|
5
|
+
/**
|
|
6
|
+
* Builds a user operation using the provided client and operation parameters. Ensures that the account exists and the client is compatible.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { createSmartAccountClient } from "@aa-sdk/core";
|
|
11
|
+
*
|
|
12
|
+
* // smart account client is already extended with buildUserOperation
|
|
13
|
+
* const client = createSmartAccountClient(...);
|
|
14
|
+
* const result = await client.buildUserOperation({
|
|
15
|
+
* uo: {
|
|
16
|
+
* target: "0x...",
|
|
17
|
+
* data: "0x...", // or "0x",
|
|
18
|
+
* value: 0n, // optional
|
|
19
|
+
* },
|
|
20
|
+
* account, // only required if the client above is not connected to an account
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @param {Client<TTransport, TChain, TAccount>} client the client instance used to build the user operation
|
|
25
|
+
* @param {BuildUserOperationParameters<TAccount, TContext, TEntryPointVersion>} args the parameters required to build the user operation, including account, overrides, and context
|
|
26
|
+
* @returns {Promise<UserOperationStruct<TEntryPointVersion>>} a promise that resolves to a `UserOperationStruct` object containing the built user operation details
|
|
27
|
+
*/
|
|
5
28
|
export declare function buildUserOperation<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined, TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>>(client: Client<TTransport, TChain, TAccount>, args: BuildUserOperationParameters<TAccount, TContext, TEntryPointVersion>): Promise<UserOperationStruct<TEntryPointVersion>>;
|
|
@@ -4,6 +4,29 @@ import { AccountNotFoundError } from "../../errors/account.js";
|
|
|
4
4
|
import { IncompatibleClientError } from "../../errors/client.js";
|
|
5
5
|
import { _initUserOperation } from "./internal/initUserOperation.js";
|
|
6
6
|
import { _runMiddlewareStack } from "./internal/runMiddlewareStack.js";
|
|
7
|
+
/**
|
|
8
|
+
* Builds a user operation using the provided client and operation parameters. Ensures that the account exists and the client is compatible.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { createSmartAccountClient } from "@aa-sdk/core";
|
|
13
|
+
*
|
|
14
|
+
* // smart account client is already extended with buildUserOperation
|
|
15
|
+
* const client = createSmartAccountClient(...);
|
|
16
|
+
* const result = await client.buildUserOperation({
|
|
17
|
+
* uo: {
|
|
18
|
+
* target: "0x...",
|
|
19
|
+
* data: "0x...", // or "0x",
|
|
20
|
+
* value: 0n, // optional
|
|
21
|
+
* },
|
|
22
|
+
* account, // only required if the client above is not connected to an account
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @param {Client<TTransport, TChain, TAccount>} client the client instance used to build the user operation
|
|
27
|
+
* @param {BuildUserOperationParameters<TAccount, TContext, TEntryPointVersion>} args the parameters required to build the user operation, including account, overrides, and context
|
|
28
|
+
* @returns {Promise<UserOperationStruct<TEntryPointVersion>>} a promise that resolves to a `UserOperationStruct` object containing the built user operation details
|
|
29
|
+
*/
|
|
7
30
|
export async function buildUserOperation(client, args) {
|
|
8
31
|
const { account = client.account, overrides, context } = args;
|
|
9
32
|
if (!account) {
|