@gearbox-protocol/sdk 12.3.3 → 12.3.5

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.
@@ -60,7 +60,7 @@ class DegenDistributorsPlugin extends import_sdk.BasePlugin {
60
60
  if (r.status === "success" && r.result.length > 0) {
61
61
  this.#distributors?.upsert(pool, r.result[0]);
62
62
  } else {
63
- this.sdk.logger?.error(
63
+ this.sdk.logger?.warn(
64
64
  `failed to load degen distributor for market configurator ${this.labelAddress(
65
65
  cfg
66
66
  )} and pool ${this.labelAddress(pool)}: ${r.error}`
@@ -62,11 +62,15 @@ function createClient(opts, network) {
62
62
  async function attachClient(options, network) {
63
63
  let { chainId, networkType } = network;
64
64
  const attachClient2 = createClient(options);
65
- if (!networkType) {
65
+ if (networkType) {
66
+ if (!chainId) {
67
+ chainId = (0, import_chain.getChain)(networkType).id;
68
+ }
69
+ } else {
66
70
  networkType = await (0, import_chain.detectNetwork)(attachClient2);
67
- }
68
- if (!chainId) {
69
- chainId = await attachClient2.getChainId();
71
+ if (!chainId) {
72
+ chainId = await attachClient2.getChainId();
73
+ }
70
74
  }
71
75
  return createClient(options, { networkType, chainId });
72
76
  }
@@ -37,7 +37,7 @@ class DegenDistributorsPlugin extends BasePlugin {
37
37
  if (r.status === "success" && r.result.length > 0) {
38
38
  this.#distributors?.upsert(pool, r.result[0]);
39
39
  } else {
40
- this.sdk.logger?.error(
40
+ this.sdk.logger?.warn(
41
41
  `failed to load degen distributor for market configurator ${this.labelAddress(
42
42
  cfg
43
43
  )} and pool ${this.labelAddress(pool)}: ${r.error}`
@@ -61,11 +61,15 @@ function createClient(opts, network) {
61
61
  async function attachClient(options, network) {
62
62
  let { chainId, networkType } = network;
63
63
  const attachClient2 = createClient(options);
64
- if (!networkType) {
64
+ if (networkType) {
65
+ if (!chainId) {
66
+ chainId = getChain(networkType).id;
67
+ }
68
+ } else {
65
69
  networkType = await detectNetwork(attachClient2);
66
- }
67
- if (!chainId) {
68
- chainId = await attachClient2.getChainId();
70
+ if (!chainId) {
71
+ chainId = await attachClient2.getChainId();
72
+ }
69
73
  }
70
74
  return createClient(options, { networkType, chainId });
71
75
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "12.3.3",
3
+ "version": "12.3.5",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",