@gearbox-protocol/sdk 9.1.3 → 9.1.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.
@@ -73,7 +73,7 @@ class RevolverTransport {
73
73
  retryCount: config.retryCount,
74
74
  retryDelay: config.retryDelay,
75
75
  timeout: config.timeout,
76
- batch: false,
76
+ batch: !!config.batch,
77
77
  key: `${provider}-${i}`,
78
78
  name: `${provider}-${i}`,
79
79
  onFetchRequest: this.#config.onRequest ? (...args) => this.#config.onRequest?.(`${provider}-${i}`, ...args) : void 0,
@@ -171,7 +171,7 @@ class RevolverTransport {
171
171
  );
172
172
  }
173
173
  }
174
- await this.#config.onRotateFailed?.(reason);
174
+ await this.#config.onRotateFailed?.(oldTransportName, reason);
175
175
  return false;
176
176
  }
177
177
  get currentTransportName() {
@@ -56,7 +56,7 @@ class RevolverTransport {
56
56
  retryCount: config.retryCount,
57
57
  retryDelay: config.retryDelay,
58
58
  timeout: config.timeout,
59
- batch: false,
59
+ batch: !!config.batch,
60
60
  key: `${provider}-${i}`,
61
61
  name: `${provider}-${i}`,
62
62
  onFetchRequest: this.#config.onRequest ? (...args) => this.#config.onRequest?.(`${provider}-${i}`, ...args) : void 0,
@@ -154,7 +154,7 @@ class RevolverTransport {
154
154
  );
155
155
  }
156
156
  }
157
- await this.#config.onRotateFailed?.(reason);
157
+ await this.#config.onRotateFailed?.(oldTransportName, reason);
158
158
  return false;
159
159
  }
160
160
  get currentTransportName() {
@@ -14,6 +14,10 @@ export interface RevolverTransportConfig {
14
14
  retryCount?: TransportConfig["retryCount"] | undefined;
15
15
  retryDelay?: TransportConfig["retryDelay"] | undefined;
16
16
  timeout?: TransportConfig["timeout"] | undefined;
17
+ /**
18
+ * Allow batching of json-rpc requests
19
+ */
20
+ batch?: boolean | undefined;
17
21
  /**
18
22
  * Spying function that also returns provider name in additional to the request
19
23
  */
@@ -29,7 +33,7 @@ export interface RevolverTransportConfig {
29
33
  /**
30
34
  * Callback that is called when the transport cannot be rotated
31
35
  */
32
- onRotateFailed?: (reason?: BaseError) => void | Promise<void>;
36
+ onRotateFailed?: (oldTransportName: string, reason?: BaseError) => void | Promise<void>;
33
37
  /**
34
38
  * How long, in milliseconds, to wait before try this transport again
35
39
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "9.1.3",
3
+ "version": "9.1.5",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",