WSS

eth_subscribe

Subscribe to different Ethereum event types like newHeads, logs, newPendingTransactions, and minedTransactions using WebSockets.

wss://bsc.nownodes.io/wss/{{api-key}}

Example body (raw)

{"jsonrpc":"2.0","id": 2, "method": "eth_subscribe", "params": ["newHeads"]}

Example response: 200

{
    "jsonrpc": "2.0",
    "method": "eth_subscription",
    "params": {
        "subscription": "0x120ac69196e4f4b0aa9fbb251a4addd1",
        "result": {
            "parentHash": "0x36e47e59cd78c9b5d79748e77c79706a0c3fade869d90d2d07a6b1f48f3d0ecf",
            "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
            "miner": "0x0100000000000000000000000000000000000000",
            "stateRoot": "0x173d731a33d73bed28b5e46f1f025677706d8805a1f1bd1ea06246106d7b0fe4",
            "transactionsRoot": "0xfd5cbd4b68a0f979bbfa75482c7b99b2ce40bd08025cf569b85338764de6743a",
            "receiptsRoot": "0x6131cb6d400ccbed44e9be6751ad29020b0309c6aa97ace45d4725075eff0d19",
            "logsBloom": "0x413204bc001391c1c922708917002401a300850c00f62404080205021842c02400d200a412a042a6a00048001401401519004335d220d81004bc0a20000690c0882c5182130102106000b1585105844944308dc9ae260230143501080000440186e4c0085248408201101053068488865654078207e94640200010128000300a11010026048048201108000c81088510b2c0dc41bef4a6082600611041849243a411104304a4050000a20003c188016114080209250010258d668801047100489999caa71188010009810136410524441194090d0ce22042250441160a14e1008ae4614a201080244423304020250708060989000410110090305c384410650a",
            "difficulty": "0x1",
            "number": "0x45b3e02",
            "gasLimit": "0x16e3600",
            "gasUsed": "0x132818f",
            "timestamp": "0x69317b04",
            "extraData": "0x00000000003bb47100000000e6ec5f020000000001c03d7100000000000223cfdbc376c8963ce9e00c01cd4a9c98a9620ca50a792aabe810ec44d58cee8900000001020000000000000000000000000000000000000500000000a2b43fca5b13accfdd41ecf7f5815c6eb62572266d070cb801156fce0f8934b700000001020000000000000000000000000000000000000500000000",
            "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "nonce": "0x0000000000000000",
            "extDataHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
            "baseFeePerGas": "0x630e876",
            "extDataGasUsed": "0x0",
            "blockGasCost": "0x0",
            "blobGasUsed": "0x0",
            "excessBlobGas": "0x0",
            "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "timestampMilliseconds": "0x19ae94887a2",
            "minDelayExcess": "0x70c2a2",
            "hash": "0xfb30b8b59f5781e82a23f6031a00533f09c40d569727c868d0725cf90a627369"
        }
    }
}

eth_unsubscribe

Unsubscribe from different Ethereum event types with a regular RPC call with eth_unsubscribe as the method and the subscriptionId as the first parameter.

Example body (raw)

Example response: 200

eth_chainId

Returns the currently configured chain ID, a value used in replay-protected transaction signing as introduced by EIP-155.

Example body (raw)

Example response: 200

eth_blockNumber

Returns the number of most recent block.

Example body (raw)

Example response: 200

eth_call

Executes a new message call immediately without creating a transaction on the block chain.

Example body (raw)

Example response: 200

eth_estimateGas

Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance.

Example body (raw)

Example response: 200

eth_gasPrice

Returns the current gas price in the default EVM denomination parameter.

Example body (raw)

Example response: 200

eth_getBalance

Returns the balance of the account of given address.

Example body (raw)

Example response: 200

eth_getBlockByHash

Returns information about a block by hash.

Example body (raw)

Example response: 200

eth_getBlockByNumber

Returns information about a block by block number.

Example body (raw)

Example response: 200

eth_getBlockTransactionCountByHash

Returns the number of transactions in a block matching the given block hash.

Example body (raw)

Example response: 200

eth_getBlockTransactionCountByNumber

Returns the number of transactions in a block from a block matching the given block number.

Example body (raw)

Example response: 200

