@gitmyabi/topup 1.0.9 → 1.0.11

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 CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Auto-generated TypeScript type bindings for **TopUp**
4
4
 
5
- - **Build ID**: `etherscan-topup-d9ab7add-1787018542929`
5
+ - **Build ID**: `etherscan-topup-64d332d6-1787482394160`
6
6
  - **Build Number**: 1
7
- - **Commit**: `ac1de40`
7
+ - **Commit**: `8eacf25`
8
8
  - **Branch**: `etherscan`
9
9
  - **Target**: `ethers-v6`
10
10
  - **Contracts**: 2
@@ -12,7 +12,7 @@ Auto-generated TypeScript type bindings for **TopUp**
12
12
  ## Installation
13
13
 
14
14
  ```bash
15
- npm install @gitmyabi/topup@1.0.9
15
+ npm install @gitmyabi/topup@1.0.11
16
16
  ```
17
17
 
18
18
  ## Usage
@@ -1,14 +1,18 @@
1
1
  import type { Address, PublicClient, WalletClient } from 'viem';
2
2
  /**
3
- * TopUp_json ABI
3
+ * TopUpV2_json ABI
4
4
  *
5
5
  * This ABI is typed using viem's type system for full type safety.
6
6
  */
7
- export declare const TopUp_jsonAbi: readonly [{
7
+ export declare const TopUpV2_jsonAbi: readonly [{
8
8
  readonly inputs: readonly [{
9
9
  readonly internalType: "address";
10
10
  readonly name: "_weth";
11
11
  readonly type: "address";
12
+ }, {
13
+ readonly internalType: "address";
14
+ readonly name: "_dispatcher";
15
+ readonly type: "address";
12
16
  }];
13
17
  readonly stateMutability: "nonpayable";
14
18
  readonly type: "constructor";
@@ -24,18 +28,34 @@ export declare const TopUp_jsonAbi: readonly [{
24
28
  readonly inputs: readonly [];
25
29
  readonly name: "InvalidAmount";
26
30
  readonly type: "error";
31
+ }, {
32
+ readonly inputs: readonly [];
33
+ readonly name: "InvalidRecipient";
34
+ readonly type: "error";
27
35
  }, {
28
36
  readonly inputs: readonly [];
29
37
  readonly name: "NewOwnerIsZeroAddress";
30
38
  readonly type: "error";
39
+ }, {
40
+ readonly inputs: readonly [];
41
+ readonly name: "NoBalanceToRecover";
42
+ readonly type: "error";
31
43
  }, {
32
44
  readonly inputs: readonly [];
33
45
  readonly name: "NoHandoverRequest";
34
46
  readonly type: "error";
47
+ }, {
48
+ readonly inputs: readonly [];
49
+ readonly name: "OnlyDispatcher";
50
+ readonly type: "error";
35
51
  }, {
36
52
  readonly inputs: readonly [];
37
53
  readonly name: "OnlyOwner";
38
54
  readonly type: "error";
55
+ }, {
56
+ readonly inputs: readonly [];
57
+ readonly name: "OnlyUnsupportedTokens";
58
+ readonly type: "error";
39
59
  }, {
40
60
  readonly inputs: readonly [{
41
61
  readonly internalType: "address";
@@ -48,6 +68,10 @@ export declare const TopUp_jsonAbi: readonly [{
48
68
  readonly inputs: readonly [];
49
69
  readonly name: "Unauthorized";
50
70
  readonly type: "error";
71
+ }, {
72
+ readonly inputs: readonly [];
73
+ readonly name: "WrapperNotSet";
74
+ readonly type: "error";
51
75
  }, {
52
76
  readonly anonymous: false;
53
77
  readonly inputs: readonly [{
@@ -98,6 +122,36 @@ export declare const TopUp_jsonAbi: readonly [{
98
122
  }];
99
123
  readonly name: "ProcessTopUp";
100
124
  readonly type: "event";
125
+ }, {
126
+ readonly anonymous: false;
127
+ readonly inputs: readonly [{
128
+ readonly indexed: true;
129
+ readonly internalType: "address";
130
+ readonly name: "token";
131
+ readonly type: "address";
132
+ }, {
133
+ readonly indexed: true;
134
+ readonly internalType: "address";
135
+ readonly name: "recipient";
136
+ readonly type: "address";
137
+ }, {
138
+ readonly indexed: false;
139
+ readonly internalType: "uint256";
140
+ readonly name: "amount";
141
+ readonly type: "uint256";
142
+ }];
143
+ readonly name: "RecoveryExecuted";
144
+ readonly type: "event";
145
+ }, {
146
+ readonly inputs: readonly [];
147
+ readonly name: "DISPATCHER";
148
+ readonly outputs: readonly [{
149
+ readonly internalType: "address";
150
+ readonly name: "";
151
+ readonly type: "address";
152
+ }];
153
+ readonly stateMutability: "view";
154
+ readonly type: "function";
101
155
  }, {
102
156
  readonly inputs: readonly [];
103
157
  readonly name: "ETH";
@@ -124,6 +178,20 @@ export declare const TopUp_jsonAbi: readonly [{
124
178
  readonly outputs: readonly [];
125
179
  readonly stateMutability: "payable";
126
180
  readonly type: "function";
181
+ }, {
182
+ readonly inputs: readonly [{
183
+ readonly internalType: "address";
184
+ readonly name: "token";
185
+ readonly type: "address";
186
+ }, {
187
+ readonly internalType: "address";
188
+ readonly name: "recipient";
189
+ readonly type: "address";
190
+ }];
191
+ readonly name: "executeRecovery";
192
+ readonly outputs: readonly [];
193
+ readonly stateMutability: "nonpayable";
194
+ readonly type: "function";
127
195
  }, {
128
196
  readonly inputs: readonly [{
129
197
  readonly internalType: "address";
@@ -218,20 +286,34 @@ export declare const TopUp_jsonAbi: readonly [{
218
286
  }];
219
287
  readonly stateMutability: "view";
220
288
  readonly type: "function";
289
+ }, {
290
+ readonly inputs: readonly [{
291
+ readonly internalType: "address";
292
+ readonly name: "token";
293
+ readonly type: "address";
294
+ }, {
295
+ readonly internalType: "uint256";
296
+ readonly name: "amount";
297
+ readonly type: "uint256";
298
+ }];
299
+ readonly name: "wrap";
300
+ readonly outputs: readonly [];
301
+ readonly stateMutability: "nonpayable";
302
+ readonly type: "function";
221
303
  }, {
222
304
  readonly stateMutability: "payable";
223
305
  readonly type: "receive";
224
306
  }];
225
307
  /**
226
- * Type-safe ABI for TopUp_json
308
+ * Type-safe ABI for TopUpV2_json
227
309
  */
228
- export type TopUp_jsonAbi = typeof TopUp_jsonAbi;
310
+ export type TopUpV2_jsonAbi = typeof TopUpV2_jsonAbi;
229
311
  /**
230
- * Contract instance type for TopUp_json
312
+ * Contract instance type for TopUpV2_json
231
313
  */
232
- export type TopUp_jsonContract = any;
314
+ export type TopUpV2_jsonContract = any;
233
315
  /**
234
- * TopUp_json Contract Class
316
+ * TopUpV2_json Contract Class
235
317
  *
236
318
  * Provides a class-based API similar to TypeChain for interacting with the contract.
237
319
  *
@@ -239,12 +321,12 @@ export type TopUp_jsonContract = any;
239
321
  * ```typescript
240
322
  * import { createPublicClient, createWalletClient, http } from 'viem';
241
323
  * import { mainnet } from 'viem/chains';
242
- * import { TopUp_json } from 'TopUp_json';
324
+ * import { TopUpV2_json } from 'TopUpV2_json';
243
325
  *
244
326
  * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
245
327
  * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
246
328
  *
247
- * const contract = new TopUp_json('0x...', { publicClient, walletClient });
329
+ * const contract = new TopUpV2_json('0x...', { publicClient, walletClient });
248
330
  *
249
331
  * // Read functions
250
332
  * const result = await contract.balanceOf('0x...');
@@ -262,7 +344,7 @@ export type TopUp_jsonContract = any;
262
344
  * });
263
345
  * ```
264
346
  */
265
- export declare class TopUp_json {
347
+ export declare class TopUpV2_json {
266
348
  private contract;
267
349
  private contractAddress;
268
350
  private publicClient;
@@ -277,7 +359,12 @@ export declare class TopUp_json {
277
359
  /**
278
360
  * Get the underlying viem contract instance
279
361
  */
280
- getContract(): TopUp_jsonContract;
362
+ getContract(): TopUpV2_jsonContract;
363
+ /**
364
+ * DISPATCHER
365
+ * view
366
+ */
367
+ DISPATCHER(): Promise<`0x${string}`>;
281
368
  /**
282
369
  * ETH
283
370
  * view
@@ -332,6 +419,23 @@ export declare class TopUp_json {
332
419
  nonce?: number;
333
420
  value?: bigint;
334
421
  }): Promise<`0x${string}`>;
422
+ /**
423
+ * executeRecovery
424
+ * nonpayable
425
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
426
+ */
427
+ executeRecovery(token: `0x${string}`, recipient: `0x${string}`, options?: {
428
+ accessList?: import('viem').AccessList;
429
+ authorizationList?: import('viem').AuthorizationList;
430
+ chain?: import('viem').Chain | null;
431
+ dataSuffix?: `0x${string}`;
432
+ gas?: bigint;
433
+ gasPrice?: bigint;
434
+ maxFeePerGas?: bigint;
435
+ maxPriorityFeePerGas?: bigint;
436
+ nonce?: number;
437
+ value?: bigint;
438
+ }): Promise<`0x${string}`>;
335
439
  /**
336
440
  * initialize
337
441
  * nonpayable
@@ -434,6 +538,23 @@ export declare class TopUp_json {
434
538
  nonce?: number;
435
539
  value?: bigint;
436
540
  }): Promise<`0x${string}`>;
541
+ /**
542
+ * wrap
543
+ * nonpayable
544
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
545
+ */
546
+ wrap(token: `0x${string}`, amount: bigint, options?: {
547
+ accessList?: import('viem').AccessList;
548
+ authorizationList?: import('viem').AuthorizationList;
549
+ chain?: import('viem').Chain | null;
550
+ dataSuffix?: `0x${string}`;
551
+ gas?: bigint;
552
+ gasPrice?: bigint;
553
+ maxFeePerGas?: bigint;
554
+ maxPriorityFeePerGas?: bigint;
555
+ nonce?: number;
556
+ value?: bigint;
557
+ }): Promise<`0x${string}`>;
437
558
  /**
438
559
  * Simulate contract write operations (dry-run without sending transaction)
439
560
  *
@@ -477,6 +598,23 @@ export declare class TopUp_json {
477
598
  nonce?: number;
478
599
  value?: bigint;
479
600
  }): Promise<void>;
601
+ /**
602
+ * Simulate executeRecovery
603
+ * Returns gas estimate and result without sending transaction
604
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
605
+ */
606
+ executeRecovery(token: `0x${string}`, recipient: `0x${string}`, options?: {
607
+ accessList?: import("viem").AccessList;
608
+ authorizationList?: import("viem").AuthorizationList;
609
+ chain?: import("viem").Chain | null;
610
+ dataSuffix?: `0x${string}`;
611
+ gas?: bigint;
612
+ gasPrice?: bigint;
613
+ maxFeePerGas?: bigint;
614
+ maxPriorityFeePerGas?: bigint;
615
+ nonce?: number;
616
+ value?: bigint;
617
+ }): Promise<void>;
480
618
  /**
481
619
  * Simulate initialize
482
620
  * Returns gas estimate and result without sending transaction
@@ -579,6 +717,23 @@ export declare class TopUp_json {
579
717
  nonce?: number;
580
718
  value?: bigint;
581
719
  }): Promise<void>;
720
+ /**
721
+ * Simulate wrap
722
+ * Returns gas estimate and result without sending transaction
723
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
724
+ */
725
+ wrap(token: `0x${string}`, amount: bigint, options?: {
726
+ accessList?: import("viem").AccessList;
727
+ authorizationList?: import("viem").AuthorizationList;
728
+ chain?: import("viem").Chain | null;
729
+ dataSuffix?: `0x${string}`;
730
+ gas?: bigint;
731
+ gasPrice?: bigint;
732
+ maxFeePerGas?: bigint;
733
+ maxPriorityFeePerGas?: bigint;
734
+ nonce?: number;
735
+ value?: bigint;
736
+ }): Promise<void>;
582
737
  };
583
738
  /**
584
739
  * Watch contract events
@@ -640,5 +795,19 @@ export declare class TopUp_json {
640
795
  }) => void, filter?: {
641
796
  token: `0x${string}`;
642
797
  }) => () => void;
798
+ /**
799
+ * Watch RecoveryExecuted events
800
+ * @param callback Function to call when event is emitted
801
+ * @param filter Optional filter for indexed parameters
802
+ * @returns Unwatch function to stop listening
803
+ */
804
+ RecoveryExecuted: (callback: (event: {
805
+ token: `0x${string}`;
806
+ recipient: `0x${string}`;
807
+ amount: bigint;
808
+ }) => void, filter?: {
809
+ token: `0x${string}`;
810
+ recipient: `0x${string}`;
811
+ }) => () => void;
643
812
  };
644
813
  }
@@ -1,19 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TopUp_json = exports.TopUp_jsonAbi = void 0;
3
+ exports.TopUpV2_json = exports.TopUpV2_jsonAbi = void 0;
4
4
  const viem_1 = require("viem");
5
5
  /**
6
- * TopUp_json ABI
6
+ * TopUpV2_json ABI
7
7
  *
8
8
  * This ABI is typed using viem's type system for full type safety.
9
9
  */
10
- exports.TopUp_jsonAbi = [
10
+ exports.TopUpV2_jsonAbi = [
11
11
  {
12
12
  "inputs": [
13
13
  {
14
14
  "internalType": "address",
15
15
  "name": "_weth",
16
16
  "type": "address"
17
+ },
18
+ {
19
+ "internalType": "address",
20
+ "name": "_dispatcher",
21
+ "type": "address"
17
22
  }
18
23
  ],
19
24
  "stateMutability": "nonpayable",
@@ -34,21 +39,41 @@ exports.TopUp_jsonAbi = [
34
39
  "name": "InvalidAmount",
35
40
  "type": "error"
36
41
  },
42
+ {
43
+ "inputs": [],
44
+ "name": "InvalidRecipient",
45
+ "type": "error"
46
+ },
37
47
  {
38
48
  "inputs": [],
39
49
  "name": "NewOwnerIsZeroAddress",
40
50
  "type": "error"
41
51
  },
52
+ {
53
+ "inputs": [],
54
+ "name": "NoBalanceToRecover",
55
+ "type": "error"
56
+ },
42
57
  {
43
58
  "inputs": [],
44
59
  "name": "NoHandoverRequest",
45
60
  "type": "error"
46
61
  },
62
+ {
63
+ "inputs": [],
64
+ "name": "OnlyDispatcher",
65
+ "type": "error"
66
+ },
47
67
  {
48
68
  "inputs": [],
49
69
  "name": "OnlyOwner",
50
70
  "type": "error"
51
71
  },
72
+ {
73
+ "inputs": [],
74
+ "name": "OnlyUnsupportedTokens",
75
+ "type": "error"
76
+ },
52
77
  {
53
78
  "inputs": [
54
79
  {
@@ -65,6 +90,11 @@ exports.TopUp_jsonAbi = [
65
90
  "name": "Unauthorized",
66
91
  "type": "error"
67
92
  },
93
+ {
94
+ "inputs": [],
95
+ "name": "WrapperNotSet",
96
+ "type": "error"
97
+ },
68
98
  {
69
99
  "anonymous": false,
70
100
  "inputs": [
@@ -129,6 +159,44 @@ exports.TopUp_jsonAbi = [
129
159
  "name": "ProcessTopUp",
130
160
  "type": "event"
131
161
  },
162
+ {
163
+ "anonymous": false,
164
+ "inputs": [
165
+ {
166
+ "indexed": true,
167
+ "internalType": "address",
168
+ "name": "token",
169
+ "type": "address"
170
+ },
171
+ {
172
+ "indexed": true,
173
+ "internalType": "address",
174
+ "name": "recipient",
175
+ "type": "address"
176
+ },
177
+ {
178
+ "indexed": false,
179
+ "internalType": "uint256",
180
+ "name": "amount",
181
+ "type": "uint256"
182
+ }
183
+ ],
184
+ "name": "RecoveryExecuted",
185
+ "type": "event"
186
+ },
187
+ {
188
+ "inputs": [],
189
+ "name": "DISPATCHER",
190
+ "outputs": [
191
+ {
192
+ "internalType": "address",
193
+ "name": "",
194
+ "type": "address"
195
+ }
196
+ ],
197
+ "stateMutability": "view",
198
+ "type": "function"
199
+ },
132
200
  {
133
201
  "inputs": [],
134
202
  "name": "ETH",
@@ -162,6 +230,24 @@ exports.TopUp_jsonAbi = [
162
230
  "stateMutability": "payable",
163
231
  "type": "function"
164
232
  },
233
+ {
234
+ "inputs": [
235
+ {
236
+ "internalType": "address",
237
+ "name": "token",
238
+ "type": "address"
239
+ },
240
+ {
241
+ "internalType": "address",
242
+ "name": "recipient",
243
+ "type": "address"
244
+ }
245
+ ],
246
+ "name": "executeRecovery",
247
+ "outputs": [],
248
+ "stateMutability": "nonpayable",
249
+ "type": "function"
250
+ },
165
251
  {
166
252
  "inputs": [
167
253
  {
@@ -283,13 +369,31 @@ exports.TopUp_jsonAbi = [
283
369
  "stateMutability": "view",
284
370
  "type": "function"
285
371
  },
372
+ {
373
+ "inputs": [
374
+ {
375
+ "internalType": "address",
376
+ "name": "token",
377
+ "type": "address"
378
+ },
379
+ {
380
+ "internalType": "uint256",
381
+ "name": "amount",
382
+ "type": "uint256"
383
+ }
384
+ ],
385
+ "name": "wrap",
386
+ "outputs": [],
387
+ "stateMutability": "nonpayable",
388
+ "type": "function"
389
+ },
286
390
  {
287
391
  "stateMutability": "payable",
288
392
  "type": "receive"
289
393
  }
290
394
  ];
291
395
  /**
292
- * TopUp_json Contract Class
396
+ * TopUpV2_json Contract Class
293
397
  *
294
398
  * Provides a class-based API similar to TypeChain for interacting with the contract.
295
399
  *
@@ -297,12 +401,12 @@ exports.TopUp_jsonAbi = [
297
401
  * ```typescript
298
402
  * import { createPublicClient, createWalletClient, http } from 'viem';
299
403
  * import { mainnet } from 'viem/chains';
300
- * import { TopUp_json } from 'TopUp_json';
404
+ * import { TopUpV2_json } from 'TopUpV2_json';
301
405
  *
302
406
  * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
303
407
  * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
304
408
  *
305
- * const contract = new TopUp_json('0x...', { publicClient, walletClient });
409
+ * const contract = new TopUpV2_json('0x...', { publicClient, walletClient });
306
410
  *
307
411
  * // Read functions
308
412
  * const result = await contract.balanceOf('0x...');
@@ -320,13 +424,13 @@ exports.TopUp_jsonAbi = [
320
424
  * });
321
425
  * ```
322
426
  */
323
- class TopUp_json {
427
+ class TopUpV2_json {
324
428
  constructor(address, clients) {
325
429
  this.contractAddress = address;
326
430
  this.publicClient = clients.publicClient;
327
431
  this.contract = (0, viem_1.getContract)({
328
432
  address,
329
- abi: exports.TopUp_jsonAbi,
433
+ abi: exports.TopUpV2_jsonAbi,
330
434
  client: {
331
435
  public: clients.publicClient,
332
436
  wallet: clients.walletClient,
@@ -345,6 +449,13 @@ class TopUp_json {
345
449
  getContract() {
346
450
  return this.contract;
347
451
  }
452
+ /**
453
+ * DISPATCHER
454
+ * view
455
+ */
456
+ async DISPATCHER() {
457
+ return this.contract.read.DISPATCHER();
458
+ }
348
459
  /**
349
460
  * ETH
350
461
  * view
@@ -395,6 +506,17 @@ class TopUp_json {
395
506
  }
396
507
  return this.contract.write.completeOwnershipHandover([pendingOwner], options);
397
508
  }
509
+ /**
510
+ * executeRecovery
511
+ * nonpayable
512
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
513
+ */
514
+ async executeRecovery(token, recipient, options) {
515
+ if (!this.contract.write) {
516
+ throw new Error('Wallet client is required for write operations');
517
+ }
518
+ return this.contract.write.executeRecovery([token, recipient], options);
519
+ }
398
520
  /**
399
521
  * initialize
400
522
  * nonpayable
@@ -461,6 +583,17 @@ class TopUp_json {
461
583
  }
462
584
  return this.contract.write.transferOwnership([newOwner], options);
463
585
  }
586
+ /**
587
+ * wrap
588
+ * nonpayable
589
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
590
+ */
591
+ async wrap(token, amount, options) {
592
+ if (!this.contract.write) {
593
+ throw new Error('Wallet client is required for write operations');
594
+ }
595
+ return this.contract.write.wrap([token, amount], options);
596
+ }
464
597
  /**
465
598
  * Simulate contract write operations (dry-run without sending transaction)
466
599
  *
@@ -491,6 +624,14 @@ class TopUp_json {
491
624
  async completeOwnershipHandover(pendingOwner, options) {
492
625
  return contract.simulate.completeOwnershipHandover([pendingOwner], options);
493
626
  },
627
+ /**
628
+ * Simulate executeRecovery
629
+ * Returns gas estimate and result without sending transaction
630
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
631
+ */
632
+ async executeRecovery(token, recipient, options) {
633
+ return contract.simulate.executeRecovery([token, recipient], options);
634
+ },
494
635
  /**
495
636
  * Simulate initialize
496
637
  * Returns gas estimate and result without sending transaction
@@ -538,6 +679,14 @@ class TopUp_json {
538
679
  */
539
680
  async transferOwnership(newOwner, options) {
540
681
  return contract.simulate.transferOwnership([newOwner], options);
682
+ },
683
+ /**
684
+ * Simulate wrap
685
+ * Returns gas estimate and result without sending transaction
686
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
687
+ */
688
+ async wrap(token, amount, options) {
689
+ return contract.simulate.wrap([token, amount], options);
541
690
  }
542
691
  };
543
692
  }
@@ -564,7 +713,7 @@ class TopUp_json {
564
713
  OwnershipHandoverCanceled: (callback, filter) => {
565
714
  return this.publicClient.watchContractEvent({
566
715
  address: this.contractAddress,
567
- abi: exports.TopUp_jsonAbi,
716
+ abi: exports.TopUpV2_jsonAbi,
568
717
  eventName: 'OwnershipHandoverCanceled',
569
718
  args: filter,
570
719
  onLogs: (logs) => {
@@ -583,7 +732,7 @@ class TopUp_json {
583
732
  OwnershipHandoverRequested: (callback, filter) => {
584
733
  return this.publicClient.watchContractEvent({
585
734
  address: this.contractAddress,
586
- abi: exports.TopUp_jsonAbi,
735
+ abi: exports.TopUpV2_jsonAbi,
587
736
  eventName: 'OwnershipHandoverRequested',
588
737
  args: filter,
589
738
  onLogs: (logs) => {
@@ -602,7 +751,7 @@ class TopUp_json {
602
751
  OwnershipTransferred: (callback, filter) => {
603
752
  return this.publicClient.watchContractEvent({
604
753
  address: this.contractAddress,
605
- abi: exports.TopUp_jsonAbi,
754
+ abi: exports.TopUpV2_jsonAbi,
606
755
  eventName: 'OwnershipTransferred',
607
756
  args: filter,
608
757
  onLogs: (logs) => {
@@ -621,7 +770,7 @@ class TopUp_json {
621
770
  ProcessTopUp: (callback, filter) => {
622
771
  return this.publicClient.watchContractEvent({
623
772
  address: this.contractAddress,
624
- abi: exports.TopUp_jsonAbi,
773
+ abi: exports.TopUpV2_jsonAbi,
625
774
  eventName: 'ProcessTopUp',
626
775
  args: filter,
627
776
  onLogs: (logs) => {
@@ -630,8 +779,27 @@ class TopUp_json {
630
779
  });
631
780
  },
632
781
  });
782
+ },
783
+ /**
784
+ * Watch RecoveryExecuted events
785
+ * @param callback Function to call when event is emitted
786
+ * @param filter Optional filter for indexed parameters
787
+ * @returns Unwatch function to stop listening
788
+ */
789
+ RecoveryExecuted: (callback, filter) => {
790
+ return this.publicClient.watchContractEvent({
791
+ address: this.contractAddress,
792
+ abi: exports.TopUpV2_jsonAbi,
793
+ eventName: 'RecoveryExecuted',
794
+ args: filter,
795
+ onLogs: (logs) => {
796
+ logs.forEach((log) => {
797
+ callback(log.args);
798
+ });
799
+ },
800
+ });
633
801
  }
634
802
  };
635
803
  }
636
804
  }
637
- exports.TopUp_json = TopUp_json;
805
+ exports.TopUpV2_json = TopUpV2_json;
@@ -2,17 +2,22 @@ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType }
2
2
  import { getContract } from 'viem';
3
3
 
4
4
  /**
5
- * TopUp_json ABI
5
+ * TopUpV2_json ABI
6
6
  *
7
7
  * This ABI is typed using viem's type system for full type safety.
8
8
  */
9
- export const TopUp_jsonAbi = [
9
+ export const TopUpV2_jsonAbi = [
10
10
  {
11
11
  "inputs": [
12
12
  {
13
13
  "internalType": "address",
14
14
  "name": "_weth",
15
15
  "type": "address"
16
+ },
17
+ {
18
+ "internalType": "address",
19
+ "name": "_dispatcher",
20
+ "type": "address"
16
21
  }
17
22
  ],
18
23
  "stateMutability": "nonpayable",
@@ -33,21 +38,41 @@ export const TopUp_jsonAbi = [
33
38
  "name": "InvalidAmount",
34
39
  "type": "error"
35
40
  },
41
+ {
42
+ "inputs": [],
43
+ "name": "InvalidRecipient",
44
+ "type": "error"
45
+ },
36
46
  {
37
47
  "inputs": [],
38
48
  "name": "NewOwnerIsZeroAddress",
39
49
  "type": "error"
40
50
  },
51
+ {
52
+ "inputs": [],
53
+ "name": "NoBalanceToRecover",
54
+ "type": "error"
55
+ },
41
56
  {
42
57
  "inputs": [],
43
58
  "name": "NoHandoverRequest",
44
59
  "type": "error"
45
60
  },
61
+ {
62
+ "inputs": [],
63
+ "name": "OnlyDispatcher",
64
+ "type": "error"
65
+ },
46
66
  {
47
67
  "inputs": [],
48
68
  "name": "OnlyOwner",
49
69
  "type": "error"
50
70
  },
71
+ {
72
+ "inputs": [],
73
+ "name": "OnlyUnsupportedTokens",
74
+ "type": "error"
75
+ },
51
76
  {
52
77
  "inputs": [
53
78
  {
@@ -64,6 +89,11 @@ export const TopUp_jsonAbi = [
64
89
  "name": "Unauthorized",
65
90
  "type": "error"
66
91
  },
92
+ {
93
+ "inputs": [],
94
+ "name": "WrapperNotSet",
95
+ "type": "error"
96
+ },
67
97
  {
68
98
  "anonymous": false,
69
99
  "inputs": [
@@ -128,6 +158,44 @@ export const TopUp_jsonAbi = [
128
158
  "name": "ProcessTopUp",
129
159
  "type": "event"
130
160
  },
161
+ {
162
+ "anonymous": false,
163
+ "inputs": [
164
+ {
165
+ "indexed": true,
166
+ "internalType": "address",
167
+ "name": "token",
168
+ "type": "address"
169
+ },
170
+ {
171
+ "indexed": true,
172
+ "internalType": "address",
173
+ "name": "recipient",
174
+ "type": "address"
175
+ },
176
+ {
177
+ "indexed": false,
178
+ "internalType": "uint256",
179
+ "name": "amount",
180
+ "type": "uint256"
181
+ }
182
+ ],
183
+ "name": "RecoveryExecuted",
184
+ "type": "event"
185
+ },
186
+ {
187
+ "inputs": [],
188
+ "name": "DISPATCHER",
189
+ "outputs": [
190
+ {
191
+ "internalType": "address",
192
+ "name": "",
193
+ "type": "address"
194
+ }
195
+ ],
196
+ "stateMutability": "view",
197
+ "type": "function"
198
+ },
131
199
  {
132
200
  "inputs": [],
133
201
  "name": "ETH",
@@ -161,6 +229,24 @@ export const TopUp_jsonAbi = [
161
229
  "stateMutability": "payable",
162
230
  "type": "function"
163
231
  },
232
+ {
233
+ "inputs": [
234
+ {
235
+ "internalType": "address",
236
+ "name": "token",
237
+ "type": "address"
238
+ },
239
+ {
240
+ "internalType": "address",
241
+ "name": "recipient",
242
+ "type": "address"
243
+ }
244
+ ],
245
+ "name": "executeRecovery",
246
+ "outputs": [],
247
+ "stateMutability": "nonpayable",
248
+ "type": "function"
249
+ },
164
250
  {
165
251
  "inputs": [
166
252
  {
@@ -282,6 +368,24 @@ export const TopUp_jsonAbi = [
282
368
  "stateMutability": "view",
283
369
  "type": "function"
284
370
  },
371
+ {
372
+ "inputs": [
373
+ {
374
+ "internalType": "address",
375
+ "name": "token",
376
+ "type": "address"
377
+ },
378
+ {
379
+ "internalType": "uint256",
380
+ "name": "amount",
381
+ "type": "uint256"
382
+ }
383
+ ],
384
+ "name": "wrap",
385
+ "outputs": [],
386
+ "stateMutability": "nonpayable",
387
+ "type": "function"
388
+ },
285
389
  {
286
390
  "stateMutability": "payable",
287
391
  "type": "receive"
@@ -289,19 +393,19 @@ export const TopUp_jsonAbi = [
289
393
  ] as const satisfies Abi;
290
394
 
291
395
  /**
292
- * Type-safe ABI for TopUp_json
396
+ * Type-safe ABI for TopUpV2_json
293
397
  */
294
- export type TopUp_jsonAbi = typeof TopUp_jsonAbi;
398
+ export type TopUpV2_jsonAbi = typeof TopUpV2_jsonAbi;
295
399
 
296
400
  /**
297
- * Contract instance type for TopUp_json
401
+ * Contract instance type for TopUpV2_json
298
402
  */
299
403
  // Use any for contract type to avoid complex viem type issues
300
404
  // The runtime behavior is type-safe through viem's ABI typing
301
- export type TopUp_jsonContract = any;
405
+ export type TopUpV2_jsonContract = any;
302
406
 
303
407
  /**
304
- * TopUp_json Contract Class
408
+ * TopUpV2_json Contract Class
305
409
  *
306
410
  * Provides a class-based API similar to TypeChain for interacting with the contract.
307
411
  *
@@ -309,12 +413,12 @@ export type TopUp_jsonContract = any;
309
413
  * ```typescript
310
414
  * import { createPublicClient, createWalletClient, http } from 'viem';
311
415
  * import { mainnet } from 'viem/chains';
312
- * import { TopUp_json } from 'TopUp_json';
416
+ * import { TopUpV2_json } from 'TopUpV2_json';
313
417
  *
314
418
  * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
315
419
  * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
316
420
  *
317
- * const contract = new TopUp_json('0x...', { publicClient, walletClient });
421
+ * const contract = new TopUpV2_json('0x...', { publicClient, walletClient });
318
422
  *
319
423
  * // Read functions
320
424
  * const result = await contract.balanceOf('0x...');
@@ -332,8 +436,8 @@ export type TopUp_jsonContract = any;
332
436
  * });
333
437
  * ```
334
438
  */
335
- export class TopUp_json {
336
- private contract: TopUp_jsonContract;
439
+ export class TopUpV2_json {
440
+ private contract: TopUpV2_jsonContract;
337
441
  private contractAddress: Address;
338
442
  private publicClient: PublicClient;
339
443
 
@@ -348,7 +452,7 @@ export class TopUp_json {
348
452
  this.publicClient = clients.publicClient;
349
453
  this.contract = getContract({
350
454
  address,
351
- abi: TopUp_jsonAbi,
455
+ abi: TopUpV2_jsonAbi,
352
456
  client: {
353
457
  public: clients.publicClient,
354
458
  wallet: clients.walletClient,
@@ -366,10 +470,18 @@ export class TopUp_json {
366
470
  /**
367
471
  * Get the underlying viem contract instance
368
472
  */
369
- getContract(): TopUp_jsonContract {
473
+ getContract(): TopUpV2_jsonContract {
370
474
  return this.contract;
371
475
  }
372
476
 
477
+ /**
478
+ * DISPATCHER
479
+ * view
480
+ */
481
+ async DISPATCHER(): Promise<`0x${string}`> {
482
+ return this.contract.read.DISPATCHER() as Promise<`0x${string}`>;
483
+ }
484
+
373
485
  /**
374
486
  * ETH
375
487
  * view
@@ -448,6 +560,29 @@ export class TopUp_json {
448
560
  return this.contract.write.completeOwnershipHandover([pendingOwner] as const, options) as Promise<`0x${string}`>;
449
561
  }
450
562
 
563
+ /**
564
+ * executeRecovery
565
+ * nonpayable
566
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
567
+ */
568
+ async executeRecovery(token: `0x${string}`, recipient: `0x${string}`, options?: {
569
+ accessList?: import('viem').AccessList;
570
+ authorizationList?: import('viem').AuthorizationList;
571
+ chain?: import('viem').Chain | null;
572
+ dataSuffix?: `0x${string}`;
573
+ gas?: bigint;
574
+ gasPrice?: bigint;
575
+ maxFeePerGas?: bigint;
576
+ maxPriorityFeePerGas?: bigint;
577
+ nonce?: number;
578
+ value?: bigint;
579
+ }): Promise<`0x${string}`> {
580
+ if (!this.contract.write) {
581
+ throw new Error('Wallet client is required for write operations');
582
+ }
583
+ return this.contract.write.executeRecovery([token, recipient] as const, options) as Promise<`0x${string}`>;
584
+ }
585
+
451
586
  /**
452
587
  * initialize
453
588
  * nonpayable
@@ -586,6 +721,29 @@ export class TopUp_json {
586
721
  return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
587
722
  }
588
723
 
724
+ /**
725
+ * wrap
726
+ * nonpayable
727
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
728
+ */
729
+ async wrap(token: `0x${string}`, amount: bigint, options?: {
730
+ accessList?: import('viem').AccessList;
731
+ authorizationList?: import('viem').AuthorizationList;
732
+ chain?: import('viem').Chain | null;
733
+ dataSuffix?: `0x${string}`;
734
+ gas?: bigint;
735
+ gasPrice?: bigint;
736
+ maxFeePerGas?: bigint;
737
+ maxPriorityFeePerGas?: bigint;
738
+ nonce?: number;
739
+ value?: bigint;
740
+ }): Promise<`0x${string}`> {
741
+ if (!this.contract.write) {
742
+ throw new Error('Wallet client is required for write operations');
743
+ }
744
+ return this.contract.write.wrap([token, amount] as const, options) as Promise<`0x${string}`>;
745
+ }
746
+
589
747
 
590
748
 
591
749
  /**
@@ -640,6 +798,25 @@ export class TopUp_json {
640
798
  }): Promise<void> {
641
799
  return contract.simulate.completeOwnershipHandover([pendingOwner] as const, options) as Promise<void>;
642
800
  },
801
+ /**
802
+ * Simulate executeRecovery
803
+ * Returns gas estimate and result without sending transaction
804
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
805
+ */
806
+ async executeRecovery(token: `0x${string}`, recipient: `0x${string}`, options?: {
807
+ accessList?: import('viem').AccessList;
808
+ authorizationList?: import('viem').AuthorizationList;
809
+ chain?: import('viem').Chain | null;
810
+ dataSuffix?: `0x${string}`;
811
+ gas?: bigint;
812
+ gasPrice?: bigint;
813
+ maxFeePerGas?: bigint;
814
+ maxPriorityFeePerGas?: bigint;
815
+ nonce?: number;
816
+ value?: bigint;
817
+ }): Promise<void> {
818
+ return contract.simulate.executeRecovery([token, recipient] as const, options) as Promise<void>;
819
+ },
643
820
  /**
644
821
  * Simulate initialize
645
822
  * Returns gas estimate and result without sending transaction
@@ -753,6 +930,25 @@ export class TopUp_json {
753
930
  value?: bigint;
754
931
  }): Promise<void> {
755
932
  return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
933
+ },
934
+ /**
935
+ * Simulate wrap
936
+ * Returns gas estimate and result without sending transaction
937
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
938
+ */
939
+ async wrap(token: `0x${string}`, amount: bigint, options?: {
940
+ accessList?: import('viem').AccessList;
941
+ authorizationList?: import('viem').AuthorizationList;
942
+ chain?: import('viem').Chain | null;
943
+ dataSuffix?: `0x${string}`;
944
+ gas?: bigint;
945
+ gasPrice?: bigint;
946
+ maxFeePerGas?: bigint;
947
+ maxPriorityFeePerGas?: bigint;
948
+ nonce?: number;
949
+ value?: bigint;
950
+ }): Promise<void> {
951
+ return contract.simulate.wrap([token, amount] as const, options) as Promise<void>;
756
952
  }
757
953
  };
758
954
  }
@@ -780,7 +976,7 @@ export class TopUp_json {
780
976
  OwnershipHandoverCanceled: (callback: (event: { pendingOwner: `0x${string}` }) => void, filter?: { pendingOwner: `0x${string}` }) => {
781
977
  return this.publicClient.watchContractEvent({
782
978
  address: this.contractAddress,
783
- abi: TopUp_jsonAbi,
979
+ abi: TopUpV2_jsonAbi,
784
980
  eventName: 'OwnershipHandoverCanceled',
785
981
  args: filter,
786
982
  onLogs: (logs: any[]) => {
@@ -799,7 +995,7 @@ export class TopUp_json {
799
995
  OwnershipHandoverRequested: (callback: (event: { pendingOwner: `0x${string}` }) => void, filter?: { pendingOwner: `0x${string}` }) => {
800
996
  return this.publicClient.watchContractEvent({
801
997
  address: this.contractAddress,
802
- abi: TopUp_jsonAbi,
998
+ abi: TopUpV2_jsonAbi,
803
999
  eventName: 'OwnershipHandoverRequested',
804
1000
  args: filter,
805
1001
  onLogs: (logs: any[]) => {
@@ -818,7 +1014,7 @@ export class TopUp_json {
818
1014
  OwnershipTransferred: (callback: (event: { oldOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { oldOwner: `0x${string}`; newOwner: `0x${string}` }) => {
819
1015
  return this.publicClient.watchContractEvent({
820
1016
  address: this.contractAddress,
821
- abi: TopUp_jsonAbi,
1017
+ abi: TopUpV2_jsonAbi,
822
1018
  eventName: 'OwnershipTransferred',
823
1019
  args: filter,
824
1020
  onLogs: (logs: any[]) => {
@@ -837,7 +1033,7 @@ export class TopUp_json {
837
1033
  ProcessTopUp: (callback: (event: { token: `0x${string}`; amount: bigint }) => void, filter?: { token: `0x${string}` }) => {
838
1034
  return this.publicClient.watchContractEvent({
839
1035
  address: this.contractAddress,
840
- abi: TopUp_jsonAbi,
1036
+ abi: TopUpV2_jsonAbi,
841
1037
  eventName: 'ProcessTopUp',
842
1038
  args: filter,
843
1039
  onLogs: (logs: any[]) => {
@@ -846,6 +1042,25 @@ export class TopUp_json {
846
1042
  });
847
1043
  },
848
1044
  }) as () => void;
1045
+ },
1046
+ /**
1047
+ * Watch RecoveryExecuted events
1048
+ * @param callback Function to call when event is emitted
1049
+ * @param filter Optional filter for indexed parameters
1050
+ * @returns Unwatch function to stop listening
1051
+ */
1052
+ RecoveryExecuted: (callback: (event: { token: `0x${string}`; recipient: `0x${string}`; amount: bigint }) => void, filter?: { token: `0x${string}`; recipient: `0x${string}` }) => {
1053
+ return this.publicClient.watchContractEvent({
1054
+ address: this.contractAddress,
1055
+ abi: TopUpV2_jsonAbi,
1056
+ eventName: 'RecoveryExecuted',
1057
+ args: filter,
1058
+ onLogs: (logs: any[]) => {
1059
+ logs.forEach((log: any) => {
1060
+ callback(log.args as any);
1061
+ });
1062
+ },
1063
+ }) as () => void;
849
1064
  }
850
1065
  };
851
1066
  }
@@ -1,4 +1,4 @@
1
1
  export { BeaconProxy_jsonAbi, BeaconProxy_json } from './BeaconProxy_json';
2
2
  export type { BeaconProxy_jsonAbi as BeaconProxy_jsonAbiType, BeaconProxy_jsonContract } from './BeaconProxy_json';
3
- export { TopUp_jsonAbi, TopUp_json } from './TopUp_json';
4
- export type { TopUp_jsonAbi as TopUp_jsonAbiType, TopUp_jsonContract } from './TopUp_json';
3
+ export { TopUpV2_jsonAbi, TopUpV2_json } from './TopUpV2_json';
4
+ export type { TopUpV2_jsonAbi as TopUpV2_jsonAbiType, TopUpV2_jsonContract } from './TopUpV2_json';
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TopUp_json = exports.TopUp_jsonAbi = exports.BeaconProxy_json = exports.BeaconProxy_jsonAbi = void 0;
3
+ exports.TopUpV2_json = exports.TopUpV2_jsonAbi = exports.BeaconProxy_json = exports.BeaconProxy_jsonAbi = void 0;
4
4
  // Auto-generated exports for all contracts
5
5
  var BeaconProxy_json_1 = require("./BeaconProxy_json");
6
6
  Object.defineProperty(exports, "BeaconProxy_jsonAbi", { enumerable: true, get: function () { return BeaconProxy_json_1.BeaconProxy_jsonAbi; } });
7
7
  Object.defineProperty(exports, "BeaconProxy_json", { enumerable: true, get: function () { return BeaconProxy_json_1.BeaconProxy_json; } });
8
- var TopUp_json_1 = require("./TopUp_json");
9
- Object.defineProperty(exports, "TopUp_jsonAbi", { enumerable: true, get: function () { return TopUp_json_1.TopUp_jsonAbi; } });
10
- Object.defineProperty(exports, "TopUp_json", { enumerable: true, get: function () { return TopUp_json_1.TopUp_json; } });
8
+ var TopUpV2_json_1 = require("./TopUpV2_json");
9
+ Object.defineProperty(exports, "TopUpV2_jsonAbi", { enumerable: true, get: function () { return TopUpV2_json_1.TopUpV2_jsonAbi; } });
10
+ Object.defineProperty(exports, "TopUpV2_json", { enumerable: true, get: function () { return TopUpV2_json_1.TopUpV2_json; } });
@@ -1,5 +1,5 @@
1
1
  // Auto-generated exports for all contracts
2
2
  export { BeaconProxy_jsonAbi, BeaconProxy_json } from './BeaconProxy_json';
3
3
  export type { BeaconProxy_jsonAbi as BeaconProxy_jsonAbiType, BeaconProxy_jsonContract } from './BeaconProxy_json';
4
- export { TopUp_jsonAbi, TopUp_json } from './TopUp_json';
5
- export type { TopUp_jsonAbi as TopUp_jsonAbiType, TopUp_jsonContract } from './TopUp_json';
4
+ export { TopUpV2_jsonAbi, TopUpV2_json } from './TopUpV2_json';
5
+ export type { TopUpV2_jsonAbi as TopUpV2_jsonAbiType, TopUpV2_jsonContract } from './TopUpV2_json';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gitmyabi/topup",
3
- "version": "1.0.9",
4
- "description": "Auto-generated TypeScript type bindings for TopUp (build etherscan-topup-d9ab7add-1787018542929, commit ac1de40, branch etherscan)",
3
+ "version": "1.0.11",
4
+ "description": "Auto-generated TypeScript type bindings for TopUp (build etherscan-topup-64d332d6-1787482394160, commit 8eacf25, branch etherscan)",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
7
7
  "exports": {
@@ -39,5 +39,5 @@
39
39
  "url": "https://github.com/etherscan/topup"
40
40
  },
41
41
  "branch": "etherscan",
42
- "shortHash": "ac1de40"
42
+ "shortHash": "8eacf25"
43
43
  }