Removed old EIP-1193 experimental provider; it can now be supported by Web3Provider as EIP-1193 is now backwards compatible.
This commit is contained in:
parent
393c0c74a9
commit
84c68ac5c1
@ -1,40 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
|
|
||||||
import { ethers } from "ethers";
|
|
||||||
|
|
||||||
import { version } from "./_version";
|
|
||||||
|
|
||||||
const logger = new ethers.utils.Logger(version);
|
|
||||||
|
|
||||||
//import { Networkish } from "@ethersproject/networks";
|
|
||||||
//import { defineReadOnly } from "@ethersproject/properties";
|
|
||||||
|
|
||||||
//import { Logger } from "@ethersproject/logger";
|
|
||||||
//import { version } from "./_version";
|
|
||||||
//const logger = new Logger(version);
|
|
||||||
|
|
||||||
//import { JsonRpcProvider } from "./json-rpc-provider";
|
|
||||||
|
|
||||||
|
|
||||||
// Exported Types
|
|
||||||
export interface Eip1193Provider {
|
|
||||||
send: (message: string, params?: Array<any>) => Promise<any>;
|
|
||||||
on(eventName: string, listener: (...args: Array<any>) => void): this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
export class EipWrappedProvider extends ethers.providers.JsonRpcProvider {
|
|
||||||
readonly provider: Eip1193Provider;
|
|
||||||
|
|
||||||
constructor(provider: Eip1193Provider, network?: ethers.providers.Networkish) {
|
|
||||||
logger.checkNew(new.target, EipWrappedProvider);
|
|
||||||
|
|
||||||
super("eip1193:/\/", network);
|
|
||||||
|
|
||||||
ethers.utils.defineReadOnly(this, "provider", provider);
|
|
||||||
}
|
|
||||||
|
|
||||||
send(method: string, params: any): Promise<any> {
|
|
||||||
return this.provider.send(method, params);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user