@gitmyabi/dot 1.0.0 → 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 +3 -3
- package/contracts/{ERC20Token_json.d.ts → Token_json.d.ts} +116 -323
- package/contracts/{ERC20Token_json.js → Token_json.js} +143 -332
- package/contracts/{ERC20Token_json.ts → Token_json.ts} +149 -431
- package/contracts/index.d.ts +2 -2
- package/contracts/index.js +4 -4
- package/contracts/index.ts +2 -2
- package/package.json +3 -3
|
@@ -1,33 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Token_json = exports.Token_jsonAbi = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Token_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.Token_jsonAbi = [
|
|
11
11
|
{
|
|
12
12
|
"inputs": [
|
|
13
13
|
{
|
|
14
14
|
"internalType": "string",
|
|
15
|
-
"name": "
|
|
15
|
+
"name": "_name",
|
|
16
16
|
"type": "string"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"internalType": "string",
|
|
20
|
-
"name": "
|
|
20
|
+
"name": "_symbol",
|
|
21
21
|
"type": "string"
|
|
22
22
|
},
|
|
23
|
-
{
|
|
24
|
-
"internalType": "uint256",
|
|
25
|
-
"name": "initSupply",
|
|
26
|
-
"type": "uint256"
|
|
27
|
-
},
|
|
28
23
|
{
|
|
29
24
|
"internalType": "uint8",
|
|
30
|
-
"name": "
|
|
25
|
+
"name": "_decimals",
|
|
31
26
|
"type": "uint8"
|
|
32
27
|
}
|
|
33
28
|
],
|
|
@@ -52,7 +47,7 @@ exports.ERC20Token_jsonAbi = [
|
|
|
52
47
|
"type": "uint256"
|
|
53
48
|
}
|
|
54
49
|
],
|
|
55
|
-
"name": "
|
|
50
|
+
"name": "InsufficientAllowance",
|
|
56
51
|
"type": "error"
|
|
57
52
|
},
|
|
58
53
|
{
|
|
@@ -73,73 +68,66 @@ exports.ERC20Token_jsonAbi = [
|
|
|
73
68
|
"type": "uint256"
|
|
74
69
|
}
|
|
75
70
|
],
|
|
76
|
-
"name": "
|
|
71
|
+
"name": "InsufficientBalance",
|
|
77
72
|
"type": "error"
|
|
78
73
|
},
|
|
79
74
|
{
|
|
80
75
|
"inputs": [
|
|
81
76
|
{
|
|
82
77
|
"internalType": "address",
|
|
83
|
-
"name": "
|
|
78
|
+
"name": "",
|
|
84
79
|
"type": "address"
|
|
85
80
|
}
|
|
86
81
|
],
|
|
87
|
-
"name": "
|
|
82
|
+
"name": "InvalidApprover",
|
|
88
83
|
"type": "error"
|
|
89
84
|
},
|
|
90
85
|
{
|
|
91
86
|
"inputs": [
|
|
92
87
|
{
|
|
93
88
|
"internalType": "address",
|
|
94
|
-
"name": "
|
|
89
|
+
"name": "",
|
|
95
90
|
"type": "address"
|
|
96
91
|
}
|
|
97
92
|
],
|
|
98
|
-
"name": "
|
|
93
|
+
"name": "InvalidReceiver",
|
|
99
94
|
"type": "error"
|
|
100
95
|
},
|
|
101
96
|
{
|
|
102
97
|
"inputs": [
|
|
103
98
|
{
|
|
104
99
|
"internalType": "address",
|
|
105
|
-
"name": "
|
|
100
|
+
"name": "",
|
|
106
101
|
"type": "address"
|
|
107
102
|
}
|
|
108
103
|
],
|
|
109
|
-
"name": "
|
|
104
|
+
"name": "InvalidSender",
|
|
110
105
|
"type": "error"
|
|
111
106
|
},
|
|
112
107
|
{
|
|
113
|
-
"inputs": [
|
|
114
|
-
|
|
115
|
-
"internalType": "address",
|
|
116
|
-
"name": "spender",
|
|
117
|
-
"type": "address"
|
|
118
|
-
}
|
|
119
|
-
],
|
|
120
|
-
"name": "ERC20InvalidSpender",
|
|
108
|
+
"inputs": [],
|
|
109
|
+
"name": "InvalidSignature",
|
|
121
110
|
"type": "error"
|
|
122
111
|
},
|
|
123
112
|
{
|
|
124
113
|
"inputs": [
|
|
125
114
|
{
|
|
126
115
|
"internalType": "address",
|
|
127
|
-
"name": "
|
|
116
|
+
"name": "",
|
|
128
117
|
"type": "address"
|
|
129
118
|
}
|
|
130
119
|
],
|
|
131
|
-
"name": "
|
|
120
|
+
"name": "InvalidSpender",
|
|
132
121
|
"type": "error"
|
|
133
122
|
},
|
|
134
123
|
{
|
|
135
|
-
"inputs": [
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
"name": "OwnableUnauthorizedAccount",
|
|
124
|
+
"inputs": [],
|
|
125
|
+
"name": "PermitExpired",
|
|
126
|
+
"type": "error"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"inputs": [],
|
|
130
|
+
"name": "Unauthorized",
|
|
143
131
|
"type": "error"
|
|
144
132
|
},
|
|
145
133
|
{
|
|
@@ -167,64 +155,6 @@ exports.ERC20Token_jsonAbi = [
|
|
|
167
155
|
"name": "Approval",
|
|
168
156
|
"type": "event"
|
|
169
157
|
},
|
|
170
|
-
{
|
|
171
|
-
"anonymous": false,
|
|
172
|
-
"inputs": [
|
|
173
|
-
{
|
|
174
|
-
"indexed": true,
|
|
175
|
-
"internalType": "address",
|
|
176
|
-
"name": "previousOwner",
|
|
177
|
-
"type": "address"
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
"indexed": true,
|
|
181
|
-
"internalType": "address",
|
|
182
|
-
"name": "newOwner",
|
|
183
|
-
"type": "address"
|
|
184
|
-
}
|
|
185
|
-
],
|
|
186
|
-
"name": "OwnershipTransferred",
|
|
187
|
-
"type": "event"
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
"anonymous": false,
|
|
191
|
-
"inputs": [
|
|
192
|
-
{
|
|
193
|
-
"indexed": false,
|
|
194
|
-
"internalType": "uint8",
|
|
195
|
-
"name": "precision",
|
|
196
|
-
"type": "uint8"
|
|
197
|
-
}
|
|
198
|
-
],
|
|
199
|
-
"name": "SetDecimals",
|
|
200
|
-
"type": "event"
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
"anonymous": false,
|
|
204
|
-
"inputs": [
|
|
205
|
-
{
|
|
206
|
-
"indexed": false,
|
|
207
|
-
"internalType": "string",
|
|
208
|
-
"name": "name",
|
|
209
|
-
"type": "string"
|
|
210
|
-
}
|
|
211
|
-
],
|
|
212
|
-
"name": "SetName",
|
|
213
|
-
"type": "event"
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
"anonymous": false,
|
|
217
|
-
"inputs": [
|
|
218
|
-
{
|
|
219
|
-
"indexed": false,
|
|
220
|
-
"internalType": "string",
|
|
221
|
-
"name": "symbol",
|
|
222
|
-
"type": "string"
|
|
223
|
-
}
|
|
224
|
-
],
|
|
225
|
-
"name": "SetSymbol",
|
|
226
|
-
"type": "event"
|
|
227
|
-
},
|
|
228
158
|
{
|
|
229
159
|
"anonymous": false,
|
|
230
160
|
"inputs": [
|
|
@@ -250,11 +180,24 @@ exports.ERC20Token_jsonAbi = [
|
|
|
250
180
|
"name": "Transfer",
|
|
251
181
|
"type": "event"
|
|
252
182
|
},
|
|
183
|
+
{
|
|
184
|
+
"inputs": [],
|
|
185
|
+
"name": "DOMAIN_SEPARATOR",
|
|
186
|
+
"outputs": [
|
|
187
|
+
{
|
|
188
|
+
"internalType": "bytes32",
|
|
189
|
+
"name": "",
|
|
190
|
+
"type": "bytes32"
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
"stateMutability": "view",
|
|
194
|
+
"type": "function"
|
|
195
|
+
},
|
|
253
196
|
{
|
|
254
197
|
"inputs": [
|
|
255
198
|
{
|
|
256
199
|
"internalType": "address",
|
|
257
|
-
"name": "
|
|
200
|
+
"name": "_owner",
|
|
258
201
|
"type": "address"
|
|
259
202
|
},
|
|
260
203
|
{
|
|
@@ -283,7 +226,7 @@ exports.ERC20Token_jsonAbi = [
|
|
|
283
226
|
},
|
|
284
227
|
{
|
|
285
228
|
"internalType": "uint256",
|
|
286
|
-
"name": "
|
|
229
|
+
"name": "amount",
|
|
287
230
|
"type": "uint256"
|
|
288
231
|
}
|
|
289
232
|
],
|
|
@@ -348,6 +291,19 @@ exports.ERC20Token_jsonAbi = [
|
|
|
348
291
|
"stateMutability": "view",
|
|
349
292
|
"type": "function"
|
|
350
293
|
},
|
|
294
|
+
{
|
|
295
|
+
"inputs": [],
|
|
296
|
+
"name": "gateway",
|
|
297
|
+
"outputs": [
|
|
298
|
+
{
|
|
299
|
+
"internalType": "address",
|
|
300
|
+
"name": "",
|
|
301
|
+
"type": "address"
|
|
302
|
+
}
|
|
303
|
+
],
|
|
304
|
+
"stateMutability": "view",
|
|
305
|
+
"type": "function"
|
|
306
|
+
},
|
|
351
307
|
{
|
|
352
308
|
"inputs": [
|
|
353
309
|
{
|
|
@@ -380,60 +336,63 @@ exports.ERC20Token_jsonAbi = [
|
|
|
380
336
|
"type": "function"
|
|
381
337
|
},
|
|
382
338
|
{
|
|
383
|
-
"inputs": [
|
|
384
|
-
"name": "owner",
|
|
385
|
-
"outputs": [
|
|
339
|
+
"inputs": [
|
|
386
340
|
{
|
|
387
341
|
"internalType": "address",
|
|
388
|
-
"name": "",
|
|
342
|
+
"name": "account",
|
|
389
343
|
"type": "address"
|
|
390
344
|
}
|
|
391
345
|
],
|
|
346
|
+
"name": "nonces",
|
|
347
|
+
"outputs": [
|
|
348
|
+
{
|
|
349
|
+
"internalType": "uint256",
|
|
350
|
+
"name": "",
|
|
351
|
+
"type": "uint256"
|
|
352
|
+
}
|
|
353
|
+
],
|
|
392
354
|
"stateMutability": "view",
|
|
393
355
|
"type": "function"
|
|
394
356
|
},
|
|
395
|
-
{
|
|
396
|
-
"inputs": [],
|
|
397
|
-
"name": "renounceOwnership",
|
|
398
|
-
"outputs": [],
|
|
399
|
-
"stateMutability": "nonpayable",
|
|
400
|
-
"type": "function"
|
|
401
|
-
},
|
|
402
357
|
{
|
|
403
358
|
"inputs": [
|
|
359
|
+
{
|
|
360
|
+
"internalType": "address",
|
|
361
|
+
"name": "issuer",
|
|
362
|
+
"type": "address"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"internalType": "address",
|
|
366
|
+
"name": "spender",
|
|
367
|
+
"type": "address"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"internalType": "uint256",
|
|
371
|
+
"name": "value",
|
|
372
|
+
"type": "uint256"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"internalType": "uint256",
|
|
376
|
+
"name": "deadline",
|
|
377
|
+
"type": "uint256"
|
|
378
|
+
},
|
|
404
379
|
{
|
|
405
380
|
"internalType": "uint8",
|
|
406
|
-
"name": "
|
|
381
|
+
"name": "v",
|
|
407
382
|
"type": "uint8"
|
|
408
|
-
}
|
|
409
|
-
],
|
|
410
|
-
"name": "setDecimals",
|
|
411
|
-
"outputs": [],
|
|
412
|
-
"stateMutability": "nonpayable",
|
|
413
|
-
"type": "function"
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
"inputs": [
|
|
383
|
+
},
|
|
417
384
|
{
|
|
418
|
-
"internalType": "
|
|
419
|
-
"name": "
|
|
420
|
-
"type": "
|
|
421
|
-
}
|
|
422
|
-
],
|
|
423
|
-
"name": "setName",
|
|
424
|
-
"outputs": [],
|
|
425
|
-
"stateMutability": "nonpayable",
|
|
426
|
-
"type": "function"
|
|
427
|
-
},
|
|
428
|
-
{
|
|
429
|
-
"inputs": [
|
|
385
|
+
"internalType": "bytes32",
|
|
386
|
+
"name": "r",
|
|
387
|
+
"type": "bytes32"
|
|
388
|
+
},
|
|
430
389
|
{
|
|
431
|
-
"internalType": "
|
|
432
|
-
"name": "
|
|
433
|
-
"type": "
|
|
390
|
+
"internalType": "bytes32",
|
|
391
|
+
"name": "s",
|
|
392
|
+
"type": "bytes32"
|
|
434
393
|
}
|
|
435
394
|
],
|
|
436
|
-
"name": "
|
|
395
|
+
"name": "permit",
|
|
437
396
|
"outputs": [],
|
|
438
397
|
"stateMutability": "nonpayable",
|
|
439
398
|
"type": "function"
|
|
@@ -468,12 +427,12 @@ exports.ERC20Token_jsonAbi = [
|
|
|
468
427
|
"inputs": [
|
|
469
428
|
{
|
|
470
429
|
"internalType": "address",
|
|
471
|
-
"name": "
|
|
430
|
+
"name": "recipient",
|
|
472
431
|
"type": "address"
|
|
473
432
|
},
|
|
474
433
|
{
|
|
475
434
|
"internalType": "uint256",
|
|
476
|
-
"name": "
|
|
435
|
+
"name": "amount",
|
|
477
436
|
"type": "uint256"
|
|
478
437
|
}
|
|
479
438
|
],
|
|
@@ -492,17 +451,17 @@ exports.ERC20Token_jsonAbi = [
|
|
|
492
451
|
"inputs": [
|
|
493
452
|
{
|
|
494
453
|
"internalType": "address",
|
|
495
|
-
"name": "
|
|
454
|
+
"name": "sender",
|
|
496
455
|
"type": "address"
|
|
497
456
|
},
|
|
498
457
|
{
|
|
499
458
|
"internalType": "address",
|
|
500
|
-
"name": "
|
|
459
|
+
"name": "recipient",
|
|
501
460
|
"type": "address"
|
|
502
461
|
},
|
|
503
462
|
{
|
|
504
463
|
"internalType": "uint256",
|
|
505
|
-
"name": "
|
|
464
|
+
"name": "amount",
|
|
506
465
|
"type": "uint256"
|
|
507
466
|
}
|
|
508
467
|
],
|
|
@@ -516,23 +475,10 @@ exports.ERC20Token_jsonAbi = [
|
|
|
516
475
|
],
|
|
517
476
|
"stateMutability": "nonpayable",
|
|
518
477
|
"type": "function"
|
|
519
|
-
},
|
|
520
|
-
{
|
|
521
|
-
"inputs": [
|
|
522
|
-
{
|
|
523
|
-
"internalType": "address",
|
|
524
|
-
"name": "newOwner",
|
|
525
|
-
"type": "address"
|
|
526
|
-
}
|
|
527
|
-
],
|
|
528
|
-
"name": "transferOwnership",
|
|
529
|
-
"outputs": [],
|
|
530
|
-
"stateMutability": "nonpayable",
|
|
531
|
-
"type": "function"
|
|
532
478
|
}
|
|
533
479
|
];
|
|
534
480
|
/**
|
|
535
|
-
*
|
|
481
|
+
* Token_json Contract Class
|
|
536
482
|
*
|
|
537
483
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
538
484
|
*
|
|
@@ -540,12 +486,12 @@ exports.ERC20Token_jsonAbi = [
|
|
|
540
486
|
* ```typescript
|
|
541
487
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
542
488
|
* import { mainnet } from 'viem/chains';
|
|
543
|
-
* import {
|
|
489
|
+
* import { Token_json } from 'Token_json';
|
|
544
490
|
*
|
|
545
491
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
546
492
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
547
493
|
*
|
|
548
|
-
* const contract = new
|
|
494
|
+
* const contract = new Token_json('0x...', { publicClient, walletClient });
|
|
549
495
|
*
|
|
550
496
|
* // Read functions
|
|
551
497
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -563,13 +509,13 @@ exports.ERC20Token_jsonAbi = [
|
|
|
563
509
|
* });
|
|
564
510
|
* ```
|
|
565
511
|
*/
|
|
566
|
-
class
|
|
512
|
+
class Token_json {
|
|
567
513
|
constructor(address, clients) {
|
|
568
514
|
this.contractAddress = address;
|
|
569
515
|
this.publicClient = clients.publicClient;
|
|
570
516
|
this.contract = (0, viem_1.getContract)({
|
|
571
517
|
address,
|
|
572
|
-
abi: exports.
|
|
518
|
+
abi: exports.Token_jsonAbi,
|
|
573
519
|
client: {
|
|
574
520
|
public: clients.publicClient,
|
|
575
521
|
wallet: clients.walletClient,
|
|
@@ -588,12 +534,19 @@ class ERC20Token_json {
|
|
|
588
534
|
getContract() {
|
|
589
535
|
return this.contract;
|
|
590
536
|
}
|
|
537
|
+
/**
|
|
538
|
+
* DOMAIN_SEPARATOR
|
|
539
|
+
* view
|
|
540
|
+
*/
|
|
541
|
+
async DOMAIN_SEPARATOR() {
|
|
542
|
+
return this.contract.read.DOMAIN_SEPARATOR();
|
|
543
|
+
}
|
|
591
544
|
/**
|
|
592
545
|
* allowance
|
|
593
546
|
* view
|
|
594
547
|
*/
|
|
595
|
-
async allowance(
|
|
596
|
-
return this.contract.read.allowance([
|
|
548
|
+
async allowance(_owner, spender) {
|
|
549
|
+
return this.contract.read.allowance([_owner, spender]);
|
|
597
550
|
}
|
|
598
551
|
/**
|
|
599
552
|
* balanceOf
|
|
@@ -609,6 +562,13 @@ class ERC20Token_json {
|
|
|
609
562
|
async decimals() {
|
|
610
563
|
return this.contract.read.decimals();
|
|
611
564
|
}
|
|
565
|
+
/**
|
|
566
|
+
* gateway
|
|
567
|
+
* view
|
|
568
|
+
*/
|
|
569
|
+
async gateway() {
|
|
570
|
+
return this.contract.read.gateway();
|
|
571
|
+
}
|
|
612
572
|
/**
|
|
613
573
|
* name
|
|
614
574
|
* view
|
|
@@ -617,11 +577,11 @@ class ERC20Token_json {
|
|
|
617
577
|
return this.contract.read.name();
|
|
618
578
|
}
|
|
619
579
|
/**
|
|
620
|
-
*
|
|
580
|
+
* nonces
|
|
621
581
|
* view
|
|
622
582
|
*/
|
|
623
|
-
async
|
|
624
|
-
return this.contract.read.
|
|
583
|
+
async nonces(account) {
|
|
584
|
+
return this.contract.read.nonces([account]);
|
|
625
585
|
}
|
|
626
586
|
/**
|
|
627
587
|
* symbol
|
|
@@ -642,11 +602,11 @@ class ERC20Token_json {
|
|
|
642
602
|
* nonpayable
|
|
643
603
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
644
604
|
*/
|
|
645
|
-
async approve(spender,
|
|
605
|
+
async approve(spender, amount, options) {
|
|
646
606
|
if (!this.contract.write) {
|
|
647
607
|
throw new Error('Wallet client is required for write operations');
|
|
648
608
|
}
|
|
649
|
-
return this.contract.write.approve([spender,
|
|
609
|
+
return this.contract.write.approve([spender, amount], options);
|
|
650
610
|
}
|
|
651
611
|
/**
|
|
652
612
|
* burn
|
|
@@ -671,81 +631,37 @@ class ERC20Token_json {
|
|
|
671
631
|
return this.contract.write.mint([account, amount], options);
|
|
672
632
|
}
|
|
673
633
|
/**
|
|
674
|
-
*
|
|
675
|
-
* nonpayable
|
|
676
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
677
|
-
*/
|
|
678
|
-
async renounceOwnership(options) {
|
|
679
|
-
if (!this.contract.write) {
|
|
680
|
-
throw new Error('Wallet client is required for write operations');
|
|
681
|
-
}
|
|
682
|
-
return this.contract.write.renounceOwnership(options);
|
|
683
|
-
}
|
|
684
|
-
/**
|
|
685
|
-
* setDecimals
|
|
634
|
+
* permit
|
|
686
635
|
* nonpayable
|
|
687
636
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
688
637
|
*/
|
|
689
|
-
async
|
|
638
|
+
async permit(issuer, spender, value, deadline, v, r, s, options) {
|
|
690
639
|
if (!this.contract.write) {
|
|
691
640
|
throw new Error('Wallet client is required for write operations');
|
|
692
641
|
}
|
|
693
|
-
return this.contract.write.
|
|
694
|
-
}
|
|
695
|
-
/**
|
|
696
|
-
* setName
|
|
697
|
-
* nonpayable
|
|
698
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
699
|
-
*/
|
|
700
|
-
async setName(newName, options) {
|
|
701
|
-
if (!this.contract.write) {
|
|
702
|
-
throw new Error('Wallet client is required for write operations');
|
|
703
|
-
}
|
|
704
|
-
return this.contract.write.setName([newName], options);
|
|
705
|
-
}
|
|
706
|
-
/**
|
|
707
|
-
* setSymbol
|
|
708
|
-
* nonpayable
|
|
709
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
710
|
-
*/
|
|
711
|
-
async setSymbol(newSymbol, options) {
|
|
712
|
-
if (!this.contract.write) {
|
|
713
|
-
throw new Error('Wallet client is required for write operations');
|
|
714
|
-
}
|
|
715
|
-
return this.contract.write.setSymbol([newSymbol], options);
|
|
642
|
+
return this.contract.write.permit([issuer, spender, value, deadline, v, r, s], options);
|
|
716
643
|
}
|
|
717
644
|
/**
|
|
718
645
|
* transfer
|
|
719
646
|
* nonpayable
|
|
720
647
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
721
648
|
*/
|
|
722
|
-
async transfer(
|
|
649
|
+
async transfer(recipient, amount, options) {
|
|
723
650
|
if (!this.contract.write) {
|
|
724
651
|
throw new Error('Wallet client is required for write operations');
|
|
725
652
|
}
|
|
726
|
-
return this.contract.write.transfer([
|
|
653
|
+
return this.contract.write.transfer([recipient, amount], options);
|
|
727
654
|
}
|
|
728
655
|
/**
|
|
729
656
|
* transferFrom
|
|
730
657
|
* nonpayable
|
|
731
658
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
732
659
|
*/
|
|
733
|
-
async transferFrom(
|
|
734
|
-
if (!this.contract.write) {
|
|
735
|
-
throw new Error('Wallet client is required for write operations');
|
|
736
|
-
}
|
|
737
|
-
return this.contract.write.transferFrom([from, to, value], options);
|
|
738
|
-
}
|
|
739
|
-
/**
|
|
740
|
-
* transferOwnership
|
|
741
|
-
* nonpayable
|
|
742
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
743
|
-
*/
|
|
744
|
-
async transferOwnership(newOwner, options) {
|
|
660
|
+
async transferFrom(sender, recipient, amount, options) {
|
|
745
661
|
if (!this.contract.write) {
|
|
746
662
|
throw new Error('Wallet client is required for write operations');
|
|
747
663
|
}
|
|
748
|
-
return this.contract.write.
|
|
664
|
+
return this.contract.write.transferFrom([sender, recipient, amount], options);
|
|
749
665
|
}
|
|
750
666
|
/**
|
|
751
667
|
* Simulate contract write operations (dry-run without sending transaction)
|
|
@@ -766,8 +682,8 @@ class ERC20Token_json {
|
|
|
766
682
|
* Returns gas estimate and result without sending transaction
|
|
767
683
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
768
684
|
*/
|
|
769
|
-
async approve(spender,
|
|
770
|
-
return contract.simulate.approve([spender,
|
|
685
|
+
async approve(spender, amount, options) {
|
|
686
|
+
return contract.simulate.approve([spender, amount], options);
|
|
771
687
|
},
|
|
772
688
|
/**
|
|
773
689
|
* Simulate burn
|
|
@@ -786,60 +702,28 @@ class ERC20Token_json {
|
|
|
786
702
|
return contract.simulate.mint([account, amount], options);
|
|
787
703
|
},
|
|
788
704
|
/**
|
|
789
|
-
* Simulate
|
|
705
|
+
* Simulate permit
|
|
790
706
|
* Returns gas estimate and result without sending transaction
|
|
791
707
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
792
708
|
*/
|
|
793
|
-
async
|
|
794
|
-
return contract.simulate.
|
|
795
|
-
},
|
|
796
|
-
/**
|
|
797
|
-
* Simulate setDecimals
|
|
798
|
-
* Returns gas estimate and result without sending transaction
|
|
799
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
800
|
-
*/
|
|
801
|
-
async setDecimals(newDecimals, options) {
|
|
802
|
-
return contract.simulate.setDecimals([newDecimals], options);
|
|
803
|
-
},
|
|
804
|
-
/**
|
|
805
|
-
* Simulate setName
|
|
806
|
-
* Returns gas estimate and result without sending transaction
|
|
807
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
808
|
-
*/
|
|
809
|
-
async setName(newName, options) {
|
|
810
|
-
return contract.simulate.setName([newName], options);
|
|
811
|
-
},
|
|
812
|
-
/**
|
|
813
|
-
* Simulate setSymbol
|
|
814
|
-
* Returns gas estimate and result without sending transaction
|
|
815
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
816
|
-
*/
|
|
817
|
-
async setSymbol(newSymbol, options) {
|
|
818
|
-
return contract.simulate.setSymbol([newSymbol], options);
|
|
709
|
+
async permit(issuer, spender, value, deadline, v, r, s, options) {
|
|
710
|
+
return contract.simulate.permit([issuer, spender, value, deadline, v, r, s], options);
|
|
819
711
|
},
|
|
820
712
|
/**
|
|
821
713
|
* Simulate transfer
|
|
822
714
|
* Returns gas estimate and result without sending transaction
|
|
823
715
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
824
716
|
*/
|
|
825
|
-
async transfer(
|
|
826
|
-
return contract.simulate.transfer([
|
|
717
|
+
async transfer(recipient, amount, options) {
|
|
718
|
+
return contract.simulate.transfer([recipient, amount], options);
|
|
827
719
|
},
|
|
828
720
|
/**
|
|
829
721
|
* Simulate transferFrom
|
|
830
722
|
* Returns gas estimate and result without sending transaction
|
|
831
723
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
832
724
|
*/
|
|
833
|
-
async transferFrom(
|
|
834
|
-
return contract.simulate.transferFrom([
|
|
835
|
-
},
|
|
836
|
-
/**
|
|
837
|
-
* Simulate transferOwnership
|
|
838
|
-
* Returns gas estimate and result without sending transaction
|
|
839
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
840
|
-
*/
|
|
841
|
-
async transferOwnership(newOwner, options) {
|
|
842
|
-
return contract.simulate.transferOwnership([newOwner], options);
|
|
725
|
+
async transferFrom(sender, recipient, amount, options) {
|
|
726
|
+
return contract.simulate.transferFrom([sender, recipient, amount], options);
|
|
843
727
|
}
|
|
844
728
|
};
|
|
845
729
|
}
|
|
@@ -866,7 +750,7 @@ class ERC20Token_json {
|
|
|
866
750
|
Approval: (callback, filter) => {
|
|
867
751
|
return this.publicClient.watchContractEvent({
|
|
868
752
|
address: this.contractAddress,
|
|
869
|
-
abi: exports.
|
|
753
|
+
abi: exports.Token_jsonAbi,
|
|
870
754
|
eventName: 'Approval',
|
|
871
755
|
args: filter,
|
|
872
756
|
onLogs: (logs) => {
|
|
@@ -876,79 +760,6 @@ class ERC20Token_json {
|
|
|
876
760
|
},
|
|
877
761
|
});
|
|
878
762
|
},
|
|
879
|
-
/**
|
|
880
|
-
* Watch OwnershipTransferred events
|
|
881
|
-
* @param callback Function to call when event is emitted
|
|
882
|
-
* @param filter Optional filter for indexed parameters
|
|
883
|
-
* @returns Unwatch function to stop listening
|
|
884
|
-
*/
|
|
885
|
-
OwnershipTransferred: (callback, filter) => {
|
|
886
|
-
return this.publicClient.watchContractEvent({
|
|
887
|
-
address: this.contractAddress,
|
|
888
|
-
abi: exports.ERC20Token_jsonAbi,
|
|
889
|
-
eventName: 'OwnershipTransferred',
|
|
890
|
-
args: filter,
|
|
891
|
-
onLogs: (logs) => {
|
|
892
|
-
logs.forEach((log) => {
|
|
893
|
-
callback(log.args);
|
|
894
|
-
});
|
|
895
|
-
},
|
|
896
|
-
});
|
|
897
|
-
},
|
|
898
|
-
/**
|
|
899
|
-
* Watch SetDecimals events
|
|
900
|
-
* @param callback Function to call when event is emitted
|
|
901
|
-
* @param filter Optional filter for indexed parameters
|
|
902
|
-
* @returns Unwatch function to stop listening
|
|
903
|
-
*/
|
|
904
|
-
SetDecimals: (callback) => {
|
|
905
|
-
return this.publicClient.watchContractEvent({
|
|
906
|
-
address: this.contractAddress,
|
|
907
|
-
abi: exports.ERC20Token_jsonAbi,
|
|
908
|
-
eventName: 'SetDecimals',
|
|
909
|
-
onLogs: (logs) => {
|
|
910
|
-
logs.forEach((log) => {
|
|
911
|
-
callback(log.args);
|
|
912
|
-
});
|
|
913
|
-
},
|
|
914
|
-
});
|
|
915
|
-
},
|
|
916
|
-
/**
|
|
917
|
-
* Watch SetName events
|
|
918
|
-
* @param callback Function to call when event is emitted
|
|
919
|
-
* @param filter Optional filter for indexed parameters
|
|
920
|
-
* @returns Unwatch function to stop listening
|
|
921
|
-
*/
|
|
922
|
-
SetName: (callback) => {
|
|
923
|
-
return this.publicClient.watchContractEvent({
|
|
924
|
-
address: this.contractAddress,
|
|
925
|
-
abi: exports.ERC20Token_jsonAbi,
|
|
926
|
-
eventName: 'SetName',
|
|
927
|
-
onLogs: (logs) => {
|
|
928
|
-
logs.forEach((log) => {
|
|
929
|
-
callback(log.args);
|
|
930
|
-
});
|
|
931
|
-
},
|
|
932
|
-
});
|
|
933
|
-
},
|
|
934
|
-
/**
|
|
935
|
-
* Watch SetSymbol events
|
|
936
|
-
* @param callback Function to call when event is emitted
|
|
937
|
-
* @param filter Optional filter for indexed parameters
|
|
938
|
-
* @returns Unwatch function to stop listening
|
|
939
|
-
*/
|
|
940
|
-
SetSymbol: (callback) => {
|
|
941
|
-
return this.publicClient.watchContractEvent({
|
|
942
|
-
address: this.contractAddress,
|
|
943
|
-
abi: exports.ERC20Token_jsonAbi,
|
|
944
|
-
eventName: 'SetSymbol',
|
|
945
|
-
onLogs: (logs) => {
|
|
946
|
-
logs.forEach((log) => {
|
|
947
|
-
callback(log.args);
|
|
948
|
-
});
|
|
949
|
-
},
|
|
950
|
-
});
|
|
951
|
-
},
|
|
952
763
|
/**
|
|
953
764
|
* Watch Transfer events
|
|
954
765
|
* @param callback Function to call when event is emitted
|
|
@@ -958,7 +769,7 @@ class ERC20Token_json {
|
|
|
958
769
|
Transfer: (callback, filter) => {
|
|
959
770
|
return this.publicClient.watchContractEvent({
|
|
960
771
|
address: this.contractAddress,
|
|
961
|
-
abi: exports.
|
|
772
|
+
abi: exports.Token_jsonAbi,
|
|
962
773
|
eventName: 'Transfer',
|
|
963
774
|
args: filter,
|
|
964
775
|
onLogs: (logs) => {
|
|
@@ -971,4 +782,4 @@ class ERC20Token_json {
|
|
|
971
782
|
};
|
|
972
783
|
}
|
|
973
784
|
}
|
|
974
|
-
exports.
|
|
785
|
+
exports.Token_json = Token_json;
|