-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01e8640
commit 3c701be
Showing
5 changed files
with
175,897 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { CliffAdapterResult } from "../../types/adapters"; | ||
import jsob from "./schedule.json"; | ||
|
||
type Unlock = { amount: number; locktime: number }; | ||
type Allocation = { | ||
initialAmount: number; | ||
unlockSchedule: Unlock[]; | ||
}; | ||
|
||
export function time(): Object { | ||
const data: any = jsob; | ||
const res: { [label: string]: CliffAdapterResult[] } = {}; | ||
|
||
data.allocations.map((a: Allocation, i: number) => { | ||
const sections: CliffAdapterResult[] = []; | ||
|
||
if (a.initialAmount) | ||
sections.push({ | ||
type: "cliff", | ||
start: data.startTime, | ||
amount: a.initialAmount, | ||
}); | ||
|
||
a.unlockSchedule.map((u: Unlock) => { | ||
sections.push({ type: "cliff", start: u.locktime, amount: u.amount }); | ||
}); | ||
|
||
if (sections.length == 0) return; | ||
|
||
res[`Unknown ${i}`] = sections; | ||
}); | ||
|
||
return res; | ||
} |
Oops, something went wrong.