import DB from './db'; import { Player } from '../../player'; import { IEosNodeConfig, IEosNodeConfigTable } from '../../configs'; import { ISignPlugin } from '../../plugins/interface'; import { IEosClient, IIdentity } from '../../types/eos'; import { IScatter } from '../../types/scatter'; /** * Player on browser (need scatter) * @author kinghand@foxmail.com */ export declare class ScatterPlayer extends Player { _networks: IEosNodeConfigTable; protected identityReceiver: ((_identity: IIdentity | Error) => any)[]; readonly storage: DB; protected _eosClient?: IEosClient; constructor(_networks: IEosNodeConfigTable); /** * switch to an network with name * @param key */ switchNetwork(key: string): void; /** * add net config to table at runtime * @param netName * @param conf */ setNetConf(netName: string, conf: any): void; /** * get network name in use */ readonly netName: string; /** * get network config of cur netName */ readonly netConf: IEosNodeConfig; /** * try get scatter * @see https://get-scatter.com/docs/examples-interaction-flow * @return {Scatter} */ readonly scatter: IScatter; /** * try get scatter async - if not find * @see https://get-scatter.com/docs/examples-interaction-flow * @return {Scatter} */ getScatterAsync(maxTry?: number): Promise; getPCScatter(): Promise; /** * login - require account identity from scatter * @return {Promise<{Identity}>} */ login(): Promise; /** * logout * @return {Promise} */ logout(): Promise; /** * get or create scatter * @return {eosAPI} */ readonly eosClient: IEosClient; /** * getIdentity of cur scatter user * @attention When there are multiple concurrent getIdentity requests, scatter will only return the first one. * @return {Promise<{Identity}>} */ getIdentity(): Promise; /** * sign a message with current identity * @param {string} message - message to sign * @param {... ISignPlugin[]} signPlugins - signer map's list * @return {Promise} - signed data * @constructor */ sign(message: string, ...signPlugins: ISignPlugin[]): Promise; help(): string; }