@lumiapassport/ui-kit 1.14.0 → 1.14.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/README.md CHANGED
@@ -138,46 +138,13 @@ That's it! The `ConnectWalletButton` provides a complete authentication UI with
138
138
  title: 'Welcome to MyApp',
139
139
  subtitle: 'Sign in to continue',
140
140
 
141
- // beta
142
- dialogClassName: 'string',
141
+ dialogClassName: 'string', // beta
143
142
 
144
143
  authOrder: ['email', 'passkey', 'social'],
145
144
 
146
145
  branding: {
147
146
  tagline: 'Powered by MPC',
148
- link: { text: 'Learn More', url: 'https://example.com/docs' },
149
- },
150
-
151
- // TO BE DEPRECATED, cssv is used
152
- colors: {
153
- dark: {
154
- background: '#060117',
155
- text: '#fefdff',
156
- textSecondary: '#c4c2c7',
157
- textMuted: '#8a8890',
158
- border: '#2a1a3a',
159
- buttonBackground: '#ff6b35',
160
- buttonBackgroundEnd: '#f7931e',
161
- buttonText: '#ffffff',
162
- buttonBackgroundHover: '#e55a2b',
163
- buttonBackgroundHoverEnd: '#d67d1a',
164
- connectedButtonBackground: 'rgba(27, 90, 226, 0.6)',
165
- connectedButtonBorder: '#4a5568'
166
- },
167
- light: {
168
- background: '#fefdff',
169
- text: '#060117',
170
- textSecondary: '#4a4754',
171
- textMuted: '#6b6a70',
172
- border: '#e0dde6',
173
- buttonBackground: '#9333ea',
174
- buttonBackgroundEnd: '#2563eb',
175
- buttonText: '#fefdff',
176
- buttonBackgroundHover: '#7e22ce',
177
- buttonBackgroundHoverEnd: '#1d4ed8',
178
- connectedButtonBackground: '#f3f4f6',
179
- connectedButtonBorder: '#d1d5db'
180
- }
147
+ link: { text: 'Learn More', url: \'https\:\/\/example.com/docs\' },
181
148
  },
182
149
  },
183
150
 
@@ -234,8 +201,8 @@ That's it! The `ConnectWalletButton` provides a complete authentication UI with
234
201
  name: 'Lumia Beam',
235
202
  symbol: 'LUMIA',
236
203
  chainId: 2030232745,
237
- rpcUrl: 'https://beam-rpc.lumia.org',
238
- explorerUrl: 'https://beam-explorer.lumia.org',
204
+ rpcUrl: 'https\:\/\/beam-rpc.lumia.org',
205
+ explorerUrl: 'https\:\/\/beam-explorer.lumia.org',
239
206
  testnet: true,
240
207
  },
241
208
  }}
@@ -15,7 +15,7 @@
15
15
  <meta http-equiv="X-Content-Type-Options" content="nosniff" />
16
16
  <meta http-equiv="Referrer-Policy" content="strict-origin-when-cross-origin" />
17
17
 
18
- <title>Lumia Passport Secure Wallet - iframe version 1.14.0</title>
18
+ <title>Lumia Passport Secure Wallet - iframe version 1.14.2</title>
19
19
 
20
20
  <!-- Styles will be injected by build process -->
21
21
  <style>
@@ -64,8 +64,8 @@
64
64
  /* font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif; */
65
65
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
66
66
 
67
- background: var(--iframe-bg);
68
- backdrop-filter: blur(10px);
67
+ background: #000000;
68
+ /* backdrop-filter: blur(10px); */
69
69
 
70
70
  color: var(--iframe-text);
71
71
 
@@ -84,21 +84,6 @@
84
84
  justify-content: center;
85
85
  }
86
86
 
87
- /* OK */
88
- @keyframes details-open {
89
- from {
90
- max-height: 0;
91
- }
92
- to {
93
- max-height: 148px; /* Adjust as needed based on content size */
94
- }
95
- }
96
-
97
- /* OK */
98
- details[open] > div[data-details-content] {
99
- animation: details-open 300ms ease;
100
- }
101
-
102
87
  /* Ready Indicator START */
103
88
  /* OK */
