whisk
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): WhiskClientConfig

Options

OptionTypeRequiredNotes
walletsWalletAdapterFactory[]yesOrder matters. First adapter that matches the source chain wins.
chainsChain[]yesChains the widget can route between.
defaultSourceChainChainnoInitial source. Falls back to chains[0].
defaultDestinationChainChainnoInitial destination.
tokenTokennoDefault token alias. USDC today.
resolverResolvernoCustom resolver chain. Defaults to address + ENS.
feePolicyFeePolicynoPlatform fee config.
rpcUrlsPartial<Record<Chain, string>>noOverride the default public RPC for a chain.
useForwarderbooleannoForwarder Service. Defaults to true.
appLabelstringnoShown in some wallet UIs as the connecting app's name.
kitKeystringnoCircle 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",
  },
});

On this page