UNPKG

@particle-network/connectkit

Version:
11 lines (10 loc) 954 B
import { type AddEthereumChainParameter, type BaseErrorType, type ChainNotConfiguredErrorType, type ConnectorParameter, type ErrorType, type Evaluate, type ExactPartial, type ProviderNotFoundErrorType, type SwitchChainNotSupportedErrorType, type UserRejectedRequestErrorType } from '@particle-network/connector-core'; import type { Chain } from 'viem'; import type { Config } from '../createConfig'; export type SwitchChainParameters = Evaluate<ConnectorParameter & { chainId: number; addEthereumChainParameter?: Evaluate<ExactPartial<Omit<AddEthereumChainParameter, 'chainId'>>> | undefined; }>; export type SwitchChainReturnType = Chain; export type SwitchChainErrorType = SwitchChainNotSupportedErrorType | ChainNotConfiguredErrorType | ProviderNotFoundErrorType | UserRejectedRequestErrorType | BaseErrorType | ErrorType; export declare function switchChain(config: Config, parameters: SwitchChainParameters): Promise<SwitchChainReturnType>;