2019-05-14 18:48:48 -04:00
|
|
|
import { Networkish } from "@ethersproject/networks";
|
|
|
|
import { JsonRpcProvider } from "./json-rpc-provider";
|
2020-04-27 06:31:43 -04:00
|
|
|
export declare type ExternalProvider = {
|
2019-05-14 18:48:48 -04:00
|
|
|
isMetaMask?: boolean;
|
|
|
|
host?: string;
|
|
|
|
path?: string;
|
2020-04-27 06:31:43 -04:00
|
|
|
sendAsync?: (request: {
|
|
|
|
method: string;
|
|
|
|
params?: Array<any>;
|
|
|
|
}, callback: (error: any, response: any) => void) => void;
|
|
|
|
send?: (request: {
|
|
|
|
method: string;
|
|
|
|
params?: Array<any>;
|
|
|
|
}, callback: (error: any, response: any) => void) => void;
|
|
|
|
request?: (request: {
|
|
|
|
method: string;
|
|
|
|
params?: Array<any>;
|
|
|
|
}) => Promise<any>;
|
2019-05-14 18:48:48 -04:00
|
|
|
};
|
2020-04-27 06:31:43 -04:00
|
|
|
export declare type JsonRpcFetchFunc = (method: string, params?: Array<any>) => Promise<any>;
|
2019-05-14 18:48:48 -04:00
|
|
|
export declare class Web3Provider extends JsonRpcProvider {
|
2020-04-27 06:31:43 -04:00
|
|
|
readonly provider: ExternalProvider;
|
|
|
|
readonly jsonRpcFetchFunc: JsonRpcFetchFunc;
|
|
|
|
constructor(provider: ExternalProvider | JsonRpcFetchFunc, network?: Networkish);
|
2020-02-10 15:51:58 -05:00
|
|
|
send(method: string, params: Array<any>): Promise<any>;
|
2019-05-14 18:48:48 -04:00
|
|
|
}
|