@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 +21 -79
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,97 +1,39 @@
|
|
1
|
-
# Glow Labs
|
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 {
|
19
|
-
import
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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
|
package/lib/cjs/index.d.ts
CHANGED
package/lib/cjs/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,
|
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"}
|
package/lib/esm/index.d.ts
CHANGED
package/lib/esm/index.js
CHANGED
package/lib/esm/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,
|
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