Skip to main content

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:
OptionTypeDescription
privyAppIdstringYour Privy application ID (required)
embeddedWalletConfigobjectEmbedded wallet behavior configuration
embeddedWalletConfig.createOnLogin'off' | 'users-without-wallets' | 'all-users'When to create embedded wallets
Get Your Privy App ID:
  1. Sign up at privy.io
  2. Create a new app
  3. 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:
OptionTypeDescription
dynamicEnvironmentIdstringYour Dynamic environment ID (required)
Get Your Dynamic Environment ID:
  1. Sign up at dynamic.xyz
  2. Create a new project
  3. 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>

SwapWidget Configuration

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

OptionTypeDefaultDescription
swapBatchesChainBatch[]RequiredChain batches for execution
supportedChainsnumber[]RequiredArray of supported chain IDs
tokenAddressstring'0x0'Token address (0x0 for native)
theme'light' | 'dark''light'Color theme
showSlippageSettingsbooleantrueShow slippage configuration
enableFlipSwapbooleantrueEnable asset flip button
stylesSwapWidgetStyles-Custom styling object

Complete Provider Reference

PropTypeDefaultDescription
provider'privy' | 'dynamic'RequiredWallet provider
privyAppIdstring-Privy app ID (required for Privy)
dynamicEnvironmentIdstring-Dynamic environment ID (required for Dynamic)
supportedChainIdsnumber[][11155111, 421614, 5115, 123420001114]Supported chains
mode'7702' | 'presign' | 'ondemand''7702'Execution mode
nativeChainIdnumber-Native chain for non-7702 modes
appNamestring'Spicenet'Application name
embeddedWalletConfigobject-Embedded wallet config

Next Steps