API reference
createWhiskConfig
Build the frozen config that WhiskProvider consumes.
createWhiskConfig(...) validates the inputs, normalises chain
identifiers, and returns a frozen object you pass to
<WhiskProvider>. Call it once, at module scope. Don't rebuild it
on every render, the engine keys off the config object identity.
import { createWhiskConfig, evm, solana } from "@usewhisk/react";Signature
createWhiskConfig(options: CreateWhiskConfigOptions): WhiskClientConfigOptions
| Option | Type | Required | Notes |
|---|---|---|---|
wallets | WalletAdapterFactory[] | yes | Order matters. First adapter that matches the source chain wins. |
chains | Chain[] | yes | Chains the widget can route between. |
defaultSourceChain | Chain | no | Initial source. Falls back to chains[0]. |
defaultDestinationChain | Chain | no | Initial destination. |
token | Token | no | Default token alias. USDC today. |
resolver | Resolver | no | Custom resolver chain. Defaults to address + ENS. |
feePolicy | FeePolicy | no | Platform fee config. |
rpcUrls | Partial<Record<Chain, string>> | no | Override the default public RPC for a chain. |
useForwarder | boolean | no | Forwarder Service. Defaults to true. |
appLabel | string | no | Shown in some wallet UIs as the connecting app's name. |
kitKey | string | no | Circle Console kit key for swap. |
Wallet adapters
evm(options)
type EvmFactoryOptions = {
projectId: string; // WalletConnect project ID
/** Pass a preconfigured wagmi config to override the bundled one. */
wagmiConfig?: WagmiConfig;
};solana(options)
type SolanaFactoryOptions = {
/** Network to target. Defaults to `"devnet"`. */
network?: "mainnet-beta" | "devnet" | "testnet";
/** Custom RPC endpoint. Defaults to the public network endpoint. */
endpoint?: string;
/** Auto-reconnect on mount. Off by default. */
autoConnect?: boolean;
/** Legacy wallet adapters alongside Wallet Standard auto-discovery. */
wallets?: WalletAdapter[];
};The public-cluster RPC default is rate-limited; pass endpoint with
a paid RPC URL (Helius, Triton, QuickNode) for production traffic.
A few examples
Minimal EVM
const config = createWhiskConfig({
wallets: [evm({ projectId: "abc123…" })],
chains: ["Base", "Arbitrum"],
});EVM + Solana with a custom RPC
const config = createWhiskConfig({
wallets: [evm({ projectId: "abc123…" }), solana({ network: "mainnet-beta" })],
chains: ["Base", "Solana"],
rpcUrls: {
Base: "https://my-base-rpc.example.com",
},
});With a platform fee
const config = createWhiskConfig({
wallets: [evm({ projectId: "abc123…" })],
chains: ["Base"],
feePolicy: {
flat: "0.05",
percent: 0.002,
recipient: "0xMyFeeTreasury…",
label: "Service fee",
},
});