@unicitylabs/sphere-sdk 0.14.1-dev.1 → 0.14.1-dev.2

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.
Files changed (47) hide show
  1. package/dist/connect/index.cjs +20 -5
  2. package/dist/connect/index.cjs.map +1 -1
  3. package/dist/connect/index.d.cts +0 -1
  4. package/dist/connect/index.d.ts +0 -1
  5. package/dist/connect/index.js +20 -5
  6. package/dist/connect/index.js.map +1 -1
  7. package/dist/core/index.cjs +395 -213
  8. package/dist/core/index.cjs.map +1 -1
  9. package/dist/core/index.d.cts +10 -3
  10. package/dist/core/index.d.ts +10 -3
  11. package/dist/core/index.js +395 -213
  12. package/dist/core/index.js.map +1 -1
  13. package/dist/impl/browser/connect/index.cjs +10 -2
  14. package/dist/impl/browser/connect/index.cjs.map +1 -1
  15. package/dist/impl/browser/connect/index.d.cts +0 -1
  16. package/dist/impl/browser/connect/index.d.ts +0 -1
  17. package/dist/impl/browser/connect/index.js +10 -2
  18. package/dist/impl/browser/connect/index.js.map +1 -1
  19. package/dist/impl/nodejs/connect/index.cjs +9 -1
  20. package/dist/impl/nodejs/connect/index.cjs.map +1 -1
  21. package/dist/impl/nodejs/connect/index.d.cts +0 -1
  22. package/dist/impl/nodejs/connect/index.d.ts +0 -1
  23. package/dist/impl/nodejs/connect/index.js +9 -1
  24. package/dist/impl/nodejs/connect/index.js.map +1 -1
  25. package/dist/impl/nodejs/index.d.cts +8 -1
  26. package/dist/impl/nodejs/index.d.ts +8 -1
  27. package/dist/impl/shared/wallet-api/index.d.cts +8 -1
  28. package/dist/impl/shared/wallet-api/index.d.ts +8 -1
  29. package/dist/impl/wallet-api-v2/index.cjs +38 -5
  30. package/dist/impl/wallet-api-v2/index.cjs.map +1 -1
  31. package/dist/impl/wallet-api-v2/index.d.cts +23 -2
  32. package/dist/impl/wallet-api-v2/index.d.ts +23 -2
  33. package/dist/impl/wallet-api-v2/index.js +38 -5
  34. package/dist/impl/wallet-api-v2/index.js.map +1 -1
  35. package/dist/index.cjs +395 -213
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.d.cts +10 -3
  38. package/dist/index.d.ts +10 -3
  39. package/dist/index.js +395 -213
  40. package/dist/index.js.map +1 -1
  41. package/dist/modules/payments-v2/index.cjs +340 -199
  42. package/dist/modules/payments-v2/index.cjs.map +1 -1
  43. package/dist/modules/payments-v2/index.d.cts +68 -19
  44. package/dist/modules/payments-v2/index.d.ts +68 -19
  45. package/dist/modules/payments-v2/index.js +339 -199
  46. package/dist/modules/payments-v2/index.js.map +1 -1
  47. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -638,8 +638,8 @@ interface SphereEventMap {
638
638
  };
639
639
  /** The wallet-api inventory mirror changed — re-read tokens()/assets(). */
640
640
  'inventory:updated': Record<string, never>;
641
- /** History changed — re-read via history(). */
642
- 'history:updated': Record<string, never>;
641
+ /** History changed — carries the just-recorded client-shaped entry (same toEntry mapping history() serves). */
642
+ 'history:updated': HistoryEntry;
643
643
  'payment_request:incoming': PaymentRequestView;
644
644
  'payment_request:updated': {
645
645
  id: string;
@@ -2290,6 +2290,14 @@ interface FacadeSession {
2290
2290
  start(): Promise<void>;
2291
2291
  stop(): Promise<void>;
2292
2292
  subscribeStream(stream: 'inventory' | 'mailbox' | 'payment_requests', handler: () => void): () => void;
2293
+ /** §5.1: the latched server syncEpoch ('' before first server contact). */
2294
+ currentEpoch(): string;
2295
+ /**
2296
+ * §5.1 restore hook — REQUIRED so an unwired restore protocol is a COMPILE
2297
+ * ERROR: handlers run and are AWAITED on a syncEpoch change BEFORE any
2298
+ * stream nudge resumes. The facade registers handleEpochChange here.
2299
+ */
2300
+ subscribeEpochChange(handler: (epoch: string) => Promise<void>): () => void;
2293
2301
  /**
2294
2302
  * Optional connection-status feed (same wiring pattern as the streams; the
2295
2303
  * emission point is the session's existing `connection:status` transition).
@@ -2593,7 +2601,6 @@ interface PaymentsV2TransportArgs {
2593
2601
  /** Per-(network, address) scoped KV — refresh token, cursors, seen-set live here. */
2594
2602
  kv: ScopedKV;
2595
2603
  emitStatus: (status: ConnectionStatus) => void;
2596
- onEpochChange: (epoch: string) => Promise<void>;
2597
2604
  }
2598
2605
  /**
2599
2606
  * The `Sphere.init({ walletApi })` transport config — built by
package/dist/index.d.ts CHANGED
@@ -638,8 +638,8 @@ interface SphereEventMap {
638
638
  };
639
639
  /** The wallet-api inventory mirror changed — re-read tokens()/assets(). */
640
640
  'inventory:updated': Record<string, never>;
641
- /** History changed — re-read via history(). */
642
- 'history:updated': Record<string, never>;
641
+ /** History changed — carries the just-recorded client-shaped entry (same toEntry mapping history() serves). */
642
+ 'history:updated': HistoryEntry;
643
643
  'payment_request:incoming': PaymentRequestView;
644
644
  'payment_request:updated': {
645
645
  id: string;
@@ -2290,6 +2290,14 @@ interface FacadeSession {
2290
2290
  start(): Promise<void>;
2291
2291
  stop(): Promise<void>;
2292
2292
  subscribeStream(stream: 'inventory' | 'mailbox' | 'payment_requests', handler: () => void): () => void;
2293
+ /** §5.1: the latched server syncEpoch ('' before first server contact). */
2294
+ currentEpoch(): string;
2295
+ /**
2296
+ * §5.1 restore hook — REQUIRED so an unwired restore protocol is a COMPILE
2297
+ * ERROR: handlers run and are AWAITED on a syncEpoch change BEFORE any
2298
+ * stream nudge resumes. The facade registers handleEpochChange here.
2299
+ */
2300
+ subscribeEpochChange(handler: (epoch: string) => Promise<void>): () => void;
2293
2301
  /**
2294
2302
  * Optional connection-status feed (same wiring pattern as the streams; the
2295
2303
  * emission point is the session's existing `connection:status` transition).
@@ -2593,7 +2601,6 @@ interface PaymentsV2TransportArgs {
2593
2601
  /** Per-(network, address) scoped KV — refresh token, cursors, seen-set live here. */
2594
2602
  kv: ScopedKV;
2595
2603
  emitStatus: (status: ConnectionStatus) => void;
2596
- onEpochChange: (epoch: string) => Promise<void>;
2597
2604
  }
2598
2605
  /**
2599
2606
  * The `Sphere.init({ walletApi })` transport config — built by