@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.
@@ -5063,6 +5063,76 @@ function FarmsRouter(baseUrl) {
5063
5063
  throw new Error(parseApiError(error));
5064
5064
  }
5065
5065
  };
5066
+ const fetchFarmWeeklyRewardsBatch = async (params) => {
5067
+ try {
5068
+ sentryAddBreadcrumb({
5069
+ category: "control-api",
5070
+ message: "POST /farms/rewards-history/batch",
5071
+ level: "info",
5072
+ data: { baseUrl, farmsCount: params.farmIds?.length },
5073
+ });
5074
+ const data = await request("/farms/rewards-history/batch", {
5075
+ method: "POST",
5076
+ headers: {
5077
+ "Content-Type": "application/json",
5078
+ },
5079
+ body: JSON.stringify(params),
5080
+ });
5081
+ return data;
5082
+ }
5083
+ catch (error) {
5084
+ sentryCaptureException(error, {
5085
+ action: "fetchFarmWeeklyRewardsBatch",
5086
+ baseUrl,
5087
+ farmsCount: params.farmIds?.length,
5088
+ });
5089
+ throw new Error(parseApiError(error));
5090
+ }
5091
+ };
5092
+ const fetchWalletFarmRewardsHistory = async (walletAddress, query) => {
5093
+ try {
5094
+ if (!walletAddress) {
5095
+ throw new Error("Wallet address is required");
5096
+ }
5097
+ const params = new URLSearchParams();
5098
+ if (query?.startWeek !== undefined)
5099
+ params.set("startWeek", query.startWeek.toString());
5100
+ if (query?.endWeek !== undefined)
5101
+ params.set("endWeek", query.endWeek.toString());
5102
+ const queryString = params.toString();
5103
+ const path = `/farms/by-wallet/${encodeURIComponent(walletAddress)}/farm-rewards-history${queryString ? `?${queryString}` : ""}`;
5104
+ return await request(path);
5105
+ }
5106
+ catch (error) {
5107
+ throw new Error(parseApiError(error));
5108
+ }
5109
+ };
5110
+ const fetchWalletFarmRewardsHistoryBatch = async (params) => {
5111
+ try {
5112
+ sentryAddBreadcrumb({
5113
+ category: "control-api",
5114
+ message: "POST /farms/by-wallet/farm-rewards-history/batch",
5115
+ level: "info",
5116
+ data: { baseUrl, walletsCount: params.wallets?.length },
5117
+ });
5118
+ const data = await request("/farms/by-wallet/farm-rewards-history/batch", {
5119
+ method: "POST",
5120
+ headers: {
5121
+ "Content-Type": "application/json",
5122
+ },
5123
+ body: JSON.stringify(params),
5124
+ });
5125
+ return data;
5126
+ }
5127
+ catch (error) {
5128
+ sentryCaptureException(error, {
5129
+ action: "fetchWalletFarmRewardsHistoryBatch",
5130
+ baseUrl,
5131
+ walletsCount: params.wallets?.length,
5132
+ });
5133
+ throw new Error(parseApiError(error));
5134
+ }
5135
+ };
5066
5136
  return {
5067
5137
  fetchFarmRewardSplits,
5068
5138
  fetchSponsoredFarms,
@@ -5072,6 +5142,9 @@ function FarmsRouter(baseUrl) {
5072
5142
  estimateRewardScoresBatch,
5073
5143
  calculateMiningScoresBatch,
5074
5144
  fetchEfficiencyScores,
5145
+ fetchFarmWeeklyRewardsBatch,
5146
+ fetchWalletFarmRewardsHistory,
5147
+ fetchWalletFarmRewardsHistoryBatch,
5075
5148
  };
5076
5149
  }
5077
5150
 
@@ -5117,4 +5190,4 @@ function calculateFarmEfficiency(protocolDepositUsd6, weeklyImpactAssetsWad) {
5117
5190
  }
5118
5191
 
5119
5192
  export { ControlRouter as C, DECIMALS_BY_TOKEN as D, FarmsRouter as F, GLOW_WEIGHT_DECIMAL_PRECISION as G, HUB_URL as H, KickstarterRouter as K, MAX_WEIGHT as M, OFF_CHAIN_PAYMENT_CURRENCIES as O, PAYMENT_CURRENCIES as P, RegionRouter as R, STAKING_DIRECTIONS as S, TRANSFER_TYPES as T, USDG_WEIGHT_DECIMAL_PRECISION as U, WalletsRouter as W, useOffchainFractions as a, useRewardsKernel as b, configureSentry as c, REGIONS as d, KICKSTARTER_STATUS as e, calculateFarmEfficiency as f, ForwarderError as g, OffchainFractionsError as h, RewardsKernelError as i, allRegions as j, usStates as k, countries as l, FORWARDER_ABI as m, OFFCHAIN_FRACTIONS_ABI as n, REWARDS_KERNEL_ABI as o, getAddresses as p, GCA_URLS as q, regionMetadata as r, parseViemError as s, parseEthersError as t, useForwarder as u, waitForEthersTransactionWithRetry as v, waitForViemTransactionWithRetry as w };
5120
- //# sourceMappingURL=calculate-farm-efficiency-BLvnmRNd.js.map
5193
+ //# sourceMappingURL=calculate-farm-efficiency-VRzMgQmC.js.map