@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.cjs
CHANGED
|
@@ -9524,35 +9524,18 @@ function resolveProofTimeoutMs(configured) {
|
|
|
9524
9524
|
}
|
|
9525
9525
|
return configured;
|
|
9526
9526
|
}
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
if (prop === "addEventListener") {
|
|
9531
|
-
return (type, listener, options) => {
|
|
9532
|
-
if (type === "abort" && target.aborted) {
|
|
9533
|
-
queueMicrotask(() => {
|
|
9534
|
-
listener.call(target, new Event("abort"));
|
|
9535
|
-
});
|
|
9536
|
-
return;
|
|
9537
|
-
}
|
|
9538
|
-
target.addEventListener(type, listener, options);
|
|
9539
|
-
};
|
|
9540
|
-
}
|
|
9541
|
-
const value = Reflect.get(target, prop, target);
|
|
9542
|
-
return typeof value === "function" ? value.bind(target) : value;
|
|
9543
|
-
}
|
|
9544
|
-
});
|
|
9527
|
+
var TRANSIENT_HTTP_STATUSES = /* @__PURE__ */ new Set([408, 425, 429, 500, 502, 503, 504]);
|
|
9528
|
+
function isTransientGatewayError(err) {
|
|
9529
|
+
return err instanceof import_JsonRpcNetworkError.JsonRpcNetworkError && TRANSIENT_HTTP_STATUSES.has(err.status);
|
|
9545
9530
|
}
|
|
9546
|
-
function
|
|
9547
|
-
return new Promise((
|
|
9548
|
-
|
|
9549
|
-
reject(signal.reason);
|
|
9550
|
-
return;
|
|
9551
|
-
}
|
|
9531
|
+
function pause(ms, signal) {
|
|
9532
|
+
return new Promise((resolve) => {
|
|
9533
|
+
const timer = setTimeout(resolve, ms);
|
|
9552
9534
|
signal.addEventListener(
|
|
9553
9535
|
"abort",
|
|
9554
9536
|
() => {
|
|
9555
|
-
|
|
9537
|
+
clearTimeout(timer);
|
|
9538
|
+
resolve();
|
|
9556
9539
|
},
|
|
9557
9540
|
{ once: true }
|
|
9558
9541
|
);
|
|
@@ -9575,17 +9558,23 @@ async function awaitProofBounded(deps, transaction, external) {
|
|
|
9575
9558
|
)
|
|
9576
9559
|
);
|
|
9577
9560
|
}, deps.timeoutMs);
|
|
9578
|
-
const wait = (0, import_InclusionProofUtils.waitInclusionProof)(
|
|
9579
|
-
deps.client,
|
|
9580
|
-
deps.trustBase,
|
|
9581
|
-
deps.predicateVerifier,
|
|
9582
|
-
transaction,
|
|
9583
|
-
lateDeliveringSignal(controller.signal),
|
|
9584
|
-
deps.intervalMs
|
|
9585
|
-
);
|
|
9586
|
-
wait.catch(() => void 0);
|
|
9587
9561
|
try {
|
|
9588
|
-
|
|
9562
|
+
for (; ; ) {
|
|
9563
|
+
try {
|
|
9564
|
+
return await (0, import_InclusionProofUtils.waitInclusionProof)(
|
|
9565
|
+
deps.client,
|
|
9566
|
+
deps.trustBase,
|
|
9567
|
+
deps.predicateVerifier,
|
|
9568
|
+
transaction,
|
|
9569
|
+
controller.signal,
|
|
9570
|
+
deps.intervalMs
|
|
9571
|
+
);
|
|
9572
|
+
} catch (err) {
|
|
9573
|
+
if (controller.signal.aborted) throw err;
|
|
9574
|
+
if (!isTransientGatewayError(err)) throw err;
|
|
9575
|
+
await pause(deps.intervalMs, controller.signal);
|
|
9576
|
+
}
|
|
9577
|
+
}
|
|
9589
9578
|
} finally {
|
|
9590
9579
|
clearTimeout(timer);
|
|
9591
9580
|
external?.removeEventListener("abort", relayAbort);
|