@gearbox-protocol/sdk 11.6.5 → 11.6.7

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.
@@ -83,6 +83,9 @@ class PythUpdater extends import_base.SDKConstruct {
83
83
  });
84
84
  }
85
85
  async getUpdateTxs(feeds) {
86
+ if (feeds.length === 0) {
87
+ return [];
88
+ }
86
89
  this.#logger?.debug(
87
90
  `generating update transactions for ${feeds.length} pyth price feeds`
88
91
  );
@@ -90,6 +90,9 @@ class RedstoneUpdater extends import_base.SDKConstruct {
90
90
  });
91
91
  }
92
92
  async getUpdateTxs(feeds) {
93
+ if (feeds.length === 0) {
94
+ return [];
95
+ }
93
96
  this.#logger?.debug(
94
97
  `generating update transactions for ${feeds.length} redstone price feeds`
95
98
  );
@@ -53,7 +53,8 @@ function tryBisectBlockRange({ fromBlock, toBlock }, e) {
53
53
  "query exceeds max block",
54
54
  "range is too large",
55
55
  "eth_getLogs is limited to",
56
- "eth_getLogs requests with up to"
56
+ "eth_getLogs requests with up to",
57
+ "exceeded max allowed range"
57
58
  ];
58
59
  if (e instanceof Error && blockRangeErrors.some((errorText) => e.message.includes(errorText))) {
59
60
  const middle = (fromBlock + toBlock) / 2n;
@@ -63,6 +63,9 @@ class PythUpdater extends SDKConstruct {
63
63
  });
64
64
  }
65
65
  async getUpdateTxs(feeds) {
66
+ if (feeds.length === 0) {
67
+ return [];
68
+ }
66
69
  this.#logger?.debug(
67
70
  `generating update transactions for ${feeds.length} pyth price feeds`
68
71
  );
@@ -68,6 +68,9 @@ class RedstoneUpdater extends SDKConstruct {
68
68
  });
69
69
  }
70
70
  async getUpdateTxs(feeds) {
71
+ if (feeds.length === 0) {
72
+ return [];
73
+ }
71
74
  this.#logger?.debug(
72
75
  `generating update transactions for ${feeds.length} redstone price feeds`
73
76
  );
@@ -32,7 +32,8 @@ function tryBisectBlockRange({ fromBlock, toBlock }, e) {
32
32
  "query exceeds max block",
33
33
  "range is too large",
34
34
  "eth_getLogs is limited to",
35
- "eth_getLogs requests with up to"
35
+ "eth_getLogs requests with up to",
36
+ "exceeded max allowed range"
36
37
  ];
37
38
  if (e instanceof Error && blockRangeErrors.some((errorText) => e.message.includes(errorText))) {
38
39
  const middle = (fromBlock + toBlock) / 2n;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "11.6.5",
3
+ "version": "11.6.7",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",