@defillama/sdk 3.0.46 → 3.0.48

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.
@@ -4,6 +4,7 @@ import { ethers } from "ethers";
4
4
  export declare class ChainApi {
5
5
  block?: Block;
6
6
  chain: Chain | string;
7
+ chainId?: number;
7
8
  timestamp?: number;
8
9
  provider: ethers.providers.BaseProvider;
9
10
  _balances: Balances;
package/build/ChainApi.js CHANGED
@@ -59,12 +59,14 @@ var debugLog_1 = require("./util/debugLog");
59
59
  var generalUtil_1 = require("./generalUtil");
60
60
  var ChainApi = /** @class */ (function () {
61
61
  function ChainApi(params) {
62
- var _a;
62
+ var _a, _b;
63
63
  this.block = params.block;
64
64
  this.chain = (_a = params.chain) !== null && _a !== void 0 ? _a : 'ethereum';
65
65
  this.timestamp = params.timestamp;
66
66
  this.provider = (0, general_1.getProvider)(this.chain);
67
67
  this._balances = {};
68
+ // @ts-ignore
69
+ this.chainId = (_b = providers_json_1.default[this.chain]) === null || _b === void 0 ? void 0 : _b.chainId;
68
70
  }
69
71
  ChainApi.prototype.call = function (params) {
70
72
  return (0, abi2_1.call)(__assign(__assign({}, params), { block: this.block, chain: this.chain }));
@@ -133,9 +135,7 @@ var ChainApi = /** @class */ (function () {
133
135
  return this._balances;
134
136
  };
135
137
  ChainApi.prototype.getChainId = function () {
136
- var _a;
137
- // @ts-ignore
138
- return (_a = providers_json_1.default[this.chain]) === null || _a === void 0 ? void 0 : _a.chainId;
138
+ return this.chainId;
139
139
  };
140
140
  return ChainApi;
141
141
  }());