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, charged on top of the transfer.
feeBearer"sender" | "receiver"noWho absorbs the bridge fees. Defaults to "receiver".
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: {
    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",
});

On this page