@volr/react 0.1.109 → 0.1.110

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
@@ -956,6 +956,99 @@ interface UseVolrPaymentApiReturn {
956
956
  }
957
957
  declare function useVolrPaymentApi(): UseVolrPaymentApiReturn;
958
958
 
959
+ /**
960
+ * useUserBalances hook - Fetch user's token balances for project deposit assets
961
+ */
962
+
963
+ /**
964
+ * Token balance with metadata
965
+ */
966
+ interface TokenBalance {
967
+ /** Unique identifier: chainId_address or chainId_native */
968
+ id: string;
969
+ /** Chain ID */
970
+ chainId: number;
971
+ /** Token symbol */
972
+ symbol: string;
973
+ /** Token decimals */
974
+ decimals: number;
975
+ /** Token address (0x0 for native) */
976
+ address: string;
977
+ /** Token icon URL */
978
+ iconUrl?: string;
979
+ /** Whether this is native token */
980
+ isNative: boolean;
981
+ /** Raw balance in smallest unit */
982
+ balanceRaw: bigint;
983
+ /** Formatted balance string */
984
+ balance: string;
985
+ /** USD value (if available) */
986
+ balanceUsd?: number;
987
+ /** Whether balance is loading */
988
+ isLoading: boolean;
989
+ /** Error if balance fetch failed */
990
+ error?: string;
991
+ }
992
+ /**
993
+ * Branding data with payment enabled flag
994
+ */
995
+ interface BrandingData {
996
+ depositAssets: DepositAsset$1[];
997
+ paymentEnabled: boolean;
998
+ }
999
+ interface UseUserBalancesReturn {
1000
+ /** Array of token balances */
1001
+ balances: TokenBalance[];
1002
+ /** Total USD value of all balances */
1003
+ totalUsd: number;
1004
+ /** Whether any balance is loading */
1005
+ isLoading: boolean;
1006
+ /** Whether payment feature is enabled for this project */
1007
+ paymentEnabled: boolean;
1008
+ /** Refresh all balances */
1009
+ refresh: () => Promise<void>;
1010
+ /** Error if branding fetch failed */
1011
+ error: Error | null;
1012
+ }
1013
+ /**
1014
+ * Hook to fetch user's token balances for project deposit assets
1015
+ */
1016
+ declare function useUserBalances(): UseUserBalancesReturn;
1017
+
1018
+ /**
1019
+ * useWithdraw hook - Withdraw tokens to external address
1020
+ */
1021
+
1022
+ interface WithdrawParams {
1023
+ /** Chain ID to withdraw from */
1024
+ chainId: number;
1025
+ /** Token address (use 'native' for native token) */
1026
+ tokenAddress: string;
1027
+ /** Token decimals */
1028
+ decimals: number;
1029
+ /** Amount to withdraw (human readable, e.g., "1.5") */
1030
+ amount: string;
1031
+ /** Destination address */
1032
+ to: `0x${string}`;
1033
+ }
1034
+ interface UseWithdrawReturn {
1035
+ /** Execute withdrawal */
1036
+ withdraw: (params: WithdrawParams) => Promise<RelayResult>;
1037
+ /** Whether withdrawal is in progress */
1038
+ isWithdrawing: boolean;
1039
+ /** Last withdrawal result */
1040
+ result: RelayResult | null;
1041
+ /** Error if withdrawal failed */
1042
+ error: Error | null;
1043
+ /** Reset state */
1044
+ reset: () => void;
1045
+ }
1046
+ /**
1047
+ * Hook to withdraw tokens to external address
1048
+ * Uses existing relay infrastructure for gas sponsorship
1049
+ */
1050
+ declare function useWithdraw(): UseWithdrawReturn;
1051
+
959
1052
  /**
960
1053
  * Passkey adapter for WebAuthn
961
1054
  * Implements PasskeyProviderPort interface
@@ -1367,4 +1460,65 @@ declare function getUserCredentials(client: APIClient): Promise<Array<{
1367
1460
  createdAt: string;
1368
1461
  }>>;
1369
1462
 
1370
- export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type ERC20BalanceComparison, type Erc20Token$1 as Erc20Token, type EvmChainClient, type EvmClient, type EvmNamespace, type KeyStorageType, type MigrationCompleteParams, type MigrationCompleteResult, type MigrationError, type MigrationMessage, type MigrationRequestParams, type MigrationRequestResult, type MigrationSeedRequest, type MigrationSeedResponse, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type OnSignRequest, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, PasskeyNotFoundError, type PayOptions, type PaymentContext, type PaymentError, type PaymentHandle, type PaymentHandlers, type PaymentHistoryOptions, type PaymentHistoryResult, type PaymentItem, type PaymentResult, type PaymentStatus, type PaymentToken, type PlatformCheckResult, type PrfInputDto, PrfNotSupportedError, type SendBatchOverloads, type SendTxOptions, type SignRequest, type SignerType, type SiweSession, type SiweSessionStatus, type SocialProvider, type TransactionDto, type TransactionStatus, type UseMpcConnectionReturn, type UsePasskeyEnrollmentReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type UseVolrPaymentApiReturn, UserCancelledError, type UserDto, type VolrClient, type VolrConfig, type VolrContextValue, VolrProvider, type VolrUser, type WalletStateComparison, analyzeContractForEIP7702, buildCall, buildCalls, checkPrfExtensionAvailable, checkPrfSupport, compareERC20Balances, compareWalletStates, completeMigration, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, defaultIdempotencyKey, diagnoseTransactionFailure, getERC20Balance, getPasskeyAuthGuidance, getUserCredentials, getWalletState, isEIP7702Delegated, isUserCancelledError, listenForSeedRequests, normalizeHex, normalizeHexArray, openMigrationPopup, requestMigration, requestSeedFromOpener, sendSeedToPopup, uploadBlobViaPresign, useDepositListener, useInternalAuth, useMpcConnection, usePasskeyEnrollment, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin, useVolrPaymentApi };
1463
+ /**
1464
+ * EIP-6963: Multi Injected Provider Discovery
1465
+ * https://eips.ethereum.org/EIPS/eip-6963
1466
+ */
1467
+ interface EIP6963ProviderInfo {
1468
+ uuid: string;
1469
+ name: string;
1470
+ icon: string;
1471
+ rdns: string;
1472
+ }
1473
+ interface EIP6963ProviderDetail {
1474
+ info: EIP6963ProviderInfo;
1475
+ provider: any;
1476
+ }
1477
+ interface EIP6963AnnounceProviderEvent extends Event {
1478
+ detail: EIP6963ProviderDetail;
1479
+ }
1480
+ /**
1481
+ * Wallet display info for UI rendering
1482
+ */
1483
+ interface WalletDisplayInfo {
1484
+ id: string;
1485
+ name: string;
1486
+ icon?: string;
1487
+ rdns?: string;
1488
+ provider: any;
1489
+ isLegacy?: boolean;
1490
+ }
1491
+
1492
+ /**
1493
+ * EIP-6963 Multi Injected Provider Discovery Hook
1494
+ *
1495
+ * Detects wallet providers in the browser using EIP-6963 standard
1496
+ * with fallback to legacy window.ethereum.
1497
+ */
1498
+
1499
+ interface UseEIP6963Return {
1500
+ /** Best available provider (EIP-6963 first, then window.ethereum) */
1501
+ provider: any | null;
1502
+ /** Provider info if from EIP-6963 */
1503
+ providerInfo: EIP6963ProviderInfo | null;
1504
+ /** Whether any wallet is available */
1505
+ hasWallet: boolean;
1506
+ /** Whether detection is still in progress */
1507
+ isDetecting: boolean;
1508
+ /** All detected EIP-6963 providers */
1509
+ allProviders: EIP6963ProviderDetail[];
1510
+ /** Has legacy window.ethereum provider */
1511
+ hasLegacyProvider: boolean;
1512
+ /** Get all wallets for UI display (EIP-6963 + legacy fallback) */
1513
+ getWalletsForDisplay: () => WalletDisplayInfo[];
1514
+ }
1515
+ /**
1516
+ * Detects wallet providers using EIP-6963 with window.ethereum fallback
1517
+ */
1518
+ declare function useEIP6963(): UseEIP6963Return;
1519
+ /**
1520
+ * Detect wallet connector identifier from provider
1521
+ */
1522
+ declare function detectWalletConnector(provider: any, providerInfo: EIP6963ProviderInfo | null): string;
1523
+
1524
+ export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BrandingData, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type EIP6963AnnounceProviderEvent, type EIP6963ProviderDetail, type EIP6963ProviderInfo, type ERC20BalanceComparison, type Erc20Token$1 as Erc20Token, type EvmChainClient, type EvmClient, type EvmNamespace, type KeyStorageType, type MigrationCompleteParams, type MigrationCompleteResult, type MigrationError, type MigrationMessage, type MigrationRequestParams, type MigrationRequestResult, type MigrationSeedRequest, type MigrationSeedResponse, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type OnSignRequest, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, PasskeyNotFoundError, type PayOptions, type PaymentContext, type PaymentError, type PaymentHandle, type PaymentHandlers, type PaymentHistoryOptions, type PaymentHistoryResult, type PaymentItem, type PaymentResult, type PaymentStatus, type PaymentToken, type PlatformCheckResult, type PrfInputDto, PrfNotSupportedError, type SendBatchOverloads, type SendTxOptions, type SignRequest, type SignerType, type SiweSession, type SiweSessionStatus, type SocialProvider, type TokenBalance, type TransactionDto, type TransactionStatus, type UseEIP6963Return, type UseMpcConnectionReturn, type UsePasskeyEnrollmentReturn, type UseUserBalancesReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type UseVolrPaymentApiReturn, type UseWithdrawReturn, UserCancelledError, type UserDto, type VolrClient, type VolrConfig, type VolrContextValue, VolrProvider, type VolrUser, type WalletDisplayInfo, type WalletStateComparison, type WithdrawParams, analyzeContractForEIP7702, buildCall, buildCalls, checkPrfExtensionAvailable, checkPrfSupport, compareERC20Balances, compareWalletStates, completeMigration, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, defaultIdempotencyKey, detectWalletConnector, diagnoseTransactionFailure, getERC20Balance, getPasskeyAuthGuidance, getUserCredentials, getWalletState, isEIP7702Delegated, isUserCancelledError, listenForSeedRequests, normalizeHex, normalizeHexArray, openMigrationPopup, requestMigration, requestSeedFromOpener, sendSeedToPopup, uploadBlobViaPresign, useDepositListener, useEIP6963, useInternalAuth, useMpcConnection, usePasskeyEnrollment, useUserBalances, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin, useVolrPaymentApi, useWithdraw };
package/dist/index.d.ts CHANGED
@@ -956,6 +956,99 @@ interface UseVolrPaymentApiReturn {
956
956
  }
