ethers.js/lib.esm/providers/provider-cloudflare.js

22 lines
736 B
JavaScript
Raw Normal View History

2023-01-28 09:53:29 +03:00
/**
* About Cloudflare
*
* @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare]
*/
2022-11-09 10:57:02 +03:00
import { assertArgument } from "../utils/index.js";
2022-09-05 23:57:11 +03:00
import { Network } from "./network.js";
import { JsonRpcProvider } from "./provider-jsonrpc.js";
2022-11-30 23:44:23 +03:00
/**
2023-01-28 09:53:29 +03:00
* About Cloudflare...
2022-11-30 23:44:23 +03:00
*/
2022-09-05 23:57:11 +03:00
export class CloudflareProvider extends JsonRpcProvider {
2022-11-30 23:44:23 +03:00
constructor(_network) {
if (_network == null) {
_network = "mainnet";
}
2022-09-05 23:57:11 +03:00
const network = Network.from(_network);
2022-11-09 10:57:02 +03:00
assertArgument(network.name === "mainnet", "unsupported network", "network", _network);
2022-09-05 23:57:11 +03:00
super("https:/\/cloudflare-eth.com/", network, { staticNetwork: network });
}
}
//# sourceMappingURL=provider-cloudflare.js.map