@defillama/sdk 3.0.29 → 3.0.31

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.
@@ -352,6 +352,8 @@ function multicallAddress(chainId) {
352
352
  return "0x23c65A0E1aF27EFd46B60c43998682e1e322C6f6";
353
353
  case 4099: // bitindi
354
354
  return "0xDF15De1fB392Ab10551afF1dDDDfAFFd228D7FE0";
355
+ case 22776: // map
356
+ return "0x6f13ad2bae66B5560c6157883a42B70085F9ca20";
355
357
  default:
356
358
  return null;
357
359
  }
package/build/general.js CHANGED
@@ -142,6 +142,7 @@ exports.providers = {
142
142
  tlchain: createProvider("tlchain", "https://mainnet-rpc.tlchain.live", 5177),
143
143
  zeniq: createProvider("zeniq", "https://smart1.zeniq.network:9545,https://smart2.zeniq.network:9545,https://smar31.zeniq.network:9545", 383414847825),
144
144
  bitindi: createProvider("bitindi", "https://rpc-mainnet.bitindi.org", 4099),
145
+ map: createProvider("map", "https://rpc.maplabs.io", 22776),
145
146
  };
146
147
  function getProvider(chain) {
147
148
  if (chain === void 0) { chain = "ethereum"; }
@@ -28,6 +28,7 @@ export declare function getLogs(params: {
28
28
  } | {
29
29
  output: Log[];
30
30
  }>;
31
+ export declare function getTimestamp(height: number, chain: Chain): Promise<number>;
31
32
  export declare function normalizeAddress(address: string): string;
32
33
  export declare function normalizePrefixes(address: string): string;
33
34
  export declare function normalizeBalances(balances: {
@@ -50,7 +50,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
50
50
  return (mod && mod.__esModule) ? mod : { "default": mod };
51
51
  };
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.normalizeBalances = exports.normalizePrefixes = exports.normalizeAddress = exports.getLogs = exports.lookupBlock = exports.getLatestBlock = exports.sliceIntoChunks = exports.runInPromisePool = void 0;
53
+ exports.normalizeBalances = exports.normalizePrefixes = exports.normalizeAddress = exports.getTimestamp = exports.getLogs = exports.lookupBlock = exports.getLatestBlock = exports.sliceIntoChunks = exports.runInPromisePool = void 0;
54
54
  var general_1 = require("../general");
55
55
  var node_fetch_1 = __importDefault(require("node-fetch"));
56
56
  var ethers_1 = require("ethers");
@@ -312,6 +312,22 @@ function getLogs(params) {
312
312
  });
313
313
  }
314
314
  exports.getLogs = getLogs;
315
+ function getTimestamp(height, chain) {
316
+ return __awaiter(this, void 0, void 0, function () {
317
+ var provider, block;
318
+ return __generator(this, function (_a) {
319
+ switch (_a.label) {
320
+ case 0:
321
+ provider = getExtraProvider(chain);
322
+ return [4 /*yield*/, provider.getBlock(height)];
323
+ case 1:
324
+ block = _a.sent();
325
+ return [2 /*return*/, block.timestamp];
326
+ }
327
+ });
328
+ });
329
+ }
330
+ exports.getTimestamp = getTimestamp;
315
331
  function normalizeAddress(address) {
316
332
  // sol amd tezos case sensitive so no normalising
317
333
  var prefix = address.substring(0, address.indexOf(":"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defillama/sdk",
3
- "version": "3.0.29",
3
+ "version": "3.0.31",
4
4
  "description": "SDK for calculating TVL",
5
5
  "main": "build/index.js",
6
6
  "scripts": {