Returns binary data from the local database
Database name.
Key name.
The previously stored data.
Returns string from the local database
Database name.
Key name.
The previously stored string.
Stores binary data in the local database.
Database name.
Key name.
Data to store.
true if the value was stored, otherwise false.
Stores a string in the local database.
Database name.
Key name.
String to store.
returns true if the value was stored, otherwise false.
Attempts to replay the transaction as it was executed on the network and return storage data given a starting key and max number of entries to return.
DATA, 32 Bytes - hash of a block
QUANTITY - the index of the transaction in the block
DATA, 20 Bytes - address of the contract
DATA - hash of the start key for grabbing storage entries
integer of maximum number of storage entries to return
returns a storage object with the keys being keccak-256 hashes of the storage keys, and the values being the raw, unhashed key and value for that specific storage slot. Also returns a next key which is the keccak-256 hash of the next key in storage for continuous downloading.
Attempt 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 will finally attempt to execute the transaction that corresponds to the given hash.
In addition to the hash of the transaction you may give it a secondary optional argument, which specifies the options for this specific call. The possible options are:
disableStorage
: {boolean} Setting this to true
will disable storage capture (default = false
).disableMemory
: {boolean} Setting this to true
will disable memory capture (default = false
).disableStack
: {boolean} Setting this to true
will disable stack capture (default = false
).returns comment
Returns a list of addresses owned by client.
Array of 20 Bytes - addresses owned by the client.
Returns the number of the most recent block.
integer of the current block number the client is on.
Executes a new message call immediately without creating a transaction on the block chain.
the return value of executed contract.
Returns the currently configured chain id, a value used in replay-protected transaction signing as introduced by EIP-155.
The chain id as a string.
Returns the client coinbase address.
20 bytes - the current coinbase address.
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.
the amount of gas used.
Returns the current price per gas in wei.
integer of the current gas price in wei.
Returns the balance of the account of given address.
20 Bytes - address to check for balance.
integer block number, or the string "latest", "earliest" or "pending", see the default block parameter
Returns information about a block by block hash.
Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions.
Block
Returns information about a block by block number.
QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in the default block parameter.
Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions.
the block, null
if the block doesn't exist.
Returns the number of transactions in a block from a block matching the given block hash.
DATA, 32 Bytes - hash of a block.
Returns the number of transactions in a block from a block matching the given block number.
Returns code at a given address.
20 Bytes - address
integer block number, or the string "latest", "earliest" or "pending", see the default block parameter
the code from the given address.
Polling method for a filter, which returns an array of logs, block hashes, or transaction hashes, depending on the filter type, which occurred since last poll.
the filter id.
an array of logs, block hashes, or transaction hashes, depending on the filter type, which occurred since last poll.
Returns an array of all logs matching filter with given id.
Array of log objects, or an empty array.
Returns an array of all logs matching a given filter object.
The filter options
Array of log objects, or an empty array.
Returns the value from a storage position at a given address.
integer block number, or the string "latest", "earliest" or "pending", see the default block parameter
Returns information about a transaction by block hash and transaction index position.
DATA, 32 Bytes - hash of a block.
QUANTITY - integer of the transaction index position.
Returns information about a transaction by block number and transaction index position.
QUANTITY|TAG - a block number, or the string "earliest", "latest" or "pending", as in the default block parameter.
QUANTITY - integer of the transaction index position.
Returns the information about a transaction requested by transaction hash.
32 Bytes - hash of a transaction
Returns the number of transactions sent from an address.
integer block number, or the string "latest", "earliest" or "pending", see the default block parameter
integer of the number of transactions sent from this address.
Returns the receipt of a transaction by transaction hash.
Note That the receipt is not available for pending transactions.
32 Bytes - hash of a transaction
Returns the receipt of a transaction by transaction hash.
Returns information about a uncle of a block by hash and uncle index position.
hash of a block
the uncle's index position.
Returns information about a uncle of a block by hash and uncle index position.
a block number, or the string "earliest", "latest" or "pending", as in the default block parameter.
the uncle's index position.
Returns the number of uncles in a block from a block matching the given block hash.
DATA, 32 Bytes - hash of a block.
Returns the number of uncles in a block from a block matching the given block hash.
Returns: An Array with the following elements 1: DATA, 32 Bytes - current block header pow-hash 2: DATA, 32 Bytes - the seed hash used for the DAG. 3: DATA, 32 Bytes - the boundary condition ("target"), 2^256 / difficulty.
A filter id
the hash of the current block, the seedHash, and the boundary condition to be met ("target").
Returns the number of hashes per second that the node is mining with.
number of hashes per second.
Returns true
if client is actively mining new blocks.
returns true
if the client is mining, otherwise false
.
Creates a filter in the node, to notify when a new block arrives. To check
if the state has changed, call eth_getFilterChanges
.
A filter id.
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
.
If the from fromBlock
or toBlock
option are equal to "latest" the
filter continually append logs for whatever block is seen as latest at the
time the block was mined, not just for the block that was "latest" when the
filter was created.
Topics are order-dependent. A transaction with a log with topics [A, B] will be matched by the following topic filters:
[]
“anything”[A]
“A in first position (and anything after)”[null, B]
“anything in first position AND B in second position (and
anything after)”[A, B]
“A in first position AND B in second position (and anything
after)”[[A, B], [A, B]]
“(A OR B) in first position AND (A OR B) in second
position (and anything after)”The filter options
Creates a filter in the node, to notify when new pending transactions
arrive. To check if the state has changed, call eth_getFilterChanges
.
A filter id.
Returns the current ethereum protocol version.
The current ethereum protocol version.
Creates new message call transaction or a contract creation for signed transactions.
The transaction hash
Creates new message call transaction or a contract creation, if the data field contains code.
The transaction hash
The sign method calculates an Ethereum specific signature with:
sign(keccak256("\x19Ethereum Signed Message:\n" + message.length + message)))
.
By adding a prefix to the message makes the calculated signature recognizable as an Ethereum specific signature. This prevents misuse where a malicious DApp can sign arbitrary data (e.g. transaction) and use the signature to impersonate the victim.
Note the address to sign with must be unlocked.
Signature
Address of the account that will sign the messages.
Typed structured data to be signed.
Signature. As in eth_sign
, it is a hex encoded 129 byte array
starting with 0x
. It encodes the r
, s
, and v
parameters from
appendix F of the yellow paper
in big-endian format. Bytes 0...64 contain the r
parameter, bytes
64...128 the s
parameter, and the last byte the v
parameter. Note
that the v
parameter includes the chain id as specified in EIP-155.
Used for submitting mining hashrate.
a hexadecimal string representation (32 bytes) of the hash rate
A random hexadecimal(32 bytes) ID identifying the client
true
if submitting went through successfully and false
otherwise.
Used for submitting a proof-of-work solution
The nonce found (64 bits)
The header's pow-hash (256 bits)
The mix digest (256 bits)
true
if the provided solution is valid, otherwise false
.
Starts a subscription to a particular event. For every event that matches the subscription a JSON-RPC notification with event details and subscription ID will be sent to a client.
A subscription id.
Starts a subscription to a particular event. For every event that matches the subscription a JSON-RPC notification with event details and subscription ID will be sent to a client.
Filter options:
address
: either an address or an array of addresses. Only logs that
are created from these addresses are returnedtopics
, only logs which match the specified topicsA subscription id.
Returns an object with data about the sync status or false.
An object with sync status data or false, when not syncing: startingBlock: {bigint} - The block at which the import started (will only be reset, after the sync reached his head) currentBlock: {bigint} - The current block, same as eth_blockNumber highestBlock: {bigint} - The estimated highest block
Uninstalls a filter with given id. Should always be called when watch is no longer needed.
the filter id.
true
if the filter was successfully uninstalled, otherwise
false
.
Jump forward in time by the given amount of time, in seconds.
Must be greater than or equal to 0
Returns the total time adjustment, in seconds.
Locks any unknown account.
Note: accounts known to the personal
namespace and accounts returned by
eth_accounts
cannot be locked using this method.
address the address of the account to lock
true
if the account was locked successfully, false
if the
account was already locked. Throws an error if the account could not be
locked.
Force a single block to be mined.
Mines a block independent of whether or not mining is started or stopped. Will mine an empty block if there are no available transactions to mine.
the timestamp the block should be mined with.
EXPERIMENTAL: Optionally, specify an options
object with timestamp
and/or blocks
fields. If blocks
is given, it will mine exactly blocks
number of blocks, regardless of any other blocks mined or reverted during it's
operation. This behavior is subject to change!
The string "0x0"
. May return additional meta-data in the future.
Revert the state of the blockchain to a previous snapshot. Takes a single parameter, which is the snapshot id to revert to. This deletes the given snapshot, as well as any snapshots taken after (Ex: reverting to id 0x1 will delete snapshots with ids 0x1, 0x2, etc... If no snapshot id is passed it will revert to the latest snapshot.
the snapshot id to revert
true
if a snapshot was reverted, otherwise false
Sets the given account's nonce to the specified value. Mines a new block before returning.
Warning: this will result in an invalid state tree.
true
if it worked
Sets the internal clock time to the given timestamp.
Warning: This will allow you to move backwards in time, which may cause new blocks to appear to be mined before old blocks. This is will result in an invalid state.
The amount of seconds between the given timestamp and now.
Snapshot the state of the blockchain at the current block. Takes no
parameters. Returns the id of the snapshot that was created. A snapshot can
only be reverted once. After a successful evm_revert
, the same snapshot
id cannot be used again. Consider creating a new snapshot after each
evm_revert
if you need to revert to the same point multiple times.
The hex-encoded identifier for this snapshot
Unlocks any unknown account.
address the address of the account to unlock
(default: disabled) Duration in seconds how long the account should remain unlocked for. Set to 0 to disable automatic locking.
true
if the account was unlocked successfully, false
if the
account was already unlocked. Throws an error if the account could not be
unlocked.
Sets the etherbase, where mining rewards will go.
Set the extraData block header field a miner can include.
Sets the minimal accepted gas price when mining transactions. Any transactions that are below this limit are excluded from the mining process.
Resume the CPU mining process with the given number of threads.
Note: threads
is ignored.
true
Stop the CPU mining operation.
Returns true
if client is actively listening for network connections.
true
when listening, otherwise false
.
Returns number of peers currently connected to the client.
integer of the number of connected peers.
Returns the current network id.
The current network id. This value should NOT be JSON-RPC Quantity/Data encoded.
Imports the given unencrypted private key (hex string) into the key store, encrypting it with the passphrase.
Returns all the Ethereum account addresses of all keys that have been added.
the Ethereum account addresses of all keys that have been added.
Locks the account. The account can no longer be used to send transactions.
Generates a new account with private key. Returns the address of the new account.
The new account's address
Validate the given passphrase and submit transaction.
The transaction is the same argument as for eth_sendTransaction and contains the from address. If the passphrase can be used to decrypt the private key belonging to tx.from the transaction is verified, signed and send onto the network. The account is not unlocked globally in the node and cannot be used in other RPC calls.
Unlocks the account for use.
The unencrypted key will be held in memory until the unlock duration expires. The unlock duration defaults to 300 seconds. An explicit duration of zero seconds unlocks the key until geth exits.
The account can be used with eth_sign and eth_sendTransaction while it is unlocked.
20 Bytes - The address of the account to unlock.
Passphrase to unlock the account.
(default: 300) Duration in seconds how long the account should remain unlocked for. Set to 0 to disable automatic locking.
true if it worked. Throws an error if it did not.
Adds a whisper identity to the group
true if the identity was successfully added to the group, otherwise false.
Polling method for whisper filters. Returns new messages since the last call of this method.
The filter id. Ex: "0x7"
More Info: https://github.com/ethereum/wiki/wiki/JSON-RPC#shh_getfilterchanges
Get all messages matching a filter. Unlike shh_getFilterChanges this returns all messages.
The filter id. Ex: "0x7"
See: shh_getFilterChanges
Checks if the client hold the private keys for a given identity.
The identity address to check.
returns true if the client holds the privatekey for that identity, otherwise false.
Creates filter to notify, when client receives whisper message matching the filter options.
- ^(optional) Identity of the receiver. When present it will try to decrypt any incoming message if the client holds the private key to this identity.
Array of DATA topics which the incoming message's topics should match.
returns true if the identity was successfully added to the group, otherwise false.
Creates a new group.
the address of the new group.
Creates new whisper identity in the client.
result - the address of the new identity.
Creates a whisper message and injects it into the network for distribution.
returns true if the message was sent, otherwise false.
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 shh_getFilterChanges for a period of time.
The filter id. Ex: "0x7"
true if the filter was successfully uninstalled, otherwise false.
Returns the current whisper protocol version.
The current whisper protocol version
Returns the current client version.
The current client version.
Returns Keccak-256 (not the standardized SHA3-256) of the given data.
The SHA3 result of the given string.
Generated using TypeDoc
This is the Ethereum API that the provider interacts with. The only methods permitted on the prototype are the supported json-rpc methods.