@glowlabs-org/utils 0.2.68 → 0.2.71
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/cjs/lib/control-api/kickstarter-router.d.ts +2 -4
- package/dist/cjs/lib/types/index.d.ts +22 -0
- package/dist/cjs/wallets-router-BlUnsu7X.js.map +1 -1
- package/dist/esm/lib/control-api/kickstarter-router.d.ts +2 -4
- package/dist/esm/lib/types/index.d.ts +22 -0
- package/dist/esm/wallets-router-0gtxkell.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/control-api/kickstarter-router.ts +3 -6
- package/src/lib/types/index.ts +24 -0
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
KickstarterCreateResponse,
|
|
8
8
|
CommitKickstarterPayload,
|
|
9
9
|
CommitKickstarterResponse,
|
|
10
|
+
KickstarterDetails,
|
|
10
11
|
} from "../types";
|
|
11
12
|
|
|
12
13
|
function parseApiError(error: unknown): string {
|
|
@@ -65,14 +66,10 @@ export function KickstarterRouter(baseUrl: string) {
|
|
|
65
66
|
|
|
66
67
|
const fetchKickstarter = async (
|
|
67
68
|
idOrSlug: string
|
|
68
|
-
): Promise<
|
|
69
|
-
Kickstarter & {
|
|
70
|
-
contributorsCount: number;
|
|
71
|
-
}
|
|
72
|
-
> => {
|
|
69
|
+
): Promise<KickstarterDetails> => {
|
|
73
70
|
try {
|
|
74
71
|
const data = await request<{
|
|
75
|
-
kickstarter:
|
|
72
|
+
kickstarter: KickstarterDetails;
|
|
76
73
|
}>(`/kickstarters/${encodeURIComponent(idOrSlug)}`);
|
|
77
74
|
return data.kickstarter;
|
|
78
75
|
} catch (error) {
|
package/src/lib/types/index.ts
CHANGED
|
@@ -229,6 +229,12 @@ export interface Kickstarter {
|
|
|
229
229
|
kickoffStakeEventId?: string;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
+
export interface KickstarterDetails extends Kickstarter {
|
|
233
|
+
contributorsCount: number;
|
|
234
|
+
farmCount: number;
|
|
235
|
+
solarFarmApplications: SolarFarmApplication[];
|
|
236
|
+
}
|
|
237
|
+
|
|
232
238
|
export interface CommitKickstarterPayload {
|
|
233
239
|
wallet: string; // 0x-prefixed 40-char hex
|
|
234
240
|
amount: string; // atomic GCTL, must equal stakeTargetGctl/KICKSTARTER_STAKE_PERCENTAGE
|
|
@@ -269,10 +275,28 @@ export interface SponsoredFarm {
|
|
|
269
275
|
isPurchased: boolean;
|
|
270
276
|
builtAt?: string;
|
|
271
277
|
purchaserWallet: string | null;
|
|
278
|
+
afterInstallPictures: {
|
|
279
|
+
id: string;
|
|
280
|
+
name: string;
|
|
281
|
+
url: string;
|
|
282
|
+
isShowingSolarPanels: boolean;
|
|
283
|
+
}[];
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export interface SolarFarmApplication {
|
|
287
|
+
applicationId: string;
|
|
288
|
+
farmId: string | null;
|
|
289
|
+
farmOwnerWallet: string;
|
|
290
|
+
regionId: number;
|
|
291
|
+
gcaWallet: string;
|
|
292
|
+
protocolDepositUSDC6Decimals: string;
|
|
293
|
+
status: "audit_fees_paid" | "completed";
|
|
294
|
+
createdAt: string;
|
|
272
295
|
}
|
|
273
296
|
|
|
274
297
|
export interface RegionDetails extends RegionWithMetadata {
|
|
275
298
|
sponsoredFarms: SponsoredFarm[];
|
|
299
|
+
solarFarmApplications: SolarFarmApplication[];
|
|
276
300
|
glwPerWeek: number;
|
|
277
301
|
usdgPerWeek: number;
|
|
278
302
|
gctlPerWeek: number;
|