@defillama/sdk 2.3.49 → 2.3.50
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/LICENSE +661 -661
- package/README.md +16 -16
- package/build/abi/cachedABIs.d.ts +4 -4
- package/build/abi/cachedABIs.js +70 -70
- package/build/abi/convertResults.d.ts +2 -2
- package/build/abi/convertResults.js +56 -56
- package/build/abi/index.d.ts +26 -26
- package/build/abi/index.js +185 -185
- package/build/abi/index.test.d.ts +1 -1
- package/build/abi/index.test.js +651 -651
- package/build/abi/multicall.d.ts +21 -13
- package/build/abi/multicall.js +234 -210
- package/build/api.d.ts +10 -10
- package/build/api.js +32 -32
- package/build/cdp/compoundTokens.d.ts +68 -68
- package/build/cdp/compoundTokens.js +69 -69
- package/build/cdp/index.d.ts +29 -29
- package/build/cdp/index.js +124 -124
- package/build/cdp/index.test.d.ts +1 -1
- package/build/cdp/index.test.js +82 -82
- package/build/cdp/makerTokens.d.ts +10 -10
- package/build/cdp/makerTokens.js +244 -244
- package/build/cli.d.ts +2 -2
- package/build/cli.js +95 -95
- package/build/computeTVL/blocks.d.ts +18 -18
- package/build/computeTVL/blocks.js +138 -138
- package/build/computeTVL/blocks.test.d.ts +1 -1
- package/build/computeTVL/blocks.test.js +56 -56
- package/build/computeTVL/humanizeNumber.d.ts +1 -1
- package/build/computeTVL/humanizeNumber.js +18 -18
- package/build/computeTVL/index.d.ts +56 -55
- package/build/computeTVL/index.js +367 -366
- package/build/computeTVL/index.test.d.ts +1 -1
- package/build/computeTVL/index.test.js +107 -107
- package/build/computeTVL/prices.d.ts +9 -9
- package/build/computeTVL/prices.js +163 -163
- package/build/erc20/index.d.ts +31 -31
- package/build/erc20/index.js +144 -144
- package/build/erc20/index.test.d.ts +1 -1
- package/build/erc20/index.test.js +124 -124
- package/build/eth/index.d.ts +21 -21
- package/build/eth/index.js +90 -90
- package/build/eth/index.test.d.ts +1 -1
- package/build/eth/index.test.js +122 -122
- package/build/general.d.ts +10 -10
- package/build/general.js +105 -105
- package/build/general.test.d.ts +1 -1
- package/build/general.test.js +73 -73
- package/build/generalUtil.d.ts +19 -19
- package/build/generalUtil.js +117 -117
- package/build/generalUtil.test.d.ts +1 -1
- package/build/generalUtil.test.js +59 -59
- package/build/index.d.ts +2 -2
- package/build/index.js +24 -24
- package/build/index.test.js +69 -69
- package/build/types.d.ts +5 -5
- package/build/types.js +2 -2
- package/build/util/index.d.ts +57 -57
- package/build/util/index.js +354 -354
- package/build/util/index.test.d.ts +1 -1
- package/build/util/index.test.js +314 -314
- package/build/util/tokenList.d.ts +14 -14
- package/build/util/tokenList.js +3631 -3631
- package/package.json +41 -41
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.humanizeNumber = void 0;
|
|
4
|
-
function humanizeNumber(amount) {
|
|
5
|
-
var quantifiers = [
|
|
6
|
-
[Math.pow(10, 9), "B"],
|
|
7
|
-
[Math.pow(10, 6), "M"],
|
|
8
|
-
[Math.pow(10, 3), "k"],
|
|
9
|
-
];
|
|
10
|
-
for (var _i = 0, quantifiers_1 = quantifiers; _i < quantifiers_1.length; _i++) {
|
|
11
|
-
var _a = quantifiers_1[_i], denominator = _a[0], letter = _a[1];
|
|
12
|
-
if (amount > denominator) {
|
|
13
|
-
return (amount / denominator).toFixed(2) + " " + letter;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return amount.toString();
|
|
17
|
-
}
|
|
18
|
-
exports.humanizeNumber = humanizeNumber;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.humanizeNumber = void 0;
|
|
4
|
+
function humanizeNumber(amount) {
|
|
5
|
+
var quantifiers = [
|
|
6
|
+
[Math.pow(10, 9), "B"],
|
|
7
|
+
[Math.pow(10, 6), "M"],
|
|
8
|
+
[Math.pow(10, 3), "k"],
|
|
9
|
+
];
|
|
10
|
+
for (var _i = 0, quantifiers_1 = quantifiers; _i < quantifiers_1.length; _i++) {
|
|
11
|
+
var _a = quantifiers_1[_i], denominator = _a[0], letter = _a[1];
|
|
12
|
+
if (amount > denominator) {
|
|
13
|
+
return (amount / denominator).toFixed(2) + " " + letter;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return amount.toString();
|
|
17
|
+
}
|
|
18
|
+
exports.humanizeNumber = humanizeNumber;
|
|
@@ -1,55 +1,56 @@
|
|
|
1
|
-
import { StringNumber } from "../types";
|
|
2
|
-
import { TokenPrices, GetCoingeckoLog } from "./prices";
|
|
3
|
-
declare type Balances = {
|
|
4
|
-
[tokenAddressOrName: string]: StringNumber | Object;
|
|
5
|
-
};
|
|
6
|
-
declare type ReturnedTokenBalances = {
|
|
7
|
-
[tokenSymbolOrName: string]: number;
|
|
8
|
-
};
|
|
9
|
-
export declare const chainToCoingeckoId: {
|
|
10
|
-
bsc: string;
|
|
11
|
-
ethereum: string;
|
|
12
|
-
polygon: string;
|
|
13
|
-
avax: string;
|
|
14
|
-
fantom: string;
|
|
15
|
-
xdai: string;
|
|
16
|
-
heco: string;
|
|
17
|
-
okexchain: string;
|
|
18
|
-
harmony: string;
|
|
19
|
-
kcc: string;
|
|
20
|
-
celo: string;
|
|
21
|
-
arbitrum: string;
|
|
22
|
-
iotex: string;
|
|
23
|
-
moonriver: string;
|
|
24
|
-
solana: string;
|
|
25
|
-
terra: string;
|
|
26
|
-
tron: string;
|
|
27
|
-
waves: string;
|
|
28
|
-
klaytn: string;
|
|
29
|
-
osmosis: string;
|
|
30
|
-
kava: string;
|
|
31
|
-
icon: string;
|
|
32
|
-
optimism: string;
|
|
33
|
-
eos: string;
|
|
34
|
-
secret: string;
|
|
35
|
-
rsk: string;
|
|
36
|
-
neo: string;
|
|
37
|
-
tezos: string;
|
|
38
|
-
wan: string;
|
|
39
|
-
ontology: string;
|
|
40
|
-
algorand: string;
|
|
41
|
-
zilliqa: string;
|
|
42
|
-
kardia: string;
|
|
43
|
-
cronos: string;
|
|
44
|
-
aurora: string;
|
|
45
|
-
boba: string;
|
|
46
|
-
metis: string;
|
|
47
|
-
telos: string;
|
|
48
|
-
moonbeam: string;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
import { StringNumber } from "../types";
|
|
2
|
+
import { TokenPrices, GetCoingeckoLog } from "./prices";
|
|
3
|
+
declare type Balances = {
|
|
4
|
+
[tokenAddressOrName: string]: StringNumber | Object;
|
|
5
|
+
};
|
|
6
|
+
declare type ReturnedTokenBalances = {
|
|
7
|
+
[tokenSymbolOrName: string]: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const chainToCoingeckoId: {
|
|
10
|
+
bsc: string;
|
|
11
|
+
ethereum: string;
|
|
12
|
+
polygon: string;
|
|
13
|
+
avax: string;
|
|
14
|
+
fantom: string;
|
|
15
|
+
xdai: string;
|
|
16
|
+
heco: string;
|
|
17
|
+
okexchain: string;
|
|
18
|
+
harmony: string;
|
|
19
|
+
kcc: string;
|
|
20
|
+
celo: string;
|
|
21
|
+
arbitrum: string;
|
|
22
|
+
iotex: string;
|
|
23
|
+
moonriver: string;
|
|
24
|
+
solana: string;
|
|
25
|
+
terra: string;
|
|
26
|
+
tron: string;
|
|
27
|
+
waves: string;
|
|
28
|
+
klaytn: string;
|
|
29
|
+
osmosis: string;
|
|
30
|
+
kava: string;
|
|
31
|
+
icon: string;
|
|
32
|
+
optimism: string;
|
|
33
|
+
eos: string;
|
|
34
|
+
secret: string;
|
|
35
|
+
rsk: string;
|
|
36
|
+
neo: string;
|
|
37
|
+
tezos: string;
|
|
38
|
+
wan: string;
|
|
39
|
+
ontology: string;
|
|
40
|
+
algorand: string;
|
|
41
|
+
zilliqa: string;
|
|
42
|
+
kardia: string;
|
|
43
|
+
cronos: string;
|
|
44
|
+
aurora: string;
|
|
45
|
+
boba: string;
|
|
46
|
+
metis: string;
|
|
47
|
+
telos: string;
|
|
48
|
+
moonbeam: string;
|
|
49
|
+
velas: string;
|
|
50
|
+
};
|
|
51
|
+
export default function (rawBalances: Balances, timestamp: number | "now", verbose?: boolean, knownTokenPrices?: TokenPrices, getCoingeckoLock?: GetCoingeckoLog, coingeckoMaxRetries?: number): Promise<{
|
|
52
|
+
usdTvl: number;
|
|
53
|
+
usdTokenBalances: ReturnedTokenBalances;
|
|
54
|
+
tokenBalances: ReturnedTokenBalances;
|
|
55
|
+
}>;
|
|
56
|
+
export {};
|