@glowlabs-org/utils 0.2.97 → 0.2.99

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.
@@ -389,10 +389,7 @@ export interface EstimateRewardScoreParams {
389
389
  protocolDepositAmount: string;
390
390
  paymentCurrency: PaymentCurrency;
391
391
  adjustedWeeklyCarbonCredits: number;
392
- zone: {
393
- id: number;
394
- name?: string;
395
- };
392
+ regionId: number;
396
393
  }
397
394
  export interface RewardScoreResponse {
398
395
  rewardScore: number;
@@ -407,7 +404,6 @@ export interface RewardScoreResponse {
407
404
  glwPriceUsd6: string;
408
405
  regionInfo: {
409
406
  regionId: number;
410
- regionName: string;
411
407
  existingFarmCount: number;
412
408
  existingTotalDepositsUsd: string;
413
409
  currencyBreakdown: {
@@ -419,32 +415,27 @@ export interface RewardScoreResponse {
419
415
  totalGctlStakedAllRegions: string;
420
416
  };
421
417
  }
422
- export interface EstimateRewardScoreApiResponse {
423
- rewardScore: number;
424
- userWeeklyPdRewards: string;
425
- userWeeklyPdRewardsUsd: string;
426
- userWeeklyGlwRewards: string;
427
- userWeeklyGlwValueUsd: string;
428
- userEstimatedWeeklyCash: string;
429
- userProtocolDeposit: string;
430
- userGlowSplitPercent: string;
431
- userDepositSplitPercent: string;
432
- glwPriceUsd6: string;
433
- regionInfo: {
418
+ export interface EstimateRewardScoreErrorResponse {
419
+ error: string;
420
+ }
421
+ export interface EstimateRewardScoresBatchParams {
422
+ farms: EstimateRewardScoreParams[];
423
+ }
424
+ export interface BatchRewardScoreSuccessResult {
425
+ success: true;
426
+ data: RewardScoreResponse;
427
+ }
428
+ export interface BatchRewardScoreFailureResult {
429
+ success: false;
430
+ error: string;
431
+ farmData: {
432
+ userId: string;
434
433
  regionId: number;
435
- regionName: string;
436
- existingFarmCount: number;
437
- existingTotalDepositsUsd: string;
438
- currencyBreakdown: {
439
- currency: string;
440
- protocolDepositSum: string;
441
- carbonCreditProductionSum: string;
442
- }[];
443
- regionGctlStaked: string;
444
- totalGctlStakedAllRegions: string;
434
+ paymentCurrency: string;
445
435
  };
446
436
  }
447
- export interface EstimateRewardScoreErrorResponse {
448
- error: string;
437
+ export type BatchRewardScoreResult = BatchRewardScoreSuccessResult | BatchRewardScoreFailureResult;
438
+ export interface EstimateRewardScoresBatchResponse {
439
+ results: BatchRewardScoreResult[];
449
440
  }
450
441
  export type { MintedEvent as ControlMintedEvent };
@@ -1,5 +1,5 @@
1
- import { T as TRANSFER_TYPES } from './farms-router-Da1P3B8g.js';
2
- export { C as ControlRouter, D as DECIMALS_BY_TOKEN, g as FORWARDER_ABI, F as FarmsRouter, b as ForwarderError, i as GCA_URLS, G as GLOW_WEIGHT_DECIMAL_PRECISION, H as HUB_URL, K as KickstarterRouter, M as MAX_WEIGHT, c as OFF_CHAIN_PAYMENT_CURRENCIES, O as OffchainFractionsError, P as PAYMENT_CURRENCIES, R as RegionRouter, U as USDG_WEIGHT_DECIMAL_PRECISION, W as WalletsRouter, d as allRegions, f as countries, h as getAddresses, r as regionMetadata, e as usStates, u as useForwarder, a as useOffchainFractions } from './farms-router-Da1P3B8g.js';
1
+ import { T as TRANSFER_TYPES } from './farms-router-C1A8W28q.js';
2
+ export { C as ControlRouter, D as DECIMALS_BY_TOKEN, g as FORWARDER_ABI, F as FarmsRouter, b as ForwarderError, i as GCA_URLS, G as GLOW_WEIGHT_DECIMAL_PRECISION, H as HUB_URL, K as KickstarterRouter, M as MAX_WEIGHT, c as OFF_CHAIN_PAYMENT_CURRENCIES, O as OffchainFractionsError, P as PAYMENT_CURRENCIES, R as RegionRouter, U as USDG_WEIGHT_DECIMAL_PRECISION, W as WalletsRouter, d as allRegions, f as countries, h as getAddresses, r as regionMetadata, e as usStates, u as useForwarder, a as useOffchainFractions } from './farms-router-C1A8W28q.js';
3
3
  import { verifyTypedData, getAddress } from 'viem';
4
4
  import 'ethers';
5
5
 
@@ -3018,7 +3018,6 @@ function FarmsRouter(baseUrl) {
3018
3018
  };
3019
3019
  const estimateRewardScore = async (params) => {
3020
3020
  try {
3021
- // First try to get the success response
3022
3021
  const data = await request("/farms/estimate-reward-score", {
3023
3022
  method: "POST",
3024
3023
  headers: {
@@ -3030,7 +3029,7 @@ function FarmsRouter(baseUrl) {
3030
3029
  if ("error" in data) {
3031
3030
  throw new Error(data.error);
3032
3031
  }
3033
- // At this point, TypeScript knows it's EstimateRewardScoreApiResponse
3032
+ // At this point, TypeScript knows it's RewardScoreResponse
3034
3033
  // All fields are required in the success response based on the API spec
3035
3034
  return data;
3036
3035
  }
@@ -3038,11 +3037,27 @@ function FarmsRouter(baseUrl) {
3038
3037
  throw new Error(parseApiError(error));
3039
3038
  }
3040
3039
  };
3040
+ const estimateRewardScoresBatch = async (params) => {
3041
+ try {
3042
+ const data = await request("/farms/estimate-reward-scores-batch", {
3043
+ method: "POST",
3044
+ headers: {
3045
+ "Content-Type": "application/json",
3046
+ },
3047
+ body: JSON.stringify(params),
3048
+ });
3049
+ return data;
3050
+ }
3051
+ catch (error) {
3052
+ throw new Error(parseApiError(error));
3053
+ }
3054
+ };
3041
3055
  return {
3042
3056
  fetchSponsoredFarms,
3043
3057
  estimateRewardScore,
3058
+ estimateRewardScoresBatch,
3044
3059
  };
3045
3060
  }
3046
3061
 
3047
3062
  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, OffchainFractionsError as O, PAYMENT_CURRENCIES as P, RegionRouter as R, TRANSFER_TYPES as T, USDG_WEIGHT_DECIMAL_PRECISION as U, WalletsRouter as W, useOffchainFractions as a, ForwarderError as b, OFF_CHAIN_PAYMENT_CURRENCIES as c, allRegions as d, usStates as e, countries as f, FORWARDER_ABI as g, getAddresses as h, GCA_URLS as i, regionMetadata as r, useForwarder as u };
3048
- //# sourceMappingURL=farms-router-Da1P3B8g.js.map
3063
+ //# sourceMappingURL=farms-router-C1A8W28q.js.map