@defillama/sdk 5.0.240 → 5.0.244

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.
Files changed (133) hide show
  1. package/build/Balances.d.ts +139 -0
  2. package/build/Balances.js +363 -0
  3. package/build/ChainApi.d.ts +142 -0
  4. package/build/ChainApi.js +310 -0
  5. package/build/abi/abi2.d.ts +5 -0
  6. package/build/abi/abi2.js +215 -0
  7. package/build/abi/cachedABIs.d.ts +4 -0
  8. package/build/abi/cachedABIs.js +8 -0
  9. package/build/abi/convertResults.d.ts +5 -0
  10. package/build/abi/convertResults.js +60 -0
  11. package/build/abi/index.d.ts +31 -0
  12. package/build/abi/index.js +327 -0
  13. package/build/abi/multicall.d.ts +23 -0
  14. package/build/abi/multicall.js +383 -0
  15. package/build/abi/multicall3.d.ts +7 -0
  16. package/build/abi/multicall3.js +405 -0
  17. package/build/abi/rpcCall.d.ts +4 -0
  18. package/build/abi/rpcCall.js +62 -0
  19. package/build/abi/tron.d.ts +33 -0
  20. package/build/abi/tron.js +118 -0
  21. package/build/api.d.ts +10 -0
  22. package/build/api.js +45 -0
  23. package/build/api2.d.ts +5 -0
  24. package/build/api2.js +41 -0
  25. package/build/chains/algorand.d.ts +277 -0
  26. package/build/chains/algorand.js +618 -0
  27. package/build/chains/aptos.d.ts +269 -0
  28. package/build/chains/aptos.js +700 -0
  29. package/build/chains/cardano.d.ts +242 -0
  30. package/build/chains/cardano.js +407 -0
  31. package/build/chains/cosmos.d.ts +252 -0
  32. package/build/chains/cosmos.js +623 -0
  33. package/build/chains/icp.d.ts +235 -0
  34. package/build/chains/icp.js +1040 -0
  35. package/build/chains/index.d.ts +23 -0
  36. package/build/chains/index.js +59 -0
  37. package/build/chains/near.d.ts +192 -0
  38. package/build/chains/near.js +446 -0
  39. package/build/chains/rpc.d.ts +125 -0
  40. package/build/chains/rpc.js +332 -0
  41. package/build/chains/starknet.d.ts +205 -0
  42. package/build/chains/starknet.js +886 -0
  43. package/build/chains/stellar.d.ts +410 -0
  44. package/build/chains/stellar.js +1082 -0
  45. package/build/chains/substrate.d.ts +333 -0
  46. package/build/chains/substrate.js +1042 -0
  47. package/build/chains/sui.d.ts +392 -0
  48. package/build/chains/sui.js +1213 -0
  49. package/build/chains/svm.d.ts +340 -0
  50. package/build/chains/svm.js +764 -0
  51. package/build/chains/tezos.d.ts +225 -0
  52. package/build/chains/tezos.js +412 -0
  53. package/build/chains/ton.d.ts +353 -0
  54. package/build/chains/ton.js +788 -0
  55. package/build/chains/tron.d.ts +45 -0
  56. package/build/chains/tron.js +110 -0
  57. package/build/chains/utxo.d.ts +210 -0
  58. package/build/chains/utxo.js +678 -0
  59. package/build/chains/xrpl.d.ts +179 -0
  60. package/build/chains/xrpl.js +467 -0
  61. package/build/computeTVL/blocks.d.ts +1 -0
  62. package/build/computeTVL/blocks.js +12 -0
  63. package/build/computeTVL/humanizeNumber.d.ts +1 -0
  64. package/build/computeTVL/humanizeNumber.js +19 -0
  65. package/build/erc20/index.d.ts +31 -0
  66. package/build/erc20/index.js +56 -0
  67. package/build/eth/index.d.ts +22 -0
  68. package/build/eth/index.js +118 -0
  69. package/build/general.d.ts +5 -0
  70. package/build/general.js +20 -0
  71. package/build/generalUtil.d.ts +8 -0
  72. package/build/generalUtil.js +73 -0
  73. package/build/index.d.ts +33 -0
  74. package/build/index.js +75 -0
  75. package/build/providers.json +1 -0
  76. package/build/types.d.ts +76 -0
  77. package/build/types.js +2 -0
  78. package/build/util/LlamaProvider.d.ts +46 -0
  79. package/build/util/LlamaProvider.js +343 -0
  80. package/build/util/blocks.d.ts +36 -0
  81. package/build/util/blocks.js +500 -0
  82. package/build/util/cache.d.ts +45 -0
  83. package/build/util/cache.js +309 -0
  84. package/build/util/callStats.d.ts +74 -0
  85. package/build/util/callStats.js +385 -0
  86. package/build/util/chainUtils/data.json +1459 -0
  87. package/build/util/chainUtils/index.d.ts +11 -0
  88. package/build/util/chainUtils/index.js +136 -0
  89. package/build/util/coins.d.ts +19 -0
  90. package/build/util/coins.js +124 -0
  91. package/build/util/common.d.ts +34 -0
  92. package/build/util/common.js +376 -0
  93. package/build/util/computeTVL.d.ts +19 -0
  94. package/build/util/computeTVL.js +102 -0
  95. package/build/util/cosmos.d.ts +1 -0
  96. package/build/util/cosmos.js +8 -0
  97. package/build/util/debugLog.d.ts +4 -0
  98. package/build/util/debugLog.js +18 -0
  99. package/build/util/discord.d.ts +1 -0
  100. package/build/util/discord.js +33 -0
  101. package/build/util/elastic.d.ts +43 -0
  102. package/build/util/elastic.js +113 -0
  103. package/build/util/env.d.ts +20 -0
  104. package/build/util/env.js +176 -0
  105. package/build/util/graph.d.ts +8 -0
  106. package/build/util/graph.js +50 -0
  107. package/build/util/index.d.ts +32 -0
  108. package/build/util/index.js +227 -0
  109. package/build/util/indexer.compatibility.d.ts +6 -0
  110. package/build/util/indexer.compatibility.js +64 -0
  111. package/build/util/indexer.d.ts +92 -0
  112. package/build/util/indexer.js +854 -0
  113. package/build/util/indexerSql.d.ts +9 -0
  114. package/build/util/indexerSql.js +102 -0
  115. package/build/util/internal-cache.d.ts +11 -0
  116. package/build/util/internal-cache.js +77 -0
  117. package/build/util/logs.d.ts +58 -0
  118. package/build/util/logs.decode.shared.d.ts +8 -0
  119. package/build/util/logs.decode.shared.js +289 -0
  120. package/build/util/logs.js +432 -0
  121. package/build/util/promisePool.d.ts +8 -0
  122. package/build/util/promisePool.js +31 -0
  123. package/build/util/r2.d.ts +4 -0
  124. package/build/util/r2.js +52 -0
  125. package/build/util/removeRedundantRPCs.d.ts +1 -0
  126. package/build/util/removeRedundantRPCs.js +49 -0
  127. package/build/util/transactions.d.ts +35 -0
  128. package/build/util/transactions.js +22 -0
  129. package/build/util/updateChainLabels.d.ts +1 -0
  130. package/build/util/updateChainLabels.js +5 -0
  131. package/build/util/updateProviderList.d.ts +1 -0
  132. package/build/util/updateProviderList.js +275 -0
  133. package/package.json +3 -2
