@gitmyabi/topup 1.0.9 → 1.0.10
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 +3 -3
- package/contracts/{TopUp_json.d.ts → TopUpV2_json.d.ts} +128 -11
- package/contracts/{TopUp_json.js → TopUpV2_json.js} +139 -13
- package/contracts/{TopUp_json.ts → TopUpV2_json.ts} +167 -17
- package/contracts/index.d.ts +2 -2
- package/contracts/index.js +4 -4
- package/contracts/index.ts +2 -2
- package/package.json +3 -3
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-
|
|
5
|
+
- **Build ID**: `etherscan-topup-7a9f8f6a-1787232291699`
|
|
6
6
|
- **Build Number**: 1
|
|
7
|
-
- **Commit**: `
|
|
7
|
+
- **Commit**: `36e82b0`
|
|
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.
|
|
15
|
+
npm install @gitmyabi/topup@1.0.10
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Usage
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import type { Address, PublicClient, WalletClient } from 'viem';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
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
|
|
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";
|
|
@@ -98,6 +118,36 @@ export declare const TopUp_jsonAbi: readonly [{
|
|
|
98
118
|
}];
|
|
99
119
|
readonly name: "ProcessTopUp";
|
|
100
120
|
readonly type: "event";
|
|
121
|
+
}, {
|
|
122
|
+
readonly anonymous: false;
|
|
123
|
+
readonly inputs: readonly [{
|
|
124
|
+
readonly indexed: true;
|
|
125
|
+
readonly internalType: "address";
|
|
126
|
+
readonly name: "token";
|
|
127
|
+
readonly type: "address";
|
|
128
|
+
}, {
|
|
129
|
+
readonly indexed: true;
|
|
130
|
+
readonly internalType: "address";
|
|
131
|
+
readonly name: "recipient";
|
|
132
|
+
readonly type: "address";
|
|
133
|
+
}, {
|
|
134
|
+
readonly indexed: false;
|
|
135
|
+
readonly internalType: "uint256";
|
|
136
|
+
readonly name: "amount";
|
|
137
|
+
readonly type: "uint256";
|
|
138
|
+
}];
|
|
139
|
+
readonly name: "RecoveryExecuted";
|
|
140
|
+
readonly type: "event";
|
|
141
|
+
}, {
|
|
142
|
+
readonly inputs: readonly [];
|
|
143
|
+
readonly name: "DISPATCHER";
|
|
144
|
+
readonly outputs: readonly [{
|
|
145
|
+
readonly internalType: "address";
|
|
146
|
+
readonly name: "";
|
|
147
|
+
readonly type: "address";
|
|
148
|
+
}];
|
|
149
|
+
readonly stateMutability: "view";
|
|
150
|
+
readonly type: "function";
|
|
101
151
|
}, {
|
|
102
152
|
readonly inputs: readonly [];
|
|
103
153
|
readonly name: "ETH";
|
|
@@ -124,6 +174,20 @@ export declare const TopUp_jsonAbi: readonly [{
|
|
|
124
174
|
readonly outputs: readonly [];
|
|
125
175
|
readonly stateMutability: "payable";
|
|
126
176
|
readonly type: "function";
|
|
177
|
+
}, {
|
|
178
|
+
readonly inputs: readonly [{
|
|
179
|
+
readonly internalType: "address";
|
|
180
|
+
readonly name: "token";
|
|
181
|
+
readonly type: "address";
|
|
182
|
+
}, {
|
|
183
|
+
readonly internalType: "address";
|
|
184
|
+
readonly name: "recipient";
|
|
185
|
+
readonly type: "address";
|
|
186
|
+
}];
|
|
187
|
+
readonly name: "executeRecovery";
|
|
188
|
+
readonly outputs: readonly [];
|
|
189
|
+
readonly stateMutability: "nonpayable";
|
|
190
|
+
readonly type: "function";
|
|
127
191
|
}, {
|
|
128
192
|
readonly inputs: readonly [{
|
|
129
193
|
readonly internalType: "address";
|
|
@@ -223,15 +287,15 @@ export declare const TopUp_jsonAbi: readonly [{
|
|
|
223
287
|
readonly type: "receive";
|
|
224
288
|
}];
|
|
225
289
|
/**
|
|
226
|
-
* Type-safe ABI for
|
|
290
|
+
* Type-safe ABI for TopUpV2_json
|
|
227
291
|
*/
|
|
228
|
-
export type
|
|
292
|
+
export type TopUpV2_jsonAbi = typeof TopUpV2_jsonAbi;
|
|
229
293
|
/**
|
|
230
|
-
* Contract instance type for
|
|
294
|
+
* Contract instance type for TopUpV2_json
|
|
231
295
|
*/
|
|
232
|
-
export type
|
|
296
|
+
export type TopUpV2_jsonContract = any;
|
|
233
297
|
/**
|
|
234
|
-
*
|
|
298
|
+
* TopUpV2_json Contract Class
|
|
235
299
|
*
|
|
236
300
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
237
301
|
*
|
|
@@ -239,12 +303,12 @@ export type TopUp_jsonContract = any;
|
|
|
239
303
|
* ```typescript
|
|
240
304
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
241
305
|
* import { mainnet } from 'viem/chains';
|
|
242
|
-
* import {
|
|
306
|
+
* import { TopUpV2_json } from 'TopUpV2_json';
|
|
243
307
|
*
|
|
244
308
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
245
309
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
246
310
|
*
|
|
247
|
-
* const contract = new
|
|
311
|
+
* const contract = new TopUpV2_json('0x...', { publicClient, walletClient });
|
|
248
312
|
*
|
|
249
313
|
* // Read functions
|
|
250
314
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -262,7 +326,7 @@ export type TopUp_jsonContract = any;
|
|
|
262
326
|
* });
|
|
263
327
|
* ```
|
|
264
328
|
*/
|
|
265
|
-
export declare class
|
|
329
|
+
export declare class TopUpV2_json {
|
|
266
330
|
private contract;
|
|
267
331
|
private contractAddress;
|
|
268
332
|
private publicClient;
|
|
@@ -277,7 +341,12 @@ export declare class TopUp_json {
|
|
|
277
341
|
/**
|
|
278
342
|
* Get the underlying viem contract instance
|
|
279
343
|
*/
|
|
280
|
-
getContract():
|
|
344
|
+
getContract(): TopUpV2_jsonContract;
|
|
345
|
+
/**
|
|
346
|
+
* DISPATCHER
|
|
347
|
+
* view
|
|
348
|
+
*/
|
|
349
|
+
DISPATCHER(): Promise<`0x${string}`>;
|
|
281
350
|
/**
|
|
282
351
|
* ETH
|
|
283
352
|
* view
|
|
@@ -332,6 +401,23 @@ export declare class TopUp_json {
|
|
|
332
401
|
nonce?: number;
|
|
333
402
|
value?: bigint;
|
|
334
403
|
}): Promise<`0x${string}`>;
|
|
404
|
+
/**
|
|
405
|
+
* executeRecovery
|
|
406
|
+
* nonpayable
|
|
407
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
408
|
+
*/
|
|
409
|
+
executeRecovery(token: `0x${string}`, recipient: `0x${string}`, 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}`>;
|
|
335
421
|
/**
|
|
336
422
|
* initialize
|
|
337
423
|
* nonpayable
|
|
@@ -477,6 +563,23 @@ export declare class TopUp_json {
|
|
|
477
563
|
nonce?: number;
|
|
478
564
|
value?: bigint;
|
|
479
565
|
}): Promise<void>;
|
|
566
|
+
/**
|
|
567
|
+
* Simulate executeRecovery
|
|
568
|
+
* Returns gas estimate and result without sending transaction
|
|
569
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
570
|
+
*/
|
|
571
|
+
executeRecovery(token: `0x${string}`, recipient: `0x${string}`, options?: {
|
|
572
|
+
accessList?: import("viem").AccessList;
|
|
573
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
574
|
+
chain?: import("viem").Chain | null;
|
|
575
|
+
dataSuffix?: `0x${string}`;
|
|
576
|
+
gas?: bigint;
|
|
577
|
+
gasPrice?: bigint;
|
|
578
|
+
maxFeePerGas?: bigint;
|
|
579
|
+
maxPriorityFeePerGas?: bigint;
|
|
580
|
+
nonce?: number;
|
|
581
|
+
value?: bigint;
|
|
582
|
+
}): Promise<void>;
|
|
480
583
|
/**
|
|
481
584
|
* Simulate initialize
|
|
482
585
|
* Returns gas estimate and result without sending transaction
|
|
@@ -640,5 +743,19 @@ export declare class TopUp_json {
|
|
|
640
743
|
}) => void, filter?: {
|
|
641
744
|
token: `0x${string}`;
|
|
642
745
|
}) => () => void;
|
|
746
|
+
/**
|
|
747
|
+
* Watch RecoveryExecuted events
|
|
748
|
+
* @param callback Function to call when event is emitted
|
|
749
|
+
* @param filter Optional filter for indexed parameters
|
|
750
|
+
* @returns Unwatch function to stop listening
|
|
751
|
+
*/
|
|
752
|
+
RecoveryExecuted: (callback: (event: {
|
|
753
|
+
token: `0x${string}`;
|
|
754
|
+
recipient: `0x${string}`;
|
|
755
|
+
amount: bigint;
|
|
756
|
+
}) => void, filter?: {
|
|
757
|
+
token: `0x${string}`;
|
|
758
|
+
recipient: `0x${string}`;
|
|
759
|
+
}) => () => void;
|
|
643
760
|
};
|
|
644
761
|
}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TopUpV2_json = exports.TopUpV2_jsonAbi = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
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.
|
|
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
|
{
|
|
@@ -129,6 +154,44 @@ exports.TopUp_jsonAbi = [
|
|
|
129
154
|
"name": "ProcessTopUp",
|
|
130
155
|
"type": "event"
|
|
131
156
|
},
|
|
157
|
+
{
|
|
158
|
+
"anonymous": false,
|
|
159
|
+
"inputs": [
|
|
160
|
+
{
|
|
161
|
+
"indexed": true,
|
|
162
|
+
"internalType": "address",
|
|
163
|
+
"name": "token",
|
|
164
|
+
"type": "address"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"indexed": true,
|
|
168
|
+
"internalType": "address",
|
|
169
|
+
"name": "recipient",
|
|
170
|
+
"type": "address"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"indexed": false,
|
|
174
|
+
"internalType": "uint256",
|
|
175
|
+
"name": "amount",
|
|
176
|
+
"type": "uint256"
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"name": "RecoveryExecuted",
|
|
180
|
+
"type": "event"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"inputs": [],
|
|
184
|
+
"name": "DISPATCHER",
|
|
185
|
+
"outputs": [
|
|
186
|
+
{
|
|
187
|
+
"internalType": "address",
|
|
188
|
+
"name": "",
|
|
189
|
+
"type": "address"
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"stateMutability": "view",
|
|
193
|
+
"type": "function"
|
|
194
|
+
},
|
|
132
195
|
{
|
|
133
196
|
"inputs": [],
|
|
134
197
|
"name": "ETH",
|
|
@@ -162,6 +225,24 @@ exports.TopUp_jsonAbi = [
|
|
|
162
225
|
"stateMutability": "payable",
|
|
163
226
|
"type": "function"
|
|
164
227
|
},
|
|
228
|
+
{
|
|
229
|
+
"inputs": [
|
|
230
|
+
{
|
|
231
|
+
"internalType": "address",
|
|
232
|
+
"name": "token",
|
|
233
|
+
"type": "address"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"internalType": "address",
|
|
237
|
+
"name": "recipient",
|
|
238
|
+
"type": "address"
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
"name": "executeRecovery",
|
|
242
|
+
"outputs": [],
|
|
243
|
+
"stateMutability": "nonpayable",
|
|
244
|
+
"type": "function"
|
|
245
|
+
},
|
|
165
246
|
{
|
|
166
247
|
"inputs": [
|
|
167
248
|
{
|
|
@@ -289,7 +370,7 @@ exports.TopUp_jsonAbi = [
|
|
|
289
370
|
}
|
|
290
371
|
];
|
|
291
372
|
/**
|
|
292
|
-
*
|
|
373
|
+
* TopUpV2_json Contract Class
|
|
293
374
|
*
|
|
294
375
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
295
376
|
*
|
|
@@ -297,12 +378,12 @@ exports.TopUp_jsonAbi = [
|
|
|
297
378
|
* ```typescript
|
|
298
379
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
299
380
|
* import { mainnet } from 'viem/chains';
|
|
300
|
-
* import {
|
|
381
|
+
* import { TopUpV2_json } from 'TopUpV2_json';
|
|
301
382
|
*
|
|
302
383
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
303
384
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
304
385
|
*
|
|
305
|
-
* const contract = new
|
|
386
|
+
* const contract = new TopUpV2_json('0x...', { publicClient, walletClient });
|
|
306
387
|
*
|
|
307
388
|
* // Read functions
|
|
308
389
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -320,13 +401,13 @@ exports.TopUp_jsonAbi = [
|
|
|
320
401
|
* });
|
|
321
402
|
* ```
|
|
322
403
|
*/
|
|
323
|
-
class
|
|
404
|
+
class TopUpV2_json {
|
|
324
405
|
constructor(address, clients) {
|
|
325
406
|
this.contractAddress = address;
|
|
326
407
|
this.publicClient = clients.publicClient;
|
|
327
408
|
this.contract = (0, viem_1.getContract)({
|
|
328
409
|
address,
|
|
329
|
-
abi: exports.
|
|
410
|
+
abi: exports.TopUpV2_jsonAbi,
|
|
330
411
|
client: {
|
|
331
412
|
public: clients.publicClient,
|
|
332
413
|
wallet: clients.walletClient,
|
|
@@ -345,6 +426,13 @@ class TopUp_json {
|
|
|
345
426
|
getContract() {
|
|
346
427
|
return this.contract;
|
|
347
428
|
}
|
|
429
|
+
/**
|
|
430
|
+
* DISPATCHER
|
|
431
|
+
* view
|
|
432
|
+
*/
|
|
433
|
+
async DISPATCHER() {
|
|
434
|
+
return this.contract.read.DISPATCHER();
|
|
435
|
+
}
|
|
348
436
|
/**
|
|
349
437
|
* ETH
|
|
350
438
|
* view
|
|
@@ -395,6 +483,17 @@ class TopUp_json {
|
|
|
395
483
|
}
|
|
396
484
|
return this.contract.write.completeOwnershipHandover([pendingOwner], options);
|
|
397
485
|
}
|
|
486
|
+
/**
|
|
487
|
+
* executeRecovery
|
|
488
|
+
* nonpayable
|
|
489
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
490
|
+
*/
|
|
491
|
+
async executeRecovery(token, recipient, options) {
|
|
492
|
+
if (!this.contract.write) {
|
|
493
|
+
throw new Error('Wallet client is required for write operations');
|
|
494
|
+
}
|
|
495
|
+
return this.contract.write.executeRecovery([token, recipient], options);
|
|
496
|
+
}
|
|
398
497
|
/**
|
|
399
498
|
* initialize
|
|
400
499
|
* nonpayable
|
|
@@ -491,6 +590,14 @@ class TopUp_json {
|
|
|
491
590
|
async completeOwnershipHandover(pendingOwner, options) {
|
|
492
591
|
return contract.simulate.completeOwnershipHandover([pendingOwner], options);
|
|
493
592
|
},
|
|
593
|
+
/**
|
|
594
|
+
* Simulate executeRecovery
|
|
595
|
+
* Returns gas estimate and result without sending transaction
|
|
596
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
597
|
+
*/
|
|
598
|
+
async executeRecovery(token, recipient, options) {
|
|
599
|
+
return contract.simulate.executeRecovery([token, recipient], options);
|
|
600
|
+
},
|
|
494
601
|
/**
|
|
495
602
|
* Simulate initialize
|
|
496
603
|
* Returns gas estimate and result without sending transaction
|
|
@@ -564,7 +671,7 @@ class TopUp_json {
|
|
|
564
671
|
OwnershipHandoverCanceled: (callback, filter) => {
|
|
565
672
|
return this.publicClient.watchContractEvent({
|
|
566
673
|
address: this.contractAddress,
|
|
567
|
-
abi: exports.
|
|
674
|
+
abi: exports.TopUpV2_jsonAbi,
|
|
568
675
|
eventName: 'OwnershipHandoverCanceled',
|
|
569
676
|
args: filter,
|
|
570
677
|
onLogs: (logs) => {
|
|
@@ -583,7 +690,7 @@ class TopUp_json {
|
|
|
583
690
|
OwnershipHandoverRequested: (callback, filter) => {
|
|
584
691
|
return this.publicClient.watchContractEvent({
|
|
585
692
|
address: this.contractAddress,
|
|
586
|
-
abi: exports.
|
|
693
|
+
abi: exports.TopUpV2_jsonAbi,
|
|
587
694
|
eventName: 'OwnershipHandoverRequested',
|
|
588
695
|
args: filter,
|
|
589
696
|
onLogs: (logs) => {
|
|
@@ -602,7 +709,7 @@ class TopUp_json {
|
|
|
602
709
|
OwnershipTransferred: (callback, filter) => {
|
|
603
710
|
return this.publicClient.watchContractEvent({
|
|
604
711
|
address: this.contractAddress,
|
|
605
|
-
abi: exports.
|
|
712
|
+
abi: exports.TopUpV2_jsonAbi,
|
|
606
713
|
eventName: 'OwnershipTransferred',
|
|
607
714
|
args: filter,
|
|
608
715
|
onLogs: (logs) => {
|
|
@@ -621,7 +728,7 @@ class TopUp_json {
|
|
|
621
728
|
ProcessTopUp: (callback, filter) => {
|
|
622
729
|
return this.publicClient.watchContractEvent({
|
|
623
730
|
address: this.contractAddress,
|
|
624
|
-
abi: exports.
|
|
731
|
+
abi: exports.TopUpV2_jsonAbi,
|
|
625
732
|
eventName: 'ProcessTopUp',
|
|
626
733
|
args: filter,
|
|
627
734
|
onLogs: (logs) => {
|
|
@@ -630,8 +737,27 @@ class TopUp_json {
|
|
|
630
737
|
});
|
|
631
738
|
},
|
|
632
739
|
});
|
|
740
|
+
},
|
|
741
|
+
/**
|
|
742
|
+
* Watch RecoveryExecuted events
|
|
743
|
+
* @param callback Function to call when event is emitted
|
|
744
|
+
* @param filter Optional filter for indexed parameters
|
|
745
|
+
* @returns Unwatch function to stop listening
|
|
746
|
+
*/
|
|
747
|
+
RecoveryExecuted: (callback, filter) => {
|
|
748
|
+
return this.publicClient.watchContractEvent({
|
|
749
|
+
address: this.contractAddress,
|
|
750
|
+
abi: exports.TopUpV2_jsonAbi,
|
|
751
|
+
eventName: 'RecoveryExecuted',
|
|
752
|
+
args: filter,
|
|
753
|
+
onLogs: (logs) => {
|
|
754
|
+
logs.forEach((log) => {
|
|
755
|
+
callback(log.args);
|
|
756
|
+
});
|
|
757
|
+
},
|
|
758
|
+
});
|
|
633
759
|
}
|
|
634
760
|
};
|
|
635
761
|
}
|
|
636
762
|
}
|
|
637
|
-
exports.
|
|
763
|
+
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
|
-
*
|
|
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
|
|
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
|
{
|
|
@@ -128,6 +153,44 @@ export const TopUp_jsonAbi = [
|
|
|
128
153
|
"name": "ProcessTopUp",
|
|
129
154
|
"type": "event"
|
|
130
155
|
},
|
|
156
|
+
{
|
|
157
|
+
"anonymous": false,
|
|
158
|
+
"inputs": [
|
|
159
|
+
{
|
|
160
|
+
"indexed": true,
|
|
161
|
+
"internalType": "address",
|
|
162
|
+
"name": "token",
|
|
163
|
+
"type": "address"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"indexed": true,
|
|
167
|
+
"internalType": "address",
|
|
168
|
+
"name": "recipient",
|
|
169
|
+
"type": "address"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"indexed": false,
|
|
173
|
+
"internalType": "uint256",
|
|
174
|
+
"name": "amount",
|
|
175
|
+
"type": "uint256"
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"name": "RecoveryExecuted",
|
|
179
|
+
"type": "event"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"inputs": [],
|
|
183
|
+
"name": "DISPATCHER",
|
|
184
|
+
"outputs": [
|
|
185
|
+
{
|
|
186
|
+
"internalType": "address",
|
|
187
|
+
"name": "",
|
|
188
|
+
"type": "address"
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
"stateMutability": "view",
|
|
192
|
+
"type": "function"
|
|
193
|
+
},
|
|
131
194
|
{
|
|
132
195
|
"inputs": [],
|
|
133
196
|
"name": "ETH",
|
|
@@ -161,6 +224,24 @@ export const TopUp_jsonAbi = [
|
|
|
161
224
|
"stateMutability": "payable",
|
|
162
225
|
"type": "function"
|
|
163
226
|
},
|
|
227
|
+
{
|
|
228
|
+
"inputs": [
|
|
229
|
+
{
|
|
230
|
+
"internalType": "address",
|
|
231
|
+
"name": "token",
|
|
232
|
+
"type": "address"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"internalType": "address",
|
|
236
|
+
"name": "recipient",
|
|
237
|
+
"type": "address"
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
"name": "executeRecovery",
|
|
241
|
+
"outputs": [],
|
|
242
|
+
"stateMutability": "nonpayable",
|
|
243
|
+
"type": "function"
|
|
244
|
+
},
|
|
164
245
|
{
|
|
165
246
|
"inputs": [
|
|
166
247
|
{
|
|
@@ -289,19 +370,19 @@ export const TopUp_jsonAbi = [
|
|
|
289
370
|
] as const satisfies Abi;
|
|
290
371
|
|
|
291
372
|
/**
|
|
292
|
-
* Type-safe ABI for
|
|
373
|
+
* Type-safe ABI for TopUpV2_json
|
|
293
374
|
*/
|
|
294
|
-
export type
|
|
375
|
+
export type TopUpV2_jsonAbi = typeof TopUpV2_jsonAbi;
|
|
295
376
|
|
|
296
377
|
/**
|
|
297
|
-
* Contract instance type for
|
|
378
|
+
* Contract instance type for TopUpV2_json
|
|
298
379
|
*/
|
|
299
380
|
// Use any for contract type to avoid complex viem type issues
|
|
300
381
|
// The runtime behavior is type-safe through viem's ABI typing
|
|
301
|
-
export type
|
|
382
|
+
export type TopUpV2_jsonContract = any;
|
|
302
383
|
|
|
303
384
|
/**
|
|
304
|
-
*
|
|
385
|
+
* TopUpV2_json Contract Class
|
|
305
386
|
*
|
|
306
387
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
307
388
|
*
|
|
@@ -309,12 +390,12 @@ export type TopUp_jsonContract = any;
|
|
|
309
390
|
* ```typescript
|
|
310
391
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
311
392
|
* import { mainnet } from 'viem/chains';
|
|
312
|
-
* import {
|
|
393
|
+
* import { TopUpV2_json } from 'TopUpV2_json';
|
|
313
394
|
*
|
|
314
395
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
315
396
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
316
397
|
*
|
|
317
|
-
* const contract = new
|
|
398
|
+
* const contract = new TopUpV2_json('0x...', { publicClient, walletClient });
|
|
318
399
|
*
|
|
319
400
|
* // Read functions
|
|
320
401
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -332,8 +413,8 @@ export type TopUp_jsonContract = any;
|
|
|
332
413
|
* });
|
|
333
414
|
* ```
|
|
334
415
|
*/
|
|
335
|
-
export class
|
|
336
|
-
private contract:
|
|
416
|
+
export class TopUpV2_json {
|
|
417
|
+
private contract: TopUpV2_jsonContract;
|
|
337
418
|
private contractAddress: Address;
|
|
338
419
|
private publicClient: PublicClient;
|
|
339
420
|
|
|
@@ -348,7 +429,7 @@ export class TopUp_json {
|
|
|
348
429
|
this.publicClient = clients.publicClient;
|
|
349
430
|
this.contract = getContract({
|
|
350
431
|
address,
|
|
351
|
-
abi:
|
|
432
|
+
abi: TopUpV2_jsonAbi,
|
|
352
433
|
client: {
|
|
353
434
|
public: clients.publicClient,
|
|
354
435
|
wallet: clients.walletClient,
|
|
@@ -366,10 +447,18 @@ export class TopUp_json {
|
|
|
366
447
|
/**
|
|
367
448
|
* Get the underlying viem contract instance
|
|
368
449
|
*/
|
|
369
|
-
getContract():
|
|
450
|
+
getContract(): TopUpV2_jsonContract {
|
|
370
451
|
return this.contract;
|
|
371
452
|
}
|
|
372
453
|
|
|
454
|
+
/**
|
|
455
|
+
* DISPATCHER
|
|
456
|
+
* view
|
|
457
|
+
*/
|
|
458
|
+
async DISPATCHER(): Promise<`0x${string}`> {
|
|
459
|
+
return this.contract.read.DISPATCHER() as Promise<`0x${string}`>;
|
|
460
|
+
}
|
|
461
|
+
|
|
373
462
|
/**
|
|
374
463
|
* ETH
|
|
375
464
|
* view
|
|
@@ -448,6 +537,29 @@ export class TopUp_json {
|
|
|
448
537
|
return this.contract.write.completeOwnershipHandover([pendingOwner] as const, options) as Promise<`0x${string}`>;
|
|
449
538
|
}
|
|
450
539
|
|
|
540
|
+
/**
|
|
541
|
+
* executeRecovery
|
|
542
|
+
* nonpayable
|
|
543
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
544
|
+
*/
|
|
545
|
+
async executeRecovery(token: `0x${string}`, recipient: `0x${string}`, options?: {
|
|
546
|
+
accessList?: import('viem').AccessList;
|
|
547
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
548
|
+
chain?: import('viem').Chain | null;
|
|
549
|
+
dataSuffix?: `0x${string}`;
|
|
550
|
+
gas?: bigint;
|
|
551
|
+
gasPrice?: bigint;
|
|
552
|
+
maxFeePerGas?: bigint;
|
|
553
|
+
maxPriorityFeePerGas?: bigint;
|
|
554
|
+
nonce?: number;
|
|
555
|
+
value?: bigint;
|
|
556
|
+
}): Promise<`0x${string}`> {
|
|
557
|
+
if (!this.contract.write) {
|
|
558
|
+
throw new Error('Wallet client is required for write operations');
|
|
559
|
+
}
|
|
560
|
+
return this.contract.write.executeRecovery([token, recipient] as const, options) as Promise<`0x${string}`>;
|
|
561
|
+
}
|
|
562
|
+
|
|
451
563
|
/**
|
|
452
564
|
* initialize
|
|
453
565
|
* nonpayable
|
|
@@ -640,6 +752,25 @@ export class TopUp_json {
|
|
|
640
752
|
}): Promise<void> {
|
|
641
753
|
return contract.simulate.completeOwnershipHandover([pendingOwner] as const, options) as Promise<void>;
|
|
642
754
|
},
|
|
755
|
+
/**
|
|
756
|
+
* Simulate executeRecovery
|
|
757
|
+
* Returns gas estimate and result without sending transaction
|
|
758
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
759
|
+
*/
|
|
760
|
+
async executeRecovery(token: `0x${string}`, recipient: `0x${string}`, options?: {
|
|
761
|
+
accessList?: import('viem').AccessList;
|
|
762
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
763
|
+
chain?: import('viem').Chain | null;
|
|
764
|
+
dataSuffix?: `0x${string}`;
|
|
765
|
+
gas?: bigint;
|
|
766
|
+
gasPrice?: bigint;
|
|
767
|
+
maxFeePerGas?: bigint;
|
|
768
|
+
maxPriorityFeePerGas?: bigint;
|
|
769
|
+
nonce?: number;
|
|
770
|
+
value?: bigint;
|
|
771
|
+
}): Promise<void> {
|
|
772
|
+
return contract.simulate.executeRecovery([token, recipient] as const, options) as Promise<void>;
|
|
773
|
+
},
|
|
643
774
|
/**
|
|
644
775
|
* Simulate initialize
|
|
645
776
|
* Returns gas estimate and result without sending transaction
|
|
@@ -780,7 +911,7 @@ export class TopUp_json {
|
|
|
780
911
|
OwnershipHandoverCanceled: (callback: (event: { pendingOwner: `0x${string}` }) => void, filter?: { pendingOwner: `0x${string}` }) => {
|
|
781
912
|
return this.publicClient.watchContractEvent({
|
|
782
913
|
address: this.contractAddress,
|
|
783
|
-
abi:
|
|
914
|
+
abi: TopUpV2_jsonAbi,
|
|
784
915
|
eventName: 'OwnershipHandoverCanceled',
|
|
785
916
|
args: filter,
|
|
786
917
|
onLogs: (logs: any[]) => {
|
|
@@ -799,7 +930,7 @@ export class TopUp_json {
|
|
|
799
930
|
OwnershipHandoverRequested: (callback: (event: { pendingOwner: `0x${string}` }) => void, filter?: { pendingOwner: `0x${string}` }) => {
|
|
800
931
|
return this.publicClient.watchContractEvent({
|
|
801
932
|
address: this.contractAddress,
|
|
802
|
-
abi:
|
|
933
|
+
abi: TopUpV2_jsonAbi,
|
|
803
934
|
eventName: 'OwnershipHandoverRequested',
|
|
804
935
|
args: filter,
|
|
805
936
|
onLogs: (logs: any[]) => {
|
|
@@ -818,7 +949,7 @@ export class TopUp_json {
|
|
|
818
949
|
OwnershipTransferred: (callback: (event: { oldOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { oldOwner: `0x${string}`; newOwner: `0x${string}` }) => {
|
|
819
950
|
return this.publicClient.watchContractEvent({
|
|
820
951
|
address: this.contractAddress,
|
|
821
|
-
abi:
|
|
952
|
+
abi: TopUpV2_jsonAbi,
|
|
822
953
|
eventName: 'OwnershipTransferred',
|
|
823
954
|
args: filter,
|
|
824
955
|
onLogs: (logs: any[]) => {
|
|
@@ -837,7 +968,7 @@ export class TopUp_json {
|
|
|
837
968
|
ProcessTopUp: (callback: (event: { token: `0x${string}`; amount: bigint }) => void, filter?: { token: `0x${string}` }) => {
|
|
838
969
|
return this.publicClient.watchContractEvent({
|
|
839
970
|
address: this.contractAddress,
|
|
840
|
-
abi:
|
|
971
|
+
abi: TopUpV2_jsonAbi,
|
|
841
972
|
eventName: 'ProcessTopUp',
|
|
842
973
|
args: filter,
|
|
843
974
|
onLogs: (logs: any[]) => {
|
|
@@ -846,6 +977,25 @@ export class TopUp_json {
|
|
|
846
977
|
});
|
|
847
978
|
},
|
|
848
979
|
}) as () => void;
|
|
980
|
+
},
|
|
981
|
+
/**
|
|
982
|
+
* Watch RecoveryExecuted events
|
|
983
|
+
* @param callback Function to call when event is emitted
|
|
984
|
+
* @param filter Optional filter for indexed parameters
|
|
985
|
+
* @returns Unwatch function to stop listening
|
|
986
|
+
*/
|
|
987
|
+
RecoveryExecuted: (callback: (event: { token: `0x${string}`; recipient: `0x${string}`; amount: bigint }) => void, filter?: { token: `0x${string}`; recipient: `0x${string}` }) => {
|
|
988
|
+
return this.publicClient.watchContractEvent({
|
|
989
|
+
address: this.contractAddress,
|
|
990
|
+
abi: TopUpV2_jsonAbi,
|
|
991
|
+
eventName: 'RecoveryExecuted',
|
|
992
|
+
args: filter,
|
|
993
|
+
onLogs: (logs: any[]) => {
|
|
994
|
+
logs.forEach((log: any) => {
|
|
995
|
+
callback(log.args as any);
|
|
996
|
+
});
|
|
997
|
+
},
|
|
998
|
+
}) as () => void;
|
|
849
999
|
}
|
|
850
1000
|
};
|
|
851
1001
|
}
|
package/contracts/index.d.ts
CHANGED
|
@@ -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 {
|
|
4
|
-
export type {
|
|
3
|
+
export { TopUpV2_jsonAbi, TopUpV2_json } from './TopUpV2_json';
|
|
4
|
+
export type { TopUpV2_jsonAbi as TopUpV2_jsonAbiType, TopUpV2_jsonContract } from './TopUpV2_json';
|
package/contracts/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
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
|
|
9
|
-
Object.defineProperty(exports, "
|
|
10
|
-
Object.defineProperty(exports, "
|
|
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; } });
|
package/contracts/index.ts
CHANGED
|
@@ -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 {
|
|
5
|
-
export type {
|
|
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.
|
|
4
|
-
"description": "Auto-generated TypeScript type bindings for TopUp (build etherscan-topup-
|
|
3
|
+
"version": "1.0.10",
|
|
4
|
+
"description": "Auto-generated TypeScript type bindings for TopUp (build etherscan-topup-7a9f8f6a-1787232291699, commit 36e82b0, 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": "
|
|
42
|
+
"shortHash": "36e82b0"
|
|
43
43
|
}
|