-
Notifications
You must be signed in to change notification settings - Fork 175
/
peggedAsset.type.ts
58 lines (52 loc) · 1.18 KB
/
peggedAsset.type.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { BridgeID } from "../../peggedData/bridgeData";
export type ChainBlocks = {
[x: string]: number;
};
export type PeggedAssetType =
| "peggedUSD"
| "peggedVAR"
| "peggedEUR"
| "peggedSGD"
| "peggedJPY"
| "peggedCNY"
| "peggedUAH"
| "peggedARS"
| "peggedGBP"
| "peggedCAD"
| "peggedTRY"
| "peggedCHF"
| "peggedGOLD" //not used
| "peggedCOP"
| "peggedREAL"
| "peggedAUD";
type StringNumber = string;
type PeggedBalances = {
[peggedAssetType: string]: StringNumber | number;
};
type BridgeBalances = {
[bridgeID in BridgeID]: {
[source: string]: {
amount: StringNumber | number;
};
};
};
export type Balances = PeggedBalances & {
bridges?: BridgeBalances;
};
export type Fetch = (
timestamp: number,
ethBlock: number,
chainBlocks: ChainBlocks
) => Promise<Balances>;
export type PeggedIssuanceAdapter = {
[chain: string]: {
// minted: Promise<Fetch> | (() => Promise<{}>) | undefined;
// unreleased: Promise<Fetch> | (() => Promise<{}>) | undefined;
[bridgedFrom: string]: Fetch | Promise<Fetch> | (() => Promise<{}>) | any;
};
};
export type ChainContracts = {
[chain: string]: {
[contract: string]: string[];
};
};