@soundsright/connector
Version:
soundsright wallet connector
28 lines (27 loc) • 1.04 kB
TypeScript
/// <reference types="node" />
import { EventEmitter } from 'events';
import { ConnectType, Connection, ConnectionState, UriHandler, AddTokenOptions } from './types';
export * from './types';
export * from './connections';
export * from './helper';
export default class Connector extends EventEmitter {
private static _instance;
static getInstance(): Connector;
private _type;
private readonly LAST_CONNECT_CACHE_KEY;
private cache;
private connections;
get type(): ConnectType;
get state(): ConnectionState;
protected constructor();
connect(type: ConnectType): Promise<any>;
switchChain(chainId: number): Promise<void>;
addToken(options: AddTokenOptions): Promise<void>;
disconnect(): Promise<void>;
private eventThrough;
registConnection(type: ConnectType, handler: Connection): void;
private registLastConnectCache;
setCache(cache: Storage): void;
tryLastConnect(): Promise<boolean>;
registUriHandler(handler: UriHandler): void;
}