SpiceFlowProvider
The root provider component that wraps your application and manages wallet connections.Usage
Props
| Prop | Type | Required | Description |
|---|---|---|---|
provider | 'privy' | 'dynamic' | 'para' | Yes | Wallet provider to use |
children | ReactNode | Yes | Your application components |
privyAppId | string | If using Privy | Privy application ID |
dynamicEnvironmentId | string | If using Dynamic | Dynamic environment ID |
paraApiKey | string | If using Para | Para API key |
paraAppName | string | If using Para | Para application name |
defaultChain | Chain | No | Default chain (from viem) |
supportedChains | Chain[] | Yes | Array of supported chains for your app |
Examples
SwapWidget
Pre-built UI component for cross-chain swaps with built-in asset selection, balance display, and transaction execution.Usage
Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
swapBatches | ChainBatch[] | Yes | - | Array of chain batches for cross-chain execution |
supportedChains | number[] | Yes | - | Array of supported chain IDs for swap |
tokenAddress | string | No | '0x0' | Token address for the swap (0x0 for native) |
theme | 'light' | 'dark' | No | 'light' | Color theme |
styles | SwapWidgetStyles | No | - | Custom styling object |
showSlippageSettings | boolean | No | true | Show/hide slippage settings |
enableFlipSwap | boolean | No | true | Enable asset flipping button |
fromInputHook | UseFromInputReturn | No | - | External hook for “from” input control |
toInputUpdateHook | UseToInputUpdateReturn | No | - | External hook for “to” input updates |
ChainBatch Type
Custom Styling
You can customize the widget appearance using thestyles prop:
Example with Swap Batches
ProviderLogin
Wallet connection button that adapts to your selected provider (Privy, Dynamic, or Para).Usage
Props
| Prop | Type | Required | Description |
|---|---|---|---|
styles | LoginStyles | No | Custom styling for the login button |
Example
- Privy: “Login with Privy”
- Dynamic: “Connect Wallet”
- Para: “Login with Para”
