@gearbox-protocol/sdk 9.1.8 → 9.1.9
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.
|
@@ -100,17 +100,19 @@ class RevolverTransport {
|
|
|
100
100
|
}
|
|
101
101
|
do {
|
|
102
102
|
try {
|
|
103
|
-
this.#requests.set(r, this.currentTransportName);
|
|
103
|
+
this.#requests.set(r, this.currentTransportName());
|
|
104
104
|
const resp = await this.#transport({ ...this.overrides }).request(r);
|
|
105
105
|
this.#requests.delete(r);
|
|
106
106
|
return resp;
|
|
107
107
|
} catch (e) {
|
|
108
108
|
if (e instanceof import_viem.RpcError || e instanceof import_viem.HttpRequestError) {
|
|
109
109
|
const reqTransport = this.#requests.get(r);
|
|
110
|
-
if (reqTransport === this.currentTransportName) {
|
|
110
|
+
if (reqTransport === this.currentTransportName()) {
|
|
111
111
|
await this.rotate(e);
|
|
112
112
|
} else {
|
|
113
|
-
this.#logger?.debug(
|
|
113
|
+
this.#logger?.debug(
|
|
114
|
+
`request made with old transport ${reqTransport}, trying again`
|
|
115
|
+
);
|
|
114
116
|
}
|
|
115
117
|
} else {
|
|
116
118
|
this.#requests.delete(r);
|
|
@@ -83,17 +83,19 @@ class RevolverTransport {
|
|
|
83
83
|
}
|
|
84
84
|
do {
|
|
85
85
|
try {
|
|
86
|
-
this.#requests.set(r, this.currentTransportName);
|
|
86
|
+
this.#requests.set(r, this.currentTransportName());
|
|
87
87
|
const resp = await this.#transport({ ...this.overrides }).request(r);
|
|
88
88
|
this.#requests.delete(r);
|
|
89
89
|
return resp;
|
|
90
90
|
} catch (e) {
|
|
91
91
|
if (e instanceof RpcError || e instanceof HttpRequestError) {
|
|
92
92
|
const reqTransport = this.#requests.get(r);
|
|
93
|
-
if (reqTransport === this.currentTransportName) {
|
|
93
|
+
if (reqTransport === this.currentTransportName()) {
|
|
94
94
|
await this.rotate(e);
|
|
95
95
|
} else {
|
|
96
|
-
this.#logger?.debug(
|
|
96
|
+
this.#logger?.debug(
|
|
97
|
+
`request made with old transport ${reqTransport}, trying again`
|
|
98
|
+
);
|
|
97
99
|
}
|
|
98
100
|
} else {
|
|
99
101
|
this.#requests.delete(r);
|