UNPKG

@web3-onboard/core

Version:

Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, mul

30 lines (29 loc) 1.96 kB
import type { Device, ChainId, Chain, WalletInit, WalletModule, ChainWithDecimalId, DeviceNotBrowser } from '@web3-onboard/common'; import type { ChainStyle, ConnectedChain, NotifyEventStyles } from './types.js'; import type { Chain as ViemChain } from 'viem'; export declare function getDevice(): Device | DeviceNotBrowser; export declare const notNullish: <T>(value: T | null | undefined) => value is T; export declare function isSVG(str: string): boolean; export declare function shortenAddress(add: string): string; export declare function shortenDomain(domain: string): string; export declare function copyWalletAddress(text: string): Promise<void>; export declare const toHexString: (val: number | string) => string; export declare function chainIdToHex(chains: (Chain | ChainWithDecimalId)[]): Chain[]; export declare function gweiToWeiHex(gwei: number): string; export declare const chainIdToLabel: Record<string, string>; export declare function validEnsChain(chainId: ChainId): string | null; export declare const chainIdToViemENSImport: (chainId: string) => Promise<ViemChain | null>; export declare const networkToChainId: Record<string, ChainId>; export declare const chainStyles: Record<string, ChainStyle>; export declare const unrecognizedChainStyle: { icon: string; color: string; }; export declare function getDefaultChainStyles(chainId: string): ChainStyle | undefined; export declare function connectedToValidAppChain(walletConnectedChain: ConnectedChain, chains: Chain[]): boolean; export declare function initializeWalletModules(modules: WalletInit[], device: Device): WalletModule[]; export declare const defaultNotifyEventStyles: Record<string, NotifyEventStyles>; export declare const wait: (time: number) => Promise<void>; export declare function getLocalStore(key: string): string | null; export declare function setLocalStore(key: string, value: string): void; export declare function delLocalStore(key: string): void;