@gearbox-protocol/sdk 2.1.16 → 2.1.18

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.
@@ -1,7 +1,7 @@
1
1
  // SPDX-License-Identifier: UNLICENSED
2
- // Gearbox. Generalized leverage protocol that allows to take leverage and then use it across other DeFi protocols and platforms in a composable way.
3
- // (c) Gearbox Foundation, 2023
4
- pragma solidity ^0.8.17;
2
+ // Gearbox Protocol. Generalized leverage for DeFi protocols
3
+ // (c) Gearbox Foundation, 2023.
4
+ pragma solidity ^0.8.0;
5
5
 
6
6
  enum AdapterType {
7
7
  ABSTRACT,
@@ -1,7 +1,7 @@
1
1
  // SPDX-License-Identifier: UNLICENSED
2
- // Gearbox. Generalized leverage protocol that allows to take leverage and then use it across other DeFi protocols and platforms in a composable way.
3
- // (c) Gearbox Foundation, 2023
4
- pragma solidity ^0.8.17;
2
+ // Gearbox Protocol. Generalized leverage for DeFi protocols
3
+ // (c) Gearbox Foundation, 2023.
4
+ pragma solidity ^0.8.0;
5
5
 
6
6
  enum PriceFeedType {
7
7
  CHAINLINK_ORACLE,
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  const chai_1 = require("chai");
7
4
  const ethers_1 = require("ethers");
8
5
  const chains_1 = require("../core/chains");
9
6
  const types_1 = require("../types");
10
7
  const formatter_1 = require("../utils/formatter");
11
- const multicall_1 = __importDefault(require("../utils/multicall"));
8
+ const multicall_1 = require("../utils/multicall");
12
9
  const priceFeeds_1 = require("./priceFeeds");
13
10
  const pricefeedType_1 = require("./pricefeedType");
14
11
  const iFeed = types_1.AggregatorV3Interface__factory.createInterface();
@@ -27,7 +24,7 @@ class PriceFeedsSuite {
27
24
  }
28
25
  return new ethers_1.ethers.providers.StaticJsonRpcProvider(url, chains_1.CHAINS[c]);
29
26
  });
30
- const resps = await Promise.all(this.networkTypes.map((_, i) => (0, multicall_1.default)(this.calls[i], providers[i])));
27
+ const resps = await Promise.all(this.networkTypes.map((_, i) => (0, multicall_1.safeMulticall)(this.calls[i], providers[i])));
31
28
  return resps.map((_, i) => this.buildDict(this.calls[i], resps[i]));
32
29
  }
33
30
  collectCalls(c) {
@@ -1,13 +1,10 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  /* eslint-disable max-nested-callbacks */
7
4
  const ethers_1 = require("ethers");
8
5
  const chains_1 = require("../core/chains");
9
6
  const types_1 = require("../types");
10
- const multicall_1 = __importDefault(require("../utils/multicall"));
7
+ const multicall_1 = require("../utils/multicall");
11
8
  const token_1 = require("./token");
12
9
  const erc20 = types_1.IERC20Metadata__factory.createInterface();
13
10
  const EXCEPTIONS_IN_SYMBOLS = {
@@ -67,7 +64,7 @@ class TokenSuite {
67
64
  }
68
65
  }
69
66
  else {
70
- const resps = await (0, multicall_1.default)(this.calls, this.provider);
67
+ const resps = await (0, multicall_1.safeMulticall)(this.calls, this.provider);
71
68
  for (let i = 0; i < resps.length; i++) {
72
69
  const call = this.calls[i];
73
70
  const resp = resps[i];
@@ -21,7 +21,7 @@ export declare function multicall<R extends Array<any>>(calls: Array<MCall<any>>
21
21
  * @param overrides
22
22
  * @returns
23
23
  */
24
- export default function safeMulticall<V = any, T extends MCall<any> = MCall<any>>(calls: T[], p: Signer | ethers.providers.Provider, overrides?: CallOverrides): Promise<Array<{
24
+ export declare function safeMulticall<V = any, T extends MCall<any> = MCall<any>>(calls: T[], p: Signer | ethers.providers.Provider, overrides?: CallOverrides): Promise<Array<{
25
25
  error: boolean;
26
26
  value?: V;
27
27
  }>>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MultiCallContract = exports.multicall = void 0;
3
+ exports.MultiCallContract = exports.safeMulticall = exports.multicall = void 0;
4
4
  const config_1 = require("../config");
5
5
  const types_1 = require("../types");
6
6
  async function multicall(calls, p, overrides) {
@@ -37,7 +37,7 @@ async function safeMulticall(calls, p, overrides) {
37
37
  : undefined,
38
38
  }));
39
39
  }
40
- exports.default = safeMulticall;
40
+ exports.safeMulticall = safeMulticall;
41
41
  function unwrapArray(data) {
42
42
  if (!data) {
43
43
  return data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "2.1.16",
3
+ "version": "2.1.18",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",