I'm trying to call eth_getBlockByNumber using Web3WsProvider of ethers.js with the following code:
const Web3WsProvider = require('web3-providers-ws');
.
.
.
const provider = new Web3WsProvider("wss://api.avax-test.network/ext/bc/C/ws", options);
this.client = new ethers.providers.Web3Provider(provider);
const res = await (this.client as ethers.providers.Web3Provider).send(
"eth_getBlockByNumber", ["0x0", false]
);
but I get an error
Error: the method eth_getBlockByNumber does not exist/is not available
I am able to make this call through postman and get back a result. Why am I not able to do the same with ethers.js