@defillama/sdk 2.3.39 → 2.3.43

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.
@@ -43,6 +43,9 @@ export declare const chainToCoingeckoId: {
43
43
  cronos: string;
44
44
  aurora: string;
45
45
  boba: string;
46
+ metis: string;
47
+ telos: string;
48
+ moonbeam: string;
46
49
  };
47
50
  export default function (rawBalances: Balances, timestamp: number | "now", verbose?: boolean, knownTokenPrices?: TokenPrices, getCoingeckoLock?: GetCoingeckoLog, coingeckoMaxRetries?: number): Promise<{
48
51
  usdTvl: number;
@@ -105,17 +105,10 @@ exports.chainToCoingeckoId = {
105
105
  cronos: "cronos",
106
106
  aurora: "aurora",
107
107
  boba: "boba",
108
+ metis: "metis-andromeda",
109
+ telos: "telos",
110
+ moonbeam: "moonbeam",
108
111
  };
109
- function currentCoingeckoUrls(chain) {
110
- if (chain === 'coingecko') {
111
- return "v3/simple/price?ids";
112
- }
113
- var platformId = exports.chainToCoingeckoId[chain];
114
- if (platformId !== undefined) {
115
- return "v3/simple/token_price/" + platformId + "?contract_addresses";
116
- }
117
- throw new Error("Chain not supported");
118
- }
119
112
  var chains = Object.keys(exports.chainToCoingeckoId);
120
113
  function getHistoricalChainPrices(ids, timestamp, knownTokenPrices, getCoingeckoLock, coingeckoMaxRetries) {
121
114
  return __awaiter(this, void 0, void 0, function () {
@@ -2,7 +2,7 @@ import { ethers, BigNumber } from "ethers";
2
2
  export declare const providers: {
3
3
  [chain: string]: ethers.providers.BaseProvider;
4
4
  };
5
- export declare type Chain = "ethereum" | "bsc" | "polygon" | "heco" | "fantom" | "rsk" | "tomochain" | "xdai" | "avax" | "wan" | "iotex" | "harmony" | "thundercore" | "okexchain" | "optimism" | "arbitrum" | "energyweb" | "songbird" | "hpb" | "gochain" | "ethclassic" | "xdaiarb" | "kardia" | "fuse" | "smartbch" | "elastos" | "hoo" | "fusion" | "aurora" | "ronin" | "boba" | "cronos" | "polis" | "zyx" | "telos" | "metis" | "ubiq" | "velas" | "callisto" | "csc" | "nahmii" | "liquidchain" | "meter" | "theta" | "oasis" | "syscoin" | "moonbeam";
5
+ export declare type Chain = "ethereum" | "bsc" | "polygon" | "heco" | "fantom" | "rsk" | "tomochain" | "xdai" | "avax" | "wan" | "iotex" | "harmony" | "thundercore" | "okexchain" | "optimism" | "arbitrum" | "energyweb" | "songbird" | "hpb" | "gochain" | "ethclassic" | "xdaiarb" | "kardia" | "fuse" | "smartbch" | "elastos" | "hoo" | "fusion" | "aurora" | "ronin" | "boba" | "cronos" | "polis" | "zyx" | "telos" | "metis" | "ubiq" | "velas" | "callisto" | "csc" | "nahmii" | "liquidchain" | "meter" | "theta" | "oasis" | "syscoin" | "moonbeam" | "curio";
6
6
  export declare function getProvider(chain?: Chain): ethers.providers.BaseProvider;
7
7
  export declare const TEN: ethers.BigNumber;
8
8
  export declare function handleDecimals(num: BigNumber, decimals?: number): string;
package/build/general.js CHANGED
@@ -29,7 +29,7 @@ exports.providers = {
29
29
  bsc: createProvider("bsc", "https://bsc-dataseed.binance.org/,https://bsc-dataseed1.defibit.io/,https://bsc-dataseed1.ninicoin.io/,https://bsc-dataseed2.defibit.io/,https://bsc-dataseed2.ninicoin.io/", 56),
30
30
  polygon: createProvider("polygon", "https://polygon-rpc.com/,https://rpc-mainnet.maticvigil.com/", 137),
31
31
  heco: createProvider("heco", "https://http-mainnet.hecochain.com,https://http-mainnet-node.huobichain.com,https://pub001.hg.network/rpc", 128),
32
- fantom: createProvider("fantom", "https://rpc.ftm.tools/,https://rpcapi.fantom.network", 250),
32
+ fantom: createProvider("fantom", "https://rpc.ankr.com/fantom,https://rpc.ftm.tools/,https://rpcapi.fantom.network", 250),
33
33
  rsk: createProvider("rsk", "https://public-node.rsk.co", 30),
34
34
  tomochain: createProvider("tomochain", "https://rpc.tomochain.com", 88),
35
35
  xdai: createProvider("xdai", "https://rpc.xdaichain.com/,https://xdai.poanetwork.dev,https://dai.poa.network,https://xdai-archive.blockscout.com", 100),
@@ -64,7 +64,7 @@ exports.providers = {
64
64
  cronos: createProvider("cronos", "https://evm-cronos.crypto.org/", 25),
65
65
  polis: createProvider("polis", "https://rpc.polis.tech", 333999),
66
66
  zyx: createProvider("zyx", "https://rpc-1.zyx.network/,https://rpc-2.zyx.network/,https://rpc-3.zyx.network/,https://rpc-5.zyx.network/", 55),
67
- telos: createProvider("telos", "https://mainnet.telos.net/evm/,https://rpc1.eu.telos.net/evm/,https://rpc1.us.telos.net/evm", 40),
67
+ telos: createProvider("telos", "https://mainnet.telos.net/evm,https://rpc1.eu.telos.net/evm,https://rpc1.us.telos.net/evm", 40),
68
68
  metis: createProvider("metis", "https://andromeda.metis.io/?owner=1088", 1088),
69
69
  ubiq: createProvider("ubiq", "https://rpc.octano.dev", 8),
70
70
  velas: createProvider("velas", "https://evmexplorer.velas.com/rpc", 106),
@@ -77,7 +77,8 @@ exports.providers = {
77
77
  theta: createProvider("theta", 'https://eth-rpc-api.thetatoken.org/rpc', 361),
78
78
  oasis: createProvider("oasis", 'https://emerald.oasis.dev/', 42262),
79
79
  syscoin: createProvider("syscoin", 'https://rpc.syscoin.org', 57),
80
- moonbeam: createProvider("moonbeam", 'https://rpc.api.moonbeam.network', 1284)
80
+ moonbeam: createProvider("moonbeam", 'https://rpc.api.moonbeam.network', 1284),
81
+ curio: createProvider("curio", 'https://mainnet-api.skalenodes.com/v1/fit-betelgeuse', 836542336838601)
81
82
  };
82
83
  function getProvider(chain) {
83
84
  if (chain === void 0) { chain = "ethereum"; }
@@ -298,6 +298,9 @@ function getLogs(params) {
298
298
  return __generator(this, function (_b) {
299
299
  switch (_b.label) {
300
300
  case 0:
301
+ if (params.toBlock === undefined || params.fromBlock === undefined) {
302
+ throw new Error("toBlock and fromBlock need to be defined in all calls to getLogs");
303
+ }
301
304
  filter = {
302
305
  address: params.target,
303
306
  topics: (_a = params.topics) !== null && _a !== void 0 ? _a : [ethers_1.utils.id(params.topic)],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defillama/sdk",
3
- "version": "2.3.39",
3
+ "version": "2.3.43",
4
4
  "description": "SDK for calculating TVL",
5
5
  "main": "build/index.js",
6
6
  "scripts": {