UNPKG

@particle-network/connectkit

Version:
40 lines (39 loc) 1.68 kB
import type { Chain } from 'viem/chains'; import { type SwitchChainParameters } from '../actions/switchChain'; import { type MutationOptions } from './useMutation'; export type UseSwitchChainParameters = MutationOptions<Chain, SwitchChainParameters>; export declare const useSwitchChain: (parameters?: UseSwitchChainParameters) => { status: "error" | "success" | "idle" | "loading"; data: import("../actions/switchChain").SwitchChainReturnType | null; error: any; switchChain: (variables: { connector?: import("@particle-network/connector-core").Connector | undefined; chainId: number; addEthereumChainParameter?: { nativeCurrency?: { name: string; symbol: string; decimals: number; } | undefined; rpcUrls?: readonly string[] | undefined; chainName?: string | undefined; blockExplorerUrls?: string[] | undefined; iconUrls?: string[] | undefined; } | undefined; }) => void; switchChainAsync: (variables: { connector?: import("@particle-network/connector-core").Connector | undefined; chainId: number; addEthereumChainParameter?: { nativeCurrency?: { name: string; symbol: string; decimals: number; } | undefined; rpcUrls?: readonly string[] | undefined; chainName?: string | undefined; blockExplorerUrls?: string[] | undefined; iconUrls?: string[] | undefined; } | undefined; }) => Promise<import("../actions/switchChain").SwitchChainReturnType>; };