@gearbox-protocol/sdk 1.7.1 → 1.7.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/lib/index.d.ts CHANGED
@@ -57,6 +57,7 @@ export * from "./utils/errors";
57
57
  export { getPoolTokens, getUnderlyingToken } from "./utils/extracter";
58
58
  export { keyToLowercase, objectEntries, swapKeyValue } from "./utils/mappers";
59
59
  export * from "./utils/multicall";
60
+ export * from "./utils/network";
60
61
  export * from "./utils/price";
61
62
  export { callRepeater } from "./utils/repeater";
62
63
  export * from "./utils/types";
package/lib/index.js CHANGED
@@ -83,6 +83,7 @@ Object.defineProperty(exports, "keyToLowercase", { enumerable: true, get: functi
83
83
  Object.defineProperty(exports, "objectEntries", { enumerable: true, get: function () { return mappers_1.objectEntries; } });
84
84
  Object.defineProperty(exports, "swapKeyValue", { enumerable: true, get: function () { return mappers_1.swapKeyValue; } });
85
85
  __exportStar(require("./utils/multicall"), exports);
86
+ __exportStar(require("./utils/network"), exports);
86
87
  __exportStar(require("./utils/price"), exports);
87
88
  var repeater_1 = require("./utils/repeater");
88
89
  Object.defineProperty(exports, "callRepeater", { enumerable: true, get: function () { return repeater_1.callRepeater; } });
@@ -1,3 +1,4 @@
1
1
  import { ethers } from "ethers";
2
2
  import { NetworkType } from "../core/constants";
3
3
  export declare function detectNetwork(provider: ethers.providers.Provider): Promise<NetworkType>;
4
+ export declare function getEtherscan(chainId: number): string;
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.detectNetwork = void 0;
39
+ exports.getEtherscan = exports.detectNetwork = void 0;
40
40
  var constants_1 = require("../core/constants");
41
41
  var token_1 = require("../tokens/token");
42
42
  var types_1 = require("../types");
@@ -72,3 +72,14 @@ function detectNetwork(provider) {
72
72
  });
73
73
  }
74
74
  exports.detectNetwork = detectNetwork;
75
+ function getEtherscan(chainId) {
76
+ switch (chainId) {
77
+ case constants_1.MAINNET_NETWORK:
78
+ return "https://etherscan.io";
79
+ case constants_1.GOERLI_NETWORK:
80
+ return "https://goerli.etherscan.io";
81
+ default:
82
+ return "";
83
+ }
84
+ }
85
+ exports.getEtherscan = getEtherscan;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "1.7.1",
3
+ "version": "1.7.3",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",