@lumiapassport/ui-kit 1.14.26 → 1.15.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/index.d.cts CHANGED
@@ -985,6 +985,55 @@ interface UseLogoutReturn {
985
985
  */
986
986
  declare function useLogout(): UseLogoutReturn;
987
987
 
988
+ /**
989
+ * Nickname fingerprint verification utilities
990
+ * Implements client-side verification per FRD spec
991
+ *
992
+ * IMPORTANT: Client MUST NOT trust server blindly.
993
+ * Always verify fingerprint locally before displaying to user.
994
+ */
995
+ /**
996
+ * Generate fingerprint from owner address
997
+ * Must match backend algorithm exactly
998
+ *
999
+ * Algorithm:
1000
+ * 1. Normalize address to checksum format
1001
+ * 2. Compute keccak256 hash
1002
+ * 3. Take first 5 bytes (40 bits)
1003
+ * 4. Encode using Base32 alphabet
1004
+ * 5. Format as XXXX-XXXX
1005
+ *
1006
+ * @param ownerAddress - The EOA owner address
1007
+ * @returns Fingerprint in format "XXXX-XXXX"
1008
+ */
1009
+ declare function generateFingerprint(ownerAddress: string): string;
1010
+ /**
1011
+ * Verify that received fingerprint matches computed fingerprint
1012
+ *
1013
+ * @param ownerAddress - The owner address from API response
1014
+ * @param receivedFingerprint - The fingerprint from API response
1015
+ * @returns true if fingerprint is valid, false if verification failed
1016
+ */
1017
+ declare function verifyFingerprint(ownerAddress: string, receivedFingerprint: string): boolean;
1018
+ /**
1019
+ * Fingerprint verification result
1020
+ */
1021
+ interface FingerprintVerificationResult {
1022
+ isValid: boolean;
1023
+ computedFingerprint: string | null;
1024
+ receivedFingerprint: string | null;
1025
+ error?: string;
1026
+ }
1027
+ /**
1028
+ * Verify fingerprint with detailed result
1029
+ * Use this for UI display of verification status
1030
+ *
1031
+ * @param ownerAddress - The owner address from API response
1032
+ * @param receivedFingerprint - The fingerprint from API response
1033
+ * @returns Detailed verification result
1034
+ */
1035
+ declare function verifyFingerprintDetailed(ownerAddress: string | null, receivedFingerprint: string | null): FingerprintVerificationResult;
1036
+
988
1037
  /**
989
1038
  * Nickname API types
990
1039
  * Types for nickname-related API responses and requests
@@ -1023,14 +1072,40 @@ interface NicknameAvailability {
1023
1072
  }
1024
1073
  type NicknameUnavailableReason = 'TAKEN' | 'RESERVED' | 'TOO_SHORT' | 'TOO_LONG' | 'INVALID_CHARS' | 'INVALID_UNDERSCORE';
1025
1074
  /**
1026
- * Nickname to wallet address resolution
1027
- * Returned by GET /api/auth/nicknames/{handle}/resolve
1075
+ * Resolved target for a specific chain
1076
+ */
1077
+ interface NicknameResolvedTarget {
1078
+ chainId: number;
1079
+ wallet: `0x${string}`;
1080
+ }
1081
+ /**
1082
+ * Avatar information for nickname resolution
1083
+ */
1084
+ interface NicknameAvatar {
1085
+ type: 'deterministic-circles';
1086
+ seed: string;
1087
+ }
1088
+ /**
1089
+ * Nickname to wallet address resolution (v2)
1090
+ * Returned by POST /api/auth/nicknames/resolve
1028
1091
  */
1029
1092
  interface NicknameResolution {
1030
1093
  handle: string;
1031
- displayHandle: string;
1032
- walletAddress: `0x${string}`;
1033
- ownerAddress: `0x${string}`;
1094
+ requestedChainId: number;
1095
+ resolvedTarget: NicknameResolvedTarget | null;
1096
+ availableTargets: NicknameResolvedTarget[];
1097
+ owner: `0x${string}` | null;
1098
+ fingerprint: string | null;
1099
+ avatar: NicknameAvatar | null;
1100
+ avatarSvg: string | null;
1101
+ isFrozen: boolean;
1102
+ }
1103
+ /**
1104
+ * Request body for resolving nickname (v2)
1105
+ */
1106
+ interface NicknameResolveRequest {
1107
+ handle: string;
1108
+ chainId: number;
1034
1109
  }
1035
1110
  /**
1036
1111
  * Client-side nickname validation result
@@ -1043,7 +1118,7 @@ type NicknameValidationError = 'TOO_SHORT' | 'TOO_LONG' | 'INVALID_CHARS' | 'INV
1043
1118
 
1044
1119
  /**
1045
1120
  * useNicknameResolve hook
1046
- * Public hook for resolving nicknames to wallet addresses
1121
+ * Public hook for resolving nicknames to wallet addresses with verification
1047
1122
  */
1048
1123
 
1049
1124
  interface UseNicknameResolveResult {
@@ -1052,6 +1127,10 @@ interface UseNicknameResolveResult {
1052
1127
  isResolving: boolean;
1053
1128
  isError: boolean;
1054
1129
  isNotFound: boolean;
1130
+ isWalletNotSetup: boolean;
1131
+ isFrozen: boolean;
1132
+ isFingerprintVerified: boolean;
1133
+ fingerprintVerification: FingerprintVerificationResult | null;
1055
1134
  error: Error | null;
1056
1135
  resolvedAddress: string | null;
1057
1136
  }
@@ -1061,18 +1140,23 @@ interface UseNicknameResolveResult {
1061
1140
  * - Does not start with 0x
1062
1141
  */
1063
1142
  declare function looksLikeNickname(input: string): boolean;
1143
+ interface UseNicknameResolveOptions {
1144
+ enabled?: boolean;
1145
+ chainId: number;
1146
+ }
1064
1147
  /**
1065
- * Hook to resolve a nickname to a wallet address
1148
+ * Hook to resolve a nickname to a wallet address with verification
1066
1149
  *
1067
1150
  * - Debounces API calls by 300ms
1068
1151
  * - Only resolves when input looks like a nickname
1069
- * - Returns resolved address when found
1152
+ * - Verifies fingerprint locally before returning data (MANDATORY)
1153
+ * - Returns resolved address when found and verified
1070
1154
  *
1071
1155
  * @param input - The recipient input (can be address or nickname)
1072
- * @param enabled - Whether resolution should be enabled (default: true)
1073
- * @returns Resolution data, loading states, error state, resolved address
1156
+ * @param options - Resolution options including chainId (required) and enabled flag
1157
+ * @returns Resolution data, loading states, error state, verification status, resolved address
1074
1158
  */
1075
- declare function useNicknameResolve(input: string, enabled?: boolean): UseNicknameResolveResult;
1159
+ declare function useNicknameResolve(input: string, options: UseNicknameResolveOptions): UseNicknameResolveResult;
1076
1160
 
1077
1161
  declare const LUMIA_EXPLORER_URL: string;
1078
1162
  declare const lumiaBeam: Chain;
@@ -1496,4 +1580,4 @@ declare function useLumiaPassportLinkedProfiles(): {
1496
1580
  refresh: () => Promise<void>;
1497
1581
  };
1498
1582
 
1499
- export { type AccountSession, Address, type AddressProps, type Asset, ConnectWalletButton, type ConnectWalletButtonProps, ErrorCodes, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LUMIA_EXPLORER_URL, LumiaLogo, type LumiaPassportCallbacks, type LumiaPassportConfig, LumiaPassportError, LumiaPassportProvider, type LumiaPassportProviderProps, LumiaPassportSessionProvider, LumiaRainbowKitProvider, LumiaWagmiProvider, type NicknameAvailability, type NicknameChangeResult, type NicknameInfo, type NicknameResolution, type NicknameValidationResult, PageKey, type PageOpenParams, type ProviderDetail, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TypedDataDomain, type TypedDataField, type UpdateProfileRequest, type UseLogoutReturn, type UseNicknameResolveResult, type UseSendTransactionReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UserOpMempool, type UserOpReceipt, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserProfile, UserRejectedError, type WalletReadyStatus, createLumiaPassportError, deployAccount, destroyIframeManager, getIframeManager, getUserProfile, looksLikeNickname, lumiaBeam, prepareUserOperation, queryClient, sendUserOperation, signTypedData, updateUserProfile, useAssets, useLogout, useLumiaPassportAccountSession, useLumiaPassportAddress, useLumiaPassportBalance, useLumiaPassportColorMode, useLumiaPassportConfig, useLumiaPassportError, useLumiaPassportHasServerVault, useLumiaPassportIFrameReady, useLumiaPassportIsMobileView, useLumiaPassportLinkedProfiles, useLumiaPassportLoadingStatus, useLumiaPassportOpen, useLumiaPassportRecoveryUserId, useLumiaPassportSession, useNicknameResolve, useSendTransaction, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useUserOpStatus, wagmiConfig };
1583
+ export { type AccountSession, Address, type AddressProps, type Asset, ConnectWalletButton, type ConnectWalletButtonProps, ErrorCodes, type FingerprintVerificationResult, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LUMIA_EXPLORER_URL, LumiaLogo, type LumiaPassportCallbacks, type LumiaPassportConfig, LumiaPassportError, LumiaPassportProvider, type LumiaPassportProviderProps, LumiaPassportSessionProvider, LumiaRainbowKitProvider, LumiaWagmiProvider, type NicknameAvailability, type NicknameAvatar, type NicknameChangeResult, type NicknameInfo, type NicknameResolution, type NicknameResolveRequest, type NicknameResolvedTarget, type NicknameValidationResult, PageKey, type PageOpenParams, type ProviderDetail, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TypedDataDomain, type TypedDataField, type UpdateProfileRequest, type UseLogoutReturn, type UseNicknameResolveOptions, type UseNicknameResolveResult, type UseSendTransactionReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UserOpMempool, type UserOpReceipt, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserProfile, UserRejectedError, type WalletReadyStatus, createLumiaPassportError, deployAccount, destroyIframeManager, generateFingerprint, getIframeManager, getUserProfile, looksLikeNickname, lumiaBeam, prepareUserOperation, queryClient, sendUserOperation, signTypedData, updateUserProfile, useAssets, useLogout, useLumiaPassportAccountSession, useLumiaPassportAddress, useLumiaPassportBalance, useLumiaPassportColorMode, useLumiaPassportConfig, useLumiaPassportError, useLumiaPassportHasServerVault, useLumiaPassportIFrameReady, useLumiaPassportIsMobileView, useLumiaPassportLinkedProfiles, useLumiaPassportLoadingStatus, useLumiaPassportOpen, useLumiaPassportRecoveryUserId, useLumiaPassportSession, useNicknameResolve, useSendTransaction, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useUserOpStatus, verifyFingerprint, verifyFingerprintDetailed, wagmiConfig };
package/dist/index.d.ts CHANGED
@@ -985,6 +985,55 @@ interface UseLogoutReturn {
985
985
  */
986
986
  declare function useLogout(): UseLogoutReturn;
987
987
 
988
+ /**
989
+ * Nickname fingerprint verification utilities
990
+ * Implements client-side verification per FRD spec
991
+ *
992
+ * IMPORTANT: Client MUST NOT trust server blindly.
993
+ * Always verify fingerprint locally before displaying to user.
994
+ */
995
+ /**
996
+ * Generate fingerprint from owner address
997
+ * Must match backend algorithm exactly
998
+ *
999
+ * Algorithm:
1000
+ * 1. Normalize address to checksum format
1001
+ * 2. Compute keccak256 hash
1002
+ * 3. Take first 5 bytes (40 bits)
1003
+ * 4. Encode using Base32 alphabet
1004
+ * 5. Format as XXXX-XXXX
1005
+ *
1006
+ * @param ownerAddress - The EOA owner address
1007
+ * @returns Fingerprint in format "XXXX-XXXX"
1008
+ */
1009
+ declare function generateFingerprint(ownerAddress: string): string;
1010
+ /**
1011
+ * Verify that received fingerprint matches computed fingerprint
1012
+ *
1013
+ * @param ownerAddress - The owner address from API response
1014
+ * @param receivedFingerprint - The fingerprint from API response
1015
+ * @returns true if fingerprint is valid, false if verification failed
1016
+ */
1017
+ declare function verifyFingerprint(ownerAddress: string, receivedFingerprint: string): boolean;
1018
+ /**
1019
+ * Fingerprint verification result
1020
+ */
1021
+ interface FingerprintVerificationResult {
1022
+ isValid: boolean;
1023
+ computedFingerprint: string | null;
1024
+ receivedFingerprint: string | null;
1025
+ error?: string;
1026
+ }
1027
+ /**
1028
+ * Verify fingerprint with detailed result
1029
+ * Use this for UI display of verification status
1030
+ *
1031
+ * @param ownerAddress - The owner address from API response
1032
+ * @param receivedFingerprint - The fingerprint from API response
1033
+ * @returns Detailed verification result
1034
+ */
1035
+ declare function verifyFingerprintDetailed(ownerAddress: string | null, receivedFingerprint: string | null): FingerprintVerificationResult;
1036
+
988
1037
  /**
989
1038
  * Nickname API types
990
1039
  * Types for nickname-related API responses and requests
@@ -1023,14 +1072,40 @@ interface NicknameAvailability {
1023
1072
  }
1024
1073
  type NicknameUnavailableReason = 'TAKEN' | 'RESERVED' | 'TOO_SHORT' | 'TOO_LONG' | 'INVALID_CHARS' | 'INVALID_UNDERSCORE';
1025
1074
  /**
1026
- * Nickname to wallet address resolution
1027
- * Returned by GET /api/auth/nicknames/{handle}/resolve
1075
+ * Resolved target for a specific chain
1076
+ */
1077
+ interface NicknameResolvedTarget {
1078
+ chainId: number;
1079
+ wallet: `0x${string}`;
1080
+ }
1081
+ /**
1082
+ * Avatar information for nickname resolution
1083
+ */
1084
+ interface NicknameAvatar {
1085
+ type: 'deterministic-circles';
1086
+ seed: string;
1087
+ }
1088
+ /**
1089
+ * Nickname to wallet address resolution (v2)
1090
+ * Returned by POST /api/auth/nicknames/resolve
1028
1091
  */
1029
1092
  interface NicknameResolution {
1030
1093
  handle: string;
1031
- displayHandle: string;
1032
- walletAddress: `0x${string}`;
1033
- ownerAddress: `0x${string}`;
1094
+ requestedChainId: number;
1095
+ resolvedTarget: NicknameResolvedTarget | null;
1096
+ availableTargets: NicknameResolvedTarget[];
1097
+ owner: `0x${string}` | null;
1098
+ fingerprint: string | null;
1099
+ avatar: NicknameAvatar | null;
1100
+ avatarSvg: string | null;
1101
+ isFrozen: boolean;
1102
+ }
1103
+ /**
1104
+ * Request body for resolving nickname (v2)
1105
+ */
1106
+ interface NicknameResolveRequest {
1107
+ handle: string;
1108
+ chainId: number;
1034
1109
  }
1035
1110
  /**
1036
1111
  * Client-side nickname validation result
@@ -1043,7 +1118,7 @@ type NicknameValidationError = 'TOO_SHORT' | 'TOO_LONG' | 'INVALID_CHARS' | 'INV
1043
1118
 
1044
1119
  /**
1045
1120
  * useNicknameResolve hook
1046
- * Public hook for resolving nicknames to wallet addresses
1121
+ * Public hook for resolving nicknames to wallet addresses with verification
1047
1122
  */
1048
1123
 
1049
1124
  interface UseNicknameResolveResult {
@@ -1052,6 +1127,10 @@ interface UseNicknameResolveResult {
1052
1127
  isResolving: boolean;
1053
1128
  isError: boolean;
1054
1129
  isNotFound: boolean;
1130
+ isWalletNotSetup: boolean;
1131
+ isFrozen: boolean;
1132
+ isFingerprintVerified: boolean;
1133
+ fingerprintVerification: FingerprintVerificationResult | null;
1055
1134
  error: Error | null;
1056
1135
  resolvedAddress: string | null;
1057
1136
  }
@@ -1061,18 +1140,23 @@ interface UseNicknameResolveResult {
1061
1140
  * - Does not start with 0x
1062
1141
  */
1063
1142
  declare function looksLikeNickname(input: string): boolean;
1143
+ interface UseNicknameResolveOptions {
1144
+ enabled?: boolean;
1145
+ chainId: number;
1146
+ }
1064
1147
  /**
1065
- * Hook to resolve a nickname to a wallet address
1148
+ * Hook to resolve a nickname to a wallet address with verification
1066
1149
  *
1067
1150
  * - Debounces API calls by 300ms
1068
1151
  * - Only resolves when input looks like a nickname
1069
- * - Returns resolved address when found
1152
+ * - Verifies fingerprint locally before returning data (MANDATORY)
1153
+ * - Returns resolved address when found and verified
1070
1154
  *
1071
1155
  * @param input - The recipient input (can be address or nickname)
1072
- * @param enabled - Whether resolution should be enabled (default: true)
1073
- * @returns Resolution data, loading states, error state, resolved address
1156
+ * @param options - Resolution options including chainId (required) and enabled flag
1157
+ * @returns Resolution data, loading states, error state, verification status, resolved address
1074
1158
  */
1075
- declare function useNicknameResolve(input: string, enabled?: boolean): UseNicknameResolveResult;
1159
+ declare function useNicknameResolve(input: string, options: UseNicknameResolveOptions): UseNicknameResolveResult;
1076
1160
 
1077
1161
  declare const LUMIA_EXPLORER_URL: string;
1078
1162
  declare const lumiaBeam: Chain;
@@ -1496,4 +1580,4 @@ declare function useLumiaPassportLinkedProfiles(): {
1496
1580
  refresh: () => Promise<void>;
1497
1581
  };
1498
1582
 
1499
- export { type AccountSession, Address, type AddressProps, type Asset, ConnectWalletButton, type ConnectWalletButtonProps, ErrorCodes, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LUMIA_EXPLORER_URL, LumiaLogo, type LumiaPassportCallbacks, type LumiaPassportConfig, LumiaPassportError, LumiaPassportProvider, type LumiaPassportProviderProps, LumiaPassportSessionProvider, LumiaRainbowKitProvider, LumiaWagmiProvider, type NicknameAvailability, type NicknameChangeResult, type NicknameInfo, type NicknameResolution, type NicknameValidationResult, PageKey, type PageOpenParams, type ProviderDetail, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TypedDataDomain, type TypedDataField, type UpdateProfileRequest, type UseLogoutReturn, type UseNicknameResolveResult, type UseSendTransactionReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UserOpMempool, type UserOpReceipt, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserProfile, UserRejectedError, type WalletReadyStatus, createLumiaPassportError, deployAccount, destroyIframeManager, getIframeManager, getUserProfile, looksLikeNickname, lumiaBeam, prepareUserOperation, queryClient, sendUserOperation, signTypedData, updateUserProfile, useAssets, useLogout, useLumiaPassportAccountSession, useLumiaPassportAddress, useLumiaPassportBalance, useLumiaPassportColorMode, useLumiaPassportConfig, useLumiaPassportError, useLumiaPassportHasServerVault, useLumiaPassportIFrameReady, useLumiaPassportIsMobileView, useLumiaPassportLinkedProfiles, useLumiaPassportLoadingStatus, useLumiaPassportOpen, useLumiaPassportRecoveryUserId, useLumiaPassportSession, useNicknameResolve, useSendTransaction, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useUserOpStatus, wagmiConfig };
1583
+ export { type AccountSession, Address, type AddressProps, type Asset, ConnectWalletButton, type ConnectWalletButtonProps, ErrorCodes, type FingerprintVerificationResult, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LUMIA_EXPLORER_URL, LumiaLogo, type LumiaPassportCallbacks, type LumiaPassportConfig, LumiaPassportError, LumiaPassportProvider, type LumiaPassportProviderProps, LumiaPassportSessionProvider, LumiaRainbowKitProvider, LumiaWagmiProvider, type NicknameAvailability, type NicknameAvatar, type NicknameChangeResult, type NicknameInfo, type NicknameResolution, type NicknameResolveRequest, type NicknameResolvedTarget, type NicknameValidationResult, PageKey, type PageOpenParams, type ProviderDetail, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TypedDataDomain, type TypedDataField, type UpdateProfileRequest, type UseLogoutReturn, type UseNicknameResolveOptions, type UseNicknameResolveResult, type UseSendTransactionReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UserOpMempool, type UserOpReceipt, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserProfile, UserRejectedError, type WalletReadyStatus, createLumiaPassportError, deployAccount, destroyIframeManager, generateFingerprint, getIframeManager, getUserProfile, looksLikeNickname, lumiaBeam, prepareUserOperation, queryClient, sendUserOperation, signTypedData, updateUserProfile, useAssets, useLogout, useLumiaPassportAccountSession, useLumiaPassportAddress, useLumiaPassportBalance, useLumiaPassportColorMode, useLumiaPassportConfig, useLumiaPassportError, useLumiaPassportHasServerVault, useLumiaPassportIFrameReady, useLumiaPassportIsMobileView, useLumiaPassportLinkedProfiles, useLumiaPassportLoadingStatus, useLumiaPassportOpen, useLumiaPassportRecoveryUserId, useLumiaPassportSession, useNicknameResolve, useSendTransaction, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useUserOpStatus, verifyFingerprint, verifyFingerprintDetailed, wagmiConfig };