@gearbox-protocol/sdk 8.0.0-next.2 → 8.0.0

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.
@@ -45,7 +45,6 @@ class BotsPlugin extends import_sdk.BasePlugin {
45
45
  if (!force && this.loaded) {
46
46
  return this.state;
47
47
  }
48
- this.#botsByMarket = new import_sdk.AddressMap();
49
48
  const [pcAddr] = this.sdk.addressProvider.mustGetLatest(
50
49
  import_sdk.AP_PERIPHERY_COMPRESSOR,
51
50
  import_sdk.VERSION_RANGE_310
@@ -65,6 +64,7 @@ class BotsPlugin extends import_sdk.BasePlugin {
65
64
  ),
66
65
  allowFailure: false
67
66
  });
67
+ this.#botsByMarket = new import_sdk.AddressMap();
68
68
  for (let i = 0; i < mcs.length; i++) {
69
69
  const mc = mcs[i];
70
70
  const marketBotData = botsData[i];
@@ -52,10 +52,10 @@ class DegenDistributorsPlugin extends import_sdk.BasePlugin {
52
52
  const cfg = m.configurator.address;
53
53
  const cfgLC = cfg.toLowerCase();
54
54
  const r = distributorByConfigurator?.[cfgLC];
55
- if (!this.#distributors) {
56
- this.#distributors = new import_sdk.AddressMap(void 0, MAP_LABEL);
57
- }
58
55
  if (r.status === "fulfilled") {
56
+ if (!this.#distributors) {
57
+ this.#distributors = new import_sdk.AddressMap(void 0, MAP_LABEL);
58
+ }
59
59
  this.#distributors.upsert(pool, r.value);
60
60
  } else {
61
61
  this.sdk.logger?.error(
@@ -55,10 +55,13 @@ class Pools7DAgoPlugin extends import_sdk.BasePlugin {
55
55
  const m = markets[index];
56
56
  const cfg = m.configurator.address;
57
57
  const pool = m.pool.pool.address;
58
- if (!this.#pools7DAgo) {
59
- this.#pools7DAgo = new import_sdk.AddressMap(void 0, MAP_LABEL);
60
- }
61
58
  if (r.status === "success") {
59
+ if (!this.#pools7DAgo) {
60
+ this.#pools7DAgo = new import_sdk.AddressMap(
61
+ void 0,
62
+ MAP_LABEL
63
+ );
64
+ }
62
65
  this.#pools7DAgo.upsert(m.pool.pool.address, {
63
66
  dieselRate: r.result.dieselRate,
64
67
  pool
@@ -29,7 +29,6 @@ class ZappersPlugin extends import_sdk.BasePlugin {
29
29
  if (!force && this.loaded) {
30
30
  return this.state;
31
31
  }
32
- this.#zappers = new import_sdk.AddressMap(void 0, "zappers");
33
32
  const [pcAddr] = this.sdk.addressProvider.mustGetLatest(
34
33
  import_sdk.AP_PERIPHERY_COMPRESSOR,
35
34
  import_sdk.VERSION_RANGE_310
@@ -49,6 +48,7 @@ class ZappersPlugin extends import_sdk.BasePlugin {
49
48
  ),
50
49
  allowFailure: true
51
50
  });
51
+ this.#zappers = new import_sdk.AddressMap(void 0, "zappers");
52
52
  for (let i = 0; i < resp.length; i++) {
53
53
  const { status, result, error } = resp[i];
54
54
  const marketConfigurator = markets[i].configurator.address;
@@ -31,7 +31,6 @@ class BotsPlugin extends BasePlugin {
31
31
  if (!force && this.loaded) {
32
32
  return this.state;
33
33
  }
34
- this.#botsByMarket = new AddressMap();
35
34
  const [pcAddr] = this.sdk.addressProvider.mustGetLatest(
36
35
  AP_PERIPHERY_COMPRESSOR,
37
36
  VERSION_RANGE_310
@@ -51,6 +50,7 @@ class BotsPlugin extends BasePlugin {
51
50
  ),
52
51
  allowFailure: false
53
52
  });
53
+ this.#botsByMarket = new AddressMap();
54
54
  for (let i = 0; i < mcs.length; i++) {
55
55
  const mc = mcs[i];
56
56
  const marketBotData = botsData[i];
@@ -29,10 +29,10 @@ class DegenDistributorsPlugin extends BasePlugin {
29
29
  const cfg = m.configurator.address;
30
30
  const cfgLC = cfg.toLowerCase();
31
31
  const r = distributorByConfigurator?.[cfgLC];
32
- if (!this.#distributors) {
33
- this.#distributors = new AddressMap(void 0, MAP_LABEL);
34
- }
35
32
  if (r.status === "fulfilled") {
33
+ if (!this.#distributors) {
34
+ this.#distributors = new AddressMap(void 0, MAP_LABEL);
35
+ }
36
36
  this.#distributors.upsert(pool, r.value);
37
37
  } else {
38
38
  this.sdk.logger?.error(
@@ -39,10 +39,13 @@ class Pools7DAgoPlugin extends BasePlugin {
39
39
  const m = markets[index];
40
40
  const cfg = m.configurator.address;
41
41
  const pool = m.pool.pool.address;
42
- if (!this.#pools7DAgo) {
43
- this.#pools7DAgo = new AddressMap(void 0, MAP_LABEL);
44
- }
45
42
  if (r.status === "success") {
43
+ if (!this.#pools7DAgo) {
44
+ this.#pools7DAgo = new AddressMap(
45
+ void 0,
46
+ MAP_LABEL
47
+ );
48
+ }
46
49
  this.#pools7DAgo.upsert(m.pool.pool.address, {
47
50
  dieselRate: r.result.dieselRate,
48
51
  pool
@@ -11,7 +11,6 @@ class ZappersPlugin extends BasePlugin {
11
11
  if (!force && this.loaded) {
12
12
  return this.state;
13
13
  }
14
- this.#zappers = new AddressMap(void 0, "zappers");
15
14
  const [pcAddr] = this.sdk.addressProvider.mustGetLatest(
16
15
  AP_PERIPHERY_COMPRESSOR,
17
16
  VERSION_RANGE_310
@@ -31,6 +30,7 @@ class ZappersPlugin extends BasePlugin {
31
30
  ),
32
31
  allowFailure: true
33
32
  });
33
+ this.#zappers = new AddressMap(void 0, "zappers");
34
34
  for (let i = 0; i < resp.length; i++) {
35
35
  const { status, result, error } = resp[i];
36
36
  const marketConfigurator = markets[i].configurator.address;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "8.0.0-next.2",
3
+ "version": "8.0.0",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",