@atomiqlabs/chain-evm 1.0.0-dev.83 → 1.0.0-dev.84
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.
|
@@ -14,12 +14,12 @@ class JsonRpcProviderWithRetries extends ethers_1.JsonRpcProvider {
|
|
|
14
14
|
}
|
|
15
15
|
send(method, params) {
|
|
16
16
|
return (0, Utils_1.tryWithRetries)(() => super.send(method, params), this.retryPolicy, e => {
|
|
17
|
-
if (e.code != null && typeof (e.code) === "string")
|
|
18
|
-
return
|
|
19
|
-
if (e.error?.code != null && typeof (e.error.code) === "number")
|
|
20
|
-
return
|
|
21
|
-
if (e.error?.message != null && typeof (e.error.message) === "string")
|
|
22
|
-
return
|
|
17
|
+
if (e.code != null && typeof (e.code) === "string" && Utils_1.allowedEthersErrorCodes.has(e.code))
|
|
18
|
+
return true;
|
|
19
|
+
if (e.error?.code != null && typeof (e.error.code) === "number" && Utils_1.allowedEthersErrorNumbers.has(e.error.code))
|
|
20
|
+
return true;
|
|
21
|
+
if (e.error?.message != null && typeof (e.error.message) === "string" && Utils_1.allowedEthersErrorMessages.has(e.error.message))
|
|
22
|
+
return true;
|
|
23
23
|
return false;
|
|
24
24
|
});
|
|
25
25
|
}
|
|
@@ -10,12 +10,12 @@ class WebSocketProviderWithRetries extends ReconnectingWebSocketProvider_1.Recon
|
|
|
10
10
|
}
|
|
11
11
|
send(method, params) {
|
|
12
12
|
return (0, Utils_1.tryWithRetries)(() => super.send(method, params), this.retryPolicy, e => {
|
|
13
|
-
if (e.code != null && typeof (e.code) === "string")
|
|
14
|
-
return
|
|
15
|
-
if (e.error?.code != null && typeof (e.error.code) === "number")
|
|
16
|
-
return
|
|
17
|
-
if (e.error?.message != null && typeof (e.error.message) === "string")
|
|
18
|
-
return
|
|
13
|
+
if (e.code != null && typeof (e.code) === "string" && Utils_1.allowedEthersErrorCodes.has(e.code))
|
|
14
|
+
return true;
|
|
15
|
+
if (e.error?.code != null && typeof (e.error.code) === "number" && Utils_1.allowedEthersErrorNumbers.has(e.error.code))
|
|
16
|
+
return true;
|
|
17
|
+
if (e.error?.message != null && typeof (e.error.message) === "string" && Utils_1.allowedEthersErrorMessages.has(e.error.message))
|
|
18
|
+
return true;
|
|
19
19
|
return false;
|
|
20
20
|
});
|
|
21
21
|
}
|
package/package.json
CHANGED
|
@@ -24,9 +24,9 @@ export class JsonRpcProviderWithRetries extends JsonRpcProvider {
|
|
|
24
24
|
|
|
25
25
|
send(method: string, params: Array<any> | Record<string, any>): Promise<any> {
|
|
26
26
|
return tryWithRetries(() => super.send(method, params), this.retryPolicy, e => {
|
|
27
|
-
if(e.code!=null && typeof(e.code)==="string"
|
|
28
|
-
if(e.error?.code!=null && typeof(e.error.code)==="number"
|
|
29
|
-
if(e.error?.message!=null && typeof(e.error.message)==="string"
|
|
27
|
+
if(e.code!=null && typeof(e.code)==="string" && allowedEthersErrorCodes.has(e.code)) return true;
|
|
28
|
+
if(e.error?.code!=null && typeof(e.error.code)==="number" && allowedEthersErrorNumbers.has(e.error.code)) return true;
|
|
29
|
+
if(e.error?.message!=null && typeof(e.error.message)==="string" && allowedEthersErrorMessages.has(e.error.message)) return true;
|
|
30
30
|
return false;
|
|
31
31
|
});
|
|
32
32
|
}
|
|
@@ -25,9 +25,9 @@ export class WebSocketProviderWithRetries extends ReconnectingWebSocketProvider
|
|
|
25
25
|
|
|
26
26
|
send(method: string, params: Array<any> | Record<string, any>): Promise<any> {
|
|
27
27
|
return tryWithRetries(() => super.send(method, params), this.retryPolicy, e => {
|
|
28
|
-
if(e.code!=null && typeof(e.code)==="string"
|
|
29
|
-
if(e.error?.code!=null && typeof(e.error.code)==="number"
|
|
30
|
-
if(e.error?.message!=null && typeof(e.error.message)==="string"
|
|
28
|
+
if(e.code!=null && typeof(e.code)==="string" && allowedEthersErrorCodes.has(e.code)) return true;
|
|
29
|
+
if(e.error?.code!=null && typeof(e.error.code)==="number" && allowedEthersErrorNumbers.has(e.error.code)) return true;
|
|
30
|
+
if(e.error?.message!=null && typeof(e.error.message)==="string" && allowedEthersErrorMessages.has(e.error.message)) return true;
|
|
31
31
|
return false;
|
|
32
32
|
});
|
|
33
33
|
}
|