EthereumApiEth class

This class implements the Ethereuum eth API, sometimes referred to as DApp

Inheritance

Constructors

EthereumApiEth(Ethereum client)
Construction

Properties

hashCode int
The hash code for this object.
no setterinherited
id int
Message Id
no setterinherited
lastError EthereumError
Last error
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

accounts() Future<List<EthereumAddress>?>
Accounts, a list of addresses owned by client.
blockNumber() Future<int?>
Block number, the number of most recent block.
call(EthereumAddress? address, EthereumDefaultBlock? block, {EthereumAddress? from, int? gas, int? gasPrice, int? value, EthereumData? data}) Future<EthereumData?>
Call Executes a new message call immediately without creating a transaction on the block chain. address: The address the transaction is sent to. from: (optional) The address the transaction is sent from. gas: (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions. gasPrice: (optional) Integer of the gasPrice used for each paid gas value: (optional) Integer of the value send with this transaction data: (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI block: default block parameter Returns the return value of executed contract.
clientVersion() Future<String?>
/ Client version
coinbaseAddress() Future<BigInt?>
The client coinbase address.
estimateGas({EthereumAddress? address, EthereumAddress? from, int? gas, int? gasPrice, int? value, EthereumData? data}) Future<int?>
Estimate gas Makes a call or transaction, which won't be added to the blockchain and returns the used gas, which can be used for estimating the used gas. See eth_call parameters, expect that all properties are optional. If no gas limit is specified geth uses the block gas limit from the pending block as an upper bound. As a result the returned estimate might not be enough to executed the call/transaction when the amount of gas is higher than the pending block gas limit. Returns the amount of gas used.
gasPrice() Future<int?>
The current price per gas in wei.
getBalance(EthereumAddress? address, EthereumDefaultBlock? block) Future<BigInt?>
Get balance, the balance of the account of the given address.
getBlockByHash(EthereumData? blockHash, {bool full = true}) Future<EthereumBlock?>
Get block by hash Returns information about a block by hash Hash of a block and a boolean, if true it returns the full transaction objects, if false only the hashes of the transactions, defaults to true. Returns A block object, or null when no block was found :
getBlockByNumber(EthereumDefaultBlock? blockNumber, {bool full = true}) Future<EthereumBlock?>
Get block by number Returns information about a block by block number. blockNumber - defualt block parameter as in the default block parameter. A boolean, if true it returns the full transaction objects, if false only the hashes of the transactions, defaults to true. Returns See getBlockByHash
getBlockTransactionCountByHash(EthereumData? blockHash) Future<int?>
Block Transaction Count By Hash The number of transactions in a block from a block matching the given block hash. If the method returns null a count of 0 is returned, this is to distinguish between this and an error.
getBlockTransactionCountByNumber(EthereumDefaultBlock? blockNumber) Future<int?>
Block Transaction Count By Number The number of transactions in a block matching the given block number. If the method returns null a count of 0 is returned, this is to distinguish between this and an error.
getCode(EthereumAddress? address, EthereumDefaultBlock? block) Future<int?>
Get code, the code at the given address.
getFilterChanges(int? filterId) Future<EthereumFilter?>
Get filter changes Polling method for a filter, which returns an list of logs which occurred since last poll. Filter Id Returns an EthereumFilter object or null
getFilterLogs(int? filterId) Future<EthereumFilter?>
Get filter logs Filter Id Returns see getFilterChanges
getLogs({required EthereumDefaultBlock fromBlock, required EthereumDefaultBlock toBlock, dynamic address, List<EthereumData>? topics}) Future<List<EthereumLog>?>
Get logs Returns an array of all logs matching a given filter object. The filter definition, see newFilter parameters.
getStorageAt(EthereumAddress? address, int? pos, EthereumDefaultBlock? block) Future<EthereumData?>
Get Storage at, the value from a storage position at a given address. Parameters are the address of the storage, the integer position of the storage and the default block parameter.
getTransactionByBlockHashAndIndex(EthereumData? blockHash, int? index) Future<EthereumTransaction?>
Get transaction by block hash and index. Returns information about a transaction by block hash and transaction index position. Hash of a block and integer of the transaction index position. Returns see getTransactionByHash.
getTransactionByBlockNumberAndIndex(EthereumDefaultBlock? blockNumber, int? index) Future<EthereumTransaction?>
Get transaction by block number and index. Returns information about a transaction by block number and transaction index position. A block number as in the default block parameter. Returns see getTransactionByHash.
getTransactionByHash(EthereumData? hash) Future<EthereumTransaction?>
Get transaction by hash Returns the information about a transaction requested by transaction hash. Hash of a transaction Returns a transaction object, or null when no transaction was found:
getTransactionCount(EthereumAddress? address, EthereumDefaultBlock? block) Future<int?>
Transaction count, returns the number of transactions sent from an address.
getTransactionReceipt(EthereumData? transactionHash) Future<EthereumTransactionReceipt?>
Get transaction receipt Returns the receipt of a transaction by transaction hash. Note That the receipt is not available for pending transactions. Hash of a transaction Returns a transaction receipt object, or null when no receipt was found:
getUncleByBlockHashAndIndex(EthereumData? blockHash, int? index) Future<EthereumBlock?>
Get uncle by block hash and index. Returns information about an uncle by block hash and uncle index position. Note: An uncle doesn't contain individual transactions. Hash of a block and integer of the uncle index position. Returns see getBlockByHash.
getUncleByBlockNumberAndIndex(EthereumDefaultBlock? blockNumber, int? index) Future<EthereumBlock?>
Get uncle by block number and index. Returns information about an uncle by block number and uncle index position. Note: An uncle doesn't contain individual transactions. A block number as in the default block parameter. Returns see getBlockByHash.
getUncleCountByHash(EthereumData? blockHash) Future<int?>
Block Uncle Count By Hash The number of uncles in a block from a block matching the given block hash. If the method returns null a count of 0 is returned, this is to distinguish between this and an error.
getUncleCountByNumber(EthereumDefaultBlock? blockNumber) Future<int?>
Block Uncle Count By Number The number of uncles in a block matching the given block number. If the method returns null a count of 0 is returned, this is to distinguish between this and an error.
getWork() Future<EthereumWork?>
Get work Returns the hash of the current block, the seedHash, and the boundary condition to be met ('target'). Returns an EthereumWork object or null
hashrate() Future<int?>
Hashrate, returns the number of hashes per second that the node is mining with.
mining() Future<bool?>
Mining, true when mining
netListening() Future<bool?>
Net listening, true when listening
netPeerCount() Future<int?>
Net peer count,
netVersion() Future<String?>
Net version
newBlockFilter() Future<int?>
New block filter Creates a filter in the node, to notify when a new block arrives. To check if the state has changed, call getFilterChanges. Returns a filter id.
newFilter({required EthereumDefaultBlock fromBlock, required EthereumDefaultBlock toBlock, dynamic address, List<EthereumData>? topics}) Future<int?>
New filter Creates a filter object, based on filter options, to notify when the state changes (logs). To check if the state has changed, call getFilterChanges. note on specifying topic filters: 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)' fromBlock: - (optional, default: 'latest') Integer block number, or 'latest' for the last mined block or 'pending', 'earliest' for not yet mined transactions. toBlock: - (optional, default: 'latest') Integer block number, or 'latest' for the last mined block or 'pending', 'earliest' for not yet mined transactions. address: - (optional) Contract address or a list of addresses from which logs should originate. topics: - (optional) topics. Topics are order-dependent. Note: the user must build this structure using the utilities in the EthereumUtilities class. See the Ethereum Wiki RPC page for examples. Returns a filter id.
newPendingTransactionFilter() Future<int?>
New pending transaction filter Creates a filter in the node, to notify when a new pending transaction arrives. To check if the state has changed, call getFilterChanges. Returns a filter id.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
protocolVersion() Future<String?>
Protocol version
sendRawTransaction(EthereumData? signedTransaction) Future<EthereumData?>
Send raw transaction Creates new message call transaction or a contract creation for signed transactions. Takes the signed transaction data. Returns the transaction hash, or the zero hash if the transaction is not yet available.
sendTransaction(EthereumAddress? address, EthereumData? data, {EthereumAddress? to, int gas = 9000, int? gasPrice, int? value, int? nonce}) Future<EthereumData?>
Send transaction Creates new message call transaction or a contract creation, if the data field contains code. address: The address the transaction is sent from. to: (optional when creating new contract) The address the transaction is directed to. gas: (optional, default: 90000) Integer of the gas provided for the transaction execution. It will return unused gas. gasPrice: (optional, default: To-Be-Determined) Integer of the gasPrice used for each paid gas value: (optional) Integer of the value send with this transaction data: The compiled code of a contract OR the hash of the invoked method signature and encoded parameters. For details see Ethereum Contract ABI nonce: (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce. Returns the transaction hash, or the zero hash if the transaction is not yet available.
sha3(EthereumData? data) Future<BigInt?>
Returns Keccak-256 (not the standardized SHA3-256) of the given data.
shhPost(List<EthereumData>? topics, EthereumData? payload, int? priority, int? ttl, {required EthereumAddress to, required EthereumAddress from}) Future<bool?>
SHH post Sends a whisper message from: - (optional) The identity of the sender. to: - (optional) The identity of the receiver. When present whisper will encrypt the message so that only the receiver can decrypt it. topics: - List of topics, for the receiver to identify messages. payload: - The payload of the message. priority: - The integer of the priority in a range from ... (?). ttl: - integer of the time to live in seconds. Returns true if the message was send, otherwise false.
shhVersion() Future<String?>
SHH version Returns the current whisper protocol version.
sign(EthereumAddress? account, EthereumData? message) Future<EthereumData?>
Sign The sign method calculates an Ethereum specific signature with: sign(keccak256('\x19Ethereum Signed Message:\n' + len(message) + message))). Note the address to sign with must be unlocked.
submitHashrate(EthereumData? hashRate, String? id) Future<bool?>
Submit hash rate Used for submitting mining hashrate. Hash rate Id, a random hexadecimal(32 bytes) string identifying the client Returns true if submitting went through successfully and false otherwise.
submitWork(EthereumData? nonce, EthereumData? powHash, EthereumData? digest) Future<bool?>
Submit work Used for submitting a proof-of-work solution. The nonce found The header's pow-hash The mix digest Returns true if the provided solution is valid, otherwise false.
syncStatus() Future<EthereumSyncStatus?>
Sync status, an object with data about the sync status if syncing or false if not.
toString() String
A string representation of this object.
inherited
uninstallFilter(int? filterId) Future<bool?>
Uninstall filter 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 getFilterChanges for a period of time. Filter id Returns true if the filter was successfully uninstalled, otherwise false.

Operators

operator ==(Object other) bool
The equality operator.
inherited