@gearbox-protocol/sdk 10.7.1 → 10.7.2

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.
@@ -184,20 +184,18 @@ const retryCodes = /* @__PURE__ */ new Set([
184
184
  const defaultShouldRetry = ({
185
185
  error
186
186
  }) => {
187
- const callExError = error instanceof import_viem.BaseError && error.walk(
188
- (e) => e instanceof import_viem.CallExecutionError && e.details === "header not found"
189
- );
190
- if (callExError && [
187
+ if ("code" in error && typeof error.code === "number") {
188
+ return retryCodes.has(error.code);
189
+ }
190
+ const msg = error.message?.toLowerCase() ?? `${error}`.toLowerCase();
191
+ if ([
191
192
  "unknown block",
192
193
  "header not found",
193
194
  "resource unavailable",
194
195
  "requested resource not available"
195
- ].some((s) => callExError.details.toLowerCase().includes(s))) {
196
+ ].some((s) => msg.includes(s))) {
196
197
  return true;
197
198
  }
198
- if ("code" in error && typeof error.code === "number") {
199
- return retryCodes.has(error.code);
200
- }
201
199
  return false;
202
200
  };
203
201
  class AbstractTransportSelector {
@@ -1,6 +1,5 @@
1
1
  import {
2
2
  BaseError,
3
- CallExecutionError,
4
3
  HttpRequestError,
5
4
  http,
6
5
  InvalidInputRpcError,
@@ -172,20 +171,18 @@ const retryCodes = /* @__PURE__ */ new Set([
172
171
  const defaultShouldRetry = ({
173
172
  error
174
173
  }) => {
175
- const callExError = error instanceof BaseError && error.walk(
176
- (e) => e instanceof CallExecutionError && e.details === "header not found"
177
- );
178
- if (callExError && [
174
+ if ("code" in error && typeof error.code === "number") {
175
+ return retryCodes.has(error.code);
176
+ }
177
+ const msg = error.message?.toLowerCase() ?? `${error}`.toLowerCase();
178
+ if ([
179
179
  "unknown block",
180
180
  "header not found",
181
181
  "resource unavailable",
182
182
  "requested resource not available"
183
- ].some((s) => callExError.details.toLowerCase().includes(s))) {
183
+ ].some((s) => msg.includes(s))) {
184
184
  return true;
185
185
  }
186
- if ("code" in error && typeof error.code === "number") {
187
- return retryCodes.has(error.code);
188
- }
189
186
  return false;
190
187
  };
191
188
  class AbstractTransportSelector {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "10.7.1",
3
+ "version": "10.7.2",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",