@glowlabs-org/utils 0.0.1

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.
Files changed (136) hide show
  1. package/README.md +98 -0
  2. package/lib/cjs/constants/index.d.ts +1 -0
  3. package/lib/cjs/constants/index.js +5 -0
  4. package/lib/cjs/constants/index.js.map +1 -0
  5. package/lib/cjs/default-values/gca-to-server-urls.d.ts +0 -0
  6. package/lib/cjs/default-values/gca-to-server-urls.js +9 -0
  7. package/lib/cjs/default-values/gca-to-server-urls.js.map +1 -0
  8. package/lib/cjs/index.d.ts +3 -0
  9. package/lib/cjs/index.js +22 -0
  10. package/lib/cjs/index.js.map +1 -0
  11. package/lib/cjs/lib/create-weekly-report/index.d.ts +43 -0
  12. package/lib/cjs/lib/create-weekly-report/index.js +177 -0
  13. package/lib/cjs/lib/create-weekly-report/index.js.map +1 -0
  14. package/lib/cjs/lib/create-weekly-report/utils/hash-leaf.d.ts +7 -0
  15. package/lib/cjs/lib/create-weekly-report/utils/hash-leaf.js +16 -0
  16. package/lib/cjs/lib/create-weekly-report/utils/hash-leaf.js.map +1 -0
  17. package/lib/cjs/package.json +1 -0
  18. package/lib/cjs/types/AuditCompleted.d.ts +3 -0
  19. package/lib/cjs/types/AuditCompleted.js +4 -0
  20. package/lib/cjs/types/AuditCompleted.js.map +1 -0
  21. package/lib/cjs/types/AuditInherited.d.ts +6 -0
  22. package/lib/cjs/types/AuditInherited.js +4 -0
  23. package/lib/cjs/types/AuditInherited.js.map +1 -0
  24. package/lib/cjs/types/Device.d.ts +5 -0
  25. package/lib/cjs/types/Device.js +4 -0
  26. package/lib/cjs/types/Device.js.map +1 -0
  27. package/lib/cjs/types/DuplicatedButPastAuditCompleted.d.ts +8 -0
  28. package/lib/cjs/types/DuplicatedButPastAuditCompleted.js +3 -0
  29. package/lib/cjs/types/DuplicatedButPastAuditCompleted.js.map +1 -0
  30. package/lib/cjs/types/Farm.d.ts +20 -0
  31. package/lib/cjs/types/Farm.js +3 -0
  32. package/lib/cjs/types/Farm.js.map +1 -0
  33. package/lib/cjs/types/FarmStatus.d.ts +14 -0
  34. package/lib/cjs/types/FarmStatus.js +3 -0
  35. package/lib/cjs/types/FarmStatus.js.map +1 -0
  36. package/lib/cjs/types/GCAAndServerUrl.d.ts +5 -0
  37. package/lib/cjs/types/GCAAndServerUrl.js +3 -0
  38. package/lib/cjs/types/GCAAndServerUrl.js.map +1 -0
  39. package/lib/cjs/types/GCAServerResponse.d.ts +6 -0
  40. package/lib/cjs/types/GCAServerResponse.js +3 -0
  41. package/lib/cjs/types/GCAServerResponse.js.map +1 -0
  42. package/lib/cjs/types/GetEquipmentDataHandlerParams.d.ts +5 -0
  43. package/lib/cjs/types/GetEquipmentDataHandlerParams.js +4 -0
  44. package/lib/cjs/types/GetEquipmentDataHandlerParams.js.map +1 -0
  45. package/lib/cjs/types/PayoutWalletAndSplit.d.ts +17 -0
  46. package/lib/cjs/types/PayoutWalletAndSplit.js +3 -0
  47. package/lib/cjs/types/PayoutWalletAndSplit.js.map +1 -0
  48. package/lib/cjs/types/PayoutWalletAndSplitWithRewardSplits.d.ts +15 -0
  49. package/lib/cjs/types/PayoutWalletAndSplitWithRewardSplits.js +3 -0
  50. package/lib/cjs/types/PayoutWalletAndSplitWithRewardSplits.js.map +1 -0
  51. package/lib/cjs/types/RewardSplit.d.ts +5 -0
  52. package/lib/cjs/types/RewardSplit.js +4 -0
  53. package/lib/cjs/types/RewardSplit.js.map +1 -0
  54. package/lib/cjs/types/RewardSplits.d.ts +2 -0
  55. package/lib/cjs/types/RewardSplits.js +3 -0
  56. package/lib/cjs/types/RewardSplits.js.map +1 -0
  57. package/lib/cjs/types/SlotRange.d.ts +4 -0
  58. package/lib/cjs/types/SlotRange.js +4 -0
  59. package/lib/cjs/types/SlotRange.js.map +1 -0
  60. package/lib/cjs/types/WeekAndSlotRange.d.ts +5 -0
  61. package/lib/cjs/types/WeekAndSlotRange.js +3 -0
  62. package/lib/cjs/types/WeekAndSlotRange.js.map +1 -0
  63. package/lib/cjs/types/index.d.ts +14 -0
  64. package/lib/cjs/types/index.js +31 -0
  65. package/lib/cjs/types/index.js.map +1 -0
  66. package/lib/cjs/types/stashed-Farm.d.ts +20 -0
  67. package/lib/cjs/types/stashed-Farm.js +3 -0
  68. package/lib/cjs/types/stashed-Farm.js.map +1 -0
  69. package/lib/esm/constants/index.d.ts +1 -0
  70. package/lib/esm/constants/index.js +2 -0
  71. package/lib/esm/constants/index.js.map +1 -0
  72. package/lib/esm/default-values/gca-to-server-urls.d.ts +0 -0
  73. package/lib/esm/default-values/gca-to-server-urls.js +9 -0
  74. package/lib/esm/default-values/gca-to-server-urls.js.map +1 -0
  75. package/lib/esm/index.d.ts +3 -0
  76. package/lib/esm/index.js +4 -0
  77. package/lib/esm/index.js.map +1 -0
  78. package/lib/esm/lib/create-weekly-report/index.d.ts +43 -0
  79. package/lib/esm/lib/create-weekly-report/index.js +170 -0
  80. package/lib/esm/lib/create-weekly-report/index.js.map +1 -0
  81. package/lib/esm/lib/create-weekly-report/utils/hash-leaf.d.ts +7 -0
  82. package/lib/esm/lib/create-weekly-report/utils/hash-leaf.js +12 -0
  83. package/lib/esm/lib/create-weekly-report/utils/hash-leaf.js.map +1 -0
  84. package/lib/esm/package.json +1 -0
  85. package/lib/esm/types/AuditCompleted.d.ts +3 -0
  86. package/lib/esm/types/AuditCompleted.js +3 -0
  87. package/lib/esm/types/AuditCompleted.js.map +1 -0
  88. package/lib/esm/types/AuditInherited.d.ts +6 -0
  89. package/lib/esm/types/AuditInherited.js +3 -0
  90. package/lib/esm/types/AuditInherited.js.map +1 -0
  91. package/lib/esm/types/Device.d.ts +5 -0
  92. package/lib/esm/types/Device.js +3 -0
  93. package/lib/esm/types/Device.js.map +1 -0
  94. package/lib/esm/types/DuplicatedButPastAuditCompleted.d.ts +8 -0
  95. package/lib/esm/types/DuplicatedButPastAuditCompleted.js +2 -0
  96. package/lib/esm/types/DuplicatedButPastAuditCompleted.js.map +1 -0
  97. package/lib/esm/types/Farm.d.ts +20 -0
  98. package/lib/esm/types/Farm.js +2 -0
  99. package/lib/esm/types/Farm.js.map +1 -0
  100. package/lib/esm/types/FarmStatus.d.ts +14 -0
  101. package/lib/esm/types/FarmStatus.js +2 -0
  102. package/lib/esm/types/FarmStatus.js.map +1 -0
  103. package/lib/esm/types/GCAAndServerUrl.d.ts +5 -0
  104. package/lib/esm/types/GCAAndServerUrl.js +2 -0
  105. package/lib/esm/types/GCAAndServerUrl.js.map +1 -0
  106. package/lib/esm/types/GCAServerResponse.d.ts +6 -0
  107. package/lib/esm/types/GCAServerResponse.js +2 -0
  108. package/lib/esm/types/GCAServerResponse.js.map +1 -0
  109. package/lib/esm/types/GetEquipmentDataHandlerParams.d.ts +5 -0
  110. package/lib/esm/types/GetEquipmentDataHandlerParams.js +3 -0
  111. package/lib/esm/types/GetEquipmentDataHandlerParams.js.map +1 -0
  112. package/lib/esm/types/PayoutWalletAndSplit.d.ts +17 -0
  113. package/lib/esm/types/PayoutWalletAndSplit.js +2 -0
  114. package/lib/esm/types/PayoutWalletAndSplit.js.map +1 -0
  115. package/lib/esm/types/PayoutWalletAndSplitWithRewardSplits.d.ts +15 -0
  116. package/lib/esm/types/PayoutWalletAndSplitWithRewardSplits.js +2 -0
  117. package/lib/esm/types/PayoutWalletAndSplitWithRewardSplits.js.map +1 -0
  118. package/lib/esm/types/RewardSplit.d.ts +5 -0
  119. package/lib/esm/types/RewardSplit.js +3 -0
  120. package/lib/esm/types/RewardSplit.js.map +1 -0
  121. package/lib/esm/types/RewardSplits.d.ts +2 -0
  122. package/lib/esm/types/RewardSplits.js +2 -0
  123. package/lib/esm/types/RewardSplits.js.map +1 -0
  124. package/lib/esm/types/SlotRange.d.ts +4 -0
  125. package/lib/esm/types/SlotRange.js +3 -0
  126. package/lib/esm/types/SlotRange.js.map +1 -0
  127. package/lib/esm/types/WeekAndSlotRange.d.ts +5 -0
  128. package/lib/esm/types/WeekAndSlotRange.js +2 -0
  129. package/lib/esm/types/WeekAndSlotRange.js.map +1 -0
  130. package/lib/esm/types/index.d.ts +14 -0
  131. package/lib/esm/types/index.js +15 -0
  132. package/lib/esm/types/index.js.map +1 -0
  133. package/lib/esm/types/stashed-Farm.d.ts +20 -0
  134. package/lib/esm/types/stashed-Farm.js +2 -0
  135. package/lib/esm/types/stashed-Farm.js.map +1 -0
  136. package/package.json +46 -0
