Wallet Providers
Spice Flow supports two major wallet providers. Choose the one that best fits your needs.
Privy
Best for embedded wallets and social logins.
<SpiceFlowProvider
provider="privy"
privyAppId="your-privy-app-id"
>
{children}
</SpiceFlowProvider>
Configuration Options:
| Option | Type | Description |
|---|
privyAppId | string | Your Privy application ID (required) |
embeddedWalletConfig | object | Embedded wallet behavior configuration |
embeddedWalletConfig.createOnLogin | 'off' | 'users-without-wallets' | 'all-users' | When to create embedded wallets |
Get Your Privy App ID:
- Sign up at privy.io
- Create a new app
- Copy your App ID from the dashboard
Dynamic
Best for multi-wallet support and flexible authentication.
<SpiceFlowProvider
provider="dynamic"
dynamicEnvironmentId="your-dynamic-environment-id"
>
{children}
</SpiceFlowProvider>
Configuration Options:
| Option | Type | Description |
|---|
dynamicEnvironmentId | string | Your Dynamic environment ID (required) |
Get Your Dynamic Environment ID:
- Sign up at dynamic.xyz
- Create a new project
- Copy your Environment ID from settings
Execution Modes
Spice Flow supports three execution modes for different use cases.
7702 Mode (Default)
Uses EIP-7702 with embedded wallets for the best user experience. Transactions are executed via delegate contracts.
<SpiceFlowProvider
provider="privy"
privyAppId="your-app-id"
mode="7702"
>
{children}
</SpiceFlowProvider>
Presign Mode
Pre-signed transaction mode for external wallets. Users sign all transactions upfront.
<SpiceFlowProvider
provider="privy"
privyAppId="your-app-id"
mode="presign"
nativeChainId={11155111}
>
{children}
</SpiceFlowProvider>
Ondemand Mode
On-demand signing mode. Each transaction is signed as needed during execution.
<SpiceFlowProvider
provider="privy"
privyAppId="your-app-id"
mode="ondemand"
nativeChainId={11155111}
>
{children}
</SpiceFlowProvider>
In presign and ondemand modes, the embedded wallet providers (Privy/Dynamic auth flows) are skipped. Users connect their external wallets directly.
Supported Chains
Configure which chains your application supports.
Default Chains
The SDK defaults to: Sepolia (11155111), Arbitrum Sepolia (421614), Citrea (5115), and Basecamp (123420001114).
import { sepolia, arbitrumSepolia } from 'viem/chains';
<SpiceFlowProvider
provider="privy"
privyAppId="your-app-id"
supportedChainIds={[11155111, 421614]}
>
{children}
</SpiceFlowProvider>
Configure the swap widget behavior and appearance.
Basic Configuration
<SwapWidget
swapBatches={batches}
supportedChains={[11155111, 421614]}
tokenAddress="0x0" // Native token
showSlippageSettings={true}
enableFlipSwap={true}
theme="light"
/>
Configuration Options
| Option | Type | Default | Description |
|---|
swapBatches | ChainBatch[] | Required | Chain batches for execution |
supportedChains | number[] | Required | Array of supported chain IDs |
tokenAddress | string | '0x0' | Token address (0x0 for native) |
theme | 'light' | 'dark' | 'light' | Color theme |
showSlippageSettings | boolean | true | Show slippage configuration |
enableFlipSwap | boolean | true | Enable asset flip button |
styles | SwapWidgetStyles | - | Custom styling object |
Complete Provider Reference
| Prop | Type | Default | Description |
|---|
provider | 'privy' | 'dynamic' | Required | Wallet provider |
privyAppId | string | - | Privy app ID (required for Privy) |
dynamicEnvironmentId | string | - | Dynamic environment ID (required for Dynamic) |
supportedChainIds | number[] | [11155111, 421614, 5115, 123420001114] | Supported chains |
mode | '7702' | 'presign' | 'ondemand' | '7702' | Execution mode |
nativeChainId | number | - | Native chain for non-7702 modes |
appName | string | 'Spicenet' | Application name |
embeddedWalletConfig | object | - | Embedded wallet config |
Next Steps