@gitmyabi/basewallet 1.0.1 → 1.0.3

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.
@@ -9,175 +9,91 @@ const viem_1 = require("viem");
9
9
  */
10
10
  exports.BaseWallet_jsonAbi = [
11
11
  {
12
- "anonymous": false,
12
+ "constant": false,
13
13
  "inputs": [
14
14
  {
15
- "indexed": true,
16
- "internalType": "address",
17
- "name": "module",
15
+ "name": "_newOwner",
18
16
  "type": "address"
19
- },
20
- {
21
- "indexed": false,
22
- "internalType": "bool",
23
- "name": "value",
24
- "type": "bool"
25
17
  }
26
18
  ],
27
- "name": "AuthorisedModule",
28
- "type": "event"
19
+ "name": "setOwner",
20
+ "outputs": [],
21
+ "payable": false,
22
+ "stateMutability": "nonpayable",
23
+ "type": "function"
29
24
  },
30
25
  {
31
- "anonymous": false,
26
+ "constant": false,
32
27
  "inputs": [
33
28
  {
34
- "indexed": true,
35
- "internalType": "address",
36
- "name": "module",
29
+ "name": "_module",
37
30
  "type": "address"
38
31
  },
39
32
  {
40
- "indexed": true,
41
- "internalType": "bytes4",
42
- "name": "method",
33
+ "name": "_method",
43
34
  "type": "bytes4"
44
35
  }
45
36
  ],
46
- "name": "EnabledStaticCall",
47
- "type": "event"
48
- },
49
- {
50
- "anonymous": false,
51
- "inputs": [
52
- {
53
- "indexed": true,
54
- "internalType": "address",
55
- "name": "module",
56
- "type": "address"
57
- },
58
- {
59
- "indexed": true,
60
- "internalType": "address",
61
- "name": "target",
62
- "type": "address"
63
- },
64
- {
65
- "indexed": true,
66
- "internalType": "uint256",
67
- "name": "value",
68
- "type": "uint256"
69
- },
70
- {
71
- "indexed": false,
72
- "internalType": "bytes",
73
- "name": "data",
74
- "type": "bytes"
75
- }
76
- ],
77
- "name": "Invoked",
78
- "type": "event"
79
- },
80
- {
81
- "anonymous": false,
82
- "inputs": [
83
- {
84
- "indexed": false,
85
- "internalType": "address",
86
- "name": "owner",
87
- "type": "address"
88
- }
89
- ],
90
- "name": "OwnerChanged",
91
- "type": "event"
92
- },
93
- {
94
- "anonymous": false,
95
- "inputs": [
96
- {
97
- "indexed": true,
98
- "internalType": "uint256",
99
- "name": "value",
100
- "type": "uint256"
101
- },
102
- {
103
- "indexed": true,
104
- "internalType": "address",
105
- "name": "sender",
106
- "type": "address"
107
- },
108
- {
109
- "indexed": false,
110
- "internalType": "bytes",
111
- "name": "data",
112
- "type": "bytes"
113
- }
114
- ],
115
- "name": "Received",
116
- "type": "event"
117
- },
118
- {
119
- "stateMutability": "payable",
120
- "type": "fallback"
37
+ "name": "enableStaticCall",
38
+ "outputs": [],
39
+ "payable": false,
40
+ "stateMutability": "nonpayable",
41
+ "type": "function"
121
42
  },
122
43
  {
44
+ "constant": false,
123
45
  "inputs": [
124
46
  {
125
- "internalType": "address",
126
47
  "name": "_module",
127
48
  "type": "address"
128
49
  },
129
50
  {
130
- "internalType": "bool",
131
51
  "name": "_value",
132
52
  "type": "bool"
133
53
  }
134
54
  ],
135
55
  "name": "authoriseModule",
136
56
  "outputs": [],
57
+ "payable": false,
137
58
  "stateMutability": "nonpayable",
138
59
  "type": "function"
139
60
  },
140
61
  {
62
+ "constant": false,
141
63
  "inputs": [
142
64
  {
143
- "internalType": "address",
144
- "name": "",
65
+ "name": "_owner",
145
66
  "type": "address"
146
- }
147
- ],
148
- "name": "authorised",
149
- "outputs": [
67
+ },
150
68
  {
151
- "internalType": "bool",
152
- "name": "",
153
- "type": "bool"
69
+ "name": "_modules",
70
+ "type": "address[]"
154
71
  }
155
72
  ],
156
- "stateMutability": "view",
73
+ "name": "init",
74
+ "outputs": [],
75
+ "payable": false,
76
+ "stateMutability": "nonpayable",
157
77
  "type": "function"
158
78
  },
