Skip to main content
These hooks let you build custom UIs on top of the Spice Flow SDK. If the prebuilt components don’t fit your use case, use these hooks to access wallet state, balances, and execution directly.

useSpiceExecution

The core execution hook. Handles EIP 7702 delegation signing, intent submission, and solver execution polling. This is what powers SpiceDeposit under the hood.

Usage

Return Value

The hook returns execute (not executeGasless), plus fee estimation, status, and a status reset:
The SDK holds its own concurrency lock and throws on an overlapping execute call, so you do not need a module-level mutex. For multi-step flows, call clearStatus() between executions.

Progress Steps

The onProgress callback receives updates as execution proceeds:

useSpiceAssets

Fetch the user’s Spice balance from the relayer API. This returns the off chain balance (what the user has deposited via escrow), not on chain wallet balances.

Usage

Config

Return Value


useSupplyAssets

Lists every asset the user can fund a given destination token with — wallet balances and Spice balances, across all supported chains. This is the source-selection half of a custom supply UI (see the Custom UI Integration guide for the full flow).

Usage

Return Value


useSupplyQuote

Resolves routing for a selected source asset: whether it funds the destination token directly or needs a swap, and the quote for it. Feed its output into buildSupplyChainBatches / estimateFeePreview — see Custom UI Integration.

Usage

Return Value


useWallet

Access wallet connection state and signing actions for the configured provider (Privy).

Usage

Return Value


Getting the embedded wallet address

There is no standalone useEmbeddedWalletAddress hook. In 7702 mode the embedded wallet is the on-chain identity; read its address from useWallet() or from the provider context:

useAssetInput

Manage asset selection and amount input state. Used to control the asset selector in deposit and lock flows from your own UI.

Usage

Return Value


useLockDuration

Manage lock duration selection state for SpiceLock.

Usage


useSpicePendingDeposits

Detect funds stranded in the user’s embedded wallet (deposits that were sent but not yet credited to Spice balance). Used by SpiceDeposit internally for recovery flows.

Usage


useSpiceBrand

Resolve the current theme from the provider’s theme prop and any component-level styles/dark overrides. Only used when building custom components that need to match the SDK’s look.

Usage

Return Value


Next Steps

Components

Use prebuilt components for common flows

Styling

Customize appearance with the brand system

API Reference

Explore the REST API for advanced use cases

Configuration

Configure chains and providers