Skip to main content

Questions tagged [websocket]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
22 views

GetBalance faster method and tokens/nft balance

Hello to the whole community! I have a question about the getBalance function. given the same node characteristics, if I were to send the getbalance request for 10000 wallets, is the ethers.js or web3....
Die84albe's user avatar
0 votes
1 answer
58 views

Viem's PublicClient#watchContractEvent with WSS transport: Socket closed

New PublicClient instances created with WSS transport immediately fail to watch contract events if created after a period of the app inactivity - i.e. if no PublicClient was created or used for a few ...
Utgarda's user avatar
  • 791
1 vote
1 answer
40 views

Not getting every transaction and unable to parse data

The following JS code uses a basic BNB Smart Chain endpoint from QuickNode and ethers.js v6.3.0 to parse all transactions' data that is sent to PancakeSwap address. const address = '...
PancakeBot's user avatar
0 votes
0 answers
31 views

Rust and erigon: How to Stabilize Responses from the Erigon WebSocket API?

I have a Rust application that communicates with the erigon API using websockets (specifically using the web3 crate). Lately, I've been experiencing instability with the responses from the server, as ...
Pierogi's user avatar
  • 203
1 vote
0 answers
118 views

EthereumProvider from @walletconnect/ethereum-provider not seeing my Infura project

I'm having trouble with getting EthereumProvider to connect via the Infura API key. I use it in my connection logic like this: const provider = await EthereumProvider.init({ ...
Oleh Yatskiv's user avatar
0 votes
1 answer
197 views

Disconnected from ETH websocket after timeout error [Python]

i'm trying to listen to eth websocket using python's web3 library, particularly listening to log events. async def ws_v2_subscription_context_manager_example(): while True: try: async with ...
germor197's user avatar
0 votes
0 answers
43 views

Geth private POA network behaving strangely

The Setup I have setup a private POA network using geth (v1.10.14). My network configurations are as following; BlockTime: 1sec Consensus: Clique Number of Signers: 3 Number of Miners: 3 I have ...
Asad Hayat's user avatar
0 votes
1 answer
212 views

Web3. Websocket connection closed. An error occurred: object of type 'NoneType' has no len()

I'm trying to receive pending transactions from the eth mempool, for which I use a wss connection to the node. The problem is that when normally receiving messages from the node, no errors occur and ...
404's user avatar
  • 33
0 votes
0 answers
17 views

Can eth_subscribe newHead in Ethereum Provide baseFeePerGas Directly?

I'm working with Ethereum's eth_subscribe method, specifically subscribing to newHeads to get real-time information about new blocks. My goal is to retrieve the baseFeePerGas for each new block. ...
Bnq's user avatar
  • 1
0 votes
1 answer
84 views

Error "could not detect network" when using WebSocket provider with Alchemy

I have a file with over 1 million+ ethereum addresses and private keys grouped together in a single file separated only using a ','. Example: 0x7256bCf73C2309893AA12d6b26A142AB3097560c,...
Nikhil Meena's user avatar
0 votes
0 answers
66 views

Getting error when connecting my ether js websocket provider to local node web socket server

So I am building my backend to listen for events. So I used the websocket provider of ether js to listen. Since it requires a websocket server url so I built my local websocket server. But I am ...
Arnab Chatterjee's user avatar
0 votes
1 answer
55 views

I want to subscribe to flashloan events on the Aave v2 contract via websocket, how do I find the function/event?

I am trying to set up a websocket connection with ethers.js to listen for flashloan events. I have made a connection successfully listening to Transfer events on the USDT contract - which was simple ...
Zara44's user avatar
  • 3
0 votes
0 answers
24 views

Live Price monitor

How does dexscreener or dextools websites keep up with the price changes efficiently on thousands of tokens? Can anyone provide a sample code for that? if not, then a roadmap of steps to be taken, ...
Melardev's user avatar
  • 101
0 votes
0 answers
710 views

Cannot listen to contract events with ethers.js

Trying to track token transfer events but it only works initially when the server is starts. After 5mins, it stops listening to any Transfer events even when the websocket is still active. I've ...
Nischit Pradhan's user avatar
0 votes
1 answer
371 views

Connection types, http/ws/ipc

I was wondering and couldn't find any docs regarding that, which connection is the fastest/has the least latency when querying the blockchain? From logical point of view I think IPC, but I'm not sure. ...
Kacper's user avatar
  • 1
1 vote
2 answers
1k views

WEBSOCKETS Provider url for binance smart chain

I have a contract deployed in Binance smart chain. I have written a script that will help me read the events logs from the Blockchain. currently, I tested that with the local hardhat network itself, ...
Bappa Banerjee's user avatar
0 votes
1 answer
701 views

Error on WebSocket connection

