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, charged on top of the transfer. |
feeBearer | "sender" | "receiver" | no | Who absorbs the bridge fees. Defaults to "receiver". |
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: {
value: "0.05", // absolute USDC, added on top of the transfer
recipient: "0xMyFeeTreasury…", // split 90% to you, 10% to Arc
},
});Recipient receives the exact amount
Set feeBearer: "sender" so the bridge fees are added to the sender's
debit instead of deducted from the transfer. Useful for checkout,
payroll, and invoice flows where the recipient needs to net an exact
figure. See Fees and quotes.
const config = createWhiskConfig({
wallets: [evm({ projectId: "abc123…" })],
chains: ["Base", "Arbitrum"],
feeBearer: "sender",
});