@unicitylabs/sphere-sdk 0.14.7 → 0.14.8-dev.1

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.
@@ -11541,16 +11541,37 @@ var TransferMachine = class {
11541
11541
  ...plan.memo !== void 0 ? { memo: plan.memo } : {}
11542
11542
  };
11543
11543
  const outcomes = [];
11544
+ const certified = [];
11544
11545
  for (let at = 0; at < plan.ops.length; at += CERTIFY_WIDTH) {
11545
11546
  const batch = plan.ops.slice(at, at + CERTIFY_WIDTH);
11546
11547
  const settled = await Promise.all(
11547
- batch.map((op) => this.certifyOne(ctx, engine, op, plan.sources.get(op.sourceTokenId)))
11548
+ batch.map(
11549
+ (op) => this.certifyOne(ctx, engine, op, plan.sources.get(op.sourceTokenId)).then((o) => {
11550
+ if (o.certified) {
11551
+ certified.push(o);
11552
+ this.emitProgress(plan, certified);
11553
+ }
11554
+ return o;
11555
+ })
11556
+ )
11548
11557
  );
11549
11558
  outcomes.push(...settled);
11550
11559
  if (settled.some((o) => o.error !== void 0 && !o.certified)) break;
11551
11560
  }
11552
11561
  return outcomes;
11553
11562
  }
11563
+ /** In-flight snapshot: `tokenTransfers` holds the legs certified SO FAR. */
11564
+ emitProgress(plan, certified) {
11565
+ this.deps.emit("transfer:updated", {
11566
+ id: plan.transferId,
11567
+ status: "submitted",
11568
+ tokens: [],
11569
+ tokenTransfers: certified.map((o) => ({
11570
+ sourceTokenId: o.op.sourceTokenId,
11571
+ method: o.op.kind
11572
+ }))
11573
+ });
11574
+ }
11554
11575
  async certifyOne(ctx, engine, op, source) {
11555
11576
  if (source === void 0) {
11556
11577
  return {