@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.
@@ -875,16 +875,37 @@ var TransferMachine = class {
875
875
  ...plan.memo !== void 0 ? { memo: plan.memo } : {}
876
876
  };
877
877
  const outcomes = [];
878
+ const certified = [];
878
879
  for (let at = 0; at < plan.ops.length; at += CERTIFY_WIDTH) {
879
880
  const batch = plan.ops.slice(at, at + CERTIFY_WIDTH);
880
881
  const settled = await Promise.all(
881
- batch.map((op) => this.certifyOne(ctx, engine, op, plan.sources.get(op.sourceTokenId)))
882
+ batch.map(
883
+ (op) => this.certifyOne(ctx, engine, op, plan.sources.get(op.sourceTokenId)).then((o) => {
884
+ if (o.certified) {
885
+ certified.push(o);
886
+ this.emitProgress(plan, certified);
887
+ }
888
+ return o;
889
+ })
890
+ )
882
891
  );
883
892
  outcomes.push(...settled);
884
893
  if (settled.some((o) => o.error !== void 0 && !o.certified)) break;
885
894
  }
886
895
  return outcomes;
887
896
  }
897
+ /** In-flight snapshot: `tokenTransfers` holds the legs certified SO FAR. */
898
+ emitProgress(plan, certified) {
899
+ this.deps.emit("transfer:updated", {
900
+ id: plan.transferId,
901
+ status: "submitted",
902
+ tokens: [],
903
+ tokenTransfers: certified.map((o) => ({
904
+ sourceTokenId: o.op.sourceTokenId,
905
+ method: o.op.kind
906
+ }))
907
+ });
908
+ }
888
909
  async certifyOne(ctx, engine, op, source) {
889
910
  if (source === void 0) {
890
911
  return {