@defillama/sdk 3.0.18 → 3.0.20

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.
@@ -46,6 +46,15 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
46
46
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
47
  }
48
48
  };
49
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
50
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
51
+ if (ar || !(i in from)) {
52
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
53
+ ar[i] = from[i];
54
+ }
55
+ }
56
+ return to.concat(ar || Array.prototype.slice.call(from));
57
+ };
49
58
  var __importDefault = (this && this.__importDefault) || function (mod) {
50
59
  return (mod && mod.__esModule) ? mod : { "default": mod };
51
60
  };
@@ -64,6 +73,7 @@ var knownTypes = [
64
73
  'int', 'int8', 'int16', 'int32', 'int64', 'int128', 'int256',
65
74
  'uint', 'uint8', 'uint16', 'uint32', 'uint64', 'uint128', 'uint256',
66
75
  ];
76
+ (__spreadArray([], knownTypes, true)).forEach(function (i) { return knownTypes.push(i + '[]'); }); // support array type for all known types
67
77
  var defaultChunkSize = !!process.env.SDK_MULTICALL_CHUNK_SIZE ? +process.env.SDK_MULTICALL_CHUNK_SIZE : 500;
68
78
  function resolveABI(providedAbi) {
69
79
  var abi = providedAbi;
@@ -298,6 +298,8 @@ function multicallAddress(chainId) {
298
298
  case 1231: // ultron
299
299
  case 2152: // findora
300
300
  case 50: // xdc
301
+ case 40: // telos
302
+ return "0x74D01B798F0aEdc39548D3EA5fC922B291293b95";
301
303
  case 52: // csc
302
304
  return "0x18fA376d92511Dd04090566AB6144847c03557d8";
303
305
  case 2222:
@@ -18,5 +18,5 @@ export declare function mergeBalances(balances: Balances, balancesToMerge: Balan
18
18
  type ChainBlocks = {
19
19
  [chain: string]: number;
20
20
  };
21
- export declare function sumChainTvls(chainTvls: Array<(timestamp: number, ethBlock: number, chainBlocks: ChainBlocks) => Promise<Balances>>): (timestamp: number, ethBlock: number, chainBlocks: ChainBlocks) => Promise<{}>;
21
+ export declare function sumChainTvls(chainTvls: Array<(timestamp: number, ethBlock: number, chainBlocks: ChainBlocks, params: any) => Promise<Balances>>): (timestamp: number, ethBlock: number, chainBlocks: ChainBlocks, params: any) => Promise<{}>;
22
22
  export { blocks, humanizeNumber, };
@@ -128,7 +128,7 @@ function mergeBalances(balances, balancesToMerge) {
128
128
  exports.mergeBalances = mergeBalances;
129
129
  function sumChainTvls(chainTvls) {
130
130
  var _this = this;
131
- return function (timestamp, ethBlock, chainBlocks) { return __awaiter(_this, void 0, void 0, function () {
131
+ return function (timestamp, ethBlock, chainBlocks, params) { return __awaiter(_this, void 0, void 0, function () {
132
132
  var balances;
133
133
  var _this = this;
134
134
  return __generator(this, function (_a) {
@@ -139,7 +139,7 @@ function sumChainTvls(chainTvls) {
139
139
  var chainBalances;
140
140
  return __generator(this, function (_a) {
141
141
  switch (_a.label) {
142
- case 0: return [4 /*yield*/, chainTvl(timestamp, ethBlock, chainBlocks)];
142
+ case 0: return [4 /*yield*/, chainTvl(timestamp, ethBlock, chainBlocks, params)];
143
143
  case 1:
144
144
  chainBalances = _a.sent();
145
145
  mergeBalances(balances, chainBalances);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defillama/sdk",
3
- "version": "3.0.18",
3
+ "version": "3.0.20",
4
4
  "description": "SDK for calculating TVL",
5
5
  "main": "build/index.js",
6
6
  "scripts": {