@partylayer/sdk 0.13.0 → 0.13.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.
package/dist/index.d.mts CHANGED
@@ -340,6 +340,13 @@ declare class PartyLayerClient {
340
340
  private readonly warmPlans;
341
341
  private eventHandlers;
342
342
  private activeSession;
343
+ /**
344
+ * True when `activeSession` was revived AS-IS (no live `status()` probe) because
345
+ * its adapter wasn't registered yet at restore time (the lazy configured-announce
346
+ * case). Cleared once a live probe validates it (or on fresh connect). When set,
347
+ * `aggregateAnnouncedWallets` re-probes the session the moment that adapter is born.
348
+ */
349
+ private activeSessionNeedsProbe;
343
350
  readonly registryClient: RegistryClient;
344
351
  private logger;
345
352
  private crypto;
package/dist/index.d.ts CHANGED
@@ -340,6 +340,13 @@ declare class PartyLayerClient {
340
340
  private readonly warmPlans;
341
341
  private eventHandlers;
342
342
  private activeSession;
343
+ /**
344
+ * True when `activeSession` was revived AS-IS (no live `status()` probe) because
345
+ * its adapter wasn't registered yet at restore time (the lazy configured-announce
346
+ * case). Cleared once a live probe validates it (or on fresh connect). When set,
347
+ * `aggregateAnnouncedWallets` re-probes the session the moment that adapter is born.
348
+ */
349
+ private activeSessionNeedsProbe;
343
350
  readonly registryClient: RegistryClient;
344
351
  private logger;
345
352
  private crypto;
package/dist/index.js CHANGED
@@ -522,10 +522,11 @@ function getBuiltinAdapters() {
522
522
  // 5N Loop - QR code / popup
523
523
  new adapterCantor8.Cantor8Adapter(),
524
524
  // Cantor8 - deep link transport
525
- new adapterNightly.NightlyAdapter(),
525
+ new adapterNightly.NightlyAdapter()
526
526
  // Nightly - multichain wallet (injected)
527
- new adapterSend.SendAdapter()
528
- // Send - passkey-based, kernel.id-guarded window.canton
527
+ // Send is served via the generic CIP-0103 announce path (registry
528
+ // transport:'announce') — no longer in defaults; SendAdapter stays exported
529
+ // below for opt-in manual/bespoke use.
529
530
  ];
530
531
  }
531
532
  var SDK_VERSION = "0.3.0";
@@ -744,6 +745,13 @@ var PartyLayerClient = class {
744
745
  warmPlans = /* @__PURE__ */ new Map();
745
746
  eventHandlers = /* @__PURE__ */ new Map();
746
747
  activeSession = null;
748
+ /**
749
+ * True when `activeSession` was revived AS-IS (no live `status()` probe) because
750
+ * its adapter wasn't registered yet at restore time (the lazy configured-announce
751
+ * case). Cleared once a live probe validates it (or on fresh connect). When set,
752
+ * `aggregateAnnouncedWallets` re-probes the session the moment that adapter is born.
753
+ */
754
+ activeSessionNeedsProbe = false;
747
755
  registryClient;
748
756
  // Expose for React hooks
749
757
  logger;
@@ -1023,6 +1031,28 @@ var PartyLayerClient = class {
1023
1031
  config: deriveAnnounceConfig(entry)
1024
1032
  });
1025
1033
  this.adapters.set(configured.walletId, configured);
1034
+ const active = this.activeSession;
1035
+ if (active && this.activeSessionNeedsProbe && active.walletId === configured.walletId && configured.restore) {
1036
+ try {
1037
+ const reprobed = await configured.restore(this.createAdapterContext(), {
1038
+ ...active,
1039
+ encrypted: ""
1040
+ });
1041
+ if (reprobed) {
1042
+ this.activeSession = reprobed;
1043
+ this.activeSessionNeedsProbe = false;
1044
+ await this.persistSession(reprobed);
1045
+ this.emit("session:connected", { type: "session:connected", session: reprobed });
1046
+ } else {
1047
+ await this.removeSession(active.sessionId);
1048
+ this.activeSession = null;
1049
+ this.activeSessionNeedsProbe = false;
1050
+ this.emit("session:expired", { type: "session:expired", sessionId: active.sessionId });
1051
+ }
1052
+ } catch (err) {
1053
+ this.logger.warn("Restore re-probe failed; leaving session as-is", err);
1054
+ }
1055
+ }
1026
1056
  }
1027
1057
  } catch {
1028
1058
  }
@@ -1249,6 +1279,7 @@ var PartyLayerClient = class {
1249
1279
  }
1250
1280
  await this.persistSession(session);
1251
1281
  this.activeSession = session;
1282
+ this.activeSessionNeedsProbe = false;
1252
1283
  this.updateRegistryStatus();
1253
1284
  this.telemetry?.increment?.(core.METRICS.WALLET_CONNECT_SUCCESS);
1254
1285
  this.telemetry?.increment?.(core.METRICS.SESSIONS_CREATED);
@@ -1639,6 +1670,7 @@ var PartyLayerClient = class {
1639
1670
  });
1640
1671
  if (restored) {
1641
1672
  this.activeSession = restored;
1673
+ this.activeSessionNeedsProbe = false;
1642
1674
  await this.persistSession(restored);
1643
1675
  this.telemetry?.increment?.(core.METRICS.SESSIONS_RESTORED);
1644
1676
  this.telemetry?.increment?.(core.METRICS.WALLET_CONNECT_SUCCESS);
@@ -1657,6 +1689,7 @@ var PartyLayerClient = class {
1657
1689
  }
1658
1690
  }
1659
1691
  this.activeSession = session;
1692
+ this.activeSessionNeedsProbe = true;
1660
1693
  return session;
1661
1694
  } catch (err) {
1662
1695
  this.logger.warn("Failed to restore session", err);