@lumiapassport/ui-kit 1.10.1 → 1.11.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/index.html +17 -1
- package/dist/iframe/main.js +44 -25
- package/dist/iframe/main.js.map +1 -1
- package/dist/iframe/oauth/x.html +160 -0
- package/dist/iframe/oauth/x.js +378 -0
- package/dist/index.cjs +6576 -5402
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +76 -4
- package/dist/index.d.ts +76 -4
- package/dist/index.js +6154 -4980
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -193,6 +193,10 @@ interface LumiaPassportContextType {
|
|
|
193
193
|
config: LumiaPassportConfig;
|
|
194
194
|
updateConfig: (updates: Partial<LumiaPassportConfig>) => void;
|
|
195
195
|
callbacks?: LumiaPassportCallbacks;
|
|
196
|
+
providersVersion: number;
|
|
197
|
+
notifyProvidersUpdate: () => void;
|
|
198
|
+
manageWalletOpen: boolean;
|
|
199
|
+
setManageWalletOpen: (open: boolean) => void;
|
|
196
200
|
}
|
|
197
201
|
interface LumiaPassportProviderProps {
|
|
198
202
|
children: React__default.ReactNode;
|
|
@@ -418,6 +422,33 @@ declare function useTheme(configTheme: Theme): {
|
|
|
418
422
|
};
|
|
419
423
|
};
|
|
420
424
|
|
|
425
|
+
/**
|
|
426
|
+
* Hook to programmatically open the Manage Wallet modal
|
|
427
|
+
*
|
|
428
|
+
* @example
|
|
429
|
+
* ```tsx
|
|
430
|
+
* function MyComponent() {
|
|
431
|
+
* const { open, close, isOpen } = useManageWallet();
|
|
432
|
+
*
|
|
433
|
+
* return (
|
|
434
|
+
* <button onClick={open}>
|
|
435
|
+
* Manage Authentication Methods
|
|
436
|
+
* </button>
|
|
437
|
+
* );
|
|
438
|
+
* }
|
|
439
|
+
* ```
|
|
440
|
+
*/
|
|
441
|
+
declare function useManageWallet(): {
|
|
442
|
+
/** Opens the Manage Wallet modal */
|
|
443
|
+
readonly open: () => void;
|
|
444
|
+
/** Closes the Manage Wallet modal */
|
|
445
|
+
readonly close: () => void;
|
|
446
|
+
/** Toggles the Manage Wallet modal */
|
|
447
|
+
readonly toggle: () => void;
|
|
448
|
+
/** Whether the Manage Wallet modal is currently open */
|
|
449
|
+
readonly isOpen: boolean;
|
|
450
|
+
};
|
|
451
|
+
|
|
421
452
|
type ChainLike$2 = {
|
|
422
453
|
id: number;
|
|
423
454
|
blockExplorers?: {
|
|
@@ -1053,6 +1084,12 @@ declare class IframeManager {
|
|
|
1053
1084
|
private pendingRequests;
|
|
1054
1085
|
private usedNonces;
|
|
1055
1086
|
private messageListener;
|
|
1087
|
+
private hiddenElements;
|
|
1088
|
+
private pointerGuardCleanup;
|
|
1089
|
+
private iframeHideTimeout;
|
|
1090
|
+
private iframeActive;
|
|
1091
|
+
private providerSessions;
|
|
1092
|
+
private providerConnections;
|
|
1056
1093
|
private readonly REQUEST_TIMEOUT;
|
|
1057
1094
|
private readonly NONCE_EXPIRY;
|
|
1058
1095
|
constructor(config: IframeManagerConfig);
|
|
@@ -1100,10 +1137,28 @@ declare class IframeManager {
|
|
|
1100
1137
|
* Hide iframe
|
|
1101
1138
|
*/
|
|
1102
1139
|
hideIframe(): void;
|
|
1140
|
+
/**
|
|
1141
|
+
* Hide all Radix Dialog modals (SendModal, etc.)
|
|
1142
|
+
*/
|
|
1143
|
+
private hideAllDialogs;
|
|
1144
|
+
/**
|
|
1145
|
+
* Restore all previously hidden Radix Dialog modals
|
|
1146
|
+
*/
|
|
1147
|
+
private restoreAllDialogs;
|
|
1148
|
+
/**
|
|
1149
|
+
* Stop Radix dismissable layers from swallowing the first click on the iframe.
|
|
1150
|
+
* Radix attaches pointer event guards at the document level; we intercept at window
|
|
1151
|
+
* capture phase so user clicks flow straight into the consent iframe.
|
|
1152
|
+
*/
|
|
1153
|
+
private enablePointerEventGuards;
|
|
1154
|
+
/**
|
|
1155
|
+
* Remove pointer interception once iframe is hidden again.
|
|
1156
|
+
*/
|
|
1157
|
+
private disablePointerEventGuards;
|
|
1103
1158
|
/**
|
|
1104
1159
|
* Authenticate user with application
|
|
1105
1160
|
*/
|
|
1106
|
-
authenticate(userId: string): Promise<{
|
|
1161
|
+
authenticate(userId: string, avatar?: string | null, displayName?: string | null): Promise<{
|
|
1107
1162
|
userId: string;
|
|
1108
1163
|
address: Address$1 | undefined;
|
|
1109
1164
|
}>;
|
|
@@ -1114,7 +1169,7 @@ declare class IframeManager {
|
|
|
1114
1169
|
/**
|
|
1115
1170
|
* Sign transaction
|
|
1116
1171
|
*/
|
|
1117
|
-
signTransaction(userId: string, transaction: Transaction, accessToken?: string): Promise<Hex>;
|
|
1172
|
+
signTransaction(userId: string, transaction: Transaction, accessToken?: string, avatar?: string | null, displayName?: string | null): Promise<Hex>;
|
|
1118
1173
|
/**
|
|
1119
1174
|
* Sign EIP712 typed data
|
|
1120
1175
|
*/
|
|
@@ -1132,7 +1187,7 @@ declare class IframeManager {
|
|
|
1132
1187
|
}>>;
|
|
1133
1188
|
primaryType: string;
|
|
1134
1189
|
message: Record<string, any>;
|
|
1135
|
-
}, digest32: Hex, accessToken?: string): Promise<Hex>;
|
|
1190
|
+
}, digest32: Hex, accessToken?: string, avatar?: string | null, displayName?: string | null): Promise<Hex>;
|
|
1136
1191
|
/**
|
|
1137
1192
|
* Get user's wallet address
|
|
1138
1193
|
*/
|
|
@@ -1151,8 +1206,25 @@ declare class IframeManager {
|
|
|
1151
1206
|
provider: string;
|
|
1152
1207
|
success: boolean;
|
|
1153
1208
|
user?: any;
|
|
1209
|
+
mode?: 'login' | 'link';
|
|
1154
1210
|
error?: string;
|
|
1155
1211
|
}>;
|
|
1212
|
+
/**
|
|
1213
|
+
* Fallback verification for X OAuth cancellations.
|
|
1214
|
+
* Attempts to detect if the backend session was still established.
|
|
1215
|
+
*/
|
|
1216
|
+
private verifyXAuthSession;
|
|
1217
|
+
/**
|
|
1218
|
+
* Prime provider session/cache state to detect future changes.
|
|
1219
|
+
*/
|
|
1220
|
+
private primeProviderSessions;
|
|
1221
|
+
private getKnownSessionId;
|
|
1222
|
+
private getKnownProviderConnection;
|
|
1223
|
+
private recordProviderSession;
|
|
1224
|
+
private recordProviderConnection;
|
|
1225
|
+
private updateProviderTrackingFromUser;
|
|
1226
|
+
private extractSessionId;
|
|
1227
|
+
private getProvidersList;
|
|
1156
1228
|
/**
|
|
1157
1229
|
* Get trusted apps for user
|
|
1158
1230
|
*/
|
|
@@ -1245,4 +1317,4 @@ declare function getIframeManager(config?: IframeManagerConfig): IframeManager;
|
|
|
1245
1317
|
*/
|
|
1246
1318
|
declare function destroyIframeManager(): void;
|
|
1247
1319
|
|
|
1248
|
-
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, LumiaPassportSessionProvider, type LumiaPassportSessionProviderProps, LumiaRainbowKitProvider, type LumiaRainbowKitProviderProps, LumiaSessionProvider, type LumiaSessionProviderProps, LumiaWagmiProvider, type ProviderDetail, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, type Theme, ThemeToggle, type TokenBalance, type Transaction$1 as Transaction, TransactionsList, type TypedDataDomain, type TypedDataField, type UpdateProfileRequest, type UseLogoutReturn, 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, deployAccount, destroyIframeManager, getIframeManager, getUserProfile, lumiaBeam, prepareUserOperation, queryClient, sendUserOperation, signTypedData, updateUserProfile, useAssets, useLogout, useLumiaPassportConfig, useLumiaPassportLinkedProfiles, useLumiaPassportSession, useLumiaSession, useSendTransaction, useSmartAccountTransactions, useTheme, useTokenBalance, useTokenInfo, useTransactions, useUserOpStatus, wagmiConfig };
|
|
1320
|
+
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, LumiaPassportSessionProvider, type LumiaPassportSessionProviderProps, LumiaRainbowKitProvider, type LumiaRainbowKitProviderProps, LumiaSessionProvider, type LumiaSessionProviderProps, LumiaWagmiProvider, type ProviderDetail, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, type Theme, ThemeToggle, type TokenBalance, type Transaction$1 as Transaction, TransactionsList, type TypedDataDomain, type TypedDataField, type UpdateProfileRequest, type UseLogoutReturn, 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, deployAccount, destroyIframeManager, getIframeManager, getUserProfile, lumiaBeam, prepareUserOperation, queryClient, sendUserOperation, signTypedData, updateUserProfile, useAssets, useLogout, useLumiaPassportConfig, useLumiaPassportLinkedProfiles, useLumiaPassportSession, useLumiaSession, useManageWallet, useSendTransaction, useSmartAccountTransactions, useTheme, useTokenBalance, useTokenInfo, useTransactions, useUserOpStatus, wagmiConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -193,6 +193,10 @@ interface LumiaPassportContextType {
|
|
|
193
193
|
config: LumiaPassportConfig;
|
|
194
194
|
updateConfig: (updates: Partial<LumiaPassportConfig>) => void;
|
|
195
195
|
callbacks?: LumiaPassportCallbacks;
|
|
196
|
+
providersVersion: number;
|
|
197
|
+
notifyProvidersUpdate: () => void;
|
|
198
|
+
manageWalletOpen: boolean;
|
|
199
|
+
setManageWalletOpen: (open: boolean) => void;
|
|
196
200
|
}
|
|
197
201
|
interface LumiaPassportProviderProps {
|
|
198
202
|
children: React__default.ReactNode;
|
|
@@ -418,6 +422,33 @@ declare function useTheme(configTheme: Theme): {
|
|
|
418
422
|
};
|
|
419
423
|
};
|
|
420
424
|
|
|
425
|
+
/**
|
|
426
|
+
* Hook to programmatically open the Manage Wallet modal
|
|
427
|
+
*
|
|
428
|
+
* @example
|
|
429
|
+
* ```tsx
|
|
430
|
+
* function MyComponent() {
|
|
431
|
+
* const { open, close, isOpen } = useManageWallet();
|
|
432
|
+
*
|
|
433
|
+
* return (
|
|
434
|
+
* <button onClick={open}>
|
|
435
|
+
* Manage Authentication Methods
|
|
436
|
+
* </button>
|
|
437
|
+
* );
|
|
438
|
+
* }
|
|
439
|
+
* ```
|
|
440
|
+
*/
|
|
441
|
+
declare function useManageWallet(): {
|
|
442
|
+
/** Opens the Manage Wallet modal */
|
|
443
|
+
readonly open: () => void;
|
|
444
|
+
/** Closes the Manage Wallet modal */
|
|
445
|
+
readonly close: () => void;
|
|
446
|
+
/** Toggles the Manage Wallet modal */
|
|
447
|
+
readonly toggle: () => void;
|
|
448
|
+
/** Whether the Manage Wallet modal is currently open */
|
|
449
|
+
readonly isOpen: boolean;
|
|
450
|
+
};
|
|
451
|
+
|
|
421
452
|
type ChainLike$2 = {
|
|
422
453
|
id: number;
|
|
423
454
|
blockExplorers?: {
|
|
@@ -1053,6 +1084,12 @@ declare class IframeManager {
|
|
|
1053
1084
|
private pendingRequests;
|
|
1054
1085
|
private usedNonces;
|
|
1055
1086
|
private messageListener;
|
|
1087
|
+
private hiddenElements;
|
|
1088
|
+
private pointerGuardCleanup;
|
|
1089
|
+
private iframeHideTimeout;
|
|
1090
|
+
private iframeActive;
|
|
1091
|
+
private providerSessions;
|
|
1092
|
+
private providerConnections;
|
|
1056
1093
|
private readonly REQUEST_TIMEOUT;
|
|
1057
1094
|
private readonly NONCE_EXPIRY;
|
|
1058
1095
|
constructor(config: IframeManagerConfig);
|
|
@@ -1100,10 +1137,28 @@ declare class IframeManager {
|
|
|
1100
1137
|
* Hide iframe
|
|
1101
1138
|
*/
|
|
1102
1139
|
hideIframe(): void;
|
|
1140
|
+
/**
|
|
1141
|
+
* Hide all Radix Dialog modals (SendModal, etc.)
|
|
1142
|
+
*/
|
|
1143
|
+
private hideAllDialogs;
|
|
1144
|
+
/**
|
|
1145
|
+
* Restore all previously hidden Radix Dialog modals
|
|
1146
|
+
*/
|
|
1147
|
+
private restoreAllDialogs;
|
|
1148
|
+
/**
|
|
1149
|
+
* Stop Radix dismissable layers from swallowing the first click on the iframe.
|
|
1150
|
+
* Radix attaches pointer event guards at the document level; we intercept at window
|
|
1151
|
+
* capture phase so user clicks flow straight into the consent iframe.
|
|
1152
|
+
*/
|
|
1153
|
+
private enablePointerEventGuards;
|
|
1154
|
+
/**
|
|
1155
|
+
* Remove pointer interception once iframe is hidden again.
|
|
1156
|
+
*/
|
|
1157
|
+
private disablePointerEventGuards;
|
|
1103
1158
|
/**
|
|
1104
1159
|
* Authenticate user with application
|
|
1105
1160
|
*/
|
|
1106
|
-
authenticate(userId: string): Promise<{
|
|
1161
|
+
authenticate(userId: string, avatar?: string | null, displayName?: string | null): Promise<{
|
|
1107
1162
|
userId: string;
|
|
1108
1163
|
address: Address$1 | undefined;
|
|
1109
1164
|
}>;
|
|
@@ -1114,7 +1169,7 @@ declare class IframeManager {
|
|
|
1114
1169
|
/**
|
|
1115
1170
|
* Sign transaction
|
|
1116
1171
|
*/
|
|
1117
|
-
signTransaction(userId: string, transaction: Transaction, accessToken?: string): Promise<Hex>;
|
|
1172
|
+
signTransaction(userId: string, transaction: Transaction, accessToken?: string, avatar?: string | null, displayName?: string | null): Promise<Hex>;
|
|
1118
1173
|
/**
|
|
1119
1174
|
* Sign EIP712 typed data
|
|
1120
1175
|
*/
|
|
@@ -1132,7 +1187,7 @@ declare class IframeManager {
|
|
|
1132
1187
|
}>>;
|
|
1133
1188
|
primaryType: string;
|
|
1134
1189
|
message: Record<string, any>;
|
|
1135
|
-
}, digest32: Hex, accessToken?: string): Promise<Hex>;
|
|
1190
|
+
}, digest32: Hex, accessToken?: string, avatar?: string | null, displayName?: string | null): Promise<Hex>;
|
|
1136
1191
|
/**
|
|
1137
1192
|
* Get user's wallet address
|
|
1138
1193
|
*/
|
|
@@ -1151,8 +1206,25 @@ declare class IframeManager {
|
|
|
1151
1206
|
provider: string;
|
|
1152
1207
|
success: boolean;
|
|
1153
1208
|
user?: any;
|
|
1209
|
+
mode?: 'login' | 'link';
|
|
1154
1210
|
error?: string;
|
|
1155
1211
|
}>;
|
|
1212
|
+
/**
|
|
1213
|
+
* Fallback verification for X OAuth cancellations.
|
|
1214
|
+
* Attempts to detect if the backend session was still established.
|
|
1215
|
+
*/
|
|
1216
|
+
private verifyXAuthSession;
|
|
1217
|
+
/**
|
|
1218
|
+
* Prime provider session/cache state to detect future changes.
|
|
1219
|
+
*/
|
|
1220
|
+
private primeProviderSessions;
|
|
1221
|
+
private getKnownSessionId;
|
|
1222
|
+
private getKnownProviderConnection;
|
|
1223
|
+
private recordProviderSession;
|
|
1224
|
+
private recordProviderConnection;
|
|
1225
|
+
private updateProviderTrackingFromUser;
|
|
1226
|
+
private extractSessionId;
|
|
1227
|
+
private getProvidersList;
|
|
1156
1228
|
/**
|
|
1157
1229
|
* Get trusted apps for user
|
|
1158
1230
|
*/
|
|
@@ -1245,4 +1317,4 @@ declare function getIframeManager(config?: IframeManagerConfig): IframeManager;
|
|
|
1245
1317
|
*/
|
|
1246
1318
|
declare function destroyIframeManager(): void;
|
|
1247
1319
|
|
|
1248
|
-
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, LumiaPassportSessionProvider, type LumiaPassportSessionProviderProps, LumiaRainbowKitProvider, type LumiaRainbowKitProviderProps, LumiaSessionProvider, type LumiaSessionProviderProps, LumiaWagmiProvider, type ProviderDetail, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, type Theme, ThemeToggle, type TokenBalance, type Transaction$1 as Transaction, TransactionsList, type TypedDataDomain, type TypedDataField, type UpdateProfileRequest, type UseLogoutReturn, 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, deployAccount, destroyIframeManager, getIframeManager, getUserProfile, lumiaBeam, prepareUserOperation, queryClient, sendUserOperation, signTypedData, updateUserProfile, useAssets, useLogout, useLumiaPassportConfig, useLumiaPassportLinkedProfiles, useLumiaPassportSession, useLumiaSession, useSendTransaction, useSmartAccountTransactions, useTheme, useTokenBalance, useTokenInfo, useTransactions, useUserOpStatus, wagmiConfig };
|
|
1320
|
+
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, LumiaPassportSessionProvider, type LumiaPassportSessionProviderProps, LumiaRainbowKitProvider, type LumiaRainbowKitProviderProps, LumiaSessionProvider, type LumiaSessionProviderProps, LumiaWagmiProvider, type ProviderDetail, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, type Theme, ThemeToggle, type TokenBalance, type Transaction$1 as Transaction, TransactionsList, type TypedDataDomain, type TypedDataField, type UpdateProfileRequest, type UseLogoutReturn, 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, deployAccount, destroyIframeManager, getIframeManager, getUserProfile, lumiaBeam, prepareUserOperation, queryClient, sendUserOperation, signTypedData, updateUserProfile, useAssets, useLogout, useLumiaPassportConfig, useLumiaPassportLinkedProfiles, useLumiaPassportSession, useLumiaSession, useManageWallet, useSendTransaction, useSmartAccountTransactions, useTheme, useTokenBalance, useTokenInfo, useTransactions, useUserOpStatus, wagmiConfig };
|