@glowlabs-org/utils 0.2.38 → 0.2.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glowlabs-org/utils",
3
- "version": "0.2.38",
3
+ "version": "0.2.40",
4
4
  "description": "A library containing all typechain types and addresses relating to the glow guarded launch",
5
5
  "keywords": [],
6
6
  "author": "",
@@ -11,6 +11,7 @@ import type {
11
11
  ActivationEvent,
12
12
  KickstarterCreateResponse,
13
13
  RegionVcr,
14
+ SponsoredFarm,
14
15
  } from "../types";
15
16
 
16
17
  // ---------------------------------------------------------------------------
@@ -122,6 +123,19 @@ export function RegionRouter(baseUrl: string) {
122
123
  }
123
124
  };
124
125
 
126
+ const fetchRegionSolarFarms = async (
127
+ regionId: number
128
+ ): Promise<SponsoredFarm[]> => {
129
+ try {
130
+ const data = await request<{ sponsoredFarms: SponsoredFarm[] }>(
131
+ `/regions/${regionId}/solar-farms`
132
+ );
133
+ return data.sponsoredFarms ?? [];
134
+ } catch (error) {
135
+ throw new Error(parseApiError(error));
136
+ }
137
+ };
138
+
125
139
  // -------------------------------------------------------------------------
126
140
  // Mutations
127
141
  // -------------------------------------------------------------------------
@@ -249,6 +263,7 @@ export function RegionRouter(baseUrl: string) {
249
263
  fetchKickstarters,
250
264
  fetchKickstarter,
251
265
  fetchKickstartersByWallet,
266
+ fetchRegionSolarFarms,
252
267
  getRegionByCode,
253
268
  createRegion,
254
269
  createKickstarter,
@@ -158,12 +158,8 @@ export type KickstarterStatus =
158
158
  export interface CreateKickstarterPayload {
159
159
  creatorWallet: string;
160
160
  regionName: string;
161
- isUs?: boolean;
162
161
  title: string;
163
162
  description: string;
164
- stakeTargetGctl: string; // decimal string
165
- requiredFarmCount?: number; // defaults server-side
166
- requiredInstallerCount?: number; // defaults server-side
167
163
  code: string; // region code (e.g., "US-FL", "US", "CA")
168
164
  }
169
165