@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
|
@@ -823,6 +823,9 @@ function classifyError(e) {
|
|
|
823
823
|
}
|
|
824
824
|
return "other";
|
|
825
825
|
}
|
|
826
|
+
function firstNonConflictError(outcomes) {
|
|
827
|
+
return outcomes.find((o) => o.error !== void 0 && classifyError(o.error) !== "conflict");
|
|
828
|
+
}
|
|
826
829
|
function summarize(outcomes) {
|
|
827
830
|
const committed = outcomes.filter((o) => o.certified);
|
|
828
831
|
const rank = { "keep-open": 3, conflict: 2, other: 1 };
|
|
@@ -883,14 +886,15 @@ var TransferMachine = class {
|
|
|
883
886
|
...r.payload.memo !== void 0 ? { memo: r.payload.memo } : {}
|
|
884
887
|
};
|
|
885
888
|
const outcomes = await this.resumeOps(ctx, engine, r);
|
|
886
|
-
const { committed
|
|
889
|
+
const { committed } = summarize(outcomes);
|
|
887
890
|
const conflicts = this.toConflicts(engine, r, outcomes);
|
|
888
891
|
if (committed.length === 0 && conflicts.length > 0) throw conflicts[0].error;
|
|
889
892
|
let deliveryPending = false;
|
|
890
893
|
if (committed.length > 0) {
|
|
891
894
|
deliveryPending = await this.deliverSet(r.transferId, r.payload.recipient, r.payload.memo, committed);
|
|
892
895
|
}
|
|
893
|
-
|
|
896
|
+
const blocking = firstNonConflictError(outcomes);
|
|
897
|
+
if (blocking !== void 0) throw blocking.error;
|
|
894
898
|
await this.applyCommitted(engine, r.transferId, committed);
|
|
895
899
|
if (conflicts.length > 0) {
|
|
896
900
|
return { deliveryPending, partial: await this.settlePartial(engine, r, committed, conflicts) };
|