@gitmyabi/stakingmanager 1.0.4 → 1.0.5

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.stakingManagerV2_json = exports.stakingManagerV2_jsonAbi = void 0;
3
+ exports.stakingManagerV4_json = exports.stakingManagerV4_jsonAbi = void 0;
4
4
  const viem_1 = require("viem");
5
5
  /**
6
- * stakingManagerV2_json ABI
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.stakingManagerV2_jsonAbi = [
10
+ exports.stakingManagerV4_jsonAbi = [
11
11
  {
12
12
  "inputs": [],
13
13
  "stateMutability": "nonpayable",
@@ -97,65 +97,69 @@ exports.stakingManagerV2_jsonAbi = [
97
97
  "internalType": "uint256",
98
98
  "name": "amount",
99
99
  "type": "uint256"
100
+ },
101
+ {
102
+ "indexed": false,
103
+ "internalType": "uint256",
104
+ "name": "timestamp",
105
+ "type": "uint256"
100
106
  }
101
107
  ],
102
- "name": "Withdraw",
108
+ "name": "RestakePrincipal",
103
109
  "type": "event"
104
110
  },
105
111
  {
112
+ "anonymous": false,
106
113
  "inputs": [
107
114
  {
115
+ "indexed": true,
108
116
  "internalType": "address",
109
- "name": "_rewardTokenAddress",
110
- "type": "address"
111
- },
112
- {
113
- "internalType": "address",
114
- "name": "_presale",
117
+ "name": "user",
115
118
  "type": "address"
116
119
  },
117
120
  {
121
+ "indexed": false,
118
122
  "internalType": "uint256",
119
- "name": "_rewardTokensPerBlock",
120
- "type": "uint256"
121
- },
122
- {
123
- "internalType": "uint256",
124
- "name": "_lockTime",
123
+ "name": "amount",
125
124
  "type": "uint256"
126
125
  },
127
126
  {
127
+ "indexed": false,
128
128
  "internalType": "uint256",
129
- "name": "_endBlock",
129
+ "name": "timestamp",
130
130
  "type": "uint256"
131
131
  }
132
132
  ],
133
- "name": "__stakingManager_init",
134
- "outputs": [],
135
- "stateMutability": "nonpayable",
136
- "type": "function"
133
+ "name": "RestakeRewards",
134
+ "type": "event"
137
135
  },
138
136
  {
137
+ "anonymous": false,
139
138
  "inputs": [
140
139
  {
141
- "internalType": "address[]",
142
- "name": "_usersToBlacklist",
143
- "type": "address[]"
140
+ "indexed": true,
141
+ "internalType": "address",
142
+ "name": "user",
143
+ "type": "address"
144
+ },
145
+ {
146
+ "indexed": false,
147
+ "internalType": "uint256",
148
+ "name": "amount",
149
+ "type": "uint256"
144
150
  }
145
151
  ],
146
- "name": "blacklistUsers",
147
- "outputs": [],
148
- "stateMutability": "nonpayable",
149
- "type": "function"
152
+ "name": "Withdraw",
153
+ "type": "event"
150
154
  },
151
155
  {
152
156
  "inputs": [],
153
- "name": "claimStart",
157
+ "name": "DEV_WALLET",
154
158
  "outputs": [
155
159
  {
156
- "internalType": "uint256",
160
+ "internalType": "address",
157
161
  "name": "",
158
- "type": "uint256"
162
+ "type": "address"
159
163
  }
160
164
  ],
161
165
  "stateMutability": "view",
@@ -164,32 +168,27 @@ exports.stakingManagerV2_jsonAbi = [
164
168
  {
165
169
  "inputs": [
166
170
  {
167
- "internalType": "uint256",
168
- "name": "_amount",
169
- "type": "uint256"
171
+ "internalType": "address[]",
172
+ "name": "_usersToBlacklist",
173
+ "type": "address[]"
170
174
  }
171
175
  ],
172
- "name": "deposit",
176
+ "name": "blacklistUsers",
173
177
  "outputs": [],
174
178
  "stateMutability": "nonpayable",
175
179
  "type": "function"
176
180
  },
177
181
  {
178
- "inputs": [
179
- {
180
- "internalType": "address",
181
- "name": "_user",
182
- "type": "address"
183
- },
182
+ "inputs": [],
183
+ "name": "claimStart",
184
+ "outputs": [
184
185
  {
185
186
  "internalType": "uint256",
186
- "name": "_amount",
187
+ "name": "",
187
188
  "type": "uint256"
188
189
  }
189
190
  ],
190
- "name": "depositByPresale",
191
- "outputs": [],
192
- "stateMutability": "nonpayable",
191
+ "stateMutability": "view",
193
192
  "type": "function"
194
193
  },
195
194
  {
@@ -276,6 +275,19 @@ exports.stakingManagerV2_jsonAbi = [
276
275
  "stateMutability": "view",
277
276
  "type": "function"
278
277
  },
278
+ {
279
+ "inputs": [],
280
+ "name": "newStaking",
281
+ "outputs": [
282
+ {
283
+ "internalType": "contract INewStaking",
284
+ "name": "",
285
+ "type": "address"
286
+ }
287
+ ],
288
+ "stateMutability": "view",
289
+ "type": "function"
290
+ },
279
291
  {
280
292
  "inputs": [],
281
293
  "name": "owner",
@@ -361,6 +373,13 @@ exports.stakingManagerV2_jsonAbi = [
361
373
  "stateMutability": "nonpayable",
362
374
  "type": "function"
363
375
  },
376
+ {
377
+ "inputs": [],
378
+ "name": "restakeNew",
379
+ "outputs": [],
380
+ "stateMutability": "nonpayable",
381
+ "type": "function"
382
+ },
364
383
  {
365
384
  "inputs": [],
366
385
  "name": "rewardTokensPerBlock",
@@ -374,19 +393,6 @@ exports.stakingManagerV2_jsonAbi = [
374
393
  "stateMutability": "view",
375
394
  "type": "function"
376
395
  },
377
- {
378
- "inputs": [
379
- {
380
- "internalType": "uint256",
381
- "name": "_claimStart",
382
- "type": "uint256"
383
- }
384
- ],
385
- "name": "setClaimStart",
386
- "outputs": [],
387
- "stateMutability": "nonpayable",
388
- "type": "function"
389
- },
390
396
  {
391
397
  "inputs": [
392
398
  {
@@ -400,41 +406,15 @@ exports.stakingManagerV2_jsonAbi = [
400
406
  "stateMutability": "nonpayable",
401
407
  "type": "function"
402
408
  },
403
- {
404
- "inputs": [
405
- {
406
- "internalType": "bool",
407
- "name": "_harvestlock",
408
- "type": "bool"
409
- }
410
- ],
411
- "name": "setHarvestLock",
412
- "outputs": [],
413
- "stateMutability": "nonpayable",
414
- "type": "function"
415
- },
416
- {
417
- "inputs": [
418
- {
419
- "internalType": "uint256",
420
- "name": "_time",
421
- "type": "uint256"
422
- }
423
- ],
424
- "name": "setLockedTime",
425
- "outputs": [],
426
- "stateMutability": "nonpayable",
427
- "type": "function"
428
- },
429
409
  {
430
410
  "inputs": [
431
411
  {
432
412
  "internalType": "address",
433
- "name": "_presale",
413
+ "name": "_stakingContract",
434
414
  "type": "address"
435
415
  }
436
416
  ],
437
- "name": "setPresale",
417
+ "name": "setNewStaking",
438
418
  "outputs": [],
439
419
  "stateMutability": "nonpayable",
440
420
  "type": "function"
@@ -467,14 +447,9 @@ exports.stakingManagerV2_jsonAbi = [
467
447
  },
468
448
  {
469
449
  "inputs": [
470
- {
471
- "internalType": "address",
472
- "name": "_token",
473
- "type": "address"
474
- },
475
450
  {
476
451
  "internalType": "uint256",
477
- "name": "_amount",
452
+ "name": "amount",
478
453
  "type": "uint256"
479
454
  }
480
455
  ],
@@ -550,7 +525,7 @@ exports.stakingManagerV2_jsonAbi = [
550
525
  }
551
526
  ];
552
527
  /**
553
- * stakingManagerV2_json Contract Class
528
+ * stakingManagerV4_json Contract Class
554
529
  *
555
530
  * Provides a class-based API similar to TypeChain for interacting with the contract.
556
531
  *
@@ -558,12 +533,12 @@ exports.stakingManagerV2_jsonAbi = [
558
533
  * ```typescript
559
534
  * import { createPublicClient, createWalletClient, http } from 'viem';
560
535
  * import { mainnet } from 'viem/chains';
561
- * import { stakingManagerV2_json } from 'stakingManagerV2_json';
536
+ * import { stakingManagerV4_json } from 'stakingManagerV4_json';
562
537
  *
563
538
  * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
564
539
  * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
565
540
  *
566
- * const contract = new stakingManagerV2_json('0x...', { publicClient, walletClient });
541
+ * const contract = new stakingManagerV4_json('0x...', { publicClient, walletClient });
567
542
  *
568
543
  * // Read functions
569
544
  * const result = await contract.balanceOf('0x...');
@@ -581,13 +556,13 @@ exports.stakingManagerV2_jsonAbi = [
581
556
  * });
582
557
  * ```
583
558
  */