104
89
  .ready-indicator {
@@ -107,6 +92,7 @@
107
92
  padding: var(--iframe-pd);
108
93
  border-radius: var(--iframe-bdrs);
109
94
  max-width: 320px;
95
+ width: calc(100% - 40px);
110
96
  display: flex;
111
97
  flex-direction: column;
112
98
  align-items: center;
@@ -120,7 +106,6 @@
120
106
  display: flex;
121
107
  align-items: center;
122
108
  justify-content: center;
123
-
124
109
  font-size: 20px;
125
110
  font-weight: 600;
126
111
  width: 64px;
@@ -248,11 +233,11 @@
248
233
  left: 0;
249
234
  right: 0;
250
235
  bottom: 0;
251
- /* background: rgba(0, 0, 0, 0.8); */
252
236
  display: flex;
253
237
  align-items: center;
254
238
  justify-content: center;
255
239
  z-index: 10000;
240
+ backdrop-filter: blur(10px);
256
241
  }
257
242
 
258
243
  .modal-content {
@@ -1267,7 +1267,7 @@ var TemplateEngine = class {
1267
1267
  };
1268
1268
 
1269
1269
  // src/iframe/templates/html/authorization.html
1270
- var authorization_default = '<div class="modal-overlay">\n <div class="modal-content" style="display: flex; flex-direction: column; gap: var(--iframe-gap); align-items: center">\n <div style="display: flex; align-items: center; gap: var(--iframe-gap); justify-content: center">\n <img\n src="./lumia-logo.svg"\n alt="Lumia Passport"\n style="width: 40px; height: 40px; border-radius: 20px; object-fit: cover"\n />\n\n <span\n style="display: block; font-size: var(--iframe-h1-fz); font-weight: var(--iframe-heading-fw); line-height: 150%"\n >Authorize</span\n >\n </div>\n\n <div style="display: flex; align-items: center; gap: var(--iframe-gap); justify-content: center">\n {{#if displayLogo}}\n <img\n src="{{displayLogo}}"\n alt="{{displayName}}"\n style="width: 32px; height: 32px; border-radius: 16px; object-fit: cover"\n />\n {{else}}\n <span style="font-size: 14px; font-weight: 600">{{displayName}}</span>\n {{/if}}\n\n <span\n style="display: block; font-size: var(--iframe-h2-fz); font-weight: var(--iframe-heading-fw); line-height: 150%"\n >{{displayName}}</span\n >\n </div>\n\n <div class="domain-info {{domainStatusClass}}" style="font-size: 12px; text-align: center">\n <span style="font-family: monospace">{{domainStatusIcon}} {{domainStatusText}} {{origin}}</span>\n </div>\n\n <!-- Permissions box -->\n <details style="display: flex; flex-direction: column; width: 100%">\n <summary\n style="\n cursor: pointer;\n text-align: center;\n list-style: none;\n padding: 0 var(--iframe-pd);\n user-select: none;\n font-size: 12px;\n line-height: 20px;\n "\n >\n Show Permissions\n </summary>\n <div\n data-details-content="true"\n style="\n width: 100%;\n padding: var(--iframe-gap);\n border-radius: var(--iframe-el-bdrs);\n background: var(--iframe-info);\n font-size: 10px;\n "\n >\n <div style="margin-bottom: var(--iframe-gap)">\n <strong>{{displayName}}</strong> by <span class="project-owner">{{displayName}}</span> wants to access your\n <strong>Lumia Passport</strong> account\n </div>\n\n <div style="margin-bottom: var(--iframe-gap)">\n <strong style="margin-bottom: var(--iframe-gap)">Personal user data</strong>\n <ul style="list-style: none">\n <li style="padding-left: var(--iframe-pd)">Wallet address (read-only)</li>\n <li style="padding-left: var(--iframe-pd)">Public transaction history (read-only)</li>\n </ul>\n </div>\n\n <div style="width: 100%">\n <strong style="margin-bottom: var(--iframe-gap)">Permissions</strong>\n <ul style="list-style: none">\n <li style="padding-left: var(--iframe-pd)">Request transaction signatures</li>\n <li style="padding-left: var(--iframe-pd)">Initiate blockchain operations</li>\n </ul>\n </div>\n </div>\n </details>\n\n {{#if showSecurityWarning}}\n <div class="security-warning">\n <strong>\u26A0\uFE0F Warning:</strong> This domain is not verified for {{displayName}}\n <div>Expected: {{expectedDomains}}</div>\n <div>Actual: {{origin}}</div>\n </div>\n {{else}}\n <span style="font-size: 10px; color: var(--iframe-text-secondary)"\n >By continuing you allow the app to use these permissions.</span\n >\n {{/if}}\n\n <!-- Action buttons -->\n <div style="display: flex; gap: var(--iframe-gap); width: 100%; align-items: center">\n <button class="cancel-btn">Cancel</button>\n <button class="authorize-btn" {{authorizeButtonState}}>Continue</button>\n </div>\n\n <!-- Footer notice -->\n <div\n style="\n color: var(--iframe-text-secondary);\n font-size: 10px;\n display: flex;\n flex-direction: column;\n gap: 4px;\n align-items: center;\n text-align: center;\n "\n >\n <span>Authorizing will redirect to <strong>{{origin}}</strong></span>\n <span>You can revoke access at any time in your Lumia Passport settings.</span>\n </div>\n </div>\n</div>\n';
1270
+ var authorization_default = '<div\n style="\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n background: #000000;\n "\n>\n <div\n style="\n display: flex;\n flex-direction: column;\n gap: var(--iframe-gap);\n align-items: center;\n background: var(--iframe-modal-bg);\n border-radius: 20px;\n padding: 20px;\n max-width: 320px;\n width: calc(100% - 40px);\n max-height: 90vh;\n overflow-y: auto;\n "\n >\n <div style="display: flex; align-items: center; gap: var(--iframe-gap); justify-content: center">\n {{#if userAvatar}}\n <img\n src="{{userAvatar}}"\n alt="{{userName}}"\n style="width: 48px; height: 48px; border-radius: 24px; object-fit: cover"\n />\n {{else}}\n <span\n style="\n display: flex;\n align-items: center;\n justify-content: center;\n width: 48px;\n height: 48px;\n border-radius: 24px;\n background-color: var(--iframe-button-bg);\n color: var(--iframe-button-text);\n font-size: 14px;\n font-weight: 600;\n "\n >U</span\n >\n {{/if}}\n\n <!-- ------------------------------------------------------------ -->\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n fill="none"\n stroke="var(--iframe-text-secondary)"\n stroke-width="2"\n stroke-linecap="round"\n stroke-linejoin="round"\n >\n <path d="M5 12h14" />\n <path d="m12 5 7 7-7 7" />\n </svg>\n <!-- ------------------------------------------------------------ -->\n\n {{#if displayLogo}}\n <img\n src="{{displayLogo}}"\n alt="{{displayName}}"\n style="width: 48px; height: 48px; border-radius: 24px; object-fit: cover"\n />\n {{else}}\n <span\n style="\n display: flex;\n align-items: center;\n justify-content: center;\n width: 48px;\n height: 48px;\n border-radius: 24px;\n background-color: var(--iframe-button-bg);\n color: var(--iframe-button-text);\n font-size: 14px;\n font-weight: 600;\n "\n >A</span\n >\n {{/if}}\n </div>\n\n <div style="display: flex; align-items: center; gap: var(--iframe-gap); justify-content: center">\n <span\n style="\n width: fit-content;\n font-size: var(--iframe-h2-fz);\n font-weight: var(--iframe-heading-fw);\n line-height: 150%;\n text-align: center;\n "\n >{{displayName}}</span\n >\n </div>\n\n <div class="domain-info {{domainStatusClass}}">\n <span style="display: block; width: 100%; font-size: 12px; text-align: center; font-family: monospace"\n >{{domainStatusIcon}} {{origin}}</span\n >\n </div>\n\n <!-- Permissions box -->\n <div\n id="data-auth-permissions-block"\n aria-expanded="false"\n style="display: flex; flex-direction: column; width: 100%"\n >\n <div\n id="data-auth-permissions-toggler"\n style="\n cursor: pointer;\n text-align: center;\n list-style: none;\n padding: 0 var(--iframe-pd);\n user-select: none;\n font-size: 12px;\n line-height: 20px;\n "\n >\n Show Permissions \u25BC\n </div>\n\n <div\n id="data-auth-permissions-content"\n style="width: 100%; height: var(--iframe-permissions-h, 0); overflow: hidden; transition: height 300ms ease"\n >\n <div\n style="\n width: 100%;\n padding: var(--iframe-gap);\n border-radius: var(--iframe-el-bdrs);\n background: var(--iframe-info);\n font-size: 10px;\n "\n >\n <div style="margin-bottom: var(--iframe-gap)">\n <strong>{{displayName}}</strong> by <span class="project-owner">{{displayName}}</span> wants to access your\n <strong>Lumia Passport</strong> account\n </div>\n\n <div style="margin-bottom: var(--iframe-gap)">\n <strong style="margin-bottom: var(--iframe-gap)">Personal user data</strong>\n <ul style="list-style: none">\n <li style="padding-left: var(--iframe-pd)">Wallet address (read-only)</li>\n <li style="padding-left: var(--iframe-pd)">Public transaction history (read-only)</li>\n </ul>\n </div>\n\n <div style="width: 100%">\n <strong style="margin-bottom: var(--iframe-gap)">Permissions</strong>\n <ul style="list-style: none">\n <li style="padding-left: var(--iframe-pd)">Request transaction signatures</li>\n <li style="padding-left: var(--iframe-pd)">Initiate blockchain operations</li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n\n {{#if showSecurityWarning}}\n <div class="security-warning">\n <strong>\u26A0\uFE0F Warning:</strong> This domain is not verified for {{displayName}}\n <div>Expected: {{expectedDomains}}</div>\n <div>Actual: {{origin}}</div>\n </div>\n {{else}}\n <span style="display: block; text-align: center; font-size: 10px; color: var(--iframe-text-secondary)"\n >By continuing you allow the app to use these permissions, you can revoke access at any time.</span\n >\n {{/if}}\n\n <!-- Action buttons -->\n <div style="display: flex; gap: var(--iframe-gap); width: 100%; align-items: center">\n <button class="cancel-btn">Cancel</button>\n <button class="authorize-btn" {{authorizeButtonState}}>Continue</button>\n </div>\n </div>\n</div>\n';
1271
1271
 
1272
1272
  // src/iframe/templates/html/ready-indicator.html
1273
1273
  var ready_indicator_default = '<div class="ready-indicator">\n <div class="status-icon">\u2713</div>\n <h2>Secure Wallet Ready</h2>\n <p>Lumia Passport is ready for secure operations</p>\n <div class="info">\n <div class="info-row">\n <strong>Origin:</strong>\n <span>{{origin}}</span>\n </div>\n <div class="info-row">\n <strong>Status:</strong>\n <span class="status-active">Active</span>\n </div>\n <div class="info-row">\n <strong>Version:</strong>\n <span>{{iframeVersion}}</span>\n </div>\n <div class="info-row">\n <strong>Documentation:</strong>\n <a\n href="https://docs.lumiapassport.com/"\n target="_blank"\n rel="noopener noreferrer"\n style="color: #667eea; text-decoration: none"\n >docs.lumiapassport.com</a\n >\n </div>\n </div>\n</div>\n';
@@ -2786,6 +2786,15 @@ var DKGManager = class extends TokenRefreshApiClient {
2786
2786
  }
2787
2787
  };
