UNPKG

web3-wallets-kit

Version:

Package for connecting with Ethereum wallets for dApp

34 lines (33 loc) 1.15 kB
import Web3 from 'web3'; import { BehaviorSubject } from 'rxjs'; import { WalletType, ConnectResult, WalletConfigs, ConnectionStatus } from './types'; export * from './types'; declare type InfuraNetwork = 'rinkeby' | 'kovan' | 'mainnet' | 'ropsten' | 'goerli'; interface Options { httpRpcUrl?: string; wsRpcUrl?: string; infuraAccessToken?: string; /** default: 'mainnet' */ network?: InfuraNetwork; /** default: true */ autoConnectToPreviousWallet?: boolean; walletConfigs: WalletConfigs; } export declare class Web3WalletsManager { web3: Web3; txWeb3: BehaviorSubject<Web3 | null>; account: BehaviorSubject<string | null>; wallet: BehaviorSubject<"wallet-connect" | "bitski" | "metamask" | "fortmatic" | null>; status: BehaviorSubject<ConnectionStatus>; private storage; private options; private connectionDetails; private accountSubscription; constructor(options: Options); connect(wallet: WalletType): Promise<ConnectResult>; disconnect(): Promise<void>; getAccount(): Promise<string>; private resetState; private checkOptions; private getWeb3; }