useSpiceExecution
The core execution hook. Handles EIP 7702 delegation signing, intent submission, and solver execution polling. This is what powersSpiceDeposit under the hood.
Usage
Return Value
Progress Steps
TheonProgress callback receives updates as execution proceeds:
| Step | Description |
|---|---|
idle | Not started |
building | Building the intent |
signing-delegation | User signing EIP 7702 delegation |
signing-intent | User signing the intent hash |
submitting | Submitting to the solver |
executing | Solver executing on chain |
success | Execution complete |
error | Something went wrong |
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
| Param | Type | Default | Description |
|---|---|---|---|
address | string | Wallet address to query | |
supportedChains | number[] | Filter to specific chains | |
enabled | boolean | true | Enable or disable fetching |
refetchInterval | number | Auto refetch interval in ms |
Return Value
| Field | Type | Description |
|---|---|---|
assets | Asset[] | Array of deposited assets with balances |
loading | boolean | True during initial load |
error | string | null | Error message if fetch failed |
hasBalance | boolean | Whether user has any balance |
refetch | () => Promise<void> | Manually refetch balances |
getAssetsByChain | (chainId) => Asset[] | Filter assets by chain |
useWallet
Access wallet connection state and signing actions. Works with both Privy and Dynamic providers.Usage
Return Value
| Field | Type | Description |
|---|---|---|
isReady | boolean | Provider is initialized |
isAuthenticated | boolean | User has authenticated |
isConnected | boolean | Wallet is connected |
address | Address | undefined | Connected wallet address |
provider | "privy" | "dynamic" | null | Active provider |
actions.signMessage | (message) => Promise<{signature}> | Sign a message |
actions.signAuthorization | (params) => Promise<Authorization> | Sign EIP 7702 authorization |
useEmbeddedWalletAddress
Get the Privy embedded wallet address. Returnsundefined if no embedded wallet exists or in non 7702 mode.
Usage
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
| Field | Type | Description |
|---|---|---|
selectedAsset | SelectedAsset | null | Currently selected asset |
setSelectedAsset | (asset) => void | Set the selected asset |
assetAmount | string | Current amount string |
setAssetAmount | (amount) => void | Set the amount |
useLockDuration
Manage lock duration selection state for the SpiceLockModal.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’sbrand 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
| Field | Type | Description |
|---|---|---|
dark | boolean | Whether dark mode is active |
primaryColor | string | Brand accent color |
theme | Theme | Full theme object |
dk | ResolvedDarkPalette | Dark palette values |
palette | ResolvedDarkPalette | Mode resolved palette (light or dark) |
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