957
957
  declare function useVolrPaymentApi(): UseVolrPaymentApiReturn;
958
958
 
959
+ /**
960
+ * useUserBalances hook - Fetch user's token balances for project deposit assets
961
+ */
962
+
963
+ /**
964
+ * Token balance with metadata
965
+ */
966
+ interface TokenBalance {
967
+ /** Unique identifier: chainId_address or chainId_native */
968
+ id: string;
969
+ /** Chain ID */
970
+ chainId: number;
971
+ /** Token symbol */
972
+ symbol: string;
973
+ /** Token decimals */
974
+ decimals: number;
975
+ /** Token address (0x0 for native) */
976
+ address: string;
977
+ /** Token icon URL */
978
+ iconUrl?: string;
979
+ /** Whether this is native token */
980
+ isNative: boolean;
981
+ /** Raw balance in smallest unit */
982
+ balanceRaw: bigint;
983
+ /** Formatted balance string */
984
+ balance: string;
985
+ /** USD value (if available) */
986
+ balanceUsd?: number;
987
+ /** Whether balance is loading */
988
+ isLoading: boolean;
989
+ /** Error if balance fetch failed */
990
+ error?: string;
991
+ }
992
+ /**
993
+ * Branding data with payment enabled flag
994
+ */
995
+ interface BrandingData {
996
+ depositAssets: DepositAsset$1[];
997
+ paymentEnabled: boolean;
998
+ }
999
+ interface UseUserBalancesReturn {
1000
+ /** Array of token balances */
1001
+ balances: TokenBalance[];
1002
+ /** Total USD value of all balances */
1003
+ totalUsd: number;
1004
+ /** Whether any balance is loading */
1005
+ isLoading: boolean;
1006
+ /** Whether payment feature is enabled for this project */
1007
+ paymentEnabled: boolean;
1008
+ /** Refresh all balances */
1009
+ refresh: () => Promise<void>;
1010
+ /** Error if branding fetch failed */
1011
+ error: Error | null;
1012
+ }
1013
+ /**
1014
+ * Hook to fetch user's token balances for project deposit assets
1015
+ */
1016
+ declare function useUserBalances(): UseUserBalancesReturn;
1017
+
1018
+ /**
1019
+ * useWithdraw hook - Withdraw tokens to external address
1020
+ */
1021
+
1022
+ interface WithdrawParams {
1023
+ /** Chain ID to withdraw from */
1024
+ chainId: number;
1025
+ /** Token address (use 'native' for native token) */
1026
+ tokenAddress: string;
1027
+ /** Token decimals */
1028
+ decimals: number;
1029
+ /** Amount to withdraw (human readable, e.g., "1.5") */
1030
+ amount: string;
1031
+ /** Destination address */
1032
+ to: `0x${string}`;
1033
+ }
1034
+ interface UseWithdrawReturn {
1035
+ /** Execute withdrawal */
1036
+ withdraw: (params: WithdrawParams) => Promise<RelayResult>;
1037
+ /** Whether withdrawal is in progress */
1038
+ isWithdrawing: boolean;
1039
+ /** Last withdrawal result */
1040
+ result: RelayResult | null;
1041
+ /** Error if withdrawal failed */
1042
+ error: Error | null;
1043
+ /** Reset state */
1044
+ reset: () => void;
1045
+ }
1046
+ /**
1047
+ * Hook to withdraw tokens to external address
1048
+ * Uses existing relay infrastructure for gas sponsorship
1049
+ */
1050
+ declare function useWithdraw(): UseWithdrawReturn;
1051
+
959
1052
  /**
960
1053
  * Passkey adapter for WebAuthn
961
1054
  * Implements PasskeyProviderPort interface
@@ -1367,4 +1460,65 @@ declare function getUserCredentials(client: APIClient): Promise<Array<{
1367
1460
  createdAt: string;
1368
1461
  }>>;
1369
1462
 
1370
- export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type ERC20BalanceComparison, type Erc20Token$1 as Erc20Token, type EvmChainClient, type EvmClient, type EvmNamespace, type KeyStorageType, type MigrationCompleteParams, type MigrationCompleteResult, type MigrationError, type MigrationMessage, type MigrationRequestParams, type MigrationRequestResult, type MigrationSeedRequest, type MigrationSeedResponse, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type OnSignRequest, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, PasskeyNotFoundError, type PayOptions, type PaymentContext, type PaymentError, type PaymentHandle, type PaymentHandlers, type PaymentHistoryOptions, type PaymentHistoryResult, type PaymentItem, type PaymentResult, type PaymentStatus, type PaymentToken, type PlatformCheckResult, type PrfInputDto, PrfNotSupportedError, type SendBatchOverloads, type SendTxOptions, type SignRequest, type SignerType, type SiweSession, type SiweSessionStatus, type SocialProvider, type TransactionDto, type TransactionStatus, type UseMpcConnectionReturn, type UsePasskeyEnrollmentReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type UseVolrPaymentApiReturn, UserCancelledError, type UserDto, type VolrClient, type VolrConfig, type VolrContextValue, VolrProvider, type VolrUser, type WalletStateComparison, analyzeContractForEIP7702, buildCall, buildCalls, checkPrfExtensionAvailable, checkPrfSupport, compareERC20Balances, compareWalletStates, completeMigration, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, defaultIdempotencyKey, diagnoseTransactionFailure, getERC20Balance, getPasskeyAuthGuidance, getUserCredentials, getWalletState, isEIP7702Delegated, isUserCancelledError, listenForSeedRequests, normalizeHex, normalizeHexArray, openMigrationPopup, requestMigration, requestSeedFromOpener, sendSeedToPopup, uploadBlobViaPresign, useDepositListener, useInternalAuth, useMpcConnection, usePasskeyEnrollment, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin, useVolrPaymentApi };
1463
+ /**
1464
+ * EIP-6963: Multi Injected Provider Discovery
1465
+ * https://eips.ethereum.org/EIPS/eip-6963
1466
+ */
1467
+ interface EIP6963ProviderInfo {
1468
+ uuid: string;
1469
+ name: string;
1470
+ icon: string;
1471
+ rdns: string;
1472
+ }
1473
+ interface EIP6963ProviderDetail {
1474
+ info: EIP6963ProviderInfo;
1475
+ provider: any;
1476
+ }
1477
+ interface EIP6963AnnounceProviderEvent extends Event {
1478
+ detail: EIP6963ProviderDetail;
1479
+ }
1480
+ /**
1481
+ * Wallet display info for UI rendering
1482
+ */
1483
+ interface WalletDisplayInfo {
1484
+ id: string;
1485
+ name: string;
1486
+ icon?: string;
1487
+ rdns?: string;
1488
+ provider: any;
1489
+ isLegacy?: boolean;
1490
+ }
1491
+
1492
+ /**
1493
+ * EIP-6963 Multi Injected Provider Discovery Hook
1494
+ *
1495
+ * Detects wallet providers in the browser using EIP-6963 standard
1496
+ * with fallback to legacy window.ethereum.
1497
+ */
1498
+
1499
+ interface UseEIP6963Return {
1500
+ /** Best available provider (EIP-6963 first, then window.ethereum) */
1501
+ provider: any | null;
1502
+ /** Provider info if from EIP-6963 */
1503
+ providerInfo: EIP6963ProviderInfo | null;
1504
+ /** Whether any wallet is available */
1505
+ hasWallet: boolean;
1506
+ /** Whether detection is still in progress */
1507
+ isDetecting: boolean;
1508
+ /** All detected EIP-6963 providers */
1509
+ allProviders: EIP6963ProviderDetail[];
1510
+ /** Has legacy window.ethereum provider */
1511
+ hasLegacyProvider: boolean;
1512
+ /** Get all wallets for UI display (EIP-6963 + legacy fallback) */
1513
+ getWalletsForDisplay: () => WalletDisplayInfo[];
1514
+ }
1515
+ /**
1516
+ * Detects wallet providers using EIP-6963 with window.ethereum fallback
1517
+ */
1518
+ declare function useEIP6963(): UseEIP6963Return;
1519
+ /**
1520
+ * Detect wallet connector identifier from provider
1521
+ */
1522
+ declare function detectWalletConnector(provider: any, providerInfo: EIP6963ProviderInfo | null): string;
1523
+
1524
+ export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BrandingData, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type EIP6963AnnounceProviderEvent, type EIP6963ProviderDetail, type EIP6963ProviderInfo, type ERC20BalanceComparison, type Erc20Token$1 as Erc20Token, type EvmChainClient, type EvmClient, type EvmNamespace, type KeyStorageType, type MigrationCompleteParams, type MigrationCompleteResult, type MigrationError, type MigrationMessage, type MigrationRequestParams, type MigrationRequestResult, type MigrationSeedRequest, type MigrationSeedResponse, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type OnSignRequest, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, PasskeyNotFoundError, type PayOptions, type PaymentContext, type PaymentError, type PaymentHandle, type PaymentHandlers, type PaymentHistoryOptions, type PaymentHistoryResult, type PaymentItem, type PaymentResult, type PaymentStatus, type PaymentToken, type PlatformCheckResult, type PrfInputDto, PrfNotSupportedError, type SendBatchOverloads, type SendTxOptions, type SignRequest, type SignerType, type SiweSession, type SiweSessionStatus, type SocialProvider, type TokenBalance, type TransactionDto, type TransactionStatus, type UseEIP6963Return, type UseMpcConnectionReturn, type UsePasskeyEnrollmentReturn, type UseUserBalancesReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type UseVolrPaymentApiReturn, type UseWithdrawReturn, UserCancelledError, type UserDto, type VolrClient, type VolrConfig, type VolrContextValue, VolrProvider, type VolrUser, type WalletDisplayInfo, type WalletStateComparison, type WithdrawParams, analyzeContractForEIP7702, buildCall, buildCalls, checkPrfExtensionAvailable, checkPrfSupport, compareERC20Balances, compareWalletStates, completeMigration, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, defaultIdempotencyKey, detectWalletConnector, diagnoseTransactionFailure, getERC20Balance, getPasskeyAuthGuidance, getUserCredentials, getWalletState, isEIP7702Delegated, isUserCancelledError, listenForSeedRequests, normalizeHex, normalizeHexArray, openMigrationPopup, requestMigration, requestSeedFromOpener, sendSeedToPopup, uploadBlobViaPresign, useDepositListener, useEIP6963, useInternalAuth, useMpcConnection, usePasskeyEnrollment, useUserBalances, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin, useVolrPaymentApi, useWithdraw };