2788
2788
 
2789
+ // src/iframe/lib/onramp/utils.ts
2790
+ function omit(object, ...keys) {
2791
+ const result = { ...object };
2792
+ for (const key of keys) {
2793
+ delete result[key];
2794
+ }
2795
+ return result;
2796
+ }
2797
+
2789
2798
  // src/iframe/lib/onramp/binance.ts
2790
2799
  var API_DOMAIN = "https://api.lumiapassport.com/on-ramp";
2791
2800
  var BinanceOnrampAPI = class {
@@ -2898,7 +2907,7 @@ var BinanceOnrampAPI = class {
2898
2907
  if (!data || typeof data !== "object") {
2899
2908
  throw new Error(`Invalid payload: expected object, got ${typeof data}`);
2900
2909
  }
2901
- const payload = data;
2910
+ const payload = omit(data, "accessToken");
2902
2911
  switch (type) {
2903
2912
  case "methods":
2904
2913
  if (typeof payload.totalAmount !== "string") {
@@ -2956,7 +2965,7 @@ var RampnowOnrampAPI = class {
2956
2965
  async getRampnowConfigQuery(accessToken) {
2957
2966
  const response = await fetch(`${API_DOMAIN2}/api/rampnow/cfg`, {
2958
2967
  method: "GET",
2959
- headers: { ...accessToken && { Authorization: accessToken } }
2968
+ headers: { ...accessToken && { Authorization: `Bearer ${accessToken}` } }
2960
2969
  });
2961
2970
  const data = await response.json();
2962
2971
  return data;
@@ -2964,10 +2973,7 @@ var RampnowOnrampAPI = class {
2964
2973
  async getRampOrderQuoteQuery(payload, accessToken) {
2965
2974
  const response = await fetch(`${API_DOMAIN2}/api/rampnow/quote`, {
2966
2975
  method: "POST",
2967
- headers: {
2968
- "Content-Type": "application/json",
2969
- ...accessToken && { Authorization: accessToken }
2970
- },
2976
+ headers: { "Content-Type": "application/json", ...accessToken && { Authorization: `Bearer ${accessToken}` } },
2971
2977
  body: JSON.stringify(payload)
2972
2978
  });
2973
2979
  const data = await response.json();
@@ -2980,7 +2986,7 @@ var RampnowOnrampAPI = class {
2980
2986
  if (typeof payload !== "object" || payload === null || typeof payload?.paymentMode !== "string" || typeof payload?.srcAmount !== "number" || typeof payload?.walletAddress !== "string") {
2981
2987
  throw new Error("Invalid Ramp order quote payload");
2982
2988
  }
2983
- return payload;
2989
+ return omit(payload, "accessToken");
2984
2990
  }
2985
2991
  // UNUSED due to Rampnow APP redirect order flow
2986
2992
  // async ctreateChekoutOrderMutation(payload: CreateCheckoutOrderMutationPayload) {
@@ -3768,11 +3774,17 @@ var SigningManager = class extends TokenRefreshApiClient {
3768
3774
  }
3769
3775
  let clientState = clientSignStartResult[0];
3770
3776
  const clientMsg1 = clientSignStartResult[1];
3771
- const serverStartResponse = await this.apiCall("POST", `/api/tss/${userId}/sign/start`, {
3772
- sessionId,
3773
- digest32,
3774
- chainPath: CHAIN_PATH
3775
- }, projectId, accessToken);
3777
+ const serverStartResponse = await this.apiCall(
3778
+ "POST",
3779
+ `/api/tss/${userId}/sign/start`,
3780
+ {
3781
+ sessionId,
3782
+ digest32,
3783
+ chainPath: CHAIN_PATH
3784
+ },
3785
+ projectId,
3786
+ accessToken
3787
+ );
3776
3788
  const serverMsg1 = serverStartResponse.msg1;
3777
3789
  if (!serverMsg1?.kind || !serverMsg1.data_b64) {
3778
3790
  throw new Error("Invalid server msg1 format");
@@ -3783,10 +3795,16 @@ var SigningManager = class extends TokenRefreshApiClient {
3783
3795
  );
3784
3796
  clientState = clientR2Result[0];
3785
3797
  const clientMsg2 = clientR2Result[1];
3786
- const serverR2Response = await this.apiCall("POST", `/api/tss/${userId}/sign/round`, {
3787
- sessionId,
3788
- clientMsg: clientMsg1
3789
- }, projectId, accessToken);
3798
+ const serverR2Response = await this.apiCall(
3799
+ "POST",
3800
+ `/api/tss/${userId}/sign/round`,
3801
+ {
3802
+ sessionId,
3803
+ clientMsg: clientMsg1
3804
+ },
3805
+ projectId,
3806
+ accessToken
3807
+ );
3790
3808
  const serverMsg2 = this.extractServerMessage(serverR2Response);
3791
3809
  const clientR3Result = sign_handle(
3792
3810
  JSON.stringify({ bytes_b64: clientState.bytes_b64 }),
@@ -3794,10 +3812,16 @@ var SigningManager = class extends TokenRefreshApiClient {
3794
3812
  );
3795
3813
  clientState = clientR3Result[0];
3796
3814
  const clientMsg3 = clientR3Result[1];
3797
- const serverR3Response = await this.apiCall("POST", `/api/tss/${userId}/sign/round`, {
3798
- sessionId,
3799
- clientMsg: clientMsg2
3800
- }, projectId, accessToken);
3815
+ const serverR3Response = await this.apiCall(
3816
+ "POST",
3817
+ `/api/tss/${userId}/sign/round`,
3818
+ {
3819
+ sessionId,
3820
+ clientMsg: clientMsg2
3821
+ },
3822
+ projectId,
3823
+ accessToken
3824
+ );
3801
3825
  const serverMsg3 = this.extractServerMessage(serverR3Response);
3802
3826
  const clientFinalResult = sign_handle(
3803
3827
  JSON.stringify({ bytes_b64: clientState.bytes_b64 }),
@@ -3807,10 +3831,16 @@ var SigningManager = class extends TokenRefreshApiClient {
3807
3831
  throw new Error("Invalid final sign_handle result");
3808
3832
  }
3809
3833
  const clientSignature = clientFinalResult[2];
3810
- await this.apiCall("POST", `/api/tss/${userId}/sign/round`, {
3811
- sessionId,
3812
- clientMsg: clientMsg3
3813
- }, projectId, accessToken);
3834
+ await this.apiCall(
3835
+ "POST",
3836
+ `/api/tss/${userId}/sign/round`,
3837
+ {
3838
+ sessionId,
3839
+ clientMsg: clientMsg3
3840
+ },
3841
+ projectId,
3842
+ accessToken
3843
+ );
3814
3844
  const signature = this.formatSignature(clientSignature);
3815
3845
  return signature;
3816
3846
  }
@@ -3821,7 +3851,16 @@ var SigningManager = class extends TokenRefreshApiClient {
3821
3851
  this.showIframe();
3822
3852
  const metadata = await this.fetchProjectMetadata(projectId);
3823
3853
  return new Promise((resolve) => {
3824
- const modal = this.createConfirmationModal(userId, projectId, project, origin, transaction, risk, metadata, userProfile);
3854
+ const modal = this.createConfirmationModal(
3855
+ userId,
3856
+ projectId,
3857
+ project,
3858
+ origin,
3859
+ transaction,
3860
+ risk,
3861
+ metadata,
3862
+ userProfile
3863
+ );
3825
3864
  const confirmBtn = modal.querySelector(".confirm-btn");
3826
3865
  const cancelBtn = modal.querySelector(".cancel-btn");
3827
3866
  const trustCheckbox = modal.querySelector(".trust-app-checkbox");
@@ -4056,7 +4095,12 @@ var SigningManager = class extends TokenRefreshApiClient {
4056
4095
  * Sign EIP712 typed data with user confirmation
4057
4096
  */
4058
4097
  async signTypedData(userId, projectId, origin, typedData, digest32, accessToken, userProfile) {
4059
- console.log("[iframe][Sign] EIP712 signing request:", { userId, projectId, origin, primaryType: typedData.primaryType });
4098
+ console.log("[iframe][Sign] EIP712 signing request:", {
4099
+ userId,
4100
+ projectId,
4101
+ origin,
4102
+ primaryType: typedData.primaryType
4103
+ });
4060
4104
  await this.initialize();
4061
4105
  const projectInfo = {
4062
4106
  id: projectId,
@@ -4097,7 +4141,15 @@ var SigningManager = class extends TokenRefreshApiClient {
4097
4141
  this.showIframe();
4098
4142
  const metadata = await this.fetchProjectMetadata(projectId);
4099
4143
  return new Promise((resolve) => {
4100
- const modal = this.createEIP712ConfirmationModal(userId, projectId, project, origin, typedData, metadata, userProfile);
4144
+ const modal = this.createEIP712ConfirmationModal(
4145
+ userId,
4146
+ projectId,
4147
+ project,
4148
+ origin,
4149
+ typedData,
4150
+ metadata,
4151
+ userProfile
4152
+ );
4101
4153
  const confirmBtn = modal.querySelector(".confirm-btn");
4102
4154
  const cancelBtn = modal.querySelector(".cancel-btn");
4103
4155
  const trustCheckbox = modal.querySelector(".trust-app-checkbox");
@@ -4138,18 +4190,22 @@ var SigningManager = class extends TokenRefreshApiClient {
4138
4190
  }
4139
4191
  return String(value);
4140
4192
  };
4141
- const messageFields = Object.entries(typedData.message).map(([key, value]) => `
4193
+ const messageFields = Object.entries(typedData.message).map(
4194
+ ([key, value]) => `
4142
4195
  <div class="eip712-field">
4143
4196
  <div class="field-name">${key}:</div>
4144
4197
  <div class="field-value">${formatFieldValue(value)}</div>
4145
4198
  </div>
4146
- `).join("");
4147
- const domainFields = Object.entries(typedData.domain).filter(([_, value]) => value !== void 0).map(([key, value]) => `
4199
+ `
4200
+ ).join("");
4201
+ const domainFields = Object.entries(typedData.domain).filter(([_, value]) => value !== void 0).map(
4202
+ ([key, value]) => `
4148
4203
  <div class="eip712-field">
4149
4204
  <div class="field-name">${key}:</div>
4150
4205
  <div class="field-value">${formatFieldValue(value)}</div>
4151
4206
  </div>
4152
- `).join("");
4207
+ `
4208
+ ).join("");
4153
4209
  modal.innerHTML = `
4154
4210
  <div class="modal-overlay">
4155
4211
  <div class="modal-content eip712-modal">
@@ -4230,7 +4286,7 @@ var SigningManager = class extends TokenRefreshApiClient {
4230
4286
  };
4231
4287
 
4232
4288
  // src/iframe/main.ts
4233
- var IFRAME_VERSION = "1.14.0";
4289
+ var IFRAME_VERSION = "1.14.2";
4234
4290
  var IframeWallet = class {
4235
4291
  constructor() {
4236
4292
  console.log("=".repeat(60));
@@ -4247,34 +4303,6 @@ var IframeWallet = class {
4247
4303
  this.binance = new BinanceOnrampAPI(this.messenger.sendResponse.bind(this.messenger));
4248
4304
  this.rampnow = new RampnowOnrampAPI(this.messenger.sendResponse.bind(this.messenger));
4249
4305
  }
4250
- // private applyThemeColors(): void {
4251
- // try {
4252
- // const params = new URLSearchParams(window.location.search)
4253
- // const bg = params.get('bg')
4254
- // const text = params.get('text')
4255
- // const textSec = params.get('textSec')
4256
- // const border = params.get('border')
4257
- // if (bg || text || textSec || border) {
4258
- // const root = document.documentElement
4259
- // if (bg) {
4260
- // root.style.setProperty('--iframe-bg', bg)
4261
- // root.style.setProperty('--iframe-modal-bg', bg)
4262
- // }
4263
- // if (text) {
4264
- // root.style.setProperty('--iframe-text', text)
4265
- // }
4266
- // if (textSec) {
4267
- // root.style.setProperty('--iframe-text-secondary', textSec)
4268
- // }
4269
- // if (border) {
4270
- // root.style.setProperty('--iframe-border', border)
4271
- // }
4272
- // console.log('[IframeWallet] Applied theme colors:', { bg, text, textSec, border })
4273
- // }
4274
- // } catch (error) {
4275
- // console.warn('[IframeWallet] Failed to apply theme colors:', error)
4276
- // }
4277
- // }
4278
4306
  async initialize() {
4279
4307
  if (window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1" && !window.location.hostname.includes("lumiapassport.com")) {
4280
4308
  console.warn("[iframe] \u26A0\uFE0F Running on unexpected origin!");
@@ -4910,6 +4938,22 @@ var IframeWallet = class {
4910
4938
  this.displayReadyIndicator();
4911
4939
  }
4912
4940
  };
4941
+ function toggleAuthPermissions(e) {
4942
+ const isToggler = e.target.id === "data-auth-permissions-toggler";
4943
+ if (!isToggler) return;
4944
+ const details = document.getElementById("data-auth-permissions-block");
4945
+ const isOpen = details.hasAttribute("aria-expanded") && details.getAttribute("aria-expanded") === "true";
4946
+ const toggler = details.querySelector("#data-auth-permissions-toggler");
4947
+ if (isOpen) {
4948
+ details.setAttribute("aria-expanded", "false");
4949
+ details.style.setProperty("--iframe-permissions-h", "0px");
4950
+ toggler.innerHTML = "Show Permissions \u25BC";
4951
+ } else {
4952
+ details.setAttribute("aria-expanded", "true");
4953
+ details.style.setProperty("--iframe-permissions-h", "148px");
4954
+ toggler.innerHTML = "Hide Permissions \u25B2";
4955
+ }
4956
+ }
4913
4957
  function initWallet() {
4914
4958
  const wallet = new IframeWallet();
4915
4959
  wallet.initialize().catch((error) => {
@@ -4925,6 +4969,7 @@ function initWallet() {
4925
4969
  `;
4926
4970
  }
4927
4971
  });
4972
+ document.addEventListener("click", toggleAuthPermissions);
4928
4973
  }
4929
4974
  if (document.readyState === "loading") {
4930
4975
  document.addEventListener("DOMContentLoaded", initWallet);