ethers.js
ethers.js copied to clipboard
feat: add Quicknode provider
Gm! We were adding Quicknode as an RPC provider recently, it was different than adding other providers because Quicknode endpoints are customizable.
So we had to create a QuicknodeProvider class that accepts connection url instead of an apiKey. Here is the use example:
const quicknodeConnectionUrl = 'https://{YOUR_QUICKNODE_ENDPOINT}/{YOUR_QUICKNODE_API_KEY}/'
const provider = new QuicknodeProvider(network, quicknodeConnectionUrl)
I took UrlJsonRpcProvider class as the base and rewrote it a bit.
I thought that this class might be helpful for others too and can be included in the library. If not, your feedback is welcome anyway, especially on class inheritance (was this a good idea to extend from StaticJsonRpcProvider?) and methods overriding 🙂
This is awesome!
FYI. QuickNodeProvider is available in v6, and will be likely added in the next minor release of v5. :)