@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,23 +1,12 @@
1
1
  import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
2
  import { getContract } from 'viem';
3
3
 
4
-
5
- /**
6
- * stakingManagerV4.PoolStaker struct type
7
- */
8
- export type stakingManagerV4_PoolStaker = {
9
- amount: bigint;
10
- stakedTime: bigint;
11
- lastUpdatedBlock: bigint;
12
- Harvestedrewards: bigint;
13
- rewardDebt: bigint;
14
- };
15
4
  /**
16
- * stakingManagerV4_json ABI
5
+ * stakingManagerV2_json ABI
17
6
  *
18
7
  * This ABI is typed using viem's type system for full type safety.
19
8
  */
20
- export const stakingManagerV4_jsonAbi = [
9
+ export const stakingManagerV2_jsonAbi = [
21
10
  {
22
11
  "inputs": [],
23
12
  "stateMutability": "nonpayable",
@@ -113,16 +102,36 @@ export const stakingManagerV4_jsonAbi = [
113
102
  "type": "event"
114
103
  },
115
104
  {
116
- "inputs": [],
117
- "name": "accShareOld",
118
- "outputs": [
105
+ "inputs": [
106
+ {
107
+ "internalType": "address",
108
+ "name": "_rewardTokenAddress",
109
+ "type": "address"
110
+ },
111
+ {
112
+ "internalType": "address",
113
+ "name": "_presale",
114
+ "type": "address"
115
+ },
119
116
  {
120
117
  "internalType": "uint256",
121
- "name": "",
118
+ "name": "_rewardTokensPerBlock",
119
+ "type": "uint256"
120
+ },
121
+ {
122
+ "internalType": "uint256",
123
+ "name": "_lockTime",
124
+ "type": "uint256"
125
+ },
126
+ {
127
+ "internalType": "uint256",
128
+ "name": "_endBlock",
122
129
  "type": "uint256"
123
130
  }
124
131
  ],
125
- "stateMutability": "view",
132
+ "name": "__stakingManager_init",
133
+ "outputs": [],
134
+ "stateMutability": "nonpayable",
126
135
  "type": "function"
127
136
  },
128
137
  {
@@ -283,43 +292,36 @@ export const stakingManagerV4_jsonAbi = [
283
292
  "inputs": [
284
293
  {
285
294
  "internalType": "address",
286
- "name": "_user",
295
+ "name": "",
287
296
  "type": "address"
288
297
  }
289
298
  ],
290
299
  "name": "poolStakers",
291
300
  "outputs": [
292
301
  {
293
- "components": [
294
- {
295
- "internalType": "uint256",
296
- "name": "amount",
297
- "type": "uint256"
298
- },
299
- {
300
- "internalType": "uint256",
301
- "name": "stakedTime",
302
- "type": "uint256"
303
- },
304
- {
305
- "internalType": "uint256",
306
- "name": "lastUpdatedBlock",
307
- "type": "uint256"
308
- },
309
- {
310
- "internalType": "uint256",
311
- "name": "Harvestedrewards",
312
- "type": "uint256"
313
- },
314
- {
315
- "internalType": "uint256",
316
- "name": "rewardDebt",
317
- "type": "uint256"
318
- }
319
- ],
320
- "internalType": "struct stakingManagerV4.PoolStaker",
321
- "name": "",
322
- "type": "tuple"
302
+ "internalType": "uint256",
303
+ "name": "amount",
304
+ "type": "uint256"
305
+ },
306
+ {
307
+ "internalType": "uint256",
308
+ "name": "stakedTime",
309
+ "type": "uint256"
310
+ },
311
+ {
312
+ "internalType": "uint256",
313
+ "name": "lastUpdatedBlock",
314
+ "type": "uint256"
315
+ },
316
+ {
317
+ "internalType": "uint256",
318
+ "name": "Harvestedrewards",
319
+ "type": "uint256"
320
+ },
321
+ {
322
+ "internalType": "uint256",
323
+ "name": "rewardDebt",
324
+ "type": "uint256"
323
325
  }
324
326
  ],
325
327
  "stateMutability": "view",
@@ -449,32 +451,6 @@ export const stakingManagerV4_jsonAbi = [
449
451
  "stateMutability": "nonpayable",
450
452
  "type": "function"
451
453
  },
452
- {
453
- "inputs": [
454
- {
455
- "internalType": "bool",
456
- "name": "_vestLock",
457
- "type": "bool"
458
- }
459
- ],
460
- "name": "setVestLock",
461
- "outputs": [],
462
- "stateMutability": "nonpayable",
463
- "type": "function"
464
- },
465
- {
466
- "inputs": [
467
- {
468
- "internalType": "uint256",
469
- "name": "_vestingEndTime",
470
- "type": "uint256"
471
- }
472
- ],
473
- "name": "setVestingDetails",
474
- "outputs": [],
475
- "stateMutability": "nonpayable",
476
- "type": "function"
477
- },
478
454
  {
479
455
  "inputs": [],
480
456
  "name": "stakeToken",
@@ -489,21 +465,26 @@ export const stakingManagerV4_jsonAbi = [
489
465
  "type": "function"
490
466
  },
491
467
  {
492
- "inputs": [],
493
- "name": "tokensStaked",
494
- "outputs": [
468
+ "inputs": [
469
+ {
470
+ "internalType": "address",
471
+ "name": "_token",
472
+ "type": "address"
473
+ },
495
474
  {
496
475
  "internalType": "uint256",
497
- "name": "",
476
+ "name": "_amount",
498
477
  "type": "uint256"
499
478
  }
500
479
  ],
501
- "stateMutability": "view",
480
+ "name": "tokenTransfer",
481
+ "outputs": [],
482
+ "stateMutability": "nonpayable",
502
483
  "type": "function"
503
484
  },
504
485
  {
505
486
  "inputs": [],
506
- "name": "tokensStakedByPresale",
487
+ "name": "tokensStaked",
507
488
  "outputs": [
508
489
  {
509
490
  "internalType": "uint256",
@@ -516,7 +497,7 @@ export const stakingManagerV4_jsonAbi = [
516
497
  },
517
498
  {
518
499
  "inputs": [],
519
- "name": "tokensStakedPrev",
500
+ "name": "tokensStakedByPresale",
520
501
  "outputs": [
521
502
  {
522
503
  "internalType": "uint256",
@@ -559,69 +540,6 @@ export const stakingManagerV4_jsonAbi = [
559
540
  "stateMutability": "view",
560
541
  "type": "function"
561
542
  },
562
- {
563
- "inputs": [
564
- {
565
- "internalType": "address",
566
- "name": "",
567
- "type": "address"
568
- }
569
- ],
570
- "name": "userVestingDetails",
571
- "outputs": [
572
- {
573
- "internalType": "uint256",
574
- "name": "totalVestedAmount",
575
- "type": "uint256"
576
- },
577
- {
578
- "internalType": "uint256",
579
- "name": "totalAmountGivenOut",
580
- "type": "uint256"
581
- }
582
- ],
583
- "stateMutability": "view",
584
- "type": "function"
585
- },
586
- {
587
- "inputs": [],
588
- "name": "vestLock",
589
- "outputs": [
590
- {
591
- "internalType": "bool",
592
- "name": "",
593
- "type": "bool"
594
- }
595
- ],
596
- "stateMutability": "view",
597
- "type": "function"
598
- },
599
- {
600
- "inputs": [],
601
- "name": "vestingEndTime",
602
- "outputs": [
603
- {
604
- "internalType": "uint256",
605
- "name": "",
606
- "type": "uint256"
607
- }
608
- ],
609
- "stateMutability": "view",
610
- "type": "function"
611
- },
612
- {
613
- "inputs": [],
614
- "name": "vestingStartBlock",
615
- "outputs": [
616
- {
617
- "internalType": "uint256",
618
- "name": "",
619
- "type": "uint256"
620
- }
621
- ],
622
- "stateMutability": "view",
623
- "type": "function"
624
- },
625
543
  {
626
544
  "inputs": [],
627
545
  "name": "withdraw",
@@ -632,19 +550,19 @@ export const stakingManagerV4_jsonAbi = [
632
550
  ] as const satisfies Abi;
633
551
 
634
552
  /**
635
- * Type-safe ABI for stakingManagerV4_json
553
+ * Type-safe ABI for stakingManagerV2_json
636
554
  */
637
- export type stakingManagerV4_jsonAbi = typeof stakingManagerV4_jsonAbi;
555
+ export type stakingManagerV2_jsonAbi = typeof stakingManagerV2_jsonAbi;
638
556
 
639
557
  /**
640
- * Contract instance type for stakingManagerV4_json
558
+ * Contract instance type for stakingManagerV2_json
641
559
  */
642
560
  // Use any for contract type to avoid complex viem type issues
643
561
  // The runtime behavior is type-safe through viem's ABI typing
644
- export type stakingManagerV4_jsonContract = any;
562
+ export type stakingManagerV2_jsonContract = any;
645
563
 
646
564
  /**
647
- * stakingManagerV4_json Contract Class
565
+ * stakingManagerV2_json Contract Class
648
566
  *
649
567
  * Provides a class-based API similar to TypeChain for interacting with the contract.
650
568
  *
@@ -652,12 +570,12 @@ export type stakingManagerV4_jsonContract = any;
652
570
  * ```typescript
653
571
  * import { createPublicClient, createWalletClient, http } from 'viem';
654
572
  * import { mainnet } from 'viem/chains';
655
- * import { stakingManagerV4_json } from 'stakingManagerV4_json';
573
+ * import { stakingManagerV2_json } from 'stakingManagerV2_json';
656
574
  *
657
575
  * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
658
576
  * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
659
577
  *
660
- * const contract = new stakingManagerV4_json('0x...', { publicClient, walletClient });
578
+ * const contract = new stakingManagerV2_json('0x...', { publicClient, walletClient });
661
579
  *
662
580
  * // Read functions
663
581
  * const result = await contract.balanceOf('0x...');
@@ -675,8 +593,8 @@ export type stakingManagerV4_jsonContract = any;
675
593
  * });
676
594
  * ```
677
595
  */
678
- export class stakingManagerV4_json {
679
- private contract: stakingManagerV4_jsonContract;
596
+ export class stakingManagerV2_json {
597
+ private contract: stakingManagerV2_jsonContract;
680
598
  private contractAddress: Address;
681
599
  private publicClient: PublicClient;
682
600
 
@@ -691,7 +609,7 @@ export class stakingManagerV4_json {
691
609
  this.publicClient = clients.publicClient;
692
610
  this.contract = getContract({
693
611
  address,
694
- abi: stakingManagerV4_jsonAbi,
612
+ abi: stakingManagerV2_jsonAbi,
695
613
  client: {
696
614
  public: clients.publicClient,
697
615
  wallet: clients.walletClient,
@@ -709,18 +627,10 @@ export class stakingManagerV4_json {
709
627
  /**
710
628
  * Get the underlying viem contract instance
711
629
  */
712
- getContract(): stakingManagerV4_jsonContract {
630
+ getContract(): stakingManagerV2_jsonContract {
713
631
  return this.contract;
714
632
  }
715
633
 
716
- /**
717
- * accShareOld
718
- * view
719
- */
720
- async accShareOld(): Promise<bigint> {
721
- return this.contract.read.accShareOld() as Promise<bigint>;
722
- }
723
-
724
634
  /**
725
635
  * claimStart
726
636
  * view
@@ -781,8 +691,8 @@ export class stakingManagerV4_json {
781
691
  * poolStakers
782
692
  * view
783
693
  */
784
- async poolStakers(_user: `0x${string}`): Promise<stakingManagerV4_PoolStaker> {
785
- return this.contract.read.poolStakers([_user] as const) as Promise<stakingManagerV4_PoolStaker>;
694
+ async poolStakers(arg0: `0x${string}`): Promise<[bigint, bigint, bigint, bigint, bigint]> {
695
+ return this.contract.read.poolStakers([arg0] as const) as Promise<[bigint, bigint, bigint, bigint, bigint]>;
786
696
  }
787
697
 
788
698
  /**
@@ -825,14 +735,6 @@ export class stakingManagerV4_json {
825
735
  return this.contract.read.tokensStakedByPresale() as Promise<bigint>;
826
736
  }
827
737
 
828
- /**
829
- * tokensStakedPrev
830
- * view
831
- */
832
- async tokensStakedPrev(): Promise<bigint> {
833
- return this.contract.read.tokensStakedPrev() as Promise<bigint>;
834
- }
835
-
836
738
  /**
837
739
  * userLockedRewards
838
740
  * view
@@ -842,35 +744,26 @@ export class stakingManagerV4_json {
842
744
  }
843
745
 
844
746
  /**
845
- * userVestingDetails
846
- * view
847
- */
848
- async userVestingDetails(arg0: `0x${string}`): Promise<[bigint, bigint]> {
849
- return this.contract.read.userVestingDetails([arg0] as const) as Promise<[bigint, bigint]>;
850
- }
851
-
852
- /**
853
- * vestLock
854
- * view
855
- */
856
- async vestLock(): Promise<boolean> {
857
- return this.contract.read.vestLock() as Promise<boolean>;
858
- }
859
-
860
- /**
861
- * vestingEndTime
862
- * view
863
- */
864
- async vestingEndTime(): Promise<bigint> {
865
- return this.contract.read.vestingEndTime() as Promise<bigint>;
866
- }
867
-
868
- /**
869
- * vestingStartBlock
870
- * view
747
+ * __stakingManager_init
748
+ * nonpayable
749
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
871
750
  */
872
- async vestingStartBlock(): Promise<bigint> {
873
- return this.contract.read.vestingStartBlock() as Promise<bigint>;
751
+ async __stakingManager_init(_rewardTokenAddress: `0x${string}`, _presale: `0x${string}`, _rewardTokensPerBlock: bigint, _lockTime: bigint, _endBlock: bigint, options?: {
752
+ accessList?: import('viem').AccessList;
753
+ authorizationList?: import('viem').AuthorizationList;
754
+ chain?: import('viem').Chain | null;
755
+ dataSuffix?: `0x${string}`;
756
+ gas?: bigint;
757
+ gasPrice?: bigint;
758
+ maxFeePerGas?: bigint;
759
+ maxPriorityFeePerGas?: bigint;
760
+ nonce?: number;
761
+ value?: bigint;
762
+ }): Promise<`0x${string}`> {
763
+ if (!this.contract.write) {
764
+ throw new Error('Wallet client is required for write operations');
765
+ }
766
+ return this.contract.write.__stakingManager_init([_rewardTokenAddress, _presale, _rewardTokensPerBlock, _lockTime, _endBlock] as const, options) as Promise<`0x${string}`>;
874
767
  }
875
768
 
876
769
  /**
@@ -1150,34 +1043,11 @@ export class stakingManagerV4_json {
1150
1043
  }
1151
1044
 
1152
1045
  /**
1153
- * setVestLock
1154
- * nonpayable
1155
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
1156
- */
1157
- async setVestLock(_vestLock: boolean, options?: {
1158
- accessList?: import('viem').AccessList;
1159
- authorizationList?: import('viem').AuthorizationList;
1160
- chain?: import('viem').Chain | null;
1161
- dataSuffix?: `0x${string}`;
1162
- gas?: bigint;
1163
- gasPrice?: bigint;
1164
- maxFeePerGas?: bigint;
1165
- maxPriorityFeePerGas?: bigint;
1166
- nonce?: number;
1167
- value?: bigint;
1168
- }): Promise<`0x${string}`> {
1169
- if (!this.contract.write) {
1170
- throw new Error('Wallet client is required for write operations');
1171
- }
1172
- return this.contract.write.setVestLock([_vestLock] as const, options) as Promise<`0x${string}`>;
1173
- }
1174
-
1175
- /**
1176
- * setVestingDetails
1046
+ * tokenTransfer
1177
1047
  * nonpayable
1178
1048
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
1179
1049
  */
1180
- async setVestingDetails(_vestingEndTime: bigint, options?: {
1050
+ async tokenTransfer(_token: `0x${string}`, _amount: bigint, options?: {
1181
1051
  accessList?: import('viem').AccessList;
1182
1052
  authorizationList?: import('viem').AuthorizationList;
1183
1053
  chain?: import('viem').Chain | null;
@@ -1192,7 +1062,7 @@ export class stakingManagerV4_json {
1192
1062
  if (!this.contract.write) {
1193
1063
  throw new Error('Wallet client is required for write operations');
1194
1064
  }
1195
- return this.contract.write.setVestingDetails([_vestingEndTime] as const, options) as Promise<`0x${string}`>;
1065
+ return this.contract.write.tokenTransfer([_token, _amount] as const, options) as Promise<`0x${string}`>;
1196
1066
  }
1197
1067
 
1198
1068
  /**
@@ -1257,6 +1127,25 @@ export class stakingManagerV4_json {
1257
1127
  throw new Error('Public client is required for simulation');
1258
1128
  }
1259
1129
  return {
1130
+ /**
1131
+ * Simulate __stakingManager_init
1132
+ * Returns gas estimate and result without sending transaction
1133
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1134
+ */
1135
+ async __stakingManager_init(_rewardTokenAddress: `0x${string}`, _presale: `0x${string}`, _rewardTokensPerBlock: bigint, _lockTime: bigint, _endBlock: bigint, options?: {
1136
+ accessList?: import('viem').AccessList;
1137
+ authorizationList?: import('viem').AuthorizationList;
1138
+ chain?: import('viem').Chain | null;
1139
+ dataSuffix?: `0x${string}`;
1140
+ gas?: bigint;
1141
+ gasPrice?: bigint;
1142
+ maxFeePerGas?: bigint;
1143
+ maxPriorityFeePerGas?: bigint;
1144
+ nonce?: number;
1145
+ value?: bigint;
1146
+ }): Promise<void> {
1147
+ return contract.simulate.__stakingManager_init([_rewardTokenAddress, _presale, _rewardTokensPerBlock, _lockTime, _endBlock] as const, options) as Promise<void>;
1148
+ },
1260
1149
  /**
1261
1150
  * Simulate blacklistUsers
1262
1151
  * Returns gas estimate and result without sending transaction
@@ -1486,30 +1375,11 @@ export class stakingManagerV4_json {
1486
1375
  return contract.simulate.setStakeToken([_stakeToken] as const, options) as Promise<void>;
1487
1376
  },
1488
1377
  /**
1489
- * Simulate setVestLock
1490
- * Returns gas estimate and result without sending transaction
1491
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
1492
- */
1493
- async setVestLock(_vestLock: boolean, options?: {
1494
- accessList?: import('viem').AccessList;
1495
- authorizationList?: import('viem').AuthorizationList;
1496
- chain?: import('viem').Chain | null;
1497
- dataSuffix?: `0x${string}`;
1498
- gas?: bigint;
1499
- gasPrice?: bigint;
1500
- maxFeePerGas?: bigint;
1501
- maxPriorityFeePerGas?: bigint;
1502
- nonce?: number;
1503
- value?: bigint;
1504
- }): Promise<void> {
1505
- return contract.simulate.setVestLock([_vestLock] as const, options) as Promise<void>;
1506
- },
1507
- /**
1508
- * Simulate setVestingDetails
1378
+ * Simulate tokenTransfer
1509
1379
  * Returns gas estimate and result without sending transaction
1510
1380
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
1511
1381
  */
1512
- async setVestingDetails(_vestingEndTime: bigint, options?: {
1382
+ async tokenTransfer(_token: `0x${string}`, _amount: bigint, options?: {
1513
1383
  accessList?: import('viem').AccessList;
1514
1384
  authorizationList?: import('viem').AuthorizationList;
1515
1385
  chain?: import('viem').Chain | null;
@@ -1521,7 +1391,7 @@ export class stakingManagerV4_json {
1521
1391
  nonce?: number;
1522
1392
  value?: bigint;
1523
1393
  }): Promise<void> {
1524
- return contract.simulate.setVestingDetails([_vestingEndTime] as const, options) as Promise<void>;
1394
+ return contract.simulate.tokenTransfer([_token, _amount] as const, options) as Promise<void>;
1525
1395
  },
1526
1396
  /**
1527
1397
  * Simulate transferOwnership
@@ -1587,7 +1457,7 @@ export class stakingManagerV4_json {
1587
1457
  Deposit: (callback: (event: { user: `0x${string}`; amount: bigint }) => void, filter?: { user: `0x${string}` }) => {
1588
1458
  return this.publicClient.watchContractEvent({
1589
1459
  address: this.contractAddress,
1590
- abi: stakingManagerV4_jsonAbi,
1460
+ abi: stakingManagerV2_jsonAbi,
1591
1461
  eventName: 'Deposit',
1592
1462
  args: filter,
1593
1463
  onLogs: (logs: any[]) => {
@@ -1606,7 +1476,7 @@ export class stakingManagerV4_json {
1606
1476
  HarvestRewards: (callback: (event: { user: `0x${string}`; amount: bigint }) => void, filter?: { user: `0x${string}` }) => {
1607
1477
  return this.publicClient.watchContractEvent({
1608
1478
  address: this.contractAddress,
1609
- abi: stakingManagerV4_jsonAbi,
1479
+ abi: stakingManagerV2_jsonAbi,
1610
1480
  eventName: 'HarvestRewards',
1611
1481
  args: filter,
1612
1482
  onLogs: (logs: any[]) => {
@@ -1625,7 +1495,7 @@ export class stakingManagerV4_json {
1625
1495
  Initialized: (callback: (event: { version: bigint }) => void) => {
1626
1496
  return this.publicClient.watchContractEvent({
1627
1497
  address: this.contractAddress,
1628
- abi: stakingManagerV4_jsonAbi,
1498
+ abi: stakingManagerV2_jsonAbi,
1629
1499
  eventName: 'Initialized',
1630
1500
 
1631
1501
  onLogs: (logs: any[]) => {
@@ -1644,7 +1514,7 @@ export class stakingManagerV4_json {
1644
1514
  OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => {
1645
1515
  return this.publicClient.watchContractEvent({
1646
1516
  address: this.contractAddress,
1647
- abi: stakingManagerV4_jsonAbi,
1517
+ abi: stakingManagerV2_jsonAbi,
1648
1518
  eventName: 'OwnershipTransferred',
1649
1519
  args: filter,
1650
1520
  onLogs: (logs: any[]) => {
@@ -1663,7 +1533,7 @@ export class stakingManagerV4_json {
1663
1533
  Withdraw: (callback: (event: { user: `0x${string}`; amount: bigint }) => void, filter?: { user: `0x${string}` }) => {
1664
1534
  return this.publicClient.watchContractEvent({
1665
1535
  address: this.contractAddress,
1666
- abi: stakingManagerV4_jsonAbi,
1536
+ abi: stakingManagerV2_jsonAbi,
1667
1537
  eventName: 'Withdraw',
1668
1538
  args: filter,
1669
1539
  onLogs: (logs: any[]) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gitmyabi/stakingmanager",
3
- "version": "1.0.3",
4
- "description": "Auto-generated TypeScript type bindings for stakingManager (build etherscan-stakingmanager-b8bc5c11-1787551874450, commit e558ab8, branch etherscan)",
3
+ "version": "1.0.4",
4
+ "description": "Auto-generated TypeScript type bindings for stakingManager (build etherscan-stakingmanager-b02bbf73-1787733973699, commit 14fbc7d, 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/stakingmanager"
40
40
  },
41
41
  "branch": "etherscan",
42
- "shortHash": "e558ab8"
42
+ "shortHash": "14fbc7d"
43
43
  }