ethers.js/packages/providers/src.ts/provider-cloudflare.ts

18 lines
567 B
TypeScript
Raw Permalink Normal View History

2022-04-11 17:09:17 -04:00
import { logger } from "./logger.js";
import { Network } from "./network.js";
import { StaticJsonRpcProvider } from "./provider-jsonrpc.js";
import type { Networkish } from "./network.js";
export class CloudflareProvider extends StaticJsonRpcProvider {
constructor(_network: Networkish = "homestead") {
const network = Network.from(_network);
if (network.name !== "homestead") {
return logger.throwArgumentError("unsupported network", "network", _network);
}
super("https:/\/cloudflare-eth.com/", network);
}
}