@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
|
@@ -137,60 +137,60 @@ export declare const UserOperationFeeOptionsSchema_v6: z.ZodObject<{
|
|
|
137
137
|
multiplier?: number | undefined;
|
|
138
138
|
}>>;
|
|
139
139
|
}, "strict", z.ZodTypeAny, {
|
|
140
|
-
|
|
140
|
+
callGasLimit?: {
|
|
141
141
|
min?: number | bigint | `0x${string}` | undefined;
|
|
142
142
|
max?: number | bigint | `0x${string}` | undefined;
|
|
143
143
|
multiplier?: number | undefined;
|
|
144
144
|
} | undefined;
|
|
145
|
-
|
|
145
|
+
verificationGasLimit?: {
|
|
146
146
|
min?: number | bigint | `0x${string}` | undefined;
|
|
147
147
|
max?: number | bigint | `0x${string}` | undefined;
|
|
148
148
|
multiplier?: number | undefined;
|
|
149
149
|
} | undefined;
|
|
150
|
-
|
|
150
|
+
preVerificationGas?: {
|
|
151
151
|
min?: number | bigint | `0x${string}` | undefined;
|
|
152
152
|
max?: number | bigint | `0x${string}` | undefined;
|
|
153
153
|
multiplier?: number | undefined;
|
|
154
154
|
} | undefined;
|
|
155
|
-
|
|
155
|
+
maxFeePerGas?: {
|
|
156
156
|
min?: number | bigint | `0x${string}` | undefined;
|
|
157
157
|
max?: number | bigint | `0x${string}` | undefined;
|
|
158
158
|
multiplier?: number | undefined;
|
|
159
159
|
} | undefined;
|
|
160
|
-
|
|
160
|
+
maxPriorityFeePerGas?: {
|
|
161
161
|
min?: number | bigint | `0x${string}` | undefined;
|
|
162
162
|
max?: number | bigint | `0x${string}` | undefined;
|
|
163
163
|
multiplier?: number | undefined;
|
|
164
164
|
} | undefined;
|
|
165
165
|
}, {
|
|
166
|
-
|
|
166
|
+
callGasLimit?: {
|
|
167
167
|
min?: number | bigint | `0x${string}` | undefined;
|
|
168
168
|
max?: number | bigint | `0x${string}` | undefined;
|
|
169
169
|
multiplier?: number | undefined;
|
|
170
170
|
} | undefined;
|
|
171
|
-
|
|
171
|
+
verificationGasLimit?: {
|
|
172
172
|
min?: number | bigint | `0x${string}` | undefined;
|
|
173
173
|
max?: number | bigint | `0x${string}` | undefined;
|
|
174
174
|
multiplier?: number | undefined;
|
|
175
175
|
} | undefined;
|
|
176
|
-
|
|
176
|
+
preVerificationGas?: {
|
|
177
177
|
min?: number | bigint | `0x${string}` | undefined;
|
|
178
178
|
max?: number | bigint | `0x${string}` | undefined;
|
|
179
179
|
multiplier?: number | undefined;
|
|
180
180
|
} | undefined;
|
|
181
|
-
|
|
181
|
+
maxFeePerGas?: {
|
|
182
182
|
min?: number | bigint | `0x${string}` | undefined;
|
|
183
183
|
max?: number | bigint | `0x${string}` | undefined;
|
|
184
184
|
multiplier?: number | undefined;
|
|
185
185
|
} | undefined;
|
|
186
|
-
|
|
186
|
+
maxPriorityFeePerGas?: {
|
|
187
187
|
min?: number | bigint | `0x${string}` | undefined;
|
|
188
188
|
max?: number | bigint | `0x${string}` | undefined;
|
|
189
189
|
multiplier?: number | undefined;
|
|
190
190
|
} | undefined;
|
|
191
191
|
}>;
|
|
192
192
|
export declare const UserOperationFeeOptionsSchema_v7: z.ZodObject<{
|
|
193
|
-
|
|
193
|
+
maxFeePerGas: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
194
194
|
min: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
195
195
|
max: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
196
196
|
multiplier: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
@@ -203,7 +203,7 @@ export declare const UserOperationFeeOptionsSchema_v7: z.ZodObject<{
|
|
|
203
203
|
max?: number | bigint | `0x${string}` | undefined;
|
|
204
204
|
multiplier?: number | undefined;
|
|
205
205
|
}>>>;
|
|
206
|
-
|
|
206
|
+
maxPriorityFeePerGas: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
207
207
|
min: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
208
208
|
max: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
209
209
|
multiplier: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
@@ -216,7 +216,7 @@ export declare const UserOperationFeeOptionsSchema_v7: z.ZodObject<{
|
|
|
216
216
|
max?: number | bigint | `0x${string}` | undefined;
|
|
217
217
|
multiplier?: number | undefined;
|
|
218
218
|
}>>>;
|
|
219
|
-
|
|
219
|
+
callGasLimit: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
220
220
|
min: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
221
221
|
max: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
222
222
|
multiplier: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
@@ -229,7 +229,7 @@ export declare const UserOperationFeeOptionsSchema_v7: z.ZodObject<{
|
|
|
229
229
|
max?: number | bigint | `0x${string}` | undefined;
|
|
230
230
|
multiplier?: number | undefined;
|
|
231
231
|
}>>>;
|
|
232
|
-
|
|
232
|
+
verificationGasLimit: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
233
233
|
min: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
234
234
|
max: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
235
235
|
multiplier: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
@@ -242,7 +242,7 @@ export declare const UserOperationFeeOptionsSchema_v7: z.ZodObject<{
|
|
|
242
242
|
max?: number | bigint | `0x${string}` | undefined;
|
|
243
243
|
multiplier?: number | undefined;
|
|
244
244
|
}>>>;
|
|
245
|
-
|
|
245
|
+
preVerificationGas: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
246
246
|
min: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
247
247
|
max: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
248
248
|
multiplier: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
@@ -355,7 +355,7 @@ export declare const UserOperationFeeOptionsSchema_v7: z.ZodObject<{
|
|
|
355
355
|
} | undefined;
|
|
356
356
|
}>;
|
|
357
357
|
export declare const UserOperationFeeOptionsSchema: z.ZodObject<{
|
|
358
|
-
|
|
358
|
+
maxFeePerGas: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
359
359
|
min: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
360
360
|
max: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
361
361
|
multiplier: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
@@ -368,7 +368,7 @@ export declare const UserOperationFeeOptionsSchema: z.ZodObject<{
|
|
|
368
368
|
max?: number | bigint | `0x${string}` | undefined;
|
|
369
369
|
multiplier?: number | undefined;
|
|
370
370
|
}>>>;
|
|
371
|
-
|
|
371
|
+
maxPriorityFeePerGas: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
372
372
|
min: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
373
373
|
max: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
374
374
|
multiplier: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
@@ -381,7 +381,7 @@ export declare const UserOperationFeeOptionsSchema: z.ZodObject<{
|
|
|
381
381
|
max?: number | bigint | `0x${string}` | undefined;
|
|
382
382
|
multiplier?: number | undefined;
|
|
383
383
|
}>>>;
|
|
384
|
-
|
|
384
|
+
callGasLimit: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
385
385
|
min: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
386
386
|
max: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
387
387
|
multiplier: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
@@ -394,7 +394,7 @@ export declare const UserOperationFeeOptionsSchema: z.ZodObject<{
|
|
|
394
394
|
max?: number | bigint | `0x${string}` | undefined;
|
|
395
395
|
multiplier?: number | undefined;
|
|
396
396
|
}>>>;
|
|
397
|
-
|
|
397
|
+
verificationGasLimit: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
398
398
|
min: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
399
399
|
max: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
400
400
|
multiplier: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
@@ -407,7 +407,7 @@ export declare const UserOperationFeeOptionsSchema: z.ZodObject<{
|
|
|
407
407
|
max?: number | bigint | `0x${string}` | undefined;
|
|
408
408
|
multiplier?: number | undefined;
|
|
409
409
|
}>>>;
|
|
410
|
-
|
|
410
|
+
preVerificationGas: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
411
411
|
min: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
412
412
|
max: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
413
413
|
multiplier: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
@@ -536,7 +536,7 @@ export declare const SmartAccountClientOptsSchema: z.ZodObject<{
|
|
|
536
536
|
* Optional user operation fee options to be set globally at the provider level
|
|
537
537
|
*/
|
|
538
538
|
feeOptions: z.ZodOptional<z.ZodObject<{
|
|
539
|
-
|
|
539
|
+
maxFeePerGas: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
540
540
|
min: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
541
541
|
max: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
542
542
|
multiplier: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
@@ -549,7 +549,7 @@ export declare const SmartAccountClientOptsSchema: z.ZodObject<{
|
|
|
549
549
|
max?: number | bigint | `0x${string}` | undefined;
|
|
550
550
|
multiplier?: number | undefined;
|
|
551
551
|
}>>>;
|
|
552
|
-
|
|
552
|
+
maxPriorityFeePerGas: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
553
553
|
min: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
554
554
|
max: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
555
555
|
multiplier: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
@@ -562,7 +562,7 @@ export declare const SmartAccountClientOptsSchema: z.ZodObject<{
|
|
|
562
562
|
max?: number | bigint | `0x${string}` | undefined;
|
|
563
563
|
multiplier?: number | undefined;
|
|
564
564
|
}>>>;
|
|
565
|
-
|
|
565
|
+
callGasLimit: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
566
566
|
min: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
567
567
|
max: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
568
568
|
multiplier: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
@@ -575,7 +575,7 @@ export declare const SmartAccountClientOptsSchema: z.ZodObject<{
|
|
|
575
575
|
max?: number | bigint | `0x${string}` | undefined;
|
|
576
576
|
multiplier?: number | undefined;
|
|
577
577
|
}>>>;
|
|
578
|
-
|
|
578
|
+
verificationGasLimit: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
579
579
|
min: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
580
580
|
max: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
581
581
|
multiplier: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
|
|
@@ -588,7 +588,7 @@ export declare const SmartAccountClientOptsSchema: z.ZodObject<{
|
|
|
588
588
|
max?: number | bigint | `0x${string}` | undefined;
|
|
589
589
|
multiplier?: number | undefined;
|
|
590
590
|
}>>>;
|
|
591
|
-
|
|
591
|
+
preVerificationGas: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
592
592
|
min: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
593
593
|
max: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNumber, z.ZodBigInt]>>>;
|
|
594
594
|
multiplier: z.ZodOptional<z.ZodEffects<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AG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAK,CAAC;IAE9D;;OAEG;IACH,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC;IAE5D;;OAEG;IACH,UAAU,EAAE,6BAA6B,CAAC,QAAQ,EAAE;CACrD,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["import type { Transport } from \"viem\";\nimport { z } from \"zod\";\n\nimport { BigNumberishRangeSchema, MultiplierSchema } from \"../utils/index.js\";\nimport type { BundlerClient } from \"./bundlerClient.js\";\n\nexport const createPublicErc4337ClientSchema = <\n TTransport extends Transport = Transport
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/client/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG9E,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAE3C,EAAE,CACJ,CAAC,CAAC,MAAM,CAA4B,CAAC,QAAQ,EAAE,EAAE;IAC/C,OAAO,CACL,QAAQ,IAAI,IAAI;QAChB,OAAO,QAAQ,KAAK,QAAQ;QAC5B,SAAS,IAAI,QAAQ;QACrB,MAAM,IAAI,QAAQ;QAClB,KAAK,IAAI,QAAQ;QACjB,MAAM,IAAI,QAAQ,CACnB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,mCAAmC;AACnC,qGAAqG;AACrG,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAClD,CAAC,CAAC,KAAK,CAAC;IACN,CAAC,CAAC,MAAM,CAAC;QACP,MAAM,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;QAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QA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,CAAC;IACtC,6BAA6B,EAAE,kCAAkC;IACjE,uBAAuB,EAAE,kCAAkC;CAC5D,CAAC;KACC,OAAO,EAAE;KACT,MAAM,EAAE,CAAC;AAEd,MAAM,CAAC,MAAM,6BAA6B,GAAG,gCAAgC,CAAC;AAE9E,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC;KAC1C,MAAM,CAAC;IACN;;OAEG;IACH,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAErD;;OAEG;IACH,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAK,CAAC;IAE9D;;OAEG;IACH,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC;IAE5D;;OAEG;IACH,UAAU,EAAE,6BAA6B,CAAC,QAAQ,EAAE;CACrD,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["import type { Transport } from \"viem\";\nimport { z } from \"zod\";\n\nimport { BigNumberishRangeSchema, MultiplierSchema } from \"../utils/index.js\";\nimport type { BundlerClient } from \"./bundlerClient.js\";\n\nexport const createPublicErc4337ClientSchema = <\n TTransport extends Transport = Transport,\n>() =>\n z.custom<BundlerClient<TTransport>>((provider) => {\n return (\n provider != null &&\n typeof provider === \"object\" &&\n \"request\" in provider &&\n \"type\" in provider &&\n \"key\" in provider &&\n \"name\" in provider\n );\n });\n\n// [!region ConnectionConfigSchema]\n// TODO: in v5 either remove this or simplify it (either way this should be moved out of aa-sdk/core)\nexport const ConnectionConfigSchema = z.intersection(\n z.union([\n z.object({\n rpcUrl: z.never().optional(),\n apiKey: z.string(),\n jwt: z.never().optional(),\n }),\n z.object({\n rpcUrl: z.never().optional(),\n apiKey: z.never().optional(),\n jwt: z.string(),\n }),\n z.object({\n rpcUrl: z.string(),\n apiKey: z.never().optional(),\n jwt: z.never().optional(),\n }),\n z.object({\n rpcUrl: z.string(),\n apiKey: z.never().optional(),\n jwt: z.string(),\n }),\n ]),\n z.object({\n chainAgnosticUrl: z.string().optional(),\n }),\n);\n// [!endregion ConnectionConfigSchema]\n\nexport const UserOperationFeeOptionsFieldSchema =\n BigNumberishRangeSchema.merge(MultiplierSchema).partial();\n\nexport const UserOperationFeeOptionsSchema_v6 = z\n .object({\n maxFeePerGas: UserOperationFeeOptionsFieldSchema,\n maxPriorityFeePerGas: UserOperationFeeOptionsFieldSchema,\n callGasLimit: UserOperationFeeOptionsFieldSchema,\n verificationGasLimit: UserOperationFeeOptionsFieldSchema,\n preVerificationGas: UserOperationFeeOptionsFieldSchema,\n })\n .partial()\n .strict();\n\nexport const UserOperationFeeOptionsSchema_v7 =\n UserOperationFeeOptionsSchema_v6.extend({\n paymasterVerificationGasLimit: UserOperationFeeOptionsFieldSchema,\n paymasterPostOpGasLimit: UserOperationFeeOptionsFieldSchema,\n })\n .partial()\n .strict();\n\nexport const UserOperationFeeOptionsSchema = UserOperationFeeOptionsSchema_v7;\n\nexport const SmartAccountClientOptsSchema = z\n .object({\n /**\n * The maximum number of times to try fetching a transaction receipt before giving up (default: 5)\n */\n txMaxRetries: z.number().min(0).optional().default(5),\n\n /**\n * The interval in milliseconds to wait between retries while waiting for tx receipts (default: 2_000)\n */\n txRetryIntervalMs: z.number().min(0).optional().default(2_000),\n\n /**\n * The multiplier on interval length to wait between retries while waiting for tx receipts (default: 1.5)\n */\n txRetryMultiplier: z.number().min(0).optional().default(1.5),\n\n /**\n * Optional user operation fee options to be set globally at the provider level\n */\n feeOptions: UserOperationFeeOptionsSchema.optional(),\n })\n .strict();\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartAccountClient.js","sourceRoot":"","sources":["../../../src/client/smartAccountClient.ts"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C,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;oBACpD,CAAC;gBACH,CAAC;aACF,CAAC,CAAC,IAAI,CAAC,CAAC;QACX,CAAC;KACF,CAAC;SACC,MAAM,CAAC,GAAG,EAAE;QACX,MAAM,cAAc,GAAG,aAAa;YAClC,CAAC,CAAC;gBACE,CAAC,cAAc,CAAC,EAAE,aAAa;aAChC;YACH,CAAC,CAAC,EAAE,CAAC;QACP,OAAO;YACL,GAAG,4BAA4B,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;YACxD,GAAG,cAAc;SAClB,CAAC;IACJ,CAAC,CAAC;SACD,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;SACjC,MAAM,CAAC,yBAAyB,CAAC,CAAC;IAErC,OAAO,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,CAAC;AAC7B,CAAC;AAgCD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,oCAAoC,CAClD,MAEC;IAED,OAAO,wBAAwB,CAAC;QAC9B,GAAG,MAAM;QACT,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK;QAC1B,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;KACjC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {\n custom,\n type Chain,\n type Client,\n type ClientConfig,\n type CustomTransport,\n type FormattedTransactionRequest,\n type PublicActions,\n type PublicRpcSchema,\n type RpcSchema,\n type Transport,\n} from \"viem\";\nimport { z } from \"zod\";\nimport type { SmartContractAccount } from \"../account/smartContractAccount.js\";\nimport type { UserOperationContext } from \"../actions/smartAccount/types.js\";\nimport { AccountNotFoundError } from \"../errors/account.js\";\nimport { ChainNotFoundError } from \"../errors/client.js\";\nimport { middlewareActions } from \"../middleware/actions.js\";\nimport type { ClientMiddleware } from \"../middleware/types.js\";\nimport type { Prettify } from \"../utils/index.js\";\nimport { createBundlerClient, type BundlerClient } from \"./bundlerClient.js\";\nimport {\n type BundlerActions,\n type BundlerRpcSchema,\n} from \"./decorators/bundlerClient.js\";\nimport {\n smartAccountClientActions,\n type BaseSmartAccountClientActions,\n} from \"./decorators/smartAccountClient.js\";\nimport { SmartAccountClientOptsSchema } from \"./schema.js\";\nimport type { ClientMiddlewareConfig } from \"./types.js\";\nimport { ADD_BREADCRUMB } from \"./addBreadcrumb.js\";\n\ntype SmartAccountClientOpts = z.output<typeof SmartAccountClientOptsSchema>;\n\nexport type SmartAccountClientConfig<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n context extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n> = Prettify<\n Pick<\n ClientConfig<transport, chain, account>,\n | \"cacheTime\"\n | \"chain\"\n | \"key\"\n | \"name\"\n | \"pollingInterval\"\n | \"transport\"\n | \"type\"\n > & {\n account?: account;\n opts?: z.input<typeof SmartAccountClientOptsSchema>;\n /**\n * A function that adds a breadcrumb to the current context\n * Note, most implementations will override the client with the default alchemy transport and this\n * leads to the fact that a transport could be overwritten and not known until later.\n *\n * @param crumb A crumb, or span is telling that we are in a next step part of a multi step action\n * @returns\n */\n addBreadCrumb?: <T>(crumb: string) => T;\n } & ClientMiddlewareConfig<context>\n>;\n\nexport type SmartAccountClientRpcSchema = [\n ...BundlerRpcSchema,\n ...PublicRpcSchema\n];\n\n// [!region SmartAccountClientActions]\nexport type SmartAccountClientActions<\n chain extends Chain | undefined = Chain | undefined,\n account extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n context extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n> = BaseSmartAccountClientActions<chain, account, context> &\n BundlerActions &\n PublicActions;\n// [!endregion SmartAccountClientActions]\n\n// [!region SmartAccountClient]\nexport type SmartAccountClient<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n actions extends Record<string, unknown> = Record<string, unknown>,\n rpcSchema extends RpcSchema = SmartAccountClientRpcSchema,\n context extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n> = Prettify<\n Client<\n transport,\n chain,\n account,\n rpcSchema,\n actions & SmartAccountClientActions<chain, account, context>\n >\n>;\n// [!endregion SmartAccountClient]\n\nexport type BaseSmartAccountClient<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n context extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n> = Prettify<\n Client<\n transport,\n chain,\n account,\n [...BundlerRpcSchema, ...PublicRpcSchema],\n {\n middleware: ClientMiddleware<context>;\n } & SmartAccountClientOpts &\n BundlerActions &\n PublicActions\n >\n>;\n\nexport function createSmartAccountClient<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n>(\n config: SmartAccountClientConfig<TTransport, TChain, TAccount, TContext>\n): SmartAccountClient<TTransport, TChain, TAccount>;\n\n/**\n * Creates a smart account client using the provided configuration. This client handles various Ethereum transactions and message signing operations.\n *\n * @example\n * ```ts\n * import { createSmartAccountClient, toSmartContractAccount } from \"@aa-sdk/core\";\n * import { http } from \"viem\";\n * import { sepolia } from \"viem/chains\";\n *\n * const client = createSmartAccountClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * // optionally hoist the account\n * account: toSmartContractAccount(...),\n * });\n * ```\n *\n * @param {SmartAccountClientConfig} config The configuration for creating the smart account client\n * @returns {SmartAccountClient} A smart account client capable of handling transactions, message signing, and other operations on a smart account\n */\nexport function createSmartAccountClient(\n config: SmartAccountClientConfig\n): SmartAccountClient {\n const {\n key = \"account\",\n name = \"account provider\",\n transport,\n type = \"SmartAccountClient\",\n addBreadCrumb,\n ...params\n } = config;\n\n const client: SmartAccountClient = createBundlerClient({\n ...params,\n key,\n name,\n // we start out with this because the base methods for a SmartAccountClient\n // require a smart account client, but once we have completed building everything\n // we want to override this value with the one passed in by the extender\n type: \"SmartAccountClient\",\n // TODO: this needs to be tested\n transport: (opts) => {\n const rpcTransport = transport(opts);\n\n return custom({\n name: \"SmartAccountClientTransport\",\n async request({ method, params }) {\n switch (method) {\n case \"eth_accounts\": {\n if (!client.account) {\n throw new AccountNotFoundError();\n }\n\n return [client.account.address];\n }\n case \"eth_sendTransaction\":\n if (!client.account) {\n throw new AccountNotFoundError();\n }\n if (!client.chain) {\n throw new ChainNotFoundError();\n }\n const [tx] = params as [FormattedTransactionRequest];\n return client.sendTransaction({\n ...tx,\n account: client.account,\n chain: client.chain,\n });\n case \"eth_sign\":\n if (!client.account) {\n throw new AccountNotFoundError();\n }\n const [address, data] = params!;\n if (\n address?.toLowerCase() !== client.account.address.toLowerCase()\n ) {\n throw new Error(\n \"cannot sign for address that is not the current account\"\n );\n }\n return client.signMessage({\n message: data,\n account: client.account,\n });\n case \"personal_sign\": {\n if (!client.account) {\n throw new AccountNotFoundError();\n }\n const [data, address] = params!;\n if (\n address?.toLowerCase() !== client.account.address.toLowerCase()\n ) {\n throw new Error(\n \"cannot sign for address that is not the current account\"\n );\n }\n return client.signMessage({\n message: data,\n account: client.account,\n });\n }\n case \"eth_signTypedData_v4\": {\n if (!client.account) {\n throw new AccountNotFoundError();\n }\n const [address, dataParams] = params!;\n if (\n address?.toLowerCase() !== client.account.address.toLowerCase()\n ) {\n throw new Error(\n \"cannot sign for address that is not the current account\"\n );\n }\n try {\n return client.signTypedData({\n account: client.account,\n typedData:\n typeof dataParams === \"string\"\n ? JSON.parse(dataParams)\n : dataParams,\n });\n } catch {\n throw new Error(\"invalid JSON data params\");\n }\n }\n case \"eth_chainId\":\n if (!opts.chain) {\n throw new ChainNotFoundError();\n }\n\n return opts.chain.id;\n default:\n // TODO: there's probably a number of methods we just don't support, will need to test most of them out\n // first let's get something working though\n return rpcTransport.request({ method, params });\n }\n },\n })(opts);\n },\n })\n .extend(() => {\n const addBreadCrumbs = addBreadCrumb\n ? {\n [ADD_BREADCRUMB]: addBreadCrumb,\n }\n : {};\n return {\n ...SmartAccountClientOptsSchema.parse(config.opts ?? {}),\n ...addBreadCrumbs,\n };\n })\n .extend(middlewareActions(config))\n .extend(smartAccountClientActions);\n\n return { ...client, type };\n}\n\nexport function createSmartAccountClientFromExisting<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TClient extends BundlerClient<TTransport> = BundlerClient<TTransport>,\n TActions extends SmartAccountClientActions<\n TChain,\n TAccount,\n TContext\n > = SmartAccountClientActions<TChain, TAccount>,\n TRpcSchema extends SmartAccountClientRpcSchema = SmartAccountClientRpcSchema,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n>(\n config: Omit<\n SmartAccountClientConfig<Transport, TChain, TAccount, TContext>,\n \"transport\" | \"chain\"\n > & { client: TClient }\n): SmartAccountClient<\n CustomTransport,\n TChain,\n TAccount,\n TActions,\n TRpcSchema,\n TContext\n>;\n\n/**\n * Creates a smart account client using an existing client and specific configuration. This function can be used to reuse a pre-existing BundlerClient while customizing other aspects of the smart account.\n *\n * @example\n * ```ts\n * import {\n * createBundlerClient,\n * createSmartAccountClientFromExisting,\n * toSmartContractAccount\n * } from \"@aa-sdk/core\";\n *\n * const bundlerClient = createBundlerClient(...);\n * const client = createSmartAccountClientFromExisting({\n * client,\n * account: toSmartContractAccount(...),\n * })\n * ```\n *\n * @param {Omit<SmartAccountClientConfig, \"transport\" | \"chain\"> & {client: BundlerClient}} config the configuration object which includes the client\n * @returns {SmartAccountClient} A smart account client created from the existing BundlerClient\n */\nexport function createSmartAccountClientFromExisting(\n config: Omit<SmartAccountClientConfig, \"transport\" | \"chain\"> & {\n client: BundlerClient;\n }\n): SmartAccountClient {\n return createSmartAccountClient({\n ...config,\n chain: config.client.chain,\n transport: custom(config.client),\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"smartAccountClient.js","sourceRoot":"","sources":["../../../src/client/smartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,GAUP,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAE,mBAAmB,EAAsB,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAGN,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,yBAAyB,GAE1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAoHpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,wBAAwB,CACtC,MAAgC;IAEhC,MAAM,EACJ,GAAG,GAAG,SAAS,EACf,IAAI,GAAG,kBAAkB,EACzB,SAAS,EACT,IAAI,GAAG,oBAAoB,EAC3B,aAAa,EACb,GAAG,MAAM,EACV,GAAG,MAAM,CAAC;IAEX,MAAM,MAAM,GAAuB,mBAAmB,CAAC;QACrD,GAAG,MAAM;QACT,GAAG;QACH,IAAI;QACJ,2EAA2E;QAC3E,iFAAiF;QACjF,wEAAwE;QACxE,IAAI,EAAE,oBAAoB;QAC1B,gCAAgC;QAChC,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;YAClB,MAAM,YAAY,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YAErC,OAAO,MAAM,CAAC;gBACZ,IAAI,EAAE,6BAA6B;gBACnC,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,EA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4BACjC,CAAC;4BAED,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;wBACvB;4BACE,uGAAuG;4BACvG,2CAA2C;4BAC3C,OAAO,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;oBACpD,CAAC;gBACH,CAAC;aACF,CAAC,CAAC,IAAI,CAAC,CAAC;QACX,CAAC;KACF,CAAC;SACC,MAAM,CAAC,GAAG,EAAE;QACX,MAAM,cAAc,GAAG,aAAa;YAClC,CAAC,CAAC;gBACE,CAAC,cAAc,CAAC,EAAE,aAAa;aAChC;YACH,CAAC,CAAC,EAAE,CAAC;QACP,OAAO;YACL,GAAG,4BAA4B,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;YACxD,GAAG,cAAc;SAClB,CAAC;IACJ,CAAC,CAAC;SACD,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;SACjC,MAAM,CAAC,yBAAyB,CAAC,CAAC;IAErC,OAAO,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,CAAC;AAC7B,CAAC;AAgCD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,oCAAoC,CAClD,MAEC;IAED,OAAO,wBAAwB,CAAC;QAC9B,GAAG,MAAM;QACT,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK;QAC1B,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;KACjC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {\n custom,\n type Chain,\n type Client,\n type ClientConfig,\n type CustomTransport,\n type FormattedTransactionRequest,\n type PublicActions,\n type PublicRpcSchema,\n type RpcSchema,\n type Transport,\n} from \"viem\";\nimport { z } from \"zod\";\nimport type { SmartContractAccount } from \"../account/smartContractAccount.js\";\nimport type { UserOperationContext } from \"../actions/smartAccount/types.js\";\nimport { AccountNotFoundError } from \"../errors/account.js\";\nimport { ChainNotFoundError } from \"../errors/client.js\";\nimport { middlewareActions } from \"../middleware/actions.js\";\nimport type { ClientMiddleware } from \"../middleware/types.js\";\nimport type { Prettify } from \"../utils/index.js\";\nimport { createBundlerClient, type BundlerClient } from \"./bundlerClient.js\";\nimport {\n type BundlerActions,\n type BundlerRpcSchema,\n} from \"./decorators/bundlerClient.js\";\nimport {\n smartAccountClientActions,\n type BaseSmartAccountClientActions,\n} from \"./decorators/smartAccountClient.js\";\nimport { SmartAccountClientOptsSchema } from \"./schema.js\";\nimport type { ClientMiddlewareConfig } from \"./types.js\";\nimport { ADD_BREADCRUMB } from \"./addBreadcrumb.js\";\n\ntype SmartAccountClientOpts = z.output<typeof SmartAccountClientOptsSchema>;\n\nexport type SmartAccountClientConfig<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n context extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n> = Prettify<\n Pick<\n ClientConfig<transport, chain, account>,\n | \"cacheTime\"\n | \"chain\"\n | \"key\"\n | \"name\"\n | \"pollingInterval\"\n | \"transport\"\n | \"type\"\n > & {\n account?: account;\n opts?: z.input<typeof SmartAccountClientOptsSchema>;\n /**\n * A function that adds a breadcrumb to the current context\n * Note, most implementations will override the client with the default alchemy transport and this\n * leads to the fact that a transport could be overwritten and not known until later.\n *\n * @param crumb A crumb, or span is telling that we are in a next step part of a multi step action\n * @returns\n */\n addBreadCrumb?: <T>(crumb: string) => T;\n } & ClientMiddlewareConfig<context>\n>;\n\nexport type SmartAccountClientRpcSchema = [\n ...BundlerRpcSchema,\n ...PublicRpcSchema,\n];\n\n// [!region SmartAccountClientActions]\nexport type SmartAccountClientActions<\n chain extends Chain | undefined = Chain | undefined,\n account extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n context extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n> = BaseSmartAccountClientActions<chain, account, context> &\n BundlerActions &\n PublicActions;\n// [!endregion SmartAccountClientActions]\n\n// [!region SmartAccountClient]\nexport type SmartAccountClient<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n actions extends Record<string, unknown> = Record<string, unknown>,\n rpcSchema extends RpcSchema = SmartAccountClientRpcSchema,\n context extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n> = Prettify<\n Client<\n transport,\n chain,\n account,\n rpcSchema,\n actions & SmartAccountClientActions<chain, account, context>\n >\n>;\n// [!endregion SmartAccountClient]\n\nexport type BaseSmartAccountClient<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n context extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n> = Prettify<\n Client<\n transport,\n chain,\n account,\n [...BundlerRpcSchema, ...PublicRpcSchema],\n {\n middleware: ClientMiddleware<context>;\n } & SmartAccountClientOpts &\n BundlerActions &\n PublicActions\n >\n>;\n\nexport function createSmartAccountClient<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n>(\n config: SmartAccountClientConfig<TTransport, TChain, TAccount, TContext>,\n): SmartAccountClient<TTransport, TChain, TAccount>;\n\n/**\n * Creates a smart account client using the provided configuration. This client handles various Ethereum transactions and message signing operations.\n *\n * @example\n * ```ts\n * import { createSmartAccountClient, toSmartContractAccount } from \"@aa-sdk/core\";\n * import { http } from \"viem\";\n * import { sepolia } from \"viem/chains\";\n *\n * const client = createSmartAccountClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * // optionally hoist the account\n * account: toSmartContractAccount(...),\n * });\n * ```\n *\n * @param {SmartAccountClientConfig} config The configuration for creating the smart account client\n * @returns {SmartAccountClient} A smart account client capable of handling transactions, message signing, and other operations on a smart account\n */\nexport function createSmartAccountClient(\n config: SmartAccountClientConfig,\n): SmartAccountClient {\n const {\n key = \"account\",\n name = \"account provider\",\n transport,\n type = \"SmartAccountClient\",\n addBreadCrumb,\n ...params\n } = config;\n\n const client: SmartAccountClient = createBundlerClient({\n ...params,\n key,\n name,\n // we start out with this because the base methods for a SmartAccountClient\n // require a smart account client, but once we have completed building everything\n // we want to override this value with the one passed in by the extender\n type: \"SmartAccountClient\",\n // TODO: this needs to be tested\n transport: (opts) => {\n const rpcTransport = transport(opts);\n\n return custom({\n name: \"SmartAccountClientTransport\",\n async request({ method, params }) {\n switch (method) {\n case \"eth_accounts\": {\n if (!client.account) {\n throw new AccountNotFoundError();\n }\n\n return [client.account.address];\n }\n case \"eth_sendTransaction\":\n if (!client.account) {\n throw new AccountNotFoundError();\n }\n if (!client.chain) {\n throw new ChainNotFoundError();\n }\n const [tx] = params as [FormattedTransactionRequest];\n return client.sendTransaction({\n ...tx,\n account: client.account,\n chain: client.chain,\n });\n case \"eth_sign\":\n if (!client.account) {\n throw new AccountNotFoundError();\n }\n const [address, data] = params!;\n if (\n address?.toLowerCase() !== client.account.address.toLowerCase()\n ) {\n throw new Error(\n \"cannot sign for address that is not the current account\",\n );\n }\n return client.signMessage({\n message: data,\n account: client.account,\n });\n case \"personal_sign\": {\n if (!client.account) {\n throw new AccountNotFoundError();\n }\n const [data, address] = params!;\n if (\n address?.toLowerCase() !== client.account.address.toLowerCase()\n ) {\n throw new Error(\n \"cannot sign for address that is not the current account\",\n );\n }\n return client.signMessage({\n message: data,\n account: client.account,\n });\n }\n case \"eth_signTypedData_v4\": {\n if (!client.account) {\n throw new AccountNotFoundError();\n }\n const [address, dataParams] = params!;\n if (\n address?.toLowerCase() !== client.account.address.toLowerCase()\n ) {\n throw new Error(\n \"cannot sign for address that is not the current account\",\n );\n }\n try {\n return client.signTypedData({\n account: client.account,\n typedData:\n typeof dataParams === \"string\"\n ? JSON.parse(dataParams)\n : dataParams,\n });\n } catch {\n throw new Error(\"invalid JSON data params\");\n }\n }\n case \"eth_chainId\":\n if (!opts.chain) {\n throw new ChainNotFoundError();\n }\n\n return opts.chain.id;\n default:\n // TODO: there's probably a number of methods we just don't support, will need to test most of them out\n // first let's get something working though\n return rpcTransport.request({ method, params });\n }\n },\n })(opts);\n },\n })\n .extend(() => {\n const addBreadCrumbs = addBreadCrumb\n ? {\n [ADD_BREADCRUMB]: addBreadCrumb,\n }\n : {};\n return {\n ...SmartAccountClientOptsSchema.parse(config.opts ?? {}),\n ...addBreadCrumbs,\n };\n })\n .extend(middlewareActions(config))\n .extend(smartAccountClientActions);\n\n return { ...client, type };\n}\n\nexport function createSmartAccountClientFromExisting<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TClient extends BundlerClient<TTransport> = BundlerClient<TTransport>,\n TActions extends SmartAccountClientActions<\n TChain,\n TAccount,\n TContext\n > = SmartAccountClientActions<TChain, TAccount>,\n TRpcSchema extends SmartAccountClientRpcSchema = SmartAccountClientRpcSchema,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n>(\n config: Omit<\n SmartAccountClientConfig<Transport, TChain, TAccount, TContext>,\n \"transport\" | \"chain\"\n > & { client: TClient },\n): SmartAccountClient<\n CustomTransport,\n TChain,\n TAccount,\n TActions,\n TRpcSchema,\n TContext\n>;\n\n/**\n * Creates a smart account client using an existing client and specific configuration. This function can be used to reuse a pre-existing BundlerClient while customizing other aspects of the smart account.\n *\n * @example\n * ```ts\n * import {\n * createBundlerClient,\n * createSmartAccountClientFromExisting,\n * toSmartContractAccount\n * } from \"@aa-sdk/core\";\n *\n * const bundlerClient = createBundlerClient(...);\n * const client = createSmartAccountClientFromExisting({\n * client,\n * account: toSmartContractAccount(...),\n * })\n * ```\n *\n * @param {Omit<SmartAccountClientConfig, \"transport\" | \"chain\"> & {client: BundlerClient}} config the configuration object which includes the client\n * @returns {SmartAccountClient} A smart account client created from the existing BundlerClient\n */\nexport function createSmartAccountClientFromExisting(\n config: Omit<SmartAccountClientConfig, \"transport\" | \"chain\"> & {\n client: BundlerClient;\n },\n): SmartAccountClient {\n return createSmartAccountClient({\n ...config,\n chain: config.client.chain,\n transport: custom(config.client),\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/client/types.ts"],"names":[],"mappings":";AAqCA,sCAAsC","sourcesContent":["import type { Address } from \"abitype\";\nimport type { Hash, Hex } from \"viem\";\nimport type { z } from \"zod\";\nimport type { UserOperationContext } from \"../actions/smartAccount/types.js\";\nimport type { EntryPointVersion } from \"../entrypoint/types.js\";\nimport type { ClientMiddleware } from \"../middleware/types.js\";\nimport type { UserOperationRequest } from \"../types.js\";\nimport type { ConnectionConfigSchema } from \"./schema.js\";\n\nexport type ConnectorData = {\n chainId?: Hex;\n};\n\nexport type ConnectionConfig = z.input<typeof ConnectionConfigSchema>;\n\n// [!region SendUserOperationResult]\nexport type SendUserOperationResult<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/client/types.ts"],"names":[],"mappings":";AAqCA,sCAAsC","sourcesContent":["import type { Address } from \"abitype\";\nimport type { Hash, Hex } from \"viem\";\nimport type { z } from \"zod\";\nimport type { UserOperationContext } from \"../actions/smartAccount/types.js\";\nimport type { EntryPointVersion } from \"../entrypoint/types.js\";\nimport type { ClientMiddleware } from \"../middleware/types.js\";\nimport type { UserOperationRequest } from \"../types.js\";\nimport type { ConnectionConfigSchema } from \"./schema.js\";\n\nexport type ConnectorData = {\n chainId?: Hex;\n};\n\nexport type ConnectionConfig = z.input<typeof ConnectionConfigSchema>;\n\n// [!region SendUserOperationResult]\nexport type SendUserOperationResult<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion,\n> = {\n hash: Hash;\n request: UserOperationRequest<TEntryPointVersion>;\n};\n// [!endregion SendUserOperationResult]\n\n// [!region UpgradeToData]\nexport type UpgradeToData = {\n implAddress: Address;\n initializationData: Hex;\n};\n// [!endregion UpgradeToData]\n\n// [!region ClientMiddlewareConfig]\nexport type ClientMiddlewareConfig<\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n> = Partial<ClientMiddleware<TContext>>;\n// [!endregion ClientMiddlewareConfig]\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/ens/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAc,MAAM,aAAa,CAAC;AAElD,MAAM,CAAC,MAAM,UAAU,GAA8B,IAAI,GAAG,CAC1D,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAC5C,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,OAAe,EAAU,EAAE;IAClE,IAAI,OAAO,KAAK,OAAO,CAAC,EAAE,EAAE,CAAC;QAC3B,sHAAsH;QACtH,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,uLAAuL;IACvL,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,QAAgB,EAAU,EAAE;IACnE,IAAI,QAAQ,KAAK,EAAE,EAAE,CAAC;QACpB,sHAAsH;QACtH,OAAO,OAAO,CAAC,EAAE,CAAC;IACpB,CAAC;IAED,uLAAuL;IACvL,OAAO,CAAC,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,QAAgB,EAAS,EAAE;IAChE,MAAM,OAAO,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["import * as chains from \"viem/chains\";\nimport { mainnet, type Chain } from \"viem/chains\";\n\nexport const ChainsById: Map<number, chains.Chain> = new Map(\n Object.values(chains).map((x) => [x.id, x])
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/ens/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAc,MAAM,aAAa,CAAC;AAElD,MAAM,CAAC,MAAM,UAAU,GAA8B,IAAI,GAAG,CAC1D,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAC5C,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,OAAe,EAAU,EAAE;IAClE,IAAI,OAAO,KAAK,OAAO,CAAC,EAAE,EAAE,CAAC;QAC3B,sHAAsH;QACtH,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,uLAAuL;IACvL,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,QAAgB,EAAU,EAAE;IACnE,IAAI,QAAQ,KAAK,EAAE,EAAE,CAAC;QACpB,sHAAsH;QACtH,OAAO,OAAO,CAAC,EAAE,CAAC;IACpB,CAAC;IAED,uLAAuL;IACvL,OAAO,CAAC,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,QAAgB,EAAS,EAAE;IAChE,MAAM,OAAO,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["import * as chains from \"viem/chains\";\nimport { mainnet, type Chain } from \"viem/chains\";\n\nexport const ChainsById: Map<number, chains.Chain> = new Map(\n Object.values(chains).map((x) => [x.id, x]),\n);\n\n/**\n * Converts a given chain ID to a coin type, following specific standards for mainnet and non-mainnet chains.\n *\n * @example\n * ```ts\n * import { convertChainIdToCoinType } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n *\n * const coinType = convertChainIdToCoinType(sepolia.id);\n * ```\n *\n * @param {number} chainId the blockchain chain ID that you want to convert to a coin type\n * @returns {number} the corresponding coin type for the given chain ID\n */\nexport const convertChainIdToCoinType = (chainId: number): number => {\n if (chainId === mainnet.id) {\n // this comes from [ensip-9](https://docs.ens.domains/ens-improvement-proposals/ensip-9-multichain-address-resolution)\n return 60;\n }\n\n // this is using [ENSIP-11](https://docs.ens.domains/ens-improvement-proposals/ensip-11-evmchain-address-resolution) and assumes this is how mappings are stored for non mainnet chains\n return (0x80000000 | chainId) >>> 0;\n};\n\n/**\n * Converts a coin type to a chain ID based on predefined mappings. This function follows ENSIP-9 for coin type 60 and ENSIP-11 for other coin types.\n *\n * @example\n * ```ts\n * import { convertChainIdToCoinType, convertCoinTypeToChainId } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n *\n * const coinType = convertChainIdToCoinType(sepolia.id);\n * const chainId = convertCoinTypeToChainId(coinType);\n * ```\n *\n * @param {number} coinType the coin type to be converted to a chain ID\n * @returns {number} the corresponding chain ID\n */\nexport const convertCoinTypeToChainId = (coinType: number): number => {\n if (coinType === 60) {\n // this comes from [ensip-9](https://docs.ens.domains/ens-improvement-proposals/ensip-9-multichain-address-resolution)\n return mainnet.id;\n }\n\n // this is using [ENSIP-11](https://docs.ens.domains/ens-improvement-proposals/ensip-11-evmchain-address-resolution) and assumes this is how mappings are stored for non mainnet chains\n return (0x7fffffff & coinType) >> 0;\n};\n\n/**\n * Converts a coin type to its corresponding blockchain chain based on a predefined mapping.\n *\n * @example\n * ```ts\n * import { convertChainIdToCoinType, convertCoinTypeToChain } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n *\n * const coinType = convertChainIdToCoinType(sepolia.id);\n * const chain = convertCoinTypeToChain(coinType);\n * ```\n *\n * @param {number} coinType The numerical identifier for the coin type\n * @returns {Chain} The corresponding blockchain chain\n * @throws {Error} If the coin type does not map to a supported chain\n */\nexport const convertCoinTypeToChain = (coinType: number): Chain => {\n const chainId = convertCoinTypeToChainId(coinType);\n const chain = ChainsById.get(chainId);\n if (!chain) {\n throw new Error(\"CoinType does not map to a supported chain\");\n }\n\n return chain;\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Address, type Hash } from "viem";
|
|
1
|
+
import { type Address, type Hash, type Hex } from "viem";
|
|
2
2
|
import type { UserOperationRequest } from "../types.js";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
version: "0.6.0";
|
|
@@ -1024,6 +1024,6 @@ declare const _default: {
|
|
|
1024
1024
|
readonly type: "receive";
|
|
1025
1025
|
}];
|
|
1026
1026
|
getUserOperationHash: (request: UserOperationRequest<"0.6.0">, entryPointAddress: Address, chainId: number) => Hash;
|
|
1027
|
-
packUserOperation: (request: UserOperationRequest<"0.6.0">) =>
|
|
1027
|
+
packUserOperation: (request: UserOperationRequest<"0.6.0">) => Hex;
|
|
1028
1028
|
};
|
|
1029
1029
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0.6.js","sourceRoot":"","sources":["../../../src/entrypoint/0.6.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,SAAS,GAKV,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAI/D,MAAM,iBAAiB,GAAG,CAAC,OAAsC,EAAO,EAAE;IACxE,MAAM,cAAc,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,cAAc,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,sBAAsB,GAAG,SAAS,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEnE,OAAO,mBAAmB,CACxB;QACE,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;KACpB,EACD;QACE,OAAO,CAAC,MAAiB;QACzB,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC;QAC1B,cAAc;QACd,cAAc;QACd,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC;QACjC,WAAW,CAAC,OAAO,CAAC,oBAAoB,CAAC;QACzC,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC;QACvC,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC;QACjC,WAAW,CAAC,OAAO,CAAC,oBAAoB,CAAC;QACzC,sBAAsB;KACvB,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe;IACb,OAAO,EAAE,OAAO;IAEhB,OAAO,EAAE;QACP,OAAO,EAAE,4CAA4C;KACtD;IAED,GAAG,EAAE,gBAAgB;IAErB,oBAAoB,EAAE,CACpB,OAAsC,EACtC,iBAA0B,EAC1B,OAAe,EACT,EAAE;QACR,MAAM,OAAO,GAAG,mBAAmB,CACjC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAC/D;YACE,SAAS,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;YACrC,iBAAiB;YACjB,MAAM,CAAC,OAAO,CAAC;SAChB,CACF,CAAC;QAEF,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAED,iBAAiB;CACqD,CAAC","sourcesContent":["import {\n encodeAbiParameters,\n hexToBigInt,\n keccak256,\n type Address,\n type Chain,\n type Hash,\n type Hex,\n} from \"viem\";\nimport { EntryPointAbi_v6 } from \"../abis/EntryPointAbi_v6.js\";\nimport type { UserOperationRequest } from \"../types.js\";\nimport type { SupportedEntryPoint } from \"./types.js\";\n\nconst packUserOperation = (request: UserOperationRequest<\"0.6.0\">): Hex => {\n const hashedInitCode = keccak256(request.initCode);\n const hashedCallData = keccak256(request.callData);\n const hashedPaymasterAndData = keccak256(request.paymasterAndData);\n\n return encodeAbiParameters(\n [\n { type: \"address\" },\n { type: \"uint256\" },\n { type: \"bytes32\" },\n { type: \"bytes32\" },\n { type: \"uint256\" },\n { type: \"uint256\" },\n { type: \"uint256\" },\n { type: \"uint256\" },\n { type: \"uint256\" },\n { type: \"bytes32\" },\n ],\n [\n request.sender as Address,\n hexToBigInt(request.nonce),\n hashedInitCode,\n hashedCallData,\n hexToBigInt(request.callGasLimit),\n hexToBigInt(request.verificationGasLimit),\n hexToBigInt(request.preVerificationGas),\n hexToBigInt(request.maxFeePerGas),\n hexToBigInt(request.maxPriorityFeePerGas),\n hashedPaymasterAndData,\n ]
|
|
1
|
+
{"version":3,"file":"0.6.js","sourceRoot":"","sources":["../../../src/entrypoint/0.6.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,SAAS,GAKV,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAI/D,MAAM,iBAAiB,GAAG,CAAC,OAAsC,EAAO,EAAE;IACxE,MAAM,cAAc,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,cAAc,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,sBAAsB,GAAG,SAAS,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEnE,OAAO,mBAAmB,CACxB;QACE,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE;KACpB,EACD;QACE,OAAO,CAAC,MAAiB;QACzB,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC;QAC1B,cAAc;QACd,cAAc;QACd,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC;QACjC,WAAW,CAAC,OAAO,CAAC,oBAAoB,CAAC;QACzC,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC;QACvC,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC;QACjC,WAAW,CAAC,OAAO,CAAC,oBAAoB,CAAC;QACzC,sBAAsB;KACvB,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe;IACb,OAAO,EAAE,OAAO;IAEhB,OAAO,EAAE;QACP,OAAO,EAAE,4CAA4C;KACtD;IAED,GAAG,EAAE,gBAAgB;IAErB,oBAAoB,EAAE,CACpB,OAAsC,EACtC,iBAA0B,EAC1B,OAAe,EACT,EAAE;QACR,MAAM,OAAO,GAAG,mBAAmB,CACjC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAC/D;YACE,SAAS,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;YACrC,iBAAiB;YACjB,MAAM,CAAC,OAAO,CAAC;SAChB,CACF,CAAC;QAEF,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAED,iBAAiB;CACqD,CAAC","sourcesContent":["import {\n encodeAbiParameters,\n hexToBigInt,\n keccak256,\n type Address,\n type Chain,\n type Hash,\n type Hex,\n} from \"viem\";\nimport { EntryPointAbi_v6 } from \"../abis/EntryPointAbi_v6.js\";\nimport type { UserOperationRequest } from \"../types.js\";\nimport type { SupportedEntryPoint } from \"./types.js\";\n\nconst packUserOperation = (request: UserOperationRequest<\"0.6.0\">): Hex => {\n const hashedInitCode = keccak256(request.initCode);\n const hashedCallData = keccak256(request.callData);\n const hashedPaymasterAndData = keccak256(request.paymasterAndData);\n\n return encodeAbiParameters(\n [\n { type: \"address\" },\n { type: \"uint256\" },\n { type: \"bytes32\" },\n { type: \"bytes32\" },\n { type: \"uint256\" },\n { type: \"uint256\" },\n { type: \"uint256\" },\n { type: \"uint256\" },\n { type: \"uint256\" },\n { type: \"bytes32\" },\n ],\n [\n request.sender as Address,\n hexToBigInt(request.nonce),\n hashedInitCode,\n hashedCallData,\n hexToBigInt(request.callGasLimit),\n hexToBigInt(request.verificationGasLimit),\n hexToBigInt(request.preVerificationGas),\n hexToBigInt(request.maxFeePerGas),\n hexToBigInt(request.maxPriorityFeePerGas),\n hashedPaymasterAndData,\n ],\n );\n};\n\nexport default {\n version: \"0.6.0\",\n\n address: {\n default: \"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789\",\n },\n\n abi: EntryPointAbi_v6,\n\n getUserOperationHash: (\n request: UserOperationRequest<\"0.6.0\">,\n entryPointAddress: Address,\n chainId: number,\n ): Hash => {\n const encoded = encodeAbiParameters(\n [{ type: \"bytes32\" }, { type: \"address\" }, { type: \"uint256\" }],\n [\n keccak256(packUserOperation(request)),\n entryPointAddress,\n BigInt(chainId),\n ],\n );\n\n return keccak256(encoded);\n },\n\n packUserOperation,\n} satisfies SupportedEntryPoint<\"0.6.0\", Chain, typeof EntryPointAbi_v6>;\n"]}
|
|
@@ -781,7 +781,7 @@ declare const _default: {
|
|
|
781
781
|
readonly type: "receive";
|
|
782
782
|
}];
|
|
783
783
|
getUserOperationHash: (request: UserOperationRequest<"0.7.0">, entryPointAddress: Address, chainId: number) => Hash;
|
|
784
|
-
packUserOperation: (request: UserOperationRequest<"0.7.0">) =>
|
|
784
|
+
packUserOperation: (request: UserOperationRequest<"0.7.0">) => Hex;
|
|
785
785
|
};
|
|
786
786
|
export default _default;
|
|
787
787
|
export declare function packAccountGasLimits(data: Pick<UserOperationRequest_v7, "verificationGasLimit" | "callGasLimit"> | Pick<UserOperationRequest_v7, "maxPriorityFeePerGas" | "maxFeePerGas">): Hex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0.7.js","sourceRoot":"","sources":["../../../src/entrypoint/0.7.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,mBAAmB,EACnB,WAAW,EACX,SAAS,EACT,SAAS,EACT,GAAG,GAKJ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D,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,MAAM,CAAC;QACZ,SAAS;QACT,GAAG,CAAC,6BAA6B,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QAChD,GAAG,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QAC1C,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,gBAAwB;IAI7D,OAAO;QACL,oBAAoB,EAAE,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QACjE,YAAY,EAAE,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;KACvD,CAAC;AACJ,CAAC","sourcesContent":["import {\n concat,\n encodeAbiParameters,\n hexToBigInt,\n isAddress,\n keccak256,\n pad,\n type Address,\n type Chain,\n type Hash,\n type Hex,\n} from \"viem\";\nimport { EntryPointAbi_v7 } from \"../abis/EntryPointAbi_v7.js\";\nimport type {\n UserOperationRequest,\n UserOperationRequest_v7,\n} from \"../types.js\";\nimport type { SupportedEntryPoint } from \"./types.js\";\n\nconst packUserOperation = (request: UserOperationRequest<\"0.7.0\">): Hex => {\n const initCode =\n request.factory && request.factoryData\n ? concat([request.factory, request.factoryData])\n : \"0x\";\n const accountGasLimits = packAccountGasLimits({\n verificationGasLimit: request.verificationGasLimit,\n callGasLimit: request.callGasLimit,\n });\n\n const gasFees = packAccountGasLimits({\n maxPriorityFeePerGas: request.maxPriorityFeePerGas,\n maxFeePerGas: request.maxFeePerGas,\n });\n\n const paymasterAndData =\n request.paymaster && isAddress(request.paymaster)\n ? packPaymasterData({\n paymaster: request.paymaster,\n paymasterVerificationGasLimit: request.paymasterVerificationGasLimit,\n paymasterPostOpGasLimit: request.paymasterPostOpGasLimit,\n paymasterData: request.paymasterData,\n })\n : \"0x\";\n\n return encodeAbiParameters(\n [\n { type: \"address\" },\n { type: \"uint256\" },\n { type: \"bytes32\" },\n { type: \"bytes32\" },\n { type: \"bytes32\" },\n { type: \"uint256\" },\n { type: \"bytes32\" },\n { type: \"bytes32\" },\n ],\n [\n request.sender as Address,\n hexToBigInt(request.nonce),\n keccak256(initCode),\n keccak256(request.callData),\n accountGasLimits,\n hexToBigInt(request.preVerificationGas),\n gasFees,\n keccak256(paymasterAndData),\n ]
|
|
1
|
+
{"version":3,"file":"0.7.js","sourceRoot":"","sources":["../../../src/entrypoint/0.7.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,mBAAmB,EACnB,WAAW,EACX,SAAS,EACT,SAAS,EACT,GAAG,GAKJ,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAO/D,MAAM,iBAAiB,GAAG,CAAC,OAAsC,EAAO,EAAE;IACxE,MAAM,QAAQ,GACZ,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,WAAW;QACpC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;QAChD,CAAC,CAAC,IAAI,CAAC;IACX,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;QAC5C,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;QAClD,YAAY,EAAE,OAAO,CAAC,YAAY;KACnC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,oBAAoB,CAAC;QACnC,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;QAClD,YAAY,EAAE,OAAO,CAAC,YAAY;KACnC,CAAC,CAAC;IAEH,MAAM,gBAAgB,GACpB,OAAO,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC;QAC/C,CAAC,CAAC,iBAAiB,CAAC;YAChB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,6BAA6B,EAAE,OAAO,CAAC,6BAA6B;YACpE,uBAAuB,EAAE,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CAAC;AAEzE,MAAM,UAAU,oBAAoB,CAClC,IAE0E;IAE1E,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,EAChC,SAAS,EACT,6BAA6B,EAC7B,uBAAuB,EACvB,aAAa,GAOd;IACC,IACE,CAAC,SAAS;QACV,CAAC,6BAA6B;QAC9B,CAAC,uBAAuB;QACxB,CAAC,aAAa,EACd,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,MAAM,CAAC;QACZ,SAAS;QACT,GAAG,CAAC,6BAA6B,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QAChD,GAAG,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QAC1C,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,gBAAwB;IAI7D,OAAO;QACL,oBAAoB,EAAE,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QACjE,YAAY,EAAE,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;KACvD,CAAC;AACJ,CAAC","sourcesContent":["import {\n concat,\n encodeAbiParameters,\n hexToBigInt,\n isAddress,\n keccak256,\n pad,\n type Address,\n type Chain,\n type Hash,\n type Hex,\n} from \"viem\";\nimport { EntryPointAbi_v7 } from \"../abis/EntryPointAbi_v7.js\";\nimport type {\n UserOperationRequest,\n UserOperationRequest_v7,\n} from \"../types.js\";\nimport type { SupportedEntryPoint } from \"./types.js\";\n\nconst packUserOperation = (request: UserOperationRequest<\"0.7.0\">): Hex => {\n const initCode =\n request.factory && request.factoryData\n ? concat([request.factory, request.factoryData])\n : \"0x\";\n const accountGasLimits = packAccountGasLimits({\n verificationGasLimit: request.verificationGasLimit,\n callGasLimit: request.callGasLimit,\n });\n\n const gasFees = packAccountGasLimits({\n maxPriorityFeePerGas: request.maxPriorityFeePerGas,\n maxFeePerGas: request.maxFeePerGas,\n });\n\n const paymasterAndData =\n request.paymaster && isAddress(request.paymaster)\n ? packPaymasterData({\n paymaster: request.paymaster,\n paymasterVerificationGasLimit: request.paymasterVerificationGasLimit,\n paymasterPostOpGasLimit: request.paymasterPostOpGasLimit,\n paymasterData: request.paymasterData,\n })\n : \"0x\";\n\n return encodeAbiParameters(\n [\n { type: \"address\" },\n { type: \"uint256\" },\n { type: \"bytes32\" },\n { type: \"bytes32\" },\n { type: \"bytes32\" },\n { type: \"uint256\" },\n { type: \"bytes32\" },\n { type: \"bytes32\" },\n ],\n [\n request.sender as Address,\n hexToBigInt(request.nonce),\n keccak256(initCode),\n keccak256(request.callData),\n accountGasLimits,\n hexToBigInt(request.preVerificationGas),\n gasFees,\n keccak256(paymasterAndData),\n ],\n );\n};\n\nexport default {\n version: \"0.7.0\",\n\n address: {\n default: \"0x0000000071727De22E5E9d8BAf0edAc6f37da032\",\n },\n\n abi: EntryPointAbi_v7,\n\n getUserOperationHash: (\n request: UserOperationRequest<\"0.7.0\">,\n entryPointAddress: Address,\n chainId: number,\n ): Hash => {\n const encoded = encodeAbiParameters(\n [{ type: \"bytes32\" }, { type: \"address\" }, { type: \"uint256\" }],\n [\n keccak256(packUserOperation(request)),\n entryPointAddress,\n BigInt(chainId),\n ],\n );\n\n return keccak256(encoded);\n },\n\n packUserOperation,\n} satisfies SupportedEntryPoint<\"0.7.0\", Chain, typeof EntryPointAbi_v7>;\n\nexport function packAccountGasLimits(\n data:\n | Pick<UserOperationRequest_v7, \"verificationGasLimit\" | \"callGasLimit\">\n | Pick<UserOperationRequest_v7, \"maxPriorityFeePerGas\" | \"maxFeePerGas\">,\n): Hex {\n return concat(Object.values(data).map((v) => pad(v, { size: 16 })));\n}\n\nexport function packPaymasterData({\n paymaster,\n paymasterVerificationGasLimit,\n paymasterPostOpGasLimit,\n paymasterData,\n}: Pick<\n UserOperationRequest_v7,\n | \"paymaster\"\n | \"paymasterVerificationGasLimit\"\n | \"paymasterPostOpGasLimit\"\n | \"paymasterData\"\n>): Hex {\n if (\n !paymaster ||\n !paymasterVerificationGasLimit ||\n !paymasterPostOpGasLimit ||\n !paymasterData\n ) {\n return \"0x\";\n }\n return concat([\n paymaster,\n pad(paymasterVerificationGasLimit, { size: 16 }),\n pad(paymasterPostOpGasLimit, { size: 16 }),\n paymasterData,\n ]);\n}\n\nexport function unpackAccountGasLimits(accountGasLimits: string): {\n verificationGasLimit: number;\n callGasLimit: number;\n} {\n return {\n verificationGasLimit: parseInt(accountGasLimits.slice(2, 34), 16),\n callGasLimit: parseInt(accountGasLimits.slice(34), 16),\n };\n}\n"]}
|
|
@@ -16,7 +16,7 @@ export declare const entryPointRegistry: EntryPointRegistry;
|
|
|
16
16
|
* @param {*} value The value to be checked
|
|
17
17
|
* @returns {boolean} true if the value is a valid key of EntryPointRegistry, false otherwise
|
|
18
18
|
*/
|
|
19
|
-
export declare const isEntryPointVersion: (value: any) => value is keyof EntryPointRegistry
|
|
19
|
+
export declare const isEntryPointVersion: (value: any) => value is keyof EntryPointRegistry;
|
|
20
20
|
export declare function getEntryPoint<TEntryPointVersion extends EntryPointVersion = DefaultEntryPointVersion, TChain extends Chain = Chain>(chain: TChain, options: GetEntryPointOptions<TEntryPointVersion>): EntryPointDefRegistry<TChain>[TEntryPointVersion];
|
|
21
21
|
export declare function getEntryPoint<TEntryPointVersion extends DefaultEntryPointVersion = DefaultEntryPointVersion, TChain extends Chain = Chain>(chain: TChain, options?: GetEntryPointOptions<TEntryPointVersion>): EntryPointDefRegistry<TChain>[TEntryPointVersion];
|
|
22
22
|
export declare function getEntryPoint<TChain extends Chain = Chain>(chain: TChain, options?: GetEntryPointOptions<DefaultEntryPointVersion>): EntryPointDefRegistry<TChain>[DefaultEntryPointVersion];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entrypoint/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,aAAa,MAAM,UAAU,CAAC;AACrC,OAAO,aAAa,MAAM,UAAU,CAAC;AASrC,MAAM,CAAC,MAAM,wBAAwB,GAA6B,OAAO,CAAC;AAE1E,MAAM,CAAC,MAAM,kBAAkB,GAAuB;IACpD,OAAO,EAAE,aAAa;IACtB,OAAO,EAAE,aAAa;CACvB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,KAAU,EACyB,EAAE;IACrC,OAAO,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entrypoint/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,aAAa,MAAM,UAAU,CAAC;AACrC,OAAO,aAAa,MAAM,UAAU,CAAC;AASrC,MAAM,CAAC,MAAM,wBAAwB,GAA6B,OAAO,CAAC;AAE1E,MAAM,CAAC,MAAM,kBAAkB,GAAuB;IACpD,OAAO,EAAE,aAAa;IACtB,OAAO,EAAE,aAAa;CACvB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,KAAU,EACyB,EAAE;IACrC,OAAO,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,C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AAM,IAAI,uBAAuB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC","sourcesContent":["import { type Chain } from \"viem\";\nimport { EntryPointNotFoundError } from \"../errors/entrypoint.js\";\nimport EntryPoint_v6 from \"./0.6.js\";\nimport EntryPoint_v7 from \"./0.7.js\";\nimport type {\n DefaultEntryPointVersion,\n EntryPointDefRegistry,\n EntryPointRegistry,\n EntryPointVersion,\n GetEntryPointOptions,\n} from \"./types.js\";\n\nexport const defaultEntryPointVersion: DefaultEntryPointVersion = \"0.6.0\";\n\nexport const entryPointRegistry: EntryPointRegistry = {\n \"0.6.0\": EntryPoint_v6,\n \"0.7.0\": EntryPoint_v7,\n};\n\n/**\n * Checks if the given value is a valid key of the EntryPointRegistry.\n *\n * @example\n * ```ts\n * import { isEntryPointVersion } from \"@aa-sdk/core\";\n *\n * const valid = isEntryPointVersion(\"0.6.0\");\n * const invalid = isEntryPointVersion(\"0.8.0\");\n * ```\n *\n * @param {*} value The value to be checked\n * @returns {boolean} true if the value is a valid key of EntryPointRegistry, false otherwise\n */\nexport const isEntryPointVersion = (\n value: any,\n): value is keyof EntryPointRegistry => {\n return Object.keys(entryPointRegistry).includes(value);\n};\n\nexport function getEntryPoint<\n TEntryPointVersion extends EntryPointVersion = DefaultEntryPointVersion,\n TChain extends Chain = Chain,\n>(\n chain: TChain,\n options: GetEntryPointOptions<TEntryPointVersion>,\n): EntryPointDefRegistry<TChain>[TEntryPointVersion];\n\nexport function getEntryPoint<\n TEntryPointVersion extends\n DefaultEntryPointVersion = DefaultEntryPointVersion,\n TChain extends Chain = Chain,\n>(\n chain: TChain,\n options?: GetEntryPointOptions<TEntryPointVersion>,\n): EntryPointDefRegistry<TChain>[TEntryPointVersion];\n\nexport function getEntryPoint<TChain extends Chain = Chain>(\n chain: TChain,\n options?: GetEntryPointOptions<DefaultEntryPointVersion>,\n): EntryPointDefRegistry<TChain>[DefaultEntryPointVersion];\n\n/**\n * Retrieves the entry point definition for the specified chain and version, falling back to the default version if not provided. Throws an error if the entry point address cannot be found.\n *\n * @example\n * ```ts\n * import { getEntryPoint } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n *\n * const entryPoint060 = getEntryPoint(sepolia);\n * const entryPoint070 = getEntryPoint(sepolia, { version: \"0.7.0\" });\n * ```\n *\n * @param {Chain} chain The chain for which the entry point is being retrieved\n * @param {GetEntryPointOptions<TEntryPointVersion>} options Options containing the version and address overrides for the entry point\n * @returns {EntryPointDefRegistry<TChain>[EntryPointVersion]} The entry point definition for the specified chain and version\n */\nexport function getEntryPoint<\n TEntryPointVersion extends EntryPointVersion,\n TChain extends Chain = Chain,\n>(\n chain: TChain,\n options: GetEntryPointOptions<TEntryPointVersion>,\n): EntryPointDefRegistry<TChain>[EntryPointVersion] {\n const { version = defaultEntryPointVersion, addressOverride } = options ?? {\n version: defaultEntryPointVersion,\n };\n\n const entryPoint = entryPointRegistry[version ?? defaultEntryPointVersion];\n const address =\n addressOverride ??\n entryPoint.address[chain.id] ??\n entryPoint.address.default;\n if (!address) {\n throw new EntryPointNotFoundError(chain, version);\n }\n\n if (entryPoint.version === \"0.6.0\") {\n return {\n version: entryPoint.version,\n address,\n chain,\n abi: entryPoint.abi,\n getUserOperationHash: (r) =>\n entryPoint.getUserOperationHash(r, address, chain.id),\n packUserOperation: entryPoint.packUserOperation,\n };\n } else if (entryPoint.version === \"0.7.0\") {\n return {\n version: entryPoint.version,\n address,\n chain,\n abi: entryPoint.abi,\n getUserOperationHash: (r) =>\n entryPoint.getUserOperationHash(r, address, chain.id),\n packUserOperation: entryPoint.packUserOperation,\n };\n }\n\n throw new EntryPointNotFoundError(chain, version);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/entrypoint/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n Abi,\n Account,\n Address,\n Chain,\n GetContractParameters,\n Hash,\n Hex,\n Transport,\n} from \"viem\";\nimport type { EntryPointAbi_v6 } from \"../abis/EntryPointAbi_v6\";\nimport type { EntryPointAbi_v7 } from \"../abis/EntryPointAbi_v7\";\nimport type { UserOperationRequest } from \"../types\";\nimport type { EQ, IsOneOf, OneOf } from \"../utils\";\n\nexport interface EntryPointRegistryBase<T> {\n \"0.6.0\": T;\n \"0.7.0\": T;\n}\nexport type EntryPointVersion = keyof EntryPointRegistryBase<unknown>;\nexport type DefaultEntryPointVersion = OneOf<\"0.6.0\", EntryPointVersion>;\n\nexport type SupportedEntryPoint<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion,\n TChain extends Chain = Chain,\n TAbi extends Abi | readonly unknown[] = Abi
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/entrypoint/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n Abi,\n Account,\n Address,\n Chain,\n GetContractParameters,\n Hash,\n Hex,\n Transport,\n} from \"viem\";\nimport type { EntryPointAbi_v6 } from \"../abis/EntryPointAbi_v6\";\nimport type { EntryPointAbi_v7 } from \"../abis/EntryPointAbi_v7\";\nimport type { UserOperationRequest } from \"../types\";\nimport type { EQ, IsOneOf, OneOf } from \"../utils\";\n\nexport interface EntryPointRegistryBase<T> {\n \"0.6.0\": T;\n \"0.7.0\": T;\n}\nexport type EntryPointVersion = keyof EntryPointRegistryBase<unknown>;\nexport type DefaultEntryPointVersion = OneOf<\"0.6.0\", EntryPointVersion>;\n\nexport type SupportedEntryPoint<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion,\n TChain extends Chain = Chain,\n TAbi extends Abi | readonly unknown[] = Abi,\n> = {\n version: TEntryPointVersion;\n address: Record<TChain[\"id\"] | \"default\", Address>;\n abi: GetContractParameters<Transport, TChain, Account, TAbi>[\"abi\"];\n\n /**\n * Generates a hash for a UserOperation valid from entry point version 0.6 onwards\n *\n * @param request - the UserOperation to get the hash for\n * @param entryPointAddress - the entry point address that will be used to execute the UserOperation\n * @param chainId - the chain on which this UserOperation will be executed\n * @returns the hash of the UserOperation\n */\n getUserOperationHash: (\n request: UserOperationRequest<TEntryPointVersion>,\n entryPointAddress: Address,\n chainId: number,\n ) => Hash;\n\n /**\n * Pack the user operation data into bytes for hashing for entry point version 0.6 onwards\n * Reference:\n * v6: https://github.com/eth-infinitism/account-abstraction/blob/releases/v0.6/test/UserOp.ts#L16-L61\n * v7: https://github.com/eth-infinitism/account-abstraction/blob/releases/v0.7/test/UserOp.ts#L28-L67\n *\n * @param request - the UserOperation to get the hash for\n * @returns the hash of the UserOperation\n */\n packUserOperation: (\n userOperation: UserOperationRequest<TEntryPointVersion>,\n ) => Hex;\n};\n\nexport interface EntryPointRegistry<TChain extends Chain = Chain>\n extends EntryPointRegistryBase<\n SupportedEntryPoint<EntryPointVersion, TChain, Abi>\n > {\n \"0.6.0\": SupportedEntryPoint<\"0.6.0\", TChain, typeof EntryPointAbi_v6>;\n \"0.7.0\": SupportedEntryPoint<\"0.7.0\", TChain, typeof EntryPointAbi_v7>;\n}\n\n// [!region EntryPointDef]\nexport type EntryPointDef<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion,\n TChain extends Chain = Chain,\n TAbi extends Abi | readonly unknown[] = Abi,\n> = {\n version: TEntryPointVersion;\n address: Address;\n chain: TChain;\n abi: GetContractParameters<Transport, TChain, Account, TAbi>[\"abi\"];\n getUserOperationHash: (\n request: UserOperationRequest<TEntryPointVersion>,\n ) => Hex;\n packUserOperation: (\n userOperation: UserOperationRequest<TEntryPointVersion>,\n ) => Hex;\n};\n// [!endregion EntryPointDef]\n\nexport interface EntryPointDefRegistry<TChain extends Chain = Chain>\n extends EntryPointRegistryBase<\n EntryPointDef<EntryPointVersion, TChain, Abi>\n > {\n \"0.6.0\": EntryPointDef<\"0.6.0\", TChain, typeof EntryPointAbi_v6>;\n \"0.7.0\": EntryPointDef<\"0.7.0\", TChain, typeof EntryPointAbi_v7>;\n}\n\nexport type GetEntryPointOptions<\n TEntryPointVersion extends EntryPointVersion = DefaultEntryPointVersion,\n> =\n EQ<TEntryPointVersion, DefaultEntryPointVersion> extends true\n ?\n | {\n addressOverride?: Address;\n version?: OneOf<TEntryPointVersion, EntryPointVersion>;\n }\n | undefined\n : {\n addressOverride?: Address;\n version: OneOf<TEntryPointVersion, EntryPointVersion>;\n };\n\nexport type EntryPointParameter<\n TEntryPointVersion extends EntryPointVersion,\n TChain extends Chain = Chain,\n> =\n EQ<TEntryPointVersion, DefaultEntryPointVersion> extends true\n ? {\n entryPoint?: EntryPointDef<TEntryPointVersion, TChain>;\n }\n : {\n entryPoint: IsOneOf<TEntryPointVersion, EntryPointVersion> extends true\n ? EntryPointDef<TEntryPointVersion, TChain>\n : never;\n };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/errors/account.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAGjD,oDAAoD;IAEpD;;OAEG,CAAC;QACF,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAPzD;;;;mBAAO,sBAAsB;WAAC;IAQvC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,6BAA8B,SAAQ,SAAS;IAG1D;;;;;;OAMG;IACH,YAAY,WAAmB,EAAE,KAAY,EAAE,OAA0B;QACvE,KAAK,CACH;YACE,0BAA0B,WAAW,mBAAmB,KAAK,CAAC,IAAI,2BAA2B,OAAO,EAAE;YACtG,gFAAgF;SACjF,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QAfK;;;;mBAAO,+BAA+B;WAAC;IAgBhD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,SAAS;IAG1D;;OAEG,CAAC;QACF,KAAK,CAAC,iCAAiC,CAAC,CAAC;QALlC;;;;mBAAO,+BAA+B;WAAC;IAMhD,CAAC;CACF;AAED;;GAEG;AACH,M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AQ,SAAS,MAAM,EAAE,CAAC,CAAC;QATnD;;;;mBAAO,2BAA2B;WAAC;IAU5C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,mCAAoC,SAAQ,SAAS;IAGhE;;OAEG,CAAC;QACF,KAAK,CAAC,iCAAiC,CAAC,CAAC;QALlC;;;;mBAAO,qCAAqC;WAAC;IAMtD,CAAC;CACF","sourcesContent":["import type { Chain } from \"viem\";\nimport type { EntryPointVersion } from \"../entrypoint/types.js\";\nimport { BaseError } from \"./base.js\";\n\n/**\n * This error is thrown when an account could not be found to execute a specific action. It extends the `BaseError` class.\n */\nexport class AccountNotFoundError extends BaseError {\n override name = \"AccountNotFoundError\";\n\n // TODO: extend this further using docs path as well\n\n /**\n * Constructor for initializing an error message indicating that an account could not be found to execute the specified action.\n */ constructor() {\n super(\"Could not find an Account to execute with this Action.\");\n }\n}\n\n/**\n * Represents an error that is thrown when no default factory is defined for a specific account type on a given chain and entry point version.\n * This error suggests providing an override via the `factoryAddress` parameter when creating an account.\n */\nexport class DefaultFactoryNotDefinedError extends BaseError {\n override name = \"DefaultFactoryNotDefinedError\";\n\n /**\n * Constructs an error message indicating that no default factory was found for the given account type, chain, and entry point version.\n *\n * @param {string} accountType the type of account\n * @param {Chain} chain the blockchain chain\n * @param {EntryPointVersion} version the entry point version\n */\n constructor(accountType: string, chain: Chain, version: EntryPointVersion) {\n super(\n [\n `No default factory for ${accountType} found on chain ${chain.name} for entrypoint version ${version}`,\n \"Supply an override via the `factoryAddress` parameter when creating an account\",\n ].join(\"\\n\")
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/errors/account.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAGjD,oDAAoD;IAEpD;;OAEG,CAAC;QACF,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAPzD;;;;mBAAO,s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,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,SAAS;IAGtD;;;;OAIG;IACH,YAAY,WAAmB;QAC7B,KAAK,CAAC,mBAAmB,WAAW,+BAA+B,CAAC,CAAC;QAR9D;;;;mBAAO,2BAA2B;WAAC;IAS5C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,iCAAkC,SAAQ,SAAS;IAG9D;;;;OAIG;IACH,YAAY,WAAmB;QAC7B,KAAK,CAAC,wCAAwC,WAAW,EAAE,CAAC,CAAC;QARtD;;;;mBAAO,mCAAmC;WAAC;IASpD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAGjD;;;;;OAKG;IACH,YAAY,QAAgB,EAAE,MAAc;QAC1C,KAAK,CAAC,yBAAyB,QAAQ,SAAS,MAAM,EAAE,CAAC,CAAC;QATnD;;;;mBAAO,2BAA2B;WAAC;IAU5C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,mCAAoC,SAAQ,SAAS;IAGhE;;OAEG,CAAC;QACF,KAAK,CAAC,iCAAiC,CAAC,CAAC;QALlC;;;;mBAAO,qCAAqC;WAAC;IAMtD,CAAC;CACF","sourcesContent":["import type { Chain } from \"viem\";\nimport type { EntryPointVersion } from \"../entrypoint/types.js\";\nimport { BaseError } from \"./base.js\";\n\n/**\n * This error is thrown when an account could not be found to execute a specific action. It extends the `BaseError` class.\n */\nexport class AccountNotFoundError extends BaseError {\n override name = \"AccountNotFoundError\";\n\n // TODO: extend this further using docs path as well\n\n /**\n * Constructor for initializing an error message indicating that an account could not be found to execute the specified action.\n */ constructor() {\n super(\"Could not find an Account to execute with this Action.\");\n }\n}\n\n/**\n * Represents an error that is thrown when no default factory is defined for a specific account type on a given chain and entry point version.\n * This error suggests providing an override via the `factoryAddress` parameter when creating an account.\n */\nexport class DefaultFactoryNotDefinedError extends BaseError {\n override name = \"DefaultFactoryNotDefinedError\";\n\n /**\n * Constructs an error message indicating that no default factory was found for the given account type, chain, and entry point version.\n *\n * @param {string} accountType the type of account\n * @param {Chain} chain the blockchain chain\n * @param {EntryPointVersion} version the entry point version\n */\n constructor(accountType: string, chain: Chain, version: EntryPointVersion) {\n super(\n [\n `No default factory for ${accountType} found on chain ${chain.name} for entrypoint version ${version}`,\n \"Supply an override via the `factoryAddress` parameter when creating an account\",\n ].join(\"\\n\"),\n );\n }\n}\n\n/**\n * Custom error class for handling errors when getting a counterfactual address. This extends the `BaseError` class and provides a custom error message and name.\n */\nexport class GetCounterFactualAddressError extends BaseError {\n override name = \"GetCounterFactualAddressError\";\n\n /**\n * Constructor for initializing an error message indicating the failure of fetching the counter-factual address.\n */ constructor() {\n super(\"getCounterFactualAddress failed\");\n }\n}\n\n/**\n * An error class representing the condition where upgrades are not supported for a specific account type. This error extends the `BaseError` class and provides a custom error message based on the account type.\n */\nexport class UpgradesNotSupportedError extends BaseError {\n override name = \"UpgradesNotSupported\";\n\n /**\n * Error constructor for indicating that upgrades are not supported by the given account type.\n *\n * @param {string} accountType The type of account that does not support upgrades\n */\n constructor(accountType: string) {\n super(`Upgrades are not supported by ${accountType}`);\n }\n}\n\n/**\n * Error thrown when attempting to sign a transaction that is not supported by smart contracts.\n */\nexport class SignTransactionNotSupportedError extends BaseError {\n override name = \"SignTransactionNotSupported\";\n\n /**\n * Throws an error indicating that signing a transaction is not supported by smart contracts.\n *\n \n */ constructor() {\n super(`SignTransaction is not supported by smart contracts`);\n }\n}\n\n/**\n * Custom error class `FailedToGetStorageSlotError` which is used to signal a failure when attempting to retrieve a storage slot. This error includes the slot and slot descriptor in its message and inherits from `BaseError`.\n */\nexport class FailedToGetStorageSlotError extends BaseError {\n override name = \"FailedToGetStorageSlotError\";\n\n /**\n * Custom error message constructor for failing to get a specific storage slot.\n *\n * @param {string} slot The storage slot that failed to be accessed or retrieved\n * @param {string} slotDescriptor A description of the storage slot, for additional context in the error message\n */\n constructor(slot: string, slotDescriptor: string) {\n super(`Failed to get storage slot ${slot} (${slotDescriptor})`);\n }\n}\n\n/**\n * Represents an error indicating that batch execution is not supported for a specific account type.\n */\nexport class BatchExecutionNotSupportedError extends BaseError {\n override name = \"BatchExecutionNotSupportedError\";\n\n /**\n * Constructs an error message indicating that batch execution is not supported by the specified account type.\n *\n * @param {string} accountType the type of account that does not support batch execution\n */\n constructor(accountType: string) {\n super(`Batch execution is not supported by ${accountType}`);\n }\n}\n\n/**\n * Represents an error that occurs when an account requires an owner to execute but none is provided.\n */\nexport class AccountRequiresOwnerError extends BaseError {\n override name = \"AccountRequiresOwnerError\";\n\n /**\n * Constructs an error indicating that an account of the specified type requires an owner to execute.\n *\n * @param {string} accountType The type of account that requires an owner\n */\n constructor(accountType: string) {\n super(`Account of type ${accountType} requires an owner to execute`);\n }\n}\n\n/**\n * Represents an error that occurs when an attempt is made to call `UpgradeToAndCall` on an account type that does not support it. Includes the account type in the error message.\n */\nexport class UpgradeToAndCallNotSupportedError extends BaseError {\n override name = \"UpgradeToAndCallNotSupportedError\";\n\n /**\n * Constructs an error message indicating that `UpgradeToAndCall` is not supported by the specified account type.\n *\n * @param {string} accountType The type of account that does not support `UpgradeToAndCall`\n */\n constructor(accountType: string) {\n super(`UpgradeToAndCall is not supported by ${accountType}`);\n }\n}\n\n/**\n * Represents an error thrown when an account type does not match the expected type.\n */\nexport class IncorrectAccountType extends BaseError {\n override name = \"IncorrectAccountTypeError\";\n\n /**\n * Constructs an error object indicating that the expected account type does not match the actual account type.\n *\n * @param {string} expected the expected account type\n * @param {string} actual the actual account type that was received\n */\n constructor(expected: string, actual: string) {\n super(`Expected account type ${expected}, got ${actual}`);\n }\n}\n\n/**\n * Error class indicating that a smart account operation requires a signer.\n */\nexport class SmartAccountWithSignerRequiredError extends BaseError {\n override name = \"SmartAccountWithSignerRequiredError\";\n\n /**\n * Initializes a new instance of the error class with a predefined error message indicating that a smart account requires a signer.\n */ constructor() {\n super(\"Smart account requires a signer\");\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
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,4DAA4D,CAAC,CAAC;QAN7D;;;;mBAAO,uBAAuB;WAAC;IAOxC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,SAAS;IAGxD;;OAEG;IACH;QACE,KAAK,CAAC,4DAA4D,CAAC,CAAC;QAN7D;;;;mBAAO,6BAA6B;WAAC;IAO9C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,SAAS;IAGvD;;OAEG;IACH;QACE,KAAK,CAAC,+CAA+C,CAAC,CAAC;QANhD;;;;mBAAO,4BAA4B;WAAC;IAO7C,CAAC;CACF","sourcesContent":["import type { Client } from \"viem\";\nimport { BaseError } from \"./base.js\";\n\n/**\n * Represents an error thrown when a client is not compatible with the expected client type for a specific method. The error message provides guidance on how to create a compatible client.\n */\nexport class IncompatibleClientError extends BaseError {\n override name = \"IncompatibleClientError\";\n\n /**\n * Throws an error when the client type does not match the expected client type.\n *\n * @param {string} expectedClient The expected type of the client.\n * @param {string} method The method that was called.\n * @param {Client} client The client instance.\n */\n constructor(expectedClient: string, method: string, client: Client) {\n super(\n [\n `Client of type (${client.type}) is not a ${expectedClient}.`,\n `Create one with \\`createSmartAccountClient\\` first before using \\`${method}\\``,\n ].join(\"\\n\")
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/errors/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,SAAS;IAGpD;;;;;;OAMG;IACH,YAAY,cAAsB,EAAE,MAAc,EAAE,MAAc;QAChE,KAAK,CACH;YACE,mBAAmB,MAAM,CAAC,IAAI,cAAc,cAAc,GAAG;YAC7D,qEAAqE,MAAM,IAAI;SAChF,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QAfK;;;;mBAAO,yBAAyB;WAAC;IAgB1C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,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error thrown when a client is not compatible with the expected client type for a specific method. The error message provides guidance on how to create a compatible client.\n */\nexport class IncompatibleClientError extends BaseError {\n override name = \"IncompatibleClientError\";\n\n /**\n * Throws an error when the client type does not match the expected client type.\n *\n * @param {string} expectedClient The expected type of the client.\n * @param {string} method The method that was called.\n * @param {Client} client The client instance.\n */\n constructor(expectedClient: string, method: string, client: Client) {\n super(\n [\n `Client of type (${client.type}) is not a ${expectedClient}.`,\n `Create one with \\`createSmartAccountClient\\` first before using \\`${method}\\``,\n ].join(\"\\n\"),\n );\n }\n}\n\n/**\n * Represents an error that occurs when an invalid RPC URL is provided. This class extends the `BaseError` class and includes the invalid URL in the error message.\n */\nexport class InvalidRpcUrlError extends BaseError {\n override name = \"InvalidRpcUrlError\";\n\n /**\n * Creates an instance of an error with a message indicating an invalid RPC URL.\n *\n * @param {string} [rpcUrl] The invalid RPC URL that caused the error\n */\n constructor(rpcUrl?: string) {\n super(`Invalid RPC URL ${rpcUrl}`);\n }\n}\n\n/**\n * Error class representing a \"Chain Not Found\" error, typically thrown when no chain is supplied to the client.\n */\nexport class ChainNotFoundError extends BaseError {\n override name = \"ChainNotFoundError\";\n\n /**\n * Initializes a new instance of the error message with a default message indicating that no chain was supplied to the client.\n */\n constructor() {\n super(\"No chain supplied to the client\");\n }\n}\n\n/**\n * Error class denoting that the provided entity id is invalid because it's too large.\n */\nexport class InvalidEntityIdError extends BaseError {\n override name = \"InvalidEntityIdError\";\n\n /**\n * Initializes a new instance of the error message with a default message indicating that the entity id is invalid because it's too large.\n *\n * @param {number} entityId the invalid entityId used\n */\n constructor(entityId: number) {\n super(\n `Entity ID used is ${entityId}, but must be less than or equal to uint32.max`,\n );\n }\n}\n\n/**\n * Error class denoting that the nonce key is invalid because its too large.\n */\nexport class InvalidNonceKeyError extends BaseError {\n override name = \"InvalidNonceKeyError\";\n\n /**\n * Initializes a new instance of the error message with a default message indicating that the nonce key is invalid.\n *\n * @param {bigint} nonceKey the invalid nonceKey used\n */\n constructor(nonceKey: bigint) {\n super(\n `Nonce key is ${nonceKey} but has to be less than or equal to 2**152`,\n );\n }\n}\n\n/**\n * Error class denoting that the provided entity id is invalid because it's overriding the native entity id.\n */\nexport class EntityIdOverrideError extends BaseError {\n override name = \"EntityIdOverrideError\";\n\n /**\n * Initializes a new instance of the error message with a default message indicating that the nonce key is invalid.\n */\n constructor() {\n super(`EntityId of 0 is reserved for the owner and cannot be used`);\n }\n}\n\n/**\n * Error class denoting that the provided ma v2 account mode is invalid.\n */\nexport class InvalidModularAccountV2Mode extends BaseError {\n override name = \"InvalidModularAccountV2Mode\";\n\n /**\n * Initializes a new instance of the error message with a default message indicating that the provided ma v2 account mode is invalid.\n */\n constructor() {\n super(`The provided account mode is invalid for ModularAccount V2`);\n }\n}\n\n/**\n * Error class denoting that the deferred action nonce used is invalid.\n */\nexport class InvalidDeferredActionNonce extends BaseError {\n override name = \"InvalidDeferredActionNonce\";\n\n /**\n * Initializes a new instance of the error message with a default message indicating that the provided deferred action nonce is invalid.\n */\n constructor() {\n super(`The provided deferred action nonce is invalid`);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoint.js","sourceRoot":"","sources":["../../../src/errors/entrypoint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,SAAS;IAGpD;;;;;OAKG;IACH,YAAY,KAAY,EAAE,iBAAsB;QAC9C,KAAK,CACH;YACE,2BAA2B,iBAAiB,eAAe,KAAK,CAAC,IAAI,GAAG;YACxE,qBAAqB;SACtB,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QAdK;;;;mBAAO,yBAAyB;WAAC;IAe1C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,SAAS;IAGnD;;;;;OAKG;IACH,YAAY,KAAY,EAAE,iBAAsB;QAC9C,KAAK,CACH,2CAA2C,iBAAiB,QAAQ,KAAK,CAAC,IAAI,GAAG,CAClF,CAAC;QAXK;;;;mBAAO,wBAAwB;WAAC;IAYzC,CAAC;CACF","sourcesContent":["import type { Chain } from \"viem\";\nimport { BaseError } from \"./base.js\";\n\n/**\n * Represents an error thrown when an entry point is not found for a specific chain and entry point version. This error indicates that a default entry point does not exist for the given chain and version, and suggests providing an override.\n */\nexport class EntryPointNotFoundError extends BaseError {\n override name = \"EntryPointNotFoundError\";\n\n /**\n * Constructs an error message indicating that no default entry point exists for the given chain and entry point version.\n *\n * @param {Chain} chain The blockchain network for which the entry point is being queried\n * @param {any} entryPointVersion The version of the entry point for which no default exists\n */\n constructor(chain: Chain, entryPointVersion: any) {\n super(\n [\n `No default entry point v${entryPointVersion} exists for ${chain.name}.`,\n `Supply an override.`,\n ].join(\"\\n\")
|
|
1
|
+
{"version":3,"file":"entrypoint.js","sourceRoot":"","sources":["../../../src/errors/entrypoint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,SAAS;IAGpD;;;;;OAKG;IACH,YAAY,KAAY,EAAE,iBAAsB;QAC9C,KAAK,CACH;YACE,2BAA2B,iBAAiB,eAAe,KAAK,CAAC,IAAI,GAAG;YACxE,qBAAqB;SACtB,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QAdK;;;;mBAAO,yBAAyB;WAAC;IAe1C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,SAAS;IAGnD;;;;;OAKG;IACH,YAAY,KAAY,EAAE,iBAAsB;QAC9C,KAAK,CACH,2CAA2C,iBAAiB,QAAQ,KAAK,CAAC,IAAI,GAAG,CAClF,CAAC;QAXK;;;;mBAAO,wBAAwB;WAAC;IAYzC,CAAC;CACF","sourcesContent":["import type { Chain } from \"viem\";\nimport { BaseError } from \"./base.js\";\n\n/**\n * Represents an error thrown when an entry point is not found for a specific chain and entry point version. This error indicates that a default entry point does not exist for the given chain and version, and suggests providing an override.\n */\nexport class EntryPointNotFoundError extends BaseError {\n override name = \"EntryPointNotFoundError\";\n\n /**\n * Constructs an error message indicating that no default entry point exists for the given chain and entry point version.\n *\n * @param {Chain} chain The blockchain network for which the entry point is being queried\n * @param {any} entryPointVersion The version of the entry point for which no default exists\n */\n constructor(chain: Chain, entryPointVersion: any) {\n super(\n [\n `No default entry point v${entryPointVersion} exists for ${chain.name}.`,\n `Supply an override.`,\n ].join(\"\\n\"),\n );\n }\n}\n\n/**\n * Represents an error thrown when an invalid entry point version is encountered for a specific chain. This error extends the `BaseError` class.\n */\nexport class InvalidEntryPointError extends BaseError {\n override name = \"InvalidEntryPointError\";\n\n /**\n * Constructs an error indicating an invalid entry point version for a specific chain.\n *\n * @param {Chain} chain The chain object containing information about the blockchain\n * @param {any} entryPointVersion The entry point version that is invalid\n */\n constructor(chain: Chain, entryPointVersion: any) {\n super(\n `Invalid entry point: unexpected version ${entryPointVersion} for ${chain.name}.`,\n );\n }\n}\n"]}
|