ethers.js/packages/providers/lib.esm/web3-provider.d.ts
2021-01-19 05:22:54 -05:00

27 lines
1.0 KiB
TypeScript

import { Networkish } from "@ethersproject/networks";
import { JsonRpcProvider } from "./json-rpc-provider";
export declare type ExternalProvider = {
isMetaMask?: boolean;
host?: string;
path?: string;
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>;
};
export declare type JsonRpcFetchFunc = (method: string, params?: Array<any>) => Promise<any>;
export declare class Web3Provider extends JsonRpcProvider {
readonly provider: ExternalProvider;
readonly jsonRpcFetchFunc: JsonRpcFetchFunc;
constructor(provider: ExternalProvider | JsonRpcFetchFunc, network?: Networkish);
send(method: string, params: Array<any>): Promise<any>;
}
//# sourceMappingURL=web3-provider.d.ts.map