@triadxyz/triad-protocol 0.0.6-beta → 0.0.7-beta

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/dist/stake.js CHANGED
@@ -74,21 +74,24 @@ class Stake {
74
74
  .reduce((a, b) => a + b, 0);
75
75
  let allRewards = stake.dailyRewards.reduce((a, b) => a + b);
76
76
  stake.rewardsToClaim = 0;
77
- stake.dailyRewards.forEach((item, index) => {
78
- let week = 0;
79
- let limit = 6;
77
+ let index = 0;
78
+ let week = 0;
79
+ let limit = 7;
80
+ for (const item of stake.dailyRewards) {
80
81
  if (!stake.weeklyRewardsPaid[week]) {
81
82
  stake.rewardsToClaim += item;
82
83
  }
83
84
  if (index === limit) {
84
85
  limit += 6;
85
- week + 1;
86
+ week += 1;
86
87
  }
87
- });
88
+ index++;
89
+ }
88
90
  stake.weeklyRewards = rewards;
89
91
  stake.allRewards = allRewards;
90
92
  }
91
93
  catch (error) {
94
+ console.log(error);
92
95
  stake.apr = 0;
93
96
  stake.dailyRewards = [];
94
97
  stake.weeklyRewardsPaid = [];
package/dist/test.js CHANGED
@@ -204,6 +204,3 @@ const updateStakeRewards = () => __awaiter(void 0, void 0, void 0, function* ()
204
204
  console.log(`Failed chunks saved to ./src/utils/stake-season-1/stakes/2/failedChunks_${ts}.json`);
205
205
  }
206
206
  });
207
- triadProtocol.stake
208
- .getStakeByWallet(new web3_js_1.PublicKey('E48CKgbZVpDzerQ7DdommgqNobRHLqHy8RUVi8HXkSHE'), constants_1.STAKE_SEASON_1)
209
- .then(console.log);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "0.0.6-beta",
3
+ "version": "0.0.7-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",