@unicitylabs/sphere-sdk 0.14.6 → 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
|
@@ -778,6 +778,9 @@ function classifyError(e) {
|
|
|
778
778
|
}
|
|
779
779
|
return "other";
|
|
780
780
|
}
|
|
781
|
+
function firstNonConflictError(outcomes) {
|
|
782
|
+
return outcomes.find((o) => o.error !== void 0 && classifyError(o.error) !== "conflict");
|
|
783
|
+
}
|
|
781
784
|
function summarize(outcomes) {
|
|
782
785
|
const committed = outcomes.filter((o) => o.certified);
|
|
783
786
|
const rank = { "keep-open": 3, conflict: 2, other: 1 };
|
|
@@ -838,14 +841,15 @@ var TransferMachine = class {
|
|
|
838
841
|
...r.payload.memo !== void 0 ? { memo: r.payload.memo } : {}
|
|
839
842
|
};
|
|
840
843
|
const outcomes = await this.resumeOps(ctx, engine, r);
|
|
841
|
-
const { committed
|
|
844
|
+
const { committed } = summarize(outcomes);
|
|
842
845
|
const conflicts = this.toConflicts(engine, r, outcomes);
|
|
843
846
|
if (committed.length === 0 && conflicts.length > 0) throw conflicts[0].error;
|
|
844
847
|
let deliveryPending = false;
|
|
845
848
|
if (committed.length > 0) {
|
|
846
849
|
deliveryPending = await this.deliverSet(r.transferId, r.payload.recipient, r.payload.memo, committed);
|
|
847
850
|
}
|
|
848
|
-
|
|
851
|
+
const blocking = firstNonConflictError(outcomes);
|
|
852
|
+
if (blocking !== void 0) throw blocking.error;
|
|
849
853
|
await this.applyCommitted(engine, r.transferId, committed);
|
|
850
854
|
if (conflicts.length > 0) {
|
|
851
855
|
return { deliveryPending, partial: await this.settlePartial(engine, r, committed, conflicts) };
|