2023-01-28 09:52:20 +03:00
|
|
|
/**
|
|
|
|
* About Cloudflare
|
|
|
|
*
|
|
|
|
* @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare]
|
|
|
|
*/
|
|
|
|
|
2022-10-25 11:06:00 +03:00
|
|
|
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
|
|
|
/**
|
2023-01-28 09:52:20 +03:00
|
|
|
* About Cloudflare...
|
2022-11-30 21:44:47 +03:00
|
|
|
*/
|
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);
|
2022-10-25 11:06:00 +03:00
|
|
|
assertArgument(network.name === "mainnet", "unsupported network", "network", _network);
|
2022-09-05 23:14:43 +03:00
|
|
|
super("https:/\/cloudflare-eth.com/", network, { staticNetwork: network });
|
|
|
|
}
|
|
|
|
}
|