eth_getCode

Returns code at a given address.

Example body (raw)

Example response: 200

eth_getFilterChanges

Polling method for a filter, which returns an array of logs which occurred since last poll.

Example body (raw)

Example response: 200

eth_getFilterLogs

Returns an array of all logs matching filter with given id.

Example body (raw)

Example response: 200

eth_getLogs

Returns an array of all logs matching a given filter object.

Example body (raw)

Example response: 200

eth_getStorageAt

Returns the value from a storage position at a given address.

Example body (raw)

Example response: 200

eth_getTransactionByBlockHashAndIndex

Returns information about a transaction by block hash and transaction index position.

Example body (raw)

Example response: 200

eth_getTransactionByBlockNumberAndIndex

Returns information about a transaction by block number and transaction index position.

Example body (raw)

Example response: 200

eth_getTransactionByHash

Returns the information about a transaction requested by transaction hash.

Example body (raw)

Example response: 200

eth_getTransactionCount

Returns the number of transactions sent from an address.

Example body (raw)

Example response: 200

eth_getTransactionReceipt

Returns the receipt of a transaction by transaction hash.

Example body (raw)

Example response: 200

eth_getUncleByBlockHashAndIndex

Returns information about a uncle of a block by hash and uncle index position.

Example body (raw)

Example response: 200

eth_getUncleByBlockNumberAndIndex

Returns information about a uncle of a block by number and uncle index position.

Example body (raw)

Example response: 200

eth_getUncleCountByBlockHash

Returns the number of uncles in a block matching the given block hash.

Example body (raw)

Example response: 200

eth_getUncleCountByBlockNumber

Returns the number of uncles in a block from a block matching the given block number.

Example body (raw)

Example response: 200

eth_newBlockFilter

Creates a filter in the node, to notify when a new block arrives.

Example body (raw)

Example response: 200

eth_newFilter

Creates a filter object, based on filter options, to notify when the state changes (logs).

Method: POST

Example body (raw)

Example response: 200

eth_newPendingTransactionFilter

Creates a filter in the node, to notify when new pending transactions arrive.

Example body (raw)

Example response: 200

eth_pendingTransactions

Creates a filter in the node, to notify when new pending transactions arrive.

Example body (raw)

Example response: 200

eth_sendRawTransaction

Creates new message call transaction or a contract creation for signed transactions.

Example body (raw)

Example response: 200

eth_sendTransaction

Creates new message call transaction or a contract creation, if the data field contains code.

Example body (raw)

Example response: 200

eth_sign

The sign method calculates an Ethereum specific signature with: sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))).

Example body (raw)

Example response: 200

eth_syncing

The sync status object may need to be different depending on the details of Tendermint's sync protocol. However, the 'synced' result is simply a boolean, and can easily be derived from Tendermint's internal sync state.

Example body (raw)

Example response: 200

eth_uninstallFilter

Uninstalls a filter with given id. Should always be called when watch is no longer needed.

Example body (raw)

Example response: 200

eth_createAccessList

Returns list of addresses and storage keys that are read and written by the transaction (except the sender account and precompiles), plus the estimated gas consumed when the access list is added.

Example body (raw)

Example response: 200

eth_maxPriorityFeePerGas

Returns a fee per gas that is an estimate of how much you can pay as a priority fee, or 'tip', to get a transaction included in the current block.

Example body (raw)

Example response: 200

eth_feeHistory

Returns a collection of historical gas information.

Example body (raw)

Example response: 200

eth_getProof

Returns the account and storage values of the specified accoun.

Example body (raw)

Example response: 200

eth_coinbase

Example body (raw)

Example response: 200

eth_signTransaction

Example body (raw)

Example response: 200

eth_sign

Example body (raw)

Example response: 200

net_version

Returns the current network id.

Example body (raw)

Example response: 200

net_listening

Returns true if client is actively listening for network connections.

Example body (raw)

Example response: 200

net_peerCount

Returns the number of peers currently connected to the client.

Example body (raw)

Example response: 200

web3_clientVersion

Get the web3 client version.

Example body (raw)

Example response: 200

web3_sha3

Returns Keccak-256 (not the standardized SHA3-256) of the given data.

Example body (raw)

Example response: 200

Last updated