@latticexyz/paymaster 2.2.15-entrykit-d928bffbd5581fdc643915df1e5faad2eaafa210 → 2.2.15-ff8a065dc8e5216ad23e68f6a6c4856ecb2208a3

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.
@@ -1,669 +0,0 @@
1
- import { Chain, Address, Client, RpcSchema, UnionToTuple, EIP1193Parameters, EIP1193RequestFn, Transport, Hex, Account } from 'viem';
2
-
3
- declare function claimGasPass({ chain, userAddress }: {
4
- chain: Chain;
5
- userAddress: Address;
6
- }): Promise<void>;
7
-
8
- type GetAllowanceParams = {
9
- client: Client;
10
- paymasterAddress: Address;
11
- userAddress: Address;
12
- };
13
- declare function getAllowance({ client, paymasterAddress, userAddress }: GetAllowanceParams): Promise<bigint>;
14
- declare function getAllowanceSlot({ userAddress }: {
15
- userAddress: Address;
16
- }): `0x${string}`;
17
- declare function setAllowanceSlot({ client, paymasterAddress, userAddress, allowance, }: GetAllowanceParams & {
18
- allowance: bigint;
19
- }): Promise<void>;
20
-
21
- declare function getPaymasterAddress(chain: Chain): `0x${string}`;
22
-
23
- declare function hasPassIssuer(chain: Chain): string | false | undefined;
24
-
25
- declare const paymasterAbi: readonly [{
26
- readonly name: "SpenderSystem_AlreadyRegistered";
27
- readonly type: "error";
28
- readonly inputs: readonly [{
29
- readonly type: "address";
30
- readonly name: "spender";
31
- }, {
32
- readonly type: "address";
33
- readonly name: "user";
34
- }];
35
- }, {
36
- readonly name: "SpenderSystem_HasOwnBalance";
37
- readonly type: "error";
38
- readonly inputs: readonly [{
39
- readonly type: "address";
40
- readonly name: "spender";
41
- }];
42
- }, {
43
- readonly name: "registerSpender";
44
- readonly type: "function";
45
- readonly stateMutability: "nonpayable";
46
- readonly inputs: readonly [{
47
- readonly type: "address";
48
- readonly name: "spender";
49
- }];
50
- readonly outputs: readonly [];
51
- }];
52
- declare const paymasterConfig: {
53
- readonly multipleNamespaces: true;
54
- readonly namespace: null;
55
- readonly namespaces: {
56
- readonly root: {
57
- readonly label: "root";
58
- readonly namespace: string;
59
- readonly tables: {
60
- readonly Allowance: {
61
- readonly label: "Allowance";
62
- readonly namespaceLabel: "root";
63
- readonly type: "table";
64
- readonly namespace: string;
65
- readonly name: string;
66
- readonly tableId: `0x${string}`;
67
- readonly schema: {
68
- readonly user: {
69
- readonly type: "address";
70
- readonly internalType: "address";
71
- };
72
- readonly allowance: {
73
- readonly type: "uint256";
74
- readonly internalType: "uint256";
75
- };
76
- };
77
- readonly key: readonly ["user"];
78
- readonly codegen: {
79
- readonly outputDirectory: string;
80
- readonly tableIdArgument: false;
81
- readonly storeArgument: false;
82
- readonly dataStruct: boolean;
83
- };
84
- readonly deploy: {
85
- readonly disabled: false;
86
- };
87
- };
88
- readonly Grantor: {
89
- readonly label: "Grantor";
90
- readonly namespaceLabel: "root";
91
- readonly type: "table";
92
- readonly namespace: string;
93
- readonly name: string;
94
- readonly tableId: `0x${string}`;
95
- readonly schema: {
96
- readonly grantor: {
97
- readonly type: "address";
98
- readonly internalType: "address";
99
- };
100
- readonly allowance: {
101
- readonly type: "uint256";
102
- readonly internalType: "uint256";
103
- };
104
- };
105
- readonly key: readonly ["grantor"];
106
- readonly codegen: {
107
- readonly outputDirectory: string;
108
- readonly tableIdArgument: false;
109
- readonly storeArgument: false;
110
- readonly dataStruct: boolean;
111
- };
112
- readonly deploy: {
113
- readonly disabled: false;
114
- };
115
- };
116
- readonly PassHolder: {
117
- readonly label: "PassHolder";
118
- readonly namespaceLabel: "root";
119
- readonly type: "table";
120
- readonly namespace: string;
121
- readonly name: string;
122
- readonly tableId: `0x${string}`;
123
- readonly schema: {
124
- readonly user: {
125
- readonly type: "address";
126
- readonly internalType: "address";
127
- };
128
- readonly passId: {
129
- readonly type: "bytes32";
130
- readonly internalType: "bytes32";
131
- };
132
- readonly lastRenewed: {
133
- readonly type: "uint256";
134
- readonly internalType: "uint256";
135
- };
136
- readonly lastClaimed: {
137
- readonly type: "uint256";
138
- readonly internalType: "uint256";
139
- };
140
- };
141
- readonly key: readonly ["user", "passId"];
142
- readonly codegen: {
143
- readonly outputDirectory: string;
144
- readonly tableIdArgument: false;
145
- readonly storeArgument: false;
146
- readonly dataStruct: boolean;
147
- };
148
- readonly deploy: {
149
- readonly disabled: false;
150
- };
151
- };
152
- readonly PassConfig: {
153
- readonly label: "PassConfig";
154
- readonly namespaceLabel: "root";
155
- readonly type: "table";
156
- readonly namespace: string;
157
- readonly name: string;
158
- readonly tableId: `0x${string}`;
159
- readonly schema: {
160
- readonly passId: {
161
- readonly type: "bytes32";
162
- readonly internalType: "bytes32";
163
- };
164
- readonly claimAmount: {
165
- readonly type: "uint256";
166
- readonly internalType: "uint256";
167
- };
168
- readonly claimInterval: {
169
- readonly type: "uint256";
170
- readonly internalType: "uint256";
171
- };
172
- readonly validityPeriod: {
173
- readonly type: "uint256";
174
- readonly internalType: "uint256";
175
- };
176
- readonly grantor: {
177
- readonly type: "address";
178
- readonly internalType: "address";
179
- };
180
- };
181
- readonly key: readonly ["passId"];
182
- readonly codegen: {
183
- readonly outputDirectory: string;
184
- readonly tableIdArgument: false;
185
- readonly storeArgument: false;
186
- readonly dataStruct: boolean;
187
- };
188
- readonly deploy: {
189
- readonly disabled: false;
190
- };
191
- };
192
- readonly Spender: {
193
- readonly label: "Spender";
194
- readonly namespaceLabel: "root";
195
- readonly type: "table";
196
- readonly namespace: string;
197
- readonly name: string;
198
- readonly tableId: `0x${string}`;
199
- readonly schema: {
200
- readonly spender: {
201
- readonly type: "address";
202
- readonly internalType: "address";
203
- };
204
- readonly user: {
205
- readonly type: "address";
206
- readonly internalType: "address";
207
- };
208
- };
209
- readonly key: readonly ["spender"];
210
- readonly codegen: {
211
- readonly outputDirectory: string;
212
- readonly tableIdArgument: false;
213
- readonly storeArgument: false;
214
- readonly dataStruct: boolean;
215
- };
216
- readonly deploy: {
217
- readonly disabled: false;
218
- };
219
- };
220
- readonly SystemConfig: {
221
- readonly label: "SystemConfig";
222
- readonly namespaceLabel: "root";
223
- readonly type: "table";
224
- readonly namespace: string;
225
- readonly name: string;
226
- readonly tableId: `0x${string}`;
227
- readonly schema: {
228
- readonly entryPoint: {
229
- readonly type: "address";
230
- readonly internalType: "address";
231
- };
232
- };
233
- readonly key: readonly [];
234
- readonly codegen: {
235
- readonly outputDirectory: string;
236
- readonly tableIdArgument: false;
237
- readonly storeArgument: false;
238
- readonly dataStruct: boolean;
239
- };
240
- readonly deploy: {
241
- readonly disabled: false;
242
- };
243
- };
244
- };
245
- };
246
- };
247
- readonly tables: {
248
- readonly root__Allowance: {
249
- readonly label: "Allowance";
250
- readonly namespaceLabel: "root";
251
- readonly type: "table";
252
- readonly namespace: string;
253
- readonly name: string;
254
- readonly tableId: `0x${string}`;
255
- readonly schema: {
256
- readonly user: {
257
- readonly type: "address";
258
- readonly internalType: "address";
259
- };
260
- readonly allowance: {
261
- readonly type: "uint256";
262
- readonly internalType: "uint256";
263
- };
264
- };
265
- readonly key: readonly ["user"];
266
- readonly codegen: {
267
- readonly outputDirectory: string;
268
- readonly tableIdArgument: false;
269
- readonly storeArgument: false;
270
- readonly dataStruct: boolean;
271
- };
272
- readonly deploy: {
273
- readonly disabled: false;
274
- };
275
- };
276
- readonly root__Grantor: {
277
- readonly label: "Grantor";
278
- readonly namespaceLabel: "root";
279
- readonly type: "table";
280
- readonly namespace: string;
281
- readonly name: string;
282
- readonly tableId: `0x${string}`;
283
- readonly schema: {
284
- readonly grantor: {
285
- readonly type: "address";
286
- readonly internalType: "address";
287
- };
288
- readonly allowance: {
289
- readonly type: "uint256";
290
- readonly internalType: "uint256";
291
- };
292
- };
293
- readonly key: readonly ["grantor"];
294
- readonly codegen: {
295
- readonly outputDirectory: string;
296
- readonly tableIdArgument: false;
297
- readonly storeArgument: false;
298
- readonly dataStruct: boolean;
299
- };
300
- readonly deploy: {
301
- readonly disabled: false;
302
- };
303
- };
304
- readonly root__PassHolder: {
305
- readonly label: "PassHolder";
306
- readonly namespaceLabel: "root";
307
- readonly type: "table";
308
- readonly namespace: string;
309
- readonly name: string;
310
- readonly tableId: `0x${string}`;
311
- readonly schema: {
312
- readonly user: {
313
- readonly type: "address";
314
- readonly internalType: "address";
315
- };
316
- readonly passId: {
317
- readonly type: "bytes32";
318
- readonly internalType: "bytes32";
319
- };
320
- readonly lastRenewed: {
321
- readonly type: "uint256";
322
- readonly internalType: "uint256";
323
- };
324
- readonly lastClaimed: {
325
- readonly type: "uint256";
326
- readonly internalType: "uint256";
327
- };
328
- };
329
- readonly key: readonly ["user", "passId"];
330
- readonly codegen: {
331
- readonly outputDirectory: string;
332
- readonly tableIdArgument: false;
333
- readonly storeArgument: false;
334
- readonly dataStruct: boolean;
335
- };
336
- readonly deploy: {
337
- readonly disabled: false;
338
- };
339
- };
340
- readonly root__PassConfig: {
341
- readonly label: "PassConfig";
342
- readonly namespaceLabel: "root";
343
- readonly type: "table";
344
- readonly namespace: string;
345
- readonly name: string;
346
- readonly tableId: `0x${string}`;
347
- readonly schema: {
348
- readonly passId: {
349
- readonly type: "bytes32";
350
- readonly internalType: "bytes32";
351
- };
352
- readonly claimAmount: {
353
- readonly type: "uint256";
354
- readonly internalType: "uint256";
355
- };
356
- readonly claimInterval: {
357
- readonly type: "uint256";
358
- readonly internalType: "uint256";
359
- };
360
- readonly validityPeriod: {
361
- readonly type: "uint256";
362
- readonly internalType: "uint256";
363
- };
364
- readonly grantor: {
365
- readonly type: "address";
366
- readonly internalType: "address";
367
- };
368
- };
369
- readonly key: readonly ["passId"];
370
- readonly codegen: {
371
- readonly outputDirectory: string;
372
- readonly tableIdArgument: false;
373
- readonly storeArgument: false;
374
- readonly dataStruct: boolean;
375
- };
376
- readonly deploy: {
377
- readonly disabled: false;
378
- };
379
- };
380
- readonly root__Spender: {
381
- readonly label: "Spender";
382
- readonly namespaceLabel: "root";
383
- readonly type: "table";
384
- readonly namespace: string;
385
- readonly name: string;
386
- readonly tableId: `0x${string}`;
387
- readonly schema: {
388
- readonly spender: {
389
- readonly type: "address";
390
- readonly internalType: "address";
391
- };
392
- readonly user: {
393
- readonly type: "address";
394
- readonly internalType: "address";
395
- };
396
- };
397
- readonly key: readonly ["spender"];
398
- readonly codegen: {
399
- readonly outputDirectory: string;
400
- readonly tableIdArgument: false;
401
- readonly storeArgument: false;
402
- readonly dataStruct: boolean;
403
- };
404
- readonly deploy: {
405
- readonly disabled: false;
406
- };
407
- };
408
- readonly root__SystemConfig: {
409
- readonly label: "SystemConfig";
410
- readonly namespaceLabel: "root";
411
- readonly type: "table";
412
- readonly namespace: string;
413
- readonly name: string;
414
- readonly tableId: `0x${string}`;
415
- readonly schema: {
416
- readonly entryPoint: {
417
- readonly type: "address";
418
- readonly internalType: "address";
419
- };
420
- };
421
- readonly key: readonly [];
422
- readonly codegen: {
423
- readonly outputDirectory: string;
424
- readonly tableIdArgument: false;
425
- readonly storeArgument: false;
426
- readonly dataStruct: boolean;
427
- };
428
- readonly deploy: {
429
- readonly disabled: false;
430
- };
431
- };
432
- };
433
- readonly sourceDirectory: "src";
434
- readonly userTypes: {};
435
- readonly enums: {};
436
- readonly enumValues: {};
437
- readonly codegen: {
438
- readonly outputDirectory: "codegen";
439
- readonly storeImportPath: "@latticexyz/store/src";
440
- readonly userTypesFilename: "common.sol";
441
- readonly indexFilename: "index.sol";
442
- };
443
- };
444
- declare const paymasterTables: {
445
- readonly Allowance: {
446
- readonly label: "Allowance";
447
- readonly namespaceLabel: "root";
448
- readonly type: "table";
449
- readonly namespace: string;
450
- readonly name: string;
451
- readonly tableId: `0x${string}`;
452
- readonly schema: {
453
- readonly user: {
454
- readonly type: "address";
455
- readonly internalType: "address";
456
- };
457
- readonly allowance: {
458
- readonly type: "uint256";
459
- readonly internalType: "uint256";
460
- };
461
- };
462
- readonly key: readonly ["user"];
463
- readonly codegen: {
464
- readonly outputDirectory: string;
465
- readonly tableIdArgument: false;
466
- readonly storeArgument: false;
467
- readonly dataStruct: boolean;
468
- };
469
- readonly deploy: {
470
- readonly disabled: false;
471
- };
472
- };
473
- readonly Grantor: {
474
- readonly label: "Grantor";
475
- readonly namespaceLabel: "root";
476
- readonly type: "table";
477
- readonly namespace: string;
478
- readonly name: string;
479
- readonly tableId: `0x${string}`;
480
- readonly schema: {
481
- readonly grantor: {
482
- readonly type: "address";
483
- readonly internalType: "address";
484
- };
485
- readonly allowance: {
486
- readonly type: "uint256";
487
- readonly internalType: "uint256";
488
- };
489
- };
490
- readonly key: readonly ["grantor"];
491
- readonly codegen: {
492
- readonly outputDirectory: string;
493
- readonly tableIdArgument: false;
494
- readonly storeArgument: false;
495
- readonly dataStruct: boolean;
496
- };
497
- readonly deploy: {
498
- readonly disabled: false;
499
- };
500
- };
501
- readonly PassHolder: {
502
- readonly label: "PassHolder";
503
- readonly namespaceLabel: "root";
504
- readonly type: "table";
505
- readonly namespace: string;
506
- readonly name: string;
507
- readonly tableId: `0x${string}`;
508
- readonly schema: {
509
- readonly user: {
510
- readonly type: "address";
511
- readonly internalType: "address";
512
- };
513
- readonly passId: {
514
- readonly type: "bytes32";
515
- readonly internalType: "bytes32";
516
- };
517
- readonly lastRenewed: {
518
- readonly type: "uint256";
519
- readonly internalType: "uint256";
520
- };
521
- readonly lastClaimed: {
522
- readonly type: "uint256";
523
- readonly internalType: "uint256";
524
- };
525
- };
526
- readonly key: readonly ["user", "passId"];
527
- readonly codegen: {
528
- readonly outputDirectory: string;
529
- readonly tableIdArgument: false;
530
- readonly storeArgument: false;
531
- readonly dataStruct: boolean;
532
- };
533
- readonly deploy: {
534
- readonly disabled: false;
535
- };
536
- };
537
- readonly PassConfig: {
538
- readonly label: "PassConfig";
539
- readonly namespaceLabel: "root";
540
- readonly type: "table";
541
- readonly namespace: string;
542
- readonly name: string;
543
- readonly tableId: `0x${string}`;
544
- readonly schema: {
545
- readonly passId: {
546
- readonly type: "bytes32";
547
- readonly internalType: "bytes32";
548
- };
549
- readonly claimAmount: {
550
- readonly type: "uint256";
551
- readonly internalType: "uint256";
552
- };
553
- readonly claimInterval: {
554
- readonly type: "uint256";
555
- readonly internalType: "uint256";
556
- };
557
- readonly validityPeriod: {
558
- readonly type: "uint256";
559
- readonly internalType: "uint256";
560
- };
561
- readonly grantor: {
562
- readonly type: "address";
563
- readonly internalType: "address";
564
- };
565
- };
566
- readonly key: readonly ["passId"];
567
- readonly codegen: {
568
- readonly outputDirectory: string;
569
- readonly tableIdArgument: false;
570
- readonly storeArgument: false;
571
- readonly dataStruct: boolean;
572
- };
573
- readonly deploy: {
574
- readonly disabled: false;
575
- };
576
- };
577
- readonly Spender: {
578
- readonly label: "Spender";
579
- readonly namespaceLabel: "root";
580
- readonly type: "table";
581
- readonly namespace: string;
582
- readonly name: string;
583
- readonly tableId: `0x${string}`;
584
- readonly schema: {
585
- readonly spender: {
586
- readonly type: "address";
587
- readonly internalType: "address";
588
- };
589
- readonly user: {
590
- readonly type: "address";
591
- readonly internalType: "address";
592
- };
593
- };
594
- readonly key: readonly ["spender"];
595
- readonly codegen: {
596
- readonly outputDirectory: string;
597
- readonly tableIdArgument: false;
598
- readonly storeArgument: false;
599
- readonly dataStruct: boolean;
600
- };
601
- readonly deploy: {
602
- readonly disabled: false;
603
- };
604
- };
605
- readonly SystemConfig: {
606
- readonly label: "SystemConfig";
607
- readonly namespaceLabel: "root";
608
- readonly type: "table";
609
- readonly namespace: string;
610
- readonly name: string;
611
- readonly tableId: `0x${string}`;
612
- readonly schema: {
613
- readonly entryPoint: {
614
- readonly type: "address";
615
- readonly internalType: "address";
616
- };
617
- };
618
- readonly key: readonly [];
619
- readonly codegen: {
620
- readonly outputDirectory: string;
621
- readonly tableIdArgument: false;
622
- readonly storeArgument: false;
623
- readonly dataStruct: boolean;
624
- };
625
- readonly deploy: {
626
- readonly disabled: false;
627
- };
628
- };
629
- };
630
-
631
- type getRpcMethod<rpcSchema extends RpcSchema, method extends rpcSchema[number]["Method"]> = Extract<rpcSchema[number], {
632
- Method: method;
633
- }>;
634
- type getRpcSchema<rpcSchema extends RpcSchema, method extends rpcSchema[number]["Method"]> = UnionToTuple<getRpcMethod<rpcSchema, method>>;
635
- type getRpcReturnType<rpcSchema extends RpcSchema, method extends rpcSchema[number]["Method"]> = {
636
- [k in keyof rpcSchema & number as rpcSchema[k]["Method"]]: rpcSchema[k]["ReturnType"];
637
- }[method];
638
- type TransportRequestFnMapped<rpcSchema extends RpcSchema> = <args extends EIP1193Parameters<rpcSchema> = EIP1193Parameters<rpcSchema>>(args: args, options?: Parameters<EIP1193RequestFn>[1]) => Promise<getRpcReturnType<rpcSchema, args["method"]>>;
639
- type TransportRequestFn<rpcSchema extends RpcSchema> = <args extends EIP1193Parameters<rpcSchema> = EIP1193Parameters<rpcSchema>, method extends Extract<rpcSchema[number], {
640
- Method: args["method"];
641
- }> = Extract<rpcSchema[number], {
642
- Method: args["method"];
643
- }>>(args: args, options?: Parameters<EIP1193RequestFn>[1]) => Promise<method["ReturnType"]>;
644
-
645
- declare function gasEstimator<const transport extends Transport>(getTransport: transport): transport;
646
-
647
- type QuarryPassIssuerRpcSchema = [
648
- {
649
- Method: "quarry_issuePass";
650
- Parameters: [passId: Hex, receiver: Address];
651
- ReturnType: {
652
- message: string;
653
- };
654
- },
655
- {
656
- Method: "quarry_claimAllowance";
657
- Parameters: [passId: Hex, receiver: Address];
658
- ReturnType: {
659
- message: string;
660
- };
661
- }
662
- ];
663
- declare function quarryPassIssuer(): Transport<"http", {}, EIP1193RequestFn<QuarryPassIssuerRpcSchema>>;
664
-
665
- declare function userOpExecutor({ executor }: {
666
- executor: Client<Transport, Chain, Account>;
667
- }): Transport;
668
-
669
- export { GetAllowanceParams, QuarryPassIssuerRpcSchema, TransportRequestFn, TransportRequestFnMapped, claimGasPass, gasEstimator, getAllowance, getAllowanceSlot, getPaymasterAddress, getRpcMethod, getRpcReturnType, getRpcSchema, hasPassIssuer, paymasterAbi, paymasterConfig, paymasterTables, quarryPassIssuer, setAllowanceSlot, userOpExecutor };
package/dist/internal.js DELETED
@@ -1,2 +0,0 @@
1
- import{http as R}from"viem";function u(){return({chain:e})=>{if(!e)throw new Error("No chain provided to issuer transport.");let r="quarryPassIssuer"in e.rpcUrls?e.rpcUrls.quarryPassIssuer.http[0]:void 0;if(!r)throw new Error(`No \`quarryPassIssuer\` RPC URL found for chain ${e.id}.`);return R(r)({chain:e,retryCount:0})}}import w from"debug";var m=w("mud:paymaster");async function J({chain:e,userAddress:r}){let t=u()({chain:e});m("Issuing gas pass to",r),await t.request({method:"quarry_issuePass",params:["0x01",r]}),m("Claiming gas allowance for",r),await t.request({method:"quarry_claimAllowance",params:["0x01",r]})}import{numberToHex as U}from"viem";import{defineStore as A}from"@latticexyz/store";import{parseAbi as O}from"viem";var Z=O(["error SpenderSystem_AlreadyRegistered(address spender, address user)","error SpenderSystem_HasOwnBalance(address spender)","function registerSpender(address spender)"]),x=A({namespaces:{root:{namespace:"",tables:{Allowance:{schema:{user:"address",allowance:"uint256"},key:["user"]},Grantor:{schema:{grantor:"address",allowance:"uint256"},key:["grantor"]},PassHolder:{schema:{user:"address",passId:"bytes32",lastRenewed:"uint256",lastClaimed:"uint256"},key:["user","passId"]},PassConfig:{schema:{passId:"bytes32",claimAmount:"uint256",claimInterval:"uint256",validityPeriod:"uint256",grantor:"address"},key:["passId"]},Spender:{schema:{spender:"address",user:"address"},key:["spender"]},SystemConfig:{schema:{entryPoint:"address"},key:[]}}}}}),p=x.namespaces.root.tables;import{getRecord as C,getStaticDataLocation as d}from"@latticexyz/store/internal";import{getKeyTuple as l}from"@latticexyz/protocol-parser/internal";import{setStorageAt as q}from"viem/actions";async function pe({client:e,paymasterAddress:r,userAddress:t}){return(await C(e,{address:r,table:p.Allowance,key:{user:t},blockTag:"pending"})).allowance}function ce({userAddress:e}){return d(p.Allowance.tableId,l(p.Allowance,{user:e}))}async function me({client:e,paymasterAddress:r,userAddress:t,allowance:s}){let a=d(p.Allowance.tableId,l(p.Allowance,{user:t}));await q(e.extend(()=>({mode:"anvil"})),{address:r,index:a,value:U(s,{size:32})})}import{getChainContractAddress as I}from"viem";function fe(e){return I({chain:e,contract:"quarryPaymaster"})}function he(e){let t=e?.contracts?.quarryPaymaster?.address,s="quarryPassIssuer"in e.rpcUrls?e.rpcUrls.quarryPassIssuer.http[0]:void 0;return t!=null&&s}import{formatUserOperationRequest as T}from"viem/account-abstraction";async function c(e){return T({callGasLimit:20000000n,preVerificationGas:200000n,verificationGasLimit:2000000n,paymasterVerificationGasLimit:200000n,paymasterPostOpGasLimit:200000n})}function Ae(e){return r=>{let{request:t,...s}=e(r);return{request:async({method:n,params:o},i)=>n==="eth_estimateUserOperationGas"?c(o):t({method:n,params:o},i),...s}}}import{createTransport as F,numberToHex as L}from"viem";import{entryPoint07Address as g}from"viem/account-abstraction";import{parseEther as S,parseEventLogs as _}from"viem";import{formatUserOperation as b,toPackedUserOperation as G,getUserOperationHash as E,entryPoint07Address as f,entryPoint07Abi as y}from"viem/account-abstraction";import{setBalance as H,waitForTransactionReceipt as k,writeContract as v}from"viem/actions";import{getAction as h}from"viem/utils";async function P({executor:e,rpcUserOp:r}){e.chain.id===31337&&await H(e.extend(()=>({mode:"anvil"})),{address:e.account.address,value:S("100")});let t=b(r),s=G(t),a=E({userOperation:t,chainId:e.chain.id,entryPointVersion:"0.7",entryPointAddress:f}),n=await h(e,v,"writeContract")({abi:y,address:f,functionName:"handleOps",args:[[s],e.account.address],chain:e.chain,account:e.account}),o=await h(e,k,"waitForTransactionReceipt")({hash:n});return{success:_({logs:o.logs,abi:y,eventName:"UserOperationEvent"})[0].args.success,userOpHash:a,receipt:o}}function Ke({executor:e}){return()=>{let r=new Map;return F({key:"userOpExecutor",type:"userOpExecutor",name:"User Operation Executor Transport",request:async({method:s,params:a})=>{if(s==="eth_chainId")return L(e.chain.id);if(s==="eth_supportedEntryPoints")return[g];if(s==="eth_sendUserOperation"){let[n,o]=a;if(o===g){let i=await P({executor:e,rpcUserOp:n});return r.set(i.userOpHash,i),i.userOpHash}}if(s==="eth_getUserOperationReceipt"){let[n]=a;return r.get(n)??null}if(s==="eth_estimateUserOperationGas")return await c(a);throw new Error("Not implemented")}})}}export{J as claimGasPass,Ae as gasEstimator,pe as getAllowance,ce as getAllowanceSlot,fe as getPaymasterAddress,he as hasPassIssuer,Z as paymasterAbi,x as paymasterConfig,p as paymasterTables,u as quarryPassIssuer,me as setAllowanceSlot,Ke as userOpExecutor};
2
- //# sourceMappingURL=internal.js.map