@gearbox-protocol/sdk 9.1.7 → 9.1.8

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.
@@ -91,7 +91,7 @@ class RevolverTransport {
91
91
  get value() {
92
92
  return {
93
93
  rotate: (reason) => this.rotate(reason),
94
- currentTransportName: this.currentTransportName
94
+ currentTransportName: () => this.currentTransportName()
95
95
  };
96
96
  }
97
97
  request = async (r) => {
@@ -156,7 +156,7 @@ class RevolverTransport {
156
156
  },
157
157
  "rotating transport"
158
158
  );
159
- const oldTransportName = this.currentTransportName;
159
+ const oldTransportName = this.currentTransportName();
160
160
  const now = Date.now();
161
161
  this.#transports[this.#index].cooldown = now + (this.#config.cooldown ?? 6e4);
162
162
  for (let i = 0; i < this.#transports.length - 1; i++) {
@@ -173,7 +173,7 @@ class RevolverTransport {
173
173
  try {
174
174
  await this.#config.onRotateSuccess?.(
175
175
  oldTransportName,
176
- this.currentTransportName,
176
+ this.currentTransportName(),
177
177
  reason
178
178
  );
179
179
  } catch {
@@ -198,7 +198,7 @@ class RevolverTransport {
198
198
  this.#rotating = false;
199
199
  return false;
200
200
  }
201
- get currentTransportName() {
201
+ currentTransportName() {
202
202
  return this.#transport({}).config.name;
203
203
  }
204
204
  get #logger() {
@@ -74,7 +74,7 @@ class RevolverTransport {
74
74
  get value() {
75
75
  return {
76
76
  rotate: (reason) => this.rotate(reason),
77
- currentTransportName: this.currentTransportName
77
+ currentTransportName: () => this.currentTransportName()
78
78
  };
79
79
  }
80
80
  request = async (r) => {
@@ -139,7 +139,7 @@ class RevolverTransport {
139
139
  },
140
140
  "rotating transport"
141
141
  );
142
- const oldTransportName = this.currentTransportName;
142
+ const oldTransportName = this.currentTransportName();
143
143
  const now = Date.now();
144
144
  this.#transports[this.#index].cooldown = now + (this.#config.cooldown ?? 6e4);
145
145
  for (let i = 0; i < this.#transports.length - 1; i++) {
@@ -156,7 +156,7 @@ class RevolverTransport {
156
156
  try {
157
157
  await this.#config.onRotateSuccess?.(
158
158
  oldTransportName,
159
- this.currentTransportName,
159
+ this.currentTransportName(),
160
160
  reason
161
161
  );
162
162
  } catch {
@@ -181,7 +181,7 @@ class RevolverTransport {
181
181
  this.#rotating = false;
182
182
  return false;
183
183
  }
184
- get currentTransportName() {
184
+ currentTransportName() {
185
185
  return this.#transport({}).config.name;
186
186
  }
187
187
  get #logger() {
@@ -50,9 +50,9 @@ export interface RevolverTransportValue {
50
50
  */
51
51
  rotate: (reason?: BaseError) => Promise<boolean>;
52
52
  /**
53
- * The name of the current transport
53
+ * Returns the name of the current transport
54
54
  */
55
- currentTransportName: string;
55
+ currentTransportName: () => string;
56
56
  }
57
57
  export declare class RevolverTransport implements ReturnType<Transport<"revolver", RevolverTransportValue>> {
58
58
  #private;
@@ -76,6 +76,6 @@ export declare class RevolverTransport implements ReturnType<Transport<"revolver
76
76
  * @returns true if rotation was successful
77
77
  */
78
78
  rotate(reason?: BaseError): Promise<boolean>;
79
- get currentTransportName(): string;
79
+ currentTransportName(): string;
80
80
  }
81
81
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "9.1.7",
3
+ "version": "9.1.8",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",