@latticexyz/paymaster 2.2.15-entrykit-1694d69f0a35d77c65b0388284ad9c38c32168bd

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022-present Lattice Labs Ltd.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,663 @@
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
+
15
+ declare function getPaymasterAddress(chain: Chain): `0x${string}`;
16
+
17
+ declare function hasPassIssuer(chain: Chain): string | false | undefined;
18
+
19
+ declare const paymasterAbi: readonly [{
20
+ readonly name: "SpenderSystem_AlreadyRegistered";
21
+ readonly type: "error";
22
+ readonly inputs: readonly [{
23
+ readonly type: "address";
24
+ readonly name: "spender";
25
+ }, {
26
+ readonly type: "address";
27
+ readonly name: "user";
28
+ }];
29
+ }, {
30
+ readonly name: "SpenderSystem_HasOwnBalance";
31
+ readonly type: "error";
32
+ readonly inputs: readonly [{
33
+ readonly type: "address";
34
+ readonly name: "spender";
35
+ }];
36
+ }, {
37
+ readonly name: "registerSpender";
38
+ readonly type: "function";
39
+ readonly stateMutability: "nonpayable";
40
+ readonly inputs: readonly [{
41
+ readonly type: "address";
42
+ readonly name: "spender";
43
+ }];
44
+ readonly outputs: readonly [];
45
+ }];
46
+ declare const paymasterConfig: {
47
+ readonly multipleNamespaces: true;
48
+ readonly namespace: null;
49
+ readonly namespaces: {
50
+ readonly root: {
51
+ readonly label: "root";
52
+ readonly namespace: string;
53
+ readonly tables: {
54
+ readonly Allowance: {
55
+ readonly label: "Allowance";
56
+ readonly namespaceLabel: "root";
57
+ readonly type: "table";
58
+ readonly namespace: string;
59
+ readonly name: string;
60
+ readonly tableId: `0x${string}`;
61
+ readonly schema: {
62
+ readonly user: {
63
+ readonly type: "address";
64
+ readonly internalType: "address";
65
+ };
66
+ readonly allowance: {
67
+ readonly type: "uint256";
68
+ readonly internalType: "uint256";
69
+ };
70
+ };
71
+ readonly key: readonly ["user"];
72
+ readonly codegen: {
73
+ readonly outputDirectory: string;
74
+ readonly tableIdArgument: false;
75
+ readonly storeArgument: false;
76
+ readonly dataStruct: boolean;
77
+ };
78
+ readonly deploy: {
79
+ readonly disabled: false;
80
+ };
81
+ };
82
+ readonly Grantor: {
83
+ readonly label: "Grantor";
84
+ readonly namespaceLabel: "root";
85
+ readonly type: "table";
86
+ readonly namespace: string;
87
+ readonly name: string;
88
+ readonly tableId: `0x${string}`;
89
+ readonly schema: {
90
+ readonly grantor: {
91
+ readonly type: "address";
92
+ readonly internalType: "address";
93
+ };
94
+ readonly allowance: {
95
+ readonly type: "uint256";
96
+ readonly internalType: "uint256";
97
+ };
98
+ };
99
+ readonly key: readonly ["grantor"];
100
+ readonly codegen: {
101
+ readonly outputDirectory: string;
102
+ readonly tableIdArgument: false;
103
+ readonly storeArgument: false;
104
+ readonly dataStruct: boolean;
105
+ };
106
+ readonly deploy: {
107
+ readonly disabled: false;
108
+ };
109
+ };
110
+ readonly PassHolder: {
111
+ readonly label: "PassHolder";
112
+ readonly namespaceLabel: "root";
113
+ readonly type: "table";
114
+ readonly namespace: string;
115
+ readonly name: string;
116
+ readonly tableId: `0x${string}`;
117
+ readonly schema: {
118
+ readonly user: {
119
+ readonly type: "address";
120
+ readonly internalType: "address";
121
+ };
122
+ readonly passId: {
123
+ readonly type: "bytes32";
124
+ readonly internalType: "bytes32";
125
+ };
126
+ readonly lastRenewed: {
127
+ readonly type: "uint256";
128
+ readonly internalType: "uint256";
129
+ };
130
+ readonly lastClaimed: {
131
+ readonly type: "uint256";
132
+ readonly internalType: "uint256";
133
+ };
134
+ };
135
+ readonly key: readonly ["user", "passId"];
136
+ readonly codegen: {
137
+ readonly outputDirectory: string;
138
+ readonly tableIdArgument: false;
139
+ readonly storeArgument: false;
140
+ readonly dataStruct: boolean;
141
+ };
142
+ readonly deploy: {
143
+ readonly disabled: false;
144
+ };
145
+ };
146
+ readonly PassConfig: {
147
+ readonly label: "PassConfig";
148
+ readonly namespaceLabel: "root";
149
+ readonly type: "table";
150
+ readonly namespace: string;
151
+ readonly name: string;
152
+ readonly tableId: `0x${string}`;
153
+ readonly schema: {
154
+ readonly passId: {
155
+ readonly type: "bytes32";
156
+ readonly internalType: "bytes32";
157
+ };
158
+ readonly claimAmount: {
159
+ readonly type: "uint256";
160
+ readonly internalType: "uint256";
161
+ };
162
+ readonly claimInterval: {
163
+ readonly type: "uint256";
164
+ readonly internalType: "uint256";
165
+ };
166
+ readonly validityPeriod: {
167
+ readonly type: "uint256";
168
+ readonly internalType: "uint256";
169
+ };
170
+ readonly grantor: {
171
+ readonly type: "address";
172
+ readonly internalType: "address";
173
+ };
174
+ };
175
+ readonly key: readonly ["passId"];
176
+ readonly codegen: {
177
+ readonly outputDirectory: string;
178
+ readonly tableIdArgument: false;
179
+ readonly storeArgument: false;
180
+ readonly dataStruct: boolean;
181
+ };
182
+ readonly deploy: {
183
+ readonly disabled: false;
184
+ };
185
+ };
186
+ readonly Spender: {
187
+ readonly label: "Spender";
188
+ readonly namespaceLabel: "root";
189
+ readonly type: "table";
190
+ readonly namespace: string;
191
+ readonly name: string;
192
+ readonly tableId: `0x${string}`;
193
+ readonly schema: {
194
+ readonly spender: {
195
+ readonly type: "address";
196
+ readonly internalType: "address";
197
+ };
198
+ readonly user: {
199
+ readonly type: "address";
200
+ readonly internalType: "address";
201
+ };
202
+ };
203
+ readonly key: readonly ["spender"];
204
+ readonly codegen: {
205
+ readonly outputDirectory: string;
206
+ readonly tableIdArgument: false;
207
+ readonly storeArgument: false;
208
+ readonly dataStruct: boolean;
209
+ };
210
+ readonly deploy: {
211
+ readonly disabled: false;
212
+ };
213
+ };
214
+ readonly SystemConfig: {
215
+ readonly label: "SystemConfig";
216
+ readonly namespaceLabel: "root";
217
+ readonly type: "table";
218
+ readonly namespace: string;
219
+ readonly name: string;
220
+ readonly tableId: `0x${string}`;
221
+ readonly schema: {
222
+ readonly entryPoint: {
223
+ readonly type: "address";
224
+ readonly internalType: "address";
225
+ };
226
+ };
227
+ readonly key: readonly [];
228
+ readonly codegen: {
229
+ readonly outputDirectory: string;
230
+ readonly tableIdArgument: false;
231
+ readonly storeArgument: false;
232
+ readonly dataStruct: boolean;
233
+ };
234
+ readonly deploy: {
235
+ readonly disabled: false;
236
+ };
237
+ };
238
+ };
239
+ };
240
+ };
241
+ readonly tables: {
242
+ readonly root__Allowance: {
243
+ readonly label: "Allowance";
244
+ readonly namespaceLabel: "root";
245
+ readonly type: "table";
246
+ readonly namespace: string;
247
+ readonly name: string;
248
+ readonly tableId: `0x${string}`;
249
+ readonly schema: {
250
+ readonly user: {
251
+ readonly type: "address";
252
+ readonly internalType: "address";
253
+ };
254
+ readonly allowance: {
255
+ readonly type: "uint256";
256
+ readonly internalType: "uint256";
257
+ };
258
+ };
259
+ readonly key: readonly ["user"];
260
+ readonly codegen: {
261
+ readonly outputDirectory: string;
262
+ readonly tableIdArgument: false;
263
+ readonly storeArgument: false;
264
+ readonly dataStruct: boolean;
265
+ };
266
+ readonly deploy: {
267
+ readonly disabled: false;
268
+ };
269
+ };
270
+ readonly root__Grantor: {
271
+ readonly label: "Grantor";
272
+ readonly namespaceLabel: "root";
273
+ readonly type: "table";
274
+ readonly namespace: string;
275
+ readonly name: string;
276
+ readonly tableId: `0x${string}`;
277
+ readonly schema: {
278
+ readonly grantor: {
279
+ readonly type: "address";
280
+ readonly internalType: "address";
281
+ };
282
+ readonly allowance: {
283
+ readonly type: "uint256";
284
+ readonly internalType: "uint256";
285
+ };
286
+ };
287
+ readonly key: readonly ["grantor"];
288
+ readonly codegen: {
289
+ readonly outputDirectory: string;
290
+ readonly tableIdArgument: false;
291
+ readonly storeArgument: false;
292
+ readonly dataStruct: boolean;
293
+ };
294
+ readonly deploy: {
295
+ readonly disabled: false;
296
+ };
297
+ };
298
+ readonly root__PassHolder: {
299
+ readonly label: "PassHolder";
300
+ readonly namespaceLabel: "root";
301
+ readonly type: "table";
302
+ readonly namespace: string;
303
+ readonly name: string;
304
+ readonly tableId: `0x${string}`;
305
+ readonly schema: {
306
+ readonly user: {
307
+ readonly type: "address";
308
+ readonly internalType: "address";
309
+ };
310
+ readonly passId: {
311
+ readonly type: "bytes32";
312
+ readonly internalType: "bytes32";
313
+ };
314
+ readonly lastRenewed: {
315
+ readonly type: "uint256";
316
+ readonly internalType: "uint256";
317
+ };
318
+ readonly lastClaimed: {
319
+ readonly type: "uint256";
320
+ readonly internalType: "uint256";
321
+ };
322
+ };
323
+ readonly key: readonly ["user", "passId"];
324
+ readonly codegen: {
325
+ readonly outputDirectory: string;
326
+ readonly tableIdArgument: false;
327
+ readonly storeArgument: false;
328
+ readonly dataStruct: boolean;
329
+ };
330
+ readonly deploy: {
331
+ readonly disabled: false;
332
+ };
333
+ };
334
+ readonly root__PassConfig: {
335
+ readonly label: "PassConfig";
336
+ readonly namespaceLabel: "root";
337
+ readonly type: "table";
338
+ readonly namespace: string;
339
+ readonly name: string;
340
+ readonly tableId: `0x${string}`;
341
+ readonly schema: {
342
+ readonly passId: {
343
+ readonly type: "bytes32";
344
+ readonly internalType: "bytes32";
345
+ };
346
+ readonly claimAmount: {
347
+ readonly type: "uint256";
348
+ readonly internalType: "uint256";
349
+ };
350
+ readonly claimInterval: {
351
+ readonly type: "uint256";
352
+ readonly internalType: "uint256";
353
+ };
354
+ readonly validityPeriod: {
355
+ readonly type: "uint256";
356
+ readonly internalType: "uint256";
357
+ };
358
+ readonly grantor: {
359
+ readonly type: "address";
360
+ readonly internalType: "address";
361
+ };
362
+ };
363
+ readonly key: readonly ["passId"];
364
+ readonly codegen: {
365
+ readonly outputDirectory: string;
366
+ readonly tableIdArgument: false;
367
+ readonly storeArgument: false;
368
+ readonly dataStruct: boolean;
369
+ };
370
+ readonly deploy: {
371
+ readonly disabled: false;
372
+ };
373
+ };
374
+ readonly root__Spender: {
375
+ readonly label: "Spender";
376
+ readonly namespaceLabel: "root";
377
+ readonly type: "table";
378
+ readonly namespace: string;
379
+ readonly name: string;
380
+ readonly tableId: `0x${string}`;
381
+ readonly schema: {
382
+ readonly spender: {
383
+ readonly type: "address";
384
+ readonly internalType: "address";
385
+ };
386
+ readonly user: {
387
+ readonly type: "address";
388
+ readonly internalType: "address";
389
+ };
390
+ };
391
+ readonly key: readonly ["spender"];
392
+ readonly codegen: {
393
+ readonly outputDirectory: string;
394
+ readonly tableIdArgument: false;
395
+ readonly storeArgument: false;
396
+ readonly dataStruct: boolean;
397
+ };
398
+ readonly deploy: {
399
+ readonly disabled: false;
400
+ };
401
+ };
402
+ readonly root__SystemConfig: {
403
+ readonly label: "SystemConfig";
404
+ readonly namespaceLabel: "root";
405
+ readonly type: "table";
406
+ readonly namespace: string;
407
+ readonly name: string;
408
+ readonly tableId: `0x${string}`;
409
+ readonly schema: {
410
+ readonly entryPoint: {
411
+ readonly type: "address";
412
+ readonly internalType: "address";
413
+ };
414
+ };
415
+ readonly key: readonly [];
416
+ readonly codegen: {
417
+ readonly outputDirectory: string;
418
+ readonly tableIdArgument: false;
419
+ readonly storeArgument: false;
420
+ readonly dataStruct: boolean;
421
+ };
422
+ readonly deploy: {
423
+ readonly disabled: false;
424
+ };
425
+ };
426
+ };
427
+ readonly sourceDirectory: "src";
428
+ readonly userTypes: {};
429
+ readonly enums: {};
430
+ readonly enumValues: {};
431
+ readonly codegen: {
432
+ readonly outputDirectory: "codegen";
433
+ readonly storeImportPath: "@latticexyz/store/src";
434
+ readonly userTypesFilename: "common.sol";
435
+ readonly indexFilename: "index.sol";
436
+ };
437
+ };
438
+ declare const paymasterTables: {
439
+ readonly Allowance: {
440
+ readonly label: "Allowance";
441
+ readonly namespaceLabel: "root";
442
+ readonly type: "table";
443
+ readonly namespace: string;
444
+ readonly name: string;
445
+ readonly tableId: `0x${string}`;
446
+ readonly schema: {
447
+ readonly user: {
448
+ readonly type: "address";
449
+ readonly internalType: "address";
450
+ };
451
+ readonly allowance: {
452
+ readonly type: "uint256";
453
+ readonly internalType: "uint256";
454
+ };
455
+ };
456
+ readonly key: readonly ["user"];
457
+ readonly codegen: {
458
+ readonly outputDirectory: string;
459
+ readonly tableIdArgument: false;
460
+ readonly storeArgument: false;
461
+ readonly dataStruct: boolean;
462
+ };
463
+ readonly deploy: {
464
+ readonly disabled: false;
465
+ };
466
+ };
467
+ readonly Grantor: {
468
+ readonly label: "Grantor";
469
+ readonly namespaceLabel: "root";
470
+ readonly type: "table";
471
+ readonly namespace: string;
472
+ readonly name: string;
473
+ readonly tableId: `0x${string}`;
474
+ readonly schema: {
475
+ readonly grantor: {
476
+ readonly type: "address";
477
+ readonly internalType: "address";
478
+ };
479
+ readonly allowance: {
480
+ readonly type: "uint256";
481
+ readonly internalType: "uint256";
482
+ };
483
+ };
484
+ readonly key: readonly ["grantor"];
485
+ readonly codegen: {
486
+ readonly outputDirectory: string;
487
+ readonly tableIdArgument: false;
488
+ readonly storeArgument: false;
489
+ readonly dataStruct: boolean;
490
+ };
491
+ readonly deploy: {
492
+ readonly disabled: false;
493
+ };
494
+ };
495
+ readonly PassHolder: {
496
+ readonly label: "PassHolder";
497
+ readonly namespaceLabel: "root";
498
+ readonly type: "table";
499
+ readonly namespace: string;
500
+ readonly name: string;
501
+ readonly tableId: `0x${string}`;
502
+ readonly schema: {
503
+ readonly user: {
504
+ readonly type: "address";
505
+ readonly internalType: "address";
506
+ };
507
+ readonly passId: {
508
+ readonly type: "bytes32";
509
+ readonly internalType: "bytes32";
510
+ };
511
+ readonly lastRenewed: {
512
+ readonly type: "uint256";
513
+ readonly internalType: "uint256";
514
+ };
515
+ readonly lastClaimed: {
516
+ readonly type: "uint256";
517
+ readonly internalType: "uint256";
518
+ };
519
+ };
520
+ readonly key: readonly ["user", "passId"];
521
+ readonly codegen: {
522
+ readonly outputDirectory: string;
523
+ readonly tableIdArgument: false;
524
+ readonly storeArgument: false;
525
+ readonly dataStruct: boolean;
526
+ };
527
+ readonly deploy: {
528
+ readonly disabled: false;
529
+ };
530
+ };
531
+ readonly PassConfig: {
532
+ readonly label: "PassConfig";
533
+ readonly namespaceLabel: "root";
534
+ readonly type: "table";
535
+ readonly namespace: string;
536
+ readonly name: string;
537
+ readonly tableId: `0x${string}`;
538
+ readonly schema: {
539
+ readonly passId: {
540
+ readonly type: "bytes32";
541
+ readonly internalType: "bytes32";
542
+ };
543
+ readonly claimAmount: {
544
+ readonly type: "uint256";
545
+ readonly internalType: "uint256";
546
+ };
547
+ readonly claimInterval: {
548
+ readonly type: "uint256";
549
+ readonly internalType: "uint256";
550
+ };
551
+ readonly validityPeriod: {
552
+ readonly type: "uint256";
553
+ readonly internalType: "uint256";
554
+ };
555
+ readonly grantor: {
556
+ readonly type: "address";
557
+ readonly internalType: "address";
558
+ };
559
+ };
560
+ readonly key: readonly ["passId"];
561
+ readonly codegen: {
562
+ readonly outputDirectory: string;
563
+ readonly tableIdArgument: false;
564
+ readonly storeArgument: false;
565
+ readonly dataStruct: boolean;
566
+ };
567
+ readonly deploy: {
568
+ readonly disabled: false;
569
+ };
570
+ };
571
+ readonly Spender: {
572
+ readonly label: "Spender";
573
+ readonly namespaceLabel: "root";
574
+ readonly type: "table";
575
+ readonly namespace: string;
576
+ readonly name: string;
577
+ readonly tableId: `0x${string}`;
578
+ readonly schema: {
579
+ readonly spender: {
580
+ readonly type: "address";
581
+ readonly internalType: "address";
582
+ };
583
+ readonly user: {
584
+ readonly type: "address";
585
+ readonly internalType: "address";
586
+ };
587
+ };
588
+ readonly key: readonly ["spender"];
589
+ readonly codegen: {
590
+ readonly outputDirectory: string;
591
+ readonly tableIdArgument: false;
592
+ readonly storeArgument: false;
593
+ readonly dataStruct: boolean;
594
+ };
595
+ readonly deploy: {
596
+ readonly disabled: false;
597
+ };
598
+ };
599
+ readonly SystemConfig: {
600
+ readonly label: "SystemConfig";
601
+ readonly namespaceLabel: "root";
602
+ readonly type: "table";
603
+ readonly namespace: string;
604
+ readonly name: string;
605
+ readonly tableId: `0x${string}`;
606
+ readonly schema: {
607
+ readonly entryPoint: {
608
+ readonly type: "address";
609
+ readonly internalType: "address";
610
+ };
611
+ };
612
+ readonly key: readonly [];
613
+ readonly codegen: {
614
+ readonly outputDirectory: string;
615
+ readonly tableIdArgument: false;
616
+ readonly storeArgument: false;
617
+ readonly dataStruct: boolean;
618
+ };
619
+ readonly deploy: {
620
+ readonly disabled: false;
621
+ };
622
+ };
623
+ };
624
+
625
+ type getRpcMethod<rpcSchema extends RpcSchema, method extends rpcSchema[number]["Method"]> = Extract<rpcSchema[number], {
626
+ Method: method;
627
+ }>;
628
+ type getRpcSchema<rpcSchema extends RpcSchema, method extends rpcSchema[number]["Method"]> = UnionToTuple<getRpcMethod<rpcSchema, method>>;
629
+ type getRpcReturnType<rpcSchema extends RpcSchema, method extends rpcSchema[number]["Method"]> = {
630
+ [k in keyof rpcSchema & number as rpcSchema[k]["Method"]]: rpcSchema[k]["ReturnType"];
631
+ }[method];
632
+ type TransportRequestFnMapped<rpcSchema extends RpcSchema> = <args extends EIP1193Parameters<rpcSchema> = EIP1193Parameters<rpcSchema>>(args: args, options?: Parameters<EIP1193RequestFn>[1]) => Promise<getRpcReturnType<rpcSchema, args["method"]>>;
633
+ type TransportRequestFn<rpcSchema extends RpcSchema> = <args extends EIP1193Parameters<rpcSchema> = EIP1193Parameters<rpcSchema>, method extends Extract<rpcSchema[number], {
634
+ Method: args["method"];
635
+ }> = Extract<rpcSchema[number], {
636
+ Method: args["method"];
637
+ }>>(args: args, options?: Parameters<EIP1193RequestFn>[1]) => Promise<method["ReturnType"]>;
638
+
639
+ declare function gasEstimator<const transport extends Transport>(getTransport: transport): transport;
640
+
641
+ type QuarryPassIssuerRpcSchema = [
642
+ {
643
+ Method: "quarry_issuePass";
644
+ Parameters: [passId: Hex, receiver: Address];
645
+ ReturnType: {
646
+ message: string;
647
+ };
648
+ },
649
+ {
650
+ Method: "quarry_claimAllowance";
651
+ Parameters: [passId: Hex, receiver: Address];
652
+ ReturnType: {
653
+ message: string;
654
+ };
655
+ }
656
+ ];
657
+ declare function quarryPassIssuer(): Transport<"http", {}, EIP1193RequestFn<QuarryPassIssuerRpcSchema>>;
658
+
659
+ declare function userOpExecutor({ executor }: {
660
+ executor: Client<Transport, Chain, Account>;
661
+ }): Transport;
662
+
663
+ export { GetAllowanceParams, QuarryPassIssuerRpcSchema, TransportRequestFn, TransportRequestFnMapped, claimGasPass, gasEstimator, getAllowance, getPaymasterAddress, getRpcMethod, getRpcReturnType, getRpcSchema, hasPassIssuer, paymasterAbi, paymasterConfig, paymasterTables, quarryPassIssuer, userOpExecutor };
@@ -0,0 +1,2 @@
1
+ import{http as y}from"viem";function m(){return({chain:r})=>{if(!r)throw new Error("No chain provided to issuer transport.");let e="quarryPassIssuer"in r.rpcUrls?r.rpcUrls.quarryPassIssuer.http[0]:void 0;if(!e)throw new Error(`No \`quarryPassIssuer\` RPC URL found for chain ${r.id}.`);return y(e)({chain:r,retryCount:0})}}import h from"debug";var c=h("mud:paymaster");async function Q({chain:r,userAddress:e}){let t=m()({chain:r});c("Issuing gas pass to",e),await t.request({method:"quarry_issuePass",params:["0x01",e]}),c("Claiming gas allowance for",e),await t.request({method:"quarry_claimAllowance",params:["0x01",e]})}import{defineStore as P}from"@latticexyz/store";import{parseAbi as R}from"viem";var z=R(["error SpenderSystem_AlreadyRegistered(address spender, address user)","error SpenderSystem_HasOwnBalance(address spender)","function registerSpender(address spender)"]),O=P({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:[]}}}}}),u=O.namespaces.root.tables;import{getRecord as g}from"@latticexyz/store/internal";async function X({client:r,paymasterAddress:e,userAddress:t}){return(await g(r,{address:e,table:u.Allowance,key:{user:t},blockTag:"pending"})).allowance}import{getChainContractAddress as C}from"viem";function er(r){return C({chain:r,contract:"quarryPaymaster"})}function sr(r){let t=r?.contracts?.quarryPaymaster?.address,s="quarryPassIssuer"in r.rpcUrls?r.rpcUrls.quarryPassIssuer.http[0]:void 0;return t!=null&&s}import{formatUserOperationRequest as U}from"viem/account-abstraction";async function p(r){return U({callGasLimit:20000000n,preVerificationGas:200000n,verificationGasLimit:2000000n,paymasterVerificationGasLimit:200000n,paymasterPostOpGasLimit:200000n})}function pr(r){return e=>{let{request:t,...s}=r(e);return{request:async({method:a,params:o},i)=>a==="eth_estimateUserOperationGas"?p(o):t({method:a,params:o},i),...s}}}import{createTransport as S,numberToHex as b}from"viem";import{entryPoint07Address as l}from"viem/account-abstraction";import{parseEther as q}from"viem";import{formatUserOperation as A,toPackedUserOperation as x,getUserOperationHash as w,entryPoint07Address as d,entryPoint07Abi as I}from"viem/account-abstraction";import{setBalance as T,writeContract as _}from"viem/actions";import{getAction as G}from"viem/utils";async function f({executor:r,rpcUserOp:e}){r.chain.id===31337&&await T(r.extend(()=>({mode:"anvil"})),{address:r.account.address,value:q("100")});let t=A(e),s=t.preVerificationGas+t.verificationGasLimit+(t.paymasterVerificationGasLimit??0n)+(t.paymasterPostOpGasLimit??0n)+t.callGasLimit,n=x(t),a=w({userOperation:t,chainId:r.chain.id,entryPointVersion:"0.7",entryPointAddress:d}),o=await G(r,_,"writeContract")({abi:I,address:d,functionName:"handleOps",args:[[n],r.account.address],chain:r.chain,account:r.account,gas:s});return{success:!0,userOpHash:a,receipt:{transactionHash:o}}}function Hr({executor:r}){return()=>{let e=new Map;return S({key:"userOpExecutor",type:"userOpExecutor",name:"User Operation Executor Transport",request:async({method:s,params:n})=>{if(s==="eth_chainId")return b(r.chain.id);if(s==="eth_supportedEntryPoints")return[l];if(s==="eth_sendUserOperation"){let[a,o]=n;if(o===l){let i=await f({executor:r,rpcUserOp:a});return e.set(i.userOpHash,i),i.userOpHash}}if(s==="eth_getUserOperationReceipt"){let[a]=n;return e.get(a)??null}if(s==="eth_estimateUserOperationGas")return await p(n);throw new Error("Not implemented")}})}}export{Q as claimGasPass,pr as gasEstimator,X as getAllowance,er as getPaymasterAddress,sr as hasPassIssuer,z as paymasterAbi,O as paymasterConfig,u as paymasterTables,m as quarryPassIssuer,Hr as userOpExecutor};
2
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/transports/quarryPassIssuer.ts","../src/debug.ts","../src/claimGasPass.ts","../src/paymaster.ts","../src/getAllowance.ts","../src/getPaymasterAddress.ts","../src/hasPassIssuer.ts","../src/transports/methods/estimateUserOperationGas.ts","../src/transports/gasEstimator.ts","../src/transports/userOpExecutor.ts","../src/transports/methods/sendUserOperation.ts"],"sourcesContent":["import { Address, EIP1193RequestFn, Hex, Transport, http } from \"viem\";\n\nexport type QuarryPassIssuerRpcSchema = [\n {\n Method: \"quarry_issuePass\";\n Parameters: [passId: Hex, receiver: Address];\n ReturnType: { message: string };\n },\n {\n Method: \"quarry_claimAllowance\";\n Parameters: [passId: Hex, receiver: Address];\n ReturnType: { message: string };\n },\n];\n\nexport function quarryPassIssuer(): Transport<\"http\", {}, EIP1193RequestFn<QuarryPassIssuerRpcSchema>> {\n return ({ chain }) => {\n if (!chain) throw new Error(\"No chain provided to issuer transport.\");\n\n const url = \"quarryPassIssuer\" in chain.rpcUrls ? chain.rpcUrls.quarryPassIssuer.http[0] : undefined;\n // TODO: add fallback for anvil to do what quarryPassIssuer does internally\n if (!url) throw new Error(`No \\`quarryPassIssuer\\` RPC URL found for chain ${chain.id}.`);\n\n return http(url)({ chain, retryCount: 0 });\n };\n}\n","import createDebug from \"debug\";\n\nexport const debug = createDebug(\"mud:paymaster\");\n","import { Address, Chain } from \"viem\";\nimport { quarryPassIssuer } from \"./transports/quarryPassIssuer\";\nimport { debug } from \"./debug\";\n\nexport async function claimGasPass({ chain, userAddress }: { chain: Chain; userAddress: Address }) {\n const transport = quarryPassIssuer()({ chain });\n\n // TODO: handle case where you already have a pass?\n debug(\"Issuing gas pass to\", userAddress);\n await transport.request({\n method: \"quarry_issuePass\",\n params: [\"0x01\", userAddress],\n });\n\n debug(\"Claiming gas allowance for\", userAddress);\n await transport.request({\n method: \"quarry_claimAllowance\",\n params: [\"0x01\", userAddress],\n });\n}\n","import { defineStore } from \"@latticexyz/store\";\nimport { parseAbi } from \"viem\";\n\n// TODO: move the whole paymaster in here so we can just re-export ABI + MUD config\n\nexport const paymasterAbi = parseAbi([\n \"error SpenderSystem_AlreadyRegistered(address spender, address user)\",\n \"error SpenderSystem_HasOwnBalance(address spender)\",\n \"function registerSpender(address spender)\",\n]);\n\nexport const paymasterConfig = defineStore({\n namespaces: {\n root: {\n namespace: \"\",\n tables: {\n Allowance: {\n schema: {\n user: \"address\",\n allowance: \"uint256\",\n },\n key: [\"user\"],\n },\n Grantor: {\n schema: {\n grantor: \"address\",\n allowance: \"uint256\",\n },\n key: [\"grantor\"],\n },\n PassHolder: {\n schema: {\n user: \"address\",\n passId: \"bytes32\",\n lastRenewed: \"uint256\",\n lastClaimed: \"uint256\",\n },\n key: [\"user\", \"passId\"],\n },\n PassConfig: {\n schema: {\n passId: \"bytes32\",\n claimAmount: \"uint256\",\n claimInterval: \"uint256\",\n validityPeriod: \"uint256\",\n grantor: \"address\",\n },\n key: [\"passId\"],\n },\n Spender: {\n schema: {\n spender: \"address\",\n user: \"address\",\n },\n key: [\"spender\"],\n },\n SystemConfig: {\n schema: {\n entryPoint: \"address\",\n },\n key: [],\n },\n },\n },\n },\n});\n\nexport const paymasterTables = paymasterConfig.namespaces.root.tables;\n","import { Address, Client } from \"viem\";\nimport { paymasterTables } from \"./paymaster\";\nimport { getRecord } from \"@latticexyz/store/internal\";\n\nexport type GetAllowanceParams = {\n client: Client;\n paymasterAddress: Address;\n userAddress: Address;\n};\n\nexport async function getAllowance({ client, paymasterAddress, userAddress }: GetAllowanceParams) {\n const record = await getRecord(client, {\n address: paymasterAddress,\n table: paymasterTables.Allowance,\n key: { user: userAddress },\n blockTag: \"pending\",\n });\n return record.allowance;\n}\n","import { Chain, getChainContractAddress } from \"viem\";\n\nexport function getPaymasterAddress(chain: Chain) {\n return getChainContractAddress({ chain, contract: \"quarryPaymaster\" });\n}\n","import { Chain, ChainContract } from \"viem\";\n\nexport function hasPassIssuer(chain: Chain) {\n const paymasterContract = chain?.contracts?.quarryPaymaster as ChainContract | undefined;\n const paymasterAddress = paymasterContract?.address;\n\n const passIssuerUrl = \"quarryPassIssuer\" in chain.rpcUrls ? chain.rpcUrls.quarryPassIssuer.http[0] : undefined;\n\n return paymasterAddress != null && passIssuerUrl;\n}\n","import { BundlerRpcSchema } from \"viem\";\nimport { formatUserOperationRequest } from \"viem/account-abstraction\";\nimport { getRpcMethod } from \"../common\";\n\n// TODO: revisit after demo (don't hardcode gas)\n\ntype rpcMethod = getRpcMethod<BundlerRpcSchema, \"eth_estimateUserOperationGas\">;\n\nexport async function estimateUserOperationGas(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _params: rpcMethod[\"Parameters\"],\n): Promise<rpcMethod[\"ReturnType\"]> {\n return formatUserOperationRequest({\n callGasLimit: 20_000_000n,\n preVerificationGas: 200_000n,\n verificationGasLimit: 2_000_000n,\n paymasterVerificationGasLimit: 200_000n,\n paymasterPostOpGasLimit: 200_000n,\n });\n}\n","import { BundlerRpcSchema, Transport } from \"viem\";\nimport { estimateUserOperationGas } from \"./methods/estimateUserOperationGas\";\nimport { TransportRequestFn, getRpcSchema } from \"./common\";\n\n// TODO: move to common package?\n\nexport function gasEstimator<const transport extends Transport>(getTransport: transport): transport {\n return ((opts) => {\n const { request: originalRequest, ...rest } = getTransport(opts);\n\n const request: TransportRequestFn<getRpcSchema<BundlerRpcSchema, \"eth_estimateUserOperationGas\">> = async (\n { method, params },\n options,\n ) => {\n if (method === \"eth_estimateUserOperationGas\") {\n return estimateUserOperationGas(params);\n }\n return originalRequest({ method, params }, options);\n };\n\n return { request, ...rest };\n }) as transport;\n}\n","import {\n Account,\n BundlerRpcSchema,\n Chain,\n Client,\n EIP1193RequestFn,\n Hash,\n RpcUserOperationReceipt,\n Transport,\n createTransport,\n numberToHex,\n} from \"viem\";\nimport { entryPoint07Address } from \"viem/account-abstraction\";\nimport { TransportRequestFn } from \"./common\";\nimport { estimateUserOperationGas } from \"./methods/estimateUserOperationGas\";\nimport { sendUserOperation } from \"./methods/sendUserOperation\";\n\n// TODO: move to common package?\n\nexport function userOpExecutor({ executor }: { executor: Client<Transport, Chain, Account> }): Transport {\n return () => {\n const receipts = new Map<Hash, RpcUserOperationReceipt<\"0.7\">>();\n\n // @ts-expect-error TODO\n const request: TransportRequestFn<BundlerRpcSchema> = async ({ method, params }) => {\n // TODO: move chain/ID into args and executors as accounts instead of clients?\n if (method === \"eth_chainId\") {\n return numberToHex(executor.chain.id);\n }\n\n if (method === \"eth_supportedEntryPoints\") {\n return [entryPoint07Address];\n }\n\n if (method === \"eth_sendUserOperation\") {\n const [rpcUserOp, entrypoint] = params;\n if (entrypoint === entryPoint07Address) {\n const result = await sendUserOperation({ executor, rpcUserOp });\n receipts.set(result.userOpHash, result as RpcUserOperationReceipt<\"0.7\">);\n return result.userOpHash;\n }\n }\n\n if (method === \"eth_getUserOperationReceipt\") {\n const [hash] = params;\n return receipts.get(hash) ?? null;\n }\n\n if (method === \"eth_estimateUserOperationGas\") {\n return await estimateUserOperationGas(params);\n }\n\n throw new Error(\"Not implemented\");\n };\n\n return createTransport({\n key: \"userOpExecutor\",\n type: \"userOpExecutor\",\n name: \"User Operation Executor Transport\",\n request: request as EIP1193RequestFn,\n });\n };\n}\n","import { Client, Transport, Chain, Account, RpcUserOperation, RpcUserOperationReceipt, parseEther } from \"viem\";\nimport {\n formatUserOperation,\n toPackedUserOperation,\n getUserOperationHash,\n entryPoint07Address,\n entryPoint07Abi,\n} from \"viem/account-abstraction\";\nimport { setBalance, writeContract } from \"viem/actions\";\nimport { getAction } from \"viem/utils\";\n\n// TODO: move to common package?\n\n// TODO: move this into a generic to support other versions?\nconst entryPointVersion = \"0.7\";\ntype entryPointVersion = typeof entryPointVersion;\n\nexport async function sendUserOperation({\n executor,\n rpcUserOp,\n}: {\n executor: Client<Transport, Chain, Account>;\n rpcUserOp: RpcUserOperation<entryPointVersion>;\n}): Promise<\n Pick<RpcUserOperationReceipt<entryPointVersion>, \"success\" | \"userOpHash\"> & {\n receipt: Pick<RpcUserOperationReceipt<entryPointVersion>[\"receipt\"], \"transactionHash\">;\n }\n> {\n if (executor.chain.id === 31337) {\n await setBalance(\n executor.extend(() => ({ mode: \"anvil\" })),\n {\n address: executor.account.address,\n value: parseEther(\"100\"),\n },\n );\n }\n\n const userOp = formatUserOperation(rpcUserOp);\n const gas =\n userOp.preVerificationGas +\n userOp.verificationGasLimit +\n (userOp.paymasterVerificationGasLimit ?? 0n) +\n (userOp.paymasterPostOpGasLimit ?? 0n) +\n userOp.callGasLimit;\n\n const packedUserOp = toPackedUserOperation(userOp);\n\n const userOpHash = getUserOperationHash({\n userOperation: userOp,\n chainId: executor.chain.id,\n entryPointVersion: \"0.7\",\n entryPointAddress: entryPoint07Address,\n });\n\n const transactionHash = await getAction(\n executor,\n writeContract,\n \"writeContract\",\n )({\n abi: entryPoint07Abi,\n address: entryPoint07Address,\n functionName: \"handleOps\",\n args: [[packedUserOp], executor.account.address],\n chain: executor.chain,\n account: executor.account,\n gas,\n });\n\n return {\n success: true,\n userOpHash,\n receipt: { transactionHash },\n };\n}\n"],"mappings":"AAAA,OAAoD,QAAAA,MAAY,OAezD,SAASC,GAAuF,CACrG,MAAO,CAAC,CAAE,MAAAC,CAAM,IAAM,CACpB,GAAI,CAACA,EAAO,MAAM,IAAI,MAAM,wCAAwC,EAEpE,IAAMC,EAAM,qBAAsBD,EAAM,QAAUA,EAAM,QAAQ,iBAAiB,KAAK,CAAC,EAAI,OAE3F,GAAI,CAACC,EAAK,MAAM,IAAI,MAAM,mDAAmDD,EAAM,KAAK,EAExF,OAAOF,EAAKG,CAAG,EAAE,CAAE,MAAAD,EAAO,WAAY,CAAE,CAAC,CAC3C,CACF,CCzBA,OAAOE,MAAiB,QAEjB,IAAMC,EAAQD,EAAY,eAAe,ECEhD,eAAsBE,EAAa,CAAE,MAAAC,EAAO,YAAAC,CAAY,EAA2C,CACjG,IAAMC,EAAYC,EAAiB,EAAE,CAAE,MAAAH,CAAM,CAAC,EAG9CI,EAAM,sBAAuBH,CAA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MAAM,iBAAiB,CACnC,CAOA,CAAC,CACH,CACF","names":["http","quarryPassIssuer","chain","url","createDebug","debug","claimGasPass","chain","userAddress","transport","quarryPassIssuer","debug","defineStore","parseAbi","paymasterAbi","paymasterConfig","paymasterTables","getRecord","getAllowance","client","paymasterAddress","userAddress","paymasterTables","getChainContractAddress","getPaymasterAddress","chain","hasPassIssuer","chain","paymasterAddress","passIssuerUrl","formatUserOperationRequest","estimateUserOperationGas","_params","gasEstimator","getTransport","opts","originalRequest","rest","method","params","options","estimateUserOperationGas","createTransport","numberToHex","entryPoint07Address","parseEther","formatUserOperation","toPackedUserOperation","getUserOperationHash","entryPoint07Address","entryPoint07Abi","setBalance","writeContract","getAction","sendUserOperation","executor","rpcUserOp","setBalance","parseEther","userOp","formatUserOperation","gas","packedUserOp","toPackedUserOperation","userOpHash","getUserOperationHash","entryPoint07Address","transactionHash","getAction","writeContract","entryPoint07Abi","userOpExecutor","executor","receipts","createTransport","method","params","numberToHex","entryPoint07Address","rpcUserOp","entrypoint","result","sendUserOperation","hash","estimateUserOperationGas"]}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@latticexyz/paymaster",
3
+ "version": "2.2.15-entrykit-1694d69f0a35d77c65b0388284ad9c38c32168bd",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/latticexyz/mud.git",
7
+ "directory": "packages/paymaster"
8
+ },
9
+ "license": "MIT",
10
+ "type": "module",
11
+ "exports": {
12
+ "./internal": "./dist/internal.js"
13
+ },
14
+ "typesVersions": {
15
+ "*": {
16
+ "internal": [
17
+ "./dist/internal.d.ts"
18
+ ]
19
+ }
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "dependencies": {
25
+ "debug": "^4.3.4",
26
+ "webauthn-p256": "^0.0.10",
27
+ "@latticexyz/common": "2.2.15-entrykit-1694d69f0a35d77c65b0388284ad9c38c32168bd",
28
+ "@latticexyz/store": "2.2.15-entrykit-1694d69f0a35d77c65b0388284ad9c38c32168bd"
29
+ },
30
+ "devDependencies": {
31
+ "@types/debug": "^4.1.7",
32
+ "tsup": "^6.7.0",
33
+ "viem": "2.21.19"
34
+ },
35
+ "peerDependencies": {
36
+ "viem": "2.x"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "scripts": {
42
+ "build": "tsup",
43
+ "clean": "shx rm -rf dist",
44
+ "dev": "tsup --watch",
45
+ "test": "tsc -p tsconfig.test.json --noEmit && vitest --run",
46
+ "test:ci": "pnpm run test"
47
+ }
48
+ }