584
- class stakingManagerV2_json {
559
+ class stakingManagerV4_json {
585
560
  constructor(address, clients) {
586
561
  this.contractAddress = address;
587
562
  this.publicClient = clients.publicClient;
588
563
  this.contract = (0, viem_1.getContract)({
589
564
  address,
590
- abi: exports.stakingManagerV2_jsonAbi,
565
+ abi: exports.stakingManagerV4_jsonAbi,
591
566
  client: {
592
567
  public: clients.publicClient,
593
568
  wallet: clients.walletClient,
@@ -606,6 +581,13 @@ class stakingManagerV2_json {
606
581
  getContract() {
607
582
  return this.contract;
608
583
  }
584
+ /**
585
+ * DEV_WALLET
586
+ * view
587
+ */
588
+ async DEV_WALLET() {
589
+ return this.contract.read.DEV_WALLET();
590
+ }
609
591
  /**
610
592
  * claimStart
611
593
  * view
@@ -648,6 +630,13 @@ class stakingManagerV2_json {
648
630
  async lockedTime() {
649
631
  return this.contract.read.lockedTime();
650
632
  }
633
+ /**
634
+ * newStaking
635
+ * view
636
+ */
637
+ async newStaking() {
638
+ return this.contract.read.newStaking();
639
+ }
651
640
  /**
652
641
  * owner
653
642
  * view
@@ -704,17 +693,6 @@ class stakingManagerV2_json {
704
693
  async userLockedRewards(arg0) {
705
694
  return this.contract.read.userLockedRewards([arg0]);
706
695
  }
707
- /**
708
- * __stakingManager_init
709
- * nonpayable
710
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
711
- */
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);
717
- }
718
696
  /**
719
697
  * blacklistUsers
720
698
  * nonpayable
@@ -726,28 +704,6 @@ class stakingManagerV2_json {
726
704
  }
727
705
  return this.contract.write.blacklistUsers([_usersToBlacklist], options);
728
706
  }
729
- /**
730
- * deposit
731
- * nonpayable
732
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
733
- */
734
- async deposit(_amount, options) {
735
- if (!this.contract.write) {
736
- throw new Error('Wallet client is required for write operations');
737
- }
738
- return this.contract.write.deposit([_amount], options);
739
- }
740
- /**
741
- * depositByPresale
742
- * nonpayable
743
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
744
- */
745
- async depositByPresale(_user, _amount, options) {
746
- if (!this.contract.write) {
747
- throw new Error('Wallet client is required for write operations');
748
- }
749
- return this.contract.write.depositByPresale([_user, _amount], options);
750
- }
751
707
  /**
752
708
  * harvestRewards
753
709
  * nonpayable
@@ -782,15 +738,15 @@ class stakingManagerV2_json {
782
738
  return this.contract.write.renounceOwnership(options);
783
739
  }
784
740
  /**
785
- * setClaimStart
741
+ * restakeNew
786
742
  * nonpayable
787
743
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
788
744
  */
789
- async setClaimStart(_claimStart, options) {
745
+ async restakeNew(options) {
790
746
  if (!this.contract.write) {
791
747
  throw new Error('Wallet client is required for write operations');
792
748
  }
793
- return this.contract.write.setClaimStart([_claimStart], options);
749
+ return this.contract.write.restakeNew(options);
794
750
  }
795
751
  /**
796
752
  * setEndBlock
@@ -804,37 +760,15 @@ class stakingManagerV2_json {
804
760
  return this.contract.write.setEndBlock([_endBlock], options);
805
761
  }
806
762
  /**
807
- * setHarvestLock
808
- * nonpayable
809
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
810
- */
811
- async setHarvestLock(_harvestlock, options) {
812
- if (!this.contract.write) {
813
- throw new Error('Wallet client is required for write operations');
814
- }
815
- return this.contract.write.setHarvestLock([_harvestlock], options);
816
- }
817
- /**
818
- * setLockedTime
763
+ * setNewStaking
819
764
  * nonpayable
820
765
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
821
766
  */
822
- async setLockedTime(_time, options) {
767
+ async setNewStaking(_stakingContract, options) {
823
768
  if (!this.contract.write) {
824
769
  throw new Error('Wallet client is required for write operations');
825
770
  }
826
- return this.contract.write.setLockedTime([_time], options);
827
- }
828
- /**
829
- * setPresale
830
- * nonpayable
831
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
832
- */
833
- async setPresale(_presale, options) {
834
- if (!this.contract.write) {
835
- throw new Error('Wallet client is required for write operations');
836
- }
837
- return this.contract.write.setPresale([_presale], options);
771
+ return this.contract.write.setNewStaking([_stakingContract], options);
838
772
  }
839
773
  /**
840
774
  * setStakeToken
@@ -852,11 +786,11 @@ class stakingManagerV2_json {
852
786
  * nonpayable
853
787
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
854
788
  */
855
- async tokenTransfer(_token, _amount, options) {
789
+ async tokenTransfer(amount, options) {
856
790
  if (!this.contract.write) {
857
791
  throw new Error('Wallet client is required for write operations');
858
792
  }
859
- return this.contract.write.tokenTransfer([_token, _amount], options);
793
+ return this.contract.write.tokenTransfer([amount], options);
860
794
  }
861
795
  /**
862
796
  * transferOwnership
@@ -894,14 +828,6 @@ class stakingManagerV2_json {
894
828
  throw new Error('Public client is required for simulation');
895
829
  }
896
830
  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
831
  /**
906
832
  * Simulate blacklistUsers
907
833
  * Returns gas estimate and result without sending transaction
@@ -910,22 +836,6 @@ class stakingManagerV2_json {
910
836
  async blacklistUsers(_usersToBlacklist, options) {
911
837
  return contract.simulate.blacklistUsers([_usersToBlacklist], options);
912
838
  },
913
- /**
914
- * Simulate deposit
915
- * Returns gas estimate and result without sending transaction
916
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
917
- */
918
- async deposit(_amount, options) {
919
- return contract.simulate.deposit([_amount], options);
920
- },
921
- /**
922
- * Simulate depositByPresale
923
- * Returns gas estimate and result without sending transaction
924
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
925
- */
926
- async depositByPresale(_user, _amount, options) {
927
- return contract.simulate.depositByPresale([_user, _amount], options);
928
- },
929
839
  /**
930
840
  * Simulate harvestRewards
931
841
  * Returns gas estimate and result without sending transaction
@@ -951,12 +861,12 @@ class stakingManagerV2_json {
951
861
  return contract.simulate.renounceOwnership(options);
952
862
  },
953
863
  /**
954
- * Simulate setClaimStart
864
+ * Simulate restakeNew
955
865
  * Returns gas estimate and result without sending transaction
956
866
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
957
867
  */
958
- async setClaimStart(_claimStart, options) {
959
- return contract.simulate.setClaimStart([_claimStart], options);
868
+ async restakeNew(options) {
869
+ return contract.simulate.restakeNew(options);
960
870
  },
961
871
  /**
962
872
  * Simulate setEndBlock
@@ -967,28 +877,12 @@ class stakingManagerV2_json {
967
877
  return contract.simulate.setEndBlock([_endBlock], options);
968
878
  },
969
879
  /**
970
- * Simulate setHarvestLock
971
- * Returns gas estimate and result without sending transaction
972
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
973
- */
974
- async setHarvestLock(_harvestlock, options) {
975
- return contract.simulate.setHarvestLock([_harvestlock], options);
976
- },
977
- /**
978
- * Simulate setLockedTime
880
+ * Simulate setNewStaking
979
881
  * Returns gas estimate and result without sending transaction
980
882
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
981
883
  */
982
- async setLockedTime(_time, options) {
983
- return contract.simulate.setLockedTime([_time], options);
984
- },
985
- /**
986
- * Simulate setPresale
987
- * Returns gas estimate and result without sending transaction
988
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
989
- */
990
- async setPresale(_presale, options) {
991
- return contract.simulate.setPresale([_presale], options);
884
+ async setNewStaking(_stakingContract, options) {
885
+ return contract.simulate.setNewStaking([_stakingContract], options);
992
886
  },
993
887
  /**
994
888
  * Simulate setStakeToken
@@ -1003,8 +897,8 @@ class stakingManagerV2_json {
1003
897
  * Returns gas estimate and result without sending transaction
1004
898
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
1005
899
  */
1006
- async tokenTransfer(_token, _amount, options) {
1007
- return contract.simulate.tokenTransfer([_token, _amount], options);
900
+ async tokenTransfer(amount, options) {
901
+ return contract.simulate.tokenTransfer([amount], options);
1008
902
  },
1009
903
  /**
1010
904
  * Simulate transferOwnership
@@ -1047,7 +941,7 @@ class stakingManagerV2_json {
1047
941
  Deposit: (callback, filter) => {
1048
942
  return this.publicClient.watchContractEvent({
1049
943
  address: this.contractAddress,
1050
- abi: exports.stakingManagerV2_jsonAbi,
944
+ abi: exports.stakingManagerV4_jsonAbi,
1051
945
  eventName: 'Deposit',
1052
946
  args: filter,
1053
947
  onLogs: (logs) => {
@@ -1066,7 +960,7 @@ class stakingManagerV2_json {
1066
960
  HarvestRewards: (callback, filter) => {
1067
961
  return this.publicClient.watchContractEvent({
1068
962
  address: this.contractAddress,
1069
- abi: exports.stakingManagerV2_jsonAbi,
963
+ abi: exports.stakingManagerV4_jsonAbi,
1070
964
  eventName: 'HarvestRewards',
1071
965
  args: filter,
1072
966
  onLogs: (logs) => {
@@ -1085,7 +979,7 @@ class stakingManagerV2_json {
1085
979
  Initialized: (callback) => {
1086
980
  return this.publicClient.watchContractEvent({
1087
981
  address: this.contractAddress,
1088
- abi: exports.stakingManagerV2_jsonAbi,
982
+ abi: exports.stakingManagerV4_jsonAbi,
1089
983
  eventName: 'Initialized',
1090
984
  onLogs: (logs) => {
1091
985
  logs.forEach((log) => {
@@ -1103,7 +997,7 @@ class stakingManagerV2_json {
1103
997
  OwnershipTransferred: (callback, filter) => {
1104
998
  return this.publicClient.watchContractEvent({
1105
999
  address: this.contractAddress,
1106
- abi: exports.stakingManagerV2_jsonAbi,
1000
+ abi: exports.stakingManagerV4_jsonAbi,
1107
1001
  eventName: 'OwnershipTransferred',
1108
1002
  args: filter,
1109
1003
  onLogs: (logs) => {
@@ -1113,6 +1007,44 @@ class stakingManagerV2_json {
1113
1007
  },
1114
1008
  });
1115
1009
  },
1010
+ /**
1011
+ * Watch RestakePrincipal events
1012
+ * @param callback Function to call when event is emitted
1013
+ * @param filter Optional filter for indexed parameters
1014
+ * @returns Unwatch function to stop listening
1015
+ */
1016
+ RestakePrincipal: (callback, filter) => {
1017
+ return this.publicClient.watchContractEvent({
1018
+ address: this.contractAddress,
1019
+ abi: exports.stakingManagerV4_jsonAbi,
1020
+ eventName: 'RestakePrincipal',
1021
+ args: filter,
1022
+ onLogs: (logs) => {
1023
+ logs.forEach((log) => {
1024
+ callback(log.args);
1025
+ });
1026
+ },
1027
+ });
1028
+ },
1029
+ /**
1030
+ * Watch RestakeRewards events
1031
+ * @param callback Function to call when event is emitted
1032
+ * @param filter Optional filter for indexed parameters
1033
+ * @returns Unwatch function to stop listening
1034
+ */
1035
+ RestakeRewards: (callback, filter) => {
1036
+ return this.publicClient.watchContractEvent({
1037
+ address: this.contractAddress,
1038
+ abi: exports.stakingManagerV4_jsonAbi,
1039
+ eventName: 'RestakeRewards',
1040
+ args: filter,
1041
+ onLogs: (logs) => {
1042
+ logs.forEach((log) => {
1043
+ callback(log.args);
1044
+ });
1045
+ },
1046
+ });
1047
+ },
1116
1048
  /**
1117
1049
  * Watch Withdraw events
1118
1050
  * @param callback Function to call when event is emitted
@@ -1122,7 +1054,7 @@ class stakingManagerV2_json {
1122
1054
  Withdraw: (callback, filter) => {
1123
1055
  return this.publicClient.watchContractEvent({
1124
1056
  address: this.contractAddress,
1125
- abi: exports.stakingManagerV2_jsonAbi,
1057
+ abi: exports.stakingManagerV4_jsonAbi,
1126
1058
  eventName: 'Withdraw',
1127
1059
  args: filter,
1128
1060
  onLogs: (logs) => {
@@ -1135,4 +1067,4 @@ class stakingManagerV2_json {
1135
1067
  };
1136
1068
  }
1137
1069
  }
1138
- exports.stakingManagerV2_json = stakingManagerV2_json;
1070
+ exports.stakingManagerV4_json = stakingManagerV4_json;