forked from alexgo-io/alex-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.ts
66 lines (54 loc) · 1.43 KB
/
types.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
59
60
61
62
63
64
65
66
import { Currency } from './currency';
/**
* TokenInfo represents the details of a token that can be used in the AlexSDK.
*/
export type TokenInfo = {
/**
* The unique identifier of the currency.
*/
id: Currency;
/**
* The display name of the token that ALEX maintains, usually the token symbol.
*/
name: string;
/**
* The URL to the icon image of the token, maintained by ALEX.
*/
icon: string;
/**
* The full asset id of the alex wrapped token in the format of "{deployer}.{contract}::{asset}".
*/
wrapToken: string;
/**
* The number of decimal places for the wrapped token.
*/
wrapTokenDecimals: number;
/**
* The full asset id of the underlying token in the format of "{deployer}.{contract}::{asset}".
*/
underlyingToken: string;
/**
* The number of decimal places for the underlying token.
*/
underlyingTokenDecimals: number;
/**
* A boolean flag indicating whether the token is a rebase token.
* In a rebase token, getBalance is different from ft-balance
* Also postcondition would need to be adjusted since amount is different from ft-events
*/
isRebaseToken: boolean;
};
export type PoolData = {
tokenX: Currency;
tokenY: Currency;
factor: bigint;
};
export type PriceData = {
token: Currency;
price: number;
};
export type AlexSDKResponse = {
tokens: TokenInfo[];
pools: PoolData[];
};
export type BackendAPIPriceResponse = PriceData[];