Skip to content

Commit

Permalink
woo, kwenta, avax (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
waynebruce0x committed Sep 21, 2023
1 parent 01e8640 commit 3c701be
Show file tree
Hide file tree
Showing 5 changed files with 175,897 additions and 0 deletions.
34 changes: 34 additions & 0 deletions adapters/avax/index.ts
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;
}
Loading

0 comments on commit 3c701be

Please sign in to comment.