@glowlabs-org/utils 0.0.8 → 0.1.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.
- package/.github/workflows/publish.yml +14 -4
- package/dist/cjs/constants/regex.d.ts +1 -0
- package/dist/cjs/constants/urls.d.ts +2 -0
- package/dist/cjs/constants/weights.d.ts +12 -0
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.js +19091 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/lib/create-weekly-report/index.d.ts +73 -0
- package/dist/cjs/lib/create-weekly-report/types/Audit.d.ts +40 -0
- package/dist/cjs/lib/create-weekly-report/types/RewardSplit.d.ts +5 -0
- package/dist/cjs/lib/create-weekly-report/types/RewardSplits.d.ts +2 -0
- package/dist/cjs/lib/create-weekly-report/types/index.d.ts +7 -0
- package/dist/cjs/lib/create-weekly-report/types/merkle.d.ts +10 -0
- package/dist/cjs/lib/create-weekly-report/utils/accumulate-leaf-weights.d.ts +2 -0
- package/dist/cjs/lib/create-weekly-report/utils/custom-to-fixed.d.ts +1 -0
- package/dist/cjs/lib/create-weekly-report/utils/fetch-farms-for-week.d.ts +12 -0
- package/dist/cjs/lib/create-weekly-report/utils/from-bigint.d.ts +7 -0
- package/dist/cjs/lib/create-weekly-report/utils/greater-than-max-deviation.d.ts +1 -0
- package/dist/cjs/lib/create-weekly-report/utils/multiply-bigInt-by-decimal-percentage.d.ts +1 -0
- package/dist/cjs/lib/create-weekly-report/utils/to-bigint.d.ts +7 -0
- package/dist/cjs/utils/custom-to-fixed.d.ts +1 -0
- package/dist/cjs/utils/greater-than-max-deviation.d.ts +1 -0
- package/dist/cjs/utils/hash-leaf.d.ts +7 -0
- package/dist/esm/constants/index.d.ts +1 -0
- package/dist/esm/constants/regex.d.ts +1 -0
- package/dist/esm/constants/urls.d.ts +2 -0
- package/dist/esm/constants/weights.d.ts +12 -0
- package/dist/esm/default-values/gca-to-server-urls.d.ts +0 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +19088 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/create-weekly-report/index.d.ts +73 -0
- package/dist/esm/lib/create-weekly-report/types/Audit.d.ts +40 -0
- package/dist/esm/lib/create-weekly-report/types/AuditCompleted.d.ts +3 -0
- package/dist/esm/lib/create-weekly-report/types/AuditInherited.d.ts +6 -0
- package/dist/esm/lib/create-weekly-report/types/Device.d.ts +5 -0
- package/dist/esm/lib/create-weekly-report/types/DuplicatedButPastAuditCompleted.d.ts +8 -0
- package/dist/esm/lib/create-weekly-report/types/Farm.d.ts +20 -0
- package/dist/esm/lib/create-weekly-report/types/FarmStatus.d.ts +14 -0
- package/dist/esm/lib/create-weekly-report/types/GCAServerResponse.d.ts +6 -0
- package/dist/esm/lib/create-weekly-report/types/GetEquipmentDataHandlerParams.d.ts +5 -0
- package/dist/esm/lib/create-weekly-report/types/PayoutWalletAndSplit.d.ts +17 -0
- package/dist/esm/lib/create-weekly-report/types/PayoutWalletAndSplitWithRewardSplits.d.ts +15 -0
- package/dist/esm/lib/create-weekly-report/types/RewardSplit copy.d.ts +5 -0
- package/dist/esm/lib/create-weekly-report/types/RewardSplit.d.ts +5 -0
- package/dist/esm/lib/create-weekly-report/types/RewardSplits copy.d.ts +2 -0
- package/dist/esm/lib/create-weekly-report/types/RewardSplits.d.ts +2 -0
- package/dist/esm/lib/create-weekly-report/types/SlotRange.d.ts +4 -0
- package/dist/esm/lib/create-weekly-report/types/WeekAndSlotRange.d.ts +5 -0
- package/dist/esm/lib/create-weekly-report/types/index.d.ts +7 -0
- package/dist/esm/lib/create-weekly-report/types/merkle.d.ts +10 -0
- package/dist/esm/lib/create-weekly-report/types/stashed-Farm.d.ts +20 -0
- package/dist/esm/lib/create-weekly-report/utils/accumulate-leaf-weights.d.ts +2 -0
- package/dist/esm/lib/create-weekly-report/utils/custom-to-fixed.d.ts +1 -0
- package/dist/esm/lib/create-weekly-report/utils/fetch-farms-for-week.d.ts +12 -0
- package/dist/esm/lib/create-weekly-report/utils/from-bigint.d.ts +7 -0
- package/dist/esm/lib/create-weekly-report/utils/greater-than-max-deviation.d.ts +1 -0
- package/dist/esm/lib/create-weekly-report/utils/hashLeaf.d.ts +7 -0
- package/dist/esm/lib/create-weekly-report/utils/multiply-bigInt-by-decimal-percentage.d.ts +1 -0
- package/dist/esm/lib/create-weekly-report/utils/to-bigint.d.ts +7 -0
- package/dist/esm/utils/custom-to-fixed.d.ts +1 -0
- package/dist/esm/utils/greater-than-max-deviation.d.ts +1 -0
- package/dist/esm/utils/hash-leaf.d.ts +7 -0
- package/package.json +22 -22
- package/rollup.config.js +28 -0
- package/src/constants/regex.ts +2 -0
- package/src/constants/urls.ts +3 -0
- package/src/constants/weights.ts +15 -0
- package/src/index.ts +2 -257
- package/src/lib/create-weekly-report/index.ts +691 -0
- package/src/lib/create-weekly-report/types/Audit.ts +41 -0
- package/src/{types → lib/create-weekly-report/types}/AuditCompleted.ts +3 -1
- package/src/lib/create-weekly-report/types/AuditInherited.ts +8 -0
- package/src/lib/create-weekly-report/types/Device.ts +7 -0
- package/src/lib/create-weekly-report/types/DuplicatedButPastAuditCompleted.ts +10 -0
- package/src/lib/create-weekly-report/types/Farm.ts +22 -0
- package/src/{types → lib/create-weekly-report/types}/FarmStatus.ts +6 -6
- package/src/{types → lib/create-weekly-report/types}/GCAServerResponse.ts +5 -1
- package/src/lib/create-weekly-report/types/GetEquipmentDataHandlerParams.ts +7 -0
- package/src/lib/create-weekly-report/types/PayoutWalletAndSplit.ts +25 -0
- package/src/lib/create-weekly-report/types/PayoutWalletAndSplitWithRewardSplits.ts +23 -0
- package/src/lib/create-weekly-report/types/RewardSplit copy.ts +7 -0
- package/src/lib/create-weekly-report/types/RewardSplit.ts +7 -0
- package/{dist/types/Device.js → src/lib/create-weekly-report/types/RewardSplits copy.ts } +3 -2
- package/src/{types → lib/create-weekly-report/types}/RewardSplits.ts +1 -1
- package/src/{types → lib/create-weekly-report/types}/SlotRange.ts +4 -1
- package/src/{types → lib/create-weekly-report/types}/WeekAndSlotRange.ts +4 -1
- package/src/lib/create-weekly-report/types/index.ts +7 -0
- package/src/lib/create-weekly-report/types/merkle.ts +11 -0
- package/src/lib/create-weekly-report/types/stashed-Farm.ts +22 -0
- package/src/lib/create-weekly-report/utils/accumulate-leaf-weights.ts +17 -0
- package/src/lib/create-weekly-report/utils/custom-to-fixed.ts +9 -0
- package/src/lib/create-weekly-report/utils/fetch-farms-for-week.ts +30 -0
- package/src/lib/create-weekly-report/utils/from-bigint.ts +12 -0
- package/src/lib/create-weekly-report/utils/greater-than-max-deviation.ts +9 -0
- package/src/lib/create-weekly-report/utils/hashLeaf.ts +20 -0
- package/src/lib/create-weekly-report/utils/multiply-bigInt-by-decimal-percentage.ts +15 -0
- package/src/lib/create-weekly-report/utils/to-bigint.ts +16 -0
- package/src/utils/custom-to-fixed.ts +9 -0
- package/src/utils/greater-than-max-deviation.ts +9 -0
- package/tsconfig.json +4 -4
- package/dist/constants/index.js +0 -2
- package/dist/constants/index.js.map +0 -1
- package/dist/default-values/gca-to-server-urls.js +0 -9
- package/dist/default-values/gca-to-server-urls.js.map +0 -1
- package/dist/hash-leaf.js +0 -12
- package/dist/hash-leaf.js.map +0 -1
- package/dist/index.d.ts +0 -44
- package/dist/index.js +0 -176
- package/dist/index.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/types/AuditCompleted.js +0 -3
- package/dist/types/AuditCompleted.js.map +0 -1
- package/dist/types/AuditInherited.js +0 -3
- package/dist/types/AuditInherited.js.map +0 -1
- package/dist/types/Device.js.map +0 -1
- package/dist/types/DuplicatedButPastAuditCompleted.js +0 -2
- package/dist/types/DuplicatedButPastAuditCompleted.js.map +0 -1
- package/dist/types/Farm.js +0 -2
- package/dist/types/Farm.js.map +0 -1
- package/dist/types/FarmStatus.js +0 -2
- package/dist/types/FarmStatus.js.map +0 -1
- package/dist/types/GCAAndServerUrl.d.ts +0 -5
- package/dist/types/GCAAndServerUrl.js +0 -2
- package/dist/types/GCAAndServerUrl.js.map +0 -1
- package/dist/types/GCAServerResponse.js +0 -2
- package/dist/types/GCAServerResponse.js.map +0 -1
- package/dist/types/GetEquipmentDataHandlerParams.js +0 -3
- package/dist/types/GetEquipmentDataHandlerParams.js.map +0 -1
- package/dist/types/PayoutWalletAndSplit.js +0 -2
- package/dist/types/PayoutWalletAndSplit.js.map +0 -1
- package/dist/types/PayoutWalletAndSplitWithRewardSplits.js +0 -2
- package/dist/types/PayoutWalletAndSplitWithRewardSplits.js.map +0 -1
- package/dist/types/RewardSplit.js +0 -3
- package/dist/types/RewardSplit.js.map +0 -1
- package/dist/types/RewardSplits.js +0 -2
- package/dist/types/RewardSplits.js.map +0 -1
- package/dist/types/SlotRange.js +0 -3
- package/dist/types/SlotRange.js.map +0 -1
- package/dist/types/WeekAndSlotRange.js +0 -2
- package/dist/types/WeekAndSlotRange.js.map +0 -1
- package/dist/types/index.d.ts +0 -14
- package/dist/types/index.js +0 -15
- package/dist/types/index.js.map +0 -1
- package/dist/types/stashed-Farm.js +0 -2
- package/dist/types/stashed-Farm.js.map +0 -1
- package/src/types/AuditInherited.ts +0 -3
- package/src/types/Device.ts +0 -3
- package/src/types/DuplicatedButPastAuditCompleted.ts +0 -4
- package/src/types/Farm.ts +0 -22
- package/src/types/GCAAndServerUrl.ts +0 -5
- package/src/types/GetEquipmentDataHandlerParams.ts +0 -3
- package/src/types/PayoutWalletAndSplit.ts +0 -5
- package/src/types/PayoutWalletAndSplitWithRewardSplits.ts +0 -6
- package/src/types/RewardSplit.ts +0 -3
- package/src/types/index.ts +0 -14
- package/src/types/stashed-Farm.ts +0 -22
- /package/dist/{constants → cjs/constants}/index.d.ts +0 -0
- /package/dist/{default-values → cjs/default-values}/gca-to-server-urls.d.ts +0 -0
- /package/dist/{types → cjs/lib/create-weekly-report/types}/AuditCompleted.d.ts +0 -0
- /package/dist/{types → cjs/lib/create-weekly-report/types}/AuditInherited.d.ts +0 -0
- /package/dist/{types → cjs/lib/create-weekly-report/types}/Device.d.ts +0 -0
- /package/dist/{types → cjs/lib/create-weekly-report/types}/DuplicatedButPastAuditCompleted.d.ts +0 -0
- /package/dist/{types → cjs/lib/create-weekly-report/types}/Farm.d.ts +0 -0
- /package/dist/{types → cjs/lib/create-weekly-report/types}/FarmStatus.d.ts +0 -0
- /package/dist/{types → cjs/lib/create-weekly-report/types}/GCAServerResponse.d.ts +0 -0
- /package/dist/{types → cjs/lib/create-weekly-report/types}/GetEquipmentDataHandlerParams.d.ts +0 -0
- /package/dist/{types → cjs/lib/create-weekly-report/types}/PayoutWalletAndSplit.d.ts +0 -0
- /package/dist/{types → cjs/lib/create-weekly-report/types}/PayoutWalletAndSplitWithRewardSplits.d.ts +0 -0
- /package/dist/{types/RewardSplit.d.ts → cjs/lib/create-weekly-report/types/RewardSplit copy.d.ts} +0 -0
- /package/dist/{types/RewardSplits.d.ts → cjs/lib/create-weekly-report/types/RewardSplits copy.d.ts} +0 -0
- /package/dist/{types → cjs/lib/create-weekly-report/types}/SlotRange.d.ts +0 -0
- /package/dist/{types → cjs/lib/create-weekly-report/types}/WeekAndSlotRange.d.ts +0 -0
- /package/dist/{types → cjs/lib/create-weekly-report/types}/stashed-Farm.d.ts +0 -0
- /package/dist/{hash-leaf.d.ts → cjs/lib/create-weekly-report/utils/hashLeaf.d.ts} +0 -0
- /package/src/{hash-leaf.ts → utils/hash-leaf.ts} +0 -0
package/dist/types/index.d.ts
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
export * from "./AuditCompleted";
|
2
|
-
export * from "./AuditInherited";
|
3
|
-
export * from "./Device";
|
4
|
-
export * from "./DuplicatedButPastAuditCompleted";
|
5
|
-
export * from "./Farm";
|
6
|
-
export * from "./FarmStatus";
|
7
|
-
export * from "./GCAServerResponse";
|
8
|
-
export * from "./GetEquipmentDataHandlerParams";
|
9
|
-
export * from "./PayoutWalletAndSplit";
|
10
|
-
export * from "./PayoutWalletAndSplitWithRewardSplits";
|
11
|
-
export * from "./RewardSplit";
|
12
|
-
export * from "./RewardSplits";
|
13
|
-
export * from "./SlotRange";
|
14
|
-
export * from "./WeekAndSlotRange";
|
package/dist/types/index.js
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
export * from "./AuditCompleted";
|
2
|
-
export * from "./AuditInherited";
|
3
|
-
export * from "./Device";
|
4
|
-
export * from "./DuplicatedButPastAuditCompleted";
|
5
|
-
export * from "./Farm";
|
6
|
-
export * from "./FarmStatus";
|
7
|
-
export * from "./GCAServerResponse";
|
8
|
-
export * from "./GetEquipmentDataHandlerParams";
|
9
|
-
export * from "./PayoutWalletAndSplit";
|
10
|
-
export * from "./PayoutWalletAndSplitWithRewardSplits";
|
11
|
-
export * from "./RewardSplit";
|
12
|
-
export * from "./RewardSplits";
|
13
|
-
export * from "./SlotRange";
|
14
|
-
export * from "./WeekAndSlotRange";
|
15
|
-
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,mCAAmC,CAAC;AAClD,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,wCAAwC,CAAC;AACvD,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"stashed-Farm.js","sourceRoot":"","sources":["../../src/types/stashed-Farm.ts"],"names":[],"mappings":""}
|
@@ -1,3 +0,0 @@
|
|
1
|
-
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
2
|
-
|
3
|
-
export interface AuditInherited { originalAuditCompleteWeek: number, oldFarmId: bigint, weekAuditWasInherited: number, slotRangeActiveInWeekInherited: [number, number], }
|
package/src/types/Device.ts
DELETED
@@ -1,4 +0,0 @@
|
|
1
|
-
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
2
|
-
import type { AuditInherited } from "./AuditInherited";
|
3
|
-
|
4
|
-
export interface DuplicatedButPastAuditCompleted { weekDuplicated: number, slotRangeActiveInWeekDuplicated: [number, number], originalWeekAuditCompletedOrInherited: number, newFarmId: bigint, ifWasAlsoAuditInheritedInOnboardingWeek: AuditInherited | null, }
|
package/src/types/Farm.ts
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
2
|
-
import type { FarmStatus } from "./FarmStatus";
|
3
|
-
import type { RewardSplits } from "./RewardSplits";
|
4
|
-
import type { SlotRange } from "./SlotRange";
|
5
|
-
|
6
|
-
export interface Farm {
|
7
|
-
hexlifiedPublicKey: string;
|
8
|
-
carbonCreditsProduced: number;
|
9
|
-
powerOutputs: Array<number>;
|
10
|
-
impactRates: Array<number>;
|
11
|
-
weeklyPayment: number;
|
12
|
-
rollingImpactPoints: number;
|
13
|
-
powerOutput: number;
|
14
|
-
shortId: bigint;
|
15
|
-
protocolFee: number;
|
16
|
-
rewardSplits: RewardSplits | null;
|
17
|
-
status: FarmStatus;
|
18
|
-
protocolFeePaymentHash: string | null;
|
19
|
-
weeksAndSlotRangesToInvertPowerMap: Record<number, Array<SlotRange>> | null;
|
20
|
-
weeksAndSlotsToInvalidatePowerMap: Record<number, Array<SlotRange>> | null;
|
21
|
-
timestampAuditedComplete: bigint | null;
|
22
|
-
}
|
@@ -1,5 +0,0 @@
|
|
1
|
-
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
2
|
-
import type { FarmStatus } from "./FarmStatus";
|
3
|
-
import type { SlotRange } from "./SlotRange";
|
4
|
-
|
5
|
-
export interface PayoutWalletAndSplit { short_id: bigint, payout_wallet: string, auditor: string, auditor_percenage_glow_weight: number, auditor_percentage_usdc_weight: number, glow_weight: number, comments: Array<string> | null, payment_tx_hash: string | null, protocol_fee_paid_week: number, status: FarmStatus | null, weeks_and_slot_ranges_to_invert_power_map: Record<number, Array<SlotRange>> | null, weeks_and_slots_to_invalidate_power_map: Record<number, Array<SlotRange>> | null, timestamp_audited_completed: bigint | null, }
|
@@ -1,6 +0,0 @@
|
|
1
|
-
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
2
|
-
import type { FarmStatus } from "./FarmStatus";
|
3
|
-
import type { RewardSplits } from "./RewardSplits";
|
4
|
-
import type { SlotRange } from "./SlotRange";
|
5
|
-
|
6
|
-
export interface PayoutWalletAndSplitWithRewardSplits { short_id: bigint, reward_splits: RewardSplits | null, glow_weight: number, comments: Array<string> | null, payment_tx_hash: string | null, protocol_fee_paid_week: number, status: FarmStatus | null, weeks_and_slot_ranges_to_invert_power_map: Record<number, Array<SlotRange>> | null, weeks_and_slots_to_invalidate_power_map: Record<number, Array<SlotRange>> | null, timestamp_audited_completed: bigint | null, }
|
package/src/types/RewardSplit.ts
DELETED
package/src/types/index.ts
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
export * from "./AuditCompleted";
|
2
|
-
export * from "./AuditInherited";
|
3
|
-
export * from "./Device";
|
4
|
-
export * from "./DuplicatedButPastAuditCompleted";
|
5
|
-
export * from "./Farm";
|
6
|
-
export * from "./FarmStatus";
|
7
|
-
export * from "./GCAServerResponse";
|
8
|
-
export * from "./GetEquipmentDataHandlerParams";
|
9
|
-
export * from "./PayoutWalletAndSplit";
|
10
|
-
export * from "./PayoutWalletAndSplitWithRewardSplits";
|
11
|
-
export * from "./RewardSplit";
|
12
|
-
export * from "./RewardSplits";
|
13
|
-
export * from "./SlotRange";
|
14
|
-
export * from "./WeekAndSlotRange";
|
@@ -1,22 +0,0 @@
|
|
1
|
-
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
2
|
-
import type { FarmStatus } from "./FarmStatus";
|
3
|
-
import type { RewardSplits } from "./RewardSplits";
|
4
|
-
import type { SlotRange } from "./SlotRange";
|
5
|
-
|
6
|
-
export interface Farm {
|
7
|
-
hexlifiedPublicKey: string;
|
8
|
-
carbonCreditsProduced: number;
|
9
|
-
powerOutputs: Array<number>;
|
10
|
-
impactRates: Array<number>;
|
11
|
-
weeklyPayment: number;
|
12
|
-
rollingImpactPoints: number;
|
13
|
-
powerOutput: number;
|
14
|
-
shortId: bigint;
|
15
|
-
protocolFee: number;
|
16
|
-
rewardSplits: RewardSplits | null;
|
17
|
-
status: FarmStatus;
|
18
|
-
protocolFeePaymentHash: string | null;
|
19
|
-
weeksAndSlotRangesToInvertPowerMap: Record<number, Array<SlotRange>> | null;
|
20
|
-
weeksAndSlotsToInvalidatePowerMap: Record<number, Array<SlotRange>> | null;
|
21
|
-
timestampAuditedComplete: bigint | null;
|
22
|
-
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/dist/{types → cjs/lib/create-weekly-report/types}/DuplicatedButPastAuditCompleted.d.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/dist/{types → cjs/lib/create-weekly-report/types}/GetEquipmentDataHandlerParams.d.ts
RENAMED
File without changes
|
File without changes
|
/package/dist/{types → cjs/lib/create-weekly-report/types}/PayoutWalletAndSplitWithRewardSplits.d.ts
RENAMED
File without changes
|
/package/dist/{types/RewardSplit.d.ts → cjs/lib/create-weekly-report/types/RewardSplit copy.d.ts}
RENAMED
File without changes
|
/package/dist/{types/RewardSplits.d.ts → cjs/lib/create-weekly-report/types/RewardSplits copy.d.ts}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|