package/README.md ADDED
@@ -0,0 +1,98 @@
1
+ # Glow Labs ABIs
2
+
3
+ This repository contains the typechain types and abis related to the glow labs guarded launch.
4
+
5
+ ## Install
6
+
7
+ `npm install ethers@5.7.2 @glowlabs-org/guarded-launch-ethers-sdk`
8
+
9
+ ## Requirements
10
+
11
+ - Ethers V5
12
+ - Node version >= 16
13
+
14
+ ## Example Usage
15
+
16
+ ```typescript
17
+ import { ethers } from "ethers";
18
+ import {
19
+ type CarbonCreditDescendingPriceAuction,
20
+ CarbonCreditDescendingPriceAuction__factory,
21
+ type EarlyLiquidity,
22
+ EarlyLiquidity__factory,
23
+ GCCGuardedLaunch__factory,
24
+ type GCCGuardedLaunch,
25
+ GlowGuardedLaunch__factory,
26
+ type Governance,
27
+ Governance__factory,
28
+ type GrantsTreasury,
29
+ GrantsTreasury__factory,
30
+ type ImpactCatalyst,
31
+ ImpactCatalyst__factory,
32
+ type MinerPoolAndGCA,
33
+ MinerPoolAndGCA__factory,
34
+ type SafetyDelay,
35
+ SafetyDelay__factory,
36
+ type USDG,
37
+ USDG__factory,
38
+ type VetoCouncil,
39
+ VetoCouncil__factory,
40
+ addresses,
41
+ GlowGuardedLaunch,
42
+ } from "@glowlabs-org/guarded-launch-ethers-sdk";
43
+
44
+ const provider = new ethers.providers.JsonRpcProvider(
45
+ "https://mainnet.infura.io/v3/<INFURA_API_KEY>"
46
+ );
47
+
48
+ const auction: CarbonCreditDescendingPriceAuction =
49
+ CarbonCreditDescendingPriceAuction__factory.connect(
50
+ addresses.auction,
51
+ provider
52
+ );
53
+ const earlyLiquidity: EarlyLiquidity = EarlyLiquidity__factory.connect(
54
+ addresses.earlyLiquidity,
55
+ provider
56
+ );
57
+ const gccGuardedLaunch: GCCGuardedLaunch = GCCGuardedLaunch__factory.connect(
58
+ addresses.gccGuardedLaunch,
59
+ provider
60
+ );
61
+ const glowGuardedLaunch: GlowGuardedLaunch = GlowGuardedLaunch__factory.connect(
62
+ addresses.glowGuardedLaunch,
63
+ provider
64
+ );
65
+ const governance: Governance = Governance__factory.connect(
66
+ addresses.governance,
67
+ provider
68
+ );
69
+ const grantsTreasury: GrantsTreasury = GrantsTreasury__factory.connect(
70
+ addresses.grantsTreasury,
71
+ provider
72
+ );
73
+ const impactCatalyst: ImpactCatalyst = ImpactCatalyst__factory.connect(
74
+ addresses.impactCatalyst,
75
+ provider
76
+ );
77
+ const minerPoolAndGCA: MinerPoolAndGCA = MinerPoolAndGCA__factory.connect(
78
+ addresses.minerPoolAndGCA,
79
+ provider
80
+ );
81
+ const safetyDelay: SafetyDelay = SafetyDelay__factory.connect(
82
+ addresses.safetyDelay,
83
+ provider
84
+ );
85
+ const usdg: USDG = USDG__factory.connect(addresses.usdg, provider);
86
+ const vetoCouncil: VetoCouncil = VetoCouncil__factory.connect(
87
+ addresses.vetoCouncil,
88
+ provider
89
+ );
90
+
91
+ /**
92
+ * Use the typechain bindings to interact with the contracts
93
+ */
94
+ ```
95
+
96
+ ## Contributions
97
+
98
+ For contributions, feel free to open a PR or raise an issue.
@@ -0,0 +1 @@
1
+ export declare const GENESIS_TIMESTAMP: number;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GENESIS_TIMESTAMP = void 0;
4
+ exports.GENESIS_TIMESTAMP = 1700352000;
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAW,UAAU,CAAC"}
File without changes
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // import { GCAAndServerUrl } from "src/types/GCAAndServerUrl";
3
+ // export const gcaToServerUrls: GCAAndServerUrl[] = [
4
+ // {
5
+ // gca:"0xB2d687b199ee40e6113CD490455cC81eC325C496",
6
+ // urls:
7
+ // }
8
+ //TODO: Later when DD more robust testing is added
9
+ //# sourceMappingURL=gca-to-server-urls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gca-to-server-urls.js","sourceRoot":"","sources":["../../../src/default-values/gca-to-server-urls.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAE/D,sDAAsD;AACtD,QAAQ;AACR,4DAA4D;AAC5D,gBAAgB;AAChB,QAAQ;AAER,kDAAkD"}
@@ -0,0 +1,3 @@
1
+ export * from "./types";
2
+ export { createWeeklyReport, type CreateWeeklyReportArgs, } from "./lib/create-weekly-report";
3
+ export * from "./constants";
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.createWeeklyReport = void 0;
18
+ __exportStar(require("./types"), exports);
19
+ var create_weekly_report_1 = require("./lib/create-weekly-report");
20
+ Object.defineProperty(exports, "createWeeklyReport", { enumerable: true, get: function () { return create_weekly_report_1.createWeeklyReport; } });
21
+ __exportStar(require("./constants"), exports);
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,mEAGoC;AAFlC,0HAAA,kBAAkB,OAAA;AAGpB,8CAA4B"}
@@ -0,0 +1,43 @@
1
+ import { Farm } from "src/types/Farm";
2
+ import { GCAServerResponse } from "src/types/GCAServerResponse";
3
+ export type ApiRes = {
4
+ filteredFarms: Farm[];
5
+ rawData: GCAServerResponse;
6
+ multiplier: number;
7
+ };
8
+ export type MerkleLeafIntermediary = {
9
+ wallet: string;
10
+ glowWeight: number;
11
+ usdgWeight: number;
12
+ };
13
+ export type FinalLeaf = {
14
+ wallet: string;
15
+ glowWeight: string;
16
+ usdgWeight: string;
17
+ };
18
+ export type CreateWeeklyReportArgs = {
19
+ week: number;
20
+ gcaUrls: string[];
21
+ apiUrl: string;
22
+ };
23
+ export declare function createWeeklyReport(args: CreateWeeklyReportArgs): Promise<{
24
+ headlineStats: {
25
+ weekNumber: number;
26
+ totalCreditsProduced: number;
27
+ totalCreditsProducedBN: string;
28
+ totalGlowWeightInFinalized: string;
29
+ totalGlowWeightHuman: string;
30
+ totalUSDGWeightInFinalized: string;
31
+ totalUSDGWeightHuman: string;
32
+ root: string;
33
+ };
34
+ finalLeaves: FinalLeaf[];
35
+ farmsWithMerkleProofs: {
36
+ proof: string[];
37
+ wallet: string;
38
+ glowWeight: string;
39
+ usdgWeight: string;
40
+ }[];
41
+ farms: Farm[];
42
+ rawData: GCAServerResponse;
43
+ }>;
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createWeeklyReport = void 0;
7
+ const hash_leaf_1 = require("./utils/hash-leaf");
8
+ const merkletreejs_1 = __importDefault(require("merkletreejs"));
9
+ const ethers_1 = require("ethers");
10
+ const utils_1 = require("ethers/lib/utils");
11
+ /**
12
+ * @dev This is actually not as intuitive as it seems.
13
+ * Glow actually has 18 decimals, but glow weight is based on the amount of protocol fees (USDC) that the farm paid
14
+ * Therefore, the weight is based on the amount of USDC that was paid, which has 6 decimals
15
+ */
16
+ const GLOW_WEIGHT_DECIMAL_PRECISION = 6;
17
+ /**
18
+ * @dev This is actually not as intuitive as it seems.
19
+ * USDG weight is based on the amount of carbon credits produced, but the max value of a weight is ((2*64)-1) / 5 so we need to choose sensible precision to make sure that number never overflows
20
+ */
21
+ const USDG_WEIGHT_DECIMAL_PRECISION = 6;
22
+ // const GCA_URLS = ["http://95.217.194.59:35015"];
23
+ async function getFarmsForWeek(args) {
24
+ const { week: weekNumber, gcaUrls, apiUrl } = args;
25
+ const url = apiUrl;
26
+ // const url = "http://0.0.0.0:3005/headline_farm_stats";
27
+ const body = {
28
+ urls: gcaUrls,
29
+ week_number: weekNumber,
30
+ with_full_data: true,
31
+ include_unassigned_farms: false,
32
+ with_raw_data: true,
33
+ };
34
+ const res = await fetch(url, {
35
+ method: "POST",
36
+ body: JSON.stringify(body),
37
+ headers: {
38
+ "Content-Type": "application/json",
39
+ },
40
+ });
41
+ const _json = await res.json();
42
+ return _json;
43
+ }
44
+ async function createWeeklyReport(args) {
45
+ const map = new Map();
46
+ function addValueToMap(key, value, map) {
47
+ if (map.has(key)) {
48
+ //+= everything
49
+ const existingValue = map.get(key);
50
+ existingValue.glowWeight += value.glowWeight;
51
+ existingValue.usdgWeight += value.usdgWeight;
52
+ map.set(key, existingValue);
53
+ }
54
+ else {
55
+ map.set(key, value);
56
+ }
57
+ }
58
+ const apiResposne = await getFarmsForWeek(args);
59
+ const farms = apiResposne.filteredFarms;
60
+ const rawData = apiResposne.rawData;
61
+ let totalCreditsProduced = 0;
62
+ //log the total farms in farms
63
+ for (const farm of farms) {
64
+ // const {
65
+ // shortId,
66
+ // payoutWallet,
67
+ // installerGlowFeePercent,
68
+ // installerUsdgFeePercent,
69
+ // } = farm;
70
+ // const key = farm.payoutWallet;
71
+ // farm.carbonCreditsProduced =
72
+ farm.status === "Unassigned" ? 0 : farm.carbonCreditsProduced;
73
+ console.log(farm.status);
74
+ if (farm.carbonCreditsProduced < 0) {
75
+ throw new Error("Carbon credits produced is less than 0");
76
+ }
77
+ totalCreditsProduced += farm.carbonCreditsProduced;
78
+ // const value = {
79
+ // wallet: payoutWallet,
80
+ // glowWeight: farm.weeklyPayment * (1 - installerGlowFeePercent),
81
+ // usdgWeight: farm.carbonCreditsProduced * (1 - installerUsdgFeePercent),
82
+ // };
83
+ // const installerKey = farm.installerWallet;
84
+ // const installerValue = {
85
+ // wallet: farm.installerWallet,
86
+ // glowWeight: farm.weeklyPayment * installerGlowFeePercent,
87
+ // usdgWeight: farm.carbonCreditsProduced * installerUsdgFeePercent,
88
+ // };
89
+ if (!farm.rewardSplits)
90
+ throw new Error("No reward splits");
91
+ const sumOfRewardSplitsGlowWeight = farm.rewardSplits.reduce((acc, rewardSplit) => acc + rewardSplit.glowSplitPercent, 0);
92
+ const sumOfRewardSplitsUSDGWeight = farm.rewardSplits.reduce((acc, rewardSplit) => acc + rewardSplit.usdgSplitPercent, 0);
93
+ if (sumOfRewardSplitsGlowWeight !== 1)
94
+ throw new Error("Glow weight splits do not add up to 1");
95
+ if (sumOfRewardSplitsUSDGWeight !== 1)
96
+ throw new Error("USDG weight splits do not add up to 1");
97
+ for (const rewardSplit of farm.rewardSplits) {
98
+ const value = {
99
+ wallet: rewardSplit.walletAddress,
100
+ glowWeight: farm.weeklyPayment * rewardSplit.glowSplitPercent,
101
+ usdgWeight: farm.carbonCreditsProduced * rewardSplit.usdgSplitPercent,
102
+ };
103
+ addValueToMap(rewardSplit.walletAddress, value, map);
104
+ }
105
+ // addValueToMap(key, value, map);
106
+ // addValueToMap(installerKey, installerValue, map);
107
+ }
108
+ const merkleLeaves = Array.from(map.values());
109
+ const finalLeaves = merkleLeaves.map(({ wallet, glowWeight, usdgWeight }) => ({
110
+ wallet,
111
+ glowWeight: (0, utils_1.parseUnits)(glowWeight.toString(), GLOW_WEIGHT_DECIMAL_PRECISION).toString(),
112
+ usdgWeight: (0, utils_1.parseUnits)(usdgWeight.toString(), USDG_WEIGHT_DECIMAL_PRECISION).toString(),
113
+ }));
114
+ const leaves = finalLeaves.map((leaf) => (0, hash_leaf_1.hashLeaf)({
115
+ address: leaf.wallet,
116
+ glowWeight: leaf.glowWeight,
117
+ usdcWeight: leaf.usdgWeight,
118
+ }));
119
+ const tree = new merkletreejs_1.default(leaves, ethers_1.ethers.utils.keccak256, { sort: true });
120
+ const root = tree.getHexRoot();
121
+ const totalGlowWeightFinalizedLeavesSum = finalLeaves.reduce((acc, { glowWeight }) => acc.add(glowWeight), ethers_1.ethers.BigNumber.from(0));
122
+ const totalGCCWeightFinalizedLeavesSum = finalLeaves.reduce((acc, { usdgWeight }) => acc.add(usdgWeight), ethers_1.ethers.BigNumber.from(0));
123
+ const headlineStats = {
124
+ weekNumber: args.week,
125
+ totalCreditsProduced,
126
+ totalCreditsProducedBN: (0, utils_1.parseUnits)(totalCreditsProduced.toString(), 18).toString(),
127
+ totalGlowWeightInFinalized: totalGlowWeightFinalizedLeavesSum.toString(),
128
+ totalGlowWeightHuman: (0, utils_1.formatUnits)(BigInt(totalGlowWeightFinalizedLeavesSum.toString()), GLOW_WEIGHT_DECIMAL_PRECISION).toString(),
129
+ totalUSDGWeightInFinalized: totalGCCWeightFinalizedLeavesSum.toString(),
130
+ totalUSDGWeightHuman: (0, utils_1.formatUnits)(BigInt(totalGCCWeightFinalizedLeavesSum.toString()), USDG_WEIGHT_DECIMAL_PRECISION).toString(),
131
+ root: root,
132
+ };
133
+ const farmsWithMerkleProofs = finalLeaves.map((leaf) => {
134
+ const hashedLeaf = (0, hash_leaf_1.hashLeaf)({
135
+ address: leaf.wallet,
136
+ glowWeight: leaf.glowWeight,
137
+ usdcWeight: leaf.usdgWeight,
138
+ });
139
+ const proof = tree.getHexProof(hashedLeaf);
140
+ const isValid = tree.verify(proof, hashedLeaf, root);
141
+ if (!isValid) {
142
+ throw new Error("Invalid proof");
143
+ }
144
+ return {
145
+ ...leaf,
146
+ proof,
147
+ };
148
+ });
149
+ //-----------------------------------------------------//
150
+ //-Some invariant tests in case something got messed up//
151
+ //-----------------------------------------------------//
152
+ //Make sure that the sum of all the glow weight is equal to the sum of all the glow weight in the final leaves
153
+ let forLoopedGlowWeightSum = ethers_1.ethers.BigNumber.from(0);
154
+ for (const farm of farmsWithMerkleProofs) {
155
+ forLoopedGlowWeightSum = forLoopedGlowWeightSum.add(ethers_1.BigNumber.from(farm.glowWeight));
156
+ }
157
+ if (!forLoopedGlowWeightSum.eq(totalGlowWeightFinalizedLeavesSum)) {
158
+ throw new Error("Glow weight sum is not equal");
159
+ }
160
+ //do the same for gcc
161
+ let forLoopedGCCWeightSum = ethers_1.ethers.BigNumber.from(0);
162
+ for (const farm of farmsWithMerkleProofs) {
163
+ forLoopedGCCWeightSum = forLoopedGCCWeightSum.add(ethers_1.BigNumber.from(farm.usdgWeight));
164
+ }
165
+ if (!forLoopedGCCWeightSum.eq(totalGCCWeightFinalizedLeavesSum)) {
166
+ throw new Error("GCC weight sum is not equal");
167
+ }
168
+ return {
169
+ headlineStats,
170
+ finalLeaves,
171
+ farmsWithMerkleProofs,
172
+ farms,
173
+ rawData,
174
+ };
175
+ }
176
+ exports.createWeeklyReport = createWeeklyReport;
177
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/create-weekly-report/index.ts"],"names":[],"mappings":";;;;;;AACA,iDAA6C;AAC7C,gEAAsC;AACtC,mCAA2C;AAE3C,4CAA2D;AAoB3D;;;;GAIG;AACH,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAExC;;;GAGG;AACH,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAMxC,mDAAmD;AACnD,KAAK,UAAU,eAAe,CA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,gCAAgC,CAAC,EAAE,CAAC;QAChE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IAED,OAAO;QACL,aAAa;QACb,WAAW;QACX,qBAAqB;QACrB,KAAK;QACL,OAAO;KACR,CAAC;AACJ,CAAC;AArLD,gDAqLC"}
@@ -0,0 +1,7 @@
1
+ type HashLeafArgs = {
2
+ address: string;
3
+ glowWeight: string;
4
+ usdcWeight: string;
5
+ };
6
+ export declare function hashLeaf({ address, glowWeight, usdcWeight, }: HashLeafArgs): string;
7
+ export {};
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hashLeaf = void 0;
4
+ const ethers_1 = require("ethers");
5
+ const leafTypes = ["address", "uint256", "uint256"];
6
+ function hashLeaf({ address, glowWeight, usdcWeight, }) {
7
+ const hash = ethers_1.ethers.utils.solidityKeccak256(leafTypes, [
8
+ address,
9
+ glowWeight,
10
+ usdcWeight,
11
+ ]);
12
+ return hash;
13
+ }
14
+ exports.hashLeaf = hashLeaf;
15
+ //
16
+ //# sourceMappingURL=hash-leaf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash-leaf.js","sourceRoot":"","sources":["../../../../../src/lib/create-weekly-report/utils/hash-leaf.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,MAAM,SAAS,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAOpD,SAAgB,QAAQ,CAAC,EACvB,OAAO,EACP,UAAU,EACV,UAAU,GACG;IACb,MAAM,IAAI,GAAG,eAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,EAAE;QACrD,OAAO;QACP,UAAU;QACV,UAAU;KACX,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC;AAXD,4BAWC;AAED,EAAE"}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,3 @@
1
+ export interface AuditCompleted {
2
+ week: number;
3
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=AuditCompleted.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuditCompleted.js","sourceRoot":"","sources":["../../../src/types/AuditCompleted.ts"],"names":[],"mappings":";AAAA,4GAA4G"}
@@ -0,0 +1,6 @@
1
+ export interface AuditInherited {
2
+ originalAuditCompleteWeek: number;
3
+ oldFarmId: bigint;
4
+ weekAuditWasInherited: number;
5
+ slotRangeActiveInWeekInherited: [number, number];
6
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=AuditInherited.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuditInherited.js","sourceRoot":"","sources":["../../../src/types/AuditInherited.ts"],"names":[],"mappings":";AAAA,4GAA4G"}
@@ -0,0 +1,5 @@
1
+ export interface Device {
2
+ PublicKey: Array<number>;
3
+ powerOutputs: Array<number>;
4
+ impactRates: Array<number>;
5
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=Device.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Device.js","sourceRoot":"","sources":["../../../src/types/Device.ts"],"names":[],"mappings":";AAAA,4GAA4G"}
@@ -0,0 +1,8 @@
1
+ import type { AuditInherited } from "./AuditInherited";
2
+ export interface DuplicatedButPastAuditCompleted {
3
+ weekDuplicated: number;
4
+ slotRangeActiveInWeekDuplicated: [number, number];
5
+ originalWeekAuditCompletedOrInherited: number;
6
+ newFarmId: bigint;
7
+ ifWasAlsoAuditInheritedInOnboardingWeek: AuditInherited | null;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=DuplicatedButPastAuditCompleted.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DuplicatedButPastAuditCompleted.js","sourceRoot":"","sources":["../../../src/types/DuplicatedButPastAuditCompleted.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import type { FarmStatus } from "./FarmStatus";
2
+ import type { RewardSplits } from "./RewardSplits";
3
+ import type { SlotRange } from "./SlotRange";
4
+ export interface Farm {
5
+ hexlifiedPublicKey: string;
6
+ carbonCreditsProduced: number;
7
+ powerOutputs: Array<number>;
8
+ impactRates: Array<number>;
9
+ weeklyPayment: number;
10
+ rollingImpactPoints: number;
11
+ powerOutput: number;
12
+ shortId: bigint;
13
+ protocolFee: number;
14
+ rewardSplits: RewardSplits | null;
15
+ status: FarmStatus;
16
+ protocolFeePaymentHash: string | null;
17
+ weeksAndSlotRangesToInvertPowerMap: Record<number, Array<SlotRange>> | null;
18
+ weeksAndSlotsToInvalidatePowerMap: Record<number, Array<SlotRange>> | null;
19
+ timestampAuditedComplete: bigint | null;
20
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Farm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Farm.js","sourceRoot":"","sources":["../../../src/types/Farm.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ import type { AuditCompleted } from "./AuditCompleted";
2
+ import type { AuditInherited } from "./AuditInherited";
3
+ import type { DuplicatedButPastAuditCompleted } from "./DuplicatedButPastAuditCompleted";
4
+ export type FarmStatus = {
5
+ AuditCompleted: AuditCompleted;
6
+ } | {
7
+ AuditInherited: AuditInherited;
8
+ } | {
9
+ Banned: number;
10
+ } | {
11
+ Duplicate: number;
12
+ } | {
13
+ DuplicateWithPastAuditCompleted: DuplicatedButPastAuditCompleted;
14
+ } | "Unassigned";
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=FarmStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FarmStatus.js","sourceRoot":"","sources":["../../../src/types/FarmStatus.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export type GCAAndServerUrl = {
2
+ gca: `0x${string}`;
3
+ urls: string[];
4
+ notes?: string[];
5
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=GCAAndServerUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GCAAndServerUrl.js","sourceRoot":"","sources":["../../../src/types/GCAAndServerUrl.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { Device } from "./Device";
2
+ export interface GCAServerResponse {
3
+ Devices: Array<Device>;
4
+ TimeslotOffset: bigint;
5
+ signature: Array<number>;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=GCAServerResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GCAServerResponse.js","sourceRoot":"","sources":["../../../src/types/GCAServerResponse.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export interface GetEquipmentDataHandlerParams {
2
+ url: string;
3
+ weekNumber: number;
4
+ withFullData: boolean | null;
5
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=GetEquipmentDataHandlerParams.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetEquipmentDataHandlerParams.js","sourceRoot":"","sources":["../../../src/types/GetEquipmentDataHandlerParams.ts"],"names":[],"mappings":";AAAA,4GAA4G"}
@@ -0,0 +1,17 @@
1
+ import type { FarmStatus } from "./FarmStatus";
2
+ import type { SlotRange } from "./SlotRange";
3
+ export interface PayoutWalletAndSplit {
4
+ short_id: bigint;
5
+ payout_wallet: string;
6
+ auditor: string;
7
+ auditor_percenage_glow_weight: number;
8
+ auditor_percentage_usdc_weight: number;
9
+ glow_weight: number;
10
+ comments: Array<string> | null;
11
+ payment_tx_hash: string | null;
12
+ protocol_fee_paid_week: number;
13
+ status: FarmStatus | null;
14
+ weeks_and_slot_ranges_to_invert_power_map: Record<number, Array<SlotRange>> | null;
15
+ weeks_and_slots_to_invalidate_power_map: Record<number, Array<SlotRange>> | null;
16
+ timestamp_audited_completed: bigint | null;
17
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=PayoutWalletAndSplit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PayoutWalletAndSplit.js","sourceRoot":"","sources":["../../../src/types/PayoutWalletAndSplit.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import type { FarmStatus } from "./FarmStatus";
2
+ import type { RewardSplits } from "./RewardSplits";
3
+ import type { SlotRange } from "./SlotRange";
4
+ export interface PayoutWalletAndSplitWithRewardSplits {
5
+ short_id: bigint;
6
+ reward_splits: RewardSplits | null;
7
+ glow_weight: number;
8
+ comments: Array<string> | null;
9
+ payment_tx_hash: string | null;
10
+ protocol_fee_paid_week: number;
11
+ status: FarmStatus | null;
12
+ weeks_and_slot_ranges_to_invert_power_map: Record<number, Array<SlotRange>> | null;
13
+ weeks_and_slots_to_invalidate_power_map: Record<number, Array<SlotRange>> | null;
14
+ timestamp_audited_completed: bigint | null;
15
+ }