i want to retrive data from this websocket api, where is my code import { WebSocketServer } from 'ws' let socket = new WebSocketServer('wss://ws.blockchain.info/inv'); socket.on('error', console....
Oswald's user avatar
  • 1
1 vote
0 answers
37 views

Real-time subscription to events in fantom?

I've tried to listen to events using websockets. import asyncio, json from websockets import connect wss = 'wss://wsapi.fantom.network' params = json.dumps({"id": 1, "method": &...
hdnguyen's user avatar
0 votes
1 answer
2k views

Cannot read properties of undefined (reading 'WebSocketProvider')

I keep getting this error "cannot read properties of undefined (reading 'WebSocketProvider')" this is my code require('dotenv').config() const ethers = require('ethers') const { BigNumber, ...
Adediran Adedamola Oluwafemi's user avatar
1 vote
1 answer
215 views

Frame size of X bytes exceeds maximum accepted frame size

I'm attempting to calculate slippage of the past X number of blocks to determine if a potential trade is likely to slip beyond the threshold 1% level. If it does I will cancel the trade. To do this, ...
Trent Kennelly's user avatar
2 votes
1 answer
2k views

Reading and listening to Solidity events via Web3.py and websocket

Recently I have been solving a problem of how to listen to and read Solidity events in Web3.py via websocket rather than constant HTTP calling. You may be familiar with this algorythm which can be ...
f22daniel's user avatar
  • 373
0 votes
1 answer
67 views

usage of infura wss

I am trying to connect to infura via wss protocol, but I get this typerror, can you please help me out with that? from web3 import Web3 # add your blockchain connection information infura_websocket = ...
f22daniel's user avatar
  • 373
1 vote
0 answers
112 views

Localhost Websocket Events Don't Work With Truffle?

I created a simple smart contract that emits an event when a function in called. When I run it with truffle develop it says "Truffle Develop started at http://127.0.0.1:9545/" I then start ...
Jim's user avatar
  • 173
0 votes
1 answer
995 views

Connecting to matic mumbai via websocket

I try to connect to mumbai testnet via websocket to listen to blockchain events: const web3 = new Web3(new Web3.providers.WebsocketProvider("wss://rpc-mumbai.matic.today")); However, I get ...
dnnagy's user avatar
  • 111
0 votes
1 answer
321 views

Alchemy Websocket Sub with Filter on Arbitrum Returns No Messages

The following sub with filter is not resulting in an error and no messages are received for newly mined txns: '{"jsonrpc": "2.0", "id": 1, "method": "...
Paul's user avatar
  • 11
0 votes
1 answer
198 views

Websocket Connection With Filter Returns No Messages

I am trying to listen on a websocket connection to an optimism node for specific events on a specific contract. I am getting the message back that I am connected to the node, but even though I see ...
Alkhara's user avatar
  • 26
0 votes
1 answer
205 views

How can I know if my rpcUrl is working or not?

I have a 2 rpcUrl, I would like to pick the one that's working. How can I pick the active rpcUrl? Unfortunately, I can't catch the error log on this one. const provider = new ethers.providers....
Lonewarp's user avatar
  • 151
1 vote
2 answers
429 views

Can I know in real time when ether is coming into my account from Ethereum?

I would like to create a feature in my Dapp(nodejs) that notifies me when ether is coming into my account in real time. For example, is there a way to use websockets or APIs? Can anyone give me some ...
imelon2's user avatar
  • 568
0 votes
1 answer
517 views

TimeOut excpetion on websocket using Nethereum

I'm working on a frontrunning bot using Nethereum. the problem I'm facing is the following, once I get all the pending transaction hashes through the websocket, I pass the hash trhough ...
ramy ben haj yahia's user avatar
0 votes
3 answers
1k views

How to listen for events without a websocket RPC?

Based on the docs of ethersjs, I could use the provider.on() function to listen for events and perform some actions. However, would it still work if I don't have a websocket RPC URL? If it still does ...
xenon's user avatar
  • 455
2 votes
1 answer
2k views

Ganache and webscockets

I'm searching the docs, but, I cannot find anything. Does ganache support WebSocket connections? People seem to use for web socket connections in different posts.
Nikos Iliakis's user avatar
0 votes
0 answers
72 views

0x V4 Websocket connection

Is the 0x V4 Websocket server down? It was working for me a few days ago, but now I am getting the error "server rejected WebSocket connection: HTTP 400". Has anything changed?
Orvar's user avatar
  • 1
0 votes
0 answers
538 views

How do I listen to changes for an ethereum address using websockets + RPC eth_subscribe method + postman

I am trying to listen for changes in a wallet balance on the Kovan testnet , so I have connected to a Kovan node using a node provider's websocket endpoint, I have no errors connecting, and no errors ...
noahm101's user avatar
1 vote
0 answers
429 views

Websocket returning "unexpected server response: 200"

Using ethers.js with node, I was able to connect and communicate with websockets until recently. My code did work but now I only get Unexpected server response: 200 as response when trying to ...
kitaro's user avatar
  • 11
1 vote
1 answer
503 views

Websocket listener returns no response

I am trying to listen to a UniSwap v3 Swap event but I get no response from the network. I am connected to polygon network via websocket and after firing up the listener I get no callbacks even though ...
Ádám Klöczl's user avatar
2 votes
1 answer
301 views

Filter out mint and burn Transfers from Transfer events (web3.js)

In web.js Library Is there a way to filter out the Transfers events generated by the mint and burn function so as to ignore all the Transfer events generated by the mint or burn function. I know we ...
hassan ahmed's user avatar
1 vote
0 answers
1k views

How to properly subscribe to Uniswap v3 pool price events with NodeJS and JavaScript?

In reviewing the Uniswap v3 Quoter documentation: These functions are not marked view because they rely on calling non-view functions and reverting to compute the result. They are also not gas ...
ElHaix's user avatar
  • 187
0 votes
1 answer
2k views

Can't create Web3 websocket connection successfully

I use latest Web3 version (1.6.1) code in Node.js as provided in docs. But when I run: var Web3 = require('web3'); var web3 = new Web3( new Web3.providers.WebsocketProvider('wss://dex.binance.org/api/...
T.Todua's user avatar
  • 155
0 votes
0 answers
155 views

Web3 socket with options doesn't work

I'm trying to set some options in my wss connection but that seems don't have any effect using the moralis endpoint to connect in BSC I tried to keep the connection but that's dropped yet const Web3 = ...
kraune's user avatar
  • 11
0 votes
0 answers
215 views

Web3 Contract events not working on Ropsten testnet

Despite assuring that all event subscriptions are done through a websocket web3 provider instead of https, I still cannot get an event to return an info with " .on('data' ", however " ....
Blake Hatch's user avatar
0 votes
1 answer
2k views

What is the primary cause of error ECONREFUSED?

I have written a few small scripts using Node and Ethers to do simple buy and sell transactions through the PCS router and have had success when I write the code however, I am just learning and i have ...
gendisarray's user avatar
2 votes
0 answers
726 views

Losing connection on Geth websocket subscription

I am trying to keep multiple WebSocket connections to my Geth node open at the same time (around 200 connections). My issue is that they keep closing with a timeout error. I can't seem to know if it's ...
Kaki Master Of Time's user avatar
1 vote
1 answer
366 views

How can I listen emitted events from BSC network

How can I noticed and get the results of events whenever events are emitted on BSC network. I have tried web3.on() method, but the on() method can work with WebSocketProvider and BSC network does not ...
David Yu's user avatar
  • 111
0 votes
2 answers
170 views

Geth is not emitting pending transactons

I am connected to two nodes, mine and external. The external one emits pending transactions mine does not. I started geth full node (after downloading a snapshot of the network). After 24h using eth....
PhoenixPL's user avatar
1 vote
0 answers
383 views

Get addLiquidityTransaction on a specific contract on ethers.js

I'am trying to get an addLiquidityETH event in ethers.js with a WebSocket on a specific contract but got nothing, can someone tell me what am i missing ? const filter = { address: ' TOKEN ADDRESS ', ...
Juan Hernandez's user avatar
1 vote
2 answers
5k views

Is there a way to listen to log events via websocket with web3py

i am trying to listen to log events via my node's websocket server but i can't seem to find a way to do that using the web3Py lib. the asynchronous implementation of the docs is basically a threaded ...
Kaki Master Of Time's user avatar
1 vote
0 answers
222 views

Dex Data on BinanceSmartChain

I'm trying to get access to some data on the BSC using a websocket and the same methods as web3. I've sucessfully sent the following to get the latest swap pairs created at the PancakeSwap Factory: {\&...
user2146441's user avatar
5 votes
1 answer
6k views

Subscribing to events using ethers / hardhat network

I have a basic node express application. It connects to my locally running hardhat network via ethers & websocket. The connection seems to work, since I can query the blockchain succesfully (for ...
Fabian Scherer's user avatar
0 votes
1 answer
272 views

Why can't I establish a socket connection with Infura? Project ID is correct, I triple checked

I want to subscribe and listen to events that involve funds moving to my wallet, however I for some reason am not able to establish a socket connection to an Infura node. First I npm init and npm web3....
Teo's user avatar
  • 53
2 votes
1 answer
849 views

405 Method Not Allowed with websocket geth RPC

curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: XXXXXXX" -H "Origin: https://XXXXXXX/" -H "Content-Type: application/json" -X ...
Dobit's user avatar
  • 162