@lumiapassport/ui-kit 1.3.0 → 1.3.1
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/iframe/main.js +31 -0
- package/dist/iframe/main.js.map +1 -1
- package/dist/index.cjs +12 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -1
- package/dist/index.d.ts +26 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -121,6 +121,14 @@ interface LumiaPassportConfig {
|
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
interface WalletReadyStatus$1 {
|
|
125
|
+
ready: boolean;
|
|
126
|
+
userId?: string;
|
|
127
|
+
address?: `0x${string}`;
|
|
128
|
+
hasKeyshare: boolean;
|
|
129
|
+
hasSession: boolean;
|
|
130
|
+
timestamp: number;
|
|
131
|
+
}
|
|
124
132
|
interface LumiaPassportCallbacks {
|
|
125
133
|
onLumiaPassportConnecting?: (payload: {
|
|
126
134
|
method: 'passkey' | 'email' | 'social' | 'wallet';
|
|
@@ -148,6 +156,7 @@ interface LumiaPassportCallbacks {
|
|
|
148
156
|
code?: string;
|
|
149
157
|
message: string;
|
|
150
158
|
}) => void;
|
|
159
|
+
onWalletReady?: (status: WalletReadyStatus$1) => void;
|
|
151
160
|
}
|
|
152
161
|
interface LumiaPassportContextType {
|
|
153
162
|
config: LumiaPassportConfig;
|
|
@@ -812,4 +821,20 @@ declare function useLumiaPassportLinkedProfiles(): {
|
|
|
812
821
|
readonly refresh: () => Promise<void>;
|
|
813
822
|
};
|
|
814
823
|
|
|
815
|
-
|
|
824
|
+
/**
|
|
825
|
+
* Iframe Manager for Parent SDK
|
|
826
|
+
*
|
|
827
|
+
* Manages secure communication with the isolated iframe wallet at auth.lumiapassport.com
|
|
828
|
+
* Implements postMessage protocol with HMAC authentication and replay protection
|
|
829
|
+
*/
|
|
830
|
+
|
|
831
|
+
interface WalletReadyStatus {
|
|
832
|
+
ready: boolean;
|
|
833
|
+
userId?: string;
|
|
834
|
+
address?: `0x${string}`;
|
|
835
|
+
hasKeyshare: boolean;
|
|
836
|
+
hasSession: boolean;
|
|
837
|
+
timestamp: number;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
export { type AccountSession$1 as AccountSession, Address, type AddressProps, type Asset, ConnectWalletButton, type ConnectWalletButtonProps, Hash, type HashProps, KeyshareBackup, LUMIA_EXPLORER_URL, LumiaLogo, type LumiaPassportCallbacks, type LumiaPassportConfig, LumiaPassportProvider, type LumiaPassportProviderProps, LumiaRainbowKitProvider, type LumiaRainbowKitProviderProps, LumiaSessionProvider, type LumiaSessionProviderProps, LumiaWagmiProvider, type SendTransactionParams, type SendTransactionResult, type Theme, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type UpdateProfileRequest, type UseSendTransactionReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UserOpMempool, type UserOpReceipt, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserProfile, type WalletReadyStatus, getUserProfile, lumiaBeam, prepareUserOperation, queryClient, sendUserOperation, updateUserProfile, useAssets, useLumiaPassportConfig, useLumiaPassportLinkedProfiles, useLumiaSession, useSendTransaction, useSmartAccountTransactions, useTheme, useTokenBalance, useTokenInfo, useTransactions, useUserOpStatus, wagmiConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -121,6 +121,14 @@ interface LumiaPassportConfig {
|
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
interface WalletReadyStatus$1 {
|
|
125
|
+
ready: boolean;
|
|
126
|
+
userId?: string;
|
|
127
|
+
address?: `0x${string}`;
|
|
128
|
+
hasKeyshare: boolean;
|
|
129
|
+
hasSession: boolean;
|
|
130
|
+
timestamp: number;
|
|
131
|
+
}
|
|
124
132
|
interface LumiaPassportCallbacks {
|
|
125
133
|
onLumiaPassportConnecting?: (payload: {
|
|
126
134
|
method: 'passkey' | 'email' | 'social' | 'wallet';
|
|
@@ -148,6 +156,7 @@ interface LumiaPassportCallbacks {
|
|
|
148
156
|
code?: string;
|
|
149
157
|
message: string;
|
|
150
158
|
}) => void;
|
|
159
|
+
onWalletReady?: (status: WalletReadyStatus$1) => void;
|
|
151
160
|
}
|
|
152
161
|
interface LumiaPassportContextType {
|
|
153
162
|
config: LumiaPassportConfig;
|
|
@@ -812,4 +821,20 @@ declare function useLumiaPassportLinkedProfiles(): {
|
|
|
812
821
|
readonly refresh: () => Promise<void>;
|
|
813
822
|
};
|
|
814
823
|
|
|
815
|
-
|
|
824
|
+
/**
|
|
825
|
+
* Iframe Manager for Parent SDK
|
|
826
|
+
*
|
|
827
|
+
* Manages secure communication with the isolated iframe wallet at auth.lumiapassport.com
|
|
828
|
+
* Implements postMessage protocol with HMAC authentication and replay protection
|
|
829
|
+
*/
|
|
830
|
+
|
|
831
|
+
interface WalletReadyStatus {
|
|
832
|
+
ready: boolean;
|
|
833
|
+
userId?: string;
|
|
834
|
+
address?: `0x${string}`;
|
|
835
|
+
hasKeyshare: boolean;
|
|
836
|
+
hasSession: boolean;
|
|
837
|
+
timestamp: number;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
export { type AccountSession$1 as AccountSession, Address, type AddressProps, type Asset, ConnectWalletButton, type ConnectWalletButtonProps, Hash, type HashProps, KeyshareBackup, LUMIA_EXPLORER_URL, LumiaLogo, type LumiaPassportCallbacks, type LumiaPassportConfig, LumiaPassportProvider, type LumiaPassportProviderProps, LumiaRainbowKitProvider, type LumiaRainbowKitProviderProps, LumiaSessionProvider, type LumiaSessionProviderProps, LumiaWagmiProvider, type SendTransactionParams, type SendTransactionResult, type Theme, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type UpdateProfileRequest, type UseSendTransactionReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UserOpMempool, type UserOpReceipt, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserProfile, type WalletReadyStatus, getUserProfile, lumiaBeam, prepareUserOperation, queryClient, sendUserOperation, updateUserProfile, useAssets, useLumiaPassportConfig, useLumiaPassportLinkedProfiles, useLumiaSession, useSendTransaction, useSmartAccountTransactions, useTheme, useTokenBalance, useTokenInfo, useTransactions, useUserOpStatus, wagmiConfig };
|
package/dist/index.js
CHANGED
|
@@ -2366,6 +2366,7 @@ var init_iframe_manager = __esm({
|
|
|
2366
2366
|
this.iframeUrl = config.iframeUrl;
|
|
2367
2367
|
this.projectId = config.projectId;
|
|
2368
2368
|
this.debug = config.debug || false;
|
|
2369
|
+
this.onWalletReadyCallback = config.onWalletReady;
|
|
2369
2370
|
this.readyPromise = new Promise((resolve) => {
|
|
2370
2371
|
this.readyResolve = resolve;
|
|
2371
2372
|
});
|
|
@@ -2429,6 +2430,7 @@ var init_iframe_manager = __esm({
|
|
|
2429
2430
|
}
|
|
2430
2431
|
const validIframeTypes = [
|
|
2431
2432
|
"LUMIA_PASSPORT_IFRAME_READY",
|
|
2433
|
+
"LUMIA_PASSPORT_WALLET_READY",
|
|
2432
2434
|
"LUMIA_PASSPORT_SHOW_IFRAME",
|
|
2433
2435
|
"LUMIA_PASSPORT_HIDE_IFRAME",
|
|
2434
2436
|
"LUMIA_PASSPORT_SDK_AUTH_SUCCESS",
|
|
@@ -2449,7 +2451,7 @@ var init_iframe_manager = __esm({
|
|
|
2449
2451
|
}
|
|
2450
2452
|
const iframeOrigin = new URL(this.iframeUrl).origin;
|
|
2451
2453
|
if (event.origin !== iframeOrigin) {
|
|
2452
|
-
this.log("[IframeManager] \u26A0\uFE0F Ignored message from invalid origin:", event.origin,
|
|
2454
|
+
this.log("[IframeManager] \u26A0\uFE0F Ignored message from invalid origin:", { received: event.origin, expected: iframeOrigin });
|
|
2453
2455
|
return;
|
|
2454
2456
|
}
|
|
2455
2457
|
if (message.type === "LUMIA_PASSPORT_IFRAME_READY") {
|
|
@@ -2458,6 +2460,13 @@ var init_iframe_manager = __esm({
|
|
|
2458
2460
|
this.readyResolve();
|
|
2459
2461
|
return;
|
|
2460
2462
|
}
|
|
2463
|
+
if (message.type === "LUMIA_PASSPORT_WALLET_READY") {
|
|
2464
|
+
this.log("[IframeManager] \u{1F4E8} Received LUMIA_PASSPORT_WALLET_READY", message.data);
|
|
2465
|
+
if (this.onWalletReadyCallback) {
|
|
2466
|
+
this.onWalletReadyCallback(message.data);
|
|
2467
|
+
}
|
|
2468
|
+
return;
|
|
2469
|
+
}
|
|
2461
2470
|
if (message.type === "LUMIA_PASSPORT_SHOW_IFRAME") {
|
|
2462
2471
|
this.log("[IframeManager] \u{1F4E8} Received LUMIA_PASSPORT_SHOW_IFRAME");
|
|
2463
2472
|
this.showIframe();
|
|
@@ -3051,7 +3060,8 @@ var LumiaPassportProvider = ({
|
|
|
3051
3060
|
const iframeManager = getIframeManager({
|
|
3052
3061
|
iframeUrl,
|
|
3053
3062
|
projectId: projectId2,
|
|
3054
|
-
debug: config.features?.mpcSecurity ?? true
|
|
3063
|
+
debug: config.features?.mpcSecurity ?? true,
|
|
3064
|
+
onWalletReady: callbacks?.onWalletReady
|
|
3055
3065
|
});
|
|
3056
3066
|
iframeManager.initialize().then(() => {
|
|
3057
3067
|
console.log("[LumiaPassport] \u2705 Secure iframe wallet initialized successfully");
|