@lumiapassport/ui-kit 1.3.0 → 1.3.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.
@@ -3797,6 +3797,12 @@ var IframeWallet = class {
3797
3797
  origin
3798
3798
  );
3799
3799
  console.log(`[iframe] \u2705 User authenticated: ${userId}`);
3800
+ if (this.storage.hasKeyshare(userId)) {
3801
+ console.log(`[iframe] \u2139\uFE0F User has existing keyshare, sending WALLET_READY`);
3802
+ this.sendWalletReadyStatus(userId, origin);
3803
+ } else {
3804
+ console.log(`[iframe] \u2139\uFE0F User needs DKG or restore to create/recover keyshare`);
3805
+ }
3800
3806
  }
3801
3807
  async handleStartDKG(message, origin) {
3802
3808
  const { sessionToken, userId, projectId, accessToken } = message.data;
@@ -3827,6 +3833,7 @@ var IframeWallet = class {
3827
3833
  origin
3828
3834
  );
3829
3835
  console.log(`[iframe] \u2705 DKG completed: ${result.ownerAddress}`);
3836
+ this.sendWalletReadyStatus(userId, origin);
3830
3837
  } catch (error) {
3831
3838
  this.hideLoadingIndicator();
3832
3839
  throw error;
@@ -4050,6 +4057,7 @@ var IframeWallet = class {
4050
4057
  origin
4051
4058
  );
4052
4059
  console.log(`[iframe] \u2705 RESTORE_BACKUP: Backup restored successfully`);
4060
+ this.sendWalletReadyStatus(userId, origin);
4053
4061
  } catch (error) {
4054
4062
  console.error("[iframe] RESTORE_BACKUP: Exception:", error);
4055
4063
  this.messenger.sendResponse(
@@ -4103,6 +4111,7 @@ var IframeWallet = class {
4103
4111
  origin
4104
4112
  );
4105
4113
  console.log(`[iframe] \u2705 RESTORE_FROM_FILE: File restored successfully`);
4114
+ this.sendWalletReadyStatus(userId, origin);
4106
4115
  } catch (error) {
4107
4116
  console.error("[iframe] RESTORE_FROM_FILE: Exception:", error);
4108
4117
  this.messenger.sendResponse(
@@ -4173,6 +4182,34 @@ var IframeWallet = class {
4173
4182
  </div>
4174
4183
  `;
4175
4184
  }
4185
+ /**
4186
+ * Send wallet ready status to parent
4187
+ * This notifies the frontend that the wallet is fully initialized and ready to sign
4188
+ */
4189
+ sendWalletReadyStatus(userId, origin) {
4190
+ const hasKeyshare = this.storage.hasKeyshare(userId);
4191
+ const address = hasKeyshare ? this.storage.getOwnerAddress(userId) : void 0;
4192
+ const hasSession = this.sessionManager.hasSession(origin);
4193
+ const status = {
4194
+ ready: hasKeyshare && hasSession,
4195
+ userId,
4196
+ address,
4197
+ hasKeyshare,
4198
+ hasSession,
4199
+ timestamp: Date.now()
4200
+ };
4201
+ console.log("[iframe] \u{1F4E4} Sending WALLET_READY status:", status);
4202
+ if (window.parent) {
4203
+ window.parent.postMessage(
4204
+ {
4205
+ type: "LUMIA_PASSPORT_WALLET_READY",
4206
+ data: status,
4207
+ timestamp: Date.now()
4208
+ },
4209
+ origin
4210
+ );
4211
+ }
4212
+ }
4176
4213
  displayLoadingIndicator(message) {
4177
4214
  const app = document.getElementById("app");
4178
4215
  if (!app) return;