Skip to main content

pathfinder_subscribe RPC Method

Open a new websocket subscription.

Updated on
Jun 26, 2024

pathfinder_subscribe RPC Method

Parameters

kind
string
REQUIRED
The type of subscription. It supports one of the following type of subscription
newHeads
string
REQUIRED
The notifications for each new block header
events
string
REQUIRED
The notifications for events emitted by smart contracts. With Events we can use one of the following fields as well
address
string
(Optional) It filter events by contract address
keys
array
(Optional) It filter events by specific keys
transactionStatus
string
REQUIRED
The status updates for a specific transaction. With transactionStatus we have to use transaction_hash as well
transaction_hash
string
REQUIRED
The required transaction hash to track

Returns

result
integer
An identifier for this subscription stream used to associate events with this subscription
Request
1
wscat -c ws \
2
# wait for connection
3
{"id":1,"jsonrpc":"2.0","method":"pathfinder_subscribe","params":["newHeads"]}
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free