@glowlabs-org/utils 0.2.162 → 0.2.163

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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var calculateFarmEfficiency = require('./calculate-farm-efficiency-C1AxUV_w.js');
3
+ var calculateFarmEfficiency = require('./calculate-farm-efficiency-DIL_hKMo.js');
4
4
  require('decimal.js');
5
5
  var viem = require('viem');
6
6
  require('ethers');
@@ -5065,6 +5065,76 @@ function FarmsRouter(baseUrl) {
5065
5065
  throw new Error(parseApiError(error));
5066
5066
  }
5067
5067
  };
5068
+ const fetchFarmWeeklyRewardsBatch = async (params) => {
5069
+ try {
5070
+ sentryAddBreadcrumb({
5071
+ category: "control-api",
5072
+ message: "POST /farms/rewards-history/batch",
5073
+ level: "info",
5074
+ data: { baseUrl, farmsCount: params.farmIds?.length },
5075
+ });
5076
+ const data = await request("/farms/rewards-history/batch", {
5077
+ method: "POST",
5078
+ headers: {
5079
+ "Content-Type": "application/json",
5080
+ },
5081
+ body: JSON.stringify(params),
5082
+ });
5083
+ return data;
5084
+ }
5085
+ catch (error) {
5086
+ sentryCaptureException(error, {
5087
+ action: "fetchFarmWeeklyRewardsBatch",
5088
+ baseUrl,
5089
+ farmsCount: params.farmIds?.length,
5090
+ });
5091
+ throw new Error(parseApiError(error));
5092
+ }
5093
+ };
5094
+ const fetchWalletFarmRewardsHistory = async (walletAddress, query) => {
5095
+ try {
5096
+ if (!walletAddress) {
5097
+ throw new Error("Wallet address is required");
5098
+ }
5099
+ const params = new URLSearchParams();
5100
+ if (query?.startWeek !== undefined)
5101
+ params.set("startWeek", query.startWeek.toString());
5102
+ if (query?.endWeek !== undefined)
5103
+ params.set("endWeek", query.endWeek.toString());
5104
+ const queryString = params.toString();
5105
+ const path = `/farms/by-wallet/${encodeURIComponent(walletAddress)}/farm-rewards-history${queryString ? `?${queryString}` : ""}`;
5106
+ return await request(path);
5107
+ }
5108
+ catch (error) {
5109
+ throw new Error(parseApiError(error));
5110
+ }
5111
+ };
5112
+ const fetchWalletFarmRewardsHistoryBatch = async (params) => {
5113
+ try {
5114
+ sentryAddBreadcrumb({
5115
+ category: "control-api",
5116
+ message: "POST /farms/by-wallet/farm-rewards-history/batch",
5117
+ level: "info",
5118
+ data: { baseUrl, walletsCount: params.wallets?.length },
5119
+ });
5120
+ const data = await request("/farms/by-wallet/farm-rewards-history/batch", {
5121
+ method: "POST",
5122
+ headers: {
5123
+ "Content-Type": "application/json",
5124
+ },
5125
+ body: JSON.stringify(params),
5126
+ });
5127
+ return data;
5128
+ }
5129
+ catch (error) {
5130
+ sentryCaptureException(error, {
5131
+ action: "fetchWalletFarmRewardsHistoryBatch",
5132
+ baseUrl,
5133
+ walletsCount: params.wallets?.length,
5134
+ });
5135
+ throw new Error(parseApiError(error));
5136
+ }
5137
+ };
5068
5138
  return {
5069
5139
  fetchFarmRewardSplits,
5070
5140
  fetchSponsoredFarms,
@@ -5074,6 +5144,9 @@ function FarmsRouter(baseUrl) {
5074
5144
  estimateRewardScoresBatch,
5075
5145
  calculateMiningScoresBatch,
5076
5146
  fetchEfficiencyScores,
5147
+ fetchFarmWeeklyRewardsBatch,
5148
+ fetchWalletFarmRewardsHistory,
5149
+ fetchWalletFarmRewardsHistoryBatch,
5077
5150
  };
5078
5151
  }
5079
5152
 
@@ -5149,4 +5222,4 @@ exports.useOffchainFractions = useOffchainFractions;
5149
5222
  exports.useRewardsKernel = useRewardsKernel;
5150
5223
  exports.waitForEthersTransactionWithRetry = waitForEthersTransactionWithRetry;
5151
5224
  exports.waitForViemTransactionWithRetry = waitForViemTransactionWithRetry;
5152
- //# sourceMappingURL=calculate-farm-efficiency-C1AxUV_w.js.map
5225
+ //# sourceMappingURL=calculate-farm-efficiency-DIL_hKMo.js.map