@getpara/server-sdk 3.5.0 → 3.5.1
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.
- package/dist/cjs/workers/worker.js +20 -1
- package/dist/esm/workers/worker.js +20 -1
- package/package.json +5 -5
|
@@ -72,6 +72,25 @@ var walletUtils = __toESM(require("./walletUtils.js"));
|
|
|
72
72
|
var import_mpcWorkerError = require("./mpcWorkerError.js");
|
|
73
73
|
let rawWasm;
|
|
74
74
|
let wasmLoaded = false;
|
|
75
|
+
function getSerializableError(error) {
|
|
76
|
+
if (error && typeof error === "object") {
|
|
77
|
+
return error;
|
|
78
|
+
}
|
|
79
|
+
return void 0;
|
|
80
|
+
}
|
|
81
|
+
function isRetryableError(error) {
|
|
82
|
+
const errorFields = getSerializableError(error);
|
|
83
|
+
if (!errorFields) {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
if (errorFields.code === "POLICY_DENIED") {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
if (typeof errorFields.status === "number" && errorFields.status >= 400 && errorFields.status < 500) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
75
94
|
function requestWasmWithRetries(ctx, retries = 3) {
|
|
76
95
|
return __async(this, null, function* () {
|
|
77
96
|
for (let i = 0; i < retries; i++) {
|
|
@@ -188,7 +207,7 @@ function withRetry(operation, maxRetries = 2, timeoutMs = 1e4) {
|
|
|
188
207
|
}
|
|
189
208
|
} catch (error) {
|
|
190
209
|
retries++;
|
|
191
|
-
if (retries > maxRetries) {
|
|
210
|
+
if (!isRetryableError(error) || retries > maxRetries) {
|
|
192
211
|
throw error;
|
|
193
212
|
}
|
|
194
213
|
console.warn(`Operation failed (attempt ${retries}/${maxRetries}), retrying...`, error);
|
|
@@ -46,6 +46,25 @@ import * as walletUtils from "./walletUtils.js";
|
|
|
46
46
|
import { classifyMpcError, unwrapMpcError } from "./mpcWorkerError.js";
|
|
47
47
|
let rawWasm;
|
|
48
48
|
let wasmLoaded = false;
|
|
49
|
+
function getSerializableError(error) {
|
|
50
|
+
if (error && typeof error === "object") {
|
|
51
|
+
return error;
|
|
52
|
+
}
|
|
53
|
+
return void 0;
|
|
54
|
+
}
|
|
55
|
+
function isRetryableError(error) {
|
|
56
|
+
const errorFields = getSerializableError(error);
|
|
57
|
+
if (!errorFields) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
if (errorFields.code === "POLICY_DENIED") {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
if (typeof errorFields.status === "number" && errorFields.status >= 400 && errorFields.status < 500) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
49
68
|
function requestWasmWithRetries(ctx, retries = 3) {
|
|
50
69
|
return __async(this, null, function* () {
|
|
51
70
|
for (let i = 0; i < retries; i++) {
|
|
@@ -162,7 +181,7 @@ function withRetry(operation, maxRetries = 2, timeoutMs = 1e4) {
|
|
|
162
181
|
}
|
|
163
182
|
} catch (error) {
|
|
164
183
|
retries++;
|
|
165
|
-
if (retries > maxRetries) {
|
|
184
|
+
if (!isRetryableError(error) || retries > maxRetries) {
|
|
166
185
|
throw error;
|
|
167
186
|
}
|
|
168
187
|
console.warn(`Operation failed (attempt ${retries}/${maxRetries}), retrying...`, error);
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/server-sdk",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@getpara/core-sdk": "3.5.
|
|
6
|
-
"@getpara/user-management-client": "3.5.
|
|
7
|
-
"@getpara/viem-v2-integration": "3.5.
|
|
5
|
+
"@getpara/core-sdk": "3.5.1",
|
|
6
|
+
"@getpara/user-management-client": "3.5.1",
|
|
7
|
+
"@getpara/viem-v2-integration": "3.5.1",
|
|
8
8
|
"uuid": "^11.1.0",
|
|
9
9
|
"ws": "^8.14.2"
|
|
10
10
|
},
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dist",
|
|
17
17
|
"package.json"
|
|
18
18
|
],
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "362fc377edf3cca5f743679498ff4908921c8468",
|
|
20
20
|
"main": "dist/cjs/index.js",
|
|
21
21
|
"module": "dist/esm/index.js",
|
|
22
22
|
"scripts": {
|