UNPKG

@quirks/store

Version:
35 lines (34 loc) 1.18 kB
import { Wallet } from '@quirks/core'; export declare const ConnectionStates: { readonly DISCONNECTED: "DISCONNECTED"; readonly CONNECTED: "CONNECTED"; readonly REJECTED: "REJECTED"; }; export type ConnectionState = (typeof ConnectionStates)[keyof typeof ConnectionStates]; export declare const SetupStates: { readonly DEINITIALIZED: "DEINITIALIZED"; readonly INITIALIZED: "INITIALIZED"; }; export type SetupState = (typeof SetupStates)[keyof typeof SetupStates]; export interface ConnectOptions { autoSuggestions: boolean; autoAccountChange: boolean; } export interface ConnectState { walletName?: string; wallet?: Wallet; status: ConnectionState; connecting: boolean; connectionError?: Error; setupStatus: SetupState; options: ConnectOptions; } export interface ConnectActions { setWallet: (wallet?: Wallet) => Promise<void>; getWalletData: () => Promise<void>; connect: (walletName: string) => Promise<void>; reconnect: (walletName: string) => Promise<void>; disconnect: () => void; suggestChains: (walletName: string) => Promise<void>; } export type ConnectSlice = ConnectState & ConnectActions;