@unicitylabs/sphere-sdk 0.14.4 → 0.14.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.
- package/dist/connect/index.cjs +1 -1
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +1 -1
- package/dist/connect/index.js.map +1 -1
- package/dist/core/index.cjs +24 -35
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +24 -35
- package/dist/core/index.js.map +1 -1
- package/dist/impl/browser/connect/index.cjs +1 -1
- package/dist/impl/browser/connect/index.cjs.map +1 -1
- package/dist/impl/browser/connect/index.js +1 -1
- package/dist/impl/browser/connect/index.js.map +1 -1
- package/dist/index.cjs +24 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +24 -35
- package/dist/index.js.map +1 -1
- package/dist/token-engine/index.cjs +24 -35
- package/dist/token-engine/index.cjs.map +1 -1
- package/dist/token-engine/index.js +24 -35
- package/dist/token-engine/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -9396,35 +9396,18 @@ function resolveProofTimeoutMs(configured) {
|
|
|
9396
9396
|
}
|
|
9397
9397
|
return configured;
|
|
9398
9398
|
}
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
if (prop === "addEventListener") {
|
|
9403
|
-
return (type, listener, options) => {
|
|
9404
|
-
if (type === "abort" && target.aborted) {
|
|
9405
|
-
queueMicrotask(() => {
|
|
9406
|
-
listener.call(target, new Event("abort"));
|
|
9407
|
-
});
|
|
9408
|
-
return;
|
|
9409
|
-
}
|
|
9410
|
-
target.addEventListener(type, listener, options);
|
|
9411
|
-
};
|
|
9412
|
-
}
|
|
9413
|
-
const value = Reflect.get(target, prop, target);
|
|
9414
|
-
return typeof value === "function" ? value.bind(target) : value;
|
|
9415
|
-
}
|
|
9416
|
-
});
|
|
9399
|
+
var TRANSIENT_HTTP_STATUSES = /* @__PURE__ */ new Set([408, 425, 429, 500, 502, 503, 504]);
|
|
9400
|
+
function isTransientGatewayError(err) {
|
|
9401
|
+
return err instanceof JsonRpcNetworkError && TRANSIENT_HTTP_STATUSES.has(err.status);
|
|
9417
9402
|
}
|
|
9418
|
-
function
|
|
9419
|
-
return new Promise((
|
|
9420
|
-
|
|
9421
|
-
reject(signal.reason);
|
|
9422
|
-
return;
|
|
9423
|
-
}
|
|
9403
|
+
function pause(ms, signal) {
|
|
9404
|
+
return new Promise((resolve) => {
|
|
9405
|
+
const timer = setTimeout(resolve, ms);
|
|
9424
9406
|
signal.addEventListener(
|
|
9425
9407
|
"abort",
|
|
9426
9408
|
() => {
|
|
9427
|
-
|
|
9409
|
+
clearTimeout(timer);
|
|
9410
|
+
resolve();
|
|
9428
9411
|
},
|
|
9429
9412
|
{ once: true }
|
|
9430
9413
|
);
|
|
@@ -9447,17 +9430,23 @@ async function awaitProofBounded(deps, transaction, external) {
|
|
|
9447
9430
|
)
|
|
9448
9431
|
);
|
|
9449
9432
|
}, deps.timeoutMs);
|
|
9450
|
-
const wait = waitInclusionProof(
|
|
9451
|
-
deps.client,
|
|
9452
|
-
deps.trustBase,
|
|
9453
|
-
deps.predicateVerifier,
|
|
9454
|
-
transaction,
|
|
9455
|
-
lateDeliveringSignal(controller.signal),
|
|
9456
|
-
deps.intervalMs
|
|
9457
|
-
);
|
|
9458
|
-
wait.catch(() => void 0);
|
|
9459
9433
|
try {
|
|
9460
|
-
|
|
9434
|
+
for (; ; ) {
|
|
9435
|
+
try {
|
|
9436
|
+
return await waitInclusionProof(
|
|
9437
|
+
deps.client,
|
|
9438
|
+
deps.trustBase,
|
|
9439
|
+
deps.predicateVerifier,
|
|
9440
|
+
transaction,
|
|
9441
|
+
controller.signal,
|
|
9442
|
+
deps.intervalMs
|
|
9443
|
+
);
|
|
9444
|
+
} catch (err) {
|
|
9445
|
+
if (controller.signal.aborted) throw err;
|
|
9446
|
+
if (!isTransientGatewayError(err)) throw err;
|
|
9447
|
+
await pause(deps.intervalMs, controller.signal);
|
|
9448
|
+
}
|
|
9449
|
+
}
|
|
9461
9450
|
} finally {
|
|
9462
9451
|
clearTimeout(timer);
|
|
9463
9452
|
external?.removeEventListener("abort", relayAbort);
|