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

21 lines
665 B
TypeScript
Raw Normal View History

import { assertArgument } from "../utils/index.js";
2022-09-05 23:14:43 +03:00
import { Network } from "./network.js";
import { JsonRpcProvider } from "./provider-jsonrpc.js";
import type { Networkish } from "./network.js";
2022-11-30 21:44:47 +03:00
/**
* Aboud Cloudflare...
*
* @_docloc: api/providers/thirdparty
*/
2022-09-05 23:14:43 +03:00
export class CloudflareProvider extends JsonRpcProvider {
2022-11-28 05:58:07 +03:00
constructor(_network?: Networkish) {
if (_network == null) { _network = "mainnet"; }
2022-09-05 23:14:43 +03:00
const network = Network.from(_network);
assertArgument(network.name === "mainnet", "unsupported network", "network", _network);
2022-09-05 23:14:43 +03:00
super("https:/\/cloudflare-eth.com/", network, { staticNetwork: network });
}
}