@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/core/index.js
CHANGED
|
@@ -9380,35 +9380,18 @@ function resolveProofTimeoutMs(configured) {
|
|
|
9380
9380
|
}
|
|
9381
9381
|
return configured;
|
|
9382
9382
|
}
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
if (prop === "addEventListener") {
|
|
9387
|
-
return (type, listener, options) => {
|
|
9388
|
-
if (type === "abort" && target.aborted) {
|
|
9389
|
-
queueMicrotask(() => {
|
|
9390
|
-
listener.call(target, new Event("abort"));
|
|
9391
|
-
});
|
|
9392
|
-
return;
|
|
9393
|
-
}
|
|
9394
|
-
target.addEventListener(type, listener, options);
|
|
9395
|
-
};
|
|
9396
|
-
}
|
|
9397
|
-
const value = Reflect.get(target, prop, target);
|
|
9398
|
-
return typeof value === "function" ? value.bind(target) : value;
|
|
9399
|
-
}
|
|
9400
|
-
});
|
|
9383
|
+
var TRANSIENT_HTTP_STATUSES = /* @__PURE__ */ new Set([408, 425, 429, 500, 502, 503, 504]);
|
|
9384
|
+
function isTransientGatewayError(err) {
|
|
9385
|
+
return err instanceof JsonRpcNetworkError && TRANSIENT_HTTP_STATUSES.has(err.status);
|
|
9401
9386
|
}
|
|
9402
|
-
function
|
|
9403
|
-
return new Promise((
|
|
9404
|
-
|
|
9405
|
-
reject(signal.reason);
|
|
9406
|
-
return;
|
|
9407
|
-
}
|
|
9387
|
+
function pause(ms, signal) {
|
|
9388
|
+
return new Promise((resolve) => {
|
|
9389
|
+
const timer = setTimeout(resolve, ms);
|
|
9408
9390
|
signal.addEventListener(
|
|
9409
9391
|
"abort",
|
|
9410
9392
|
() => {
|
|
9411
|
-
|
|
9393
|
+
clearTimeout(timer);
|
|
9394
|
+
resolve();
|
|
9412
9395
|
},
|
|
9413
9396
|
{ once: true }
|
|
9414
9397
|
);
|
|
@@ -9431,17 +9414,23 @@ async function awaitProofBounded(deps, transaction, external) {
|
|
|
9431
9414
|
)
|
|
9432
9415
|
);
|
|
9433
9416
|
}, deps.timeoutMs);
|
|
9434
|
-
const wait = waitInclusionProof(
|
|
9435
|
-
deps.client,
|
|
9436
|
-
deps.trustBase,
|
|
9437
|
-
deps.predicateVerifier,
|
|
9438
|
-
transaction,
|
|
9439
|
-
lateDeliveringSignal(controller.signal),
|
|
9440
|
-
deps.intervalMs
|
|
9441
|
-
);
|
|
9442
|
-
wait.catch(() => void 0);
|
|
9443
9417
|
try {
|
|
9444
|
-
|
|
9418
|
+
for (; ; ) {
|
|
9419
|
+
try {
|
|
9420
|
+
return await waitInclusionProof(
|
|
9421
|
+
deps.client,
|
|
9422
|
+
deps.trustBase,
|
|
9423
|
+
deps.predicateVerifier,
|
|
9424
|
+
transaction,
|
|
9425
|
+
controller.signal,
|
|
9426
|
+
deps.intervalMs
|
|
9427
|
+
);
|
|
9428
|
+
} catch (err) {
|
|
9429
|
+
if (controller.signal.aborted) throw err;
|
|
9430
|
+
if (!isTransientGatewayError(err)) throw err;
|
|
9431
|
+
await pause(deps.intervalMs, controller.signal);
|
|
9432
|
+
}
|
|
9433
|
+
}
|
|
9445
9434
|
} finally {
|
|
9446
9435
|
clearTimeout(timer);
|
|
9447
9436
|
external?.removeEventListener("abort", relayAbort);
|