@aa-sdk/core 4.34.1 → 4.35.1
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.map +1 -1
- package/dist/esm/actions/smartAccount/getAddress.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/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 +5 -8
- 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/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 +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/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/client/smartAccountClient.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/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 +5 -4
- package/src/actions/smartAccount/getAddress.ts +2 -2
- 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 +3 -2
- 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 +98 -104
- 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/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 +9 -12
- 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
package/src/utils/testUtils.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { getEntryPoint } from "../entrypoint/index.js";
|
|
|
11
11
|
import type { DefaultEntryPointVersion } from "../entrypoint/types.js";
|
|
12
12
|
|
|
13
13
|
export const createDummySmartContractAccount = async <C extends BundlerClient>(
|
|
14
|
-
client: C
|
|
14
|
+
client: C,
|
|
15
15
|
): Promise<SmartContractAccount<"dummy", DefaultEntryPointVersion>> => {
|
|
16
16
|
return toSmartContractAccount({
|
|
17
17
|
source: "dummy",
|
|
@@ -37,6 +37,6 @@ export const createTestClient = (chain: Chain) => {
|
|
|
37
37
|
transport: custom({
|
|
38
38
|
request: async () => {},
|
|
39
39
|
}),
|
|
40
|
-
})
|
|
40
|
+
}),
|
|
41
41
|
);
|
|
42
42
|
};
|
package/src/utils/traceHeader.ts
CHANGED
|
@@ -2,7 +2,7 @@ function generateRandomHexString(numBytes: number) {
|
|
|
2
2
|
const hexPairs = new Array(numBytes).fill(0).map(() =>
|
|
3
3
|
Math.floor(Math.random() * 16)
|
|
4
4
|
.toString(16)
|
|
5
|
-
.padStart(2, "0")
|
|
5
|
+
.padStart(2, "0"),
|
|
6
6
|
);
|
|
7
7
|
return hexPairs.join("");
|
|
8
8
|
}
|
|
@@ -46,7 +46,7 @@ export class TraceHeader {
|
|
|
46
46
|
traceId: string,
|
|
47
47
|
parentId: string,
|
|
48
48
|
traceFlags: string,
|
|
49
|
-
traceState: TraceHeader["traceState"]
|
|
49
|
+
traceState: TraceHeader["traceState"],
|
|
50
50
|
) {
|
|
51
51
|
this.traceId = traceId;
|
|
52
52
|
this.parentId = parentId;
|
|
@@ -68,7 +68,7 @@ export class TraceHeader {
|
|
|
68
68
|
clientTraceId,
|
|
69
69
|
generateRandomHexString(8),
|
|
70
70
|
"00", //Means no flag have been set, and no sampled state https://www.w3.org/TR/trace-context/#trace-flags
|
|
71
|
-
{}
|
|
71
|
+
{},
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
@@ -82,7 +82,7 @@ export class TraceHeader {
|
|
|
82
82
|
* @returns {TraceHeader | undefined} The trace header object, or nothing if not found
|
|
83
83
|
*/
|
|
84
84
|
static fromTraceHeader(
|
|
85
|
-
headers: Record<string, string
|
|
85
|
+
headers: Record<string, string>,
|
|
86
86
|
): TraceHeader | undefined {
|
|
87
87
|
if (!headers[TRACE_HEADER_NAME]) {
|
|
88
88
|
return undefined;
|
|
@@ -91,16 +91,19 @@ export class TraceHeader {
|
|
|
91
91
|
headers[TRACE_HEADER_NAME]?.split("-");
|
|
92
92
|
|
|
93
93
|
const traceState =
|
|
94
|
-
headers[TRACE_HEADER_STATE]?.split(",").reduce(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
headers[TRACE_HEADER_STATE]?.split(",").reduce(
|
|
95
|
+
(acc, curr) => {
|
|
96
|
+
const [key, value] = curr.split("=");
|
|
97
|
+
acc[key] = value;
|
|
98
|
+
return acc;
|
|
99
|
+
},
|
|
100
|
+
{} as Record<string, string>,
|
|
101
|
+
) || {};
|
|
99
102
|
if (version !== "00") {
|
|
100
103
|
console.debug(
|
|
101
104
|
new Error(
|
|
102
|
-
`Invalid version for traceheader: ${headers[TRACE_HEADER_NAME]}
|
|
103
|
-
)
|
|
105
|
+
`Invalid version for traceheader: ${headers[TRACE_HEADER_NAME]}`,
|
|
106
|
+
),
|
|
104
107
|
);
|
|
105
108
|
return undefined;
|
|
106
109
|
}
|
package/src/utils/types.ts
CHANGED
|
@@ -62,7 +62,7 @@ export type EqualsOneOfTheComponents<T, Union> = Union extends infer Component /
|
|
|
62
62
|
export type IsMemberOrSubtypeOfAComponent<
|
|
63
63
|
T,
|
|
64
64
|
Union,
|
|
65
|
-
ConjunctionOfExplicitComponentChecks extends boolean
|
|
65
|
+
ConjunctionOfExplicitComponentChecks extends boolean,
|
|
66
66
|
> = [T] extends [Union]
|
|
67
67
|
? true extends ConjunctionOfExplicitComponentChecks
|
|
68
68
|
? true
|
package/src/utils/userop.ts
CHANGED
|
@@ -20,9 +20,9 @@ import { allEqual, isBigNumberish } from "./index.js";
|
|
|
20
20
|
* @returns {boolean} a type guard that asserts the UserOperationRequest is valid
|
|
21
21
|
*/
|
|
22
22
|
export function isValidRequest<
|
|
23
|
-
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
23
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion,
|
|
24
24
|
>(
|
|
25
|
-
request: UserOperationStruct<TEntryPointVersion
|
|
25
|
+
request: UserOperationStruct<TEntryPointVersion>,
|
|
26
26
|
): request is UserOperationRequest<TEntryPointVersion> {
|
|
27
27
|
// These are the only ones marked as optional in the interface above
|
|
28
28
|
return (
|
|
@@ -43,7 +43,7 @@ export function isValidRequest<
|
|
|
43
43
|
* @returns {boolean} a type guard that asserts the UserOperationRequest is a UserOperationRequest
|
|
44
44
|
*/
|
|
45
45
|
export function isValidPaymasterAndData<
|
|
46
|
-
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
46
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion,
|
|
47
47
|
>(request: UserOperationStruct<TEntryPointVersion>): boolean {
|
|
48
48
|
if ("paymasterAndData" in request) {
|
|
49
49
|
return (request as UserOperationStruct_v6).paymasterAndData != null;
|
|
@@ -54,7 +54,7 @@ export function isValidPaymasterAndData<
|
|
|
54
54
|
(request as UserOperationStruct_v7).paymaster == null,
|
|
55
55
|
(request as UserOperationStruct_v7).paymasterData == null,
|
|
56
56
|
(request as UserOperationStruct_v7).paymasterPostOpGasLimit == null,
|
|
57
|
-
(request as UserOperationStruct_v7).paymasterVerificationGasLimit == null
|
|
57
|
+
(request as UserOperationStruct_v7).paymasterVerificationGasLimit == null,
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -65,7 +65,7 @@ export function isValidPaymasterAndData<
|
|
|
65
65
|
* @returns {boolean} a type guard that asserts the UserOperationStruct is a UserOperationRequest
|
|
66
66
|
*/
|
|
67
67
|
export function isValidFactoryAndData<
|
|
68
|
-
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
68
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion,
|
|
69
69
|
>(request: UserOperationStruct<TEntryPointVersion>): boolean {
|
|
70
70
|
if ("initCode" in request) {
|
|
71
71
|
const { initCode } = request as UserOperationStruct_v6;
|
|
@@ -75,7 +75,7 @@ export function isValidFactoryAndData<
|
|
|
75
75
|
// either all exist, or none.
|
|
76
76
|
return allEqual(
|
|
77
77
|
(request as UserOperationStruct_v7).factory == null,
|
|
78
|
-
(request as UserOperationStruct_v7).factoryData == null
|
|
78
|
+
(request as UserOperationStruct_v7).factoryData == null,
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -89,7 +89,7 @@ export function isValidFactoryAndData<
|
|
|
89
89
|
*/
|
|
90
90
|
export function applyUserOpOverride<TValue extends BigNumberish | undefined>(
|
|
91
91
|
value: TValue,
|
|
92
|
-
override?: BigNumberish | Multiplier
|
|
92
|
+
override?: BigNumberish | Multiplier,
|
|
93
93
|
): TValue | BigNumberish {
|
|
94
94
|
if (override == null) {
|
|
95
95
|
return value;
|
|
@@ -115,7 +115,7 @@ export function applyUserOpOverride<TValue extends BigNumberish | undefined>(
|
|
|
115
115
|
*/
|
|
116
116
|
export function applyUserOpFeeOption<TValue extends BigNumberish | undefined>(
|
|
117
117
|
value: TValue,
|
|
118
|
-
feeOption?: UserOperationFeeOptionsField
|
|
118
|
+
feeOption?: UserOperationFeeOptionsField,
|
|
119
119
|
): TValue | BigNumberish {
|
|
120
120
|
if (feeOption == null) {
|
|
121
121
|
return value;
|
|
@@ -127,9 +127,9 @@ export function applyUserOpFeeOption<TValue extends BigNumberish | undefined>(
|
|
|
127
127
|
? bigIntMultiply(value, feeOption.multiplier)
|
|
128
128
|
: value,
|
|
129
129
|
feeOption.min,
|
|
130
|
-
feeOption.max
|
|
130
|
+
feeOption.max,
|
|
131
131
|
)
|
|
132
|
-
: feeOption.min ?? 0n;
|
|
132
|
+
: (feeOption.min ?? 0n);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
/**
|
|
@@ -143,11 +143,11 @@ export function applyUserOpFeeOption<TValue extends BigNumberish | undefined>(
|
|
|
143
143
|
* @returns {BigNumberish} the new value of the field after applying the override or fee option
|
|
144
144
|
*/
|
|
145
145
|
export function applyUserOpOverrideOrFeeOption<
|
|
146
|
-
TValue extends BigNumberish | undefined
|
|
146
|
+
TValue extends BigNumberish | undefined,
|
|
147
147
|
>(
|
|
148
148
|
value: TValue,
|
|
149
149
|
override?: BigNumberish | Multiplier,
|
|
150
|
-
feeOption?: UserOperationFeeOptionsField
|
|
150
|
+
feeOption?: UserOperationFeeOptionsField,
|
|
151
151
|
): TValue | BigNumberish {
|
|
152
152
|
return value != null && override != null
|
|
153
153
|
? applyUserOpOverride(value, override)!
|
|
@@ -164,9 +164,9 @@ export function applyUserOpOverrideOrFeeOption<
|
|
|
164
164
|
* @returns {boolean} whether the paymaster middleware should be bypassed
|
|
165
165
|
*/
|
|
166
166
|
export const bypassPaymasterAndData = <
|
|
167
|
-
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
167
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion,
|
|
168
168
|
>(
|
|
169
|
-
overrides: UserOperationOverrides<TEntryPointVersion> | undefined
|
|
169
|
+
overrides: UserOperationOverrides<TEntryPointVersion> | undefined,
|
|
170
170
|
): boolean =>
|
|
171
171
|
!!overrides &&
|
|
172
172
|
("paymasterAndData" in overrides || "paymasterData" in overrides);
|
|
@@ -181,9 +181,9 @@ export const bypassPaymasterAndData = <
|
|
|
181
181
|
* @returns {boolean} whether the paymaster middleware should be bypassed
|
|
182
182
|
*/
|
|
183
183
|
export const bypassPaymasterAndDataEmptyHex = <
|
|
184
|
-
TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
184
|
+
TEntryPointVersion extends EntryPointVersion = EntryPointVersion,
|
|
185
185
|
>(
|
|
186
|
-
overrides: UserOperationOverrides<TEntryPointVersion> | undefined
|
|
186
|
+
overrides: UserOperationOverrides<TEntryPointVersion> | undefined,
|
|
187
187
|
): boolean =>
|
|
188
188
|
overrides !== undefined &&
|
|
189
189
|
(("paymasterAndData" in overrides && overrides.paymasterAndData === "0x") ||
|
|
@@ -197,7 +197,7 @@ export const bypassPaymasterAndDataEmptyHex = <
|
|
|
197
197
|
* @returns {{ paymaster: Hex; paymasterData: Hex}} the parsed paymaster and paymasterData fields of entrypoint v0.7 user operation request paymaster and paymasterData field
|
|
198
198
|
*/
|
|
199
199
|
export const parsePaymasterAndData = (
|
|
200
|
-
paymasterAndData: Hex
|
|
200
|
+
paymasterAndData: Hex,
|
|
201
201
|
): Pick<UserOperationRequest<"0.7.0">, "paymaster" | "paymasterData"> => ({
|
|
202
202
|
paymaster: paymasterAndData.substring(0, 42) as Address,
|
|
203
203
|
paymasterData: `0x${paymasterAndData.substring(42)}` as Hex,
|
package/src/version.ts
CHANGED