Supported on zkSync (mainnet) only.
API Endpoint
The format of a zkSync API endpoint is
https://open-platform.nodereal.io/{{apiKey}}/zksync/
Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/zksync/
Ethereum JSON-RPC API
eth_accounts
Returns an array of addresses owned by the client.
Parameters
- N/A
Returns
- An array of addresses owned by the client
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_accounts","id":1,"jsonrpc":"2.0"}'
eth_blockNumber
Returns the latest block number of the blockchain.
Parameters
- N/A
Returns
- An integer value of the latest block number encoded as hexadecimal
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}'
eth_call
Executes a new message call immediately without creating a transaction on the block chain.
Parameters
transaction
- object - The transaction call object which contains the following fields:from
- string - (optional) The address from which the transaction is sentto
- string - The address to which the transaction is addressedgas
- integer - (optional) The integer of gas provided for the transaction executiongasPrice
- integer - (optional) The integer of gasPrice used for each paid gas encoded as hexadecimalvalue
- integer - (optional) The integer of value sent with this transaction encoded as hexadecimaldata
- string - (optional) The hash of the method signature and encoded parameters. For more information, see the Contract ABI description in the Solidity documentation
blockNumber/tag
- string - The block number in hexadecimal format or the string latest, earliest, pending, safe or finalized
Returns
data
- The return value of the executed contract method
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
--header 'Content-Type: application/json' \
--data '{"method":"eth_call","params":[{"from":"0x9Efc7825Cf3347F5B2dcCC7740D80224C83A1cB2","to":"0x40609141Db628BeEE3BfAB8034Fc2D8278D0Cc78","data":"0xa9059cbb000000000000000000000000d1d5577189bcc32eb6739f15e78d122db6df81530000000000000000000000000000000000000000000000056bc75e2d63100000"}, "latest"],"id":1,"jsonrpc":"2.0"}'
eth_chainId
Returns the current network/chain ID, used to sign replay-protected transaction introduced in EIP-155.
Parameters
- N/A
Returns
- It returns a hexadecimal value in string format which represents an integer of the chain ID
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_chainId","params":[],"id":1,"jsonrpc":"2.0"}'
eth_estimateGas
Returns an estimation of gas for a given transaction.
Parameters
transaction
- object - The transaction call object:from
- string - (optional) The address from which the transaction is sentto
- string - The address to which the transaction is addressedgas
- integer - (optional) The integer of gas provided for the transaction executiongasPrice
- integer - (optional) The integer of gasPrice used for each paid gas encoded as hexadecimalvalue
- integer - (optional) The integer of value sent with this transaction encoded as hexadecimaldata
- string - (optional) The hash of the method signature and encoded parameters.
Returns
quantity
- The estimated amount of gas used
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_estimateGas","params":[{"from":"0xAACD1Cf4567bdFEd90a8c829174920B00cA30fF8","to":"0x245AD20B9A84B073fB565C6e1541477A0c833f56"}],"id":1,"jsonrpc":"2.0"}'
eth_gasPrice
Returns the current gas price on the network in wei.
Parameters
- N/A
Returns
- The hexadecimal value of the current gas price in wei
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_gasPrice","params":[],"id":1,"jsonrpc":"2.0"}'
eth_getBalance
Returns the balance of given account address in wei.
Parameters
address
- string - The address (20 bytes) to check for balanceblockNumber/tag
- string - The block number in hexadecimal format or the string latest, earliest, pending, safe or finalized
Returns
result
- The ETH balance of the specified address in hexadecimal value, measured in wei
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getBalance","params":["0x82d336801744F96384F46f40d231eDaB8E3D33Bc", "latest"],"id":1,"jsonrpc":"2.0"}'
eth_getBlockByHash
Returns information of the block matching the given block hash.
Parameters
hash
- string - The hash (32 bytes) of the blocktransaction detail flag
- boolean - (default: false) It returns the full transaction objects when it is true otherwise it returns only the hashes of the transactions
Returns
object
- A block object, or null when no block was foundbaseFeePerGas
- A string of the base fee encoded in hexadecimal format. Please note that this response field will not be included in a block requested before the EIP-1559 upgradedifficulty
-The integer of the difficulty for this block encoded as a hexadecimalextraData
- The “extra data” field of this blockgasLimit
- The maximum gas allowed in this block encoded as a hexadecimalgasUsed
- The total used gas by all transactions in this block encoded as a hexadecimalhash
- The block hash of the requested block. null if pendingl1BatchNumber
- The L1 batch number of the blockl1BatchTimestamp
- The L1 batch timestamp of the blocklogsBloom
- The bloom filter for the logs of the block. null if pendingminer
- The address of the beneficiary to whom the mining rewards were givenmixHash
- A string of a 256-bit hash encoded as a hexadecimalnonce
- The hash of the generated proof-of-work. null if pendingnumber
- The block number of the requested block encoded as a hexadecimal. null if pendingparentHash
- The hash of the parent blockreceiptsRoot
- The root of the receipts trie of the blocksha3Uncles
- The SHA3 of the uncles data in the blocksize
- The size of this block in bytes as an Integer value encoded as hexadecimalstateRoot
- The root of the final state trie of the blocktimestamp
- The unix timestamp for when the block was collatedtotalDifficulty
- The integer of the total difficulty of the chain until this block encoded as a hexadecimaltransactions
- An array of transaction objects - please see eth_getTransactionByHash for exact shapetransactionsRoot
- The root of the transaction trie of the blockuncles
- An array of uncle hashes
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getBlockByHash","params":["0xe3ee4854da8ef31da07ea25fa42133954984604a877f439272b0e77dc260a128",false],"id":1,"jsonrpc":"2.0"}'
eth_getBlockByNumber
Returns information of the block matching the given block number.
Parameters
blockNumber/tag
- string - The block number in hexadecimal format or the string latest, earliest, pending, safe or finalizedtransaction detail flag
- boolean - (default: false) The method returns the full transaction objects when this value is true otherwise, it returns only the hashes of the transactions
Returns
object
- A block object, or null when no block was foundbaseFeePerGas
- A string of the base fee encoded in hexadecimal format. Please note that this response field will not be included in a block requested before the EIP-1559 upgradedifficulty
-The integer of the difficulty for this block encoded as a hexadecimalextraData
- The “extra data” field of this blockgasLimit
- The maximum gas allowed in this block encoded as a hexadecimalgasUsed
- The total used gas by all transactions in this block encoded as a hexadecimalhash
- The block hash of the requested block. null if pendingl1BatchNumber
- The L1 batch number of the blockl1BatchTimestamp
- The L1 batch timestamp of the blocklogsBloom
- The bloom filter for the logs of the block. null if pendingminer
- The address of the beneficiary to whom the mining rewards were givenmixHash
- A string of a 256-bit hash encoded as a hexadecimalnonce
- The hash of the generated proof-of-work. null if pendingnumber
- The block number of the requested block encoded as a hexadecimal. null if pendingparentHash
- The hash of the parent blockreceiptsRoot
- The root of the receipts trie of the blocksha3Uncles
- The SHA3 of the uncles data in the blocksize
- The size of this block in bytes as an Integer value encoded as hexadecimalstateRoot
- The root of the final state trie of the blocktimestamp
- The unix timestamp for when the block was collatedtotalDifficulty
- The integer of the total difficulty of the chain until this block encoded as a hexadecimaltransactions
- An array of transaction objects - please see eth_getTransactionByHash for exact shapetransactionsRoot
- The root of the transaction trie of the blockuncles
- An array of uncle hashes
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getBlockByNumber","params":["0x8CFDC3",false],"id":1,"jsonrpc":"2.0"}'
eth_getBlockTransactionCountByHash
Returns the number of transactions for the block matching the given block hash.
Parameters
hash
- string - The hash of the block
Returns
result
- The number of transactions associated with a specific block, in hexadecimal value
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getBlockTransactionCountByHash","params":["0xe3ee4854da8ef31da07ea25fa42133954984604a877f439272b0e77dc260a128"],"id":1,"jsonrpc":"2.0"}'
eth_getBlockTransactionCountByNumber
Returns the number of transactions for the block matching the given block number.
Parameters
blockNumber
- string - The block number as a string in hexadecimal format or tags. The supported tag values include earliest for the earliest/genesis block, latest for the latest mined block, pending for the pending state/transactions, safe for the most recent secure block, and finalized for the most recent secure block accepted by more than 2/3 of validators. safe and finalized are only supported on Ethereum, Gnosis, Arbitrum, Arbitrum Nova, and Avalanche C-chain
Returns
result
- The number of transactions in a specific block represented in hexadecimal format
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getBlockTransactionCountByNumber","params":["0x8CFDC3"],"id":1,"jsonrpc":"2.0"}'
eth_getCode
Returns the compiled bytecode of a smart contract.
Parameters
address
- string - The address of the smart contract from which the bytecode will be obtainedblockNumber
- string - The block number as a string in hexadecimal format or tags. The supported tag values include earliest for the earliest/genesis block, latest for the latest mined block, pending for the pending state/transactions, safe for the most recent secure block, and finalized for the most recent secure block accepted by more than 2/3 of validators. safe and finalized are only supported on Ethereum, Gnosis, Arbitrum, Arbitrum Nova, and Avalanche C-chain
Returns
result
- The bytecode from a given address returned as a string
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getCode","params":["0x000000000000000000000000000000000000800A","latest"],"id":1,"jsonrpc":"2.0"}'
eth_getFilterChanges
Polling method for a filter, which returns an array of events that have occurred since the last poll.
Parameters
filter ID
- string - The filter id that is returned from eth_newFilter, eth_newBlockFilter or eth_newPendingTransactionFilter
Returns
array
- An array of one of the following, depending on the filter type, or empty if there were no changes since the last poll:eth_newBlockFilter
:blockHash
- The 32 byte hash of a block that meets your filter requirements
eth_newPendingTransactionFilter
:transactionHash
- The 32 byte hash of a transaction that meets your filter requirements
eth_newFilter
:address
- An address from which this log originatedtopics
- An array of zero to four 32 Bytes DATA of indexed log arguments. In Solidity, the first topic is the hash of the signature of the event (e.g. Deposit(address, bytes32, uint256)), except you declare the event with the anonymous specifierdata
- It contains one or more 32 Bytes non-indexed arguments of the logblockNumber
- The block number where this log was in. null when its a pending logtransactionHash
- The hash of the transactions this log was created from. null when its a pending logtransactionIndex
- The integer of the transaction's index position that the log was created from. null when it's a pending logblockHash
- The hash of the block where this log was in. null when its a pending loglogIndex
- The integer of the log index position in the block. null when it's a pending logremoved
- It is true when the log was removed due to a chain reorganization, and false if it's a valid log
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getFilterChanges","params":["YOUR_FILTER_ID"],"id":1,"jsonrpc":"2.0"}'
eth_getFilterLogs
Returns an array of all logs matching filter with given id.
Parameters
id
- string - The filter ID
Returns
result
- An array of log objects, or an empty array if nothing has changed since last polladdress
- string - The address from which this log originatedtopics
- array - An array of (0 to 4) 32 Bytes DATA of indexed log arguments. (In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier)data
- string - It contains one or more 32 Bytes non-indexed arguments of the logblockNumber
- string - The block number where this log was in. null when its pending. Null when it's a pending logtransactionHash
- string - The hash of the transaction from which this log was created from. null if the log is pendingtransactionIndex
- string - The integer of the transaction's index position that the log was created from. Null when it's a pending logblockHash
- string - The hash of the block where this log was in. Null when it's a pending loglogIndex
- string - The integer of the log index position in the block. Null when it's a pending logremoved
- boolean - It is true if log was removed, due to a chain reorganization and false if it's a valid log
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getFilterLogs","params":["YOUR_FILTER_ID"],"id":1,"jsonrpc":"2.0"}'
eth_getLogs
Returns an array of all logs matching a given filter object.
Parameters
object
- The transaction call object which contains the following fields:fromBlock
- string - (optional, default: "latest") The block number as a string in hexadecimal format or tags. The supported tag values include earliest for the earliest/genesis block, latest for the latest mined block, pending for the pending state/transactions, safe for the most recent secure block, and finalized for the most recent secure block accepted by more than 2/3 of validators. safe and finalized are only supported on Ethereum, Gnosis, Arbitrum, Arbitrum Nova, and Avalanche C-chaintoBlock
- string - (optional, default: "latest") The block number as a string in hexadecimal format or tags. The supported tag values include earliest for the earliest/genesis block, latest for the latest mined block, pending for the pending state/transactions, safe for the most recent secure block, and finalized for the most recent secure block accepted by more than 2/3 of validators. safe and finalized are only supported on Ethereum, Gnosis, Arbitrum, Arbitrum Nova, and Avalanche C-chainaddress
- string - (optional) The contract address or a list of addresses from which logs should originatetopics
- string - (optional) An array of DATA topics and also, the topics are order-dependent.blockHash
- string - (optional) With the addition of EIP-234, blockHash is a new filter option that restricts the logs returned to the block number referenced in the blockHash. Using the blockHash field is equivalent to setting the fromBlock and toBlock to the block number the blockHash references. If blockHash is present in the filter criteria, neither fromBlock nor toBlock is allowed
Returns
array
- An array of log objects, or an empty array if nothing has changed since last poll:
address - An address from which this log originatedtopics
-An array of zero to four 32 Bytes DATA of indexed log arguments. In Solidity, the first topic is the hash of the signature of the event (e.g. Deposit(address, bytes32, uint256)), except you declare the event with the anonymous specifierdata
- It contains one or more 32 Bytes non-indexed arguments of the logblockNumber
- The block number where this log was in. null when it's a pending logtransactionHash
- The hash of the transactions this log was created from. null when its a pending logtransactionIndex
- The integer of the transaction's index position that the log was created from. null when it's a pending logblockHash
- The hash of the block where this log was in. null when it's a pending loglogIndex
- The integer of the log index position in the block. null when it's a pending logremoved
- It is true when the log was removed due to a chain reorganization, and false if it's a valid log
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getLogs","params":[{"address": "0xB949b4E3945628650862a29Abef3291F2eD52471"}],"id":1,"jsonrpc":"2.0"}'
eth_getStorageAt
Returns the value from a storage position at a given address.
Parameters
address
- string - The address to check for storageposition
- string - The integer of the position in storageblockNumber
- string - The block number as a string in hexadecimal format or tags. The supported tag values include earliest for the earliest/genesis block, latest for the latest mined block, pending for the pending state/transactions, safe for the most recent secure block, and finalized for the most recent secure block accepted by more than 2/3 of validators. safe and finalized are only supported on Ethereum, Gnosis, Arbitrum, Arbitrum Nova, and Avalanche C-chain
Returns
result
- It returns the value from a storage position at a given address
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getStorageAt","params":["0xE592427A0AEce92De3Edee1F18E0157C05861564", "0x0", "latest"],"id":1,"jsonrpc":"2.0"}'
eth_getTransactionByBlockHashAndIndex
Returns information about a transaction given a blockhash and transaction index position.
Parameters
blockHash
- string - The block hashindex
- string - An integer of the transaction index position encoded as a hexadecimal
Returns
object
- The transaction response object, or null if no transaction is found:blockHash
- The hash of the block where this log was in. null when it's a pending logblockNumber
- The block number where this log was in. null when it's a pending logfrom
- The address of the sendergas
- The gas provided by the sender, encoded as hexadecimalgasPrice
- The gas price provided by the sender in wei, encoded as hexadecimalmaxFeePerGas
- The maximum fee per gas set in the transactionmaxPriorityFeePerGas
- The maximum priority gas fee set in the transactionhash
- The hash of the transactioninput
- The data sent along with the transactionnonce
- The number of transactions made by the sender before this one encoded as hexadecimalto
- The address of the receiver. null when it's a contract creation transactiontransactionIndex
- The integer of the transaction's index position that the log was created from. null when it's a pending logvalue
- The value transferred in wei encoded as hexadecimaltype
- The transaction typeaccesslist
- A list of addresses and storage keys that the transaction plans to accesschainId
- The chain id of the transaction, if anyv
- The standardized V field of the signaturer
The R field of the signatures
The S field of the signature
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getTransactionByBlockHashAndIndex","params":["0xe3ee4854da8ef31da07ea25fa42133954984604a877f439272b0e77dc260a128","0x2"],"id":1,"jsonrpc":"2.0"}'
eth_getTransactionByBlockNumberAndIndex
Returns information about a transaction given a block number and transaction index position.
Parameters
blockNumber
- string - The block number as a string in hexadecimal format or tags. The supported tag values include earliest for the earliest/genesis block, latest for the latest mined block, pending for the pending state/transactions, safe for the most recent secure block, and finalized for the most recent secure block accepted by more than 2/3 of validators. safe and finalized are only supported on Ethereum, Gnosis, Arbitrum, Arbitrum Nova, and Avalanche C-chainindex
- string - An integer of the transaction index position encoded as a hexadecimal
Returns
object
- The transaction response object, or null if no transaction is found:blockHash
- The hash of the block where this log was in. null when it's a pending logblockNumber
- The block number where this log was in. null when it's a pending logfrom
- The address of the sendergas
- The gas provided by the sender, encoded as hexadecimalgasPrice
- The gas price provided by the sender in wei, encoded as hexadecimalmaxFeePerGas
- The maximum fee per gas set in the transactionmaxPriorityFeePerGas
- The maximum priority gas fee set in the transactionhash
- The hash of the transactioninput
- The data sent along with the transactionnonce
- The number of transactions made by the sender before this one encoded as hexadecimalto
- The address of the receiver. null when it's a contract creation transactiontransactionIndex
- The integer of the transaction's index position that the log was created from. null when it's a pending logvalue
- The value transferred in wei encoded as hexadecimaltype
- The transaction typechainId
- The chain id of the transaction, if anyv
- The standardized V field of the signaturer
The R field of the signatures
The S field of the signature
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getTransactionByBlockNumberAndIndex","params":["0x8CFDC3", "0x2"],"id":1,"jsonrpc":"2.0"}'
eth_getTransactionByHash
Returns the information about a transaction from a transaction hash.
Parameters
hash
- string - The hash of a transaction
Returns
object
- The transaction response object, or null if no transaction is found:blockHash
- The hash of the block where this log was in. null when it's a pending logblockNumber
- The block number where this log was in. null when it's a pending logfrom
- The address of the sendergas
- The gas provided by the sender, encoded as hexadecimalgasPrice
- The gas price provided by the sender in wei, encoded as hexadecimalmaxFeePerGas
- The maximum fee per gas set in the transactionmaxPriorityFeePerGas
- The maximum priority gas fee set in the transactionhash
- The hash of the transactioninput
- The data sent along with the transactionnonce
- The number of transactions made by the sender before this one encoded as hexadecimalto
- The address of the receiver. null when it's a contract creation transactiontransactionIndex
- The integer of the transaction's index position that the log was created from. null when it's a pending logvalue
- The value transferred in wei encoded as hexadecimaltype
- The transaction typeaccessList
- A list of addresses and storage keys that the transaction plans to accesschainId
- The chain id of the transaction, if anyv
- The standardized V field of the signaturer
The R field of the signatures
The S field of the signature
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getTransactionByHash","params":["0xebeb53528ede8be54fdcd519c96bb3aeff136cd71179d57ee70ed24a6efad18a"],"id":1,"jsonrpc":"2.0"}'
eth_getTransactionCount
Returns the number of transactions sent from an address.
Parameters
address
- string - The address from which the transaction count to be checkedblockNumber
- string - The block number as a string in hexadecimal format or tags. The supported tag values include earliest for the earliest/genesis block, latest for the latest mined block, pending for the pending state/transactions, safe for the most recent secure block, and finalized for the most recent secure block accepted by more than 2/3 of validators. safe and finalized are only supported on Ethereum, Gnosis, Arbitrum, Arbitrum Nova, and Avalanche C-chain
Returns
result
- The integer of the number of transactions sent from an address encoded as hexadecimal
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getTransactionCount","params":["0x82d336801744F96384F46f40d231eDaB8E3D33Bc", "latest"],"id":1,"jsonrpc":"2.0"}'
eth_getTransactionReceipt
Returns the receipt of a transaction by transaction hash.
Parameters
hash
- string - The hash of a transaction
Returns
object
- A transaction receipt object, or null when no receipt was foundblockHash
- The hash of the block where this transaction was inblockNumber
- The block number where this transaction was added encoded as a hexadecimalcontractAddress
- The contract address created for contract creation, otherwise nullcumulativeGasUsed
- The total gas used when this transaction was executed in the blockeffectiveGasPrice
- The total base charge plus tip paid for each unit of gasfrom
- The address of the sendergasUsed
- The amount of gas used by this specific transaction alonelogs
- An array of log objects that generated this transactionaddress
- The address from which this log was generatedtopics
- An array of zero to four 32 Bytes DATA of indexed log arguments. In Solidity, the first topic is the hash of the signature of the event (e.g. Deposit(address, bytes32, uint256)), except you declare the event with the anonymous specifierdata
- The 32 byte non-indexed argument of the logblockNumber
- The block number where this log was intransactionHash
- The hash of the transaction from which this log was created from. null if the log is pendingtransactionIndex
- The transactions index position from which this log was created from. null if the log is pendingblockHash
- The hash of the block where this log was inlogIndex
- The integer of log index position in the block encoded as hexadecimal. null if the log is pendingremoved
- It is true if log was removed, due to a chain reorganization and false if it's a valid log
logsBloom
- The bloom filter which is used to retrive related logsstatus
- It is either 1 (success) or 0 (failure) encoded as a hexadecimalto
- The address of the receiver. Null when its a contract creation transactiontransactionHash
- The hash of the transactiontransactionIndex
- The transactions index position in the block encoded as a hexadecimaltype
- The type of value
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getTransactionReceipt","params":["0xebeb53528ede8be54fdcd519c96bb3aeff136cd71179d57ee70ed24a6efad18a"],"id":1,"jsonrpc":"2.0"}'
eth_getUncleCountByBlockHash
Returns the number of uncles for the block matching the given block hash.
Parameters
hash
- string - The hash of the block to get uncles for
Returns
uncles
- The integer value of the number of uncles in the block encoded as hexadecimal
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getUncleCountByBlockHash","params":["0x2b64fbd89591504539f013f3a00fbeb01d6927fc72e08e9ef0bc0d0c041492fa"],"id":1,"jsonrpc":"2.0"}'
eth_getUncleCountByBlockNumber
Returns the number of uncles for the block matching the given block number.
Parameters
blockNumber
- string - The integer of a block number encoded in hexadecimal format starting with 0x
Returns
uncles
- The integer value of the number of uncles in the block encoded as hexadecimal
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getUncleCountByBlockNumber","params":["0xc5043f"],"id":1,"jsonrpc":"2.0"}'
eth_hashrate
Returns the number of hashes per second that the node is mining with.
Parameters
- N/A
Returns
hashrate
- The number of hashes per second encoded in hexadecimal format
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_hashrate","params":[],"id":67}'
eth_mining
Returns true if node is actively mining new blocks.
Parameters
- N/A
Returns
result
- It is true if the node is mining, otherwise false
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_mining","params":[],"id":67}'
eth_newBlockFilter
Creates a filter in the node, to notify when a new block arrives. To check if the state has changed, call eth_getFilterChanges.
Parameters
- N/A
Returns
result
- It returns a filter id to be used when calling eth_getFilterChanges
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_newBlockFilter","params":[],"id":67}'
eth_newFilter
Creates a filter object, based on filter options, to notify when the state changes (logs). To check if the state has changed, call eth_getFilterChanges.
Parameters
object
- The transaction response object which contains the following filter information:
fromBlock
- string - (optional) The block number as a string in hexadecimal format or tags. The supported tag values include earliest for the earliest/genesis block, latest for the latest mined block, pending for the pending state/transactions, safe for the most recent secure block, and finalized for the most recent secure block accepted by more than 2/3 of validators. safe and finalized are only supported on Ethereum, Gnosis, Arbitrum, Arbitrum Nova, and Avalanche C-chaintoBlock
- string - (optional) The block number as a string in hexadecimal format or tags. The supported tag values include earliest for the earliest/genesis block, latest for the latest mined block, pending for the pending state/transactions, safe for the most recent secure block, and finalized for the most recent secure block accepted by more than 2/3 of validators. safe and finalized are only supported on Ethereum, Gnosis, Arbitrum, Arbitrum Nova, and Avalanche C-chainaddress
- string - (optional) The contract address or a list of addresses from which logs should originatetopics
- string - (optional) An array of DATA topics and also, the topics are order-dependent.
Returns
result
- It returns a filter id to be used when calling eth_getFilterChange
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_newFilter","params":[{"fromBlock": "0xe20360", "toBlock": "0xe20411", "address": "0x6b175474e89094c44da98b954eedeac495271d0f","topics": []}],"id":1}'
eth_newPendingTransactionFilter
Creates a filter in the node to notify when new pending transactions arrive. To check if the state has changed, call eth_getFilterChanges.
Parameters
- N/A
Returns
result
- A filter id to be used when calling eth_getFilterChanges
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_newPendingTransactionFilter","params":[],"id":67}'
eth_sendRawTransaction
Creates new message call transaction or a contract creation for signed transactions.
Parameters
data
- The signed transaction
Returns
result
- The transaction hash, or the zero hash if the transaction is not yet available
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["signed transaction"],"id":1}'
eth_syncing
Returns an object with the sync status of the node if the node is out-of-sync and is syncing. Returns false when the node is already in sync.
Parameters
- N/A
Returns
result
- The result is false if JSON Object is not syncing otherwise it's true:startingblock
- The block at which the import started encoded as hexadecimalcurrentblock
- The current block, same as eth_blockNumber encoded as hexadecimalhighestblock
- The estimated highest block encoded as hexadecimal
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":67}'
eth_uninstallFilter
It uninstalls a filter with the given filter id.
Parameters
filter ID
- string - The filter ID that needs to be uninstalled. It should always be called when watch is no longer needed. Additionally, Filters timeout when they aren't requested with eth_getFilterChanges for a period of time
Returns
result
- It returns true if the filter was successfully uninstalled, otherwise false
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_uninstallFilter","params":["YOUR_FILTER_ID"],"id":1}'
net_listening
Returns true if client is actively listening for network connections.
Parameters
- N/A
Returns
result
- It's true when the client is actively listening for network connections, otherwise false
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"net_listening","params":[],"id":67}'
net_peerCount
Returns number of peers currently connected to the client.
Parameters
- N/A
Returns
result
- The integer of the number of connected peers encoded as hexadecimal
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":67}'
net_version
Returns the current network id.
Parameters
- N/A
Returns
result
- The string value of current network id. Typical values are as follows:- 1 - ethereum mainnet
- 2 - morden testnet (deprecated)
- 3 - ropsten testnet
- 4 - rinkeby testnet
- 5 - goerli testnet
- 11155111 - sepolia testnet
- 10 - optimism mainnet
- 69 - optimism kovan testnet
- 42 - kovan testnet
- 137 - matic/polygon mainnet
- 80001 - matic/polygon mumbai testnet
- 250 - fantom mainnet
- 100 - xdai mainnet
- 56 - bsc mainne
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"net_version","params":[],"id":67}'
web3_clientVersion
Returns the current version of the chain client.
Parameters
- N/A
Returns
result
- The current client version in string format
Example
curl https://open-platform.nodereal.io/{{apiKey}}/zksync/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}'