@unicitylabs/sphere-sdk 0.14.6-dev.1 → 0.14.7
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 +14 -6
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +14 -6
- 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/impl/wallet-api-v2/index.cjs.map +1 -1
- package/dist/impl/wallet-api-v2/index.js.map +1 -1
- package/dist/index.cjs +14 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/dist/modules/payments-v2/index.cjs +6 -2
- package/dist/modules/payments-v2/index.cjs.map +1 -1
- package/dist/modules/payments-v2/index.js +6 -2
- package/dist/modules/payments-v2/index.js.map +1 -1
- package/dist/token-engine/index.cjs +8 -4
- package/dist/token-engine/index.cjs.map +1 -1
- package/dist/token-engine/index.js +8 -4
- package/dist/token-engine/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -350,12 +350,15 @@ function pause(ms, signal) {
|
|
|
350
350
|
});
|
|
351
351
|
}
|
|
352
352
|
async function retryTransient(attempt, signal, intervalMs) {
|
|
353
|
+
let retried = false;
|
|
353
354
|
for (; ; ) {
|
|
355
|
+
if (signal.aborted) throw signal.reason;
|
|
354
356
|
try {
|
|
355
|
-
return await attempt();
|
|
357
|
+
return { value: await attempt(), retried };
|
|
356
358
|
} catch (err) {
|
|
357
359
|
if (signal.aborted) throw err;
|
|
358
360
|
if (!isTransientGatewayError(err)) throw err;
|
|
361
|
+
retried = true;
|
|
359
362
|
await pause(intervalMs, signal);
|
|
360
363
|
}
|
|
361
364
|
}
|
|
@@ -381,7 +384,7 @@ function certificationDeadline(timeoutMs, external, label) {
|
|
|
381
384
|
};
|
|
382
385
|
}
|
|
383
386
|
async function awaitProofBounded(deps, transaction, signal) {
|
|
384
|
-
|
|
387
|
+
const { value } = await retryTransient(
|
|
385
388
|
() => (0, import_InclusionProofUtils.waitInclusionProof)(
|
|
386
389
|
deps.client,
|
|
387
390
|
deps.trustBase,
|
|
@@ -393,6 +396,7 @@ async function awaitProofBounded(deps, transaction, signal) {
|
|
|
393
396
|
signal,
|
|
394
397
|
deps.intervalMs
|
|
395
398
|
);
|
|
399
|
+
return value;
|
|
396
400
|
}
|
|
397
401
|
|
|
398
402
|
// token-engine/errors.ts
|
|
@@ -1421,14 +1425,14 @@ var SphereTokenEngine = class {
|
|
|
1421
1425
|
let submitError = null;
|
|
1422
1426
|
let submitRejectedCleanly = false;
|
|
1423
1427
|
try {
|
|
1424
|
-
const response = await retryTransient(
|
|
1428
|
+
const { value: response, retried } = await retryTransient(
|
|
1425
1429
|
() => this.deps.client.submitCertificationRequest(certificationData),
|
|
1426
1430
|
signal,
|
|
1427
1431
|
this.deps.proofPollIntervalMs ?? DEFAULT_PROOF_POLL_INTERVAL_MS
|
|
1428
1432
|
);
|
|
1429
1433
|
if (response.status !== import_CertificationResponse.CertificationStatus.SUCCESS) {
|
|
1430
1434
|
submitError = new SphereError(`${failLabel}: ${response.status}`, failCode);
|
|
1431
|
-
submitRejectedCleanly = CLEAN_REJECT_STATUSES.has(response.status);
|
|
1435
|
+
submitRejectedCleanly = !retried && CLEAN_REJECT_STATUSES.has(response.status);
|
|
1432
1436
|
}
|
|
1433
1437
|
} catch (err) {
|
|
1434
1438
|
submitError = err ?? new SphereError(`${failLabel}: submit failed`, failCode);
|