permissionless 0.0.35 → 0.1.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/CHANGELOG.md +14 -0
- package/_cjs/accounts/biconomy/privateKeyToBiconomySmartAccount.js.map +1 -1
- package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js +32 -15
- package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js.map +1 -1
- package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js +38 -20
- package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -1
- package/_cjs/accounts/safe/privateKeyToSafeSmartAccount.js.map +1 -1
- package/_cjs/accounts/safe/signerToSafeSmartAccount.js +42 -11
- package/_cjs/accounts/safe/signerToSafeSmartAccount.js.map +1 -1
- package/_cjs/accounts/simple/privateKeyToSimpleSmartAccount.js.map +1 -1
- package/_cjs/accounts/simple/signerToSimpleSmartAccount.js +104 -44
- package/_cjs/accounts/simple/signerToSimpleSmartAccount.js.map +1 -1
- package/_cjs/accounts/types.js.map +1 -1
- package/_cjs/actions/bundler/chainId.js.map +1 -1
- package/_cjs/actions/bundler/estimateUserOperationGas.js +20 -3
- package/_cjs/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_cjs/actions/bundler/getUserOperationByHash.js +28 -11
- package/_cjs/actions/bundler/getUserOperationByHash.js.map +1 -1
- package/_cjs/actions/bundler/getUserOperationReceipt.js.map +1 -1
- package/_cjs/actions/bundler/sendUserOperation.js.map +1 -1
- package/_cjs/actions/bundler/supportedEntryPoints.js.map +1 -1
- package/_cjs/actions/pimlico/getUserOperationGasPrice.js +7 -7
- package/_cjs/actions/pimlico/getUserOperationGasPrice.js.map +1 -1
- package/_cjs/actions/pimlico/sponsorUserOperation.js +19 -7
- package/_cjs/actions/pimlico/sponsorUserOperation.js.map +1 -1
- package/_cjs/actions/pimlico/validateSponsorshipPolicies.js.map +1 -1
- package/_cjs/actions/public/getAccountNonce.js.map +1 -1
- package/_cjs/actions/public/getSenderAddress.js +5 -2
- package/_cjs/actions/public/getSenderAddress.js.map +1 -1
- package/_cjs/actions/smartAccount/deployContract.js +3 -4
- package/_cjs/actions/smartAccount/deployContract.js.map +1 -1
- package/_cjs/actions/smartAccount/prepareUserOperationRequest.js +142 -19
- package/_cjs/actions/smartAccount/prepareUserOperationRequest.js.map +1 -1
- package/_cjs/actions/smartAccount/sendTransaction.js +3 -4
- package/_cjs/actions/smartAccount/sendTransaction.js.map +1 -1
- package/_cjs/actions/smartAccount/sendTransactions.js +3 -4
- package/_cjs/actions/smartAccount/sendTransactions.js.map +1 -1
- package/_cjs/actions/smartAccount/sendUserOperation.js +1 -1
- package/_cjs/actions/smartAccount/sendUserOperation.js.map +1 -1
- package/_cjs/actions/smartAccount/signMessage.js.map +1 -1
- package/_cjs/actions/smartAccount/signTypedData.js.map +1 -1
- package/_cjs/actions/smartAccount/writeContract.js.map +1 -1
- package/_cjs/actions/stackup/accounts.js +2 -2
- package/_cjs/actions/stackup/accounts.js.map +1 -1
- package/_cjs/actions/stackup/sponsorUserOperation.js +20 -12
- package/_cjs/actions/stackup/sponsorUserOperation.js.map +1 -1
- package/_cjs/clients/createBundlerClient.js +1 -1
- package/_cjs/clients/createBundlerClient.js.map +1 -1
- package/_cjs/clients/createSmartAccountClient.js +3 -3
- package/_cjs/clients/createSmartAccountClient.js.map +1 -1
- package/_cjs/clients/decorators/bundler.js +6 -3
- package/_cjs/clients/decorators/bundler.js.map +1 -1
- package/_cjs/clients/decorators/pimlico.js +6 -3
- package/_cjs/clients/decorators/pimlico.js.map +1 -1
- package/_cjs/clients/decorators/smartAccount.js +7 -7
- package/_cjs/clients/decorators/smartAccount.js.map +1 -1
- package/_cjs/clients/decorators/stackup.js.map +1 -1
- package/_cjs/clients/pimlico.js +4 -2
- package/_cjs/clients/pimlico.js.map +1 -1
- package/_cjs/clients/stackup.js +3 -1
- package/_cjs/clients/stackup.js.map +1 -1
- package/_cjs/errors/estimateUserOperationGas.js.map +1 -1
- package/_cjs/errors/sendUserOperation.js.map +1 -1
- package/_cjs/types/entrypoint.js +3 -0
- package/_cjs/types/entrypoint.js.map +1 -0
- package/_cjs/utils/errors/getBundlerError.js.map +1 -1
- package/_cjs/utils/errors/getEstimateUserOperationGasError.js.map +1 -1
- package/_cjs/utils/errors/getSendUserOperationError.js.map +1 -1
- package/_cjs/utils/getEntryPointVersion.js +8 -0
- package/_cjs/utils/getEntryPointVersion.js.map +1 -0
- package/_cjs/utils/getRequiredPrefund.js +19 -6
- package/_cjs/utils/getRequiredPrefund.js.map +1 -1
- package/_cjs/utils/getUserOperationHash.js +81 -17
- package/_cjs/utils/getUserOperationHash.js.map +1 -1
- package/_cjs/utils/index.js +5 -1
- package/_cjs/utils/index.js.map +1 -1
- package/_cjs/utils/providerToSmartAccountSigner.js +1 -1
- package/_cjs/utils/providerToSmartAccountSigner.js.map +1 -1
- package/_cjs/utils/signUserOperationHashWithECDSA.js +2 -2
- package/_cjs/utils/signUserOperationHashWithECDSA.js.map +1 -1
- package/_esm/accounts/biconomy/privateKeyToBiconomySmartAccount.js.map +1 -1
- package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js +32 -15
- package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js.map +1 -1
- package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js +38 -21
- package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -1
- package/_esm/accounts/safe/privateKeyToSafeSmartAccount.js.map +1 -1
- package/_esm/accounts/safe/signerToSafeSmartAccount.js +42 -11
- package/_esm/accounts/safe/signerToSafeSmartAccount.js.map +1 -1
- package/_esm/accounts/simple/privateKeyToSimpleSmartAccount.js.map +1 -1
- package/_esm/accounts/simple/signerToSimpleSmartAccount.js +105 -44
- package/_esm/accounts/simple/signerToSimpleSmartAccount.js.map +1 -1
- package/_esm/accounts/types.js +0 -1
- package/_esm/accounts/types.js.map +1 -1
- package/_esm/actions/bundler/chainId.js.map +1 -1
- package/_esm/actions/bundler/estimateUserOperationGas.js +20 -3
- package/_esm/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_esm/actions/bundler/getUserOperationByHash.js +28 -11
- package/_esm/actions/bundler/getUserOperationByHash.js.map +1 -1
- package/_esm/actions/bundler/getUserOperationReceipt.js.map +1 -1
- package/_esm/actions/bundler/sendUserOperation.js.map +1 -1
- package/_esm/actions/bundler/supportedEntryPoints.js.map +1 -1
- package/_esm/actions/pimlico/getUserOperationGasPrice.js +7 -7
- package/_esm/actions/pimlico/getUserOperationGasPrice.js.map +1 -1
- package/_esm/actions/pimlico/sponsorUserOperation.js +19 -7
- package/_esm/actions/pimlico/sponsorUserOperation.js.map +1 -1
- package/_esm/actions/pimlico/validateSponsorshipPolicies.js.map +1 -1
- package/_esm/actions/public/getAccountNonce.js.map +1 -1
- package/_esm/actions/public/getSenderAddress.js +6 -3
- package/_esm/actions/public/getSenderAddress.js.map +1 -1
- package/_esm/actions/smartAccount/deployContract.js +3 -4
- package/_esm/actions/smartAccount/deployContract.js.map +1 -1
- package/_esm/actions/smartAccount/prepareUserOperationRequest.js +142 -19
- package/_esm/actions/smartAccount/prepareUserOperationRequest.js.map +1 -1
- package/_esm/actions/smartAccount/sendTransaction.js +3 -4
- package/_esm/actions/smartAccount/sendTransaction.js.map +1 -1
- package/_esm/actions/smartAccount/sendTransactions.js +3 -4
- package/_esm/actions/smartAccount/sendTransactions.js.map +1 -1
- package/_esm/actions/smartAccount/sendUserOperation.js +1 -1
- package/_esm/actions/smartAccount/sendUserOperation.js.map +1 -1
- package/_esm/actions/smartAccount/signMessage.js.map +1 -1
- package/_esm/actions/smartAccount/signTypedData.js.map +1 -1
- package/_esm/actions/smartAccount/writeContract.js.map +1 -1
- package/_esm/actions/stackup/accounts.js +2 -2
- package/_esm/actions/stackup/accounts.js.map +1 -1
- package/_esm/actions/stackup/sponsorUserOperation.js +20 -12
- package/_esm/actions/stackup/sponsorUserOperation.js.map +1 -1
- package/_esm/clients/createBundlerClient.js +1 -1
- package/_esm/clients/createBundlerClient.js.map +1 -1
- package/_esm/clients/createSmartAccountClient.js +22 -3
- package/_esm/clients/createSmartAccountClient.js.map +1 -1
- package/_esm/clients/decorators/bundler.js +6 -3
- package/_esm/clients/decorators/bundler.js.map +1 -1
- package/_esm/clients/decorators/pimlico.js +6 -3
- package/_esm/clients/decorators/pimlico.js.map +1 -1
- package/_esm/clients/decorators/smartAccount.js +7 -7
- package/_esm/clients/decorators/smartAccount.js.map +1 -1
- package/_esm/clients/decorators/stackup.js.map +1 -1
- package/_esm/clients/pimlico.js +4 -2
- package/_esm/clients/pimlico.js.map +1 -1
- package/_esm/clients/stackup.js +3 -1
- package/_esm/clients/stackup.js.map +1 -1
- package/_esm/errors/estimateUserOperationGas.js.map +1 -1
- package/_esm/errors/sendUserOperation.js.map +1 -1
- package/_esm/types/entrypoint.js +2 -0
- package/_esm/types/entrypoint.js.map +1 -0
- package/_esm/utils/errors/getBundlerError.js.map +1 -1
- package/_esm/utils/errors/getEstimateUserOperationGasError.js.map +1 -1
- package/_esm/utils/errors/getSendUserOperationError.js.map +1 -1
- package/_esm/utils/getEntryPointVersion.js +4 -0
- package/_esm/utils/getEntryPointVersion.js.map +1 -0
- package/_esm/utils/getRequiredPrefund.js +19 -6
- package/_esm/utils/getRequiredPrefund.js.map +1 -1
- package/_esm/utils/getUserOperationHash.js +82 -18
- package/_esm/utils/getUserOperationHash.js.map +1 -1
- package/_esm/utils/index.js +2 -1
- package/_esm/utils/index.js.map +1 -1
- package/_esm/utils/providerToSmartAccountSigner.js +1 -1
- package/_esm/utils/providerToSmartAccountSigner.js.map +1 -1
- package/_esm/utils/signUserOperationHashWithECDSA.js +2 -3
- package/_esm/utils/signUserOperationHashWithECDSA.js.map +1 -1
- package/_types/accounts/biconomy/privateKeyToBiconomySmartAccount.d.ts +4 -4
- package/_types/accounts/biconomy/privateKeyToBiconomySmartAccount.d.ts.map +1 -1
- package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts +5 -4
- package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts.map +1 -1
- package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts +5 -4
- package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts.map +1 -1
- package/_types/accounts/safe/privateKeyToSafeSmartAccount.d.ts +4 -4
- package/_types/accounts/safe/privateKeyToSafeSmartAccount.d.ts.map +1 -1
- package/_types/accounts/safe/signerToSafeSmartAccount.d.ts +6 -5
- package/_types/accounts/safe/signerToSafeSmartAccount.d.ts.map +1 -1
- package/_types/accounts/simple/privateKeyToSimpleSmartAccount.d.ts +4 -4
- package/_types/accounts/simple/privateKeyToSimpleSmartAccount.d.ts.map +1 -1
- package/_types/accounts/simple/signerToSimpleSmartAccount.d.ts +5 -4
- package/_types/accounts/simple/signerToSimpleSmartAccount.d.ts.map +1 -1
- package/_types/accounts/types.d.ts +8 -5
- package/_types/accounts/types.d.ts.map +1 -1
- package/_types/actions/bundler/chainId.d.ts +2 -1
- package/_types/actions/bundler/chainId.d.ts.map +1 -1
- package/_types/actions/bundler/estimateUserOperationGas.d.ts +14 -7
- package/_types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -1
- package/_types/actions/bundler/getUserOperationByHash.d.ts +10 -3
- package/_types/actions/bundler/getUserOperationByHash.d.ts.map +1 -1
- package/_types/actions/bundler/getUserOperationReceipt.d.ts +2 -1
- package/_types/actions/bundler/getUserOperationReceipt.d.ts.map +1 -1
- package/_types/actions/bundler/sendUserOperation.d.ts +6 -5
- package/_types/actions/bundler/sendUserOperation.d.ts.map +1 -1
- package/_types/actions/bundler/supportedEntryPoints.d.ts +3 -2
- package/_types/actions/bundler/supportedEntryPoints.d.ts.map +1 -1
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts.map +1 -1
- package/_types/actions/pimlico/sponsorUserOperation.d.ts +47 -6
- package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -1
- package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts +10 -5
- package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts.map +1 -1
- package/_types/actions/public/getAccountNonce.d.ts +2 -1
- package/_types/actions/public/getAccountNonce.d.ts.map +1 -1
- package/_types/actions/public/getSenderAddress.d.ts +11 -3
- package/_types/actions/public/getSenderAddress.d.ts.map +1 -1
- package/_types/actions/smartAccount/deployContract.d.ts +4 -3
- package/_types/actions/smartAccount/deployContract.d.ts.map +1 -1
- package/_types/actions/smartAccount/prepareUserOperationRequest.d.ts +21 -11
- package/_types/actions/smartAccount/prepareUserOperationRequest.d.ts.map +1 -1
- package/_types/actions/smartAccount/sendTransaction.d.ts +4 -3
- package/_types/actions/smartAccount/sendTransaction.d.ts.map +1 -1
- package/_types/actions/smartAccount/sendTransactions.d.ts +5 -4
- package/_types/actions/smartAccount/sendTransactions.d.ts.map +1 -1
- package/_types/actions/smartAccount/sendUserOperation.d.ts +6 -5
- package/_types/actions/smartAccount/sendUserOperation.d.ts.map +1 -1
- package/_types/actions/smartAccount/signMessage.d.ts +2 -1
- package/_types/actions/smartAccount/signMessage.d.ts.map +1 -1
- package/_types/actions/smartAccount/signTypedData.d.ts +3 -2
- package/_types/actions/smartAccount/signTypedData.d.ts.map +1 -1
- package/_types/actions/smartAccount/writeContract.d.ts +4 -3
- package/_types/actions/smartAccount/writeContract.d.ts.map +1 -1
- package/_types/actions/smartAccount.d.ts +2 -2
- package/_types/actions/smartAccount.d.ts.map +1 -1
- package/_types/actions/stackup/accounts.d.ts +4 -3
- package/_types/actions/stackup/accounts.d.ts.map +1 -1
- package/_types/actions/stackup/sponsorUserOperation.d.ts +6 -6
- package/_types/actions/stackup/sponsorUserOperation.d.ts.map +1 -1
- package/_types/clients/createBundlerClient.d.ts +6 -3
- package/_types/clients/createBundlerClient.d.ts.map +1 -1
- package/_types/clients/createSmartAccountClient.d.ts +9 -5
- package/_types/clients/createSmartAccountClient.d.ts.map +1 -1
- package/_types/clients/decorators/bundler.d.ts +7 -7
- package/_types/clients/decorators/bundler.d.ts.map +1 -1
- package/_types/clients/decorators/pimlico.d.ts +6 -5
- package/_types/clients/decorators/pimlico.d.ts.map +1 -1
- package/_types/clients/decorators/smartAccount.d.ts +12 -12
- package/_types/clients/decorators/smartAccount.d.ts.map +1 -1
- package/_types/clients/decorators/stackup.d.ts +5 -4
- package/_types/clients/decorators/stackup.d.ts.map +1 -1
- package/_types/clients/pimlico.d.ts +11 -6
- package/_types/clients/pimlico.d.ts.map +1 -1
- package/_types/clients/stackup.d.ts +6 -3
- package/_types/clients/stackup.d.ts.map +1 -1
- package/_types/errors/estimateUserOperationGas.d.ts +4 -3
- package/_types/errors/estimateUserOperationGas.d.ts.map +1 -1
- package/_types/errors/sendUserOperation.d.ts +4 -3
- package/_types/errors/sendUserOperation.d.ts.map +1 -1
- package/_types/types/bundler.d.ts +16 -21
- package/_types/types/bundler.d.ts.map +1 -1
- package/_types/types/entrypoint.d.ts +6 -0
- package/_types/types/entrypoint.d.ts.map +1 -0
- package/_types/types/index.d.ts +6 -4
- package/_types/types/index.d.ts.map +1 -1
- package/_types/types/pimlico.d.ts +20 -6
- package/_types/types/pimlico.d.ts.map +1 -1
- package/_types/types/stackup.d.ts +18 -4
- package/_types/types/stackup.d.ts.map +1 -1
- package/_types/types/userOperation.d.ts +51 -2
- package/_types/types/userOperation.d.ts.map +1 -1
- package/_types/utils/errors/getBundlerError.d.ts +4 -4
- package/_types/utils/errors/getBundlerError.d.ts.map +1 -1
- package/_types/utils/errors/getEstimateUserOperationGasError.d.ts +3 -2
- package/_types/utils/errors/getEstimateUserOperationGasError.d.ts.map +1 -1
- package/_types/utils/errors/getSendUserOperationError.d.ts +2 -1
- package/_types/utils/errors/getSendUserOperationError.d.ts.map +1 -1
- package/_types/utils/getEntryPointVersion.d.ts +6 -0
- package/_types/utils/getEntryPointVersion.d.ts.map +1 -0
- package/_types/utils/getRequiredPrefund.d.ts +5 -4
- package/_types/utils/getRequiredPrefund.d.ts.map +1 -1
- package/_types/utils/getUserOperationHash.d.ts +6 -5
- package/_types/utils/getUserOperationHash.d.ts.map +1 -1
- package/_types/utils/index.d.ts +2 -1
- package/_types/utils/index.d.ts.map +1 -1
- package/_types/utils/providerToSmartAccountSigner.d.ts +4 -1
- package/_types/utils/providerToSmartAccountSigner.d.ts.map +1 -1
- package/_types/utils/signUserOperationHashWithECDSA.d.ts +6 -6
- package/_types/utils/signUserOperationHashWithECDSA.d.ts.map +1 -1
- package/accounts/biconomy/privateKeyToBiconomySmartAccount.ts +17 -6
- package/accounts/biconomy/signerToBiconomySmartAccount.ts +50 -21
- package/accounts/kernel/signerToEcdsaKernelSmartAccount.ts +64 -30
- package/accounts/safe/privateKeyToSafeSmartAccount.ts +8 -5
- package/accounts/safe/signerToSafeSmartAccount.ts +57 -17
- package/accounts/simple/privateKeyToSimpleSmartAccount.ts +25 -7
- package/accounts/simple/signerToSimpleSmartAccount.ts +127 -56
- package/accounts/types.ts +12 -4
- package/actions/bundler/chainId.ts +3 -1
- package/actions/bundler/estimateUserOperationGas.ts +77 -22
- package/actions/bundler/getUserOperationByHash.ts +44 -15
- package/actions/bundler/getUserOperationReceipt.ts +3 -1
- package/actions/bundler/sendUserOperation.ts +13 -17
- package/actions/bundler/supportedEntryPoints.ts +5 -3
- package/actions/pimlico/getUserOperationGasPrice.ts +7 -9
- package/actions/pimlico/sponsorUserOperation.ts +97 -23
- package/actions/pimlico/validateSponsorshipPolicies.ts +18 -7
- package/actions/public/getAccountNonce.ts +2 -1
- package/actions/public/getSenderAddress.ts +30 -5
- package/actions/smartAccount/deployContract.ts +14 -10
- package/actions/smartAccount/prepareUserOperationRequest.ts +339 -49
- package/actions/smartAccount/sendTransaction.ts +20 -11
- package/actions/smartAccount/sendTransactions.ts +17 -11
- package/actions/smartAccount/sendUserOperation.ts +56 -23
- package/actions/smartAccount/signMessage.ts +3 -1
- package/actions/smartAccount/signTypedData.ts +3 -1
- package/actions/smartAccount/writeContract.ts +12 -5
- package/actions/smartAccount.ts +2 -2
- package/actions/stackup/accounts.ts +7 -6
- package/actions/stackup/sponsorUserOperation.ts +85 -31
- package/clients/createBundlerClient.ts +11 -6
- package/clients/createSmartAccountClient.ts +34 -20
- package/clients/decorators/bundler.ts +51 -27
- package/clients/decorators/pimlico.ts +43 -17
- package/clients/decorators/smartAccount.ts +115 -37
- package/clients/decorators/stackup.ts +14 -10
- package/clients/pimlico.ts +22 -13
- package/clients/stackup.ts +13 -7
- package/errors/estimateUserOperationGas.ts +7 -4
- package/errors/sendUserOperation.ts +9 -5
- package/package.json +1 -1
- package/types/bundler.ts +40 -28
- package/types/entrypoint.ts +13 -0
- package/types/index.ts +15 -5
- package/types/pimlico.ts +43 -17
- package/types/stackup.ts +39 -15
- package/types/userOperation.ts +82 -26
- package/utils/errors/getBundlerError.ts +10 -6
- package/utils/errors/getEstimateUserOperationGasError.ts +13 -10
- package/utils/errors/getSendUserOperationError.ts +4 -3
- package/utils/getEntryPointVersion.ts +15 -0
- package/utils/getRequiredPrefund.ts +35 -11
- package/utils/getUserOperationHash.ts +113 -23
- package/utils/index.ts +9 -1
- package/utils/providerToSmartAccountSigner.ts +6 -3
- package/utils/signUserOperationHashWithECDSA.ts +13 -7
|
@@ -6,54 +6,60 @@ const accounts_1 = require("viem/accounts");
|
|
|
6
6
|
const actions_1 = require("viem/actions");
|
|
7
7
|
const getAccountNonce_1 = require("../../actions/public/getAccountNonce.js");
|
|
8
8
|
const getSenderAddress_1 = require("../../actions/public/getSenderAddress.js");
|
|
9
|
+
const utils_1 = require("../../utils/index.js");
|
|
9
10
|
const getUserOperationHash_1 = require("../../utils/getUserOperationHash.js");
|
|
10
11
|
const isSmartAccountDeployed_1 = require("../../utils/isSmartAccountDeployed.js");
|
|
11
12
|
const types_1 = require("../types.js");
|
|
12
|
-
const getAccountInitCode = async (
|
|
13
|
+
const getAccountInitCode = async (owner, index = 0n) => {
|
|
13
14
|
if (!owner)
|
|
14
15
|
throw new Error("Owner account not found");
|
|
15
|
-
return (0, viem_1.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
args: [owner, index]
|
|
46
|
-
})
|
|
47
|
-
]);
|
|
16
|
+
return (0, viem_1.encodeFunctionData)({
|
|
17
|
+
abi: [
|
|
18
|
+
{
|
|
19
|
+
inputs: [
|
|
20
|
+
{
|
|
21
|
+
internalType: "address",
|
|
22
|
+
name: "owner",
|
|
23
|
+
type: "address"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
internalType: "uint256",
|
|
27
|
+
name: "salt",
|
|
28
|
+
type: "uint256"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
name: "createAccount",
|
|
32
|
+
outputs: [
|
|
33
|
+
{
|
|
34
|
+
internalType: "contract SimpleAccount",
|
|
35
|
+
name: "ret",
|
|
36
|
+
type: "address"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
stateMutability: "nonpayable",
|
|
40
|
+
type: "function"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
functionName: "createAccount",
|
|
44
|
+
args: [owner, index]
|
|
45
|
+
});
|
|
48
46
|
};
|
|
49
|
-
const getAccountAddress = async ({ client, factoryAddress, entryPoint, owner, index = 0n }) => {
|
|
50
|
-
const
|
|
47
|
+
const getAccountAddress = async ({ client, factoryAddress, entryPoint: entryPointAddress, owner, index = 0n }) => {
|
|
48
|
+
const entryPointVersion = (0, utils_1.getEntryPointVersion)(entryPointAddress);
|
|
49
|
+
const factoryData = await getAccountInitCode(owner, index);
|
|
50
|
+
if (entryPointVersion === "v0.6") {
|
|
51
|
+
return (0, getSenderAddress_1.getSenderAddress)(client, {
|
|
52
|
+
initCode: (0, viem_1.concatHex)([factoryAddress, factoryData]),
|
|
53
|
+
entryPoint: entryPointAddress
|
|
54
|
+
});
|
|
55
|
+
}
|
|
51
56
|
return (0, getSenderAddress_1.getSenderAddress)(client, {
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
factory: factoryAddress,
|
|
58
|
+
factoryData,
|
|
59
|
+
entryPoint: entryPointAddress
|
|
54
60
|
});
|
|
55
61
|
};
|
|
56
|
-
async function signerToSimpleSmartAccount(client, { signer, factoryAddress, entryPoint, index = 0n, address }) {
|
|
62
|
+
async function signerToSimpleSmartAccount(client, { signer, factoryAddress, entryPoint: entryPointAddress, index = 0n, address }) {
|
|
57
63
|
const viemSigner = {
|
|
58
64
|
...signer,
|
|
59
65
|
signTransaction: (_, __) => {
|
|
@@ -65,7 +71,7 @@ async function signerToSimpleSmartAccount(client, { signer, factoryAddress, entr
|
|
|
65
71
|
getAccountAddress({
|
|
66
72
|
client,
|
|
67
73
|
factoryAddress,
|
|
68
|
-
entryPoint,
|
|
74
|
+
entryPoint: entryPointAddress,
|
|
69
75
|
owner: viemSigner.address,
|
|
70
76
|
index
|
|
71
77
|
}),
|
|
@@ -93,12 +99,12 @@ async function signerToSimpleSmartAccount(client, { signer, factoryAddress, entr
|
|
|
93
99
|
...account,
|
|
94
100
|
client: client,
|
|
95
101
|
publicKey: accountAddress,
|
|
96
|
-
entryPoint:
|
|
102
|
+
entryPoint: entryPointAddress,
|
|
97
103
|
source: "SimpleSmartAccount",
|
|
98
104
|
async getNonce() {
|
|
99
105
|
return (0, getAccountNonce_1.getAccountNonce)(client, {
|
|
100
106
|
sender: accountAddress,
|
|
101
|
-
entryPoint:
|
|
107
|
+
entryPoint: entryPointAddress
|
|
102
108
|
});
|
|
103
109
|
},
|
|
104
110
|
async signUserOperation(userOperation) {
|
|
@@ -106,7 +112,7 @@ async function signerToSimpleSmartAccount(client, { signer, factoryAddress, entr
|
|
|
106
112
|
message: {
|
|
107
113
|
raw: (0, getUserOperationHash_1.getUserOperationHash)({
|
|
108
114
|
userOperation,
|
|
109
|
-
entryPoint:
|
|
115
|
+
entryPoint: entryPointAddress,
|
|
110
116
|
chainId: chainId
|
|
111
117
|
})
|
|
112
118
|
}
|
|
@@ -118,7 +124,26 @@ async function signerToSimpleSmartAccount(client, { signer, factoryAddress, entr
|
|
|
118
124
|
smartAccountDeployed = await (0, isSmartAccountDeployed_1.isSmartAccountDeployed)(client, accountAddress);
|
|
119
125
|
if (smartAccountDeployed)
|
|
120
126
|
return "0x";
|
|
121
|
-
return
|
|
127
|
+
return (0, viem_1.concatHex)([
|
|
128
|
+
factoryAddress,
|
|
129
|
+
await getAccountInitCode(viemSigner.address, index)
|
|
130
|
+
]);
|
|
131
|
+
},
|
|
132
|
+
async getFactory() {
|
|
133
|
+
if (smartAccountDeployed)
|
|
134
|
+
return undefined;
|
|
135
|
+
smartAccountDeployed = await (0, isSmartAccountDeployed_1.isSmartAccountDeployed)(client, accountAddress);
|
|
136
|
+
if (smartAccountDeployed)
|
|
137
|
+
return undefined;
|
|
138
|
+
return factoryAddress;
|
|
139
|
+
},
|
|
140
|
+
async getFactoryData() {
|
|
141
|
+
if (smartAccountDeployed)
|
|
142
|
+
return undefined;
|
|
143
|
+
smartAccountDeployed = await (0, isSmartAccountDeployed_1.isSmartAccountDeployed)(client, accountAddress);
|
|
144
|
+
if (smartAccountDeployed)
|
|
145
|
+
return undefined;
|
|
146
|
+
return getAccountInitCode(viemSigner.address, index);
|
|
122
147
|
},
|
|
123
148
|
async encodeDeployCallData(_) {
|
|
124
149
|
throw new Error("Simple account doesn't support account deployment");
|
|
@@ -126,6 +151,35 @@ async function signerToSimpleSmartAccount(client, { signer, factoryAddress, entr
|
|
|
126
151
|
async encodeCallData(args) {
|
|
127
152
|
if (Array.isArray(args)) {
|
|
128
153
|
const argsArray = args;
|
|
154
|
+
if ((0, utils_1.getEntryPointVersion)(entryPointAddress) === "v0.6") {
|
|
155
|
+
return (0, viem_1.encodeFunctionData)({
|
|
156
|
+
abi: [
|
|
157
|
+
{
|
|
158
|
+
inputs: [
|
|
159
|
+
{
|
|
160
|
+
internalType: "address[]",
|
|
161
|
+
name: "dest",
|
|
162
|
+
type: "address[]"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
internalType: "bytes[]",
|
|
166
|
+
name: "func",
|
|
167
|
+
type: "bytes[]"
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
name: "executeBatch",
|
|
171
|
+
outputs: [],
|
|
172
|
+
stateMutability: "nonpayable",
|
|
173
|
+
type: "function"
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
functionName: "executeBatch",
|
|
177
|
+
args: [
|
|
178
|
+
argsArray.map((a) => a.to),
|
|
179
|
+
argsArray.map((a) => a.data)
|
|
180
|
+
]
|
|
181
|
+
});
|
|
182
|
+
}
|
|
129
183
|
return (0, viem_1.encodeFunctionData)({
|
|
130
184
|
abi: [
|
|
131
185
|
{
|
|
@@ -135,6 +189,11 @@ async function signerToSimpleSmartAccount(client, { signer, factoryAddress, entr
|
|
|
135
189
|
name: "dest",
|
|
136
190
|
type: "address[]"
|
|
137
191
|
},
|
|
192
|
+
{
|
|
193
|
+
internalType: "uint256[]",
|
|
194
|
+
name: "value",
|
|
195
|
+
type: "uint256[]"
|
|
196
|
+
},
|
|
138
197
|
{
|
|
139
198
|
internalType: "bytes[]",
|
|
140
199
|
name: "func",
|
|
@@ -150,6 +209,7 @@ async function signerToSimpleSmartAccount(client, { signer, factoryAddress, entr
|
|
|
150
209
|
functionName: "executeBatch",
|
|
151
210
|
args: [
|
|
152
211
|
argsArray.map((a) => a.to),
|
|
212
|
+
argsArray.map((a) => a.value),
|
|
153
213
|
argsArray.map((a) => a.data)
|
|
154
214
|
]
|
|
155
215
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signerToSimpleSmartAccount.js","sourceRoot":"","sources":["../../../accounts/simple/signerToSimpleSmartAccount.ts"],"names":[],"mappings":";;;AACA,+BAUa;AACb,4CAAyC;AACzC,0CAAqE;AACrE,0EAAsE;AACtE,4EAAwE;
|
|
1
|
+
{"version":3,"file":"signerToSimpleSmartAccount.js","sourceRoot":"","sources":["../../../accounts/simple/signerToSimpleSmartAccount.ts"],"names":[],"mappings":";;;AACA,+BAUa;AACb,4CAAyC;AACzC,0CAAqE;AACrE,0EAAsE;AACtE,4EAAwE;AAOxE,uCAAkD;AAClD,2EAAuE;AACvE,+EAA2E;AAC3E,oCAIiB;AAQjB,MAAM,kBAAkB,GAAG,KAAK,EAAE,KAAc,EAAE,KAAK,GAAG,EAAE,EAAgB,EAAE;IAC1E,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAA;IAEtD,OAAO,IAAA,yBAAkB,EAAC;QACtB,GAAG,EAAE;YACD;gBACI,MAAM,EAAE;oBACJ;wBACI,YAAY,EAAE,SAAS;wBACvB,IAAI,EAAE,OAAO;wBACb,IAAI,EAAE,SAAS;qBAClB;oBACD;wBACI,YAAY,EAAE,SAAS;wBACvB,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,SAAS;qBAClB;iBACJ;gBACD,IAAI,EAAE,eAAe;gBACrB,OAAO,EAAE;oBACL;wBACI,YAAY,EAAE,wBAAwB;wBACtC,IAAI,EAAE,KAAK;wBACX,IAAI,EAAE,SAAS;qBAClB;iBACJ;gBACD,eAAe,EAAE,YAAY;gBAC7B,IAAI,EAAE,UAAU;aACnB;SACJ;QACD,YAAY,EAAE,eAAe;QAC7B,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;KACvB,CAAC,CAAA;AACN,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,KAAK,EAI7B,EACE,MAAM,EACN,cAAc,EACd,UAAU,EAAE,iBAAiB,EAC7B,KAAK,EACL,KAAK,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;YAED,OAAO,IAAA,yBAAkB,EAAC;gBACtB,GAAG,EAAE;oBACD;wBACI,MAAM,EAAE;4BACJ;gCACI,YAAY,EAAE,SAAS;gCACvB,IAAI,EAAE,MAAM;gCACZ,IAAI,EAAE,SAAS;6BAClB;4BACD;gCACI,YAAY,EAAE,SAAS;gCACvB,IAAI,EAAE,OAAO;gCACb,IAAI,EAAE,SAAS;6BAClB;4BACD;gCACI,YAAY,EAAE,OAAO;gCACrB,IAAI,EAAE,MAAM;gCACZ,IAAI,EAAE,OAAO;6BAChB;yBACJ;wBACD,IAAI,EAAE,SAAS;wBACf,OAAO,EAAE,EAAE;wBACX,eAAe,EAAE,YAAY;wBAC7B,IAAI,EAAE,UAAU;qBACnB;iBACJ;gBACD,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC;aAC1B,CAAC,CAAA;QACN,CAAC;QACD,KAAK,CAAC,iBAAiB,CAAC,cAAc;YAClC,OAAO,sIAAsI,CAAA;QACjJ,CAAC;KACJ,CAAA;AACL,CAAC;AA7OD,gEA6OC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../accounts/types.ts"],"names":[],"mappings":";;;AAAA,+BAOa;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../accounts/types.ts"],"names":[],"mappings":";;;AAAA,+BAOa;AAKb,MAAa,yCAA0C,SAAQ,gBAAS;IAEpE,YAAY,EAAE,QAAQ,KAA4B,EAAE;QAChD,KAAK,CACD;YACI,6FAA6F;YAC7F,qCAAqC;SACxC,CAAC,IAAI,CAAC,IAAI,CAAC,EACZ;YACI,QAAQ;YACR,QAAQ,EAAE,SAAS;SACtB,CACJ,CAAA;QAXI;;;;mBAAO,2CAA2C;WAAA;IAY3D,CAAC;CACJ;AAdD,8FAcC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chainId.js","sourceRoot":"","sources":["../../../actions/bundler/chainId.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"chainId.js","sourceRoot":"","sources":["../../../actions/bundler/chainId.ts"],"names":[],"mappings":";;;AA2BO,MAAM,OAAO,GAAG,KAAK,EAMxB,MAA0E,EAC5E,EAAE;IACA,OAAO,MAAM,CACT,MAAM,MAAM,CAAC,OAAO,CAAC;QACjB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,EAAE;KACb,CAAC,CACL,CAAA;AACL,CAAC,CAAA;AAdY,QAAA,OAAO,WAcnB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.estimateUserOperationGas = void 0;
|
|
4
|
+
const utils_1 = require("../../utils/index.js");
|
|
4
5
|
const deepHexlify_1 = require("../../utils/deepHexlify.js");
|
|
5
6
|
const getEstimateUserOperationGasError_1 = require("../../utils/errors/getEstimateUserOperationGasError.js");
|
|
6
7
|
const estimateUserOperationGas = async (client, args, stateOverrides) => {
|
|
@@ -18,10 +19,26 @@ const estimateUserOperationGas = async (client, args, stateOverrides) => {
|
|
|
18
19
|
]
|
|
19
20
|
: [userOperationWithBigIntAsHex, entryPoint]
|
|
20
21
|
});
|
|
22
|
+
const entryPointVersion = (0, utils_1.getEntryPointVersion)(entryPoint);
|
|
23
|
+
if (entryPointVersion === "v0.6") {
|
|
24
|
+
const responseV06 = response;
|
|
25
|
+
return {
|
|
26
|
+
preVerificationGas: BigInt(responseV06.preVerificationGas || 0),
|
|
27
|
+
verificationGasLimit: BigInt(responseV06.verificationGasLimit || 0),
|
|
28
|
+
callGasLimit: BigInt(responseV06.callGasLimit || 0)
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const responseV07 = response;
|
|
21
32
|
return {
|
|
22
|
-
preVerificationGas: BigInt(
|
|
23
|
-
verificationGasLimit: BigInt(
|
|
24
|
-
callGasLimit: BigInt(
|
|
33
|
+
preVerificationGas: BigInt(responseV07.preVerificationGas || 0),
|
|
34
|
+
verificationGasLimit: BigInt(responseV07.verificationGasLimit || 0),
|
|
35
|
+
callGasLimit: BigInt(responseV07.callGasLimit || 0),
|
|
36
|
+
paymasterVerificationGasLimit: responseV07.paymasterVerificationGasLimit
|
|
37
|
+
? BigInt(responseV07.paymasterVerificationGasLimit)
|
|
38
|
+
: undefined,
|
|
39
|
+
paymasterPostOpGasLimit: responseV07.paymasterPostOpGasLimit
|
|
40
|
+
? BigInt(responseV07.paymasterPostOpGasLimit)
|
|
41
|
+
: undefined
|
|
25
42
|
};
|
|
26
43
|
}
|
|
27
44
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"estimateUserOperationGas.js","sourceRoot":"","sources":["../../../actions/bundler/estimateUserOperationGas.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"estimateUserOperationGas.js","sourceRoot":"","sources":["../../../actions/bundler/estimateUserOperationGas.ts"],"names":[],"mappings":";;;AAcA,uCAAkD;AAClD,yDAAqD;AACrD,0GAG4D;AAiErD,MAAM,wBAAwB,GAAG,KAAK,EAMzC,MAA0E,EAC1E,IAA8D,EAC9D,cAA+B,EACwB,EAAE;IACzD,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAE1C,MAAM,4BAA4B,GAAG,IAAA,yBAAW,EAAC,aAAa,CAAC,CAAA;IAC/D,MAAM,6BAA6B,GAAG,IAAA,yBAAW,EAAC,cAAc,CAAC,CAAA;IAEjE,IAAI,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;YAClC,MAAM,EAAE,8BAA8B;YACtC,MAAM,EAAE,cAAc;gBAClB,CAAC,CAAC;oBACI,4BAA4B;oBAC5B,UAAU;oBACV,6BAA6B;iBAChC;gBACH,CAAC,CAAC,CAAC,4BAA4B,EAAE,UAAU,CAAC;SACnD,CAAC,CAAA;QAEF,MAAM,iBAAiB,GAAG,IAAA,4BAAoB,EAAC,UAAU,CAAC,CAAA;QAE1D,IAAI,iBAAiB,KAAK,MAAM,EAAE,CAAC;YAC/B,MAAM,WAAW,GAAG,QAInB,CAAA;YAED,OAAO;gBACH,kBAAkB,EAAE,MAAM,CAAC,WAAW,CAAC,kBAAkB,IAAI,CAAC,CAAC;gBAC/D,oBAAoB,EAAE,MAAM,CACxB,WAAW,CAAC,oBAAoB,IAAI,CAAC,CACxC;gBACD,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY,IAAI,CAAC,CAAC;aACJ,CAAA;QACvD,CAAC;QAED,MAAM,WAAW,GAAG,QAMnB,CAAA;QAED,OAAO;YACH,kBAAkB,EAAE,MAAM,CAAC,WAAW,CAAC,kBAAkB,IAAI,CAAC,CAAC;YAC/D,oBAAoB,EAAE,MAAM,CAAC,WAAW,CAAC,oBAAoB,IAAI,CAAC,CAAC;YACnE,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY,IAAI,CAAC,CAAC;YACnD,6BAA6B,EACzB,WAAW,CAAC,6BAA6B;gBACrC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,6BAA6B,CAAC;gBACnD,CAAC,CAAC,SAAS;YACnB,uBAAuB,EAAE,WAAW,CAAC,uBAAuB;gBACxD,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,uBAAuB,CAAC;gBAC7C,CAAC,CAAC,SAAS;SACgC,CAAA;IACvD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,MAAM,IAAA,mEAAgC,EAAC,GAAgB,EAAE,IAAI,CAAC,CAAA;IAClE,CAAC;AACL,CAAC,CAAA;AApEY,QAAA,wBAAwB,4BAoEpC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getUserOperationByHash = void 0;
|
|
4
|
+
const getEntryPointVersion_1 = require("../../utils/getEntryPointVersion.js");
|
|
4
5
|
const getUserOperationByHash = async (client, { hash }) => {
|
|
5
6
|
const params = [hash];
|
|
6
7
|
const response = await client.request({
|
|
@@ -9,18 +10,34 @@ const getUserOperationByHash = async (client, { hash }) => {
|
|
|
9
10
|
});
|
|
10
11
|
if (!response)
|
|
11
12
|
return null;
|
|
12
|
-
const { userOperation, entryPoint, transactionHash, blockHash, blockNumber } = response;
|
|
13
|
+
const { userOperation, entryPoint: entryPointAddress, transactionHash, blockHash, blockNumber } = response;
|
|
13
14
|
return {
|
|
14
|
-
userOperation:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
userOperation: (entryPointAddress === getEntryPointVersion_1.ENTRYPOINT_ADDRESS_V06
|
|
16
|
+
? {
|
|
17
|
+
...userOperation,
|
|
18
|
+
nonce: BigInt(userOperation.nonce),
|
|
19
|
+
callGasLimit: BigInt(userOperation.callGasLimit),
|
|
20
|
+
verificationGasLimit: BigInt(userOperation.verificationGasLimit),
|
|
21
|
+
preVerificationGas: BigInt(userOperation.preVerificationGas),
|
|
22
|
+
maxFeePerGas: BigInt(userOperation.maxFeePerGas),
|
|
23
|
+
maxPriorityFeePerGas: BigInt(userOperation.maxPriorityFeePerGas)
|
|
24
|
+
}
|
|
25
|
+
: {
|
|
26
|
+
...userOperation,
|
|
27
|
+
nonce: BigInt(userOperation.nonce),
|
|
28
|
+
callGasLimit: BigInt(userOperation.callGasLimit),
|
|
29
|
+
verificationGasLimit: BigInt(userOperation.verificationGasLimit),
|
|
30
|
+
preVerificationGas: BigInt(userOperation.preVerificationGas),
|
|
31
|
+
maxFeePerGas: BigInt(userOperation.maxFeePerGas),
|
|
32
|
+
maxPriorityFeePerGas: BigInt(userOperation.maxPriorityFeePerGas),
|
|
33
|
+
paymasterVerificationGasLimit: userOperation.paymasterVerificationGasLimit
|
|
34
|
+
? BigInt(userOperation.paymasterVerificationGasLimit)
|
|
35
|
+
: undefined,
|
|
36
|
+
paymasterPostOpGasLimit: userOperation.paymasterVerificationGasLimit
|
|
37
|
+
? BigInt(userOperation.paymasterPostOpGasLimit)
|
|
38
|
+
: undefined
|
|
39
|
+
}),
|
|
40
|
+
entryPoint: entryPointAddress,
|
|
24
41
|
transactionHash: transactionHash,
|
|
25
42
|
blockHash: blockHash,
|
|
26
43
|
blockNumber: BigInt(blockNumber)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserOperationByHash.js","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationByHash.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"getUserOperationByHash.js","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationByHash.ts"],"names":[],"mappings":";;;AAMA,2EAAyE;AAoClE,MAAM,sBAAsB,GAAG,KAAK,EAMvC,MAA0E,EAC1E,EAAE,IAAI,EAA8C,EACkB,EAAE;IACxE,MAAM,MAAM,GAAW,CAAC,IAAI,CAAC,CAAA;IAE7B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,4BAA4B;QACpC,MAAM;KACT,CAAC,CAAA;IAEF,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAA;IAE1B,MAAM,EACF,aAAa,EACb,UAAU,EAAE,iBAAiB,EAC7B,eAAe,EACf,SAAS,EACT,WAAW,EACd,GAAG,QAAQ,CAAA;IAEZ,OAAO;QACH,aAAa,EAAE,CAAC,iBAAiB,KAAK,6CAAsB;YACxD,CAAC,CAAC;gBACI,GAAG,aAAa;gBAChB,KAAK,EAAE,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC;gBAClC,YAAY,EAAE,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC;gBAChD,oBAAoB,EAAE,MAAM,CACxB,aAAa,CAAC,oBAAoB,CACrC;gBACD,kBAAkB,EAAE,MAAM,CAAC,aAAa,CAAC,kBAAkB,CAAC;gBAC5D,YAAY,EAAE,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC;gBAChD,oBAAoB,EAAE,MAAM,CACxB,aAAa,CAAC,oBAAoB,CACrC;aACJ;YACH,CAAC,CAAC;gBACI,GAAG,aAAa;gBAChB,KAAK,EAAE,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC;gBAClC,YAAY,EAAE,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC;gBAChD,oBAAoB,EAAE,MAAM,CACxB,aAAa,CAAC,oBAAoB,CACrC;gBACD,kBAAkB,EAAE,MAAM,CAAC,aAAa,CAAC,kBAAkB,CAAC;gBAC5D,YAAY,EAAE,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC;gBAChD,oBAAoB,EAAE,MAAM,CACxB,aAAa,CAAC,oBAAoB,CACrC;gBACD,6BAA6B,EACzB,aAAa,CAAC,6BAA6B;oBACvC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,6BAA6B,CAAC;oBACrD,CAAC,CAAC,SAAS;gBACnB,uBAAuB,EACnB,aAAa,CAAC,6BAA6B;oBACvC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,uBAAuB,CAAC;oBAC/C,CAAC,CAAC,SAAS;aACtB,CAAoD;QAC3D,UAAU,EAAE,iBAAiB;QAC7B,eAAe,EAAE,eAAe;QAChC,SAAS,EAAE,SAAS;QACpB,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC;KACnC,CAAA;AACL,CAAC,CAAA;AAnEY,QAAA,sBAAsB,0BAmElC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserOperationReceipt.js","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationReceipt.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"getUserOperationReceipt.js","sourceRoot":"","sources":["../../../actions/bundler/getUserOperationReceipt.ts"],"names":[],"mappings":";;;AAcA,yDAAkE;AA6D3D,MAAM,uBAAuB,GAA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AAO,CAAC,SAAS;YACrC,iBAAiB,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,iBAAiB,CAAC;SAChE;QACD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAC9B,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC;YACpC,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,eAAe,EAAE,GAAG,CAAC,eAAe;YACpC,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;YAC9B,gBAAgB,EAAE,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;YAC9C,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,MAAM,EAAE,GAAG,CAAC,MAAM;SACrB,CAAC,CAAC;KACN,CAAA;IAED,OAAO,oBAAoB,CAAA;AAC/B,CAAC,CAAA;AApDY,QAAA,uBAAuB,2BAoDnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendUserOperation.js","sourceRoot":"","sources":["../../../actions/bundler/sendUserOperation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"sendUserOperation.js","sourceRoot":"","sources":["../../../actions/bundler/sendUserOperation.ts"],"names":[],"mappings":";;;AASA,yDAAqD;AACrD,4FAAwF;AAgCjF,MAAM,iBAAiB,GAAG,KAAK,EAMlC,MAA0E,EAC1E,IAAuD,EAC1C,EAAE;IACf,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAE1C,IAAI,CAAC;QACD,MAAM,iBAAiB,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;YAC3C,MAAM,EAAE,uBAAuB;YAC/B,MAAM,EAAE;gBACJ,IAAA,yBAAW,EAAC,aAAa,CAExB;gBACD,UAAU;aACb;SACJ,CAAC,CAAA;QAEF,OAAO,iBAAiB,CAAA;IAC5B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,MAAM,IAAA,qDAAyB,EAC3B,GAAgB,EAChB,IAA+C,CAClD,CAAA;IACL,CAAC;AACL,CAAC,CAAA;AA7BY,QAAA,iBAAiB,qBA6B7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supportedEntryPoints.js","sourceRoot":"","sources":["../../../actions/bundler/supportedEntryPoints.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"supportedEntryPoints.js","sourceRoot":"","sources":["../../../actions/bundler/supportedEntryPoints.ts"],"names":[],"mappings":";;;AA2BO,MAAM,oBAAoB,GAAG,KAAK,EAMrC,MAA0E,EACrD,EAAE;IACvB,OAAO,MAAM,CAAC,OAAO,CAAC;QAClB,MAAM,EAAE,0BAA0B;QAClC,MAAM,EAAE,EAAE;KACb,CAAC,CAAA;AACN,CAAC,CAAA;AAZY,QAAA,oBAAoB,wBAYhC"}
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getUserOperationGasPrice = void 0;
|
|
4
4
|
const getUserOperationGasPrice = async (client) => {
|
|
5
|
-
const
|
|
5
|
+
const gasPrice = await client.request({
|
|
6
6
|
method: "pimlico_getUserOperationGasPrice",
|
|
7
7
|
params: []
|
|
8
8
|
});
|
|
9
9
|
return {
|
|
10
10
|
slow: {
|
|
11
|
-
maxFeePerGas: BigInt(
|
|
12
|
-
maxPriorityFeePerGas: BigInt(
|
|
11
|
+
maxFeePerGas: BigInt(gasPrice.slow.maxFeePerGas),
|
|
12
|
+
maxPriorityFeePerGas: BigInt(gasPrice.slow.maxPriorityFeePerGas)
|
|
13
13
|
},
|
|
14
14
|
standard: {
|
|
15
|
-
maxFeePerGas: BigInt(
|
|
16
|
-
maxPriorityFeePerGas: BigInt(
|
|
15
|
+
maxFeePerGas: BigInt(gasPrice.standard.maxFeePerGas),
|
|
16
|
+
maxPriorityFeePerGas: BigInt(gasPrice.standard.maxPriorityFeePerGas)
|
|
17
17
|
},
|
|
18
18
|
fast: {
|
|
19
|
-
maxFeePerGas: BigInt(
|
|
20
|
-
maxPriorityFeePerGas: BigInt(
|
|
19
|
+
maxFeePerGas: BigInt(gasPrice.fast.maxFeePerGas),
|
|
20
|
+
maxPriorityFeePerGas: BigInt(gasPrice.fast.maxPriorityFeePerGas)
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserOperationGasPrice.js","sourceRoot":"","sources":["../../../actions/pimlico/getUserOperationGasPrice.ts"],"names":[],"mappings":";;;AAwCO,MAAM,wBAAwB,GAAG,KAAK,EAKzC,MAAqE,EAChB,EAAE;IACvD,MAAM,
|
|
1
|
+
{"version":3,"file":"getUserOperationGasPrice.js","sourceRoot":"","sources":["../../../actions/pimlico/getUserOperationGasPrice.ts"],"names":[],"mappings":";;;AAwCO,MAAM,wBAAwB,GAAG,KAAK,EAKzC,MAAqE,EAChB,EAAE;IACvD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,kCAAkC;QAC1C,MAAM,EAAE,EAAE;KACb,CAAC,CAAA;IAEF,OAAO;QACH,IAAI,EAAE;YACF,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC;YAChD,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC;SACnE;QACD,QAAQ,EAAE;YACN,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC;YACpD,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,oBAAoB,CAAC;SACvE;QACD,IAAI,EAAE;YACF,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC;YAChD,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC;SACnE;KACJ,CAAA;AACL,CAAC,CAAA;AA1BY,QAAA,wBAAwB,4BA0BpC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sponsorUserOperation = void 0;
|
|
4
4
|
const deepHexlify_1 = require("../../utils/deepHexlify.js");
|
|
5
|
+
const getEntryPointVersion_1 = require("../../utils/getEntryPointVersion.js");
|
|
5
6
|
const sponsorUserOperation = async (client, args) => {
|
|
6
7
|
const response = await client.request({
|
|
7
8
|
method: "pm_sponsorUserOperation",
|
|
@@ -18,14 +19,25 @@ const sponsorUserOperation = async (client, args) => {
|
|
|
18
19
|
args.entryPoint
|
|
19
20
|
]
|
|
20
21
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
if (args.entryPoint === getEntryPointVersion_1.ENTRYPOINT_ADDRESS_V06) {
|
|
23
|
+
const responseV06 = response;
|
|
24
|
+
return {
|
|
25
|
+
paymasterAndData: responseV06.paymasterAndData,
|
|
26
|
+
preVerificationGas: BigInt(responseV06.preVerificationGas),
|
|
27
|
+
verificationGasLimit: BigInt(responseV06.verificationGasLimit),
|
|
28
|
+
callGasLimit: BigInt(responseV06.callGasLimit)
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const responseV07 = response;
|
|
32
|
+
return {
|
|
33
|
+
callGasLimit: BigInt(responseV07.callGasLimit),
|
|
34
|
+
verificationGasLimit: BigInt(responseV07.verificationGasLimit),
|
|
35
|
+
preVerificationGas: BigInt(responseV07.preVerificationGas),
|
|
36
|
+
paymaster: responseV07.paymaster,
|
|
37
|
+
paymasterVerificationGasLimit: BigInt(responseV07.paymasterVerificationGasLimit),
|
|
38
|
+
paymasterPostOpGasLimit: BigInt(responseV07.paymasterPostOpGasLimit),
|
|
39
|
+
paymasterData: responseV07.paymasterData
|
|
27
40
|
};
|
|
28
|
-
return userOperation;
|
|
29
41
|
};
|
|
30
42
|
exports.sponsorUserOperation = sponsorUserOperation;
|
|
31
43
|
//# sourceMappingURL=sponsorUserOperation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/pimlico/sponsorUserOperation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/pimlico/sponsorUserOperation.ts"],"names":[],"mappings":";;;AAaA,yDAAqD;AACrD,2EAAyE;AAmElE,MAAM,oBAAoB,GAAG,KAAK,EAMrC,MAKC,EACD,IAAiE,EACJ,EAAE;IAC/D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,yBAAyB;QACjC,MAAM,EAAE,IAAI,CAAC,mBAAmB;YAC5B,CAAC,CAAC;gBACI,IAAA,yBAAW,EACP,IAAI,CAAC,aAAa,CAGrB;gBACD,IAAI,CAAC,UAAU;gBACf;oBACI,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;iBAChD;aACJ;YACH,CAAC,CAAC;gBACI,IAAA,yBAAW,EACP,IAAI,CAAC,aAAa,CAGrB;gBACD,IAAI,CAAC,UAAU;aAClB;KACV,CAAC,CAAA;IAEF,IAAI,IAAI,CAAC,UAAU,KAAK,6CAAsB,EAAE,CAAC;QAC7C,MAAM,WAAW,GAAG,QASnB,CAAA;QACD,OAAO;YACH,gBAAgB,EAAE,WAAW,CAAC,gBAAgB;YAC9C,kBAAkB,EAAE,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC;YAC1D,oBAAoB,EAAE,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC;YAC9D,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC;SACH,CAAA;IACnD,CAAC;IAED,MAAM,WAAW,GAAG,QASnB,CAAA;IAED,OAAO;QACH,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,oBAAoB,EAAE,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC;QAC9D,kBAAkB,EAAE,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC;QAC1D,SAAS,EAAE,WAAW,CAAC,SAAS;QAChC,6BAA6B,EAAE,MAAM,CACjC,WAAW,CAAC,6BAA6B,CAC5C;QACD,uBAAuB,EAAE,MAAM,CAAC,WAAW,CAAC,uBAAuB,CAAC;QACpE,aAAa,EAAE,WAAW,CAAC,aAAa;KACG,CAAA;AACnD,CAAC,CAAA;AA/EY,QAAA,oBAAoB,wBA+EhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateSponsorshipPolicies.js","sourceRoot":"","sources":["../../../actions/pimlico/validateSponsorshipPolicies.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"validateSponsorshipPolicies.js","sourceRoot":"","sources":["../../../actions/pimlico/validateSponsorshipPolicies.ts"],"names":[],"mappings":";;;AAQA,yDAAqD;AAuD9C,MAAM,2BAA2B,GAAG,KAAK,EAM5C,MAKC,EACD,IAAiE,EACjB,EAAE;IAClD,OAAO,MAAM,MAAM,CAAC,OAAO,CAAC;QACxB,MAAM,EAAE,gCAAgC;QACxC,MAAM,EAAE;YACJ,IAAA,yBAAW,EAAC,IAAI,CAAC,aAAa,CAE7B;YACD,IAAI,CAAC,UAAU;YACf,IAAI,CAAC,oBAAoB;SAC5B;KACJ,CAAC,CAAA;AACN,CAAC,CAAA;AAxBY,QAAA,2BAA2B,+BAwBvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAccountNonce.js","sourceRoot":"","sources":["../../../actions/public/getAccountNonce.ts"],"names":[],"mappings":";;;AACA,0CAA2C;
|
|
1
|
+
{"version":3,"file":"getAccountNonce.js","sourceRoot":"","sources":["../../../actions/public/getAccountNonce.ts"],"names":[],"mappings":";;;AACA,0CAA2C;AAG3C,qDAAiD;AAkC1C,MAAM,eAAe,GAAG,KAAK,EAIhC,MAAkC,EAClC,IAAqC,EACtB,EAAE;IACjB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAA;IAEpD,OAAO,MAAM,IAAA,qBAAS,EAClB,MAAM,EACN,sBAAY,CACf,CAAC;QACE,OAAO,EAAE,UAAU;QACnB,GAAG,EAAE;YACD;gBACI,MAAM,EAAE;oBACJ;wBACI,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,SAAS;qBAClB;oBACD;wBACI,IAAI,EAAE,KAAK;wBACX,IAAI,EAAE,SAAS;qBAClB;iBACJ;gBACD,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,OAAO;wBACb,IAAI,EAAE,SAAS;qBAClB;iBACJ;gBACD,eAAe,EAAE,MAAM;gBACvB,IAAI,EAAE,UAAU;aACnB;SACJ;QACD,YAAY,EAAE,UAAU;QACxB,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC;KACtB,CAAC,CAAA;AACN,CAAC,CAAA;AAxCY,QAAA,eAAe,mBAwC3B"}
|
|
@@ -19,7 +19,10 @@ class InvalidEntryPointError extends viem_1.BaseError {
|
|
|
19
19
|
}
|
|
20
20
|
exports.InvalidEntryPointError = InvalidEntryPointError;
|
|
21
21
|
const getSenderAddress = async (client, args) => {
|
|
22
|
-
const { initCode, entryPoint } = args;
|
|
22
|
+
const { initCode, entryPoint, factory, factoryData } = args;
|
|
23
|
+
if (!initCode && !factory && !factoryData) {
|
|
24
|
+
throw new Error("Either `initCode` or `factory` and `factoryData` must be provided");
|
|
25
|
+
}
|
|
23
26
|
try {
|
|
24
27
|
await (0, getAction_1.getAction)(client, actions_1.simulateContract)({
|
|
25
28
|
address: entryPoint,
|
|
@@ -50,7 +53,7 @@ const getSenderAddress = async (client, args) => {
|
|
|
50
53
|
}
|
|
51
54
|
],
|
|
52
55
|
functionName: "getSenderAddress",
|
|
53
|
-
args: [initCode]
|
|
56
|
+
args: [initCode || (0, viem_1.concat)([factory, factoryData])]
|
|
54
57
|
});
|
|
55
58
|
}
|
|
56
59
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSenderAddress.js","sourceRoot":"","sources":["../../../actions/public/getSenderAddress.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"getSenderAddress.js","sourceRoot":"","sources":["../../../actions/public/getSenderAddress.ts"],"names":[],"mappings":";;;AAAA,+BAUa;AAEb,0CAA+C;AAM/C,qDAAiD;AAiBjD,MAAa,sBAAuB,SAAQ,gBAAS;IAGjD,YAAY,EACR,KAAK,EACL,UAAU,KACmC,EAAE;QAC/C,KAAK,CACD,0CACI,UAAU,CAAC,CAAC,CAAC,MAAM,UAAU,EAAE,CAAC,CAAC,CAAC,EACtC,iGAAiG,EACjG;YACI,KAAK;SACR,CACJ,CAAA;QAbI;;;;mBAAO,wBAAwB;WAAA;IAcxC,CAAC;CACJ;AAhBD,wDAgBC;AA2BM,MAAM,gBAAgB,GAAG,KAAK,EAKjC,MAAkC,EAClC,IAAkD,EAClC,EAAE;IAClB,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAA;IAE3D,IAAI,CAAC,QAAQ,IAAI,CAAC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CACX,mEAAmE,CACtE,CAAA;IACL,CAAC;IAED,IAAI,CAAC;QACD,MAAM,IAAA,qBAAS,EACX,MAAM,EACN,0BAAgB,CACnB,CAAC;YACE,OAAO,EAAE,UAAU;YACnB,GAAG,EAAE;gBACD;oBACI,MAAM,EAAE;wBACJ;4BACI,YAAY,EAAE,SAAS;4BACvB,IAAI,EAAE,QAAQ;4BACd,IAAI,EAAE,SAAS;yBAClB;qBACJ;oBACD,IAAI,EAAE,qBAAqB;oBAC3B,IAAI,EAAE,OAAO;iBAChB;gBACD;oBACI,MAAM,EAAE;wBACJ;4BACI,YAAY,EAAE,OAAO;4BACrB,IAAI,EAAE,UAAU;4BAChB,IAAI,EAAE,OAAO;yBAChB;qBACJ;oBACD,IAAI,EAAE,kBAAkB;oBACxB,OAAO,EAAE,EAAE;oBACX,eAAe,EAAE,YAAY;oBAC7B,IAAI,EAAE,UAAU;iBACnB;aACJ;YACD,YAAY,EAAE,kBAAkB;YAChC,IAAI,EAAE,CAAC,QAAQ,IAAI,IAAA,aAAM,EAAC,CAAC,OAAc,EAAE,WAAkB,CAAC,CAAC,CAAC;SACnE,CAAC,CAAA;IACN,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,GAAG,GAAG,CAAuC,CAAA;QAEnD,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,+BAA+B,EAAE,CAAC;YACrD,MAAM,WAAW,GAAG,GAAG,CAAC,KAA0C,CAAA;YAClE,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,EAAE,SAAS,IAAI,EAAE,CAAA;YACnD,IACI,SAAS,KAAK,qBAAqB;gBACnC,WAAW,CAAC,IAAI,EAAE,IAAI;gBACtB,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAC3B,CAAC;gBACC,OAAO,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAY,CAAA;YAC/C,CAAC;QACL,CAAC;QAED,MAAM,CAAC,CAAA;IACX,CAAC;IAED,MAAM,IAAI,sBAAsB,CAAC,EAAE,UAAU,EAAE,CAAC,CAAA;AACpD,CAAC,CAAA;AAtEY,QAAA,gBAAgB,oBAsE5B"}
|
|
@@ -7,7 +7,7 @@ const signUserOperationHashWithECDSA_1 = require("../../utils/signUserOperationH
|
|
|
7
7
|
const waitForUserOperationReceipt_1 = require("../bundler/waitForUserOperationReceipt.js");
|
|
8
8
|
const sendUserOperation_1 = require("./sendUserOperation.js");
|
|
9
9
|
async function deployContract(client, args) {
|
|
10
|
-
const { abi, args: constructorArgs, bytecode,
|
|
10
|
+
const { abi, args: constructorArgs, bytecode, middleware, ...request } = args;
|
|
11
11
|
const { account: account_ = client.account } = request;
|
|
12
12
|
if (!account_) {
|
|
13
13
|
throw new signUserOperationHashWithECDSA_1.AccountOrClientNotFoundError({
|
|
@@ -15,10 +15,9 @@ async function deployContract(client, args) {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
const account = (0, utils_1.parseAccount)(account_);
|
|
18
|
-
const userOpHash = await (0, getAction_1.getAction)(client, sendUserOperation_1.sendUserOperation)({
|
|
18
|
+
const userOpHash = await (0, getAction_1.getAction)(client, (sendUserOperation_1.sendUserOperation))({
|
|
19
19
|
userOperation: {
|
|
20
20
|
sender: account.address,
|
|
21
|
-
paymasterAndData: "0x",
|
|
22
21
|
maxFeePerGas: request.maxFeePerGas || 0n,
|
|
23
22
|
maxPriorityFeePerGas: request.maxPriorityFeePerGas || 0n,
|
|
24
23
|
callData: await account.encodeDeployCallData({
|
|
@@ -28,7 +27,7 @@ async function deployContract(client, args) {
|
|
|
28
27
|
})
|
|
29
28
|
},
|
|
30
29
|
account: account,
|
|
31
|
-
|
|
30
|
+
middleware
|
|
32
31
|
});
|
|
33
32
|
const userOperationReceipt = await (0, getAction_1.getAction)(client, waitForUserOperationReceipt_1.waitForUserOperationReceipt)({
|
|
34
33
|
hash: userOpHash
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployContract.js","sourceRoot":"","sources":["../../../actions/smartAccount/deployContract.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"deployContract.js","sourceRoot":"","sources":["../../../actions/smartAccount/deployContract.ts"],"names":[],"mappings":";;;AAYA,wCAA2C;AAC3C,qDAAiD;AACjD,+FAAyF;AACzF,wFAAoF;AAEpF,2DAAuD;AAyChD,KAAK,UAAU,cAAc,CAKhC,MAA2C,EAC3C,IAAiE;IAEjE,MAAM,EACF,GAAG,EACH,IAAI,EAAE,eAAe,EACrB,QAAQ,EACR,UAAU,EACV,GAAG,OAAO,EACb,GAAG,IAAI,CAAA;IAER,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,OAAO,CAAA;IAEtD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,6DAA4B,CAAC;YACnC,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAA6B,CAAA;IAElE,MAAM,UAAU,GAAG,MAAM,IAAA,qBAAS,EAC9B,MAAM,EACN,CAAA,qCAA6B,CAAA,CAChC,CAAC;QACE,aAAa,EAAE;YACX,MAAM,EAAE,OAAO,CAAC,OAAO;YACvB,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;YACxC,oBAAoB,EAAE,OAAO,CAAC,oBAAoB,IAAI,EAAE;YACxD,QAAQ,EAAE,MAAM,OAAO,CAAC,oBAAoB,CAAC;gBACzC,GAAG;gBACH,QAAQ;gBACR,IAAI,EAAE,eAAe;aACM,CAAC;SACnC;QACD,OAAO,EAAE,OAAO;QAChB,UAAU;KACb,CAAC,CAAA;IAEF,MAAM,oBAAoB,GAAG,MAAM,IAAA,qBAAS,EACxC,MAAM,EACN,yDAA2B,CAC9B,CAAC;QACE,IAAI,EAAE,UAAU;KACnB,CAAC,CAAA;IAEF,OAAO,oBAAoB,EAAE,OAAO,CAAC,eAAe,CAAA;AACxD,CAAC;AApDD,wCAoDC"}
|