eth_subscribe
Returns event that matches the subscription.
https://api.1inch.com/web3/42161
Supported on: Arbitrum
Request
Request
object jsonrpc
* string (Enum)JSON-RPC version
2.0
method
* string The method to call
params
array Method parameters
items
any id
* number Request ID
JavaScript
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const response = await fetch('https://api.1inch.com/web3/42161', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${API_KEY}`,
},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'eth_subscribe',
params: [],
id: 1,
}),
});
const data = await response.json();
console.log(data);
Response
subscription
subscription
any oneOf[0]
object newHeads subscription. Subscribing to this returns a notification each time a new header is appended to the chain, including chain reorganizations.
number
* string hash
* string parentHash
* string nonce
* string sha3Uncles
* string logsBloom
* string transactionsRoot
* string stateRoot
* string receiptsRoot
* string miner
* string difficulty
string extraData
* string gasLimit
* string gasUsed
* string timestamp
* string baseFeePerGas
string additionalProperties
none oneOf[1]
string newPendingTransactions subscription. Returns the hash for all transactions that are added to the pending state and are signed with a key that's available in the node. When a transaction that was previously part of the canonical chain isn't part of the new canonical chain after a reorganization, it's emitted again.
oneOf[2]
object removed
boolean logIndex
string transactionIndex
string transactionHash
* string blockHash
string blockNumber
string address
string data
string topics
array items
string additionalProperties
none