@defillama/sdk 4.0.1 → 4.0.3

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.
package/build/ChainApi.js CHANGED
@@ -110,7 +110,16 @@ var ChainApi = /** @class */ (function () {
110
110
  };
111
111
  ChainApi.prototype.add = function (token, balance, _a) {
112
112
  var _b = _a === void 0 ? {} : _a, _c = _b.skipChain, skipChain = _c === void 0 ? false : _c;
113
- var chain = !skipChain ? this.chain : undefined;
113
+ token = token.replace(/\//g, ':');
114
+ var isIBCToken = token.startsWith('ibc:');
115
+ var chain = this.chain;
116
+ if (skipChain || isIBCToken) {
117
+ chain = undefined;
118
+ }
119
+ if (chain === 'injective' && token.startsWith('peggy0x')) {
120
+ chain = 'ethereum';
121
+ token = token.replace('peggy', '');
122
+ }
114
123
  (0, generalUtil_1.sumSingleBalance)(this._balances, token, balance, chain);
115
124
  };
116
125
  ChainApi.prototype.addToken = function (token, balance, _a) {
@@ -279,7 +279,7 @@ function cachedMultiCall(params) {
279
279
  }
280
280
  });
281
281
  if (!missing.length)
282
- return [2 /*return*/, response];
282
+ return [2 /*return*/, { output: response }];
283
283
  params.contractCalls = missing;
284
284
  return [4 /*yield*/, multiCall(params)];
285
285
  case 1:
@@ -28,8 +28,7 @@ var fs = __importStar(require("fs"));
28
28
  // const cacheFile = __dirname + '/../../../sc-cache1.json'
29
29
  var cacheFile = process.env.CACHE_FILE;
30
30
  var cache = {};
31
- if (cacheFile)
32
- cache = require(cacheFile);
31
+ // if (cacheFile) cache = require(cacheFile) // disabled for now
33
32
  function getCache(options) {
34
33
  var address = options.address, abi = options.abi, _a = options.chain, chain = _a === void 0 ? "ethereum" : _a;
35
34
  if (!address)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defillama/sdk",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "description": "SDK for calculating TVL",
5
5
  "main": "build/index.js",
6
6
  "scripts": {