@unicitylabs/sphere-sdk 0.9.1-dev.11 → 0.9.1-dev.13

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.
@@ -2125,10 +2125,13 @@ declare class PaymentsModule {
2125
2125
  /** Coalesces concurrent payment-request pump runs. */
2126
2126
  private prPumpInFlight;
2127
2127
  /**
2128
- * Set after the once-per-session `status=open` bootstrap scan: the surfaced
2129
- * incoming list is in-memory only, so still-open requests BELOW the
2130
- * persisted cursor must be recovered at session start (bounded by the §5.5
2131
- * per-payer open cap).
2128
+ * Set after the once-per-session full incoming hydration (#556): the surfaced
2129
+ * incoming list is in-memory only, so on a fresh engine the CURRENT state of
2130
+ * ALL incoming requests — open AND resolved (paid/declined/expired) — must be
2131
+ * rebuilt from a `role=incoming&since=0` pull, not just the still-open ones.
2132
+ * A status-filtered bootstrap (the pre-#556 `status=open` scan) dropped
2133
+ * requests resolved in a PRIOR session, so the payer reopened and the
2134
+ * 'Paid Successfully' request was gone (twin of #521/#549).
2132
2135
  */
2133
2136
  private prBootstrapped;
2134
2137
  private loadedPromise;
@@ -2865,20 +2868,44 @@ declare class PaymentsModule {
2865
2868
  * mailbox-cursor pattern: the persisted `{cursor, syncEpoch}` is the resume
2866
2869
  * point; a `syncEpoch` change (server restore — §5.4) voids cursor
2867
2870
  * continuity, so the tail re-pulls from 0 and the id-dedup in
2868
- * {@link surfaceIncomingPaymentRequest} absorbs the replays. Because the
2869
- * surfaced list is in-memory only, each session ALSO starts with one
2870
- * `status=open` bootstrap scan from 0 — still-open requests below the
2871
- * cursor (bounded by the §5.5 per-payer open cap) are recovered; resolved
2872
- * ones are not re-surfaced.
2871
+ * {@link surfaceIncomingPaymentRequest} absorbs the replays.
2872
+ *
2873
+ * Because the surfaced list is in-memory only, each session FIRST runs one
2874
+ * full incoming hydration from `since=0` with NO status filter (#556 —
2875
+ * mirrors {@link hydrateHistoryFromServer}): a fresh engine rebuilds the
2876
+ * CURRENT state of ALL incoming requests — open AND resolved — so a request
2877
+ * paid/declined/expired in a PRIOR session is still present (with its
2878
+ * resolved status) instead of vanishing once the cursor advanced past it.
2879
+ * Hydration NEVER fires the new-incoming handlers/events for resolved
2880
+ * requests — only `open` ones notify (the status-aware
2881
+ * {@link surfaceIncomingPaymentRequest}) — so reopening can't spam stale
2882
+ * 'new request' notifications. After hydration the `since`-cursor delta poll
2883
+ * picks up live updates from the resume point.
2873
2884
  */
2874
2885
  private pumpIncomingPaymentRequests;
2886
+ /**
2887
+ * Decrypt a payment-request's recipient-addressed memo envelope into
2888
+ * `{ memo, senderNametag }` (the requester's message + nametag). The key is
2889
+ * the ECDH shared secret between THIS wallet (the payer) and the requester's
2890
+ * chain pubkey (`wire.fromPubkey`) — symmetric with the requester's
2891
+ * create-time derivation. Returns an empty bundle (and logs at debug) on any
2892
+ * absence/failure so the incoming view never wedges on an unreadable memo
2893
+ * (PR twin of #546/#547).
2894
+ */
2895
+ private decryptPaymentRequestMemo;
2896
+ /** §16 wire status → the public {@link PaymentRequestStatus} display status. */
2897
+ private static readonly PR_WIRE_STATUS;
2875
2898
  /**
2876
2899
  * Map a §16 wire request onto the public {@link IncomingPaymentRequest}
2877
- * surface and notify (event + handlers). Only `open` requests are
2878
- * actionable; the in-memory id-dedup doubles as the replay guard for
2879
- * cursor resets. Multi-asset requests surface their first asset (the
2880
- * module's request surface is single-asset; module-created requests
2881
- * always are).
2900
+ * surface, deduped by id (the in-memory id-dedup doubles as the replay guard
2901
+ * for cursor resets). Requests of EVERY status are surfaced so a reloaded
2902
+ * thin wallet rebuilds the CURRENT state of its incoming view (#556) — open
2903
+ * ones land as actionable `pending`, resolved ones carry their paid/declined
2904
+ * (→ `rejected`)/expired status. Only `open` requests fire the new-incoming
2905
+ * event + handlers; resolved requests are folded into the list silently, so a
2906
+ * reload (or a `syncEpoch` re-pull) never re-notifies for already-resolved
2907
+ * requests. Multi-asset requests surface their first asset (the module's
2908
+ * request surface is single-asset; module-created requests always are).
2882
2909
  */
2883
2910
  private surfaceIncomingPaymentRequest;
2884
2911
  /**
@@ -2125,10 +2125,13 @@ declare class PaymentsModule {
2125
2125
  /** Coalesces concurrent payment-request pump runs. */
2126
2126
  private prPumpInFlight;
2127
2127
  /**
2128
- * Set after the once-per-session `status=open` bootstrap scan: the surfaced
2129
- * incoming list is in-memory only, so still-open requests BELOW the
2130
- * persisted cursor must be recovered at session start (bounded by the §5.5
2131
- * per-payer open cap).
2128
+ * Set after the once-per-session full incoming hydration (#556): the surfaced
2129
+ * incoming list is in-memory only, so on a fresh engine the CURRENT state of
2130
+ * ALL incoming requests — open AND resolved (paid/declined/expired) — must be
2131
+ * rebuilt from a `role=incoming&since=0` pull, not just the still-open ones.
2132
+ * A status-filtered bootstrap (the pre-#556 `status=open` scan) dropped
2133
+ * requests resolved in a PRIOR session, so the payer reopened and the
2134
+ * 'Paid Successfully' request was gone (twin of #521/#549).
2132
2135
  */
2133
2136
  private prBootstrapped;
2134
2137
  private loadedPromise;
@@ -2865,20 +2868,44 @@ declare class PaymentsModule {
2865
2868
  * mailbox-cursor pattern: the persisted `{cursor, syncEpoch}` is the resume
2866
2869
  * point; a `syncEpoch` change (server restore — §5.4) voids cursor
2867
2870
  * continuity, so the tail re-pulls from 0 and the id-dedup in
2868
- * {@link surfaceIncomingPaymentRequest} absorbs the replays. Because the
2869
- * surfaced list is in-memory only, each session ALSO starts with one
2870
- * `status=open` bootstrap scan from 0 — still-open requests below the
2871
- * cursor (bounded by the §5.5 per-payer open cap) are recovered; resolved
2872
- * ones are not re-surfaced.
2871
+ * {@link surfaceIncomingPaymentRequest} absorbs the replays.
2872
+ *
2873
+ * Because the surfaced list is in-memory only, each session FIRST runs one
2874
+ * full incoming hydration from `since=0` with NO status filter (#556 —
2875
+ * mirrors {@link hydrateHistoryFromServer}): a fresh engine rebuilds the
2876
+ * CURRENT state of ALL incoming requests — open AND resolved — so a request
2877
+ * paid/declined/expired in a PRIOR session is still present (with its
2878
+ * resolved status) instead of vanishing once the cursor advanced past it.
2879
+ * Hydration NEVER fires the new-incoming handlers/events for resolved
2880
+ * requests — only `open` ones notify (the status-aware
2881
+ * {@link surfaceIncomingPaymentRequest}) — so reopening can't spam stale
2882
+ * 'new request' notifications. After hydration the `since`-cursor delta poll
2883
+ * picks up live updates from the resume point.
2873
2884
  */
2874
2885
  private pumpIncomingPaymentRequests;
2886
+ /**
2887
+ * Decrypt a payment-request's recipient-addressed memo envelope into
2888
+ * `{ memo, senderNametag }` (the requester's message + nametag). The key is
2889
+ * the ECDH shared secret between THIS wallet (the payer) and the requester's
2890
+ * chain pubkey (`wire.fromPubkey`) — symmetric with the requester's
2891
+ * create-time derivation. Returns an empty bundle (and logs at debug) on any
2892
+ * absence/failure so the incoming view never wedges on an unreadable memo
2893
+ * (PR twin of #546/#547).
2894
+ */
2895
+ private decryptPaymentRequestMemo;
2896
+ /** §16 wire status → the public {@link PaymentRequestStatus} display status. */
2897
+ private static readonly PR_WIRE_STATUS;
2875
2898
  /**
2876
2899
  * Map a §16 wire request onto the public {@link IncomingPaymentRequest}
2877
- * surface and notify (event + handlers). Only `open` requests are
2878
- * actionable; the in-memory id-dedup doubles as the replay guard for
2879
- * cursor resets. Multi-asset requests surface their first asset (the
2880
- * module's request surface is single-asset; module-created requests
2881
- * always are).
2900
+ * surface, deduped by id (the in-memory id-dedup doubles as the replay guard
2901
+ * for cursor resets). Requests of EVERY status are surfaced so a reloaded
2902
+ * thin wallet rebuilds the CURRENT state of its incoming view (#556) — open
2903
+ * ones land as actionable `pending`, resolved ones carry their paid/declined
2904
+ * (→ `rejected`)/expired status. Only `open` requests fire the new-incoming
2905
+ * event + handlers; resolved requests are folded into the list silently, so a
2906
+ * reload (or a `syncEpoch` re-pull) never re-notifies for already-resolved
2907
+ * requests. Multi-asset requests surface their first asset (the module's
2908
+ * request surface is single-asset; module-created requests always are).
2882
2909
  */
2883
2910
  private surfaceIncomingPaymentRequest;
2884
2911
  /**