@@ -0,0 +1,31 @@
1
+ import { Address } from "../types";
2
+ import { Chain } from "../general";
3
+ export declare function info(tokenAddress: Address, chain?: Chain): Promise<{
4
+ output: {
5
+ symbol: any;
6
+ decimals: number;
7
+ };
8
+ }>;
9
+ export declare function symbol(tokenAddress: Address, chain?: Chain): Promise<{
10
+ output: any;
11
+ }>;
12
+ export declare function decimals(tokenAddress: Address, chain?: Chain): Promise<{
13
+ output: number;
14
+ }>;
15
+ export declare function totalSupply(params: {
16
+ target: Address;
17
+ block?: number;
18
+ decimals?: number;
19
+ chain?: Chain;
20
+ }): Promise<{
21
+ output: string;
22
+ }>;
23
+ export declare function balanceOf(params: {
24
+ target: Address;
25
+ owner: Address;
26
+ block?: number;
27
+ decimals?: number;
28
+ chain?: Chain;
29
+ }): Promise<{
30
+ output: string;
31
+ }>;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.info = info;
4
+ exports.symbol = symbol;
5
+ exports.decimals = decimals;
6
+ exports.totalSupply = totalSupply;
7
+ exports.balanceOf = balanceOf;
8
+ const ethers_1 = require("ethers");
9
+ const general_1 = require("../general");
10
+ const abi = [
11
+ "function balanceOf(address owner) view returns (uint256)",
12
+ "function totalSupply() view returns (uint256)",
13
+ "function decimals() view returns (uint8)",
14
+ "function symbol() view returns (string)",
15
+ ];
16
+ function getContract(address, chain) {
17
+ return new ethers_1.ethers.Contract(address, abi, (0, general_1.getProvider)(chain));
18
+ }
19
+ async function info(tokenAddress, chain) {
20
+ const contract = getContract(tokenAddress, chain);
21
+ const tokenSymbol = contract.symbol();
22
+ const tokenDecimals = contract.decimals();
23
+ return {
24
+ output: {
25
+ symbol: await tokenSymbol,
26
+ decimals: Number(await tokenDecimals),
27
+ },
28
+ };
29
+ }
30
+ async function symbol(tokenAddress, chain) {
31
+ return {
32
+ output: await getContract(tokenAddress, chain).symbol(),
33
+ };
34
+ }
35
+ async function decimals(tokenAddress, chain) {
36
+ return {
37
+ output: Number(await getContract(tokenAddress, chain).decimals()),
38
+ };
39
+ }
40
+ async function totalSupply(params) {
41
+ const contract = getContract(params.target, params.chain);
42
+ const supply = await contract.totalSupply({
43
+ blockTag: params.block,
44
+ });
45
+ return {
46
+ output: (0, general_1.handleDecimals)(supply, params.decimals),
47
+ };
48
+ }
49
+ async function balanceOf(params) {
50
+ const balance = await getContract(params.target, params.chain).balanceOf(params.owner, {
51
+ blockTag: params.block,
52
+ });
53
+ return {
54
+ output: (0, general_1.handleDecimals)(balance, params.decimals),
55
+ };
56
+ }
@@ -0,0 +1,22 @@
1
+ import { Address, LogArray } from "../types";
2
+ import { Chain } from "../general";
3
+ export declare function getBalance(params: {
4
+ target: Address;
5
+ block?: number;
6
+ decimals?: number;
7
+ chain?: Chain;
8
+ logArray?: LogArray;
9
+ }): Promise<{
10
+ output: string;
11
+ }>;
12
+ export declare function getBalances(params: {
13
+ targets: Address[];
14
+ block?: number;
15
+ decimals?: number;
16
+ chain?: Chain;
17
+ logArray?: LogArray;
18
+ skipMultiCall?: boolean;
19
+ permitFailure?: boolean;
20
+ }): Promise<{
21
+ output: any;
22
+ }>;
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.getBalance = getBalance;
37
+ exports.getBalances = getBalances;
38
+ const general_1 = require("../general");
39
+ const Tron = __importStar(require("../abi/tron"));
40
+ const multicall3_1 = require("../abi/multicall3");
41
+ const abi2_1 = require("../abi/abi2");
42
+ const debugLog_1 = require("../util/debugLog");
43
+ const generalUtil_1 = require("../generalUtil");
44
+ async function getBalance(params) {
45
+ var _a;
46
+ // this is needed eth.getBalances doesnt include staked trx value
47
+ if (params.chain === 'tron')
48
+ return Tron.getBalance(params);
49
+ const balance = await (0, general_1.getProvider)(params.chain).getBalance(params.target, params.block);
50
+ const output = (0, general_1.handleDecimals)(balance, params.decimals);
51
+ if (params.logArray)
52
+ params.logArray.push({
53
+ chain: (_a = params.chain) !== null && _a !== void 0 ? _a : "ethereum",
54
+ holder: params.target,
55
+ token: general_1.ETHER_ADDRESS,
56
+ amount: output
57
+ });
58
+ return {
59
+ output,
60
+ };
61
+ }
62
+ async function getBalances(params) {
63
+ var _a;
64
+ // this is needed eth.getBalances doesnt include staked trx value
65
+ if (params.chain === 'tron')
66
+ return Tron.getBalances(params);
67
+ let output;
68
+ try {
69
+ const multicallContract = (0, multicall3_1.getMulticallAddress)((_a = params.chain) !== null && _a !== void 0 ? _a : "ethereum", params.block);
70
+ if (!params.skipMultiCall && multicallContract) {
71
+ const multicallResults = await (0, abi2_1.multiCall)({
72
+ calls: params.targets,
73
+ target: multicallContract,
74
+ abi: 'function getEthBalance(address addr) view returns (uint256)',
75
+ chain: params.chain,
76
+ block: params.block,
77
+ permitFailure: params.permitFailure,
78
+ });
79
+ output = multicallResults.map((value, i) => ({
80
+ target: params.targets[i],
81
+ balance: (0, general_1.handleDecimals)(value !== null && value !== void 0 ? value : '0', params.decimals)
82
+ }));
83
+ }
84
+ }
85
+ catch (e) {
86
+ (0, debugLog_1.debugLog)('Multicall failed, falling back to single calls for fetching eth balances', e);
87
+ }
88
+ if (!output) {
89
+ output = await (0, generalUtil_1.runInPromisePool)({
90
+ items: params.targets,
91
+ concurrency: 7,
92
+ processor: async (target) => ({
93
+ target,
94
+ balance: (0, general_1.handleDecimals)(await (0, general_1.getProvider)(params.chain).getBalance(target, params.block), params.decimals),
95
+ }),
96
+ permitFailure: params.permitFailure
97
+ });
98
+ // If some calls failed, fill their balance with 0
99
+ if (params.permitFailure)
100
+ output.forEach((o, idx) => {
101
+ if (!(o === null || o === void 0 ? void 0 : o.balance))
102
+ output[idx] = { target: params.targets[idx], balance: '0' };
103
+ });
104
+ }
105
+ if (params.logArray)
106
+ params.logArray.push(...params.targets.map((holder, i) => {
107
+ var _a;
108
+ return ({
109
+ chain: (_a = params.chain) !== null && _a !== void 0 ? _a : "ethereum",
110
+ holder,
111
+ token: general_1.ETHER_ADDRESS,
112
+ amount: output[i].balance
113
+ });
114
+ }));
115
+ return {
116
+ output,
117
+ };
118
+ }
@@ -0,0 +1,5 @@
1
+ export { providers, setProvider, getProvider, } from './util/LlamaProvider';
2
+ export { Chain } from './types';
3
+ export declare const TEN: bigint;
4
+ export declare function handleDecimals(num: any, decimals?: number): string;
5
+ export declare const ETHER_ADDRESS = "0x0000000000000000000000000000000000000000";
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ETHER_ADDRESS = exports.TEN = exports.getProvider = exports.setProvider = exports.providers = void 0;
4
+ exports.handleDecimals = handleDecimals;
5
+ var LlamaProvider_1 = require("./util/LlamaProvider");
6
+ Object.defineProperty(exports, "providers", { enumerable: true, get: function () { return LlamaProvider_1.providers; } });
7
+ Object.defineProperty(exports, "setProvider", { enumerable: true, get: function () { return LlamaProvider_1.setProvider; } });
8
+ Object.defineProperty(exports, "getProvider", { enumerable: true, get: function () { return LlamaProvider_1.getProvider; } });
9
+ exports.TEN = BigInt(10);
10
+ function handleDecimals(num, decimals) {
11
+ if (typeof num !== 'number')
12
+ num = num.toString();
13
+ if (decimals === undefined) {
14
+ return num.toString();
15
+ }
16
+ else {
17
+ return Number(num / (10 ** decimals)).toString();
18
+ }
19
+ }
20
+ exports.ETHER_ADDRESS = "0x0000000000000000000000000000000000000000";
@@ -0,0 +1,8 @@
1
+ import * as blocks from "./computeTVL/blocks";
2
+ import * as discord from "./util/discord";
3
+ import * as humanizeNumber from "./computeTVL/humanizeNumber";
4
+ export { sliceIntoChunks, normalizeAddress, getTimestamp, tableToString, } from "./util";
5
+ export { isEvmChain, getEVMChainSet, getEVMProvidersConfigMap, } from "./util/LlamaProvider";
6
+ export { runInPromisePool } from "./util/promisePool";
7
+ export { sumMultiBalanceOf, sumSingleBalance, mergeBalances, removeTokenBalance, sumChainTvls, getUniqueAddresses, convertToBigInt, getProviderUrl, formError, formErrorString, shortenString, fetchJson, postJson, tronToEvmAddress, evmToTronAddress, sleep, sleepRandom, getHash, } from './util/common';
8
+ export { blocks, humanizeNumber, discord, };
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.discord = exports.humanizeNumber = exports.blocks = exports.getHash = exports.sleepRandom = exports.sleep = exports.evmToTronAddress = exports.tronToEvmAddress = exports.postJson = exports.fetchJson = exports.shortenString = exports.formErrorString = exports.formError = exports.getProviderUrl = exports.convertToBigInt = exports.getUniqueAddresses = exports.sumChainTvls = exports.removeTokenBalance = exports.mergeBalances = exports.sumSingleBalance = exports.sumMultiBalanceOf = exports.runInPromisePool = exports.getEVMProvidersConfigMap = exports.getEVMChainSet = exports.isEvmChain = exports.tableToString = exports.getTimestamp = exports.normalizeAddress = exports.sliceIntoChunks = void 0;
37
+ const blocks = __importStar(require("./computeTVL/blocks"));
38
+ exports.blocks = blocks;
39
+ const discord = __importStar(require("./util/discord"));
40
+ exports.discord = discord;
41
+ const humanizeNumber = __importStar(require("./computeTVL/humanizeNumber"));
42
+ exports.humanizeNumber = humanizeNumber;
43
+ var util_1 = require("./util");
44
+ Object.defineProperty(exports, "sliceIntoChunks", { enumerable: true, get: function () { return util_1.sliceIntoChunks; } });
45
+ Object.defineProperty(exports, "normalizeAddress", { enumerable: true, get: function () { return util_1.normalizeAddress; } });
46
+ Object.defineProperty(exports, "getTimestamp", { enumerable: true, get: function () { return util_1.getTimestamp; } });
47
+ Object.defineProperty(exports, "tableToString", { enumerable: true, get: function () { return util_1.tableToString; } });
48
+ var LlamaProvider_1 = require("./util/LlamaProvider");
49
+ Object.defineProperty(exports, "isEvmChain", { enumerable: true, get: function () { return LlamaProvider_1.isEvmChain; } });
50
+ Object.defineProperty(exports, "getEVMChainSet", { enumerable: true, get: function () { return LlamaProvider_1.getEVMChainSet; } });
51
+ Object.defineProperty(exports, "getEVMProvidersConfigMap", { enumerable: true, get: function () { return LlamaProvider_1.getEVMProvidersConfigMap; } });
52
+ var promisePool_1 = require("./util/promisePool");
53
+ Object.defineProperty(exports, "runInPromisePool", { enumerable: true, get: function () { return promisePool_1.runInPromisePool; } });
54
+ // most of the code has been moved to util/common.ts to avoid circular dependencies
55
+ var common_1 = require("./util/common");
56
+ Object.defineProperty(exports, "sumMultiBalanceOf", { enumerable: true, get: function () { return common_1.sumMultiBalanceOf; } });
57
+ Object.defineProperty(exports, "sumSingleBalance", { enumerable: true, get: function () { return common_1.sumSingleBalance; } });
58
+ Object.defineProperty(exports, "mergeBalances", { enumerable: true, get: function () { return common_1.mergeBalances; } });
59
+ Object.defineProperty(exports, "removeTokenBalance", { enumerable: true, get: function () { return common_1.removeTokenBalance; } });
60
+ Object.defineProperty(exports, "sumChainTvls", { enumerable: true, get: function () { return common_1.sumChainTvls; } });
61
+ Object.defineProperty(exports, "getUniqueAddresses", { enumerable: true, get: function () { return common_1.getUniqueAddresses; } });
62
+ Object.defineProperty(exports, "convertToBigInt", { enumerable: true, get: function () { return common_1.convertToBigInt; } });
63
+ Object.defineProperty(exports, "getProviderUrl", { enumerable: true, get: function () { return common_1.getProviderUrl; } });
64
+ Object.defineProperty(exports, "formError", { enumerable: true, get: function () { return common_1.formError; } });
65
+ Object.defineProperty(exports, "formErrorString", { enumerable: true, get: function () { return common_1.formErrorString; } });
66
+ Object.defineProperty(exports, "shortenString", { enumerable: true, get: function () { return common_1.shortenString; } });
67
+ Object.defineProperty(exports, "fetchJson", { enumerable: true, get: function () { return common_1.fetchJson; } });
68
+ Object.defineProperty(exports, "postJson", { enumerable: true, get: function () { return common_1.postJson; } });
69
+ Object.defineProperty(exports, "tronToEvmAddress", { enumerable: true, get: function () { return common_1.tronToEvmAddress; } });
70
+ Object.defineProperty(exports, "evmToTronAddress", { enumerable: true, get: function () { return common_1.evmToTronAddress; } });
71
+ Object.defineProperty(exports, "sleep", { enumerable: true, get: function () { return common_1.sleep; } });
72
+ Object.defineProperty(exports, "sleepRandom", { enumerable: true, get: function () { return common_1.sleepRandom; } });
73
+ Object.defineProperty(exports, "getHash", { enumerable: true, get: function () { return common_1.getHash; } });
@@ -0,0 +1,33 @@
1
+ import { debugLog, debugTable } from "./util/debugLog";
2
+ export { ChainApi } from './ChainApi';
3
+ export { Balances } from './Balances';
4
+ export { getProvider, setProvider, } from './general';
5
+ export * as util from "./generalUtil";
6
+ export * as cache from "./util/cache";
7
+ export { getLogs as getEventLogs } from "./util/logs";
8
+ export * as sdkCache from "./util/internal-cache";
9
+ export * as api from "./api";
10
+ export * as elastic from "./util/elastic";
11
+ export * as api2 from "./api2";
12
+ export * as blocks from "./computeTVL/blocks";
13
+ import * as humanN from "./computeTVL/humanizeNumber";
14
+ export * as graph from "./util/graph";
15
+ export * as indexer from "./util/indexer";
16
+ export { queryClickhouse, queryIndexerSql, isIndexerSqlEnabled, IndexerSqlOptions } from "./util/indexerSql";
17
+ export * as types from "./types";
18
+ export * as tron from "./abi/tron";
19
+ export * as erc20 from "./erc20";
20
+ export * as coins from "./util/coins";
21
+ export * as chainUtils from "./util/chainUtils";
22
+ export * as chains from "./chains";
23
+ export * as callStats from "./util/callStats";
24
+ export declare const log: typeof debugLog;
25
+ export declare const logTable: typeof debugTable;
26
+ export declare const humanizeNumber: typeof humanN.humanizeNumber;
27
+ export declare const providerListJSON: {
28
+ [chain: string]: {
29
+ rpc: string[];
30
+ chainId: number;
31
+ explorer?: string;
32
+ };
33
+ };
package/build/index.js ADDED
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.providerListJSON = exports.humanizeNumber = exports.logTable = exports.log = exports.callStats = exports.chains = exports.chainUtils = exports.coins = exports.erc20 = exports.tron = exports.types = exports.isIndexerSqlEnabled = exports.queryIndexerSql = exports.queryClickhouse = exports.indexer = exports.graph = exports.blocks = exports.api2 = exports.elastic = exports.api = exports.sdkCache = exports.getEventLogs = exports.cache = exports.util = exports.setProvider = exports.getProvider = exports.Balances = exports.ChainApi = void 0;
40
+ const debugLog_1 = require("./util/debugLog");
41
+ var ChainApi_1 = require("./ChainApi");
42
+ Object.defineProperty(exports, "ChainApi", { enumerable: true, get: function () { return ChainApi_1.ChainApi; } });
43
+ var Balances_1 = require("./Balances");
44
+ Object.defineProperty(exports, "Balances", { enumerable: true, get: function () { return Balances_1.Balances; } });
45
+ var general_1 = require("./general"); // need to rethink usage of providers in server repo, it is initally empty
46
+ Object.defineProperty(exports, "getProvider", { enumerable: true, get: function () { return general_1.getProvider; } });
47
+ Object.defineProperty(exports, "setProvider", { enumerable: true, get: function () { return general_1.setProvider; } });
48
+ exports.util = __importStar(require("./generalUtil"));
49
+ exports.cache = __importStar(require("./util/cache"));
50
+ var logs_1 = require("./util/logs");
51
+ Object.defineProperty(exports, "getEventLogs", { enumerable: true, get: function () { return logs_1.getLogs; } });
52
+ exports.sdkCache = __importStar(require("./util/internal-cache"));
53
+ exports.api = __importStar(require("./api"));
54
+ exports.elastic = __importStar(require("./util/elastic"));
55
+ exports.api2 = __importStar(require("./api2"));
56
+ exports.blocks = __importStar(require("./computeTVL/blocks"));
57
+ const humanN = __importStar(require("./computeTVL/humanizeNumber"));
58
+ exports.graph = __importStar(require("./util/graph"));
59
+ exports.indexer = __importStar(require("./util/indexer"));
60
+ var indexerSql_1 = require("./util/indexerSql");
61
+ Object.defineProperty(exports, "queryClickhouse", { enumerable: true, get: function () { return indexerSql_1.queryClickhouse; } });
62
+ Object.defineProperty(exports, "queryIndexerSql", { enumerable: true, get: function () { return indexerSql_1.queryIndexerSql; } });
63
+ Object.defineProperty(exports, "isIndexerSqlEnabled", { enumerable: true, get: function () { return indexerSql_1.isIndexerSqlEnabled; } });
64
+ exports.types = __importStar(require("./types"));
65
+ exports.tron = __importStar(require("./abi/tron"));
66
+ exports.erc20 = __importStar(require("./erc20"));
67
+ exports.coins = __importStar(require("./util/coins"));
68
+ exports.chainUtils = __importStar(require("./util/chainUtils"));
69
+ exports.chains = __importStar(require("./chains"));
70
+ exports.callStats = __importStar(require("./util/callStats"));
71
+ const providers_json_1 = __importDefault(require("./providers.json"));
72
+ exports.log = debugLog_1.debugLog;
73
+ exports.logTable = debugLog_1.debugTable;
74
+ exports.humanizeNumber = humanN.humanizeNumber;
75
+ exports.providerListJSON = providers_json_1.default;