@gitmyabi/multisigwallet 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +108 -0
- package/contracts/MultiSigWallet_json.d.ts +929 -0
- package/contracts/MultiSigWallet_json.js +1046 -0
- package/contracts/MultiSigWallet_json.ts +1271 -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 +43 -0
|
@@ -0,0 +1,1046 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MultiSigWallet_json = exports.MultiSigWallet_jsonAbi = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* MultiSigWallet_json ABI
|
|
7
|
+
*
|
|
8
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
9
|
+
*/
|
|
10
|
+
exports.MultiSigWallet_jsonAbi = [
|
|
11
|
+
{
|
|
12
|
+
"constant": true,
|
|
13
|
+
"inputs": [
|
|
14
|
+
{
|
|
15
|
+
"name": "",
|
|
16
|
+
"type": "uint256"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"name": "owners",
|
|
20
|
+
"outputs": [
|
|
21
|
+
{
|
|
22
|
+
"name": "",
|
|
23
|
+
"type": "address"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"payable": false,
|
|
27
|
+
"stateMutability": "view",
|
|
28
|
+
"type": "function"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"constant": false,
|
|
32
|
+
"inputs": [
|
|
33
|
+
{
|
|
34
|
+
"name": "owner",
|
|
35
|
+
"type": "address"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"name": "removeOwner",
|
|
39
|
+
"outputs": [],
|
|
40
|
+
"payable": false,
|
|
41
|
+
"stateMutability": "nonpayable",
|
|
42
|
+
"type": "function"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"constant": false,
|
|
46
|
+
"inputs": [
|
|
47
|
+
{
|
|
48
|
+
"name": "transactionId",
|
|
49
|
+
"type": "uint256"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"name": "revokeConfirmation",
|
|
53
|
+
"outputs": [],
|
|
54
|
+
"payable": false,
|
|
55
|
+
"stateMutability": "nonpayable",
|
|
56
|
+
"type": "function"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"constant": true,
|
|
60
|
+
"inputs": [
|
|
61
|
+
{
|
|
62
|
+
"name": "",
|
|
63
|
+
"type": "address"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"name": "isOwner",
|
|
67
|
+
"outputs": [
|
|
68
|
+
{
|
|
69
|
+
"name": "",
|
|
70
|
+
"type": "bool"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"payable": false,
|
|
74
|
+
"stateMutability": "view",
|
|
75
|
+
"type": "function"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"constant": true,
|
|
79
|
+
"inputs": [
|
|
80
|
+
{
|
|
81
|
+
"name": "",
|
|
82
|
+
"type": "uint256"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "",
|
|
86
|
+
"type": "address"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"name": "confirmations",
|
|
90
|
+
"outputs": [
|
|
91
|
+
{
|
|
92
|
+
"name": "",
|
|
93
|
+
"type": "bool"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"payable": false,
|
|
97
|
+
"stateMutability": "view",
|
|
98
|
+
"type": "function"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"constant": true,
|
|
102
|
+
"inputs": [
|
|
103
|
+
{
|
|
104
|
+
"name": "pending",
|
|
105
|
+
"type": "bool"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "executed",
|
|
109
|
+
"type": "bool"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"name": "getTransactionCount",
|
|
113
|
+
"outputs": [
|
|
114
|
+
{
|
|
115
|
+
"name": "count",
|
|
116
|
+
"type": "uint256"
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"payable": false,
|
|
120
|
+
"stateMutability": "view",
|
|
121
|
+
"type": "function"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"constant": false,
|
|
125
|
+
"inputs": [
|
|
126
|
+
{
|
|
127
|
+
"name": "owner",
|
|
128
|
+
"type": "address"
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"name": "addOwner",
|
|
132
|
+
"outputs": [],
|
|
133
|
+
"payable": false,
|
|
134
|
+
"stateMutability": "nonpayable",
|
|
135
|
+
"type": "function"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"constant": true,
|
|
139
|
+
"inputs": [
|
|
140
|
+
{
|
|
141
|
+
"name": "transactionId",
|
|
142
|
+
"type": "uint256"
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"name": "isConfirmed",
|
|
146
|
+
"outputs": [
|
|
147
|
+
{
|
|
148
|
+
"name": "",
|
|
149
|
+
"type": "bool"
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"payable": false,
|
|
153
|
+
"stateMutability": "view",
|
|
154
|
+
"type": "function"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"constant": true,
|
|
158
|
+
"inputs": [
|
|
159
|
+
{
|
|
160
|
+
"name": "transactionId",
|
|
161
|
+
"type": "uint256"
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"name": "getConfirmationCount",
|
|
165
|
+
"outputs": [
|
|
166
|
+
{
|
|
167
|
+
"name": "count",
|
|
168
|
+
"type": "uint256"
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"payable": false,
|
|
172
|
+
"stateMutability": "view",
|
|
173
|
+
"type": "function"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"constant": true,
|
|
177
|
+
"inputs": [
|
|
178
|
+
{
|
|
179
|
+
"name": "",
|
|
180
|
+
"type": "uint256"
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"name": "transactions",
|
|
184
|
+
"outputs": [
|
|
185
|
+
{
|
|
186
|
+
"name": "destination",
|
|
187
|
+
"type": "address"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "value",
|
|
191
|
+
"type": "uint256"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"name": "data",
|
|
195
|
+
"type": "bytes"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"name": "executed",
|
|
199
|
+
"type": "bool"
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
"payable": false,
|
|
203
|
+
"stateMutability": "view",
|
|
204
|
+
"type": "function"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"constant": true,
|
|
208
|
+
"inputs": [],
|
|
209
|
+
"name": "getOwners",
|
|
210
|
+
"outputs": [
|
|
211
|
+
{
|
|
212
|
+
"name": "",
|
|
213
|
+
"type": "address[]"
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
"payable": false,
|
|
217
|
+
"stateMutability": "view",
|
|
218
|
+
"type": "function"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"constant": true,
|
|
222
|
+
"inputs": [
|
|
223
|
+
{
|
|
224
|
+
"name": "from",
|
|
225
|
+
"type": "uint256"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"name": "to",
|
|
229
|
+
"type": "uint256"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"name": "pending",
|
|
233
|
+
"type": "bool"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"name": "executed",
|
|
237
|
+
"type": "bool"
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
"name": "getTransactionIds",
|
|
241
|
+
"outputs": [
|
|
242
|
+
{
|
|
243
|
+
"name": "_transactionIds",
|
|
244
|
+
"type": "uint256[]"
|
|
245
|
+
}
|
|
246
|
+
],
|
|
247
|
+
"payable": false,
|
|
248
|
+
"stateMutability": "view",
|
|
249
|
+
"type": "function"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"constant": true,
|
|
253
|
+
"inputs": [
|
|
254
|
+
{
|
|
255
|
+
"name": "transactionId",
|
|
256
|
+
"type": "uint256"
|
|
257
|
+
}
|
|
258
|
+
],
|
|
259
|
+
"name": "getConfirmations",
|
|
260
|
+
"outputs": [
|
|
261
|
+
{
|
|
262
|
+
"name": "_confirmations",
|
|
263
|
+
"type": "address[]"
|
|
264
|
+
}
|
|
265
|
+
],
|
|
266
|
+
"payable": false,
|
|
267
|
+
"stateMutability": "view",
|
|
268
|
+
"type": "function"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"constant": true,
|
|
272
|
+
"inputs": [],
|
|
273
|
+
"name": "transactionCount",
|
|
274
|
+
"outputs": [
|
|
275
|
+
{
|
|
276
|
+
"name": "",
|
|
277
|
+
"type": "uint256"
|
|
278
|
+
}
|
|
279
|
+
],
|
|
280
|
+
"payable": false,
|
|
281
|
+
"stateMutability": "view",
|
|
282
|
+
"type": "function"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"constant": false,
|
|
286
|
+
"inputs": [
|
|
287
|
+
{
|
|
288
|
+
"name": "_required",
|
|
289
|
+
"type": "uint256"
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
"name": "changeRequirement",
|
|
293
|
+
"outputs": [],
|
|
294
|
+
"payable": false,
|
|
295
|
+
"stateMutability": "nonpayable",
|
|
296
|
+
"type": "function"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"constant": false,
|
|
300
|
+
"inputs": [
|
|
301
|
+
{
|
|
302
|
+
"name": "transactionId",
|
|
303
|
+
"type": "uint256"
|
|
304
|
+
}
|
|
305
|
+
],
|
|
306
|
+
"name": "confirmTransaction",
|
|
307
|
+
"outputs": [],
|
|
308
|
+
"payable": false,
|
|
309
|
+
"stateMutability": "nonpayable",
|
|
310
|
+
"type": "function"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"constant": false,
|
|
314
|
+
"inputs": [
|
|
315
|
+
{
|
|
316
|
+
"name": "destination",
|
|
317
|
+
"type": "address"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"name": "value",
|
|
321
|
+
"type": "uint256"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"name": "data",
|
|
325
|
+
"type": "bytes"
|
|
326
|
+
}
|
|
327
|
+
],
|
|
328
|
+
"name": "submitTransaction",
|
|
329
|
+
"outputs": [
|
|
330
|
+
{
|
|
331
|
+
"name": "transactionId",
|
|
332
|
+
"type": "uint256"
|
|
333
|
+
}
|
|
334
|
+
],
|
|
335
|
+
"payable": false,
|
|
336
|
+
"stateMutability": "nonpayable",
|
|
337
|
+
"type": "function"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"constant": true,
|
|
341
|
+
"inputs": [],
|
|
342
|
+
"name": "MAX_OWNER_COUNT",
|
|
343
|
+
"outputs": [
|
|
344
|
+
{
|
|
345
|
+
"name": "",
|
|
346
|
+
"type": "uint256"
|
|
347
|
+
}
|
|
348
|
+
],
|
|
349
|
+
"payable": false,
|
|
350
|
+
"stateMutability": "view",
|
|
351
|
+
"type": "function"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"constant": true,
|
|
355
|
+
"inputs": [],
|
|
356
|
+
"name": "required",
|
|
357
|
+
"outputs": [
|
|
358
|
+
{
|
|
359
|
+
"name": "",
|
|
360
|
+
"type": "uint256"
|
|
361
|
+
}
|
|
362
|
+
],
|
|
363
|
+
"payable": false,
|
|
364
|
+
"stateMutability": "view",
|
|
365
|
+
"type": "function"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"constant": false,
|
|
369
|
+
"inputs": [
|
|
370
|
+
{
|
|
371
|
+
"name": "owner",
|
|
372
|
+
"type": "address"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"name": "newOwner",
|
|
376
|
+
"type": "address"
|
|
377
|
+
}
|
|
378
|
+
],
|
|
379
|
+
"name": "replaceOwner",
|
|
380
|
+
"outputs": [],
|
|
381
|
+
"payable": false,
|
|
382
|
+
"stateMutability": "nonpayable",
|
|
383
|
+
"type": "function"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"constant": false,
|
|
387
|
+
"inputs": [
|
|
388
|
+
{
|
|
389
|
+
"name": "transactionId",
|
|
390
|
+
"type": "uint256"
|
|
391
|
+
}
|
|
392
|
+
],
|
|
393
|
+
"name": "executeTransaction",
|
|
394
|
+
"outputs": [],
|
|
395
|
+
"payable": false,
|
|
396
|
+
"stateMutability": "nonpayable",
|
|
397
|
+
"type": "function"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"inputs": [
|
|
401
|
+
{
|
|
402
|
+
"name": "_owners",
|
|
403
|
+
"type": "address[]"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"name": "_required",
|
|
407
|
+
"type": "uint256"
|
|
408
|
+
}
|
|
409
|
+
],
|
|
410
|
+
"payable": false,
|
|
411
|
+
"stateMutability": "nonpayable",
|
|
412
|
+
"type": "constructor"
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"payable": true,
|
|
416
|
+
"stateMutability": "payable",
|
|
417
|
+
"type": "fallback"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"anonymous": false,
|
|
421
|
+
"inputs": [
|
|
422
|
+
{
|
|
423
|
+
"indexed": true,
|
|
424
|
+
"name": "sender",
|
|
425
|
+
"type": "address"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"indexed": true,
|
|
429
|
+
"name": "transactionId",
|
|
430
|
+
"type": "uint256"
|
|
431
|
+
}
|
|
432
|
+
],
|
|
433
|
+
"name": "Confirmation",
|
|
434
|
+
"type": "event"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"anonymous": false,
|
|
438
|
+
"inputs": [
|
|
439
|
+
{
|
|
440
|
+
"indexed": true,
|
|
441
|
+
"name": "sender",
|
|
442
|
+
"type": "address"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"indexed": true,
|
|
446
|
+
"name": "transactionId",
|
|
447
|
+
"type": "uint256"
|
|
448
|
+
}
|
|
449
|
+
],
|
|
450
|
+
"name": "Revocation",
|
|
451
|
+
"type": "event"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"anonymous": false,
|
|
455
|
+
"inputs": [
|
|
456
|
+
{
|
|
457
|
+
"indexed": true,
|
|
458
|
+
"name": "transactionId",
|
|
459
|
+
"type": "uint256"
|
|
460
|
+
}
|
|
461
|
+
],
|
|
462
|
+
"name": "Submission",
|
|
463
|
+
"type": "event"
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"anonymous": false,
|
|
467
|
+
"inputs": [
|
|
468
|
+
{
|
|
469
|
+
"indexed": true,
|
|
470
|
+
"name": "transactionId",
|
|
471
|
+
"type": "uint256"
|
|
472
|
+
}
|
|
473
|
+
],
|
|
474
|
+
"name": "Execution",
|
|
475
|
+
"type": "event"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"anonymous": false,
|
|
479
|
+
"inputs": [
|
|
480
|
+
{
|
|
481
|
+
"indexed": true,
|
|
482
|
+
"name": "transactionId",
|
|
483
|
+
"type": "uint256"
|
|
484
|
+
}
|
|
485
|
+
],
|
|
486
|
+
"name": "ExecutionFailure",
|
|
487
|
+
"type": "event"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"anonymous": false,
|
|
491
|
+
"inputs": [
|
|
492
|
+
{
|
|
493
|
+
"indexed": true,
|
|
494
|
+
"name": "sender",
|
|
495
|
+
"type": "address"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"indexed": false,
|
|
499
|
+
"name": "value",
|
|
500
|
+
"type": "uint256"
|
|
501
|
+
}
|
|
502
|
+
],
|
|
503
|
+
"name": "Deposit",
|
|
504
|
+
"type": "event"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"anonymous": false,
|
|
508
|
+
"inputs": [
|
|
509
|
+
{
|
|
510
|
+
"indexed": true,
|
|
511
|
+
"name": "owner",
|
|
512
|
+
"type": "address"
|
|
513
|
+
}
|
|
514
|
+
],
|
|
515
|
+
"name": "OwnerAddition",
|
|
516
|
+
"type": "event"
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"anonymous": false,
|
|
520
|
+
"inputs": [
|
|
521
|
+
{
|
|
522
|
+
"indexed": true,
|
|
523
|
+
"name": "owner",
|
|
524
|
+
"type": "address"
|
|
525
|
+
}
|
|
526
|
+
],
|
|
527
|
+
"name": "OwnerRemoval",
|
|
528
|
+
"type": "event"
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
"anonymous": false,
|
|
532
|
+
"inputs": [
|
|
533
|
+
{
|
|
534
|
+
"indexed": false,
|
|
535
|
+
"name": "required",
|
|
536
|
+
"type": "uint256"
|
|
537
|
+
}
|
|
538
|
+
],
|
|
539
|
+
"name": "RequirementChange",
|
|
540
|
+
"type": "event"
|
|
541
|
+
}
|
|
542
|
+
];
|
|
543
|
+
/**
|
|
544
|
+
* MultiSigWallet_json Contract Class
|
|
545
|
+
*
|
|
546
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
547
|
+
*
|
|
548
|
+
* @example
|
|
549
|
+
* ```typescript
|
|
550
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
551
|
+
* import { mainnet } from 'viem/chains';
|
|
552
|
+
* import { MultiSigWallet_json } from 'MultiSigWallet_json';
|
|
553
|
+
*
|
|
554
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
555
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
556
|
+
*
|
|
557
|
+
* const contract = new MultiSigWallet_json('0x...', { publicClient, walletClient });
|
|
558
|
+
*
|
|
559
|
+
* // Read functions
|
|
560
|
+
* const result = await contract.balanceOf('0x...');
|
|
561
|
+
*
|
|
562
|
+
* // Write functions
|
|
563
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
564
|
+
*
|
|
565
|
+
* // Simulate transactions (dry-run)
|
|
566
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
567
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
568
|
+
*
|
|
569
|
+
* // Watch events
|
|
570
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
571
|
+
* console.log('Transfer event:', event);
|
|
572
|
+
* });
|
|
573
|
+
* ```
|
|
574
|
+
*/
|
|
575
|
+
class MultiSigWallet_json {
|
|
576
|
+
constructor(address, clients) {
|
|
577
|
+
this.contractAddress = address;
|
|
578
|
+
this.publicClient = clients.publicClient;
|
|
579
|
+
this.contract = (0, viem_1.getContract)({
|
|
580
|
+
address,
|
|
581
|
+
abi: exports.MultiSigWallet_jsonAbi,
|
|
582
|
+
client: {
|
|
583
|
+
public: clients.publicClient,
|
|
584
|
+
wallet: clients.walletClient,
|
|
585
|
+
},
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Get the contract address
|
|
590
|
+
*/
|
|
591
|
+
get address() {
|
|
592
|
+
return this.contractAddress;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Get the underlying viem contract instance
|
|
596
|
+
*/
|
|
597
|
+
getContract() {
|
|
598
|
+
return this.contract;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* owners
|
|
602
|
+
* view
|
|
603
|
+
*/
|
|
604
|
+
async owners(arg0) {
|
|
605
|
+
return this.contract.read.owners([arg0]);
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* isOwner
|
|
609
|
+
* view
|
|
610
|
+
*/
|
|
611
|
+
async isOwner(arg0) {
|
|
612
|
+
return this.contract.read.isOwner([arg0]);
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* confirmations
|
|
616
|
+
* view
|
|
617
|
+
*/
|
|
618
|
+
async confirmations(arg0, arg1) {
|
|
619
|
+
return this.contract.read.confirmations([arg0, arg1]);
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* getTransactionCount
|
|
623
|
+
* view
|
|
624
|
+
*/
|
|
625
|
+
async getTransactionCount(pending, executed) {
|
|
626
|
+
return this.contract.read.getTransactionCount([pending, executed]);
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* isConfirmed
|
|
630
|
+
* view
|
|
631
|
+
*/
|
|
632
|
+
async isConfirmed(transactionId) {
|
|
633
|
+
return this.contract.read.isConfirmed([transactionId]);
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* getConfirmationCount
|
|
637
|
+
* view
|
|
638
|
+
*/
|
|
639
|
+
async getConfirmationCount(transactionId) {
|
|
640
|
+
return this.contract.read.getConfirmationCount([transactionId]);
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* transactions
|
|
644
|
+
* view
|
|
645
|
+
*/
|
|
646
|
+
async transactions(arg0) {
|
|
647
|
+
return this.contract.read.transactions([arg0]);
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* getOwners
|
|
651
|
+
* view
|
|
652
|
+
*/
|
|
653
|
+
async getOwners() {
|
|
654
|
+
return this.contract.read.getOwners();
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* getTransactionIds
|
|
658
|
+
* view
|
|
659
|
+
*/
|
|
660
|
+
async getTransactionIds(from, to, pending, executed) {
|
|
661
|
+
return this.contract.read.getTransactionIds([from, to, pending, executed]);
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* getConfirmations
|
|
665
|
+
* view
|
|
666
|
+
*/
|
|
667
|
+
async getConfirmations(transactionId) {
|
|
668
|
+
return this.contract.read.getConfirmations([transactionId]);
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* transactionCount
|
|
672
|
+
* view
|
|
673
|
+
*/
|
|
674
|
+
async transactionCount() {
|
|
675
|
+
return this.contract.read.transactionCount();
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* MAX_OWNER_COUNT
|
|
679
|
+
* view
|
|
680
|
+
*/
|
|
681
|
+
async MAX_OWNER_COUNT() {
|
|
682
|
+
return this.contract.read.MAX_OWNER_COUNT();
|
|
683
|
+
}
|
|
684
|
+
/**
|
|
685
|
+
* required
|
|
686
|
+
* view
|
|
687
|
+
*/
|
|
688
|
+
async required() {
|
|
689
|
+
return this.contract.read.required();
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* removeOwner
|
|
693
|
+
* nonpayable
|
|
694
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
695
|
+
*/
|
|
696
|
+
async removeOwner(owner, options) {
|
|
697
|
+
if (!this.contract.write) {
|
|
698
|
+
throw new Error('Wallet client is required for write operations');
|
|
699
|
+
}
|
|
700
|
+
return this.contract.write.removeOwner([owner], options);
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* revokeConfirmation
|
|
704
|
+
* nonpayable
|
|
705
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
706
|
+
*/
|
|
707
|
+
async revokeConfirmation(transactionId, options) {
|
|
708
|
+
if (!this.contract.write) {
|
|
709
|
+
throw new Error('Wallet client is required for write operations');
|
|
710
|
+
}
|
|
711
|
+
return this.contract.write.revokeConfirmation([transactionId], options);
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* addOwner
|
|
715
|
+
* nonpayable
|
|
716
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
717
|
+
*/
|
|
718
|
+
async addOwner(owner, options) {
|
|
719
|
+
if (!this.contract.write) {
|
|
720
|
+
throw new Error('Wallet client is required for write operations');
|
|
721
|
+
}
|
|
722
|
+
return this.contract.write.addOwner([owner], options);
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* changeRequirement
|
|
726
|
+
* nonpayable
|
|
727
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
728
|
+
*/
|
|
729
|
+
async changeRequirement(_required, options) {
|
|
730
|
+
if (!this.contract.write) {
|
|
731
|
+
throw new Error('Wallet client is required for write operations');
|
|
732
|
+
}
|
|
733
|
+
return this.contract.write.changeRequirement([_required], options);
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* confirmTransaction
|
|
737
|
+
* nonpayable
|
|
738
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
739
|
+
*/
|
|
740
|
+
async confirmTransaction(transactionId, options) {
|
|
741
|
+
if (!this.contract.write) {
|
|
742
|
+
throw new Error('Wallet client is required for write operations');
|
|
743
|
+
}
|
|
744
|
+
return this.contract.write.confirmTransaction([transactionId], options);
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* submitTransaction
|
|
748
|
+
* nonpayable
|
|
749
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
750
|
+
*/
|
|
751
|
+
async submitTransaction(destination, value, data, options) {
|
|
752
|
+
if (!this.contract.write) {
|
|
753
|
+
throw new Error('Wallet client is required for write operations');
|
|
754
|
+
}
|
|
755
|
+
return this.contract.write.submitTransaction([destination, value, data], options);
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* replaceOwner
|
|
759
|
+
* nonpayable
|
|
760
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
761
|
+
*/
|
|
762
|
+
async replaceOwner(owner, newOwner, options) {
|
|
763
|
+
if (!this.contract.write) {
|
|
764
|
+
throw new Error('Wallet client is required for write operations');
|
|
765
|
+
}
|
|
766
|
+
return this.contract.write.replaceOwner([owner, newOwner], options);
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* executeTransaction
|
|
770
|
+
* nonpayable
|
|
771
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
772
|
+
*/
|
|
773
|
+
async executeTransaction(transactionId, options) {
|
|
774
|
+
if (!this.contract.write) {
|
|
775
|
+
throw new Error('Wallet client is required for write operations');
|
|
776
|
+
}
|
|
777
|
+
return this.contract.write.executeTransaction([transactionId], options);
|
|
778
|
+
}
|
|
779
|
+
/**
|
|
780
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
781
|
+
*
|
|
782
|
+
* @example
|
|
783
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
784
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
785
|
+
* console.log('Would succeed:', result.result);
|
|
786
|
+
*/
|
|
787
|
+
get simulate() {
|
|
788
|
+
const contract = this.contract;
|
|
789
|
+
if (!contract.simulate) {
|
|
790
|
+
throw new Error('Public client is required for simulation');
|
|
791
|
+
}
|
|
792
|
+
return {
|
|
793
|
+
/**
|
|
794
|
+
* Simulate removeOwner
|
|
795
|
+
* Returns gas estimate and result without sending transaction
|
|
796
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
797
|
+
*/
|
|
798
|
+
async removeOwner(owner, options) {
|
|
799
|
+
return contract.simulate.removeOwner([owner], options);
|
|
800
|
+
},
|
|
801
|
+
/**
|
|
802
|
+
* Simulate revokeConfirmation
|
|
803
|
+
* Returns gas estimate and result without sending transaction
|
|
804
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
805
|
+
*/
|
|
806
|
+
async revokeConfirmation(transactionId, options) {
|
|
807
|
+
return contract.simulate.revokeConfirmation([transactionId], options);
|
|
808
|
+
},
|
|
809
|
+
/**
|
|
810
|
+
* Simulate addOwner
|
|
811
|
+
* Returns gas estimate and result without sending transaction
|
|
812
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
813
|
+
*/
|
|
814
|
+
async addOwner(owner, options) {
|
|
815
|
+
return contract.simulate.addOwner([owner], options);
|
|
816
|
+
},
|
|
817
|
+
/**
|
|
818
|
+
* Simulate changeRequirement
|
|
819
|
+
* Returns gas estimate and result without sending transaction
|
|
820
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
821
|
+
*/
|
|
822
|
+
async changeRequirement(_required, options) {
|
|
823
|
+
return contract.simulate.changeRequirement([_required], options);
|
|
824
|
+
},
|
|
825
|
+
/**
|
|
826
|
+
* Simulate confirmTransaction
|
|
827
|
+
* Returns gas estimate and result without sending transaction
|
|
828
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
829
|
+
*/
|
|
830
|
+
async confirmTransaction(transactionId, options) {
|
|
831
|
+
return contract.simulate.confirmTransaction([transactionId], options);
|
|
832
|
+
},
|
|
833
|
+
/**
|
|
834
|
+
* Simulate submitTransaction
|
|
835
|
+
* Returns gas estimate and result without sending transaction
|
|
836
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
837
|
+
*/
|
|
838
|
+
async submitTransaction(destination, value, data, options) {
|
|
839
|
+
return contract.simulate.submitTransaction([destination, value, data], options);
|
|
840
|
+
},
|
|
841
|
+
/**
|
|
842
|
+
* Simulate replaceOwner
|
|
843
|
+
* Returns gas estimate and result without sending transaction
|
|
844
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
845
|
+
*/
|
|
846
|
+
async replaceOwner(owner, newOwner, options) {
|
|
847
|
+
return contract.simulate.replaceOwner([owner, newOwner], options);
|
|
848
|
+
},
|
|
849
|
+
/**
|
|
850
|
+
* Simulate executeTransaction
|
|
851
|
+
* Returns gas estimate and result without sending transaction
|
|
852
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
853
|
+
*/
|
|
854
|
+
async executeTransaction(transactionId, options) {
|
|
855
|
+
return contract.simulate.executeTransaction([transactionId], options);
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* Watch contract events
|
|
861
|
+
*
|
|
862
|
+
* @example
|
|
863
|
+
* // Watch all Transfer events
|
|
864
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
865
|
+
* console.log('Transfer:', event);
|
|
866
|
+
* });
|
|
867
|
+
*
|
|
868
|
+
* // Stop watching
|
|
869
|
+
* unwatch();
|
|
870
|
+
*/
|
|
871
|
+
get watch() {
|
|
872
|
+
return {
|
|
873
|
+
/**
|
|
874
|
+
* Watch Confirmation events
|
|
875
|
+
* @param callback Function to call when event is emitted
|
|
876
|
+
* @param filter Optional filter for indexed parameters
|
|
877
|
+
* @returns Unwatch function to stop listening
|
|
878
|
+
*/
|
|
879
|
+
Confirmation: (callback, filter) => {
|
|
880
|
+
return this.publicClient.watchContractEvent({
|
|
881
|
+
address: this.contractAddress,
|
|
882
|
+
abi: exports.MultiSigWallet_jsonAbi,
|
|
883
|
+
eventName: 'Confirmation',
|
|
884
|
+
args: filter,
|
|
885
|
+
onLogs: (logs) => {
|
|
886
|
+
logs.forEach((log) => {
|
|
887
|
+
callback(log.args);
|
|
888
|
+
});
|
|
889
|
+
},
|
|
890
|
+
});
|
|
891
|
+
},
|
|
892
|
+
/**
|
|
893
|
+
* Watch Revocation events
|
|
894
|
+
* @param callback Function to call when event is emitted
|
|
895
|
+
* @param filter Optional filter for indexed parameters
|
|
896
|
+
* @returns Unwatch function to stop listening
|
|
897
|
+
*/
|
|
898
|
+
Revocation: (callback, filter) => {
|
|
899
|
+
return this.publicClient.watchContractEvent({
|
|
900
|
+
address: this.contractAddress,
|
|
901
|
+
abi: exports.MultiSigWallet_jsonAbi,
|
|
902
|
+
eventName: 'Revocation',
|
|
903
|
+
args: filter,
|
|
904
|
+
onLogs: (logs) => {
|
|
905
|
+
logs.forEach((log) => {
|
|
906
|
+
callback(log.args);
|
|
907
|
+
});
|
|
908
|
+
},
|
|
909
|
+
});
|
|
910
|
+
},
|
|
911
|
+
/**
|
|
912
|
+
* Watch Submission events
|
|
913
|
+
* @param callback Function to call when event is emitted
|
|
914
|
+
* @param filter Optional filter for indexed parameters
|
|
915
|
+
* @returns Unwatch function to stop listening
|
|
916
|
+
*/
|
|
917
|
+
Submission: (callback, filter) => {
|
|
918
|
+
return this.publicClient.watchContractEvent({
|
|
919
|
+
address: this.contractAddress,
|
|
920
|
+
abi: exports.MultiSigWallet_jsonAbi,
|
|
921
|
+
eventName: 'Submission',
|
|
922
|
+
args: filter,
|
|
923
|
+
onLogs: (logs) => {
|
|
924
|
+
logs.forEach((log) => {
|
|
925
|
+
callback(log.args);
|
|
926
|
+
});
|
|
927
|
+
},
|
|
928
|
+
});
|
|
929
|
+
},
|
|
930
|
+
/**
|
|
931
|
+
* Watch Execution events
|
|
932
|
+
* @param callback Function to call when event is emitted
|
|
933
|
+
* @param filter Optional filter for indexed parameters
|
|
934
|
+
* @returns Unwatch function to stop listening
|
|
935
|
+
*/
|
|
936
|
+
Execution: (callback, filter) => {
|
|
937
|
+
return this.publicClient.watchContractEvent({
|
|
938
|
+
address: this.contractAddress,
|
|
939
|
+
abi: exports.MultiSigWallet_jsonAbi,
|
|
940
|
+
eventName: 'Execution',
|
|
941
|
+
args: filter,
|
|
942
|
+
onLogs: (logs) => {
|
|
943
|
+
logs.forEach((log) => {
|
|
944
|
+
callback(log.args);
|
|
945
|
+
});
|
|
946
|
+
},
|
|
947
|
+
});
|
|
948
|
+
},
|
|
949
|
+
/**
|
|
950
|
+
* Watch ExecutionFailure events
|
|
951
|
+
* @param callback Function to call when event is emitted
|
|
952
|
+
* @param filter Optional filter for indexed parameters
|
|
953
|
+
* @returns Unwatch function to stop listening
|
|
954
|
+
*/
|
|
955
|
+
ExecutionFailure: (callback, filter) => {
|
|
956
|
+
return this.publicClient.watchContractEvent({
|
|
957
|
+
address: this.contractAddress,
|
|
958
|
+
abi: exports.MultiSigWallet_jsonAbi,
|
|
959
|
+
eventName: 'ExecutionFailure',
|
|
960
|
+
args: filter,
|
|
961
|
+
onLogs: (logs) => {
|
|
962
|
+
logs.forEach((log) => {
|
|
963
|
+
callback(log.args);
|
|
964
|
+
});
|
|
965
|
+
},
|
|
966
|
+
});
|
|
967
|
+
},
|
|
968
|
+
/**
|
|
969
|
+
* Watch Deposit events
|
|
970
|
+
* @param callback Function to call when event is emitted
|
|
971
|
+
* @param filter Optional filter for indexed parameters
|
|
972
|
+
* @returns Unwatch function to stop listening
|
|
973
|
+
*/
|
|
974
|
+
Deposit: (callback, filter) => {
|
|
975
|
+
return this.publicClient.watchContractEvent({
|
|
976
|
+
address: this.contractAddress,
|
|
977
|
+
abi: exports.MultiSigWallet_jsonAbi,
|
|
978
|
+
eventName: 'Deposit',
|
|
979
|
+
args: filter,
|
|
980
|
+
onLogs: (logs) => {
|
|
981
|
+
logs.forEach((log) => {
|
|
982
|
+
callback(log.args);
|
|
983
|
+
});
|
|
984
|
+
},
|
|
985
|
+
});
|
|
986
|
+
},
|
|
987
|
+
/**
|
|
988
|
+
* Watch OwnerAddition events
|
|
989
|
+
* @param callback Function to call when event is emitted
|
|
990
|
+
* @param filter Optional filter for indexed parameters
|
|
991
|
+
* @returns Unwatch function to stop listening
|
|
992
|
+
*/
|
|
993
|
+
OwnerAddition: (callback, filter) => {
|
|
994
|
+
return this.publicClient.watchContractEvent({
|
|
995
|
+
address: this.contractAddress,
|
|
996
|
+
abi: exports.MultiSigWallet_jsonAbi,
|
|
997
|
+
eventName: 'OwnerAddition',
|
|
998
|
+
args: filter,
|
|
999
|
+
onLogs: (logs) => {
|
|
1000
|
+
logs.forEach((log) => {
|
|
1001
|
+
callback(log.args);
|
|
1002
|
+
});
|
|
1003
|
+
},
|
|
1004
|
+
});
|
|
1005
|
+
},
|
|
1006
|
+
/**
|
|
1007
|
+
* Watch OwnerRemoval events
|
|
1008
|
+
* @param callback Function to call when event is emitted
|
|
1009
|
+
* @param filter Optional filter for indexed parameters
|
|
1010
|
+
* @returns Unwatch function to stop listening
|
|
1011
|
+
*/
|
|
1012
|
+
OwnerRemoval: (callback, filter) => {
|
|
1013
|
+
return this.publicClient.watchContractEvent({
|
|
1014
|
+
address: this.contractAddress,
|
|
1015
|
+
abi: exports.MultiSigWallet_jsonAbi,
|
|
1016
|
+
eventName: 'OwnerRemoval',
|
|
1017
|
+
args: filter,
|
|
1018
|
+
onLogs: (logs) => {
|
|
1019
|
+
logs.forEach((log) => {
|
|
1020
|
+
callback(log.args);
|
|
1021
|
+
});
|
|
1022
|
+
},
|
|
1023
|
+
});
|
|
1024
|
+
},
|
|
1025
|
+
/**
|
|
1026
|
+
* Watch RequirementChange events
|
|
1027
|
+
* @param callback Function to call when event is emitted
|
|
1028
|
+
* @param filter Optional filter for indexed parameters
|
|
1029
|
+
* @returns Unwatch function to stop listening
|
|
1030
|
+
*/
|
|
1031
|
+
RequirementChange: (callback) => {
|
|
1032
|
+
return this.publicClient.watchContractEvent({
|
|
1033
|
+
address: this.contractAddress,
|
|
1034
|
+
abi: exports.MultiSigWallet_jsonAbi,
|
|
1035
|
+
eventName: 'RequirementChange',
|
|
1036
|
+
onLogs: (logs) => {
|
|
1037
|
+
logs.forEach((log) => {
|
|
1038
|
+
callback(log.args);
|
|
1039
|
+
});
|
|
1040
|
+
},
|
|
1041
|
+
});
|
|
1042
|
+
}
|
|
1043
|
+
};
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
exports.MultiSigWallet_json = MultiSigWallet_json;
|