ethers.js/packages/providers/lib.esm/web3-provider.d.ts

28 lines
1.0 KiB
TypeScript
Raw Permalink Normal View History

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;
2021-02-08 15:24:45 -05:00
isStatus?: boolean;
2019-05-14 18:48:48 -04:00
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
}
//# sourceMappingURL=web3-provider.d.ts.map