@aa-sdk/core 4.0.0-alpha.1 → 4.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/account/smartContractAccount.d.ts +9 -3
- package/dist/cjs/account/smartContractAccount.js +11 -6
- package/dist/cjs/account/smartContractAccount.js.map +1 -1
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTx.js.map +1 -1
- package/dist/cjs/actions/smartAccount/buildUserOperationFromTxs.js.map +1 -1
- package/dist/cjs/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -1
- package/dist/cjs/actions/smartAccount/estimateUserOperationGas.js.map +1 -1
- package/dist/cjs/actions/smartAccount/internal/initUserOperation.js.map +1 -1
- package/dist/cjs/actions/smartAccount/internal/runMiddlewareStack.js.map +1 -1
- package/dist/cjs/actions/smartAccount/internal/sendUserOperation.js.map +1 -1
- package/dist/cjs/actions/smartAccount/sendUserOperation.js.map +1 -1
- package/dist/cjs/client/bundlerClient.js.map +1 -1
- package/dist/cjs/client/decorators/bundlerClient.js.map +1 -1
- package/dist/cjs/client/isSmartAccountClient.js.map +1 -1
- package/dist/cjs/client/types.d.ts +2 -7
- package/dist/cjs/client/types.js.map +1 -1
- package/dist/cjs/ens/utils.d.ts +1 -1
- package/dist/cjs/ens/utils.js +3 -3
- package/dist/cjs/ens/utils.js.map +1 -1
- package/dist/cjs/errors/account.js.map +1 -1
- package/dist/cjs/errors/client.js.map +1 -1
- package/dist/cjs/errors/entrypoint.js.map +1 -1
- package/dist/cjs/errors/signer.js.map +1 -1
- package/dist/cjs/errors/transaction.js.map +1 -1
- package/dist/cjs/errors/useroperation.js.map +1 -1
- package/dist/cjs/index.d.ts +3 -6
- package/dist/cjs/index.js +38 -64
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/logger.js.map +1 -1
- package/dist/cjs/middleware/actions.js +2 -18
- package/dist/cjs/middleware/actions.js.map +1 -1
- package/dist/cjs/middleware/defaults/gasEstimator.js +4 -2
- package/dist/cjs/middleware/defaults/gasEstimator.js.map +1 -1
- package/dist/cjs/middleware/erc7677middleware.d.ts +40 -0
- package/dist/cjs/middleware/erc7677middleware.js +77 -0
- package/dist/cjs/middleware/erc7677middleware.js.map +1 -0
- package/dist/cjs/middleware/noopMiddleware.d.ts +2 -1
- package/dist/cjs/middleware/noopMiddleware.js.map +1 -1
- package/dist/cjs/middleware/types.d.ts +3 -2
- package/dist/cjs/middleware/types.js.map +1 -1
- package/dist/cjs/signer/local-account.d.ts +44 -44
- package/dist/cjs/signer/local-account.js.map +1 -1
- package/dist/cjs/signer/wallet-client.d.ts +44 -44
- package/dist/cjs/signer/wallet-client.js.map +1 -1
- package/dist/cjs/transport/split.js.map +1 -1
- package/dist/cjs/utils/bigint.js.map +1 -1
- package/dist/cjs/utils/bytes.js.map +1 -1
- package/dist/cjs/utils/defaults.d.ts +2 -4
- package/dist/cjs/utils/defaults.js +5 -45
- package/dist/cjs/utils/defaults.js.map +1 -1
- package/dist/cjs/utils/index.d.ts +0 -3
- package/dist/cjs/utils/index.js +1 -25
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/types.js.map +1 -1
- package/dist/cjs/utils/userop.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/account/smartContractAccount.d.ts +9 -3
- package/dist/esm/account/smartContractAccount.js +6 -1
- package/dist/esm/account/smartContractAccount.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperationFromTx.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperationFromTxs.js.map +1 -1
- package/dist/esm/actions/smartAccount/checkGasSponsorshipEligibility.js.map +1 -1
- package/dist/esm/actions/smartAccount/estimateUserOperationGas.js.map +1 -1
- package/dist/esm/actions/smartAccount/internal/initUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/internal/runMiddlewareStack.js.map +1 -1
- package/dist/esm/actions/smartAccount/internal/sendUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendUserOperation.js.map +1 -1
- package/dist/esm/client/bundlerClient.js.map +1 -1
- package/dist/esm/client/decorators/bundlerClient.js.map +1 -1
- package/dist/esm/client/isSmartAccountClient.js.map +1 -1
- package/dist/esm/client/types.d.ts +2 -7
- package/dist/esm/client/types.js.map +1 -1
- package/dist/esm/ens/utils.d.ts +1 -1
- package/dist/esm/ens/utils.js +1 -1
- package/dist/esm/ens/utils.js.map +1 -1
- package/dist/esm/errors/account.js.map +1 -1
- package/dist/esm/errors/client.js.map +1 -1
- package/dist/esm/errors/entrypoint.js.map +1 -1
- package/dist/esm/errors/signer.js.map +1 -1
- package/dist/esm/errors/transaction.js.map +1 -1
- package/dist/esm/errors/useroperation.js.map +1 -1
- package/dist/esm/index.d.ts +3 -6
- package/dist/esm/index.js +2 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/logger.js.map +1 -1
- package/dist/esm/middleware/actions.js +3 -18
- package/dist/esm/middleware/actions.js.map +1 -1
- package/dist/esm/middleware/defaults/gasEstimator.js +4 -2
- package/dist/esm/middleware/defaults/gasEstimator.js.map +1 -1
- package/dist/esm/middleware/erc7677middleware.d.ts +40 -0
- package/dist/esm/middleware/erc7677middleware.js +73 -0
- package/dist/esm/middleware/erc7677middleware.js.map +1 -0
- package/dist/esm/middleware/noopMiddleware.d.ts +2 -1
- package/dist/esm/middleware/noopMiddleware.js.map +1 -1
- package/dist/esm/middleware/types.d.ts +3 -2
- package/dist/esm/middleware/types.js.map +1 -1
- package/dist/esm/signer/local-account.d.ts +44 -44
- package/dist/esm/signer/local-account.js.map +1 -1
- package/dist/esm/signer/wallet-client.d.ts +44 -44
- package/dist/esm/signer/wallet-client.js.map +1 -1
- package/dist/esm/transport/split.js.map +1 -1
- package/dist/esm/utils/bigint.js.map +1 -1
- package/dist/esm/utils/bytes.js.map +1 -1
- package/dist/esm/utils/defaults.d.ts +2 -4
- package/dist/esm/utils/defaults.js +1 -40
- package/dist/esm/utils/defaults.js.map +1 -1
- package/dist/esm/utils/index.d.ts +0 -3
- package/dist/esm/utils/index.js +0 -11
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/types.js.map +1 -1
- package/dist/esm/utils/userop.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/account/smartContractAccount.d.ts +17 -11
- package/dist/types/account/smartContractAccount.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/buildUserOperationFromTx.d.ts +33 -33
- package/dist/types/actions/smartAccount/buildUserOperationFromTxs.d.ts +43 -59
- package/dist/types/actions/smartAccount/buildUserOperationFromTxs.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/checkGasSponsorshipEligibility.d.ts +18 -18
- package/dist/types/actions/smartAccount/estimateUserOperationGas.d.ts +3 -3
- package/dist/types/actions/smartAccount/internal/initUserOperation.d.ts +3 -4
- package/dist/types/actions/smartAccount/internal/initUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/internal/runMiddlewareStack.d.ts +0 -14
- package/dist/types/actions/smartAccount/internal/runMiddlewareStack.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/internal/sendUserOperation.d.ts +0 -7
- package/dist/types/actions/smartAccount/internal/sendUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/sendUserOperation.d.ts +17 -3
- package/dist/types/actions/smartAccount/sendUserOperation.d.ts.map +1 -1
- package/dist/types/client/bundlerClient.d.ts +2 -2
- package/dist/types/client/decorators/bundlerClient.d.ts +8 -8
- package/dist/types/client/isSmartAccountClient.d.ts +4 -4
- package/dist/types/client/types.d.ts +2 -7
- package/dist/types/client/types.d.ts.map +1 -1
- package/dist/types/ens/utils.d.ts +1 -1
- package/dist/types/ens/utils.d.ts.map +1 -1
- package/dist/types/errors/account.d.ts +53 -4
- package/dist/types/errors/account.d.ts.map +1 -1
- package/dist/types/errors/client.d.ts +15 -0
- package/dist/types/errors/client.d.ts.map +1 -1
- package/dist/types/errors/entrypoint.d.ts +12 -0
- package/dist/types/errors/entrypoint.d.ts.map +1 -1
- package/dist/types/errors/signer.d.ts +5 -0
- package/dist/types/errors/signer.d.ts.map +1 -1
- package/dist/types/errors/transaction.d.ts +8 -1
- package/dist/types/errors/transaction.d.ts.map +1 -1
- package/dist/types/errors/useroperation.d.ts +5 -5
- package/dist/types/errors/useroperation.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logger.d.ts +88 -0
- package/dist/types/logger.d.ts.map +1 -1
- package/dist/types/middleware/actions.d.ts +3 -3
- package/dist/types/middleware/actions.d.ts.map +1 -1
- package/dist/types/middleware/defaults/gasEstimator.d.ts +2 -2
- package/dist/types/middleware/defaults/gasEstimator.d.ts.map +1 -1
- package/dist/types/middleware/erc7677middleware.d.ts +62 -0
- package/dist/types/middleware/erc7677middleware.d.ts.map +1 -0
- package/dist/types/middleware/noopMiddleware.d.ts +4 -4
- package/dist/types/middleware/noopMiddleware.d.ts.map +1 -1
- package/dist/types/middleware/types.d.ts +3 -2
- package/dist/types/middleware/types.d.ts.map +1 -1
- package/dist/types/signer/local-account.d.ts +137 -45
- package/dist/types/signer/local-account.d.ts.map +1 -1
- package/dist/types/signer/wallet-client.d.ts +133 -44
- package/dist/types/signer/wallet-client.d.ts.map +1 -1
- package/dist/types/transport/split.d.ts +2 -2
- package/dist/types/utils/bigint.d.ts +14 -14
- package/dist/types/utils/bigint.d.ts.map +1 -1
- package/dist/types/utils/bytes.d.ts +5 -5
- package/dist/types/utils/defaults.d.ts +2 -12
- package/dist/types/utils/defaults.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +12 -22
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/types.d.ts +2 -2
- package/dist/types/utils/userop.d.ts +33 -33
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/account/smartContractAccount.ts +19 -13
- package/src/actions/smartAccount/buildUserOperationFromTx.ts +35 -35
- package/src/actions/smartAccount/buildUserOperationFromTxs.ts +44 -60
- package/src/actions/smartAccount/checkGasSponsorshipEligibility.ts +19 -19
- package/src/actions/smartAccount/estimateUserOperationGas.ts +3 -3
- package/src/actions/smartAccount/internal/initUserOperation.ts +3 -4
- package/src/actions/smartAccount/internal/runMiddlewareStack.ts +0 -22
- package/src/actions/smartAccount/internal/sendUserOperation.ts +0 -7
- package/src/actions/smartAccount/sendUserOperation.ts +17 -3
- package/src/client/bundlerClient.ts +2 -2
- package/src/client/decorators/bundlerClient.ts +8 -8
- package/src/client/isSmartAccountClient.ts +4 -4
- package/src/client/types.ts +2 -15
- package/src/ens/utils.ts +1 -2
- package/src/errors/account.ts +64 -4
- package/src/errors/client.ts +18 -0
- package/src/errors/entrypoint.ts +12 -0
- package/src/errors/signer.ts +6 -0
- package/src/errors/transaction.ts +10 -1
- package/src/errors/useroperation.ts +5 -6
- package/src/index.ts +2 -31
- package/src/logger.ts +88 -0
- package/src/middleware/actions.ts +6 -27
- package/src/middleware/defaults/gasEstimator.ts +9 -5
- package/src/middleware/erc7677middleware.ts +201 -0
- package/src/middleware/noopMiddleware.ts +6 -4
- package/src/middleware/types.ts +16 -7
- package/src/signer/local-account.ts +94 -2
- package/src/signer/wallet-client.ts +89 -0
- package/src/transport/split.ts +2 -2
- package/src/utils/bigint.ts +15 -15
- package/src/utils/bytes.ts +5 -5
- package/src/utils/defaults.ts +3 -76
- package/src/utils/index.ts +12 -35
- package/src/utils/types.ts +2 -2
- package/src/utils/userop.ts +33 -33
- package/src/version.ts +1 -1
- package/dist/cjs/account/base.d.ts +0 -49
- package/dist/cjs/account/base.js +0 -257
- package/dist/cjs/account/base.js.map +0 -1
- package/dist/cjs/account/schema.d.ts +0 -100
- package/dist/cjs/account/schema.js +0 -43
- package/dist/cjs/account/schema.js.map +0 -1
- package/dist/cjs/account/simple.d.ts +0 -14
- package/dist/cjs/account/simple.js +0 -119
- package/dist/cjs/account/simple.js.map +0 -1
- package/dist/cjs/account/types.d.ts +0 -30
- package/dist/cjs/account/types.js +0 -3
- package/dist/cjs/account/types.js.map +0 -1
- package/dist/cjs/chains/index.d.ts +0 -20
- package/dist/cjs/chains/index.js +0 -169
- package/dist/cjs/chains/index.js.map +0 -1
- package/dist/esm/account/base.d.ts +0 -49
- package/dist/esm/account/base.js +0 -253
- package/dist/esm/account/base.js.map +0 -1
- package/dist/esm/account/schema.d.ts +0 -100
- package/dist/esm/account/schema.js +0 -35
- package/dist/esm/account/schema.js.map +0 -1
- package/dist/esm/account/simple.d.ts +0 -14
- package/dist/esm/account/simple.js +0 -115
- package/dist/esm/account/simple.js.map +0 -1
- package/dist/esm/account/types.d.ts +0 -30
- package/dist/esm/account/types.js +0 -2
- package/dist/esm/account/types.js.map +0 -1
- package/dist/esm/chains/index.d.ts +0 -20
- package/dist/esm/chains/index.js +0 -166
- package/dist/esm/chains/index.js.map +0 -1
- package/dist/types/account/base.d.ts +0 -128
- package/dist/types/account/base.d.ts.map +0 -1
- package/dist/types/account/schema.d.ts +0 -101
- package/dist/types/account/schema.d.ts.map +0 -1
- package/dist/types/account/simple.d.ts +0 -15
- package/dist/types/account/simple.d.ts.map +0 -1
- package/dist/types/account/types.d.ts +0 -144
- package/dist/types/account/types.d.ts.map +0 -1
- package/dist/types/chains/index.d.ts +0 -21
- package/dist/types/chains/index.d.ts.map +0 -1
- package/src/account/base.ts +0 -415
- package/src/account/schema.ts +0 -51
- package/src/account/simple.ts +0 -221
- package/src/account/types.ts +0 -184
- package/src/chains/index.ts +0 -194
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { UserOperationRequest, UserOperationStruct } from "../types.js";
|
|
2
2
|
import { BaseError } from "./base.js";
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4
|
-
import type { dropAndReplaceUserOperation } from "../actions/smartAccount/dropAndReplaceUserOperation.js";
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
|
-
* Thrown when a
|
|
6
|
+
* Thrown when a UserOperationStruct is not a valid request
|
|
8
7
|
*
|
|
9
8
|
* extends viem BaseError
|
|
10
9
|
*/
|
|
@@ -18,7 +17,7 @@ export class InvalidUserOperationError extends BaseError {
|
|
|
18
17
|
*
|
|
19
18
|
* InvalidUserOperationError constructor
|
|
20
19
|
*
|
|
21
|
-
* @param uo the invalid user operation struct
|
|
20
|
+
* @param {UserOperationStruct} uo the invalid user operation struct
|
|
22
21
|
*/
|
|
23
22
|
constructor(uo: UserOperationStruct) {
|
|
24
23
|
super(
|
|
@@ -41,12 +40,12 @@ export class InvalidUserOperationError extends BaseError {
|
|
|
41
40
|
* Error thrown when waiting for user operation request to be mined.
|
|
42
41
|
*
|
|
43
42
|
* Includes the internal error as well as the request that failed. This request
|
|
44
|
-
* can then be used with
|
|
43
|
+
* can then be used with dropAndReplaceUserOperation to retry the operation.
|
|
45
44
|
*/
|
|
46
45
|
export class WaitForUserOperationError extends BaseError {
|
|
47
46
|
/**
|
|
48
|
-
* @param request the user operation request that failed
|
|
49
|
-
* @param error the underlying error that caused the failure
|
|
47
|
+
* @param {UserOperationRequest} request the user operation request that failed
|
|
48
|
+
* @param {Error} error the underlying error that caused the failure
|
|
50
49
|
*/
|
|
51
50
|
constructor(public request: UserOperationRequest, error: Error) {
|
|
52
51
|
super(`Failed to find User Operation: ${error.message}`);
|
package/src/index.ts
CHANGED
|
@@ -7,9 +7,6 @@ export { EntryPointAbi_v7 } from "./abis/EntryPointAbi_v7.js";
|
|
|
7
7
|
export { SimpleAccountAbi_v6 } from "./abis/SimpleAccountAbi_v6.js";
|
|
8
8
|
export { SimpleAccountAbi_v7 } from "./abis/SimpleAccountAbi_v7.js";
|
|
9
9
|
export { SimpleAccountFactoryAbi } from "./abis/SimpleAccountFactoryAbi.js";
|
|
10
|
-
export { BaseSmartContractAccount } from "./account/base.js";
|
|
11
|
-
export { createSimpleSmartAccount } from "./account/simple.js";
|
|
12
|
-
export type { SimpleSmartAccount } from "./account/simple.js";
|
|
13
10
|
export type * from "./account/smartContractAccount.js";
|
|
14
11
|
export {
|
|
15
12
|
getAccountAddress,
|
|
@@ -17,10 +14,6 @@ export {
|
|
|
17
14
|
parseFactoryAddressFromAccountInitCode,
|
|
18
15
|
toSmartContractAccount,
|
|
19
16
|
} from "./account/smartContractAccount.js";
|
|
20
|
-
export type {
|
|
21
|
-
BaseSmartAccountParams,
|
|
22
|
-
SignTypedDataParams,
|
|
23
|
-
} from "./account/types.js";
|
|
24
17
|
export { buildUserOperation } from "./actions/smartAccount/buildUserOperation.js";
|
|
25
18
|
export { buildUserOperationFromTx } from "./actions/smartAccount/buildUserOperationFromTx.js";
|
|
26
19
|
export { buildUserOperationFromTxs } from "./actions/smartAccount/buildUserOperationFromTxs.js";
|
|
@@ -31,27 +24,6 @@ export { sendTransactions } from "./actions/smartAccount/sendTransactions.js";
|
|
|
31
24
|
export { sendUserOperation } from "./actions/smartAccount/sendUserOperation.js";
|
|
32
25
|
export type * from "./actions/smartAccount/types.js";
|
|
33
26
|
export { waitForUserOperationTransaction } from "./actions/smartAccount/waitForUserOperationTransacation.js";
|
|
34
|
-
export {
|
|
35
|
-
arbitrum,
|
|
36
|
-
arbitrumGoerli,
|
|
37
|
-
arbitrumSepolia,
|
|
38
|
-
base,
|
|
39
|
-
baseGoerli,
|
|
40
|
-
baseSepolia,
|
|
41
|
-
fraxtal,
|
|
42
|
-
fraxtalSepolia,
|
|
43
|
-
goerli,
|
|
44
|
-
mainnet,
|
|
45
|
-
optimism,
|
|
46
|
-
optimismGoerli,
|
|
47
|
-
optimismSepolia,
|
|
48
|
-
polygon,
|
|
49
|
-
polygonAmoy,
|
|
50
|
-
polygonMumbai,
|
|
51
|
-
sepolia,
|
|
52
|
-
zora,
|
|
53
|
-
zoraSepolia,
|
|
54
|
-
} from "./chains/index.js";
|
|
55
27
|
export type * from "./client/bundlerClient.js";
|
|
56
28
|
export {
|
|
57
29
|
createBundlerClient,
|
|
@@ -122,6 +94,8 @@ export { defaultFeeEstimator } from "./middleware/defaults/feeEstimator.js";
|
|
|
122
94
|
export { defaultGasEstimator } from "./middleware/defaults/gasEstimator.js";
|
|
123
95
|
export { defaultPaymasterAndData } from "./middleware/defaults/paymasterAndData.js";
|
|
124
96
|
export { defaultUserOpSigner } from "./middleware/defaults/userOpSigner.js";
|
|
97
|
+
export type * from "./middleware/erc7677middleware.js";
|
|
98
|
+
export { erc7677Middleware } from "./middleware/erc7677middleware.js";
|
|
125
99
|
export { noopMiddleware } from "./middleware/noopMiddleware.js";
|
|
126
100
|
export type * from "./middleware/types.js";
|
|
127
101
|
export { LocalAccountSigner } from "./signer/local-account.js";
|
|
@@ -136,7 +110,6 @@ export { split, type SplitTransportParams } from "./transport/split.js";
|
|
|
136
110
|
export type * from "./types.js";
|
|
137
111
|
export type * from "./utils/index.js";
|
|
138
112
|
export {
|
|
139
|
-
AlchemyChainMap,
|
|
140
113
|
BigNumberishRangeSchema,
|
|
141
114
|
BigNumberishSchema,
|
|
142
115
|
ChainSchema,
|
|
@@ -154,8 +127,6 @@ export {
|
|
|
154
127
|
concatPaymasterAndData,
|
|
155
128
|
deepHexlify,
|
|
156
129
|
filterUndefined,
|
|
157
|
-
getChain,
|
|
158
|
-
getDefaultSimpleAccountFactoryAddress,
|
|
159
130
|
getDefaultUserOperationFeeOptions,
|
|
160
131
|
isBigNumberish,
|
|
161
132
|
isMultiplier,
|
package/src/logger.ts
CHANGED
|
@@ -14,38 +14,126 @@ export class Logger {
|
|
|
14
14
|
static logLevel: LogLevel = LogLevel.INFO;
|
|
15
15
|
static logFilter?: string;
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Sets the log level for logging purposes.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { Logger, LogLevel } from "@aa-sdk/core";
|
|
23
|
+
* Logger.setLogLevel(LogLevel.DEBUG);
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @param {LogLevel} logLevel The desired log level
|
|
27
|
+
*/
|
|
17
28
|
static setLogLevel(logLevel: LogLevel) {
|
|
18
29
|
this.logLevel = logLevel;
|
|
19
30
|
}
|
|
20
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Sets the log filter pattern.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* import { Logger } from "@aa-sdk/core";
|
|
38
|
+
*
|
|
39
|
+
* Logger.setLogFilter("error");
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @param {string} pattern The pattern to set as the log filter
|
|
43
|
+
*/
|
|
21
44
|
static setLogFilter(pattern: string) {
|
|
22
45
|
this.logFilter = pattern;
|
|
23
46
|
}
|
|
24
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Logs an error message to the console if the logging condition is met.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* import { Logger } from "@aa-sdk/core";
|
|
54
|
+
*
|
|
55
|
+
* Logger.error("An error occurred while processing the request");
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @param {string} msg The primary error message to be logged
|
|
59
|
+
* @param {...any[]} args Additional arguments to be logged along with the error message
|
|
60
|
+
*/
|
|
25
61
|
static error(msg: string, ...args: any[]) {
|
|
26
62
|
if (!this.shouldLog(msg, LogLevel.ERROR)) return;
|
|
27
63
|
|
|
28
64
|
console.error(msg, ...args);
|
|
29
65
|
}
|
|
30
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Logs a warning message if the logging conditions are met.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* import { Logger } from "@aa-sdk/core";
|
|
73
|
+
*
|
|
74
|
+
* Logger.warn("Careful...");
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @param {string} msg The message to log as a warning
|
|
78
|
+
* @param {...any[]} args Additional parameters to log along with the message
|
|
79
|
+
*/
|
|
31
80
|
static warn(msg: string, ...args: any[]) {
|
|
32
81
|
if (!this.shouldLog(msg, LogLevel.WARN)) return;
|
|
33
82
|
|
|
34
83
|
console.warn(msg, ...args);
|
|
35
84
|
}
|
|
36
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Logs a debug message to the console if the log level allows it.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* import { Logger } from "@aa-sdk/core";
|
|
92
|
+
*
|
|
93
|
+
* Logger.debug("Something is happening");
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @param {string} msg The message to log
|
|
97
|
+
* @param {...any[]} args Additional arguments to pass to the console.debug method
|
|
98
|
+
*/
|
|
37
99
|
static debug(msg: string, ...args: any[]) {
|
|
38
100
|
if (!this.shouldLog(msg, LogLevel.DEBUG)) return;
|
|
39
101
|
|
|
40
102
|
console.debug(msg, ...args);
|
|
41
103
|
}
|
|
42
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Logs an informational message to the console if the logging level is set to INFO.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```ts
|
|
110
|
+
* import { Logger } from "@aa-sdk/core";
|
|
111
|
+
*
|
|
112
|
+
* Logger.info("Something is happening");
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* @param {string} msg the message to log
|
|
116
|
+
* @param {...any[]} args additional arguments to log alongside the message
|
|
117
|
+
*/
|
|
43
118
|
static info(msg: string, ...args: any[]) {
|
|
44
119
|
if (!this.shouldLog(msg, LogLevel.INFO)) return;
|
|
45
120
|
|
|
46
121
|
console.info(msg, ...args);
|
|
47
122
|
}
|
|
48
123
|
|
|
124
|
+
/**
|
|
125
|
+
* Logs a message with additional arguments if the logging level permits it.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```ts
|
|
129
|
+
* import { Logger } from "@aa-sdk/core";
|
|
130
|
+
*
|
|
131
|
+
* Logger.verbose("Something is happening");
|
|
132
|
+
* ```
|
|
133
|
+
*
|
|
134
|
+
* @param {string} msg The message to log
|
|
135
|
+
* @param {...any[]} args Additional arguments to be logged
|
|
136
|
+
*/
|
|
49
137
|
static verbose(msg: string, ...args: any[]) {
|
|
50
138
|
if (!this.shouldLog(msg, LogLevel.VERBOSE)) return;
|
|
51
139
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
isHex,
|
|
3
2
|
type Chain,
|
|
4
3
|
type Client,
|
|
5
4
|
type PublicActions,
|
|
@@ -12,10 +11,6 @@ import type {
|
|
|
12
11
|
BundlerRpcSchema,
|
|
13
12
|
} from "../client/decorators/bundlerClient.js";
|
|
14
13
|
import type { ClientMiddlewareConfig } from "../client/types.js";
|
|
15
|
-
import {
|
|
16
|
-
concatPaymasterAndData,
|
|
17
|
-
parsePaymasterAndData,
|
|
18
|
-
} from "../utils/userop.js";
|
|
19
14
|
import { defaultFeeEstimator } from "./defaults/feeEstimator.js";
|
|
20
15
|
import { defaultGasEstimator } from "./defaults/gasEstimator.js";
|
|
21
16
|
import { defaultPaymasterAndData } from "./defaults/paymasterAndData.js";
|
|
@@ -45,11 +40,11 @@ export type MiddlewareClient<
|
|
|
45
40
|
>;
|
|
46
41
|
|
|
47
42
|
/**
|
|
48
|
-
*
|
|
43
|
+
* function that takes in ClientMiddlewareConfig used during client initiation
|
|
49
44
|
* and returns the middleware actions object that the smart account client extends with
|
|
50
45
|
*
|
|
51
|
-
* @param
|
|
52
|
-
* @returns middleware actions object
|
|
46
|
+
* @param {ClientMiddlewareConfig} overrides config used during client initiation for overriding default middlewares
|
|
47
|
+
* @returns {(client: MiddlewareClient<TTransport, TChain, TAccount>) => { middleware: ClientMiddleware }} middleware actions object
|
|
53
48
|
*/
|
|
54
49
|
export const middlewareActions =
|
|
55
50
|
(overrides: ClientMiddlewareConfig) =>
|
|
@@ -64,27 +59,11 @@ export const middlewareActions =
|
|
|
64
59
|
): { middleware: ClientMiddleware } => ({
|
|
65
60
|
middleware: {
|
|
66
61
|
customMiddleware: overrides.customMiddleware ?? noopMiddleware,
|
|
67
|
-
dummyPaymasterAndData:
|
|
68
|
-
|
|
69
|
-
const data = overrides.paymasterAndData!.dummyPaymasterAndData();
|
|
70
|
-
const paymasterOverrides =
|
|
71
|
-
account.getEntryPoint().version === "0.7.0"
|
|
72
|
-
? isHex(data)
|
|
73
|
-
? parsePaymasterAndData(data)
|
|
74
|
-
: data
|
|
75
|
-
: {
|
|
76
|
-
paymasterAndData: isHex(data)
|
|
77
|
-
? data
|
|
78
|
-
: concatPaymasterAndData(data),
|
|
79
|
-
};
|
|
80
|
-
return { ...struct, ...paymasterOverrides };
|
|
81
|
-
}
|
|
82
|
-
: defaultPaymasterAndData,
|
|
83
|
-
|
|
62
|
+
dummyPaymasterAndData:
|
|
63
|
+
overrides.dummyPaymasterAndData ?? defaultPaymasterAndData,
|
|
84
64
|
feeEstimator: overrides.feeEstimator ?? defaultFeeEstimator(client),
|
|
85
65
|
gasEstimator: overrides.gasEstimator ?? defaultGasEstimator(client),
|
|
86
|
-
paymasterAndData:
|
|
87
|
-
overrides.paymasterAndData?.paymasterAndData ?? defaultPaymasterAndData,
|
|
66
|
+
paymasterAndData: overrides.paymasterAndData ?? defaultPaymasterAndData,
|
|
88
67
|
userOperationSimulator:
|
|
89
68
|
overrides.userOperationSimulator ?? noopMiddleware,
|
|
90
69
|
signUserOperation: overrides.signUserOperation ?? defaultUserOpSigner,
|
|
@@ -13,13 +13,13 @@ import type { ClientMiddlewareFn } from "../types.js";
|
|
|
13
13
|
* You can override this middleware with your custom gas estimator middleware
|
|
14
14
|
* by passing it to the client constructor
|
|
15
15
|
*
|
|
16
|
-
* @param client smart account client instance to apply the middleware to
|
|
17
|
-
* @returns middleware execution function used to estimate gas for user operations
|
|
16
|
+
* @param {MiddlewareClient} client smart account client instance to apply the middleware to
|
|
17
|
+
* @returns {ClientMiddlewareFn} middleware execution function used to estimate gas for user operations
|
|
18
18
|
*/
|
|
19
19
|
export const defaultGasEstimator: <C extends MiddlewareClient>(
|
|
20
20
|
client: C
|
|
21
21
|
) => ClientMiddlewareFn =
|
|
22
|
-
(client) =>
|
|
22
|
+
(client: MiddlewareClient): ClientMiddlewareFn =>
|
|
23
23
|
async (struct, { account, overrides, feeOptions }) => {
|
|
24
24
|
const request = deepHexlify(await resolveProperties(struct));
|
|
25
25
|
|
|
@@ -58,8 +58,12 @@ export const defaultGasEstimator: <C extends MiddlewareClient>(
|
|
|
58
58
|
(feeOptions as UserOperationFeeOptions<"0.7.0">)
|
|
59
59
|
?.paymasterVerificationGasLimit
|
|
60
60
|
);
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
const uo_v7 = struct as UserOperationStruct<"0.7.0">;
|
|
62
|
+
|
|
63
|
+
uo_v7.paymasterVerificationGasLimit = paymasterVerificationGasLimit;
|
|
64
|
+
|
|
65
|
+
uo_v7.paymasterPostOpGasLimit =
|
|
66
|
+
uo_v7.paymasterPostOpGasLimit ?? (uo_v7.paymaster ? "0x0" : undefined);
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
return struct;
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toHex,
|
|
3
|
+
type Address,
|
|
4
|
+
type Chain,
|
|
5
|
+
type Client,
|
|
6
|
+
type Hex,
|
|
7
|
+
type Transport,
|
|
8
|
+
} from "viem";
|
|
9
|
+
import type { ClientMiddlewareConfig } from "../client/types";
|
|
10
|
+
import type { EntryPointVersion } from "../entrypoint/types";
|
|
11
|
+
import { ChainNotFoundError } from "../errors/client.js";
|
|
12
|
+
import type {
|
|
13
|
+
UserOperationFeeOptions,
|
|
14
|
+
UserOperationOverrides,
|
|
15
|
+
UserOperationRequest,
|
|
16
|
+
UserOperationStruct,
|
|
17
|
+
} from "../types";
|
|
18
|
+
import {
|
|
19
|
+
deepHexlify,
|
|
20
|
+
resolveProperties,
|
|
21
|
+
type Deferrable,
|
|
22
|
+
} from "../utils/index.js";
|
|
23
|
+
import type { ClientMiddlewareFn } from "./types";
|
|
24
|
+
|
|
25
|
+
export type Erc7677RpcSchema = [
|
|
26
|
+
{
|
|
27
|
+
Method: "pm_getPaymasterStubData";
|
|
28
|
+
Parameters: [UserOperationRequest, Address, Hex, Record<string, any>];
|
|
29
|
+
ReturnType: {
|
|
30
|
+
sponsor?: { name: string; icon?: string }; // Sponsor info
|
|
31
|
+
paymaster?: Address; // Paymaster address (entrypoint v0.7)
|
|
32
|
+
paymasterData?: Hex; // Paymaster data (entrypoint v0.7)
|
|
33
|
+
paymasterVerificationGasLimit?: Hex; // Paymaster validation gas (entrypoint v0.7)
|
|
34
|
+
paymasterPostOpGasLimit?: Hex; // Paymaster post-op gas (entrypoint v0.7)
|
|
35
|
+
paymasterAndData?: Hex; // Paymaster and data (entrypoint v0.6)
|
|
36
|
+
isFinal?: boolean; // Indicates that the caller does not need to call pm_getPaymasterData
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
Method: "pm_getPaymasterData";
|
|
41
|
+
Parameters: [UserOperationRequest, Address, Hex, Record<string, any>];
|
|
42
|
+
ReturnType: {
|
|
43
|
+
paymaster?: Address; // Paymaster address (entrypoint v0.7)
|
|
44
|
+
paymasterData?: Hex; // Paymaster data (entrypoint v0.7)
|
|
45
|
+
paymasterAndData?: Hex; // Paymaster and data (entrypoint v0.6)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
export type Erc7677Client<T extends Transport = Transport> = Client<
|
|
51
|
+
T,
|
|
52
|
+
Chain,
|
|
53
|
+
undefined,
|
|
54
|
+
Erc7677RpcSchema
|
|
55
|
+
>;
|
|
56
|
+
|
|
57
|
+
export type Erc7677MiddlewareParams<
|
|
58
|
+
TContext extends Record<string, any> | undefined =
|
|
59
|
+
| Record<string, any>
|
|
60
|
+
| undefined,
|
|
61
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
62
|
+
> = {
|
|
63
|
+
context?:
|
|
64
|
+
| ((
|
|
65
|
+
struct: Deferrable<UserOperationStruct<TEntryPointVersion>>,
|
|
66
|
+
args: {
|
|
67
|
+
overrides?: UserOperationOverrides<TEntryPointVersion>;
|
|
68
|
+
feeOptions?: UserOperationFeeOptions;
|
|
69
|
+
}
|
|
70
|
+
) => Promise<TContext>)
|
|
71
|
+
| TContext;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Middleware function for interacting with ERC-7677 enabled clients. It supports resolving paymaster and data fields for user operations.
|
|
76
|
+
* This middleware assumes that your RPC provider supports the ERC-7677 methods (pm_getPaymasterStubData and pm_getPaymasterData).
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* import { createSmartAccountClient, erc7677Middleware } from "@aa-sdk/core";
|
|
81
|
+
* import { http } from "viem";
|
|
82
|
+
* import { sepolia } from "viem/chains";
|
|
83
|
+
*
|
|
84
|
+
* const client = createSmartAccountClient({
|
|
85
|
+
* transport: http("rpc-url"),
|
|
86
|
+
* chain: sepolia,
|
|
87
|
+
* // this assumes that your RPC provider supports the ERC-7677 methods AND takes no context
|
|
88
|
+
* ...erc7677Middleware(),
|
|
89
|
+
* })
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* @param {Erc7677MiddlewareParams<TContext>} params Middleware parameters including context function or object. Context can be resolved dynamically by passing in a function which takes in the context at the time of sending a user op
|
|
93
|
+
* @returns {Pick<ClientMiddlewareConfig, "dummyPaymasterAndData" | "paymasterAndData">} An object containing middleware functions `dummyPaymasterAndData` and `paymasterAndData` for processing user operations with the paymaster data
|
|
94
|
+
*/
|
|
95
|
+
export function erc7677Middleware<
|
|
96
|
+
TContext extends Record<string, any> | undefined =
|
|
97
|
+
| Record<string, any>
|
|
98
|
+
| undefined
|
|
99
|
+
>(
|
|
100
|
+
params?: Erc7677MiddlewareParams<TContext>
|
|
101
|
+
): Pick<ClientMiddlewareConfig, "dummyPaymasterAndData" | "paymasterAndData"> {
|
|
102
|
+
const dummyPaymasterAndData: ClientMiddlewareFn = async (
|
|
103
|
+
uo,
|
|
104
|
+
{ client, account, feeOptions, overrides }
|
|
105
|
+
) => {
|
|
106
|
+
const userOp = deepHexlify(await resolveProperties(uo));
|
|
107
|
+
|
|
108
|
+
// Those values will be set after fee estimation.
|
|
109
|
+
userOp.maxFeePerGas = "0x0";
|
|
110
|
+
userOp.maxPriorityFeePerGas = "0x0";
|
|
111
|
+
userOp.callGasLimit = "0x0";
|
|
112
|
+
userOp.verificationGasLimit = "0x0";
|
|
113
|
+
userOp.preVerificationGas = "0x0";
|
|
114
|
+
|
|
115
|
+
const entrypoint = account.getEntryPoint();
|
|
116
|
+
|
|
117
|
+
if (entrypoint.version === "0.7.0") {
|
|
118
|
+
userOp.paymasterVerificationGasLimit = "0x0";
|
|
119
|
+
userOp.paymasterPostOpGasLimit = "0x0";
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const context =
|
|
123
|
+
(typeof params?.context === "function"
|
|
124
|
+
? await params?.context(userOp, { overrides, feeOptions })
|
|
125
|
+
: params?.context) ?? {};
|
|
126
|
+
|
|
127
|
+
if (!client.chain) {
|
|
128
|
+
throw new ChainNotFoundError();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const erc7677client = client as Erc7677Client;
|
|
132
|
+
// TODO: probably need to handle the sponsor and isFinal fields
|
|
133
|
+
const {
|
|
134
|
+
paymaster,
|
|
135
|
+
paymasterAndData,
|
|
136
|
+
paymasterData,
|
|
137
|
+
paymasterPostOpGasLimit,
|
|
138
|
+
paymasterVerificationGasLimit,
|
|
139
|
+
} = await erc7677client.request({
|
|
140
|
+
method: "pm_getPaymasterStubData",
|
|
141
|
+
params: [userOp, entrypoint.address, toHex(client.chain.id), context],
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
if (entrypoint.version === "0.6.0") {
|
|
145
|
+
return {
|
|
146
|
+
...uo,
|
|
147
|
+
paymasterAndData,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return {
|
|
152
|
+
...uo,
|
|
153
|
+
paymaster,
|
|
154
|
+
paymasterData,
|
|
155
|
+
paymasterPostOpGasLimit,
|
|
156
|
+
paymasterVerificationGasLimit,
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const paymasterAndData: ClientMiddlewareFn = async (
|
|
161
|
+
uo,
|
|
162
|
+
{ client, account, feeOptions, overrides }
|
|
163
|
+
) => {
|
|
164
|
+
const userOp = deepHexlify(await resolveProperties(uo));
|
|
165
|
+
const context =
|
|
166
|
+
(typeof params?.context === "function"
|
|
167
|
+
? await params?.context(userOp, { overrides, feeOptions })
|
|
168
|
+
: params?.context) ?? {};
|
|
169
|
+
|
|
170
|
+
if (!client.chain) {
|
|
171
|
+
throw new ChainNotFoundError();
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const erc7677client = client as Erc7677Client;
|
|
175
|
+
|
|
176
|
+
const entrypoint = account.getEntryPoint();
|
|
177
|
+
const { paymaster, paymasterAndData, paymasterData } =
|
|
178
|
+
await erc7677client.request({
|
|
179
|
+
method: "pm_getPaymasterData",
|
|
180
|
+
params: [userOp, entrypoint.address, toHex(client.chain.id), context],
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
if (entrypoint.version === "0.6.0") {
|
|
184
|
+
return {
|
|
185
|
+
...uo,
|
|
186
|
+
paymasterAndData,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return {
|
|
191
|
+
...uo,
|
|
192
|
+
paymaster,
|
|
193
|
+
paymasterData,
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
return {
|
|
198
|
+
dummyPaymasterAndData,
|
|
199
|
+
paymasterAndData,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import type { UserOperationContext } from "../actions/smartAccount/types";
|
|
1
2
|
import type { ClientMiddlewareFn } from "./types";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Noop middleware that does nothing and passes the arguments through
|
|
5
6
|
*
|
|
6
|
-
* @
|
|
7
|
-
* @
|
|
8
|
-
* @returns the arguments passed to the middleware and returned as is without modification
|
|
7
|
+
* @param {Deferrable<UserOperationStruct<TEntryPointVersion>>} args the client middleware arguments passed to the middleware
|
|
8
|
+
* @returns {Promise<Deferrable<UserOperationStruct<TEntryPointVersion>>>} the arguments passed to the middleware and returned as is without modification
|
|
9
9
|
*/
|
|
10
|
-
export const noopMiddleware: ClientMiddlewareFn
|
|
10
|
+
export const noopMiddleware: ClientMiddlewareFn<
|
|
11
|
+
UserOperationContext | undefined
|
|
12
|
+
> = async (args) => {
|
|
11
13
|
return args;
|
|
12
14
|
};
|
package/src/middleware/types.ts
CHANGED
|
@@ -11,6 +11,21 @@ import type {
|
|
|
11
11
|
import type { Deferrable } from "../utils";
|
|
12
12
|
import type { MiddlewareClient } from "./actions";
|
|
13
13
|
|
|
14
|
+
export type ClientMiddlewareArgs<
|
|
15
|
+
TAccount extends SmartContractAccount,
|
|
16
|
+
C extends MiddlewareClient,
|
|
17
|
+
TContext extends UserOperationContext | undefined =
|
|
18
|
+
| UserOperationContext
|
|
19
|
+
| undefined,
|
|
20
|
+
TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
|
|
21
|
+
> = {
|
|
22
|
+
overrides?: UserOperationOverrides<TEntryPointVersion>;
|
|
23
|
+
context?: TContext;
|
|
24
|
+
feeOptions?: UserOperationFeeOptions;
|
|
25
|
+
account: TAccount;
|
|
26
|
+
client: C;
|
|
27
|
+
};
|
|
28
|
+
|
|
14
29
|
// [!region ClientMiddlewareFn]
|
|
15
30
|
export type ClientMiddlewareFn<
|
|
16
31
|
TContext extends UserOperationContext | undefined =
|
|
@@ -22,13 +37,7 @@ export type ClientMiddlewareFn<
|
|
|
22
37
|
TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>
|
|
23
38
|
>(
|
|
24
39
|
struct: Deferrable<UserOperationStruct<TEntryPointVersion>>,
|
|
25
|
-
args:
|
|
26
|
-
overrides?: UserOperationOverrides<TEntryPointVersion>;
|
|
27
|
-
context?: TContext;
|
|
28
|
-
feeOptions?: UserOperationFeeOptions;
|
|
29
|
-
account: TAccount;
|
|
30
|
-
client: C;
|
|
31
|
-
}
|
|
40
|
+
args: ClientMiddlewareArgs<TAccount, C, TContext, TEntryPointVersion>
|
|
32
41
|
) => Promise<Deferrable<UserOperationStruct<TEntryPointVersion>>>;
|
|
33
42
|
// [!endregion ClientMiddlewareFn]
|
|
34
43
|
|