@gitmyabi/stakingmanager 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/contracts/index.d.ts +2 -2
- package/contracts/index.js +4 -4
- package/contracts/index.ts +2 -2
- package/contracts/{stakingManagerV2_json.d.ts → stakingManagerV4_json.d.ts} +193 -100
- package/contracts/{stakingManagerV2_json.js → stakingManagerV4_json.js} +212 -99
- package/contracts/{stakingManagerV2_json.ts → stakingManagerV4_json.ts} +255 -125
- package/package.json +3 -3
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.stakingManagerV4_json = exports.stakingManagerV4_jsonAbi = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* stakingManagerV4_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.stakingManagerV4_jsonAbi = [
|
|
11
11
|
{
|
|
12
12
|
"inputs": [],
|
|
13
13
|
"stateMutability": "nonpayable",
|
|
@@ -103,36 +103,16 @@ exports.stakingManagerV2_jsonAbi = [
|
|
|
103
103
|
"type": "event"
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
|
-
"inputs": [
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
"name": "_rewardTokenAddress",
|
|
110
|
-
"type": "address"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"internalType": "address",
|
|
114
|
-
"name": "_presale",
|
|
115
|
-
"type": "address"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"internalType": "uint256",
|
|
119
|
-
"name": "_rewardTokensPerBlock",
|
|
120
|
-
"type": "uint256"
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"internalType": "uint256",
|
|
124
|
-
"name": "_lockTime",
|
|
125
|
-
"type": "uint256"
|
|
126
|
-
},
|
|
106
|
+
"inputs": [],
|
|
107
|
+
"name": "accShareOld",
|
|
108
|
+
"outputs": [
|
|
127
109
|
{
|
|
128
110
|
"internalType": "uint256",
|
|
129
|
-
"name": "
|
|
111
|
+
"name": "",
|
|
130
112
|
"type": "uint256"
|
|
131
113
|
}
|
|
132
114
|
],
|
|
133
|
-
"
|
|
134
|
-
"outputs": [],
|
|
135
|
-
"stateMutability": "nonpayable",
|
|
115
|
+
"stateMutability": "view",
|
|
136
116
|
"type": "function"
|
|
137
117
|
},
|
|
138
118
|
{
|
|
@@ -293,36 +273,43 @@ exports.stakingManagerV2_jsonAbi = [
|
|
|
293
273
|
"inputs": [
|
|
294
274
|
{
|
|
295
275
|
"internalType": "address",
|
|
296
|
-
"name": "",
|
|
276
|
+
"name": "_user",
|
|
297
277
|
"type": "address"
|
|
298
278
|
}
|
|
299
279
|
],
|
|
300
280
|
"name": "poolStakers",
|
|
301
281
|
"outputs": [
|
|
302
282
|
{
|
|
303
|
-
"
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
283
|
+
"components": [
|
|
284
|
+
{
|
|
285
|
+
"internalType": "uint256",
|
|
286
|
+
"name": "amount",
|
|
287
|
+
"type": "uint256"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"internalType": "uint256",
|
|
291
|
+
"name": "stakedTime",
|
|
292
|
+
"type": "uint256"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"internalType": "uint256",
|
|
296
|
+
"name": "lastUpdatedBlock",
|
|
297
|
+
"type": "uint256"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"internalType": "uint256",
|
|
301
|
+
"name": "Harvestedrewards",
|
|
302
|
+
"type": "uint256"
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"internalType": "uint256",
|
|
306
|
+
"name": "rewardDebt",
|
|
307
|
+
"type": "uint256"
|
|
308
|
+
}
|
|
309
|
+
],
|
|
310
|
+
"internalType": "struct stakingManagerV4.PoolStaker",
|
|
311
|
+
"name": "",
|
|
312
|
+
"type": "tuple"
|
|
326
313
|
}
|
|
327
314
|
],
|
|
328
315
|
"stateMutability": "view",
|
|
@@ -452,6 +439,32 @@ exports.stakingManagerV2_jsonAbi = [
|
|
|
452
439
|
"stateMutability": "nonpayable",
|
|
453
440
|
"type": "function"
|
|
454
441
|
},
|
|
442
|
+
{
|
|
443
|
+
"inputs": [
|
|
444
|
+
{
|
|
445
|
+
"internalType": "bool",
|
|
446
|
+
"name": "_vestLock",
|
|
447
|
+
"type": "bool"
|
|
448
|
+
}
|
|
449
|
+
],
|
|
450
|
+
"name": "setVestLock",
|
|
451
|
+
"outputs": [],
|
|
452
|
+
"stateMutability": "nonpayable",
|
|
453
|
+
"type": "function"
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
"inputs": [
|
|
457
|
+
{
|
|
458
|
+
"internalType": "uint256",
|
|
459
|
+
"name": "_vestingEndTime",
|
|
460
|
+
"type": "uint256"
|
|
461
|
+
}
|
|
462
|
+
],
|
|
463
|
+
"name": "setVestingDetails",
|
|
464
|
+
"outputs": [],
|
|
465
|
+
"stateMutability": "nonpayable",
|
|
466
|
+
"type": "function"
|
|
467
|
+
},
|
|
455
468
|
{
|
|
456
469
|
"inputs": [],
|
|
457
470
|
"name": "stakeToken",
|
|
@@ -466,26 +479,21 @@ exports.stakingManagerV2_jsonAbi = [
|
|
|
466
479
|
"type": "function"
|
|
467
480
|
},
|
|
468
481
|
{
|
|
469
|
-
"inputs": [
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
"name": "_token",
|
|
473
|
-
"type": "address"
|
|
474
|
-
},
|
|
482
|
+
"inputs": [],
|
|
483
|
+
"name": "tokensStaked",
|
|
484
|
+
"outputs": [
|
|
475
485
|
{
|
|
476
486
|
"internalType": "uint256",
|
|
477
|
-
"name": "
|
|
487
|
+
"name": "",
|
|
478
488
|
"type": "uint256"
|
|
479
489
|
}
|
|
480
490
|
],
|
|
481
|
-
"
|
|
482
|
-
"outputs": [],
|
|
483
|
-
"stateMutability": "nonpayable",
|
|
491
|
+
"stateMutability": "view",
|
|
484
492
|
"type": "function"
|
|
485
493
|
},
|
|
486
494
|
{
|
|
487
495
|
"inputs": [],
|
|
488
|
-
"name": "
|
|
496
|
+
"name": "tokensStakedByPresale",
|
|
489
497
|
"outputs": [
|
|
490
498
|
{
|
|
491
499
|
"internalType": "uint256",
|
|
@@ -498,7 +506,7 @@ exports.stakingManagerV2_jsonAbi = [
|
|
|
498
506
|
},
|
|
499
507
|
{
|
|
500
508
|
"inputs": [],
|
|
501
|
-
"name": "
|
|
509
|
+
"name": "tokensStakedPrev",
|
|
502
510
|
"outputs": [
|
|
503
511
|
{
|
|
504
512
|
"internalType": "uint256",
|
|
@@ -541,6 +549,69 @@ exports.stakingManagerV2_jsonAbi = [
|
|
|
541
549
|
"stateMutability": "view",
|
|
542
550
|
"type": "function"
|
|
543
551
|
},
|
|
552
|
+
{
|
|
553
|
+
"inputs": [
|
|
554
|
+
{
|
|
555
|
+
"internalType": "address",
|
|
556
|
+
"name": "",
|
|
557
|
+
"type": "address"
|
|
558
|
+
}
|
|
559
|
+
],
|
|
560
|
+
"name": "userVestingDetails",
|
|
561
|
+
"outputs": [
|
|
562
|
+
{
|
|
563
|
+
"internalType": "uint256",
|
|
564
|
+
"name": "totalVestedAmount",
|
|
565
|
+
"type": "uint256"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"internalType": "uint256",
|
|
569
|
+
"name": "totalAmountGivenOut",
|
|
570
|
+
"type": "uint256"
|
|
571
|
+
}
|
|
572
|
+
],
|
|
573
|
+
"stateMutability": "view",
|
|
574
|
+
"type": "function"
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
"inputs": [],
|
|
578
|
+
"name": "vestLock",
|
|
579
|
+
"outputs": [
|
|
580
|
+
{
|
|
581
|
+
"internalType": "bool",
|
|
582
|
+
"name": "",
|
|
583
|
+
"type": "bool"
|
|
584
|
+
}
|
|
585
|
+
],
|
|
586
|
+
"stateMutability": "view",
|
|
587
|
+
"type": "function"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"inputs": [],
|
|
591
|
+
"name": "vestingEndTime",
|
|
592
|
+
"outputs": [
|
|
593
|
+
{
|
|
594
|
+
"internalType": "uint256",
|
|
595
|
+
"name": "",
|
|
596
|
+
"type": "uint256"
|
|
597
|
+
}
|
|
598
|
+
],
|
|
599
|
+
"stateMutability": "view",
|
|
600
|
+
"type": "function"
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
"inputs": [],
|
|
604
|
+
"name": "vestingStartBlock",
|
|
605
|
+
"outputs": [
|
|
606
|
+
{
|
|
607
|
+
"internalType": "uint256",
|
|
608
|
+
"name": "",
|
|
609
|
+
"type": "uint256"
|
|
610
|
+
}
|
|
611
|
+
],
|
|
612
|
+
"stateMutability": "view",
|
|
613
|
+
"type": "function"
|
|
614
|
+
},
|
|
544
615
|
{
|
|
545
616
|
"inputs": [],
|
|
546
617
|
"name": "withdraw",
|
|
@@ -550,7 +621,7 @@ exports.stakingManagerV2_jsonAbi = [
|
|
|
550
621
|
}
|
|
551
622
|
];
|
|
552
623
|
/**
|
|
553
|
-
*
|
|
624
|
+
* stakingManagerV4_json Contract Class
|
|
554
625
|
*
|
|
555
626
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
556
627
|
*
|
|
@@ -558,12 +629,12 @@ exports.stakingManagerV2_jsonAbi = [
|
|
|
558
629
|
* ```typescript
|
|
559
630
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
560
631
|
* import { mainnet } from 'viem/chains';
|
|
561
|
-
* import {
|
|
632
|
+
* import { stakingManagerV4_json } from 'stakingManagerV4_json';
|
|
562
633
|
*
|
|
563
634
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
564
635
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
565
636
|
*
|
|
566
|
-
* const contract = new
|
|
637
|
+
* const contract = new stakingManagerV4_json('0x...', { publicClient, walletClient });
|
|
567
638
|
*
|
|
568
639
|
* // Read functions
|
|
569
640
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -581,13 +652,13 @@ exports.stakingManagerV2_jsonAbi = [
|
|
|
581
652
|
* });
|
|
582
653
|
* ```
|
|
583
654
|
*/
|
|
584
|
-
class
|
|
655
|
+
class stakingManagerV4_json {
|
|
585
656
|
constructor(address, clients) {
|
|
586
657
|
this.contractAddress = address;
|
|
587
658
|
this.publicClient = clients.publicClient;
|
|
588
659
|
this.contract = (0, viem_1.getContract)({
|
|
589
660
|
address,
|
|
590
|
-
abi: exports.
|
|
661
|
+
abi: exports.stakingManagerV4_jsonAbi,
|
|
591
662
|
client: {
|
|
592
663
|
public: clients.publicClient,
|
|
593
664
|
wallet: clients.walletClient,
|
|
@@ -606,6 +677,13 @@ class stakingManagerV2_json {
|
|
|
606
677
|
getContract() {
|
|
607
678
|
return this.contract;
|
|
608
679
|
}
|
|
680
|
+
/**
|
|
681
|
+
* accShareOld
|
|
682
|
+
* view
|
|
683
|
+
*/
|
|
684
|
+
async accShareOld() {
|
|
685
|
+
return this.contract.read.accShareOld();
|
|
686
|
+
}
|
|
609
687
|
/**
|
|
610
688
|
* claimStart
|
|
611
689
|
* view
|
|
@@ -659,8 +737,8 @@ class stakingManagerV2_json {
|
|
|
659
737
|
* poolStakers
|
|
660
738
|
* view
|
|
661
739
|
*/
|
|
662
|
-
async poolStakers(
|
|
663
|
-
return this.contract.read.poolStakers([
|
|
740
|
+
async poolStakers(_user) {
|
|
741
|
+
return this.contract.read.poolStakers([_user]);
|
|
664
742
|
}
|
|
665
743
|
/**
|
|
666
744
|
* presaleContract
|
|
@@ -697,6 +775,13 @@ class stakingManagerV2_json {
|
|
|
697
775
|
async tokensStakedByPresale() {
|
|
698
776
|
return this.contract.read.tokensStakedByPresale();
|
|
699
777
|
}
|
|
778
|
+
/**
|
|
779
|
+
* tokensStakedPrev
|
|
780
|
+
* view
|
|
781
|
+
*/
|
|
782
|
+
async tokensStakedPrev() {
|
|
783
|
+
return this.contract.read.tokensStakedPrev();
|
|
784
|
+
}
|
|
700
785
|
/**
|
|
701
786
|
* userLockedRewards
|
|
702
787
|
* view
|
|
@@ -705,15 +790,32 @@ class stakingManagerV2_json {
|
|
|
705
790
|
return this.contract.read.userLockedRewards([arg0]);
|
|
706
791
|
}
|
|
707
792
|
/**
|
|
708
|
-
*
|
|
709
|
-
*
|
|
710
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
793
|
+
* userVestingDetails
|
|
794
|
+
* view
|
|
711
795
|
*/
|
|
712
|
-
async
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
796
|
+
async userVestingDetails(arg0) {
|
|
797
|
+
return this.contract.read.userVestingDetails([arg0]);
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* vestLock
|
|
801
|
+
* view
|
|
802
|
+
*/
|
|
803
|
+
async vestLock() {
|
|
804
|
+
return this.contract.read.vestLock();
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* vestingEndTime
|
|
808
|
+
* view
|
|
809
|
+
*/
|
|
810
|
+
async vestingEndTime() {
|
|
811
|
+
return this.contract.read.vestingEndTime();
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* vestingStartBlock
|
|
815
|
+
* view
|
|
816
|
+
*/
|
|
817
|
+
async vestingStartBlock() {
|
|
818
|
+
return this.contract.read.vestingStartBlock();
|
|
717
819
|
}
|
|
718
820
|
/**
|
|
719
821
|
* blacklistUsers
|
|
@@ -848,15 +950,26 @@ class stakingManagerV2_json {
|
|
|
848
950
|
return this.contract.write.setStakeToken([_stakeToken], options);
|
|
849
951
|
}
|
|
850
952
|
/**
|
|
851
|
-
*
|
|
953
|
+
* setVestLock
|
|
852
954
|
* nonpayable
|
|
853
955
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
854
956
|
*/
|
|
855
|
-
async
|
|
957
|
+
async setVestLock(_vestLock, options) {
|
|
856
958
|
if (!this.contract.write) {
|
|
857
959
|
throw new Error('Wallet client is required for write operations');
|
|
858
960
|
}
|
|
859
|
-
return this.contract.write.
|
|
961
|
+
return this.contract.write.setVestLock([_vestLock], options);
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* setVestingDetails
|
|
965
|
+
* nonpayable
|
|
966
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
967
|
+
*/
|
|
968
|
+
async setVestingDetails(_vestingEndTime, options) {
|
|
969
|
+
if (!this.contract.write) {
|
|
970
|
+
throw new Error('Wallet client is required for write operations');
|
|
971
|
+
}
|
|
972
|
+
return this.contract.write.setVestingDetails([_vestingEndTime], options);
|
|
860
973
|
}
|
|
861
974
|
/**
|
|
862
975
|
* transferOwnership
|
|
@@ -894,14 +1007,6 @@ class stakingManagerV2_json {
|
|
|
894
1007
|
throw new Error('Public client is required for simulation');
|
|
895
1008
|
}
|
|
896
1009
|
return {
|
|
897
|
-
/**
|
|
898
|
-
* Simulate __stakingManager_init
|
|
899
|
-
* Returns gas estimate and result without sending transaction
|
|
900
|
-
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
901
|
-
*/
|
|
902
|
-
async __stakingManager_init(_rewardTokenAddress, _presale, _rewardTokensPerBlock, _lockTime, _endBlock, options) {
|
|
903
|
-
return contract.simulate.__stakingManager_init([_rewardTokenAddress, _presale, _rewardTokensPerBlock, _lockTime, _endBlock], options);
|
|
904
|
-
},
|
|
905
1010
|
/**
|
|
906
1011
|
* Simulate blacklistUsers
|
|
907
1012
|
* Returns gas estimate and result without sending transaction
|
|
@@ -999,12 +1104,20 @@ class stakingManagerV2_json {
|
|
|
999
1104
|
return contract.simulate.setStakeToken([_stakeToken], options);
|
|
1000
1105
|
},
|
|
1001
1106
|
/**
|
|
1002
|
-
* Simulate
|
|
1107
|
+
* Simulate setVestLock
|
|
1108
|
+
* Returns gas estimate and result without sending transaction
|
|
1109
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1110
|
+
*/
|
|
1111
|
+
async setVestLock(_vestLock, options) {
|
|
1112
|
+
return contract.simulate.setVestLock([_vestLock], options);
|
|
1113
|
+
},
|
|
1114
|
+
/**
|
|
1115
|
+
* Simulate setVestingDetails
|
|
1003
1116
|
* Returns gas estimate and result without sending transaction
|
|
1004
1117
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1005
1118
|
*/
|
|
1006
|
-
async
|
|
1007
|
-
return contract.simulate.
|
|
1119
|
+
async setVestingDetails(_vestingEndTime, options) {
|
|
1120
|
+
return contract.simulate.setVestingDetails([_vestingEndTime], options);
|
|
1008
1121
|
},
|
|
1009
1122
|
/**
|
|
1010
1123
|
* Simulate transferOwnership
|
|
@@ -1047,7 +1160,7 @@ class stakingManagerV2_json {
|
|
|
1047
1160
|
Deposit: (callback, filter) => {
|
|
1048
1161
|
return this.publicClient.watchContractEvent({
|
|
1049
1162
|
address: this.contractAddress,
|
|
1050
|
-
abi: exports.
|
|
1163
|
+
abi: exports.stakingManagerV4_jsonAbi,
|
|
1051
1164
|
eventName: 'Deposit',
|
|
1052
1165
|
args: filter,
|
|
1053
1166
|
onLogs: (logs) => {
|
|
@@ -1066,7 +1179,7 @@ class stakingManagerV2_json {
|
|
|
1066
1179
|
HarvestRewards: (callback, filter) => {
|
|
1067
1180
|
return this.publicClient.watchContractEvent({
|
|
1068
1181
|
address: this.contractAddress,
|
|
1069
|
-
abi: exports.
|
|
1182
|
+
abi: exports.stakingManagerV4_jsonAbi,
|
|
1070
1183
|
eventName: 'HarvestRewards',
|
|
1071
1184
|
args: filter,
|
|
1072
1185
|
onLogs: (logs) => {
|
|
@@ -1085,7 +1198,7 @@ class stakingManagerV2_json {
|
|
|
1085
1198
|
Initialized: (callback) => {
|
|
1086
1199
|
return this.publicClient.watchContractEvent({
|
|
1087
1200
|
address: this.contractAddress,
|
|
1088
|
-
abi: exports.
|
|
1201
|
+
abi: exports.stakingManagerV4_jsonAbi,
|
|
1089
1202
|
eventName: 'Initialized',
|
|
1090
1203
|
onLogs: (logs) => {
|
|
1091
1204
|
logs.forEach((log) => {
|
|
@@ -1103,7 +1216,7 @@ class stakingManagerV2_json {
|
|
|
1103
1216
|
OwnershipTransferred: (callback, filter) => {
|
|
1104
1217
|
return this.publicClient.watchContractEvent({
|
|
1105
1218
|
address: this.contractAddress,
|
|
1106
|
-
abi: exports.
|
|
1219
|
+
abi: exports.stakingManagerV4_jsonAbi,
|
|
1107
1220
|
eventName: 'OwnershipTransferred',
|
|
1108
1221
|
args: filter,
|
|
1109
1222
|
onLogs: (logs) => {
|
|
@@ -1122,7 +1235,7 @@ class stakingManagerV2_json {
|
|
|
1122
1235
|
Withdraw: (callback, filter) => {
|
|
1123
1236
|
return this.publicClient.watchContractEvent({
|
|
1124
1237
|
address: this.contractAddress,
|
|
1125
|
-
abi: exports.
|
|
1238
|
+
abi: exports.stakingManagerV4_jsonAbi,
|
|
1126
1239
|
eventName: 'Withdraw',
|
|
1127
1240
|
args: filter,
|
|
1128
1241
|
onLogs: (logs) => {
|
|
@@ -1135,4 +1248,4 @@ class stakingManagerV2_json {
|
|
|
1135
1248
|
};
|
|
1136
1249
|
}
|
|
1137
1250
|
}
|
|
1138
|
-
exports.
|
|
1251
|
+
exports.stakingManagerV4_json = stakingManagerV4_json;
|