ethers.js/src.ts/providers/provider-cloudflare.ts
2022-09-08 23:21:08 -04:00

18 lines
594 B
TypeScript

import { throwArgumentError } from "../utils/index.js";
import { Network } from "./network.js";
import { JsonRpcProvider } from "./provider-jsonrpc.js";
import type { Networkish } from "./network.js";
export class CloudflareProvider extends JsonRpcProvider {
constructor(_network: Networkish = "homestead") {
const network = Network.from(_network);
if (network.name !== "homestead") {
return throwArgumentError("unsupported network", "network", _network);
}
super("https:/\/cloudflare-eth.com/", network, { staticNetwork: network });
}
}