@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.
@@ -920,16 +920,37 @@ var TransferMachine = class {
920
920
  ...plan.memo !== void 0 ? { memo: plan.memo } : {}
921
921
  };
922
922
  const outcomes = [];
923
+ const certified = [];
923
924
  for (let at = 0; at < plan.ops.length; at += CERTIFY_WIDTH) {
924
925
  const batch = plan.ops.slice(at, at + CERTIFY_WIDTH);
925
926
  const settled = await Promise.all(
926
- batch.map((op) => this.certifyOne(ctx, engine, op, plan.sources.get(op.sourceTokenId)))
927
+ batch.map(
928
+ (op) => this.certifyOne(ctx, engine, op, plan.sources.get(op.sourceTokenId)).then((o) => {
929
+ if (o.certified) {
930
+ certified.push(o);
931
+ this.emitProgress(plan, certified);
932
+ }
933
+ return o;
934
+ })
935
+ )
927
936
  );
928
937
  outcomes.push(...settled);
929
938
  if (settled.some((o) => o.error !== void 0 && !o.certified)) break;
930
939
  }
931
940
  return outcomes;
932
941
  }
942
+ /** In-flight snapshot: `tokenTransfers` holds the legs certified SO FAR. */
943
+ emitProgress(plan, certified) {
944
+ this.deps.emit("transfer:updated", {
945
+ id: plan.transferId,
946
+ status: "submitted",
947
+ tokens: [],
948
+ tokenTransfers: certified.map((o) => ({
949
+ sourceTokenId: o.op.sourceTokenId,
950
+ method: o.op.kind
951
+ }))
952
+ });
953
+ }
933
954
  async certifyOne(ctx, engine, op, source) {
934
955
  if (source === void 0) {
935
956
  return {