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

36 lines (35 loc) 2.33 kB
import { type Observable } from 'rxjs'; import type { Uns } from '@web3-onboard/unstoppable-resolution'; import { type PublicClient } from 'viem'; import type { Address, ChainId, EIP1193Provider, ProviderAccounts, Chain } from '@web3-onboard/common'; import type { Balances, Ens, WalletPermission, WalletState } from './types.js'; export declare const viemProviders: { [key: string]: PublicClient; }; export declare function requestAccounts(provider: EIP1193Provider): Promise<ProviderAccounts>; export declare function selectAccounts(provider: EIP1193Provider): Promise<ProviderAccounts>; export declare function getChainId(provider: EIP1193Provider): Promise<string>; export declare function listenAccountsChanged(args: { provider: EIP1193Provider; disconnected$: Observable<string>; }): Observable<ProviderAccounts>; export declare function listenChainChanged(args: { provider: EIP1193Provider; disconnected$: Observable<string>; }): Observable<ChainId>; export declare function trackWallet(provider: EIP1193Provider, label: WalletState['label']): void; export declare function getEns(address: Address, chain: Chain): Promise<Ens | null>; export declare function getUns(address: Address, chain: Chain): Promise<Uns | null>; export declare function getBalance(address: Address, chain: Chain): Promise<Balances | null>; export declare function switchChain(provider: EIP1193Provider, chainId: ChainId): Promise<unknown>; export declare function addNewChain(provider: EIP1193Provider, chain: Chain): Promise<unknown>; export declare function updateChainRPC(provider: EIP1193Provider, chain: Chain, rpcUrl: string): Promise<unknown>; export declare function getPermissions(provider: EIP1193Provider): Promise<WalletPermission[]>; export declare function syncWalletConnectedAccounts(label: WalletState['label']): Promise<void>; export declare const addOrSwitchChain: (provider: EIP1193Provider, chain: Chain) => Promise<string | undefined>; export declare const wagmiProviderMethods: () => { addOrSwitchChain: (provider: EIP1193Provider, chain: Chain) => Promise<string | undefined>; getChainId: (provider: EIP1193Provider) => Promise<string>; requestAccounts: (provider: EIP1193Provider) => Promise<ProviderAccounts>; switchChain: (provider: EIP1193Provider, chainId: ChainId) => Promise<unknown>; };