logo

JSON-RPC API

To enable a software application to interact with the blockchain, JSON RPC is the preferred method. Darwinia provides an Ethereum-compatible JSON RPC endpoint, allowing developers to seamlessly interact with the Darwinia node just as they would with Ethereum API. While these APIs strive for high compatibility with Ethereum, it's important to acknowledge that there may be variations, particularly in relation to the consensus mechanism. The details of these differences will be explained in the accompanying guide.
💡
✅ means the method is fully compatible with the Ethereum, and ❌ means it is not.

Supported API Methods

  • Returns the current Ethereum protocol version.
  • Compatible Issue: returns 1 by default.
  • Used for submitting mining hashrate.
  • Compatible Issue: returns "0x0" by default
  • Used for submitting a proof-of-work solution.
  • Compatible Issue: returns false by default.
  • Returns the hash of the current block, the seedHash, and the boundary condition to be met ("target").
  • Compatible Issue: returns null by default
  • Returns true if client is actively mining new blocks.
  • Compatible Issue: returns false by default
  • Returns the number of hashes per second that the node is mining with.
  • Compatible Issue: returns false by default.
  • Returns information about a uncle of a block by hash and uncle index position.
  • Compatible Issue: returns null by default
  • Returns information about a uncle of a block by number and uncle index position.
  • Compatible Issue: returns null by default
  • Returns the number of uncles in a block from a block matching the given block hash.
  • Compatible Issue: returns null by default
  • Returns the number of uncles in a block from a block matching the given block number.
  • Compatible Issue: returns null by default
  • Returns a list of addresses owned by client.
  • Returns the number of most recent block.
  • Executes a new message call immediately without creating a transaction on the block chain.
  • Returns the chain ID used for signing replay-protected transactions.
  • Returns the latest block author.
  • 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.
  • Returns a collection of historical gas information from which you can decide what to submit as your maxFeePerGas and/or maxPriorityFeePerGas. This method was introduced with EIP 1559.
  • Returns the current price per gas in wei.
  • Generally you will use the value returned from this method to set the maxFeePerGas in a subsequent transaction that you are submitting. This method was introduced with EIP 1559.
  • Creates new message call transaction or a contract creation for signed transactions.
  • Creates new message call transaction or a contract creation, if the data field contains code.
  • Returns the balance of the account of given address.
  • Returns information about a block by hash.
  • Returns information about a block by block number.
  • Returns the number of transactions in a block from a block matching the given block hash.
  • Returns the number of transactions in a block matching the given block number.
  • Returns code at a given address.
  • Returns the value from a storage position at a given address.
  • Returns information about a transaction by block hash and transaction index position.
  • Returns information about a transaction by block number and transaction index position.
  • Returns the information about a transaction requested by transaction hash.
  • Returns the number of transactions sent from an address.
  • Returns the receipt of a transaction by transaction hash.
  • 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.
  • Creates a filter in the node, to notify when a new block arrives. To check if the state has changed, call eth_getFilterChanges.
  • Creates a filter in the node, to notify when new pending transactions arrive. To check if the state has changed, call eth_getFilterChanges.
  • Returns an array of all logs matching a given filter object.
  • Returns an array of all logs matching a given filter object.
  • Polling method for a filter, which returns an array of logs which occurred since last poll.
  • Uninstalls a filter with given id. 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.
  • Creates a new subscription for desired events. Sends data as soon as it occurs.
  • cancels the subscription given by its ID
  • Returns an object with data about the sync status or false.
  • Returns the current client version.
  • Returns Keccak-256 (not the standardized SHA3-256) of the given data.
  • List the exact details of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.
  • List a textual summary of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.
  • For the number of transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.
  • Replays the block that matching the given block number.
  • Replays the block that matching the given block hash.
  • Attempts to run the transaction in the exact same manner as it was executed on the network. It will replay any transaction that may have been executed prior to this one before it and will then attempt to execute the transaction that corresponds to the given hash.
  • Returns traces matching given filter.