@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
|
@@ -68,12 +68,13 @@ export async function buildUserOperationFromTx<
|
|
|
68
68
|
TContext extends UserOperationContext | undefined =
|
|
69
69
|
| UserOperationContext
|
|
70
70
|
| undefined,
|
|
71
|
-
TEntryPointVersion extends
|
|
71
|
+
TEntryPointVersion extends
|
|
72
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
72
73
|
>(
|
|
73
74
|
client_: Client<Transport, TChain, TAccount>,
|
|
74
75
|
args: SendTransactionParameters<TChain, TAccount, TChainOverride>,
|
|
75
76
|
overrides?: UserOperationOverrides<TEntryPointVersion>,
|
|
76
|
-
context?: TContext
|
|
77
|
+
context?: TContext,
|
|
77
78
|
): Promise<UserOperationStruct<TEntryPointVersion>> {
|
|
78
79
|
const client = clientHeaderTrack(client_, "buildUserOperationFromTx");
|
|
79
80
|
const { account = client.account, ...request } = args;
|
|
@@ -89,7 +90,7 @@ export async function buildUserOperationFromTx<
|
|
|
89
90
|
throw new IncompatibleClientError(
|
|
90
91
|
"BaseSmartAccountClient",
|
|
91
92
|
"buildUserOperationFromTx",
|
|
92
|
-
client
|
|
93
|
+
client,
|
|
93
94
|
);
|
|
94
95
|
}
|
|
95
96
|
|
|
@@ -77,13 +77,14 @@ export async function buildUserOperationFromTxs<
|
|
|
77
77
|
TAccount extends SmartContractAccount | undefined =
|
|
78
78
|
| SmartContractAccount
|
|
79
79
|
| undefined,
|
|
80
|
-
TEntryPointVersion extends
|
|
80
|
+
TEntryPointVersion extends
|
|
81
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
81
82
|
TContext extends UserOperationContext | undefined =
|
|
82
83
|
| UserOperationContext
|
|
83
|
-
| undefined
|
|
84
|
+
| undefined,
|
|
84
85
|
>(
|
|
85
86
|
client_: Client<TTransport, TChain, TAccount>,
|
|
86
|
-
args: BuildTransactionParameters<TAccount, TContext, TEntryPointVersion
|
|
87
|
+
args: BuildTransactionParameters<TAccount, TContext, TEntryPointVersion>,
|
|
87
88
|
): Promise<BuildUserOperationFromTransactionsResult<TEntryPointVersion>> {
|
|
88
89
|
const client = clientHeaderTrack(client_, "buildUserOperationFromTxs");
|
|
89
90
|
const { account = client.account, requests, overrides, context } = args;
|
|
@@ -95,7 +96,7 @@ export async function buildUserOperationFromTxs<
|
|
|
95
96
|
throw new IncompatibleClientError(
|
|
96
97
|
"BaseSmartAccountClient",
|
|
97
98
|
"buildUserOperationFromTxs",
|
|
98
|
-
client
|
|
99
|
+
client,
|
|
99
100
|
);
|
|
100
101
|
}
|
|
101
102
|
|
|
@@ -119,8 +120,8 @@ export async function buildUserOperationFromTxs<
|
|
|
119
120
|
overrides?.maxFeePerGas != null
|
|
120
121
|
? overrides?.maxFeePerGas
|
|
121
122
|
: mfpgOverridesInTx().length > 0
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
? bigIntMax(...mfpgOverridesInTx())
|
|
124
|
+
: undefined;
|
|
124
125
|
|
|
125
126
|
const mpfpgOverridesInTx = () =>
|
|
126
127
|
requests
|
|
@@ -130,8 +131,8 @@ export async function buildUserOperationFromTxs<
|
|
|
130
131
|
overrides?.maxPriorityFeePerGas != null
|
|
131
132
|
? overrides?.maxPriorityFeePerGas
|
|
132
133
|
: mpfpgOverridesInTx().length > 0
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
? bigIntMax(...mpfpgOverridesInTx())
|
|
135
|
+
: undefined;
|
|
135
136
|
|
|
136
137
|
const _overrides = {
|
|
137
138
|
maxFeePerGas,
|
|
@@ -18,7 +18,8 @@ export type CheckGasSponsorshipEligibilityResult<
|
|
|
18
18
|
TAccount extends SmartContractAccount | undefined =
|
|
19
19
|
| SmartContractAccount
|
|
20
20
|
| undefined,
|
|
21
|
-
TEntryPointVersion extends
|
|
21
|
+
TEntryPointVersion extends
|
|
22
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
22
23
|
> = {
|
|
23
24
|
eligible: boolean;
|
|
24
25
|
request?: UserOperationStruct<TEntryPointVersion>;
|
|
@@ -60,10 +61,10 @@ export function checkGasSponsorshipEligibility<
|
|
|
60
61
|
| undefined,
|
|
61
62
|
TContext extends UserOperationContext | undefined =
|
|
62
63
|
| UserOperationContext
|
|
63
|
-
| undefined
|
|
64
|
+
| undefined,
|
|
64
65
|
>(
|
|
65
66
|
client_: Client<TTransport, TChain, TAccount>,
|
|
66
|
-
args: SendUserOperationParameters<TAccount, TContext
|
|
67
|
+
args: SendUserOperationParameters<TAccount, TContext>,
|
|
67
68
|
): Promise<CheckGasSponsorshipEligibilityResult<TAccount>> {
|
|
68
69
|
const client = clientHeaderTrack(client_, "checkGasSponsorshipEligibility");
|
|
69
70
|
const { account = client.account, overrides, context } = args;
|
|
@@ -76,7 +77,7 @@ export function checkGasSponsorshipEligibility<
|
|
|
76
77
|
throw new IncompatibleClientError(
|
|
77
78
|
"BaseSmartAccountClient",
|
|
78
79
|
"checkGasSponsorshipEligibility",
|
|
79
|
-
client
|
|
80
|
+
client,
|
|
80
81
|
);
|
|
81
82
|
}
|
|
82
83
|
|
|
@@ -56,10 +56,11 @@ export async function dropAndReplaceUserOperation<
|
|
|
56
56
|
TContext extends UserOperationContext | undefined =
|
|
57
57
|
| UserOperationContext
|
|
58
58
|
| undefined,
|
|
59
|
-
TEntryPointVersion extends
|
|
59
|
+
TEntryPointVersion extends
|
|
60
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
60
61
|
>(
|
|
61
62
|
client_: Client<TTransport, TChain, TAccount>,
|
|
62
|
-
args: DropAndReplaceUserOperationParameters<TAccount, TContext
|
|
63
|
+
args: DropAndReplaceUserOperationParameters<TAccount, TContext>,
|
|
63
64
|
): Promise<SendUserOperationResult<TEntryPointVersion>> {
|
|
64
65
|
const client = clientHeaderTrack(client_, "dropAndReplaceUserOperation");
|
|
65
66
|
const { account = client.account, uoToDrop, overrides, context } = args;
|
|
@@ -70,7 +71,7 @@ export async function dropAndReplaceUserOperation<
|
|
|
70
71
|
throw new IncompatibleClientError(
|
|
71
72
|
"BaseSmartAccountClient",
|
|
72
73
|
"dropAndReplaceUserOperation",
|
|
73
|
-
client
|
|
74
|
+
client,
|
|
74
75
|
);
|
|
75
76
|
}
|
|
76
77
|
|
|
@@ -105,18 +106,18 @@ export async function dropAndReplaceUserOperation<
|
|
|
105
106
|
// however, we have migrated to using erc7677middleware for alchemy paymaster flows
|
|
106
107
|
// and most of the other paymasters we've seen don't do fee estimation
|
|
107
108
|
const { maxFeePerGas, maxPriorityFeePerGas } = await resolveProperties(
|
|
108
|
-
await client.middleware.feeEstimator(uoToSubmit, { account, client })
|
|
109
|
+
await client.middleware.feeEstimator(uoToSubmit, { account, client }),
|
|
109
110
|
);
|
|
110
111
|
|
|
111
112
|
const _overrides = {
|
|
112
113
|
...overrides,
|
|
113
114
|
maxFeePerGas: bigIntMax(
|
|
114
115
|
BigInt(maxFeePerGas ?? 0n),
|
|
115
|
-
bigIntMultiply(uoToDrop.maxFeePerGas, 1.1)
|
|
116
|
+
bigIntMultiply(uoToDrop.maxFeePerGas, 1.1),
|
|
116
117
|
),
|
|
117
118
|
maxPriorityFeePerGas: bigIntMax(
|
|
118
119
|
BigInt(maxPriorityFeePerGas ?? 0n),
|
|
119
|
-
bigIntMultiply(uoToDrop.maxPriorityFeePerGas, 1.1)
|
|
120
|
+
bigIntMultiply(uoToDrop.maxPriorityFeePerGas, 1.1),
|
|
120
121
|
),
|
|
121
122
|
} as UserOperationOverrides<TEntryPointVersion>;
|
|
122
123
|
|
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
UserOperationContext,
|
|
15
15
|
} from "./types.js";
|
|
16
16
|
import { clientHeaderTrack } from "../../index.js";
|
|
17
|
+
import { getUserOperationError } from "./getUserOperationError.js";
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Description SmartAccountClientAction for estimating the gas cost of a user operation
|
|
@@ -37,10 +38,11 @@ export async function estimateUserOperationGas<
|
|
|
37
38
|
TContext extends UserOperationContext | undefined =
|
|
38
39
|
| UserOperationContext
|
|
39
40
|
| undefined,
|
|
40
|
-
TEntryPointVersion extends
|
|
41
|
+
TEntryPointVersion extends
|
|
42
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
41
43
|
>(
|
|
42
44
|
client_: Client<TTransport, TChain, TAccount>,
|
|
43
|
-
args: SendUserOperationParameters<TAccount, TContext
|
|
45
|
+
args: SendUserOperationParameters<TAccount, TContext>,
|
|
44
46
|
): Promise<UserOperationEstimateGasResponse<TEntryPointVersion>> {
|
|
45
47
|
const client = clientHeaderTrack(client_, "estimateUserOperationGas");
|
|
46
48
|
const { account = client.account, overrides } = args;
|
|
@@ -52,16 +54,21 @@ export async function estimateUserOperationGas<
|
|
|
52
54
|
throw new IncompatibleClientError(
|
|
53
55
|
"BaseSmartAccountClient",
|
|
54
56
|
"estimateUserOperationGas",
|
|
55
|
-
client
|
|
57
|
+
client,
|
|
56
58
|
);
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
return _initUserOperation(client, args).then(async (struct) => {
|
|
60
62
|
const request = deepHexlify(await resolveProperties(struct));
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
try {
|
|
64
|
+
return await client.estimateUserOperationGas(
|
|
65
|
+
request,
|
|
66
|
+
account.getEntryPoint().address,
|
|
67
|
+
overrides?.stateOverride,
|
|
68
|
+
);
|
|
69
|
+
} catch (err) {
|
|
70
|
+
getUserOperationError(client, request, account.getEntryPoint());
|
|
71
|
+
throw err;
|
|
72
|
+
}
|
|
66
73
|
});
|
|
67
74
|
}
|
|
@@ -11,10 +11,10 @@ export const getAddress: <
|
|
|
11
11
|
TChain extends Chain | undefined = Chain | undefined,
|
|
12
12
|
TAccount extends SmartContractAccount | undefined =
|
|
13
13
|
| SmartContractAccount
|
|
14
|
-
| undefined
|
|
14
|
+
| undefined,
|
|
15
15
|
>(
|
|
16
16
|
client: Client<TTransport, TChain, TAccount>,
|
|
17
|
-
args: GetAccountParameter<TAccount
|
|
17
|
+
args: GetAccountParameter<TAccount>,
|
|
18
18
|
) => Address = (client, args) => {
|
|
19
19
|
const { account } = args ?? { account: client.account };
|
|
20
20
|
if (!account) {
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fromHex,
|
|
3
|
+
concat,
|
|
4
|
+
isAddress,
|
|
5
|
+
decodeErrorResult,
|
|
6
|
+
type Chain,
|
|
7
|
+
type Transport,
|
|
8
|
+
} from "viem";
|
|
9
|
+
import { AccountNotFoundError } from "../../errors/account.js";
|
|
10
|
+
import type { BaseSmartAccountClient } from "../../client/smartAccountClient";
|
|
11
|
+
import type { SmartContractAccount } from "../../account/smartContractAccount.js";
|
|
12
|
+
import type { UserOperationRequest } from "../../types.js";
|
|
13
|
+
import type { EntryPointDef } from "../../index.js";
|
|
14
|
+
import { deepHexlify } from "../../utils/index.js";
|
|
15
|
+
import {
|
|
16
|
+
packAccountGasLimits,
|
|
17
|
+
packPaymasterData,
|
|
18
|
+
} from "../../entrypoint/0.7.js";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Retrieves the error message from an entrypoint for a User Operation.
|
|
22
|
+
*
|
|
23
|
+
* @param {Client<TTransport, TChain, TAccount>} client the smart account client to use for RPC requests
|
|
24
|
+
* @param {UserOperationRequest} request the uo request to get the error for
|
|
25
|
+
* @param {EntryPointDef} entryPoint the entrypoint instance to send the uo to
|
|
26
|
+
* @returns {string} the error message from the entrypoint
|
|
27
|
+
*/
|
|
28
|
+
export async function getUserOperationError<
|
|
29
|
+
TTransport extends Transport = Transport,
|
|
30
|
+
TChain extends Chain | undefined = Chain | undefined,
|
|
31
|
+
TAccount extends SmartContractAccount | undefined =
|
|
32
|
+
| SmartContractAccount
|
|
33
|
+
| undefined,
|
|
34
|
+
>(
|
|
35
|
+
client: BaseSmartAccountClient<TTransport, TChain, TAccount>,
|
|
36
|
+
request: UserOperationRequest,
|
|
37
|
+
entryPoint: EntryPointDef,
|
|
38
|
+
) {
|
|
39
|
+
if (!client.account) {
|
|
40
|
+
throw new AccountNotFoundError();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const uo = deepHexlify(request);
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
switch (entryPoint.version) {
|
|
47
|
+
case "0.6.0":
|
|
48
|
+
// TODO
|
|
49
|
+
break;
|
|
50
|
+
case "0.7.0":
|
|
51
|
+
await client.simulateContract({
|
|
52
|
+
address: entryPoint.address,
|
|
53
|
+
abi: entryPoint.abi,
|
|
54
|
+
functionName: "handleOps",
|
|
55
|
+
args: [
|
|
56
|
+
[
|
|
57
|
+
{
|
|
58
|
+
sender: client.account.address,
|
|
59
|
+
nonce: fromHex(uo.nonce, "bigint"),
|
|
60
|
+
initCode:
|
|
61
|
+
uo.factory && uo.factoryData
|
|
62
|
+
? concat([uo.factory, uo.factoryData])
|
|
63
|
+
: "0x",
|
|
64
|
+
callData: uo.callData,
|
|
65
|
+
accountGasLimits: packAccountGasLimits({
|
|
66
|
+
verificationGasLimit: uo.verificationGasLimit,
|
|
67
|
+
callGasLimit: uo.callGasLimit,
|
|
68
|
+
}),
|
|
69
|
+
preVerificationGas: fromHex(uo.preVerificationGas, "bigint"),
|
|
70
|
+
gasFees: packAccountGasLimits({
|
|
71
|
+
maxPriorityFeePerGas: uo.maxPriorityFeePerGas,
|
|
72
|
+
maxFeePerGas: uo.maxFeePerGas,
|
|
73
|
+
}),
|
|
74
|
+
paymasterAndData:
|
|
75
|
+
uo.paymaster && isAddress(uo.paymaster)
|
|
76
|
+
? packPaymasterData({
|
|
77
|
+
paymaster: uo.paymaster,
|
|
78
|
+
paymasterVerificationGasLimit:
|
|
79
|
+
uo.paymasterVerificationGasLimit,
|
|
80
|
+
paymasterPostOpGasLimit: uo.paymasterPostOpGasLimit,
|
|
81
|
+
paymasterData: uo.paymasterData,
|
|
82
|
+
})
|
|
83
|
+
: "0x",
|
|
84
|
+
signature: uo.signature,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
client.account.address,
|
|
88
|
+
],
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
} catch (err: any) {
|
|
92
|
+
if (err?.cause && err?.cause?.raw) {
|
|
93
|
+
try {
|
|
94
|
+
const { errorName, args } = decodeErrorResult({
|
|
95
|
+
abi: entryPoint.abi,
|
|
96
|
+
data: err.cause.raw,
|
|
97
|
+
});
|
|
98
|
+
console.error(`Failed with '${errorName}':`);
|
|
99
|
+
switch (errorName) {
|
|
100
|
+
case "FailedOpWithRevert":
|
|
101
|
+
case "FailedOp":
|
|
102
|
+
// TODO: if we pass in abi we could decode and print this too
|
|
103
|
+
const argsIdx = errorName === "FailedOp" ? 1 : 2;
|
|
104
|
+
console.error(
|
|
105
|
+
args && args[argsIdx]
|
|
106
|
+
? `Smart contract account reverted with error: ${args[argsIdx]}`
|
|
107
|
+
: "No revert data from smart contract account",
|
|
108
|
+
);
|
|
109
|
+
break;
|
|
110
|
+
default:
|
|
111
|
+
args && args.forEach((arg) => console.error(`\n${arg}`));
|
|
112
|
+
}
|
|
113
|
+
return;
|
|
114
|
+
} catch (err) {}
|
|
115
|
+
}
|
|
116
|
+
console.error("Entrypoint reverted with error: ");
|
|
117
|
+
console.error(err);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -36,12 +36,13 @@ export async function _initUserOperation<
|
|
|
36
36
|
TContext extends UserOperationContext | undefined =
|
|
37
37
|
| UserOperationContext
|
|
38
38
|
| undefined,
|
|
39
|
-
TEntryPointVersion extends
|
|
39
|
+
TEntryPointVersion extends
|
|
40
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
40
41
|
>(
|
|
41
42
|
client: BaseSmartAccountClient<TTransport, TChain, TAccount>,
|
|
42
43
|
args:
|
|
43
44
|
| SendUserOperationParameters<TAccount, TContext, TEntryPointVersion>
|
|
44
|
-
| BuildUserOperationParameters<TAccount, TContext, TEntryPointVersion
|
|
45
|
+
| BuildUserOperationParameters<TAccount, TContext, TEntryPointVersion>,
|
|
45
46
|
): Promise<Deferrable<UserOperationStruct<TEntryPointVersion>>> {
|
|
46
47
|
const { account = client.account, uo, overrides } = args;
|
|
47
48
|
if (!account) {
|
|
@@ -57,8 +58,8 @@ export async function _initUserOperation<
|
|
|
57
58
|
const callData = Array.isArray(uo)
|
|
58
59
|
? account.encodeBatchExecute(uo)
|
|
59
60
|
: typeof uo === "string"
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
? uo
|
|
62
|
+
: account.encodeExecute(uo);
|
|
62
63
|
|
|
63
64
|
const signature = account.getDummySignature();
|
|
64
65
|
|
|
@@ -77,11 +78,11 @@ export async function _initUserOperation<
|
|
|
77
78
|
: ({
|
|
78
79
|
factory: conditionalReturn(
|
|
79
80
|
account.isAccountDeployed().then((deployed) => !deployed),
|
|
80
|
-
account.getFactoryAddress
|
|
81
|
+
account.getFactoryAddress,
|
|
81
82
|
),
|
|
82
83
|
factoryData: conditionalReturn(
|
|
83
84
|
account.isAccountDeployed().then((deployed) => !deployed),
|
|
84
|
-
account.getFactoryData
|
|
85
|
+
account.getFactoryData,
|
|
85
86
|
),
|
|
86
87
|
sender: account.address,
|
|
87
88
|
nonce,
|
|
@@ -38,14 +38,15 @@ export async function _runMiddlewareStack<
|
|
|
38
38
|
TContext extends UserOperationContext | undefined =
|
|
39
39
|
| UserOperationContext
|
|
40
40
|
| undefined,
|
|
41
|
-
TEntryPointVersion extends
|
|
41
|
+
TEntryPointVersion extends
|
|
42
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
42
43
|
>(
|
|
43
44
|
client: BaseSmartAccountClient<TTransport, TChain, TAccount>,
|
|
44
45
|
args: {
|
|
45
46
|
uo: Deferrable<UserOperationStruct<TEntryPointVersion>>;
|
|
46
47
|
context?: TContext;
|
|
47
48
|
} & GetAccountParameter<TAccount> &
|
|
48
|
-
UserOperationOverridesParameter<TEntryPointVersion
|
|
49
|
+
UserOperationOverridesParameter<TEntryPointVersion>,
|
|
49
50
|
): Promise<UserOperationStruct<TEntryPointVersion>> {
|
|
50
51
|
const { uo, overrides, account = client.account, context } = args;
|
|
51
52
|
if (!account) {
|
|
@@ -66,15 +67,15 @@ export async function _runMiddlewareStack<
|
|
|
66
67
|
...("paymasterAndData" in overrides!
|
|
67
68
|
? { paymasterAndData: overrides.paymasterAndData }
|
|
68
69
|
: "paymasterData" in overrides! &&
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
"paymaster" in overrides &&
|
|
71
|
+
overrides.paymasterData !== "0x"
|
|
72
|
+
? {
|
|
73
|
+
paymasterData: overrides.paymasterData,
|
|
74
|
+
paymaster: overrides.paymaster,
|
|
75
|
+
}
|
|
76
|
+
: // At this point, nothing has run so no fields are set
|
|
77
|
+
// for 0.7 when not using a paymaster, all fields should be undefined
|
|
78
|
+
undefined),
|
|
78
79
|
};
|
|
79
80
|
},
|
|
80
81
|
paymasterAndData: noopMiddleware,
|
|
@@ -90,7 +91,7 @@ export async function _runMiddlewareStack<
|
|
|
90
91
|
client.middleware.gasEstimator,
|
|
91
92
|
client.middleware.customMiddleware,
|
|
92
93
|
paymasterAndData,
|
|
93
|
-
client.middleware.userOperationSimulator
|
|
94
|
+
client.middleware.userOperationSimulator,
|
|
94
95
|
)(uo, { overrides, feeOptions: client.feeOptions, account, client, context });
|
|
95
96
|
|
|
96
97
|
return resolveProperties<
|
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
} from "../../../types";
|
|
15
15
|
import { signUserOperation } from "../signUserOperation.js";
|
|
16
16
|
import type { GetContextParameter, UserOperationContext } from "../types";
|
|
17
|
+
import { getUserOperationError } from "../getUserOperationError.js";
|
|
17
18
|
|
|
18
19
|
export async function _sendUserOperation<
|
|
19
20
|
TTransport extends Transport = Transport,
|
|
@@ -24,14 +25,15 @@ export async function _sendUserOperation<
|
|
|
24
25
|
TContext extends UserOperationContext | undefined =
|
|
25
26
|
| UserOperationContext
|
|
26
27
|
| undefined,
|
|
27
|
-
TEntryPointVersion extends
|
|
28
|
+
TEntryPointVersion extends
|
|
29
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
28
30
|
>(
|
|
29
31
|
client: BaseSmartAccountClient<TTransport, TChain, TAccount>,
|
|
30
32
|
args: {
|
|
31
33
|
uoStruct: UserOperationStruct<TEntryPointVersion>;
|
|
32
34
|
overrides?: UserOperationOverrides<TEntryPointVersion>;
|
|
33
35
|
} & GetAccountParameter<TAccount> &
|
|
34
|
-
GetContextParameter<TContext
|
|
36
|
+
GetContextParameter<TContext>,
|
|
35
37
|
): Promise<SendUserOperationResult<TEntryPointVersion>> {
|
|
36
38
|
const { account = client.account, uoStruct, context, overrides } = args;
|
|
37
39
|
if (!account) {
|
|
@@ -50,8 +52,13 @@ export async function _sendUserOperation<
|
|
|
50
52
|
overrides,
|
|
51
53
|
});
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
try {
|
|
56
|
+
return {
|
|
57
|
+
hash: await client.sendRawUserOperation(request, entryPoint.address),
|
|
58
|
+
request,
|
|
59
|
+
};
|
|
60
|
+
} catch (err) {
|
|
61
|
+
getUserOperationError(client, request, entryPoint);
|
|
62
|
+
throw err;
|
|
63
|
+
}
|
|
57
64
|
}
|
|
@@ -54,12 +54,13 @@ export async function sendTransaction<
|
|
|
54
54
|
TContext extends UserOperationContext | undefined =
|
|
55
55
|
| UserOperationContext
|
|
56
56
|
| undefined,
|
|
57
|
-
TEntryPointVersion extends
|
|
57
|
+
TEntryPointVersion extends
|
|
58
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
58
59
|
>(
|
|
59
60
|
client_: Client<Transport, TChain, TAccount>,
|
|
60
61
|
args: SendTransactionParameters<TChain, TAccount, TChainOverride>,
|
|
61
62
|
overrides?: UserOperationOverrides<TEntryPointVersion>,
|
|
62
|
-
context?: TContext
|
|
63
|
+
context?: TContext,
|
|
63
64
|
): Promise<Hex> {
|
|
64
65
|
const client = clientHeaderTrack(client_, "estimateUserOperationGas");
|
|
65
66
|
const { account = client.account } = args;
|
|
@@ -75,7 +76,7 @@ export async function sendTransaction<
|
|
|
75
76
|
throw new IncompatibleClientError(
|
|
76
77
|
"BaseSmartAccountClient",
|
|
77
78
|
"sendTransaction",
|
|
78
|
-
client
|
|
79
|
+
client,
|
|
79
80
|
);
|
|
80
81
|
}
|
|
81
82
|
|
|
@@ -83,7 +84,7 @@ export async function sendTransaction<
|
|
|
83
84
|
client,
|
|
84
85
|
args,
|
|
85
86
|
overrides,
|
|
86
|
-
context
|
|
87
|
+
context,
|
|
87
88
|
);
|
|
88
89
|
|
|
89
90
|
const { hash, request } = await _sendUserOperation(client, {
|
|
@@ -39,10 +39,10 @@ export async function sendTransactions<
|
|
|
39
39
|
TAccount extends SmartContractAccount | undefined =
|
|
40
40
|
| SmartContractAccount
|
|
41
41
|
| undefined,
|
|
42
|
-
TContext extends UserOperationContext | undefined = UserOperationContext
|
|
42
|
+
TContext extends UserOperationContext | undefined = UserOperationContext,
|
|
43
43
|
>(
|
|
44
44
|
client_: Client<TTransport, TChain, TAccount>,
|
|
45
|
-
args: SendTransactionsParameters<TAccount, TContext
|
|
45
|
+
args: SendTransactionsParameters<TAccount, TContext>,
|
|
46
46
|
): Promise<Hex> {
|
|
47
47
|
const client = clientHeaderTrack(client_, "estimateUserOperationGas");
|
|
48
48
|
const { requests, overrides, account = client.account, context } = args;
|
|
@@ -54,7 +54,7 @@ export async function sendTransactions<
|
|
|
54
54
|
throw new IncompatibleClientError(
|
|
55
55
|
"BaseSmartAccountClient",
|
|
56
56
|
"sendTransactions",
|
|
57
|
-
client
|
|
57
|
+
client,
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -45,10 +45,11 @@ export async function sendUserOperation<
|
|
|
45
45
|
TContext extends UserOperationContext | undefined =
|
|
46
46
|
| UserOperationContext
|
|
47
47
|
| undefined,
|
|
48
|
-
TEntryPointVersion extends
|
|
48
|
+
TEntryPointVersion extends
|
|
49
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
49
50
|
>(
|
|
50
51
|
client_: Client<TTransport, TChain, TAccount>,
|
|
51
|
-
args: SendUserOperationParameters<TAccount, TContext
|
|
52
|
+
args: SendUserOperationParameters<TAccount, TContext>,
|
|
52
53
|
): Promise<SendUserOperationResult<TEntryPointVersion>> {
|
|
53
54
|
const client = clientHeaderTrack(client_, "sendUserOperation");
|
|
54
55
|
const { account = client.account, context, overrides } = args;
|
|
@@ -61,7 +62,7 @@ export async function sendUserOperation<
|
|
|
61
62
|
throw new IncompatibleClientError(
|
|
62
63
|
"BaseSmartAccountClient",
|
|
63
64
|
"sendUserOperation",
|
|
64
|
-
client
|
|
65
|
+
client,
|
|
65
66
|
);
|
|
66
67
|
}
|
|
67
68
|
|
|
@@ -8,7 +8,7 @@ import { AccountNotFoundError } from "../../errors/account.js";
|
|
|
8
8
|
export type SignMessageParameters<
|
|
9
9
|
TAccount extends SmartContractAccount | undefined =
|
|
10
10
|
| SmartContractAccount
|
|
11
|
-
| undefined
|
|
11
|
+
| undefined,
|
|
12
12
|
> = { message: SignableMessage } & GetAccountParameter<TAccount>;
|
|
13
13
|
|
|
14
14
|
export const signMessage: <
|
|
@@ -16,10 +16,10 @@ export const signMessage: <
|
|
|
16
16
|
TChain extends Chain | undefined = Chain | undefined,
|
|
17
17
|
TAccount extends SmartContractAccount | undefined =
|
|
18
18
|
| SmartContractAccount
|
|
19
|
-
| undefined
|
|
19
|
+
| undefined,
|
|
20
20
|
>(
|
|
21
21
|
client: Client<TTransport, TChain, TAccount>,
|
|
22
|
-
args: SignMessageParameters<TAccount
|
|
22
|
+
args: SignMessageParameters<TAccount>,
|
|
23
23
|
) => Promise<Hex> = async (client, { account = client.account, message }) => {
|
|
24
24
|
if (!account) {
|
|
25
25
|
throw new AccountNotFoundError();
|
|
@@ -17,7 +17,7 @@ export type SignTypedDataParameters<
|
|
|
17
17
|
TPrimaryType extends string = string,
|
|
18
18
|
TAccount extends SmartContractAccount | undefined =
|
|
19
19
|
| SmartContractAccount
|
|
20
|
-
| undefined
|
|
20
|
+
| undefined,
|
|
21
21
|
> = {
|
|
22
22
|
typedData: TypedDataDefinition<TTypedData, TPrimaryType>;
|
|
23
23
|
} & GetAccountParameter<TAccount>;
|
|
@@ -29,10 +29,10 @@ export const signTypedData: <
|
|
|
29
29
|
TChain extends Chain | undefined = Chain | undefined,
|
|
30
30
|
TAccount extends SmartContractAccount | undefined =
|
|
31
31
|
| SmartContractAccount
|
|
32
|
-
| undefined
|
|
32
|
+
| undefined,
|
|
33
33
|
>(
|
|
34
34
|
client: Client<TTransport, TChain, TAccount>,
|
|
35
|
-
args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount
|
|
35
|
+
args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>,
|
|
36
36
|
) => Promise<Hex> = async (client, { account = client.account, typedData }) => {
|
|
37
37
|
if (!account) {
|
|
38
38
|
throw new AccountNotFoundError();
|
|
@@ -19,10 +19,11 @@ export async function signUserOperation<
|
|
|
19
19
|
TAccount extends SmartContractAccount | undefined =
|
|
20
20
|
| SmartContractAccount
|
|
21
21
|
| undefined,
|
|
22
|
-
TEntryPointVersion extends
|
|
22
|
+
TEntryPointVersion extends
|
|
23
|
+
GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
|
|
23
24
|
>(
|
|
24
25
|
client: Client<TTransport, TChain, TAccount>,
|
|
25
|
-
args: SignUserOperationParameters<TAccount
|
|
26
|
+
args: SignUserOperationParameters<TAccount>,
|
|
26
27
|
): Promise<UserOperationRequest<TEntryPointVersion>> {
|
|
27
28
|
const { account = client.account, context } = args;
|
|
28
29
|
|
|
@@ -34,7 +35,7 @@ export async function signUserOperation<
|
|
|
34
35
|
throw new IncompatibleClientError(
|
|
35
36
|
"BaseSmartAccountClient",
|
|
36
37
|
"signUserOperation",
|
|
37
|
-
client
|
|
38
|
+
client,
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
41
|
|