@gitmyabi/stakingmanager 1.0.3 → 1.0.4

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.
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stakingManagerV4_json = exports.stakingManagerV4_jsonAbi = void 0;
3
+ exports.stakingManagerV2_json = exports.stakingManagerV2_jsonAbi = void 0;
4
4
  const viem_1 = require("viem");
5
5
  /**
6
- * stakingManagerV4_json ABI
6
+ * stakingManagerV2_json ABI
7
7
  *
8
8
  * This ABI is typed using viem's type system for full type safety.
9
9
  */
10
- exports.stakingManagerV4_jsonAbi = [
10
+ exports.stakingManagerV2_jsonAbi = [
11
11
  {
12
12
  "inputs": [],
13
13
  "stateMutability": "nonpayable",
@@ -103,16 +103,36 @@ exports.stakingManagerV4_jsonAbi = [
103
103
  "type": "event"
104
104
  },
105
105
  {
106
- "inputs": [],
107
- "name": "accShareOld",
108
- "outputs": [
106
+ "inputs": [
107
+ {
108
+ "internalType": "address",
109
+ "name": "_rewardTokenAddress",
110
+ "type": "address"
111
+ },
112
+ {
113
+ "internalType": "address",
114
+ "name": "_presale",
115
+ "type": "address"
116
+ },
109
117
  {
110
118
  "internalType": "uint256",
111
- "name": "",
119
+ "name": "_rewardTokensPerBlock",
120
+ "type": "uint256"
121
+ },
122
+ {
123
+ "internalType": "uint256",
124
+ "name": "_lockTime",
125
+ "type": "uint256"
126
+ },
127
+ {
128
+ "internalType": "uint256",
129
+ "name": "_endBlock",
112
130
  "type": "uint256"
113
131
  }
114
132
  ],
115
- "stateMutability": "view",
133
+ "name": "__stakingManager_init",
134
+ "outputs": [],
135
+ "stateMutability": "nonpayable",
116
136
  "type": "function"
117
137
  },
118
138
  {
@@ -273,43 +293,36 @@ exports.stakingManagerV4_jsonAbi = [
273
293
  "inputs": [
274
294
  {
275
295
  "internalType": "address",
276
- "name": "_user",
296
+ "name": "",
277
297
  "type": "address"
278
298
  }
279
299
  ],
280
300
  "name": "poolStakers",
281
301
  "outputs": [
282
302
  {
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"
303
+ "internalType": "uint256",
304
+ "name": "amount",
305
+ "type": "uint256"
306
+ },
307
+ {
308
+ "internalType": "uint256",
309
+ "name": "stakedTime",
310
+ "type": "uint256"
311
+ },
312
+ {
313
+ "internalType": "uint256",
314
+ "name": "lastUpdatedBlock",
315
+ "type": "uint256"
316
+ },
317
+ {
318
+ "internalType": "uint256",
319
+ "name": "Harvestedrewards",
320
+ "type": "uint256"
321
+ },
322
+ {
323
+ "internalType": "uint256",
324
+ "name": "rewardDebt",
325
+ "type": "uint256"
313
326
  }
314
327
  ],
315
328
  "stateMutability": "view",
@@ -439,32 +452,6 @@ exports.stakingManagerV4_jsonAbi = [
439
452
  "stateMutability": "nonpayable",
440
453
  "type": "function"
441
454
  },
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
- },
468
455
  {
469
456
  "inputs": [],
470
457
  "name": "stakeToken",
@@ -479,21 +466,26 @@ exports.stakingManagerV4_jsonAbi = [
479
466
  "type": "function"
480
467
  },
481
468
  {
482
- "inputs": [],
483
- "name": "tokensStaked",
484
- "outputs": [
469
+ "inputs": [
470
+ {
471
+ "internalType": "address",
472
+ "name": "_token",
473
+ "type": "address"
474
+ },
485
475
  {
486
476
  "internalType": "uint256",
487
- "name": "",
477
+ "name": "_amount",
488
478
  "type": "uint256"
489
479
  }
490
480
  ],
491
- "stateMutability": "view",
481
+ "name": "tokenTransfer",
482
+ "outputs": [],
483
+ "stateMutability": "nonpayable",
492
484
  "type": "function"
493
485
  },
494
486
  {
495
487
  "inputs": [],
496
- "name": "tokensStakedByPresale",
488
+ "name": "tokensStaked",
497
489
  "outputs": [
498
490
  {
499
491
  "internalType": "uint256",
@@ -506,7 +498,7 @@ exports.stakingManagerV4_jsonAbi = [
506
498
  },
507
499
  {
508
500
  "inputs": [],
509
- "name": "tokensStakedPrev",
501
+ "name": "tokensStakedByPresale",
510
502
  "outputs": [
511
503
  {
512
504
  "internalType": "uint256",
@@ -549,69 +541,6 @@ exports.stakingManagerV4_jsonAbi = [
549
541
  "stateMutability": "view",
550
542
  "type": "function"
551
543
  },
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
- },
615
544
  {
616
545
  "inputs": [],
617
546
  "name": "withdraw",
@@ -621,7 +550,7 @@ exports.stakingManagerV4_jsonAbi = [
621
550
  }
622
551
  ];
623
552
  /**
624
- * stakingManagerV4_json Contract Class
553
+ * stakingManagerV2_json Contract Class
625
554
  *
626
555
  * Provides a class-based API similar to TypeChain for interacting with the contract.
627
556
  *
@@ -629,12 +558,12 @@ exports.stakingManagerV4_jsonAbi = [
629
558
  * ```typescript
630
559
  * import { createPublicClient, createWalletClient, http } from 'viem';
631
560
  * import { mainnet } from 'viem/chains';
632
- * import { stakingManagerV4_json } from 'stakingManagerV4_json';
561
+ * import { stakingManagerV2_json } from 'stakingManagerV2_json';
633
562
  *
634
563
  * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
635
564
  * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
636
565
  *
637
- * const contract = new stakingManagerV4_json('0x...', { publicClient, walletClient });
566
+ * const contract = new stakingManagerV2_json('0x...', { publicClient, walletClient });
638
567
  *
639
568
  * // Read functions
640
569
  * const result = await contract.balanceOf('0x...');
@@ -652,13 +581,13 @@ exports.stakingManagerV4_jsonAbi = [
652
581
  * });
653
582
  * ```
654
583
  */
655
- class stakingManagerV4_json {
584
+ class stakingManagerV2_json {
656
585
  constructor(address, clients) {
657
586
  this.contractAddress = address;
658
587
  this.publicClient = clients.publicClient;
659
588
  this.contract = (0, viem_1.getContract)({
660
589
  address,
661
- abi: exports.stakingManagerV4_jsonAbi,
590
+ abi: exports.stakingManagerV2_jsonAbi,
662
591
  client: {
663
592
  public: clients.publicClient,
664
593
  wallet: clients.walletClient,
@@ -677,13 +606,6 @@ class stakingManagerV4_json {
677
606
  getContract() {
678
607
  return this.contract;
679
608
  }
680
- /**
681
- * accShareOld
682
- * view
683
- */
684
- async accShareOld() {
685
- return this.contract.read.accShareOld();
686
- }
687
609
  /**
688
610
  * claimStart
689
611
  * view
@@ -737,8 +659,8 @@ class stakingManagerV4_json {
737
659
  * poolStakers
738
660
  * view
739
661
  */
740
- async poolStakers(_user) {
741
- return this.contract.read.poolStakers([_user]);
662
+ async poolStakers(arg0) {
663
+ return this.contract.read.poolStakers([arg0]);
742
664
  }
743
665
  /**
744
666
  * presaleContract
@@ -775,13 +697,6 @@ class stakingManagerV4_json {
775
697
  async tokensStakedByPresale() {
776
698
  return this.contract.read.tokensStakedByPresale();
777
699
  }
778
- /**
779
- * tokensStakedPrev
780
- * view
781
- */
782
- async tokensStakedPrev() {
783
- return this.contract.read.tokensStakedPrev();
784
- }
785
700
  /**
786
701
  * userLockedRewards
787
702
  * view
@@ -790,32 +705,15 @@ class stakingManagerV4_json {
790
705
  return this.contract.read.userLockedRewards([arg0]);
791
706
  }
792
707
  /**
793
- * userVestingDetails
794
- * view
795
- */
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
708
+ * __stakingManager_init
709
+ * nonpayable
710
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
816
711
  */
817
- async vestingStartBlock() {
818
- return this.contract.read.vestingStartBlock();
712
+ async __stakingManager_init(_rewardTokenAddress, _presale, _rewardTokensPerBlock, _lockTime, _endBlock, options) {
713
+ if (!this.contract.write) {
714
+ throw new Error('Wallet client is required for write operations');
715
+ }
716
+ return this.contract.write.__stakingManager_init([_rewardTokenAddress, _presale, _rewardTokensPerBlock, _lockTime, _endBlock], options);
819
717
  }
820
718
  /**
821
719
  * blacklistUsers
@@ -950,26 +848,15 @@ class stakingManagerV4_json {
950
848
  return this.contract.write.setStakeToken([_stakeToken], options);
951
849
  }
952
850
  /**
953
- * setVestLock
851
+ * tokenTransfer
954
852
  * nonpayable
955
853
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
956
854
  */
957
- async setVestLock(_vestLock, options) {
855
+ async tokenTransfer(_token, _amount, options) {
958
856
  if (!this.contract.write) {
959
857
  throw new Error('Wallet client is required for write operations');
960
858
  }
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);
859
+ return this.contract.write.tokenTransfer([_token, _amount], options);
973
860
  }
974
861
  /**
975
862
  * transferOwnership
@@ -1007,6 +894,14 @@ class stakingManagerV4_json {
1007
894
  throw new Error('Public client is required for simulation');
1008
895
  }
1009
896
  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
+ },
1010
905
  /**
1011
906
  * Simulate blacklistUsers
1012
907
  * Returns gas estimate and result without sending transaction
@@ -1104,20 +999,12 @@ class stakingManagerV4_json {
1104
999
  return contract.simulate.setStakeToken([_stakeToken], options);
1105
1000
  },
1106
1001
  /**
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
1002
+ * Simulate tokenTransfer
1116
1003
  * Returns gas estimate and result without sending transaction
1117
1004
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
1118
1005
  */
1119
- async setVestingDetails(_vestingEndTime, options) {
1120
- return contract.simulate.setVestingDetails([_vestingEndTime], options);
1006
+ async tokenTransfer(_token, _amount, options) {
1007
+ return contract.simulate.tokenTransfer([_token, _amount], options);
1121
1008
  },
1122
1009
  /**
1123
1010
  * Simulate transferOwnership
@@ -1160,7 +1047,7 @@ class stakingManagerV4_json {
1160
1047
  Deposit: (callback, filter) => {
1161
1048
  return this.publicClient.watchContractEvent({
1162
1049
  address: this.contractAddress,
1163
- abi: exports.stakingManagerV4_jsonAbi,
1050
+ abi: exports.stakingManagerV2_jsonAbi,
1164
1051
  eventName: 'Deposit',
1165
1052
  args: filter,
1166
1053
  onLogs: (logs) => {
@@ -1179,7 +1066,7 @@ class stakingManagerV4_json {
1179
1066
  HarvestRewards: (callback, filter) => {
1180
1067
  return this.publicClient.watchContractEvent({
1181
1068
  address: this.contractAddress,
1182
- abi: exports.stakingManagerV4_jsonAbi,
1069
+ abi: exports.stakingManagerV2_jsonAbi,
1183
1070
  eventName: 'HarvestRewards',
1184
1071
  args: filter,
1185
1072
  onLogs: (logs) => {
@@ -1198,7 +1085,7 @@ class stakingManagerV4_json {
1198
1085
  Initialized: (callback) => {
1199
1086
  return this.publicClient.watchContractEvent({
1200
1087
  address: this.contractAddress,
1201
- abi: exports.stakingManagerV4_jsonAbi,
1088
+ abi: exports.stakingManagerV2_jsonAbi,
1202
1089
  eventName: 'Initialized',
1203
1090
  onLogs: (logs) => {
1204
1091
  logs.forEach((log) => {
@@ -1216,7 +1103,7 @@ class stakingManagerV4_json {
1216
1103
  OwnershipTransferred: (callback, filter) => {
1217
1104
  return this.publicClient.watchContractEvent({
1218
1105
  address: this.contractAddress,
1219
- abi: exports.stakingManagerV4_jsonAbi,
1106
+ abi: exports.stakingManagerV2_jsonAbi,
1220
1107
  eventName: 'OwnershipTransferred',
1221
1108
  args: filter,
1222
1109
  onLogs: (logs) => {
@@ -1235,7 +1122,7 @@ class stakingManagerV4_json {
1235
1122
  Withdraw: (callback, filter) => {
1236
1123
  return this.publicClient.watchContractEvent({
1237
1124
  address: this.contractAddress,
1238
- abi: exports.stakingManagerV4_jsonAbi,
1125
+ abi: exports.stakingManagerV2_jsonAbi,
1239
1126
  eventName: 'Withdraw',
1240
1127
  args: filter,
1241
1128
  onLogs: (logs) => {
@@ -1248,4 +1135,4 @@ class stakingManagerV4_json {
1248
1135
  };
1249
1136
  }
1250
1137
  }
1251
- exports.stakingManagerV4_json = stakingManagerV4_json;
1138
+ exports.stakingManagerV2_json = stakingManagerV2_json;