@defillama/sdk 2.3.40 → 2.3.45

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.
@@ -45,6 +45,7 @@ export declare const chainToCoingeckoId: {
45
45
  boba: string;
46
46
  metis: string;
47
47
  telos: string;
48
+ moonbeam: string;
48
49
  };
49
50
  export default function (rawBalances: Balances, timestamp: number | "now", verbose?: boolean, knownTokenPrices?: TokenPrices, getCoingeckoLock?: GetCoingeckoLog, coingeckoMaxRetries?: number): Promise<{
50
51
  usdTvl: number;
@@ -107,6 +107,7 @@ exports.chainToCoingeckoId = {
107
107
  boba: "boba",
108
108
  metis: "metis-andromeda",
109
109
  telos: "telos",
110
+ moonbeam: "moonbeam",
110
111
  };
111
112
  var chains = Object.keys(exports.chainToCoingeckoId);
112
113
  function getHistoricalChainPrices(ids, timestamp, knownTokenPrices, getCoingeckoLock, coingeckoMaxRetries) {
@@ -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" | "astar";
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),
@@ -77,7 +77,9 @@ 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),
82
+ astar: createProvider("astar", "https://rpc.astar.network:8545", 592)
81
83
  };
82
84
  function getProvider(chain) {
83
85
  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.40",
3
+ "version": "2.3.45",
4
4
  "description": "SDK for calculating TVL",
5
5
  "main": "build/index.js",
6
6
  "scripts": {