Skip to content

Commit

Permalink
use http provider for quicknode
Browse files Browse the repository at this point in the history
  • Loading branch information
py-zoid committed May 4, 2024
1 parent 274a1ec commit 9a9a6ce
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions internal/block_getters/quicknode_block_getter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import utils from "web3-utils";
import { WebsocketProvider } from "web3-core";
import { HttpProvider } from "web3-core";
import { IQuickNodeResponse } from "../interfaces/quicknode_response.js";
import { ITransaction } from "../interfaces/transaction.js";
import { IBlock } from "../interfaces/block.js";
Expand Down Expand Up @@ -48,7 +48,7 @@ export class QuickNodeBlockGetter extends BlockGetter implements IBlockGetter {
eth = this.alternateEth;
}

(eth.currentProvider as WebsocketProvider).send({
(eth.currentProvider as HttpProvider).send({
method: "qn_getBlockWithReceipts",
id: Date.now().toString() + blockNumber,
params: [utils.numberToHex(blockNumber)],
Expand Down
4 changes: 2 additions & 2 deletions internal/block_getters/quicknode_block_getter_worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const blockGetter = new QuickNodeBlockGetter(
//@ts-ignore
new EthClass(
//@ts-ignore
new EthClass.providers.WebsocketProvider(
new EthClass.providers.HttpProvider(
workerData.endpoint,
{
reconnect: {
Expand All @@ -29,7 +29,7 @@ const blockGetter = new QuickNodeBlockGetter(
//@ts-ignore
new EthClass(
//@ts-ignore
new EthClass.providers.WebsocketProvider(
new EthClass.providers.HttpProvider(
workerData.alternateEndpoint,
{
reconnect: {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@maticnetwork/chain-indexer-framework",
"version": "1.3.5",
"version": "1.4.0-beta",
"description": "blockchain data indexer",
"type": "module",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion public/block_producers/quicknode_block_producer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class QuickNodeBlockProducer extends BlockProducer {
//@ts-ignore
const eth = new Eth(
//@ts-ignore
new Eth.providers.WebsocketProvider(
new Eth.providers.HttpProvider(
endpoints[0],
{
reconnect: {
Expand Down

0 comments on commit 9a9a6ce

Please sign in to comment.