@aa-sdk/core 4.35.0 → 4.36.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/README.md +1 -1
- package/dist/esm/account/smartContractAccount.d.ts +1 -1
- package/dist/esm/account/smartContractAccount.js.map +1 -1
- package/dist/esm/actions/bundler/estimateUserOperationGas.d.ts +3 -2
- package/dist/esm/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/dist/esm/actions/bundler/getSupportedEntryPoints.js.map +1 -1
- package/dist/esm/actions/bundler/getUserOperationByHash.js.map +1 -1
- package/dist/esm/actions/bundler/getUserOperationReceipt.js.map +1 -1
- package/dist/esm/actions/bundler/sendRawUserOperation.d.ts +2 -1
- package/dist/esm/actions/bundler/sendRawUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/buildUserOperation.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/dropAndReplaceUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/estimateUserOperationGas.js +8 -1
- package/dist/esm/actions/smartAccount/estimateUserOperationGas.js.map +1 -1
- package/dist/esm/actions/smartAccount/getAddress.js.map +1 -1
- package/dist/esm/actions/smartAccount/getUserOperationError.d.ts +14 -0
- package/dist/esm/actions/smartAccount/getUserOperationError.js +90 -0
- package/dist/esm/actions/smartAccount/getUserOperationError.js.map +1 -0
- 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 +11 -4
- package/dist/esm/actions/smartAccount/internal/sendUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendTransaction.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendTransactions.js.map +1 -1
- package/dist/esm/actions/smartAccount/sendUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/signMessage.js.map +1 -1
- package/dist/esm/actions/smartAccount/signTypedData.js.map +1 -1
- package/dist/esm/actions/smartAccount/signUserOperation.js.map +1 -1
- package/dist/esm/actions/smartAccount/types.js.map +1 -1
- package/dist/esm/actions/smartAccount/upgradeAccount.js.map +1 -1
- package/dist/esm/actions/smartAccount/waitForUserOperationTransacation.js.map +1 -1
- package/dist/esm/client/addBreadcrumb.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/decorators/smartAccountClient.js.map +1 -1
- package/dist/esm/client/isSmartAccountClient.js.map +1 -1
- package/dist/esm/client/schema.d.ts +25 -25
- package/dist/esm/client/schema.js.map +1 -1
- package/dist/esm/client/smartAccountClient.js.map +1 -1
- package/dist/esm/client/types.js.map +1 -1
- package/dist/esm/ens/utils.js.map +1 -1
- package/dist/esm/entrypoint/0.6.d.ts +2 -2
- package/dist/esm/entrypoint/0.6.js.map +1 -1
- package/dist/esm/entrypoint/0.7.d.ts +1 -1
- package/dist/esm/entrypoint/0.7.js.map +1 -1
- package/dist/esm/entrypoint/index.d.ts +1 -1
- package/dist/esm/entrypoint/index.js.map +1 -1
- package/dist/esm/entrypoint/types.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/useroperation.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/middleware/actions.js.map +1 -1
- package/dist/esm/middleware/defaults/7702gasEstimator.d.ts +2 -2
- package/dist/esm/middleware/defaults/7702gasEstimator.js +2 -2
- package/dist/esm/middleware/defaults/7702gasEstimator.js.map +1 -1
- package/dist/esm/middleware/defaults/7702signer.d.ts +1 -1
- package/dist/esm/middleware/defaults/7702signer.js +1 -1
- package/dist/esm/middleware/defaults/7702signer.js.map +1 -1
- package/dist/esm/middleware/defaults/feeEstimator.js.map +1 -1
- package/dist/esm/middleware/defaults/gasEstimator.js.map +1 -1
- package/dist/esm/middleware/defaults/paymasterAndData.js.map +1 -1
- package/dist/esm/middleware/defaults/userOpSigner.js.map +1 -1
- package/dist/esm/middleware/erc7677middleware.js.map +1 -1
- package/dist/esm/middleware/types.js.map +1 -1
- package/dist/esm/signer/local-account.d.ts +2 -207
- package/dist/esm/signer/local-account.js.map +1 -1
- package/dist/esm/signer/schema.d.ts +1 -1
- package/dist/esm/signer/types.js.map +1 -1
- package/dist/esm/signer/wallet-client.d.ts +2 -207
- package/dist/esm/signer/wallet-client.js.map +1 -1
- package/dist/esm/transport/split.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/bigint.js.map +1 -1
- package/dist/esm/utils/defaults.js.map +1 -1
- package/dist/esm/utils/index.d.ts +2 -2
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/schema.js.map +1 -1
- package/dist/esm/utils/stateOverride.js.map +1 -1
- package/dist/esm/utils/testUtils.js.map +1 -1
- package/dist/esm/utils/traceHeader.js.map +1 -1
- package/dist/esm/utils/types.js.map +1 -1
- package/dist/esm/utils/userop.d.ts +2 -2
- package/dist/esm/utils/userop.js +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 +1 -1
- package/dist/types/account/smartContractAccount.d.ts.map +1 -1
- package/dist/types/actions/bundler/estimateUserOperationGas.d.ts +3 -2
- package/dist/types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -1
- package/dist/types/actions/bundler/getSupportedEntryPoints.d.ts.map +1 -1
- package/dist/types/actions/bundler/getUserOperationByHash.d.ts.map +1 -1
- package/dist/types/actions/bundler/getUserOperationReceipt.d.ts.map +1 -1
- package/dist/types/actions/bundler/sendRawUserOperation.d.ts +2 -1
- package/dist/types/actions/bundler/sendRawUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/buildUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/buildUserOperationFromTx.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/buildUserOperationFromTxs.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/checkGasSponsorshipEligibility.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/dropAndReplaceUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/estimateUserOperationGas.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/getUserOperationError.d.ts +15 -0
- package/dist/types/actions/smartAccount/getUserOperationError.d.ts.map +1 -0
- package/dist/types/actions/smartAccount/internal/initUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/internal/runMiddlewareStack.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/internal/sendUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/sendTransaction.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/sendUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/signUserOperation.d.ts.map +1 -1
- package/dist/types/actions/smartAccount/types.d.ts.map +1 -1
- package/dist/types/client/decorators/smartAccountClient.d.ts.map +1 -1
- package/dist/types/client/schema.d.ts +25 -25
- package/dist/types/client/schema.d.ts.map +1 -1
- package/dist/types/ens/utils.d.ts.map +1 -1
- package/dist/types/entrypoint/0.6.d.ts +2 -2
- package/dist/types/entrypoint/0.6.d.ts.map +1 -1
- package/dist/types/entrypoint/0.7.d.ts +1 -1
- package/dist/types/entrypoint/0.7.d.ts.map +1 -1
- package/dist/types/entrypoint/index.d.ts +1 -1
- package/dist/types/entrypoint/index.d.ts.map +1 -1
- package/dist/types/entrypoint/types.d.ts.map +1 -1
- package/dist/types/errors/useroperation.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/middleware/actions.d.ts.map +1 -1
- package/dist/types/middleware/defaults/7702gasEstimator.d.ts +2 -2
- package/dist/types/middleware/defaults/7702signer.d.ts +1 -1
- package/dist/types/middleware/types.d.ts.map +1 -1
- package/dist/types/signer/local-account.d.ts +2 -207
- package/dist/types/signer/local-account.d.ts.map +1 -1
- package/dist/types/signer/schema.d.ts +1 -1
- package/dist/types/signer/schema.d.ts.map +1 -1
- package/dist/types/signer/utils.d.ts.map +1 -1
- package/dist/types/signer/wallet-client.d.ts +2 -207
- package/dist/types/signer/wallet-client.d.ts.map +1 -1
- package/dist/types/transport/split.d.ts.map +1 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/bigint.d.ts.map +1 -1
- package/dist/types/utils/bytes.d.ts.map +1 -1
- package/dist/types/utils/defaults.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/testUtils.d.ts.map +1 -1
- package/dist/types/utils/traceHeader.d.ts.map +1 -1
- package/dist/types/utils/userop.d.ts +2 -2
- package/dist/types/utils/userop.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +3 -6
- package/src/account/smartContractAccount.ts +27 -25
- package/src/actions/bundler/estimateUserOperationGas.ts +2 -2
- package/src/actions/bundler/getSupportedEntryPoints.ts +2 -2
- package/src/actions/bundler/getUserOperationByHash.ts +2 -2
- package/src/actions/bundler/getUserOperationReceipt.ts +2 -2
- package/src/actions/bundler/sendRawUserOperation.ts +2 -2
- package/src/actions/smartAccount/buildUserOperation.ts +5 -4
- package/src/actions/smartAccount/buildUserOperationFromTx.ts +4 -3
- package/src/actions/smartAccount/buildUserOperationFromTxs.ts +9 -8
- package/src/actions/smartAccount/checkGasSponsorshipEligibility.ts +5 -4
- package/src/actions/smartAccount/dropAndReplaceUserOperation.ts +7 -6
- package/src/actions/smartAccount/estimateUserOperationGas.ts +15 -8
- package/src/actions/smartAccount/getAddress.ts +2 -2
- package/src/actions/smartAccount/getUserOperationError.ts +119 -0
- package/src/actions/smartAccount/internal/initUserOperation.ts +7 -6
- package/src/actions/smartAccount/internal/runMiddlewareStack.ts +13 -12
- package/src/actions/smartAccount/internal/sendUserOperation.ts +13 -6
- package/src/actions/smartAccount/sendTransaction.ts +5 -4
- package/src/actions/smartAccount/sendTransactions.ts +3 -3
- package/src/actions/smartAccount/sendUserOperation.ts +4 -3
- package/src/actions/smartAccount/signMessage.ts +3 -3
- package/src/actions/smartAccount/signTypedData.ts +3 -3
- package/src/actions/smartAccount/signUserOperation.ts +4 -3
- package/src/actions/smartAccount/types.ts +23 -15
- package/src/actions/smartAccount/upgradeAccount.ts +3 -3
- package/src/actions/smartAccount/waitForUserOperationTransacation.ts +5 -5
- package/src/client/addBreadcrumb.ts +1 -1
- package/src/client/bundlerClient.ts +5 -5
- package/src/client/decorators/bundlerClient.ts +7 -7
- package/src/client/decorators/smartAccountClient.ts +20 -18
- package/src/client/isSmartAccountClient.ts +4 -4
- package/src/client/schema.ts +2 -2
- package/src/client/smartAccountClient.ts +14 -14
- package/src/client/types.ts +2 -2
- package/src/ens/utils.ts +1 -1
- package/src/entrypoint/0.6.ts +3 -3
- package/src/entrypoint/0.7.ts +4 -4
- package/src/entrypoint/index.ts +10 -9
- package/src/entrypoint/types.ts +30 -28
- package/src/errors/account.ts +1 -1
- package/src/errors/client.ts +3 -3
- package/src/errors/entrypoint.ts +2 -2
- package/src/errors/signer.ts +1 -1
- package/src/errors/useroperation.ts +6 -3
- package/src/index.ts +1 -0
- package/src/middleware/actions.ts +3 -3
- package/src/middleware/defaults/7702gasEstimator.ts +4 -4
- package/src/middleware/defaults/7702signer.ts +3 -3
- package/src/middleware/defaults/feeEstimator.ts +4 -4
- package/src/middleware/defaults/gasEstimator.ts +6 -6
- package/src/middleware/defaults/paymasterAndData.ts +1 -1
- package/src/middleware/defaults/userOpSigner.ts +2 -2
- package/src/middleware/erc7677middleware.ts +9 -9
- package/src/middleware/types.ts +7 -5
- package/src/signer/local-account.ts +7 -7
- package/src/signer/types.ts +3 -3
- package/src/signer/wallet-client.ts +2 -2
- package/src/transport/split.ts +1 -1
- package/src/types.ts +29 -29
- package/src/utils/bigint.ts +4 -4
- package/src/utils/defaults.ts +1 -1
- package/src/utils/index.ts +12 -9
- package/src/utils/schema.ts +2 -2
- package/src/utils/stateOverride.ts +4 -4
- package/src/utils/testUtils.ts +2 -2
- package/src/utils/traceHeader.ts +14 -11
- package/src/utils/types.ts +1 -1
- package/src/utils/userop.ts +17 -17
- package/src/version.ts +1 -1
|
@@ -21,7 +21,8 @@ export type UpgradeAccountParams<
|
|
|
21
21
|
TContext extends UserOperationContext | undefined =
|
|
22
22
|
| UserOperationContext
|
|
23
23
|
| undefined,
|
|
24
|
-
TEntryPointVersion extends
|
|
24
|
+
TEntryPointVersion extends
|
|
25
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
25
26
|
> = {
|
|
26
27
|
upgradeTo: UpgradeToData;
|
|
27
28
|
waitForTx?: boolean;
|
|
@@ -36,7 +37,8 @@ export type SendUserOperationParameters<
|
|
|
36
37
|
TContext extends UserOperationContext | undefined =
|
|
37
38
|
| UserOperationContext
|
|
38
39
|
| undefined,
|
|
39
|
-
TEntryPointVersion extends
|
|
40
|
+
TEntryPointVersion extends
|
|
41
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
40
42
|
> = {
|
|
41
43
|
uo: UserOperationCallData | BatchUserOperationCallData;
|
|
42
44
|
} & GetAccountParameter<TAccount> &
|
|
@@ -50,7 +52,8 @@ export type BuildUserOperationParameters<
|
|
|
50
52
|
TContext extends UserOperationContext | undefined =
|
|
51
53
|
| UserOperationContext
|
|
52
54
|
| undefined,
|
|
53
|
-
TEntryPointVersion extends
|
|
55
|
+
TEntryPointVersion extends
|
|
56
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
54
57
|
> = SendUserOperationParameters<TAccount, TContext, TEntryPointVersion>;
|
|
55
58
|
// [!endregion BuildUserOperationParameters]
|
|
56
59
|
|
|
@@ -59,10 +62,11 @@ export type SignUserOperationParameters<
|
|
|
59
62
|
TAccount extends SmartContractAccount | undefined =
|
|
60
63
|
| SmartContractAccount
|
|
61
64
|
| undefined,
|
|
62
|
-
TEntryPointVersion extends
|
|
65
|
+
TEntryPointVersion extends
|
|
66
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
63
67
|
TContext extends UserOperationContext | undefined =
|
|
64
68
|
| UserOperationContext
|
|
65
|
-
| undefined
|
|
69
|
+
| undefined,
|
|
66
70
|
> = {
|
|
67
71
|
uoStruct: UserOperationStruct<TEntryPointVersion>;
|
|
68
72
|
} & GetAccountParameter<TAccount> &
|
|
@@ -75,7 +79,8 @@ export type SendTransactionsParameters<
|
|
|
75
79
|
TContext extends UserOperationContext | undefined =
|
|
76
80
|
| UserOperationContext
|
|
77
81
|
| undefined,
|
|
78
|
-
TEntryPointVersion extends
|
|
82
|
+
TEntryPointVersion extends
|
|
83
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
79
84
|
> = {
|
|
80
85
|
requests: RpcTransactionRequest[];
|
|
81
86
|
} & GetAccountParameter<TAccount> &
|
|
@@ -89,7 +94,8 @@ export type BuildTransactionParameters<
|
|
|
89
94
|
TContext extends UserOperationContext | undefined =
|
|
90
95
|
| UserOperationContext
|
|
91
96
|
| undefined,
|
|
92
|
-
TEntryPointVersion extends
|
|
97
|
+
TEntryPointVersion extends
|
|
98
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
93
99
|
> = SendTransactionsParameters<TAccount, TContext, TEntryPointVersion>;
|
|
94
100
|
// [!endregion BuildTransactionParameters]
|
|
95
101
|
|
|
@@ -99,7 +105,8 @@ export type DropAndReplaceUserOperationParameters<
|
|
|
99
105
|
TContext extends UserOperationContext | undefined =
|
|
100
106
|
| UserOperationContext
|
|
101
107
|
| undefined,
|
|
102
|
-
TEntryPointVersion extends
|
|
108
|
+
TEntryPointVersion extends
|
|
109
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
103
110
|
> = {
|
|
104
111
|
uoToDrop: UserOperationRequest<TEntryPointVersion>;
|
|
105
112
|
} & GetAccountParameter<TAccount> &
|
|
@@ -134,7 +141,7 @@ export type WaitForUserOperationTxParameters = {
|
|
|
134
141
|
|
|
135
142
|
// [!region BuildUserOperationFromTransactionsResult]
|
|
136
143
|
export type BuildUserOperationFromTransactionsResult<
|
|
137
|
-
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
144
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion,
|
|
138
145
|
> = {
|
|
139
146
|
uoStruct: UserOperationStruct<TEntryPointVersion>;
|
|
140
147
|
batch: BatchUserOperationCallData;
|
|
@@ -149,10 +156,11 @@ export type UserOperationContext = Record<string, any>;
|
|
|
149
156
|
export type GetContextParameter<
|
|
150
157
|
TContext extends UserOperationContext | undefined =
|
|
151
158
|
| UserOperationContext
|
|
152
|
-
| undefined
|
|
153
|
-
> =
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
159
|
+
| undefined,
|
|
160
|
+
> =
|
|
161
|
+
IsUndefined<TContext> extends true
|
|
162
|
+
? {
|
|
163
|
+
context?: TContext;
|
|
164
|
+
}
|
|
165
|
+
: { context: TContext };
|
|
158
166
|
// [!endregion GetContextParameter]
|
|
@@ -16,10 +16,10 @@ export const upgradeAccount: <
|
|
|
16
16
|
| undefined,
|
|
17
17
|
TContext extends UserOperationContext | undefined =
|
|
18
18
|
| UserOperationContext
|
|
19
|
-
| undefined
|
|
19
|
+
| undefined,
|
|
20
20
|
>(
|
|
21
21
|
client: Client<TTransport, TChain, TAccount>,
|
|
22
|
-
args: UpgradeAccountParams<TAccount, TContext
|
|
22
|
+
args: UpgradeAccountParams<TAccount, TContext>,
|
|
23
23
|
) => Promise<Hash> = async (client_, args) => {
|
|
24
24
|
const client = clientHeaderTrack(client_, "upgradeAccount");
|
|
25
25
|
const {
|
|
@@ -38,7 +38,7 @@ export const upgradeAccount: <
|
|
|
38
38
|
throw new IncompatibleClientError(
|
|
39
39
|
"BaseSmartAccountClient",
|
|
40
40
|
"upgradeAccount",
|
|
41
|
-
client
|
|
41
|
+
client,
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -32,17 +32,17 @@ import { clientHeaderTrack } from "../../index.js";
|
|
|
32
32
|
*/
|
|
33
33
|
export const waitForUserOperationTransaction: <
|
|
34
34
|
TTransport extends Transport = Transport,
|
|
35
|
-
TChain extends Chain | undefined = Chain | undefined
|
|
35
|
+
TChain extends Chain | undefined = Chain | undefined,
|
|
36
36
|
>(
|
|
37
37
|
client: Client<TTransport, TChain, any>,
|
|
38
|
-
args: WaitForUserOperationTxParameters
|
|
38
|
+
args: WaitForUserOperationTxParameters,
|
|
39
39
|
) => Promise<Hex> = async (client_, args) => {
|
|
40
40
|
const client = clientHeaderTrack(client_, "waitForUserOperationTransaction");
|
|
41
41
|
if (!isBaseSmartAccountClient(client)) {
|
|
42
42
|
throw new IncompatibleClientError(
|
|
43
43
|
"BaseSmartAccountClient",
|
|
44
44
|
"waitForUserOperationTransaction",
|
|
45
|
-
client
|
|
45
|
+
client,
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -61,14 +61,14 @@ export const waitForUserOperationTransaction: <
|
|
|
61
61
|
Math.random() * 100;
|
|
62
62
|
|
|
63
63
|
await new Promise((resolve) =>
|
|
64
|
-
setTimeout(resolve, txRetryIntervalWithJitterMs)
|
|
64
|
+
setTimeout(resolve, txRetryIntervalWithJitterMs),
|
|
65
65
|
);
|
|
66
66
|
|
|
67
67
|
const receipt = await client
|
|
68
68
|
.getUserOperationReceipt(hash as `0x${string}`)
|
|
69
69
|
.catch((e) => {
|
|
70
70
|
Logger.error(
|
|
71
|
-
`[SmartAccountProvider] waitForUserOperationTransaction error fetching receipt for ${hash}: ${e}
|
|
71
|
+
`[SmartAccountProvider] waitForUserOperationTransaction error fetching receipt for ${hash}: ${e}`,
|
|
72
72
|
);
|
|
73
73
|
});
|
|
74
74
|
|
|
@@ -45,11 +45,11 @@ export type BundlerClient<T extends Transport = Transport> = Client<
|
|
|
45
45
|
* @returns {BundlerClient<T>} A bundler client that extends the functionality of the provided public client
|
|
46
46
|
*/
|
|
47
47
|
export const createBundlerClientFromExisting: <
|
|
48
|
-
T extends Transport | FallbackTransport = Transport
|
|
48
|
+
T extends Transport | FallbackTransport = Transport,
|
|
49
49
|
>(
|
|
50
|
-
client: PublicClient<T, Chain
|
|
50
|
+
client: PublicClient<T, Chain>,
|
|
51
51
|
) => BundlerClient<T> = <T extends Transport | FallbackTransport = Transport>(
|
|
52
|
-
client: PublicClient<T, Chain
|
|
52
|
+
client: PublicClient<T, Chain>,
|
|
53
53
|
): BundlerClient<T> => {
|
|
54
54
|
return client.extend(bundlerActions);
|
|
55
55
|
};
|
|
@@ -62,7 +62,7 @@ export const createBundlerClientFromExisting: <
|
|
|
62
62
|
* @returns {BundlerClient<TTransport>} a PublicClient with methods for calling Bundler RPC methods
|
|
63
63
|
*/
|
|
64
64
|
export function createBundlerClient<TTransport extends Transport>(
|
|
65
|
-
args: PublicClientConfig<TTransport, Chain> & { type?: string }
|
|
65
|
+
args: PublicClientConfig<TTransport, Chain> & { type?: string },
|
|
66
66
|
): BundlerClient<TTransport>;
|
|
67
67
|
|
|
68
68
|
/**
|
|
@@ -83,7 +83,7 @@ export function createBundlerClient<TTransport extends Transport>(
|
|
|
83
83
|
* @returns {BundlerClient} The created Bundler Client with extended public and bundler actions
|
|
84
84
|
*/
|
|
85
85
|
export function createBundlerClient(
|
|
86
|
-
args: PublicClientConfig & { type?: string }
|
|
86
|
+
args: PublicClientConfig & { type?: string },
|
|
87
87
|
): BundlerClient {
|
|
88
88
|
if (!args.chain) {
|
|
89
89
|
throw new ChainNotFoundError();
|
|
@@ -47,7 +47,7 @@ export type BundlerRpcSchema = [
|
|
|
47
47
|
Method: "eth_supportedEntryPoints";
|
|
48
48
|
Parameters: [];
|
|
49
49
|
ReturnType: Address[];
|
|
50
|
-
}
|
|
50
|
+
},
|
|
51
51
|
];
|
|
52
52
|
|
|
53
53
|
// [!region BundlerActions]
|
|
@@ -61,11 +61,11 @@ export type BundlerActions = {
|
|
|
61
61
|
* @returns the gas estimates for the given response
|
|
62
62
|
*/
|
|
63
63
|
estimateUserOperationGas<
|
|
64
|
-
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
64
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion,
|
|
65
65
|
>(
|
|
66
66
|
request: UserOperationRequest<TEntryPointVersion>,
|
|
67
67
|
entryPoint: Address,
|
|
68
|
-
stateOverride?: StateOverride
|
|
68
|
+
stateOverride?: StateOverride,
|
|
69
69
|
): Promise<UserOperationEstimateGasResponse<TEntryPointVersion>>;
|
|
70
70
|
|
|
71
71
|
/**
|
|
@@ -76,10 +76,10 @@ export type BundlerActions = {
|
|
|
76
76
|
* @returns the hash of the sent UserOperation
|
|
77
77
|
*/
|
|
78
78
|
sendRawUserOperation<
|
|
79
|
-
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
79
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion,
|
|
80
80
|
>(
|
|
81
81
|
request: UserOperationRequest<TEntryPointVersion>,
|
|
82
|
-
entryPoint: Address
|
|
82
|
+
entryPoint: Address,
|
|
83
83
|
): Promise<Hash>;
|
|
84
84
|
|
|
85
85
|
/**
|
|
@@ -122,9 +122,9 @@ export const bundlerActions: <
|
|
|
122
122
|
Chain | undefined,
|
|
123
123
|
any,
|
|
124
124
|
[...PublicRpcSchema, ...BundlerRpcSchema]
|
|
125
|
-
|
|
125
|
+
>,
|
|
126
126
|
>(
|
|
127
|
-
client: TClient
|
|
127
|
+
client: TClient,
|
|
128
128
|
) => BundlerActions = (client) => ({
|
|
129
129
|
estimateUserOperationGas: async (request, entryPoint, stateOverride) =>
|
|
130
130
|
estimateUserOperationGas(client, { request, entryPoint, stateOverride }),
|
|
@@ -64,64 +64,66 @@ export type BaseSmartAccountClientActions<
|
|
|
64
64
|
TContext extends UserOperationContext | undefined =
|
|
65
65
|
| UserOperationContext
|
|
66
66
|
| undefined,
|
|
67
|
-
TEntryPointVersion extends
|
|
67
|
+
TEntryPointVersion extends
|
|
68
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
68
69
|
> = {
|
|
69
70
|
buildUserOperation: (
|
|
70
|
-
args: BuildUserOperationParameters<TAccount, TContext
|
|
71
|
+
args: BuildUserOperationParameters<TAccount, TContext>,
|
|
71
72
|
) => Promise<UserOperationStruct<TEntryPointVersion>>;
|
|
72
73
|
buildUserOperationFromTx: (
|
|
73
74
|
args: SendTransactionParameters<TChain, TAccount>,
|
|
74
75
|
overrides?: UserOperationOverrides<TEntryPointVersion>,
|
|
75
|
-
context?: TContext
|
|
76
|
+
context?: TContext,
|
|
76
77
|
) => Promise<UserOperationStruct<TEntryPointVersion>>;
|
|
77
78
|
buildUserOperationFromTxs: (
|
|
78
|
-
args: BuildTransactionParameters<TAccount, TContext
|
|
79
|
+
args: BuildTransactionParameters<TAccount, TContext>,
|
|
79
80
|
) => Promise<BuildUserOperationFromTransactionsResult<TEntryPointVersion>>;
|
|
80
81
|
checkGasSponsorshipEligibility: <
|
|
81
82
|
TContext extends UserOperationContext | undefined =
|
|
82
83
|
| UserOperationContext
|
|
83
84
|
| undefined,
|
|
84
|
-
TEntryPointVersion extends
|
|
85
|
+
TEntryPointVersion extends
|
|
86
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
85
87
|
>(
|
|
86
|
-
args: SendUserOperationParameters<TAccount, TContext
|
|
88
|
+
args: SendUserOperationParameters<TAccount, TContext>,
|
|
87
89
|
) => Promise<
|
|
88
90
|
CheckGasSponsorshipEligibilityResult<TAccount, TEntryPointVersion>
|
|
89
91
|
>;
|
|
90
92
|
signUserOperation: (
|
|
91
|
-
args: SignUserOperationParameters<TAccount, TEntryPointVersion, TContext
|
|
93
|
+
args: SignUserOperationParameters<TAccount, TEntryPointVersion, TContext>,
|
|
92
94
|
) => Promise<UserOperationRequest<TEntryPointVersion>>;
|
|
93
95
|
dropAndReplaceUserOperation: (
|
|
94
|
-
args: DropAndReplaceUserOperationParameters<TAccount, TContext
|
|
96
|
+
args: DropAndReplaceUserOperationParameters<TAccount, TContext>,
|
|
95
97
|
) => Promise<SendUserOperationResult<TEntryPointVersion>>;
|
|
96
98
|
// TODO: for v4 we should combine override and context into an `opts` parameter
|
|
97
99
|
// which wraps both of these properties so we can use GetContextParameter
|
|
98
100
|
sendTransaction: <TChainOverride extends Chain | undefined = undefined>(
|
|
99
101
|
args: SendTransactionParameters<TChain, TAccount, TChainOverride>,
|
|
100
102
|
overrides?: UserOperationOverrides<TEntryPointVersion>,
|
|
101
|
-
context?: TContext
|
|
103
|
+
context?: TContext,
|
|
102
104
|
) => Promise<Hex>;
|
|
103
105
|
sendTransactions: (
|
|
104
|
-
args: SendTransactionsParameters<TAccount, TContext
|
|
106
|
+
args: SendTransactionsParameters<TAccount, TContext>,
|
|
105
107
|
) => Promise<Hex>;
|
|
106
108
|
sendUserOperation: (
|
|
107
109
|
args: SendUserOperationParameters<
|
|
108
110
|
TAccount,
|
|
109
111
|
TContext,
|
|
110
112
|
GetEntryPointFromAccount<TAccount>
|
|
111
|
-
|
|
113
|
+
>,
|
|
112
114
|
) => Promise<SendUserOperationResult<TEntryPointVersion>>;
|
|
113
115
|
waitForUserOperationTransaction: (
|
|
114
|
-
args: WaitForUserOperationTxParameters
|
|
116
|
+
args: WaitForUserOperationTxParameters,
|
|
115
117
|
) => Promise<Hex>;
|
|
116
118
|
upgradeAccount: (
|
|
117
|
-
args: UpgradeAccountParams<TAccount, TContext
|
|
119
|
+
args: UpgradeAccountParams<TAccount, TContext>,
|
|
118
120
|
) => Promise<Hex>;
|
|
119
121
|
signMessage: (args: SignMessageParameters<TAccount>) => Promise<Hex>;
|
|
120
122
|
signTypedData: <
|
|
121
123
|
const TTypedData extends TypedData | { [key: string]: unknown },
|
|
122
|
-
TPrimaryType extends string = string
|
|
124
|
+
TPrimaryType extends string = string,
|
|
123
125
|
>(
|
|
124
|
-
args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount
|
|
126
|
+
args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>,
|
|
125
127
|
) => Promise<Hex>;
|
|
126
128
|
} & (IsUndefined<TAccount> extends false
|
|
127
129
|
? { getAddress: () => Address }
|
|
@@ -146,9 +148,9 @@ export const smartAccountClientActions: <
|
|
|
146
148
|
| undefined,
|
|
147
149
|
TContext extends UserOperationContext | undefined =
|
|
148
150
|
| UserOperationContext
|
|
149
|
-
| undefined
|
|
151
|
+
| undefined,
|
|
150
152
|
>(
|
|
151
|
-
client: Client<TTransport, TChain, TAccount
|
|
153
|
+
client: Client<TTransport, TChain, TAccount>,
|
|
152
154
|
) => BaseSmartAccountClientActions<TChain, TAccount, TContext> = (client) => ({
|
|
153
155
|
buildUserOperation: (args) => buildUserOperation(client, args),
|
|
154
156
|
buildUserOperationFromTx: (args, overrides, context) =>
|
|
@@ -173,7 +175,7 @@ export const smartAccountClientActions: <
|
|
|
173
175
|
|
|
174
176
|
export const smartAccountClientMethodKeys = Object.keys(
|
|
175
177
|
// @ts-expect-error we just want to get the keys
|
|
176
|
-
smartAccountClientActions(undefined)
|
|
178
|
+
smartAccountClientActions(undefined),
|
|
177
179
|
).reduce((accum, curr) => {
|
|
178
180
|
accum.add(curr);
|
|
179
181
|
return accum;
|
|
@@ -19,9 +19,9 @@ export function isSmartAccountClient<
|
|
|
19
19
|
TChain extends Chain | undefined = Chain | undefined,
|
|
20
20
|
TAccount extends SmartContractAccount | undefined =
|
|
21
21
|
| SmartContractAccount
|
|
22
|
-
| undefined
|
|
22
|
+
| undefined,
|
|
23
23
|
>(
|
|
24
|
-
client: Client<TTransport, TChain, TAccount
|
|
24
|
+
client: Client<TTransport, TChain, TAccount>,
|
|
25
25
|
): client is SmartAccountClient<TTransport, TChain, TAccount> {
|
|
26
26
|
for (const key of smartAccountClientMethodKeys) {
|
|
27
27
|
if (!(key in client)) {
|
|
@@ -45,9 +45,9 @@ export function isBaseSmartAccountClient<
|
|
|
45
45
|
TChain extends Chain | undefined = Chain | undefined,
|
|
46
46
|
TAccount extends SmartContractAccount | undefined =
|
|
47
47
|
| SmartContractAccount
|
|
48
|
-
| undefined
|
|
48
|
+
| undefined,
|
|
49
49
|
>(
|
|
50
|
-
client: Client<TTransport, TChain, TAccount
|
|
50
|
+
client: Client<TTransport, TChain, TAccount>,
|
|
51
51
|
): client is BaseSmartAccountClient<TTransport, TChain, TAccount> {
|
|
52
52
|
return client && "middleware" in client;
|
|
53
53
|
}
|
package/src/client/schema.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { BigNumberishRangeSchema, MultiplierSchema } from "../utils/index.js";
|
|
|
5
5
|
import type { BundlerClient } from "./bundlerClient.js";
|
|
6
6
|
|
|
7
7
|
export const createPublicErc4337ClientSchema = <
|
|
8
|
-
TTransport extends Transport = Transport
|
|
8
|
+
TTransport extends Transport = Transport,
|
|
9
9
|
>() =>
|
|
10
10
|
z.custom<BundlerClient<TTransport>>((provider) => {
|
|
11
11
|
return (
|
|
@@ -45,7 +45,7 @@ export const ConnectionConfigSchema = z.intersection(
|
|
|
45
45
|
]),
|
|
46
46
|
z.object({
|
|
47
47
|
chainAgnosticUrl: z.string().optional(),
|
|
48
|
-
})
|
|
48
|
+
}),
|
|
49
49
|
);
|
|
50
50
|
// [!endregion ConnectionConfigSchema]
|
|
51
51
|
|
|
@@ -41,7 +41,7 @@ export type SmartAccountClientConfig<
|
|
|
41
41
|
| undefined,
|
|
42
42
|
context extends UserOperationContext | undefined =
|
|
43
43
|
| UserOperationContext
|
|
44
|
-
| undefined
|
|
44
|
+
| undefined,
|
|
45
45
|
> = Prettify<
|
|
46
46
|
Pick<
|
|
47
47
|
ClientConfig<transport, chain, account>,
|
|
@@ -69,7 +69,7 @@ export type SmartAccountClientConfig<
|
|
|
69
69
|
|
|
70
70
|
export type SmartAccountClientRpcSchema = [
|
|
71
71
|
...BundlerRpcSchema,
|
|
72
|
-
...PublicRpcSchema
|
|
72
|
+
...PublicRpcSchema,
|
|
73
73
|
];
|
|
74
74
|
|
|
75
75
|
// [!region SmartAccountClientActions]
|
|
@@ -80,7 +80,7 @@ export type SmartAccountClientActions<
|
|
|
80
80
|
| undefined,
|
|
81
81
|
context extends UserOperationContext | undefined =
|
|
82
82
|
| UserOperationContext
|
|
83
|
-
| undefined
|
|
83
|
+
| undefined,
|
|
84
84
|
> = BaseSmartAccountClientActions<chain, account, context> &
|
|
85
85
|
BundlerActions &
|
|
86
86
|
PublicActions;
|
|
@@ -97,7 +97,7 @@ export type SmartAccountClient<
|
|
|
97
97
|
rpcSchema extends RpcSchema = SmartAccountClientRpcSchema,
|
|
98
98
|
context extends UserOperationContext | undefined =
|
|
99
99
|
| UserOperationContext
|
|
100
|
-
| undefined
|
|
100
|
+
| undefined,
|
|
101
101
|
> = Prettify<
|
|
102
102
|
Client<
|
|
103
103
|
transport,
|
|
@@ -117,7 +117,7 @@ export type BaseSmartAccountClient<
|
|
|
117
117
|
| undefined,
|
|
118
118
|
context extends UserOperationContext | undefined =
|
|
119
119
|
| UserOperationContext
|
|
120
|
-
| undefined
|
|
120
|
+
| undefined,
|
|
121
121
|
> = Prettify<
|
|
122
122
|
Client<
|
|
123
123
|
transport,
|
|
@@ -140,9 +140,9 @@ export function createSmartAccountClient<
|
|
|
140
140
|
| undefined,
|
|
141
141
|
TContext extends UserOperationContext | undefined =
|
|
142
142
|
| UserOperationContext
|
|
143
|
-
| undefined
|
|
143
|
+
| undefined,
|
|
144
144
|
>(
|
|
145
|
-
config: SmartAccountClientConfig<TTransport, TChain, TAccount, TContext
|
|
145
|
+
config: SmartAccountClientConfig<TTransport, TChain, TAccount, TContext>,
|
|
146
146
|
): SmartAccountClient<TTransport, TChain, TAccount>;
|
|
147
147
|
|
|
148
148
|
/**
|
|
@@ -166,7 +166,7 @@ export function createSmartAccountClient<
|
|
|
166
166
|
* @returns {SmartAccountClient} A smart account client capable of handling transactions, message signing, and other operations on a smart account
|
|
167
167
|
*/
|
|
168
168
|
export function createSmartAccountClient(
|
|
169
|
-
config: SmartAccountClientConfig
|
|
169
|
+
config: SmartAccountClientConfig,
|
|
170
170
|
): SmartAccountClient {
|
|
171
171
|
const {
|
|
172
172
|
key = "account",
|
|
@@ -222,7 +222,7 @@ export function createSmartAccountClient(
|
|
|
222
222
|
address?.toLowerCase() !== client.account.address.toLowerCase()
|
|
223
223
|
) {
|
|
224
224
|
throw new Error(
|
|
225
|
-
"cannot sign for address that is not the current account"
|
|
225
|
+
"cannot sign for address that is not the current account",
|
|
226
226
|
);
|
|
227
227
|
}
|
|
228
228
|
return client.signMessage({
|
|
@@ -238,7 +238,7 @@ export function createSmartAccountClient(
|
|
|
238
238
|
address?.toLowerCase() !== client.account.address.toLowerCase()
|
|
239
239
|
) {
|
|
240
240
|
throw new Error(
|
|
241
|
-
"cannot sign for address that is not the current account"
|
|
241
|
+
"cannot sign for address that is not the current account",
|
|
242
242
|
);
|
|
243
243
|
}
|
|
244
244
|
return client.signMessage({
|
|
@@ -255,7 +255,7 @@ export function createSmartAccountClient(
|
|
|
255
255
|
address?.toLowerCase() !== client.account.address.toLowerCase()
|
|
256
256
|
) {
|
|
257
257
|
throw new Error(
|
|
258
|
-
"cannot sign for address that is not the current account"
|
|
258
|
+
"cannot sign for address that is not the current account",
|
|
259
259
|
);
|
|
260
260
|
}
|
|
261
261
|
try {
|
|
@@ -317,12 +317,12 @@ export function createSmartAccountClientFromExisting<
|
|
|
317
317
|
TRpcSchema extends SmartAccountClientRpcSchema = SmartAccountClientRpcSchema,
|
|
318
318
|
TContext extends UserOperationContext | undefined =
|
|
319
319
|
| UserOperationContext
|
|
320
|
-
| undefined
|
|
320
|
+
| undefined,
|
|
321
321
|
>(
|
|
322
322
|
config: Omit<
|
|
323
323
|
SmartAccountClientConfig<Transport, TChain, TAccount, TContext>,
|
|
324
324
|
"transport" | "chain"
|
|
325
|
-
> & { client: TClient }
|
|
325
|
+
> & { client: TClient },
|
|
326
326
|
): SmartAccountClient<
|
|
327
327
|
CustomTransport,
|
|
328
328
|
TChain,
|
|
@@ -356,7 +356,7 @@ export function createSmartAccountClientFromExisting<
|
|
|
356
356
|
export function createSmartAccountClientFromExisting(
|
|
357
357
|
config: Omit<SmartAccountClientConfig, "transport" | "chain"> & {
|
|
358
358
|
client: BundlerClient;
|
|
359
|
-
}
|
|
359
|
+
},
|
|
360
360
|
): SmartAccountClient {
|
|
361
361
|
return createSmartAccountClient({
|
|
362
362
|
...config,
|
package/src/client/types.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type ConnectionConfig = z.input<typeof ConnectionConfigSchema>;
|
|
|
15
15
|
|
|
16
16
|
// [!region SendUserOperationResult]
|
|
17
17
|
export type SendUserOperationResult<
|
|
18
|
-
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
18
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion,
|
|
19
19
|
> = {
|
|
20
20
|
hash: Hash;
|
|
21
21
|
request: UserOperationRequest<TEntryPointVersion>;
|
|
@@ -33,6 +33,6 @@ export type UpgradeToData = {
|
|
|
33
33
|
export type ClientMiddlewareConfig<
|
|
34
34
|
TContext extends UserOperationContext | undefined =
|
|
35
35
|
| UserOperationContext
|
|
36
|
-
| undefined
|
|
36
|
+
| undefined,
|
|
37
37
|
> = Partial<ClientMiddleware<TContext>>;
|
|
38
38
|
// [!endregion ClientMiddlewareConfig]
|
package/src/ens/utils.ts
CHANGED
package/src/entrypoint/0.6.ts
CHANGED
|
@@ -40,7 +40,7 @@ const packUserOperation = (request: UserOperationRequest<"0.6.0">): Hex => {
|
|
|
40
40
|
hexToBigInt(request.maxFeePerGas),
|
|
41
41
|
hexToBigInt(request.maxPriorityFeePerGas),
|
|
42
42
|
hashedPaymasterAndData,
|
|
43
|
-
]
|
|
43
|
+
],
|
|
44
44
|
);
|
|
45
45
|
};
|
|
46
46
|
|
|
@@ -56,7 +56,7 @@ export default {
|
|
|
56
56
|
getUserOperationHash: (
|
|
57
57
|
request: UserOperationRequest<"0.6.0">,
|
|
58
58
|
entryPointAddress: Address,
|
|
59
|
-
chainId: number
|
|
59
|
+
chainId: number,
|
|
60
60
|
): Hash => {
|
|
61
61
|
const encoded = encodeAbiParameters(
|
|
62
62
|
[{ type: "bytes32" }, { type: "address" }, { type: "uint256" }],
|
|
@@ -64,7 +64,7 @@ export default {
|
|
|
64
64
|
keccak256(packUserOperation(request)),
|
|
65
65
|
entryPointAddress,
|
|
66
66
|
BigInt(chainId),
|
|
67
|
-
]
|
|
67
|
+
],
|
|
68
68
|
);
|
|
69
69
|
|
|
70
70
|
return keccak256(encoded);
|
package/src/entrypoint/0.7.ts
CHANGED
|
@@ -62,7 +62,7 @@ const packUserOperation = (request: UserOperationRequest<"0.7.0">): Hex => {
|
|
|
62
62
|
hexToBigInt(request.preVerificationGas),
|
|
63
63
|
gasFees,
|
|
64
64
|
keccak256(paymasterAndData),
|
|
65
|
-
]
|
|
65
|
+
],
|
|
66
66
|
);
|
|
67
67
|
};
|
|
68
68
|
|
|
@@ -78,7 +78,7 @@ export default {
|
|
|
78
78
|
getUserOperationHash: (
|
|
79
79
|
request: UserOperationRequest<"0.7.0">,
|
|
80
80
|
entryPointAddress: Address,
|
|
81
|
-
chainId: number
|
|
81
|
+
chainId: number,
|
|
82
82
|
): Hash => {
|
|
83
83
|
const encoded = encodeAbiParameters(
|
|
84
84
|
[{ type: "bytes32" }, { type: "address" }, { type: "uint256" }],
|
|
@@ -86,7 +86,7 @@ export default {
|
|
|
86
86
|
keccak256(packUserOperation(request)),
|
|
87
87
|
entryPointAddress,
|
|
88
88
|
BigInt(chainId),
|
|
89
|
-
]
|
|
89
|
+
],
|
|
90
90
|
);
|
|
91
91
|
|
|
92
92
|
return keccak256(encoded);
|
|
@@ -98,7 +98,7 @@ export default {
|
|
|
98
98
|
export function packAccountGasLimits(
|
|
99
99
|
data:
|
|
100
100
|
| Pick<UserOperationRequest_v7, "verificationGasLimit" | "callGasLimit">
|
|
101
|
-
| Pick<UserOperationRequest_v7, "maxPriorityFeePerGas" | "maxFeePerGas"
|
|
101
|
+
| Pick<UserOperationRequest_v7, "maxPriorityFeePerGas" | "maxFeePerGas">,
|
|
102
102
|
): Hex {
|
|
103
103
|
return concat(Object.values(data).map((v) => pad(v, { size: 16 })));
|
|
104
104
|
}
|
package/src/entrypoint/index.ts
CHANGED
|
@@ -32,30 +32,31 @@ export const entryPointRegistry: EntryPointRegistry = {
|
|
|
32
32
|
* @returns {boolean} true if the value is a valid key of EntryPointRegistry, false otherwise
|
|
33
33
|
*/
|
|
34
34
|
export const isEntryPointVersion = (
|
|
35
|
-
value: any
|
|
35
|
+
value: any,
|
|
36
36
|
): value is keyof EntryPointRegistry => {
|
|
37
37
|
return Object.keys(entryPointRegistry).includes(value);
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
export function getEntryPoint<
|
|
41
41
|
TEntryPointVersion extends EntryPointVersion = DefaultEntryPointVersion,
|
|
42
|
-
TChain extends Chain = Chain
|
|
42
|
+
TChain extends Chain = Chain,
|
|
43
43
|
>(
|
|
44
44
|
chain: TChain,
|
|
45
|
-
options: GetEntryPointOptions<TEntryPointVersion
|
|
45
|
+
options: GetEntryPointOptions<TEntryPointVersion>,
|
|
46
46
|
): EntryPointDefRegistry<TChain>[TEntryPointVersion];
|
|
47
47
|
|
|
48
48
|
export function getEntryPoint<
|
|
49
|
-
TEntryPointVersion extends
|
|
50
|
-
|
|
49
|
+
TEntryPointVersion extends
|
|
50
|
+
DefaultEntryPointVersion = DefaultEntryPointVersion,
|
|
51
|
+
TChain extends Chain = Chain,
|
|
51
52
|
>(
|
|
52
53
|
chain: TChain,
|
|
53
|
-
options?: GetEntryPointOptions<TEntryPointVersion
|
|
54
|
+
options?: GetEntryPointOptions<TEntryPointVersion>,
|
|
54
55
|
): EntryPointDefRegistry<TChain>[TEntryPointVersion];
|
|
55
56
|
|
|
56
57
|
export function getEntryPoint<TChain extends Chain = Chain>(
|
|
57
58
|
chain: TChain,
|
|
58
|
-
options?: GetEntryPointOptions<DefaultEntryPointVersion
|
|
59
|
+
options?: GetEntryPointOptions<DefaultEntryPointVersion>,
|
|
59
60
|
): EntryPointDefRegistry<TChain>[DefaultEntryPointVersion];
|
|
60
61
|
|
|
61
62
|
/**
|
|
@@ -76,10 +77,10 @@ export function getEntryPoint<TChain extends Chain = Chain>(
|
|
|
76
77
|
*/
|
|
77
78
|
export function getEntryPoint<
|
|
78
79
|
TEntryPointVersion extends EntryPointVersion,
|
|
79
|
-
TChain extends Chain = Chain
|
|
80
|
+
TChain extends Chain = Chain,
|
|
80
81
|
>(
|
|
81
82
|
chain: TChain,
|
|
82
|
-
options: GetEntryPointOptions<TEntryPointVersion
|
|
83
|
+
options: GetEntryPointOptions<TEntryPointVersion>,
|
|
83
84
|
): EntryPointDefRegistry<TChain>[EntryPointVersion] {
|
|
84
85
|
const { version = defaultEntryPointVersion, addressOverride } = options ?? {
|
|
85
86
|
version: defaultEntryPointVersion,
|