BluxBlux

Hooks

React hooks for querying Stellar network data and managing wallet state.

Blux provides hooks for white-label authentication, managing wallet state (network and transactions), and querying Stellar network data (accounts, balances, trades, and more).

Use useLoginEmail, useLoginSms, useLoginOAuth, useLoginPasskey, and useLoginWallet to build your own login screen. See the white-label login guide for complete examples.

All data-fetching hooks are built on TanStack Query and support the full suite of query options including caching, background refetching, pagination, and dependent queries.

Hooks backed by a core address field accept the same G…, M…, C…, SEP-2, and .xlm values as the corresponding core function. Invalid and unregistered names surface through the query or mutation's error. See address resolution and .xlm names.


useAccount

Fetch details of a Stellar account in your React app using the Blux SDK.

useAccounts

Fetch a filtered list of Stellar accounts in your React app using the Blux SDK.

useAssets

Fetch a paginated list of Stellar assets in your React app using the Blux SDK.

useBalances

Fetch the balances of a Stellar account in your React app using the Blux SDK.

useClaimableBalances

Fetch a paginated list of claimable balances in your React app using the Blux SDK.

useEffects

Fetch a paginated list of Stellar effects in your React app using the Blux SDK.

useLedgers

Fetch a paginated list of Stellar ledgers in your React app using the Blux SDK.

useLiquidityPools

Fetch a paginated list of Stellar liquidity pools in your React app using the Blux SDK.

useNetwork

Retrieve the currently active network in your React app using the Blux SDK.

useOffers

Fetch a paginated list of Stellar offers in your React app using the Blux SDK.

useOperations

Fetch a paginated list of Stellar operations in your React app using the Blux SDK.

useOrderbook

Fetch orderbook data for an asset pair in your React app using the Blux SDK.

usePayments

Fetch a paginated list of Stellar payments in your React app using the Blux SDK.

useReadContract

Read one value from a Soroban smart contract in React, powered by TanStack Query.

useReadContracts

Read state from Soroban smart contracts in React, powered by TanStack Query.

useResolveXlmNameByAddress

Find a verified XLM Domains name for a Stellar account in React.

useResolveXlmName

Resolve an XLM Domains name in React with TanStack Query caching and status state.

useSacAddress

Derive the Stellar Asset Contract (SAC) id of a classic asset in React — synchronous and memoized.

useStrictReceivePaths

Fetch strict receive payment paths in your React app using the Blux SDK.

useStrictSendPaths

Fetch strict send payment paths in your React app using the Blux SDK.

useSwap

Swap one asset for another from React, powered by a TanStack Query mutation.

useSwitchNetwork

Change the active network in your React app using the Blux SDK.

useTokenMetadata

Read a SEP-41 token / Stellar Asset Contract's metadata in React, powered by TanStack Query.

useTradeAggregation

Fetch aggregated trade data for an asset pair in your React app using the Blux SDK.

useTrades

Fetch a paginated list of Stellar trades in your React app using the Blux SDK.

useTransactions

Fetch a paginated list of Stellar transactions in your React app using the Blux SDK.

useTransfer

Send XLM, issued assets, or SEP-41 tokens from React.

useWriteContract

Invoke state-changing Soroban contract methods from React, powered by TanStack Query.