@embarkai/ui-kit 0.1.6 → 0.2.0

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
@@ -183,6 +183,7 @@ interface WatchToken {
183
183
  /** Logo URL (optional) */
184
184
  logo?: string;
185
185
  }
186
+ type WalletMode = 'linked' | 'direct' | 'both';
186
187
  interface ProviderConfig {
187
188
  projectId: string;
188
189
  passkey: {
@@ -205,6 +206,10 @@ interface ProviderConfig {
205
206
  supportedChains?: number[];
206
207
  requireSignature: boolean;
207
208
  walletConnectProjectId?: string;
209
+ /** Operating mode: 'linked' = AA (current), 'direct' = external wallet signs, 'both' = user choice */
210
+ mode?: WalletMode;
211
+ /** Filter RainbowKit wallet list. undefined = show all wallets */
212
+ allowedWallets?: string[];
208
213
  };
209
214
  preferedColorMode?: 'light' | 'dark';
210
215
  projectAssets?: {
@@ -1209,6 +1214,75 @@ interface UseErc3643ComplianceResult {
1209
1214
  */
1210
1215
  declare function useErc3643Compliance(options: UseErc3643ComplianceOptions): UseErc3643ComplianceResult;
1211
1216
 
1217
+ interface UseWalletModeReturn {
1218
+ /** Currently configured mode from provider config */
1219
+ configMode: WalletMode;
1220
+ /** Currently active mode (relevant when configMode='both') */
1221
+ activeMode: WalletMode;
1222
+ /** Switch active mode (only works when configMode='both') */
1223
+ switchMode: (mode: 'linked' | 'direct') => void;
1224
+ /** Whether the current active mode uses direct EOA signing */
1225
+ isDirect: boolean;
1226
+ }
1227
+ declare function useWalletMode(): UseWalletModeReturn;
1228
+
1229
+ interface UseDirectWalletReturn {
1230
+ /** Connected external wallet address */
1231
+ address: `0x${string}` | null;
1232
+ /** Chain ID the external wallet is on */
1233
+ chainId: number | null;
1234
+ /** Whether external wallet is connected */
1235
+ isConnected: boolean;
1236
+ /** Wallet connector name (e.g. 'MetaMask') */
1237
+ connectorName: string | null;
1238
+ /** Connect + link: opens RainbowKit modal, signs, calls linkWallet API */
1239
+ connect: () => void;
1240
+ /** Reconnect only: opens RainbowKit modal to restore wagmi session (no re-linking) */
1241
+ reconnect: () => void;
1242
+ /** Disconnect the external wallet */
1243
+ disconnect: () => void;
1244
+ }
1245
+ declare function useDirectWallet(): UseDirectWalletReturn;
1246
+
1247
+ interface DirectTransactionParams {
1248
+ to: `0x${string}`;
1249
+ /** Amount in human-readable native currency units (e.g. '1.5' for 1.5 ETH), not wei */
1250
+ value: string;
1251
+ data?: `0x${string}`;
1252
+ chainId?: number;
1253
+ }
1254
+ interface UseSendDirectTransactionReturn {
1255
+ sendTransaction: (params: DirectTransactionParams) => Promise<`0x${string}` | null>;
1256
+ isPending: boolean;
1257
+ error: string | null;
1258
+ txHash: `0x${string}` | null;
1259
+ reset: () => void;
1260
+ }
1261
+ declare function useSendDirectTransaction(): UseSendDirectTransactionReturn;
1262
+
1263
+ interface TransferToLinkedParams {
1264
+ /** Token contract address, or 'native' for native currency */
1265
+ token: `0x${string}` | 'native';
1266
+ /** Human-readable amount (e.g. '1.5', '1000') */
1267
+ amount: string;
1268
+ /** Chain ID — transfer only works within same chain */
1269
+ chainId: number;
1270
+ /** Token decimals (default: 18). Required for ERC20 tokens */
1271
+ decimals?: number;
1272
+ /** Target linked wallet address. If omitted, uses first linked wallet */
1273
+ toAddress?: `0x${string}`;
1274
+ }
1275
+ interface UseTransferToLinkedReturn {
1276
+ transfer: (params: TransferToLinkedParams) => Promise<string | null>;
1277
+ isPending: boolean;
1278
+ error: string | null;
1279
+ userOpHash: string | null;
1280
+ /** List of linked wallet addresses from profile */
1281
+ linkedWallets: `0x${string}`[];
1282
+ reset: () => void;
1283
+ }
1284
+ declare function useTransferToLinkedWallet(): UseTransferToLinkedReturn;
1285
+
1212
1286
  interface UseLogoutReturn {
1213
1287
  logout: () => Promise<void>;
1214
1288
  }
@@ -2695,4 +2769,4 @@ declare function combineI18NResources(...resourses: TranslationResources[]): Tra
2695
2769
  declare function getAvailableLanguages(resourses: TranslationResources): string[];
2696
2770
  declare function getLanguageIcon(languageKey: string): string | null;
2697
2771
 
2698
- export { AccountAbstractionError, type AccountSession, Address, type AddressProps, type Asset, type CallbacksConfig, ConnectWalletButton, type ConnectWalletButtonProps, ErrorCodes, type FingerprintVerificationResult, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LOCAL_STORAGE_I18N_KEY, LangToggle, type NicknameAvailability, type NicknameAvatar, type NicknameChangeResult, type NicknameInfo, type NicknameResolution, type NicknameResolveRequest, type NicknameResolvedTarget, type NicknameValidationResult, PASSPORT_TRANSLATIONS, PageKey, type PageOpenParams, Provider, type ProviderConfig, type ProviderDetail, type ProviderProps, type RegisterSmartAccountResult, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, type SmartAccountEntry, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TypedDataDomain, type TypedDataField, type UpdateProfileRequest, type UseErc3643ComplianceOptions, type UseErc3643ComplianceResult, type UseLogoutReturn, type UseNicknameResolveOptions, type UseNicknameResolveResult, type UseSendTransactionReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UserOpMempool, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserOperationByHash, type UserOperationReceipt, UserOperationTimeoutError, type UserProfile, UserRejectedError, type WaitForReceiptOptions, type WalletReadyStatus, type WatchToken, combineI18NResources, createAccountAbstractionError, deployAccount, destroyIframeManager, generateFingerprint, getAllSmartAccounts, getAvailableLanguages, getIframeManager, getLanguageIcon, getSmartAccountForChain, getUserOperationByHash, getUserOperationReceipt, getUserProfile, looksLikeNickname, prepareUserOperation, requireActiveChainId, sendUserOperation, signTypedData, updateUserProfile, useAccountSession, useActiveChainId, useAddress, useAssets, useBalance, useColorMode, useErc3643Compliance, useError, useHasServerVault, useHydrated, useIFrameReady, useIsMobileView, useLinkedProfiles, useLoadingStatus, useLogout, useNicknameResolve, useOpenPage, useProviderConfig, useRecoveryUserId, useSendTransaction, useSession, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useUserOpStatus, verifyFingerprint, verifyFingerprintDetailed, wagmiConfig, waitForStoreHydration, waitForUserOperationReceipt };
2772
+ export { AccountAbstractionError, type AccountSession, Address, type AddressProps, type Asset, type CallbacksConfig, ConnectWalletButton, type ConnectWalletButtonProps, type DirectTransactionParams, ErrorCodes, type FingerprintVerificationResult, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LOCAL_STORAGE_I18N_KEY, LangToggle, type NicknameAvailability, type NicknameAvatar, type NicknameChangeResult, type NicknameInfo, type NicknameResolution, type NicknameResolveRequest, type NicknameResolvedTarget, type NicknameValidationResult, PASSPORT_TRANSLATIONS, PageKey, type PageOpenParams, Provider, type ProviderConfig, type ProviderDetail, type ProviderProps, type RegisterSmartAccountResult, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, type SmartAccountEntry, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TransferToLinkedParams, type TypedDataDomain, type TypedDataField, type UpdateProfileRequest, type UseDirectWalletReturn, type UseErc3643ComplianceOptions, type UseErc3643ComplianceResult, type UseLogoutReturn, type UseNicknameResolveOptions, type UseNicknameResolveResult, type UseSendDirectTransactionReturn, type UseSendTransactionReturn, type UseTransferToLinkedReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UseWalletModeReturn, type UserOpMempool, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserOperationByHash, type UserOperationReceipt, UserOperationTimeoutError, type UserProfile, UserRejectedError, type WaitForReceiptOptions, type WalletMode, type WalletReadyStatus, type WatchToken, combineI18NResources, createAccountAbstractionError, deployAccount, destroyIframeManager, generateFingerprint, getAllSmartAccounts, getAvailableLanguages, getIframeManager, getLanguageIcon, getSmartAccountForChain, getUserOperationByHash, getUserOperationReceipt, getUserProfile, looksLikeNickname, prepareUserOperation, requireActiveChainId, sendUserOperation, signTypedData, updateUserProfile, useAccountSession, useActiveChainId, useAddress, useAssets, useBalance, useColorMode, useDirectWallet, useErc3643Compliance, useError, useHasServerVault, useHydrated, useIFrameReady, useIsMobileView, useLinkedProfiles, useLoadingStatus, useLogout, useNicknameResolve, useOpenPage, useProviderConfig, useRecoveryUserId, useSendDirectTransaction, useSendTransaction, useSession, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useTransferToLinkedWallet, useUserOpStatus, useWalletMode, verifyFingerprint, verifyFingerprintDetailed, wagmiConfig, waitForStoreHydration, waitForUserOperationReceipt };
package/dist/index.d.ts CHANGED
@@ -183,6 +183,7 @@ interface WatchToken {
183
183
  /** Logo URL (optional) */
184
184
  logo?: string;
185
185
  }
186
+ type WalletMode = 'linked' | 'direct' | 'both';
186
187
  interface ProviderConfig {
187
188
  projectId: string;
188
189
  passkey: {
@@ -205,6 +206,10 @@ interface ProviderConfig {
205
206
  supportedChains?: number[];
206
207
  requireSignature: boolean;
207
208
  walletConnectProjectId?: string;
209
+ /** Operating mode: 'linked' = AA (current), 'direct' = external wallet signs, 'both' = user choice */
210
+ mode?: WalletMode;
211
+ /** Filter RainbowKit wallet list. undefined = show all wallets */
212
+ allowedWallets?: string[];
208
213
  };
209
214
  preferedColorMode?: 'light' | 'dark';
210
215
  projectAssets?: {
@@ -1209,6 +1214,75 @@ interface UseErc3643ComplianceResult {
1209
1214
  */
1210
1215
  declare function useErc3643Compliance(options: UseErc3643ComplianceOptions): UseErc3643ComplianceResult;
1211
1216
 
1217
+ interface UseWalletModeReturn {
1218
+ /** Currently configured mode from provider config */
1219
+ configMode: WalletMode;
1220
+ /** Currently active mode (relevant when configMode='both') */
1221
+ activeMode: WalletMode;
1222
+ /** Switch active mode (only works when configMode='both') */
1223
+ switchMode: (mode: 'linked' | 'direct') => void;
1224
+ /** Whether the current active mode uses direct EOA signing */
1225
+ isDirect: boolean;
1226
+ }
1227
+ declare function useWalletMode(): UseWalletModeReturn;
1228
+
1229
+ interface UseDirectWalletReturn {
1230
+ /** Connected external wallet address */
1231
+ address: `0x${string}` | null;
1232
+ /** Chain ID the external wallet is on */
1233
+ chainId: number | null;
1234
+ /** Whether external wallet is connected */
1235
+ isConnected: boolean;
1236
+ /** Wallet connector name (e.g. 'MetaMask') */
1237
+ connectorName: string | null;
1238
+ /** Connect + link: opens RainbowKit modal, signs, calls linkWallet API */
1239
+ connect: () => void;
1240
+ /** Reconnect only: opens RainbowKit modal to restore wagmi session (no re-linking) */
1241
+ reconnect: () => void;
1242
+ /** Disconnect the external wallet */
1243
+ disconnect: () => void;
1244
+ }
1245
+ declare function useDirectWallet(): UseDirectWalletReturn;
1246
+
1247
+ interface DirectTransactionParams {
1248
+ to: `0x${string}`;
1249
+ /** Amount in human-readable native currency units (e.g. '1.5' for 1.5 ETH), not wei */
1250
+ value: string;
1251
+ data?: `0x${string}`;
1252
+ chainId?: number;
1253
+ }
1254
+ interface UseSendDirectTransactionReturn {
1255
+ sendTransaction: (params: DirectTransactionParams) => Promise<`0x${string}` | null>;
1256
+ isPending: boolean;
1257
+ error: string | null;
1258
+ txHash: `0x${string}` | null;
1259
+ reset: () => void;
1260
+ }
1261
+ declare function useSendDirectTransaction(): UseSendDirectTransactionReturn;
1262
+
1263
+ interface TransferToLinkedParams {
1264
+ /** Token contract address, or 'native' for native currency */
1265
+ token: `0x${string}` | 'native';
1266
+ /** Human-readable amount (e.g. '1.5', '1000') */
1267
+ amount: string;
1268
+ /** Chain ID — transfer only works within same chain */
1269
+ chainId: number;
1270
+ /** Token decimals (default: 18). Required for ERC20 tokens */
1271
+ decimals?: number;
1272
+ /** Target linked wallet address. If omitted, uses first linked wallet */
1273
+ toAddress?: `0x${string}`;
1274
+ }
1275
+ interface UseTransferToLinkedReturn {
1276
+ transfer: (params: TransferToLinkedParams) => Promise<string | null>;
1277
+ isPending: boolean;
1278
+ error: string | null;
1279
+ userOpHash: string | null;
1280
+ /** List of linked wallet addresses from profile */
1281
+ linkedWallets: `0x${string}`[];
1282
+ reset: () => void;
1283
+ }
1284
+ declare function useTransferToLinkedWallet(): UseTransferToLinkedReturn;
1285
+
1212
1286
  interface UseLogoutReturn {
1213
1287
  logout: () => Promise<void>;
1214
1288
  }
@@ -2695,4 +2769,4 @@ declare function combineI18NResources(...resourses: TranslationResources[]): Tra
2695
2769
  declare function getAvailableLanguages(resourses: TranslationResources): string[];
2696
2770
  declare function getLanguageIcon(languageKey: string): string | null;
2697
2771
 
2698
- export { AccountAbstractionError, type AccountSession, Address, type AddressProps, type Asset, type CallbacksConfig, ConnectWalletButton, type ConnectWalletButtonProps, ErrorCodes, type FingerprintVerificationResult, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LOCAL_STORAGE_I18N_KEY, LangToggle, type NicknameAvailability, type NicknameAvatar, type NicknameChangeResult, type NicknameInfo, type NicknameResolution, type NicknameResolveRequest, type NicknameResolvedTarget, type NicknameValidationResult, PASSPORT_TRANSLATIONS, PageKey, type PageOpenParams, Provider, type ProviderConfig, type ProviderDetail, type ProviderProps, type RegisterSmartAccountResult, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, type SmartAccountEntry, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TypedDataDomain, type TypedDataField, type UpdateProfileRequest, type UseErc3643ComplianceOptions, type UseErc3643ComplianceResult, type UseLogoutReturn, type UseNicknameResolveOptions, type UseNicknameResolveResult, type UseSendTransactionReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UserOpMempool, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserOperationByHash, type UserOperationReceipt, UserOperationTimeoutError, type UserProfile, UserRejectedError, type WaitForReceiptOptions, type WalletReadyStatus, type WatchToken, combineI18NResources, createAccountAbstractionError, deployAccount, destroyIframeManager, generateFingerprint, getAllSmartAccounts, getAvailableLanguages, getIframeManager, getLanguageIcon, getSmartAccountForChain, getUserOperationByHash, getUserOperationReceipt, getUserProfile, looksLikeNickname, prepareUserOperation, requireActiveChainId, sendUserOperation, signTypedData, updateUserProfile, useAccountSession, useActiveChainId, useAddress, useAssets, useBalance, useColorMode, useErc3643Compliance, useError, useHasServerVault, useHydrated, useIFrameReady, useIsMobileView, useLinkedProfiles, useLoadingStatus, useLogout, useNicknameResolve, useOpenPage, useProviderConfig, useRecoveryUserId, useSendTransaction, useSession, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useUserOpStatus, verifyFingerprint, verifyFingerprintDetailed, wagmiConfig, waitForStoreHydration, waitForUserOperationReceipt };
2772
+ export { AccountAbstractionError, type AccountSession, Address, type AddressProps, type Asset, type CallbacksConfig, ConnectWalletButton, type ConnectWalletButtonProps, type DirectTransactionParams, ErrorCodes, type FingerprintVerificationResult, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LOCAL_STORAGE_I18N_KEY, LangToggle, type NicknameAvailability, type NicknameAvatar, type NicknameChangeResult, type NicknameInfo, type NicknameResolution, type NicknameResolveRequest, type NicknameResolvedTarget, type NicknameValidationResult, PASSPORT_TRANSLATIONS, PageKey, type PageOpenParams, Provider, type ProviderConfig, type ProviderDetail, type ProviderProps, type RegisterSmartAccountResult, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, type SmartAccountEntry, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TransferToLinkedParams, type TypedDataDomain, type TypedDataField, type UpdateProfileRequest, type UseDirectWalletReturn, type UseErc3643ComplianceOptions, type UseErc3643ComplianceResult, type UseLogoutReturn, type UseNicknameResolveOptions, type UseNicknameResolveResult, type UseSendDirectTransactionReturn, type UseSendTransactionReturn, type UseTransferToLinkedReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UseWalletModeReturn, type UserOpMempool, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserOperationByHash, type UserOperationReceipt, UserOperationTimeoutError, type UserProfile, UserRejectedError, type WaitForReceiptOptions, type WalletMode, type WalletReadyStatus, type WatchToken, combineI18NResources, createAccountAbstractionError, deployAccount, destroyIframeManager, generateFingerprint, getAllSmartAccounts, getAvailableLanguages, getIframeManager, getLanguageIcon, getSmartAccountForChain, getUserOperationByHash, getUserOperationReceipt, getUserProfile, looksLikeNickname, prepareUserOperation, requireActiveChainId, sendUserOperation, signTypedData, updateUserProfile, useAccountSession, useActiveChainId, useAddress, useAssets, useBalance, useColorMode, useDirectWallet, useErc3643Compliance, useError, useHasServerVault, useHydrated, useIFrameReady, useIsMobileView, useLinkedProfiles, useLoadingStatus, useLogout, useNicknameResolve, useOpenPage, useProviderConfig, useRecoveryUserId, useSendDirectTransaction, useSendTransaction, useSession, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useTransferToLinkedWallet, useUserOpStatus, useWalletMode, verifyFingerprint, verifyFingerprintDetailed, wagmiConfig, waitForStoreHydration, waitForUserOperationReceipt };