> For the complete documentation index, see [llms.txt](https://fifo-docs.gitbook.io/colibri/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fifo-docs.gitbook.io/colibri/colibri-react/hooks.md).

# Hooks

Each public React hook has its own reference below: purpose, parameters, result, short TSX example and important lifecycle behavior. Start with [setup and providers](/colibri/colibri-react/setup.md) if this is your first Colibri component.

[`ColibriQueryProvider`](/colibri/colibri-react/setup.md) supplies both providers required by query and mutation hooks. See [common workflows](/colibri/colibri-react/convenience.md) for one complete provider and wallet setup.

Examples are complete components with application inputs supplied as props. They assume the providers stated on each page are mounted above the component. Keep hooks unconditional; disable a query with its supported missing input or `enabled: false` instead of conditionally calling a hook. A disabled query may still report `isPending` before it has data; check the missing input or fetching state before rendering an indefinite loading indicator.

Queries and mutations return TanStack Query results. Connection actions instead return Promise-producing functions. See [queries and caching](/colibri/colibri-react/queries.md) for shared controls, invalidation and server rendering.

## Configuration and connection

* [useWallet](/colibri/colibri-react/hooks/use-wallet.md): Observe wallet state, guarded signers and explicit connection actions together.
* [useColibriConfig](/colibri/colibri-react/hooks/use-colibri-config.md): Read the application configuration supplied by the nearest provider.
* [useConnection](/colibri/colibri-react/hooks/use-connection.md): Observe the current wallet connection and connection lifecycle.
* [useConnect](/colibri/colibri-react/hooks/use-connect.md): Connect an explicitly selected wallet connector.
* [useReconnect](/colibri/colibri-react/hooks/use-reconnect.md): Restore a previously authorized wallet connection without prompting.
* [useDisconnect](/colibri/colibri-react/hooks/use-disconnect.md): Clear the active connection and request wallet-side disconnection when supported.
* [useNetwork](/colibri/colibri-react/hooks/use-network.md): Read the provider’s configured Stellar network.

## RPC

* [useRpc](/colibri/colibri-react/hooks/use-rpc.md): Access a memoized Stellar RPC client for advanced calls.
* [useLatestLedger](/colibri/colibri-react/hooks/use-latest-ledger.md): Query the latest ledger observed by the configured RPC server.
* [useTransaction](/colibri/colibri-react/hooks/use-transaction.md): Look up a transaction hash through Stellar RPC.
* [useWaitForTransaction](/colibri/colibri-react/hooks/use-wait-for-transaction.md): Poll a transaction hash until RPC reports a terminal status.

## Accounts

* [useLedgerEntries](/colibri/colibri-react/hooks/use-ledger-entries.md): Access a stable Core ledger reader for direct, known-key reads.
* [useAccount](/colibri/colibri-react/hooks/use-account.md): Read a Classic account’s ledger entry, including balance, thresholds and signers.
* [useTrustline](/colibri/colibri-react/hooks/use-trustline.md): Read a Classic trustline’s balance and ledger metadata.

## Assets

* [useBalance](/colibri/colibri-react/hooks/use-balance.md): Read an exact XLM, Classic issued-asset or [SEP-41](/colibri/colibri-core/asset/sep-41-token-contract.md) token balance.
* [useTokenMetadata](/colibri/colibri-react/hooks/use-token-metadata.md): Read a deployed [SEP-41](/colibri/colibri-core/asset/sep-41-token-contract.md) contract’s name, symbol and decimal precision.

## Contract instances

* [useContract](/colibri/colibri-react/hooks/use-contract.md): Retain a full Core Contract or generated subclass across ordinary rerenders.

## Contract reads

* [useContractRead](/colibri/colibri-react/hooks/use-contract-read.md): Query a generated client’s typed method helper through its existing [read pipeline](/colibri/colibri-core/pipelines/read-from-contract.md).
* [useContractReadSpec](/colibri/colibri-react/hooks/use-contract-read-spec.md): Simulate a spec-described method without constructing a full Contract client.

## Contract invocations

* [useWalletContractInvoke](/colibri/colibri-react/hooks/use-wallet-contract-invoke.md): Invoke a generated method with wallet-derived source and signers, preserving explicit overrides.
* [useContractInvoke](/colibri/colibri-react/hooks/use-contract-invoke.md): Invoke a generated method using the client’s existing invocation pipeline.

## Application mutations

* [useColibriMutation](/colibri/colibri-react/hooks/use-colibri-mutation.md): Run an application-owned SDK action with Colibri’s serialization and no automatic retries.

## Classic transactions

* [useClassicTransaction](/colibri/colibri-react/hooks/use-classic-transaction.md): Submit Classic operations through Colibri’s existing Classic pipeline.

## Soroban transactions

* [useSorobanTransaction](/colibri/colibri-react/hooks/use-soroban-transaction.md): Run the existing Soroban invocation pipeline from a component action.

## Simulation

* [useSimulateSorobanTransaction](/colibri/colibri-react/hooks/use-simulate-soroban-transaction.md): Simulate a prepared native Soroban transaction without signing or submitting it.

## Events

* [useContractEvents](/colibri/colibri-react/hooks/use-contract-events.md): Observe an application-owned, shared contract-event stream.

## Signers

* [useSigners](/colibri/colibri-react/hooks/use-signers.md): Read the connected wallet’s explicit, guarded signing capabilities.
* [useSignMessage](/colibri/colibri-react/hooks/use-sign-message.md): Request a [SEP-53](/colibri/colibri-core/signer/message-signing.md) signature from the connection’s optional message signer.

## WebAuth and sessions

* [useWebAuthClient](/colibri/colibri-react/hooks/use-web-auth-client.md): Discover a unified SEP-10/SEP-45 WebAuth client for a service domain.
* [useSession](/colibri/colibri-react/hooks/use-session.md): Observe a shared, memory-only WebAuth session.
* [useWebAuth](/colibri/colibri-react/hooks/use-web-auth.md): Authenticate on demand through a shared WebAuth session.

## SEP-1 discovery

* [useStellarToml](/colibri/colibri-react/hooks/use-stellar-toml.md): Fetch and validate a domain’s [SEP-1](/colibri/colibri-core/sep1.md) stellar.toml discovery document.

## Identicons

* [useIdenticon](/colibri/colibri-react/hooks/use-identicon.md): Generate a deterministic SVG data URL for a Stellar address locally.
