@glowlabs-org/utils 0.0.4 → 0.0.5

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/README.md CHANGED
@@ -1,97 +1,39 @@
1
- # Glow Labs ABIs
1
+ # Glow Labs Utils
2
2
 
3
3
  This repository contains utils for interacting with Glow labs data sources
4
4
 
5
5
  ## Install
6
6
 
7
- `npm install ethers@5.7.2 merkletreejs @glowlabs-org/utils`
7
+ `npm install ethers@5.7.2 viem merkletreejs @glowlabs-org/utils`
8
8
 
9
9
  ## Requirements
10
10
 
11
11
  - Ethers V5
12
12
  - MerkletreeJS
13
+ - Viem
13
14
  - Node version >= 16
14
15
 
15
16
  ## Example Usage
16
17
 
17
18
  ```typescript
18
- import { ethers } from "ethers";
19
- import {
20
- type CarbonCreditDescendingPriceAuction,
21
- CarbonCreditDescendingPriceAuction__factory,
22
- type EarlyLiquidity,
23
- EarlyLiquidity__factory,
24
- GCCGuardedLaunch__factory,
25
- type GCCGuardedLaunch,
26
- GlowGuardedLaunch__factory,
27
- type Governance,
28
- Governance__factory,
29
- type GrantsTreasury,
30
- GrantsTreasury__factory,
31
- type ImpactCatalyst,
32
- ImpactCatalyst__factory,
33
- type MinerPoolAndGCA,
34
- MinerPoolAndGCA__factory,
35
- type SafetyDelay,
36
- SafetyDelay__factory,
37
- type USDG,
38
- USDG__factory,
39
- type VetoCouncil,
40
- VetoCouncil__factory,
41
- addresses,
42
- GlowGuardedLaunch,
43
- } from "@glowlabs-org/guarded-launch-ethers-sdk";
44
-
45
- const provider = new ethers.providers.JsonRpcProvider(
46
- "https://mainnet.infura.io/v3/<INFURA_API_KEY>"
47
- );
48
-
49
- const auction: CarbonCreditDescendingPriceAuction =
50
- CarbonCreditDescendingPriceAuction__factory.connect(
51
- addresses.auction,
52
- provider
53
- );
54
- const earlyLiquidity: EarlyLiquidity = EarlyLiquidity__factory.connect(
55
- addresses.earlyLiquidity,
56
- provider
57
- );
58
- const gccGuardedLaunch: GCCGuardedLaunch = GCCGuardedLaunch__factory.connect(
59
- addresses.gccGuardedLaunch,
60
- provider
61
- );
62
- const glowGuardedLaunch: GlowGuardedLaunch = GlowGuardedLaunch__factory.connect(
63
- addresses.glowGuardedLaunch,
64
- provider
65
- );
66
- const governance: Governance = Governance__factory.connect(
67
- addresses.governance,
68
- provider
69
- );
70
- const grantsTreasury: GrantsTreasury = GrantsTreasury__factory.connect(
71
- addresses.grantsTreasury,
72
- provider
73
- );
74
- const impactCatalyst: ImpactCatalyst = ImpactCatalyst__factory.connect(
75
- addresses.impactCatalyst,
76
- provider
77
- );
78
- const minerPoolAndGCA: MinerPoolAndGCA = MinerPoolAndGCA__factory.connect(
79
- addresses.minerPoolAndGCA,
80
- provider
81
- );
82
- const safetyDelay: SafetyDelay = SafetyDelay__factory.connect(
83
- addresses.safetyDelay,
84
- provider
85
- );
86
- const usdg: USDG = USDG__factory.connect(addresses.usdg, provider);
87
- const vetoCouncil: VetoCouncil = VetoCouncil__factory.connect(
88
- addresses.vetoCouncil,
89
- provider
90
- );
91
-
92
- /**
93
- * Use the typechain bindings to interact with the contracts
94
- */
19
+ import { createWeeklyReport } from "@glowlabs-org/utils";
20
+ import * as fs from "fs";
21
+ const GCA_URLS = ["http://xx.xx.xx.xx:xxxxx"];
22
+ const apiUrl = "https://URL/headline_farm_stats";
23
+
24
+ const main = async () => {
25
+ const report = await createWeeklyReport({
26
+ gcaUrls: GCA_URLS,
27
+ apiUrl: apiUrl,
28
+ week: 37,
29
+ });
30
+
31
+ //Save to 37.json
32
+ fs.writeFileSync("37.json", JSON.stringify(report, null, 4));
33
+ };
34
+ ``;
35
+
36
+ main();
95
37
  ```
96
38
 
97
39
  ## Contributions
@@ -1,3 +1,3 @@
1
1
  export * from "./types";
2
- export { createWeeklyReport, type CreateWeeklyReportArgs, } from "./lib/create-weekly-report";
2
+ export { createWeeklyReport } from "./lib/create-weekly-report";
3
3
  export * from "./constants";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,mEAGoC;AAFlC,0HAAA,kBAAkB,OAAA;AAGpB,8CAA4B;AAC5B,EAAE"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,mEAAgE;AAAvD,0HAAA,kBAAkB,OAAA;AAC3B,8CAA4B;AAC5B,EAAE"}
@@ -1,3 +1,3 @@
1
1
  export * from "./types";
2
- export { createWeeklyReport, type CreateWeeklyReportArgs, } from "./lib/create-weekly-report";
2
+ export { createWeeklyReport } from "./lib/create-weekly-report";
3
3
  export * from "./constants";
package/lib/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./types";
2
- export { createWeeklyReport, } from "./lib/create-weekly-report";
2
+ export { createWeeklyReport } from "./lib/create-weekly-report";
3
3
  export * from "./constants";
4
4
  //
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,kBAAkB,GAEnB,MAAM,4BAA4B,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,EAAE"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,cAAc,aAAa,CAAC;AAC5B,EAAE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glowlabs-org/utils",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "A library containing all typechain types and addresses relating to the glow guarded launch",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",