Skip to main content
This reference is verified against the published @spicenet-io/spiceflow-ui package by tools/check-sdk-drift.mjs on every change. The check verifies export and prop names; examples and behavioral guidance target stable SDK 5.0.3 with core 0.10.3.

SpiceFlowProvider

The root provider for chain configuration, theming, and execution mode. It reads wallet state from Privy, wagmi, and react-query. Mount those above it in your app (see Quick Start Step 2).

Usage

Props

Examples


SpiceDeposit

The account deposit flow handles Privy login, external wallet connection, token selection, escrow deposit, 7702 signing and solver execution. Since 5.0.2, depositBatches can continue a funded or recovered deposit through delivery to your app in the same modal. See Deposit and deliver to your app. Use SpiceSupply for a protocol action.

Usage

Props

To restrict which tokens appear, set allowedTokens on SpiceFlowProvider (lowercase symbols), not on SpiceDeposit.
With swapper={{ enabled: true }} on SpiceFlowProvider, the modal opens with a Wallet / Card / Exchange chooser so users can fund by debit card or from an exchange. Off by default. See Card and Exchange Deposits for where the funds land in each wallet mode.

Elysium HYPE and KNTQ deposits

Use embedded account mode (7702) on mainnet and select native HYPE or canonical KNTQ on Elysium. The SDK checks the active escrow mappings and credits the matching spiceHYPE or spiceKNTQ receipt when the escrow deposit completes. Both receipts use 18 decimals. Verify the matching receipt credit before treating the amount as available in the Spicenet balance. A deposit callback can also report funds in the embedded wallet. For existing funds in the embedded wallet, pass skipRecovery={false} to offer recovery when eligible. Check the existing action and balances before any retry.

depositBatches

For a combined deposit and destination payout, pass the callback’s context.destinationAmount to quoteSpicenetWithdrawalBatches as the inclusive payout budget. The helper quotes fees and returns the Spicenet and destination batches together. Keep the callback during recovery; the complete example does not open a separate withdrawal modal. The depositBatches prop defines what happens on the destination chain after the deposit. It can be a static array or an async function that returns batches based on the deposit amount:

SpiceSupply

Runs a deposit / supply / stake action end to end: token selection, funding, fee quoting, and execution, driven by a buildActionCalls callback that returns your destination-chain calls. This is the stock presentation of useSpiceSupply. Keep your existing UI with that controller when a stock modal does not fit. See Custom UI Integration.

Usage

buildActionCalls takes (amount, ctx) in that order. ctx (BuildActionCallsContext) carries userAddress, executorAddress, beneficiary, chainId, destinationToken, and fee fields. The bigint is in destination-token units; honor it after swaps and fee allocation. Read the current prop and context shapes from the installed package (SpiceSupplyProps, BuildActionCallsContext).
Routes paid from the user’s Spice balance need a Spicenet funding batch in front of the destination batch. The SDK builds it automatically. buildSpicenetBatch and feeExecutionMode are deprecated compatibility props; leave them unset in new integrations. Existing values remain supported.

Props

onPayExecute blocks execution until migrated. Define the calls with buildActionCalls and use onSuccess for app updates. See Migration for direct versus routed execution.

SpiceWithdraw

Withdraw assets from the user’s Spice balance to an external wallet or an explicit recipient. When there is no distinct external wallet connected, the modal asks for a recipient address. It does not silently send a withdrawal back to the embedded account being withdrawn from.

Usage

Props

Withdraw to a deposit address

For an Elysium payout, use the embedded account mode (7702) on mainnet. The destination app generates its EVM deposit address for chain 99901. Pass recipient={receiveAddress} to fix it and destinationChainIds={[99901]} to restrict the chain. Select the matching USDC, HYPE or KNTQ balance and review the chain, asset, recipient and amount. When recipient is omitted, use Switch in the To section to enter a different recipient. The recipient editor and Switch are available only when recipient is omitted. For card or exchange funding followed by delivery in one flow, use the combined deposit. For a custom signed action, the SDK exports buildSpicenetWithdrawalBatch. Use the deposit address as deliveryRecipient, chain 99901 as destinationChainId, and the matching asset as deliveryToken. Use the canonical contract address for USDC or KNTQ and the zero-address sentinel for native HYPE. Set deliveryAmount to the quoted net amount the recipient receives, as a bigint in the destination token’s smallest units. Pair the Spicenet batch with a signed destination batch on chain 99901 that lists the same reviewed transfers with from: "escrow". Keep requestTimestampMs fixed when rebuilding the same reviewed action so its withdrawal key stays stable. Keep the accepted action identity through retries and follow execution status through the destination step. The Elysium escrow sends USDC and KNTQ as standard ERC-20 transfers and HYPE as a native transfer. Before crediting the receiving account, verify the finalized destination receipt. Match the issued address and net amount in the canonical token’s Transfer event from the escrow or, for HYPE, in the escrow’s NativeTransfer event. Credit each transfer once. See Elysium mainnet for the asset and escrow addresses.

SpiceLock

Lock tokens for a duration (veToken style), using the shared input-inclusive Supply controller. The amount and duration inputs are driven by hooks you create with useAssetInput and useLockDuration and pass in, so you can read the live selection for your own preview UI.

Usage

Props

SpiceLock also accepts hoistable input hooks (sourceAssetInputHook, lockDurationHook) and escrowAddress. The builder receives destination-token amountWei, beneficiary and executorAddress; the SDK supplies conversion and delivery. onLockExecute blocks execution until moved into the builder and success callback. See SpiceLockModalProps for the full shape.

SpiceAccount

Composes AccountDisplay, SpiceDeposit and SpiceWithdraw, including open/close state and the selected withdrawal asset. It has zero required props inside the provider stack.
Optional depositProps and withdrawProps customize the nested flows without their visibility props. It also accepts the display’s branding, extra assets, token prices and mode-toggle props, but owns onDepositClick / onWithdrawClick itself. Keep AccountDisplay if your app needs to own those modals.

AccountDisplay

A popover for wallet and Spice balances and deposit/withdraw actions. It uses shared inventory and policy. extraAssets can add metadata or undiscovered positions but cannot override an SDK-acquired balance, including zero. Host tokenPrices are display-only fallbacks, not execution prices. Account totals include displayed idle balances and customSections[].totalValue; supply each section’s value once. The account dropdown no longer contains pending-deposit recovery rows. Account deposit recovery remains in SpiceDeposit.

Usage

Props


SelectChainModal

The source-chain picker on its own, for when you want the chain-selection step outside the full deposit flow. See SelectChainModal in the installed package for its current props.

ProviderLogin

Wallet connection button for the configured provider (Privy).

Usage

Props


Next Steps

Hooks

Build custom UIs with React hooks

Styling

Customize component appearance

Configuration

Configure chains and providers

Examples

See complete examples