159
79
  {
160
- "inputs": [
80
+ "constant": true,
81
+ "inputs": [],
82
+ "name": "implementation",
83
+ "outputs": [
161
84
  {
162
- "internalType": "address",
163
- "name": "_module",
85
+ "name": "",
164
86
  "type": "address"
165
- },
166
- {
167
- "internalType": "bytes4",
168
- "name": "_method",
169
- "type": "bytes4"
170
87
  }
171
88
  ],
172
- "name": "enableStaticCall",
173
- "outputs": [],
174
- "stateMutability": "nonpayable",
89
+ "payable": false,
90
+ "stateMutability": "view",
175
91
  "type": "function"
176
92
  },
177
93
  {
94
+ "constant": true,
178
95
  "inputs": [
179
96
  {
180
- "internalType": "bytes4",
181
97
  "name": "",
182
98
  "type": "bytes4"
183
99
  }
@@ -185,59 +101,40 @@ exports.BaseWallet_jsonAbi = [
185
101
  "name": "enabled",
186
102
  "outputs": [
187
103
  {
188
- "internalType": "address",
189
104
  "name": "",
190
105
  "type": "address"
191
106
  }
192
107
  ],
108
+ "payable": false,
193
109
  "stateMutability": "view",
194
110
  "type": "function"
195
111
  },
196
112
  {
113
+ "constant": true,
197
114
  "inputs": [],
198
- "name": "implementation",
115
+ "name": "owner",
199
116
  "outputs": [
200
117
  {
201
- "internalType": "address",
202
118
  "name": "",
203
119
  "type": "address"
204
120
  }
205
121
  ],
122
+ "payable": false,
206
123
  "stateMutability": "view",
207
124
  "type": "function"
208
125
  },
209
126
  {
127
+ "constant": false,
210
128
  "inputs": [
211
129
  {
212
- "internalType": "address",
213
- "name": "_owner",
214
- "type": "address"
215
- },
216
- {
217
- "internalType": "address[]",
218
- "name": "_modules",
219
- "type": "address[]"
220
- }
221
- ],
222
- "name": "init",
223
- "outputs": [],
224
- "stateMutability": "nonpayable",
225
- "type": "function"
226
- },
227
- {
228
- "inputs": [
229
- {
230
- "internalType": "address",
231
130
  "name": "_target",
232
131
  "type": "address"
233
132
  },
234
133
  {
235
- "internalType": "uint256",
236
134
  "name": "_value",
237
135
  "type": "uint256"
238
136
  },
239
137
  {
240
- "internalType": "bytes",
241
138
  "name": "_data",
242
139
  "type": "bytes"
243
140
  }
@@ -245,56 +142,146 @@ exports.BaseWallet_jsonAbi = [
245
142
  "name": "invoke",
246
143
  "outputs": [
247
144
  {
248
- "internalType": "bytes",
249
145
  "name": "_result",
250
146
  "type": "bytes"
251
147
  }
252
148
  ],
149
+ "payable": false,
253
150
  "stateMutability": "nonpayable",
254
151
  "type": "function"
255
152
  },
256
153
  {
257
- "inputs": [],
258
- "name": "modules",
154
+ "constant": true,
155
+ "inputs": [
156
+ {
157
+ "name": "",
158
+ "type": "address"
159
+ }
160
+ ],
161
+ "name": "authorised",
259
162
  "outputs": [
260
163
  {
261
- "internalType": "uint256",
262
164
  "name": "",
263
- "type": "uint256"
165
+ "type": "bool"
264
166
  }
265
167
  ],
168
+ "payable": false,
266
169
  "stateMutability": "view",
267
170
  "type": "function"
268
171
  },
269
172
  {
173
+ "constant": true,
270
174
  "inputs": [],
271
- "name": "owner",
175
+ "name": "modules",
272
176
  "outputs": [
273
177
  {
274
- "internalType": "address",
275
178
  "name": "",
276
- "type": "address"
179
+ "type": "uint256"
277
180
  }
278
181
  ],
182
+ "payable": false,
279
183
  "stateMutability": "view",
280
184
  "type": "function"
281
185
  },
282
186
  {
187
+ "payable": true,
188
+ "stateMutability": "payable",
189
+ "type": "fallback"
190
+ },
191
+ {
192
+ "anonymous": false,
283
193
  "inputs": [
284
194
  {
285
- "internalType": "address",
286
- "name": "_newOwner",
195
+ "indexed": true,
196
+ "name": "module",
287
197
  "type": "address"
198
+ },
199
+ {
200
+ "indexed": false,
201
+ "name": "value",
202
+ "type": "bool"
288
203
  }
289
204
  ],
290
- "name": "setOwner",
291
- "outputs": [],
292
- "stateMutability": "nonpayable",
293
- "type": "function"
205
+ "name": "AuthorisedModule",
206
+ "type": "event"
294
207
  },
295
208
  {
296
- "stateMutability": "payable",
297
- "type": "receive"
209
+ "anonymous": false,
210
+ "inputs": [
211
+ {
212
+ "indexed": true,
213
+ "name": "module",
214
+ "type": "address"
215
+ },
216
+ {
217
+ "indexed": true,
218
+ "name": "method",
219
+ "type": "bytes4"
220
+ }
221
+ ],
222
+ "name": "EnabledStaticCall",
223
+ "type": "event"
224
+ },
225
+ {
226
+ "anonymous": false,
227
+ "inputs": [
228
+ {
229
+ "indexed": true,
230
+ "name": "module",
231
+ "type": "address"
232
+ },
233
+ {
234
+ "indexed": true,
235
+ "name": "target",
236
+ "type": "address"
237
+ },
238
+ {
239
+ "indexed": true,
240
+ "name": "value",
241
+ "type": "uint256"
242
+ },
243
+ {
244
+ "indexed": false,
245
+ "name": "data",
246
+ "type": "bytes"
247
+ }
248
+ ],
249
+ "name": "Invoked",
250
+ "type": "event"
251
+ },
252
+ {
253
+ "anonymous": false,
254
+ "inputs": [
255
+ {
256
+ "indexed": true,
257
+ "name": "value",
258
+ "type": "uint256"
259
+ },
260
+ {
261
+ "indexed": true,
262
+ "name": "sender",
263
+ "type": "address"
264
+ },
265
+ {
266
+ "indexed": false,
267
+ "name": "data",
268
+ "type": "bytes"
269
+ }
270
+ ],
271
+ "name": "Received",
272
+ "type": "event"
273
+ },
274
+ {
275
+ "anonymous": false,
276
+ "inputs": [
277
+ {
278
+ "indexed": false,
279
+ "name": "owner",
280
+ "type": "address"
281
+ }
282
+ ],
283
+ "name": "OwnerChanged",
284
+ "type": "event"
298
285
  }
299
286
  ];
300
287
  /**
@@ -355,11 +342,11 @@ class BaseWallet_json {
355
342
  return this.contract;
356
343
  }
357
344
  /**
358
- * authorised
345
+ * implementation
359
346
  * view
360
347
  */
361
- async authorised(arg0) {
362
- return this.contract.read.authorised([arg0]);
348
+ async implementation() {
349
+ return this.contract.read.implementation();
363
350
  }
364
351
  /**
365
352
  * enabled
@@ -369,36 +356,36 @@ class BaseWallet_json {
369
356
  return this.contract.read.enabled([arg0]);
370
357
  }
371
358
  /**
372
- * implementation
359
+ * owner
373
360
  * view
374
361
  */
375
- async implementation() {
376
- return this.contract.read.implementation();
362
+ async owner() {
363
+ return this.contract.read.owner();
377
364
  }
378
365
  /**
379
- * modules
366
+ * authorised
380
367
  * view
381
368
  */
382
- async modules() {
383
- return this.contract.read.modules();
369
+ async authorised(arg0) {
370
+ return this.contract.read.authorised([arg0]);
384
371
  }
385
372
  /**
386
- * owner
373
+ * modules
387
374
  * view
388
375
  */
389
- async owner() {
390
- return this.contract.read.owner();
376
+ async modules() {
377
+ return this.contract.read.modules();
391
378
  }
392
379
  /**
393
- * authoriseModule
380
+ * setOwner
394
381
  * nonpayable
395
382
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
396
383
  */
397
- async authoriseModule(_module, _value, options) {
384
+ async setOwner(_newOwner, options) {
398
385
  if (!this.contract.write) {
399
386
  throw new Error('Wallet client is required for write operations');
400
387
  }
401
- return this.contract.write.authoriseModule([_module, _value], options);
388
+ return this.contract.write.setOwner([_newOwner], options);
402
389
  }
403
390
  /**
404
391
  * enableStaticCall
@@ -412,37 +399,37 @@ class BaseWallet_json {
412
399
  return this.contract.write.enableStaticCall([_module, _method], options);
413
400
  }
414
401
  /**
415
- * init
402
+ * authoriseModule
416
403
  * nonpayable
417
404
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
418
405
  */
419
- async init(_owner, _modules, options) {
406
+ async authoriseModule(_module, _value, options) {
420
407
  if (!this.contract.write) {
421
408
  throw new Error('Wallet client is required for write operations');
422
409
  }
423
- return this.contract.write.init([_owner, _modules], options);
410
+ return this.contract.write.authoriseModule([_module, _value], options);
424
411
  }
425
412
  /**
426
- * invoke
413
+ * init
427
414
  * nonpayable
428
415
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
429
416
  */
430
- async invoke(_target, _value, _data, options) {
417
+ async init(_owner, _modules, options) {
431
418
  if (!this.contract.write) {
432
419
  throw new Error('Wallet client is required for write operations');
433
420
  }
434
- return this.contract.write.invoke([_target, _value, _data], options);
421
+ return this.contract.write.init([_owner, _modules], options);
435
422
  }
436
423
  /**
437
- * setOwner
424
+ * invoke
438
425
  * nonpayable
439
426
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
440
427
  */
441
- async setOwner(_newOwner, options) {
428
+ async invoke(_target, _value, _data, options) {
442
429
  if (!this.contract.write) {
443
430
  throw new Error('Wallet client is required for write operations');
444
431
  }
445
- return this.contract.write.setOwner([_newOwner], options);
432
+ return this.contract.write.invoke([_target, _value, _data], options);
446
433
  }
447
434
  /**
448
435
  * Simulate contract write operations (dry-run without sending transaction)
@@ -459,12 +446,12 @@ class BaseWallet_json {
459
446
  }
460
447
  return {
461
448
  /**
462
- * Simulate authoriseModule
449
+ * Simulate setOwner
463
450
  * Returns gas estimate and result without sending transaction
464
451
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
465
452
  */
466
- async authoriseModule(_module, _value, options) {
467
- return contract.simulate.authoriseModule([_module, _value], options);
453
+ async setOwner(_newOwner, options) {
454
+ return contract.simulate.setOwner([_newOwner], options);
468
455
  },
469
456
  /**
470
457
  * Simulate enableStaticCall
@@ -474,6 +461,14 @@ class BaseWallet_json {
474
461
  async enableStaticCall(_module, _method, options) {
475
462
  return contract.simulate.enableStaticCall([_module, _method], options);
476
463
  },
464
+ /**
465
+ * Simulate authoriseModule
466
+ * Returns gas estimate and result without sending transaction
467
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
468
+ */
469
+ async authoriseModule(_module, _value, options) {
470
+ return contract.simulate.authoriseModule([_module, _value], options);
471
+ },
477
472
  /**
478
473
  * Simulate init
479
474
  * Returns gas estimate and result without sending transaction
@@ -489,14 +484,6 @@ class BaseWallet_json {
489
484
  */
490
485
  async invoke(_target, _value, _data, options) {
491
486
  return contract.simulate.invoke([_target, _value, _data], options);
492
- },
493
- /**
494
- * Simulate setOwner
495
- * Returns gas estimate and result without sending transaction
496
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
497
- */
498
- async setOwner(_newOwner, options) {
499
- return contract.simulate.setOwner([_newOwner], options);
500
487
  }
501
488
  };
502
489
  }
@@ -572,16 +559,17 @@ class BaseWallet_json {
572
559
  });
573
560
  },
574
561
  /**
575
- * Watch OwnerChanged events
562
+ * Watch Received events
576
563
  * @param callback Function to call when event is emitted
577
564
  * @param filter Optional filter for indexed parameters
578
565
  * @returns Unwatch function to stop listening
579
566
  */
580
- OwnerChanged: (callback) => {
567
+ Received: (callback, filter) => {
581
568
  return this.publicClient.watchContractEvent({
582
569
  address: this.contractAddress,
583
570
  abi: exports.BaseWallet_jsonAbi,
584
- eventName: 'OwnerChanged',
571
+ eventName: 'Received',
572
+ args: filter,
585
573
  onLogs: (logs) => {
586
574
  logs.forEach((log) => {
587
575
  callback(log.args);
@@ -590,17 +578,16 @@ class BaseWallet_json {
590
578
  });
591
579
  },
592
580
  /**
593
- * Watch Received events
581
+ * Watch OwnerChanged events
594
582
  * @param callback Function to call when event is emitted
595
583
  * @param filter Optional filter for indexed parameters
596
584
  * @returns Unwatch function to stop listening
597
585
  */
598
- Received: (callback, filter) => {
586
+ OwnerChanged: (callback) => {
599
587
  return this.publicClient.watchContractEvent({
600
588
  address: this.contractAddress,
601
589
  abi: exports.BaseWallet_jsonAbi,
602
- eventName: 'Received',
603
- args: filter,
590
+ eventName: 'OwnerChanged',
604
591
  onLogs: (logs) => {
605
592
  logs.forEach((log) => {
606
593
  callback(log.args);