@gitmyabi/authgemjoin5 0.0.0-stage → 1.0.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 +107 -2
- package/contracts/AuthGemJoin5.d.ts +474 -0
- package/contracts/AuthGemJoin5.js +474 -0
- package/contracts/AuthGemJoin5.ts +622 -0
- package/contracts/index.d.ts +2 -0
- package/contracts/index.js +7 -0
- package/contracts/index.ts +3 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +40 -3
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* AuthGemJoin5 ABI
|
|
6
|
+
*
|
|
7
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
8
|
+
*/
|
|
9
|
+
export const AuthGemJoin5Abi = [
|
|
10
|
+
{
|
|
11
|
+
"inputs": [
|
|
12
|
+
{
|
|
13
|
+
"internalType": "address",
|
|
14
|
+
"name": "vat_",
|
|
15
|
+
"type": "address"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"internalType": "bytes32",
|
|
19
|
+
"name": "ilk_",
|
|
20
|
+
"type": "bytes32"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"internalType": "address",
|
|
24
|
+
"name": "gem_",
|
|
25
|
+
"type": "address"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"stateMutability": "nonpayable",
|
|
29
|
+
"type": "constructor"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"anonymous": true,
|
|
33
|
+
"inputs": [
|
|
34
|
+
{
|
|
35
|
+
"indexed": true,
|
|
36
|
+
"internalType": "bytes4",
|
|
37
|
+
"name": "sig",
|
|
38
|
+
"type": "bytes4"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"indexed": true,
|
|
42
|
+
"internalType": "address",
|
|
43
|
+
"name": "usr",
|
|
44
|
+
"type": "address"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"indexed": true,
|
|
48
|
+
"internalType": "bytes32",
|
|
49
|
+
"name": "arg1",
|
|
50
|
+
"type": "bytes32"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"indexed": true,
|
|
54
|
+
"internalType": "bytes32",
|
|
55
|
+
"name": "arg2",
|
|
56
|
+
"type": "bytes32"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"indexed": false,
|
|
60
|
+
"internalType": "bytes",
|
|
61
|
+
"name": "data",
|
|
62
|
+
"type": "bytes"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"name": "LogNote",
|
|
66
|
+
"type": "event"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"inputs": [],
|
|
70
|
+
"name": "cage",
|
|
71
|
+
"outputs": [],
|
|
72
|
+
"stateMutability": "nonpayable",
|
|
73
|
+
"type": "function"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"inputs": [],
|
|
77
|
+
"name": "dec",
|
|
78
|
+
"outputs": [
|
|
79
|
+
{
|
|
80
|
+
"internalType": "uint256",
|
|
81
|
+
"name": "",
|
|
82
|
+
"type": "uint256"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"stateMutability": "view",
|
|
86
|
+
"type": "function"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"inputs": [
|
|
90
|
+
{
|
|
91
|
+
"internalType": "address",
|
|
92
|
+
"name": "usr",
|
|
93
|
+
"type": "address"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"name": "deny",
|
|
97
|
+
"outputs": [],
|
|
98
|
+
"stateMutability": "nonpayable",
|
|
99
|
+
"type": "function"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"inputs": [
|
|
103
|
+
{
|
|
104
|
+
"internalType": "address",
|
|
105
|
+
"name": "guy",
|
|
106
|
+
"type": "address"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"internalType": "uint256",
|
|
110
|
+
"name": "wad",
|
|
111
|
+
"type": "uint256"
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"name": "exit",
|
|
115
|
+
"outputs": [],
|
|
116
|
+
"stateMutability": "nonpayable",
|
|
117
|
+
"type": "function"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"inputs": [],
|
|
121
|
+
"name": "gem",
|
|
122
|
+
"outputs": [
|
|
123
|
+
{
|
|
124
|
+
"internalType": "contract GemLike_2",
|
|
125
|
+
"name": "",
|
|
126
|
+
"type": "address"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"stateMutability": "view",
|
|
130
|
+
"type": "function"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"inputs": [],
|
|
134
|
+
"name": "ilk",
|
|
135
|
+
"outputs": [
|
|
136
|
+
{
|
|
137
|
+
"internalType": "bytes32",
|
|
138
|
+
"name": "",
|
|
139
|
+
"type": "bytes32"
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"stateMutability": "view",
|
|
143
|
+
"type": "function"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"inputs": [
|
|
147
|
+
{
|
|
148
|
+
"internalType": "address",
|
|
149
|
+
"name": "urn",
|
|
150
|
+
"type": "address"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"internalType": "uint256",
|
|
154
|
+
"name": "wad",
|
|
155
|
+
"type": "uint256"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"internalType": "address",
|
|
159
|
+
"name": "_msgSender",
|
|
160
|
+
"type": "address"
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"name": "join",
|
|
164
|
+
"outputs": [],
|
|
165
|
+
"stateMutability": "nonpayable",
|
|
166
|
+
"type": "function"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"inputs": [],
|
|
170
|
+
"name": "live",
|
|
171
|
+
"outputs": [
|
|
172
|
+
{
|
|
173
|
+
"internalType": "uint256",
|
|
174
|
+
"name": "",
|
|
175
|
+
"type": "uint256"
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"stateMutability": "view",
|
|
179
|
+
"type": "function"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"inputs": [
|
|
183
|
+
{
|
|
184
|
+
"internalType": "address",
|
|
185
|
+
"name": "usr",
|
|
186
|
+
"type": "address"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"name": "rely",
|
|
190
|
+
"outputs": [],
|
|
191
|
+
"stateMutability": "nonpayable",
|
|
192
|
+
"type": "function"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"inputs": [],
|
|
196
|
+
"name": "vat",
|
|
197
|
+
"outputs": [
|
|
198
|
+
{
|
|
199
|
+
"internalType": "contract VatLike_4",
|
|
200
|
+
"name": "",
|
|
201
|
+
"type": "address"
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
"stateMutability": "view",
|
|
205
|
+
"type": "function"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"inputs": [
|
|
209
|
+
{
|
|
210
|
+
"internalType": "address",
|
|
211
|
+
"name": "",
|
|
212
|
+
"type": "address"
|
|
213
|
+
}
|
|
214
|
+
],
|
|
215
|
+
"name": "wards",
|
|
216
|
+
"outputs": [
|
|
217
|
+
{
|
|
218
|
+
"internalType": "uint256",
|
|
219
|
+
"name": "",
|
|
220
|
+
"type": "uint256"
|
|
221
|
+
}
|
|
222
|
+
],
|
|
223
|
+
"stateMutability": "view",
|
|
224
|
+
"type": "function"
|
|
225
|
+
}
|
|
226
|
+
] as const satisfies Abi;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Type-safe ABI for AuthGemJoin5
|
|
230
|
+
*/
|
|
231
|
+
export type AuthGemJoin5Abi = typeof AuthGemJoin5Abi;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Contract instance type for AuthGemJoin5
|
|
235
|
+
*/
|
|
236
|
+
// Use any for contract type to avoid complex viem type issues
|
|
237
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
238
|
+
export type AuthGemJoin5Contract = any;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* AuthGemJoin5 Contract Class
|
|
242
|
+
*
|
|
243
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* ```typescript
|
|
247
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
248
|
+
* import { mainnet } from 'viem/chains';
|
|
249
|
+
* import { AuthGemJoin5 } from 'AuthGemJoin5';
|
|
250
|
+
*
|
|
251
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
252
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
253
|
+
*
|
|
254
|
+
* const contract = new AuthGemJoin5('0x...', { publicClient, walletClient });
|
|
255
|
+
*
|
|
256
|
+
* // Read functions
|
|
257
|
+
* const result = await contract.balanceOf('0x...');
|
|
258
|
+
*
|
|
259
|
+
* // Write functions
|
|
260
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
261
|
+
*
|
|
262
|
+
* // Simulate transactions (dry-run)
|
|
263
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
264
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
265
|
+
*
|
|
266
|
+
* // Watch events
|
|
267
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
268
|
+
* console.log('Transfer event:', event);
|
|
269
|
+
* });
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
export class AuthGemJoin5 {
|
|
273
|
+
private contract: AuthGemJoin5Contract;
|
|
274
|
+
private contractAddress: Address;
|
|
275
|
+
private publicClient: PublicClient;
|
|
276
|
+
|
|
277
|
+
constructor(
|
|
278
|
+
address: Address,
|
|
279
|
+
clients: {
|
|
280
|
+
publicClient: PublicClient;
|
|
281
|
+
walletClient?: WalletClient;
|
|
282
|
+
}
|
|
283
|
+
) {
|
|
284
|
+
this.contractAddress = address;
|
|
285
|
+
this.publicClient = clients.publicClient;
|
|
286
|
+
this.contract = getContract({
|
|
287
|
+
address,
|
|
288
|
+
abi: AuthGemJoin5Abi,
|
|
289
|
+
client: {
|
|
290
|
+
public: clients.publicClient,
|
|
291
|
+
wallet: clients.walletClient,
|
|
292
|
+
},
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Get the contract address
|
|
298
|
+
*/
|
|
299
|
+
get address(): Address {
|
|
300
|
+
return this.contractAddress;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Get the underlying viem contract instance.
|
|
305
|
+
*/
|
|
306
|
+
getContract(): AuthGemJoin5Contract {
|
|
307
|
+
return this.contract;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* dec
|
|
312
|
+
* view
|
|
313
|
+
*/
|
|
314
|
+
async dec(): Promise<bigint> {
|
|
315
|
+
return this.contract.read.dec() as Promise<bigint>;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* gem
|
|
320
|
+
* view
|
|
321
|
+
*/
|
|
322
|
+
async gem(): Promise<`0x${string}`> {
|
|
323
|
+
return this.contract.read.gem() as Promise<`0x${string}`>;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* ilk
|
|
328
|
+
* view
|
|
329
|
+
*/
|
|
330
|
+
async ilk(): Promise<`0x${string}`> {
|
|
331
|
+
return this.contract.read.ilk() as Promise<`0x${string}`>;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* live
|
|
336
|
+
* view
|
|
337
|
+
*/
|
|
338
|
+
async live(): Promise<bigint> {
|
|
339
|
+
return this.contract.read.live() as Promise<bigint>;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* vat
|
|
344
|
+
* view
|
|
345
|
+
*/
|
|
346
|
+
async vat(): Promise<`0x${string}`> {
|
|
347
|
+
return this.contract.read.vat() as Promise<`0x${string}`>;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* wards
|
|
352
|
+
* view
|
|
353
|
+
*/
|
|
354
|
+
async wards(arg0: `0x${string}`): Promise<bigint> {
|
|
355
|
+
return this.contract.read.wards([arg0] as const) as Promise<bigint>;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* cage
|
|
360
|
+
* nonpayable
|
|
361
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
362
|
+
*/
|
|
363
|
+
async cage(options?: {
|
|
364
|
+
accessList?: import('viem').AccessList;
|
|
365
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
366
|
+
chain?: import('viem').Chain | null;
|
|
367
|
+
dataSuffix?: `0x${string}`;
|
|
368
|
+
gas?: bigint;
|
|
369
|
+
gasPrice?: bigint;
|
|
370
|
+
maxFeePerGas?: bigint;
|
|
371
|
+
maxPriorityFeePerGas?: bigint;
|
|
372
|
+
nonce?: number;
|
|
373
|
+
value?: bigint;
|
|
374
|
+
}): Promise<`0x${string}`> {
|
|
375
|
+
if (!this.contract.write) {
|
|
376
|
+
throw new Error('Wallet client is required for write operations');
|
|
377
|
+
}
|
|
378
|
+
return this.contract.write.cage(options) as Promise<`0x${string}`>;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* deny
|
|
383
|
+
* nonpayable
|
|
384
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
385
|
+
*/
|
|
386
|
+
async deny(usr: `0x${string}`, options?: {
|
|
387
|
+
accessList?: import('viem').AccessList;
|
|
388
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
389
|
+
chain?: import('viem').Chain | null;
|
|
390
|
+
dataSuffix?: `0x${string}`;
|
|
391
|
+
gas?: bigint;
|
|
392
|
+
gasPrice?: bigint;
|
|
393
|
+
maxFeePerGas?: bigint;
|
|
394
|
+
maxPriorityFeePerGas?: bigint;
|
|
395
|
+
nonce?: number;
|
|
396
|
+
value?: bigint;
|
|
397
|
+
}): Promise<`0x${string}`> {
|
|
398
|
+
if (!this.contract.write) {
|
|
399
|
+
throw new Error('Wallet client is required for write operations');
|
|
400
|
+
}
|
|
401
|
+
return this.contract.write.deny([usr] as const, options) as Promise<`0x${string}`>;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* exit
|
|
406
|
+
* nonpayable
|
|
407
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
408
|
+
*/
|
|
409
|
+
async exit(guy: `0x${string}`, wad: bigint, options?: {
|
|
410
|
+
accessList?: import('viem').AccessList;
|
|
411
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
412
|
+
chain?: import('viem').Chain | null;
|
|
413
|
+
dataSuffix?: `0x${string}`;
|
|
414
|
+
gas?: bigint;
|
|
415
|
+
gasPrice?: bigint;
|
|
416
|
+
maxFeePerGas?: bigint;
|
|
417
|
+
maxPriorityFeePerGas?: bigint;
|
|
418
|
+
nonce?: number;
|
|
419
|
+
value?: bigint;
|
|
420
|
+
}): Promise<`0x${string}`> {
|
|
421
|
+
if (!this.contract.write) {
|
|
422
|
+
throw new Error('Wallet client is required for write operations');
|
|
423
|
+
}
|
|
424
|
+
return this.contract.write.exit([guy, wad] as const, options) as Promise<`0x${string}`>;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* join
|
|
429
|
+
* nonpayable
|
|
430
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
431
|
+
*/
|
|
432
|
+
async join(urn: `0x${string}`, wad: bigint, _msgSender: `0x${string}`, options?: {
|
|
433
|
+
accessList?: import('viem').AccessList;
|
|
434
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
435
|
+
chain?: import('viem').Chain | null;
|
|
436
|
+
dataSuffix?: `0x${string}`;
|
|
437
|
+
gas?: bigint;
|
|
438
|
+
gasPrice?: bigint;
|
|
439
|
+
maxFeePerGas?: bigint;
|
|
440
|
+
maxPriorityFeePerGas?: bigint;
|
|
441
|
+
nonce?: number;
|
|
442
|
+
value?: bigint;
|
|
443
|
+
}): Promise<`0x${string}`> {
|
|
444
|
+
if (!this.contract.write) {
|
|
445
|
+
throw new Error('Wallet client is required for write operations');
|
|
446
|
+
}
|
|
447
|
+
return this.contract.write.join([urn, wad, _msgSender] as const, options) as Promise<`0x${string}`>;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* rely
|
|
452
|
+
* nonpayable
|
|
453
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
454
|
+
*/
|
|
455
|
+
async rely(usr: `0x${string}`, options?: {
|
|
456
|
+
accessList?: import('viem').AccessList;
|
|
457
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
458
|
+
chain?: import('viem').Chain | null;
|
|
459
|
+
dataSuffix?: `0x${string}`;
|
|
460
|
+
gas?: bigint;
|
|
461
|
+
gasPrice?: bigint;
|
|
462
|
+
maxFeePerGas?: bigint;
|
|
463
|
+
maxPriorityFeePerGas?: bigint;
|
|
464
|
+
nonce?: number;
|
|
465
|
+
value?: bigint;
|
|
466
|
+
}): Promise<`0x${string}`> {
|
|
467
|
+
if (!this.contract.write) {
|
|
468
|
+
throw new Error('Wallet client is required for write operations');
|
|
469
|
+
}
|
|
470
|
+
return this.contract.write.rely([usr] as const, options) as Promise<`0x${string}`>;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
477
|
+
*
|
|
478
|
+
* @example
|
|
479
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
480
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
481
|
+
* console.log('Would succeed:', result.result);
|
|
482
|
+
*/
|
|
483
|
+
get simulate() {
|
|
484
|
+
const contract = this.contract;
|
|
485
|
+
if (!contract.simulate) {
|
|
486
|
+
throw new Error('Public client is required for simulation');
|
|
487
|
+
}
|
|
488
|
+
return {
|
|
489
|
+
/**
|
|
490
|
+
* Simulate cage
|
|
491
|
+
* Returns gas estimate and result without sending transaction
|
|
492
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
493
|
+
*/
|
|
494
|
+
async cage(options?: {
|
|
495
|
+
accessList?: import('viem').AccessList;
|
|
496
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
497
|
+
chain?: import('viem').Chain | null;
|
|
498
|
+
dataSuffix?: `0x${string}`;
|
|
499
|
+
gas?: bigint;
|
|
500
|
+
gasPrice?: bigint;
|
|
501
|
+
maxFeePerGas?: bigint;
|
|
502
|
+
maxPriorityFeePerGas?: bigint;
|
|
503
|
+
nonce?: number;
|
|
504
|
+
value?: bigint;
|
|
505
|
+
}): Promise<void> {
|
|
506
|
+
return contract.simulate.cage(options) as Promise<void>;
|
|
507
|
+
},
|
|
508
|
+
/**
|
|
509
|
+
* Simulate deny
|
|
510
|
+
* Returns gas estimate and result without sending transaction
|
|
511
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
512
|
+
*/
|
|
513
|
+
async deny(usr: `0x${string}`, options?: {
|
|
514
|
+
accessList?: import('viem').AccessList;
|
|
515
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
516
|
+
chain?: import('viem').Chain | null;
|
|
517
|
+
dataSuffix?: `0x${string}`;
|
|
518
|
+
gas?: bigint;
|
|
519
|
+
gasPrice?: bigint;
|
|
520
|
+
maxFeePerGas?: bigint;
|
|
521
|
+
maxPriorityFeePerGas?: bigint;
|
|
522
|
+
nonce?: number;
|
|
523
|
+
value?: bigint;
|
|
524
|
+
}): Promise<void> {
|
|
525
|
+
return contract.simulate.deny([usr] as const, options) as Promise<void>;
|
|
526
|
+
},
|
|
527
|
+
/**
|
|
528
|
+
* Simulate exit
|
|
529
|
+
* Returns gas estimate and result without sending transaction
|
|
530
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
531
|
+
*/
|
|
532
|
+
async exit(guy: `0x${string}`, wad: bigint, options?: {
|
|
533
|
+
accessList?: import('viem').AccessList;
|
|
534
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
535
|
+
chain?: import('viem').Chain | null;
|
|
536
|
+
dataSuffix?: `0x${string}`;
|
|
537
|
+
gas?: bigint;
|
|
538
|
+
gasPrice?: bigint;
|
|
539
|
+
maxFeePerGas?: bigint;
|
|
540
|
+
maxPriorityFeePerGas?: bigint;
|
|
541
|
+
nonce?: number;
|
|
542
|
+
value?: bigint;
|
|
543
|
+
}): Promise<void> {
|
|
544
|
+
return contract.simulate.exit([guy, wad] as const, options) as Promise<void>;
|
|
545
|
+
},
|
|
546
|
+
/**
|
|
547
|
+
* Simulate join
|
|
548
|
+
* Returns gas estimate and result without sending transaction
|
|
549
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
550
|
+
*/
|
|
551
|
+
async join(urn: `0x${string}`, wad: bigint, _msgSender: `0x${string}`, options?: {
|
|
552
|
+
accessList?: import('viem').AccessList;
|
|
553
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
554
|
+
chain?: import('viem').Chain | null;
|
|
555
|
+
dataSuffix?: `0x${string}`;
|
|
556
|
+
gas?: bigint;
|
|
557
|
+
gasPrice?: bigint;
|
|
558
|
+
maxFeePerGas?: bigint;
|
|
559
|
+
maxPriorityFeePerGas?: bigint;
|
|
560
|
+
nonce?: number;
|
|
561
|
+
value?: bigint;
|
|
562
|
+
}): Promise<void> {
|
|
563
|
+
return contract.simulate.join([urn, wad, _msgSender] as const, options) as Promise<void>;
|
|
564
|
+
},
|
|
565
|
+
/**
|
|
566
|
+
* Simulate rely
|
|
567
|
+
* Returns gas estimate and result without sending transaction
|
|
568
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
569
|
+
*/
|
|
570
|
+
async rely(usr: `0x${string}`, options?: {
|
|
571
|
+
accessList?: import('viem').AccessList;
|
|
572
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
573
|
+
chain?: import('viem').Chain | null;
|
|
574
|
+
dataSuffix?: `0x${string}`;
|
|
575
|
+
gas?: bigint;
|
|
576
|
+
gasPrice?: bigint;
|
|
577
|
+
maxFeePerGas?: bigint;
|
|
578
|
+
maxPriorityFeePerGas?: bigint;
|
|
579
|
+
nonce?: number;
|
|
580
|
+
value?: bigint;
|
|
581
|
+
}): Promise<void> {
|
|
582
|
+
return contract.simulate.rely([usr] as const, options) as Promise<void>;
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Watch contract events
|
|
589
|
+
*
|
|
590
|
+
* @example
|
|
591
|
+
* // Watch all Transfer events
|
|
592
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
593
|
+
* console.log('Transfer:', event);
|
|
594
|
+
* });
|
|
595
|
+
*
|
|
596
|
+
* // Stop watching
|
|
597
|
+
* unwatch();
|
|
598
|
+
*/
|
|
599
|
+
get watch() {
|
|
600
|
+
return {
|
|
601
|
+
/**
|
|
602
|
+
* Watch LogNote events
|
|
603
|
+
* @param callback Function to call when event is emitted
|
|
604
|
+
* @param filter Optional filter for indexed parameters
|
|
605
|
+
* @returns Unwatch function to stop listening
|
|
606
|
+
*/
|
|
607
|
+
LogNote: (callback: (event: { sig: `0x${string}`; usr: `0x${string}`; arg1: `0x${string}`; arg2: `0x${string}`; data: `0x${string}` }) => void, filter?: { sig?: `0x${string}` | `0x${string}`[] | null; usr?: `0x${string}` | `0x${string}`[] | null; arg1?: `0x${string}` | `0x${string}`[] | null; arg2?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
608
|
+
return this.publicClient.watchContractEvent({
|
|
609
|
+
address: this.contractAddress,
|
|
610
|
+
abi: AuthGemJoin5Abi,
|
|
611
|
+
eventName: 'LogNote',
|
|
612
|
+
args: filter as any,
|
|
613
|
+
onLogs: (logs: any[]) => {
|
|
614
|
+
logs.forEach((log: any) => {
|
|
615
|
+
callback(log.args as any);
|
|
616
|
+
});
|
|
617
|
+
},
|
|
618
|
+
}) as () => void;
|
|
619
|
+
}
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthGemJoin5 = exports.AuthGemJoin5Abi = void 0;
|
|
4
|
+
// Auto-generated exports for all contracts
|
|
5
|
+
var AuthGemJoin5_1 = require("./AuthGemJoin5");
|
|
6
|
+
Object.defineProperty(exports, "AuthGemJoin5Abi", { enumerable: true, get: function () { return AuthGemJoin5_1.AuthGemJoin5Abi; } });
|
|
7
|
+
Object.defineProperty(exports, "AuthGemJoin5", { enumerable: true, get: function () { return AuthGemJoin5_1.AuthGemJoin5; } });
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './contracts';
|
package/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Auto-generated TypeScript type bindings
|
|
3
|
+
// This file exports all generated contract types
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
__exportStar(require("./contracts"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitmyabi/authgemjoin5",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Auto-generated TypeScript type bindings for AuthGemJoin5 (build etherscan-authgemjoin5-0a596497-1795363062233, commit 28eca25, branch etherscan)",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"types": "./index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./index.js",
|
|
10
|
+
"require": "./index.js",
|
|
11
|
+
"types": "./index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./contracts": {
|
|
14
|
+
"import": "./contracts/index.js",
|
|
15
|
+
"require": "./contracts/index.js",
|
|
16
|
+
"types": "./contracts/index.d.ts"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"index.js",
|
|
21
|
+
"index.d.ts",
|
|
22
|
+
"contracts"
|
|
23
|
+
],
|
|
24
|
+
"keywords": [
|
|
25
|
+
"ethereum",
|
|
26
|
+
"smart-contracts",
|
|
27
|
+
"viem",
|
|
28
|
+
"wagmi",
|
|
29
|
+
"typescript",
|
|
30
|
+
"abi",
|
|
31
|
+
"ethers-v6"
|
|
32
|
+
],
|
|
33
|
+
"license": "Apache-2.0",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"viem": "^2.0.0"
|
|
36
|
+
},
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/etherscan/authgemjoin5"
|
|
40
|
+
},
|
|
41
|
+
"branch": "etherscan",
|
|
42
|
+
"shortHash": "28eca25"
|
|
6
43
|
}
|