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
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Account,
|
|
3
|
-
Address,
|
|
4
|
-
BaseError,
|
|
5
|
-
Chain,
|
|
6
|
-
Client,
|
|
7
|
-
Hash,
|
|
8
|
-
Transport
|
|
9
|
-
} from "viem"
|
|
1
|
+
import type { Account, BaseError, Chain, Client, Hash, Transport } from "viem"
|
|
10
2
|
import type { BundlerClient } from "../../clients/createBundlerClient"
|
|
11
3
|
import type { Prettify } from "../../types/"
|
|
12
4
|
import type { BundlerRpcSchema } from "../../types/bundler"
|
|
5
|
+
import type { EntryPoint, GetEntryPointVersion } from "../../types/entrypoint"
|
|
13
6
|
import type {
|
|
14
7
|
UserOperation,
|
|
15
8
|
UserOperationWithBigIntAsHex
|
|
@@ -17,9 +10,9 @@ import type {
|
|
|
17
10
|
import { deepHexlify } from "../../utils/deepHexlify"
|
|
18
11
|
import { getSendUserOperationError } from "../../utils/errors/getSendUserOperationError"
|
|
19
12
|
|
|
20
|
-
export type SendUserOperationParameters = {
|
|
21
|
-
userOperation: UserOperation
|
|
22
|
-
entryPoint:
|
|
13
|
+
export type SendUserOperationParameters<entryPoint extends EntryPoint> = {
|
|
14
|
+
userOperation: UserOperation<GetEntryPointVersion<entryPoint>>
|
|
15
|
+
entryPoint: entryPoint
|
|
23
16
|
}
|
|
24
17
|
|
|
25
18
|
/**
|
|
@@ -48,12 +41,13 @@ export type SendUserOperationParameters = {
|
|
|
48
41
|
* // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
|
|
49
42
|
*/
|
|
50
43
|
export const sendUserOperation = async <
|
|
44
|
+
entryPoint extends EntryPoint,
|
|
51
45
|
TTransport extends Transport = Transport,
|
|
52
46
|
TChain extends Chain | undefined = Chain | undefined,
|
|
53
47
|
TAccount extends Account | undefined = Account | undefined
|
|
54
48
|
>(
|
|
55
|
-
client: Client<TTransport, TChain, TAccount, BundlerRpcSchema
|
|
56
|
-
args: Prettify<SendUserOperationParameters
|
|
49
|
+
client: Client<TTransport, TChain, TAccount, BundlerRpcSchema<entryPoint>>,
|
|
50
|
+
args: Prettify<SendUserOperationParameters<entryPoint>>
|
|
57
51
|
): Promise<Hash> => {
|
|
58
52
|
const { userOperation, entryPoint } = args
|
|
59
53
|
|
|
@@ -61,8 +55,10 @@ export const sendUserOperation = async <
|
|
|
61
55
|
const userOperationHash = await client.request({
|
|
62
56
|
method: "eth_sendUserOperation",
|
|
63
57
|
params: [
|
|
64
|
-
deepHexlify(userOperation) as UserOperationWithBigIntAsHex
|
|
65
|
-
|
|
58
|
+
deepHexlify(userOperation) as UserOperationWithBigIntAsHex<
|
|
59
|
+
GetEntryPointVersion<entryPoint>
|
|
60
|
+
>,
|
|
61
|
+
entryPoint
|
|
66
62
|
]
|
|
67
63
|
})
|
|
68
64
|
|
|
@@ -70,7 +66,7 @@ export const sendUserOperation = async <
|
|
|
70
66
|
} catch (err) {
|
|
71
67
|
throw getSendUserOperationError(
|
|
72
68
|
err as BaseError,
|
|
73
|
-
args as SendUserOperationParameters
|
|
69
|
+
args as SendUserOperationParameters<entryPoint>
|
|
74
70
|
)
|
|
75
71
|
}
|
|
76
72
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { Account,
|
|
1
|
+
import type { Account, Chain, Client, Transport } from "viem"
|
|
2
2
|
import type { BundlerClient } from "../../clients/createBundlerClient"
|
|
3
3
|
import type { BundlerRpcSchema } from "../../types/bundler"
|
|
4
|
+
import type { EntryPoint } from "../../types/entrypoint"
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Returns the supported entrypoints by the bundler service
|
|
@@ -25,12 +26,13 @@ import type { BundlerRpcSchema } from "../../types/bundler"
|
|
|
25
26
|
*
|
|
26
27
|
*/
|
|
27
28
|
export const supportedEntryPoints = async <
|
|
29
|
+
entryPoint extends EntryPoint,
|
|
28
30
|
TTransport extends Transport = Transport,
|
|
29
31
|
TChain extends Chain | undefined = Chain | undefined,
|
|
30
32
|
TAccount extends Account | undefined = Account | undefined
|
|
31
33
|
>(
|
|
32
|
-
client: Client<TTransport, TChain, TAccount, BundlerRpcSchema
|
|
33
|
-
): Promise<
|
|
34
|
+
client: Client<TTransport, TChain, TAccount, BundlerRpcSchema<entryPoint>>
|
|
35
|
+
): Promise<EntryPoint[]> => {
|
|
34
36
|
return client.request({
|
|
35
37
|
method: "eth_supportedEntryPoints",
|
|
36
38
|
params: []
|
|
@@ -45,25 +45,23 @@ export const getUserOperationGasPrice = async <
|
|
|
45
45
|
>(
|
|
46
46
|
client: Client<TTransport, TChain, TAccount, PimlicoBundlerRpcSchema>
|
|
47
47
|
): Promise<Prettify<GetUserOperationGasPriceReturnType>> => {
|
|
48
|
-
const
|
|
48
|
+
const gasPrice = await client.request({
|
|
49
49
|
method: "pimlico_getUserOperationGasPrice",
|
|
50
50
|
params: []
|
|
51
51
|
})
|
|
52
52
|
|
|
53
53
|
return {
|
|
54
54
|
slow: {
|
|
55
|
-
maxFeePerGas: BigInt(
|
|
56
|
-
maxPriorityFeePerGas: BigInt(
|
|
55
|
+
maxFeePerGas: BigInt(gasPrice.slow.maxFeePerGas),
|
|
56
|
+
maxPriorityFeePerGas: BigInt(gasPrice.slow.maxPriorityFeePerGas)
|
|
57
57
|
},
|
|
58
58
|
standard: {
|
|
59
|
-
maxFeePerGas: BigInt(
|
|
60
|
-
maxPriorityFeePerGas: BigInt(
|
|
61
|
-
gasPrices.standard.maxPriorityFeePerGas
|
|
62
|
-
)
|
|
59
|
+
maxFeePerGas: BigInt(gasPrice.standard.maxFeePerGas),
|
|
60
|
+
maxPriorityFeePerGas: BigInt(gasPrice.standard.maxPriorityFeePerGas)
|
|
63
61
|
},
|
|
64
62
|
fast: {
|
|
65
|
-
maxFeePerGas: BigInt(
|
|
66
|
-
maxPriorityFeePerGas: BigInt(
|
|
63
|
+
maxFeePerGas: BigInt(gasPrice.fast.maxFeePerGas),
|
|
64
|
+
maxPriorityFeePerGas: BigInt(gasPrice.fast.maxPriorityFeePerGas)
|
|
67
65
|
}
|
|
68
66
|
}
|
|
69
67
|
}
|
|
@@ -1,26 +1,58 @@
|
|
|
1
|
-
import type { Account, Address, Chain, Client, Transport } from "viem"
|
|
1
|
+
import type { Account, Address, Chain, Client, Hex, Transport } from "viem"
|
|
2
2
|
import type { PartialBy } from "viem/types/utils"
|
|
3
3
|
import type { Prettify } from "../../types/"
|
|
4
|
+
import type {
|
|
5
|
+
ENTRYPOINT_ADDRESS_V06_TYPE,
|
|
6
|
+
EntryPoint,
|
|
7
|
+
GetEntryPointVersion
|
|
8
|
+
} from "../../types/entrypoint"
|
|
4
9
|
import type { PimlicoPaymasterRpcSchema } from "../../types/pimlico"
|
|
5
10
|
import type {
|
|
6
11
|
UserOperation,
|
|
7
12
|
UserOperationWithBigIntAsHex
|
|
8
13
|
} from "../../types/userOperation"
|
|
9
14
|
import { deepHexlify } from "../../utils/deepHexlify"
|
|
15
|
+
import { ENTRYPOINT_ADDRESS_V06 } from "../../utils/getEntryPointVersion"
|
|
10
16
|
|
|
11
|
-
export type PimlicoSponsorUserOperationParameters
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
export type PimlicoSponsorUserOperationParameters<
|
|
18
|
+
entryPoint extends EntryPoint
|
|
19
|
+
> = {
|
|
20
|
+
userOperation: entryPoint extends ENTRYPOINT_ADDRESS_V06_TYPE
|
|
21
|
+
? PartialBy<
|
|
22
|
+
UserOperation<"v0.6">,
|
|
23
|
+
"callGasLimit" | "preVerificationGas" | "verificationGasLimit"
|
|
24
|
+
>
|
|
25
|
+
: PartialBy<
|
|
26
|
+
UserOperation<"v0.7">,
|
|
27
|
+
| "callGasLimit"
|
|
28
|
+
| "preVerificationGas"
|
|
29
|
+
| "verificationGasLimit"
|
|
30
|
+
| "paymasterVerificationGasLimit"
|
|
31
|
+
| "paymasterPostOpGasLimit"
|
|
32
|
+
>
|
|
33
|
+
entryPoint: entryPoint
|
|
20
34
|
sponsorshipPolicyId?: string
|
|
21
35
|
}
|
|
22
36
|
|
|
23
|
-
export type SponsorUserOperationReturnType =
|
|
37
|
+
export type SponsorUserOperationReturnType<entryPoint extends EntryPoint> =
|
|
38
|
+
entryPoint extends ENTRYPOINT_ADDRESS_V06_TYPE
|
|
39
|
+
? Pick<
|
|
40
|
+
UserOperation<"v0.6">,
|
|
41
|
+
| "callGasLimit"
|
|
42
|
+
| "verificationGasLimit"
|
|
43
|
+
| "preVerificationGas"
|
|
44
|
+
| "paymasterAndData"
|
|
45
|
+
>
|
|
46
|
+
: Pick<
|
|
47
|
+
UserOperation<"v0.7">,
|
|
48
|
+
| "callGasLimit"
|
|
49
|
+
| "verificationGasLimit"
|
|
50
|
+
| "preVerificationGas"
|
|
51
|
+
| "paymaster"
|
|
52
|
+
| "paymasterVerificationGasLimit"
|
|
53
|
+
| "paymasterPostOpGasLimit"
|
|
54
|
+
| "paymasterData"
|
|
55
|
+
>
|
|
24
56
|
|
|
25
57
|
/**
|
|
26
58
|
* Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
|
|
@@ -48,20 +80,28 @@ export type SponsorUserOperationReturnType = UserOperation
|
|
|
48
80
|
*
|
|
49
81
|
*/
|
|
50
82
|
export const sponsorUserOperation = async <
|
|
83
|
+
entryPoint extends EntryPoint,
|
|
51
84
|
TTransport extends Transport = Transport,
|
|
52
85
|
TChain extends Chain | undefined = Chain | undefined,
|
|
53
86
|
TAccount extends Account | undefined = Account | undefined
|
|
54
87
|
>(
|
|
55
|
-
client: Client<
|
|
56
|
-
|
|
57
|
-
|
|
88
|
+
client: Client<
|
|
89
|
+
TTransport,
|
|
90
|
+
TChain,
|
|
91
|
+
TAccount,
|
|
92
|
+
PimlicoPaymasterRpcSchema<entryPoint>
|
|
93
|
+
>,
|
|
94
|
+
args: Prettify<PimlicoSponsorUserOperationParameters<entryPoint>>
|
|
95
|
+
): Promise<Prettify<SponsorUserOperationReturnType<entryPoint>>> => {
|
|
58
96
|
const response = await client.request({
|
|
59
97
|
method: "pm_sponsorUserOperation",
|
|
60
98
|
params: args.sponsorshipPolicyId
|
|
61
99
|
? [
|
|
62
100
|
deepHexlify(
|
|
63
101
|
args.userOperation
|
|
64
|
-
) as UserOperationWithBigIntAsHex
|
|
102
|
+
) as UserOperationWithBigIntAsHex<
|
|
103
|
+
GetEntryPointVersion<entryPoint>
|
|
104
|
+
>,
|
|
65
105
|
args.entryPoint,
|
|
66
106
|
{
|
|
67
107
|
sponsorshipPolicyId: args.sponsorshipPolicyId
|
|
@@ -70,18 +110,52 @@ export const sponsorUserOperation = async <
|
|
|
70
110
|
: [
|
|
71
111
|
deepHexlify(
|
|
72
112
|
args.userOperation
|
|
73
|
-
) as UserOperationWithBigIntAsHex
|
|
113
|
+
) as UserOperationWithBigIntAsHex<
|
|
114
|
+
GetEntryPointVersion<entryPoint>
|
|
115
|
+
>,
|
|
74
116
|
args.entryPoint
|
|
75
117
|
]
|
|
76
118
|
})
|
|
77
119
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
120
|
+
if (args.entryPoint === ENTRYPOINT_ADDRESS_V06) {
|
|
121
|
+
const responseV06 = response as {
|
|
122
|
+
paymasterAndData: Hex
|
|
123
|
+
preVerificationGas: Hex
|
|
124
|
+
verificationGasLimit: Hex
|
|
125
|
+
callGasLimit: Hex
|
|
126
|
+
paymaster?: never
|
|
127
|
+
paymasterVerificationGasLimit?: never
|
|
128
|
+
paymasterPostOpGasLimit?: never
|
|
129
|
+
paymasterData?: never
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
paymasterAndData: responseV06.paymasterAndData,
|
|
133
|
+
preVerificationGas: BigInt(responseV06.preVerificationGas),
|
|
134
|
+
verificationGasLimit: BigInt(responseV06.verificationGasLimit),
|
|
135
|
+
callGasLimit: BigInt(responseV06.callGasLimit)
|
|
136
|
+
} as SponsorUserOperationReturnType<entryPoint>
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const responseV07 = response as {
|
|
140
|
+
preVerificationGas: Hex
|
|
141
|
+
verificationGasLimit: Hex
|
|
142
|
+
callGasLimit: Hex
|
|
143
|
+
paymaster: Address
|
|
144
|
+
paymasterVerificationGasLimit: Hex
|
|
145
|
+
paymasterPostOpGasLimit: Hex
|
|
146
|
+
paymasterData: Hex
|
|
147
|
+
paymasterAndData?: never
|
|
84
148
|
}
|
|
85
149
|
|
|
86
|
-
return
|
|
150
|
+
return {
|
|
151
|
+
callGasLimit: BigInt(responseV07.callGasLimit),
|
|
152
|
+
verificationGasLimit: BigInt(responseV07.verificationGasLimit),
|
|
153
|
+
preVerificationGas: BigInt(responseV07.preVerificationGas),
|
|
154
|
+
paymaster: responseV07.paymaster,
|
|
155
|
+
paymasterVerificationGasLimit: BigInt(
|
|
156
|
+
responseV07.paymasterVerificationGasLimit
|
|
157
|
+
),
|
|
158
|
+
paymasterPostOpGasLimit: BigInt(responseV07.paymasterPostOpGasLimit),
|
|
159
|
+
paymasterData: responseV07.paymasterData
|
|
160
|
+
} as SponsorUserOperationReturnType<entryPoint>
|
|
87
161
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Account,
|
|
1
|
+
import type { Account, Chain, Client, Transport } from "viem"
|
|
2
2
|
import type { Prettify } from "../../types/"
|
|
3
|
+
import type { EntryPoint, GetEntryPointVersion } from "../../types/entrypoint"
|
|
3
4
|
import type { PimlicoPaymasterRpcSchema } from "../../types/pimlico"
|
|
4
5
|
import type {
|
|
5
6
|
UserOperation,
|
|
@@ -7,9 +8,11 @@ import type {
|
|
|
7
8
|
} from "../../types/userOperation"
|
|
8
9
|
import { deepHexlify } from "../../utils/deepHexlify"
|
|
9
10
|
|
|
10
|
-
export type ValidateSponsorshipPoliciesParameters
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
export type ValidateSponsorshipPoliciesParameters<
|
|
12
|
+
entryPoint extends EntryPoint
|
|
13
|
+
> = {
|
|
14
|
+
userOperation: UserOperation<GetEntryPointVersion<entryPoint>>
|
|
15
|
+
entryPoint: entryPoint
|
|
13
16
|
sponsorshipPolicyIds: string[]
|
|
14
17
|
}
|
|
15
18
|
|
|
@@ -59,17 +62,25 @@ export type ValidateSponsorshipPolicies = {
|
|
|
59
62
|
* ]
|
|
60
63
|
*/
|
|
61
64
|
export const validateSponsorshipPolicies = async <
|
|
65
|
+
entryPoint extends EntryPoint,
|
|
62
66
|
TTransport extends Transport = Transport,
|
|
63
67
|
TChain extends Chain | undefined = Chain | undefined,
|
|
64
68
|
TAccount extends Account | undefined = Account | undefined
|
|
65
69
|
>(
|
|
66
|
-
client: Client<
|
|
67
|
-
|
|
70
|
+
client: Client<
|
|
71
|
+
TTransport,
|
|
72
|
+
TChain,
|
|
73
|
+
TAccount,
|
|
74
|
+
PimlicoPaymasterRpcSchema<entryPoint>
|
|
75
|
+
>,
|
|
76
|
+
args: Prettify<ValidateSponsorshipPoliciesParameters<entryPoint>>
|
|
68
77
|
): Promise<Prettify<ValidateSponsorshipPolicies>[]> => {
|
|
69
78
|
return await client.request({
|
|
70
79
|
method: "pm_validateSponsorshipPolicies",
|
|
71
80
|
params: [
|
|
72
|
-
deepHexlify(args.userOperation) as UserOperationWithBigIntAsHex
|
|
81
|
+
deepHexlify(args.userOperation) as UserOperationWithBigIntAsHex<
|
|
82
|
+
GetEntryPointVersion<entryPoint>
|
|
83
|
+
>,
|
|
73
84
|
args.entryPoint,
|
|
74
85
|
args.sponsorshipPolicyIds
|
|
75
86
|
]
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { Address, Chain, Client, Transport } from "viem"
|
|
2
2
|
import { readContract } from "viem/actions"
|
|
3
3
|
import type { Prettify } from "../../types/"
|
|
4
|
+
import type { EntryPoint } from "../../types/entrypoint"
|
|
4
5
|
import { getAction } from "../../utils/getAction"
|
|
5
6
|
|
|
6
7
|
export type GetAccountNonceParams = {
|
|
7
8
|
sender: Address
|
|
8
|
-
entryPoint:
|
|
9
|
+
entryPoint: EntryPoint
|
|
9
10
|
key?: bigint
|
|
10
11
|
}
|
|
11
12
|
|
|
@@ -6,14 +6,32 @@ import {
|
|
|
6
6
|
type ContractFunctionExecutionErrorType,
|
|
7
7
|
type ContractFunctionRevertedErrorType,
|
|
8
8
|
type Hex,
|
|
9
|
-
type Transport
|
|
9
|
+
type Transport,
|
|
10
|
+
concat
|
|
10
11
|
} from "viem"
|
|
11
12
|
|
|
12
13
|
import { simulateContract } from "viem/actions"
|
|
13
14
|
import type { Prettify } from "../../types/"
|
|
15
|
+
import type {
|
|
16
|
+
ENTRYPOINT_ADDRESS_V06_TYPE,
|
|
17
|
+
EntryPoint
|
|
18
|
+
} from "../../types/entrypoint"
|
|
14
19
|
import { getAction } from "../../utils/getAction"
|
|
15
20
|
|
|
16
|
-
export type GetSenderAddressParams
|
|
21
|
+
export type GetSenderAddressParams<entryPoint extends EntryPoint> =
|
|
22
|
+
entryPoint extends ENTRYPOINT_ADDRESS_V06_TYPE
|
|
23
|
+
? {
|
|
24
|
+
initCode: Hex
|
|
25
|
+
entryPoint: entryPoint
|
|
26
|
+
factory?: never
|
|
27
|
+
factoryData?: never
|
|
28
|
+
}
|
|
29
|
+
: {
|
|
30
|
+
entryPoint: entryPoint
|
|
31
|
+
factory: Address
|
|
32
|
+
factoryData: Hex
|
|
33
|
+
initCode?: never
|
|
34
|
+
}
|
|
17
35
|
|
|
18
36
|
export class InvalidEntryPointError extends BaseError {
|
|
19
37
|
override name = "InvalidEntryPointError"
|
|
@@ -59,13 +77,20 @@ export class InvalidEntryPointError extends BaseError {
|
|
|
59
77
|
* // Return '0x7a88a206ba40b37a8c07a2b5688cf8b287318b63'
|
|
60
78
|
*/
|
|
61
79
|
export const getSenderAddress = async <
|
|
80
|
+
entryPoint extends EntryPoint,
|
|
62
81
|
TTransport extends Transport = Transport,
|
|
63
82
|
TChain extends Chain | undefined = Chain | undefined
|
|
64
83
|
>(
|
|
65
84
|
client: Client<TTransport, TChain>,
|
|
66
|
-
args: Prettify<GetSenderAddressParams
|
|
85
|
+
args: Prettify<GetSenderAddressParams<entryPoint>>
|
|
67
86
|
): Promise<Address> => {
|
|
68
|
-
const { initCode, entryPoint } = args
|
|
87
|
+
const { initCode, entryPoint, factory, factoryData } = args
|
|
88
|
+
|
|
89
|
+
if (!initCode && !factory && !factoryData) {
|
|
90
|
+
throw new Error(
|
|
91
|
+
"Either `initCode` or `factory` and `factoryData` must be provided"
|
|
92
|
+
)
|
|
93
|
+
}
|
|
69
94
|
|
|
70
95
|
try {
|
|
71
96
|
await getAction(
|
|
@@ -100,7 +125,7 @@ export const getSenderAddress = async <
|
|
|
100
125
|
}
|
|
101
126
|
],
|
|
102
127
|
functionName: "getSenderAddress",
|
|
103
|
-
args: [initCode]
|
|
128
|
+
args: [initCode || concat([factory as Hex, factoryData as Hex])]
|
|
104
129
|
})
|
|
105
130
|
} catch (e) {
|
|
106
131
|
const err = e as ContractFunctionExecutionErrorType
|
|
@@ -9,20 +9,24 @@ import type {
|
|
|
9
9
|
} from "viem"
|
|
10
10
|
import type { SmartAccount } from "../../accounts/types"
|
|
11
11
|
import type { Prettify } from "../../types/"
|
|
12
|
+
import type { EntryPoint } from "../../types/entrypoint"
|
|
12
13
|
import { parseAccount } from "../../utils/"
|
|
13
14
|
import { getAction } from "../../utils/getAction"
|
|
14
15
|
import { AccountOrClientNotFoundError } from "../../utils/signUserOperationHashWithECDSA"
|
|
15
16
|
import { waitForUserOperationReceipt } from "../bundler/waitForUserOperationReceipt"
|
|
16
|
-
import { type
|
|
17
|
+
import { type Middleware } from "./prepareUserOperationRequest"
|
|
17
18
|
import { sendUserOperation } from "./sendUserOperation"
|
|
18
19
|
|
|
19
20
|
export type DeployContractParametersWithPaymaster<
|
|
21
|
+
entryPoint extends EntryPoint,
|
|
20
22
|
TAbi extends Abi | readonly unknown[] = Abi | readonly unknown[],
|
|
21
23
|
TChain extends Chain | undefined = Chain | undefined,
|
|
22
|
-
TAccount extends SmartAccount | undefined =
|
|
24
|
+
TAccount extends SmartAccount<entryPoint> | undefined =
|
|
25
|
+
| SmartAccount<entryPoint>
|
|
26
|
+
| undefined,
|
|
23
27
|
TChainOverride extends Chain | undefined = Chain | undefined
|
|
24
28
|
> = DeployContractParameters<TAbi, TChain, TAccount, TChainOverride> &
|
|
25
|
-
|
|
29
|
+
Middleware<entryPoint>
|
|
26
30
|
|
|
27
31
|
/**
|
|
28
32
|
* Deploys a contract to the network, given bytecode and constructor arguments.
|
|
@@ -53,17 +57,18 @@ export type DeployContractParametersWithPaymaster<
|
|
|
53
57
|
* })
|
|
54
58
|
*/
|
|
55
59
|
export async function deployContract<
|
|
60
|
+
entryPoint extends EntryPoint,
|
|
56
61
|
TChain extends Chain | undefined,
|
|
57
|
-
TAccount extends SmartAccount | undefined
|
|
62
|
+
TAccount extends SmartAccount<entryPoint> | undefined
|
|
58
63
|
>(
|
|
59
64
|
client: Client<Transport, TChain, TAccount>,
|
|
60
|
-
args: Prettify<DeployContractParametersWithPaymaster
|
|
65
|
+
args: Prettify<DeployContractParametersWithPaymaster<entryPoint>>
|
|
61
66
|
): Promise<Hash> {
|
|
62
67
|
const {
|
|
63
68
|
abi,
|
|
64
69
|
args: constructorArgs,
|
|
65
70
|
bytecode,
|
|
66
|
-
|
|
71
|
+
middleware,
|
|
67
72
|
...request
|
|
68
73
|
} = args
|
|
69
74
|
|
|
@@ -75,15 +80,14 @@ export async function deployContract<
|
|
|
75
80
|
})
|
|
76
81
|
}
|
|
77
82
|
|
|
78
|
-
const account = parseAccount(account_) as SmartAccount
|
|
83
|
+
const account = parseAccount(account_) as SmartAccount<entryPoint>
|
|
79
84
|
|
|
80
85
|
const userOpHash = await getAction(
|
|
81
86
|
client,
|
|
82
|
-
sendUserOperation
|
|
87
|
+
sendUserOperation<entryPoint>
|
|
83
88
|
)({
|
|
84
89
|
userOperation: {
|
|
85
90
|
sender: account.address,
|
|
86
|
-
paymasterAndData: "0x",
|
|
87
91
|
maxFeePerGas: request.maxFeePerGas || 0n,
|
|
88
92
|
maxPriorityFeePerGas: request.maxPriorityFeePerGas || 0n,
|
|
89
93
|
callData: await account.encodeDeployCallData({
|
|
@@ -93,7 +97,7 @@ export async function deployContract<
|
|
|
93
97
|
} as EncodeDeployDataParameters)
|
|
94
98
|
},
|
|
95
99
|
account: account,
|
|
96
|
-
|
|
100
|
+
middleware
|
|
97
101
|
})
|
|
98
102
|
|
|
99
103
|
const userOperationReceipt = await getAction(
|