Client

Client

  • Interact with ETH node as accurate, durable and stable as possible.
  • Work with more than an ETH node, do load balancing and healthcheck.
  • WARN: It does not work with endpoints that does load balancing to other nodes.

Constructor

new Client(config)

Source:
Parameters:
Name Type Description
config ClientConfig

Members

blockNumber

Source:

Safe block number latest - reorganisationBlocks, where latest is newest block number from nodes.

Methods

(async) getBlockByNumber(blockNumber, includeTransactionopt) → {Promise.<Block>}

Source:
Parameters:
Name Type Attributes Default Description
blockNumber UnsignedInteger
includeTransaction boolean <optional>
false
Returns:
Type
Promise.<Block>

(async) getLogs(filter) → {Promise.<Array.<Log>>}

Source:

Retrieve log records. It is equivalent to RPC eth_getLogs.

Parameters:
Name Type Description
filter LogFilter

Matching conditions.

Throws:
  • Call to unsafe block.
Type
DiaryError
Returns:
Type
Promise.<Array.<Log>>

(async) getTransaction(txHash) → {Transaction|undefined}

Source:

Retrieve a transaction by it's hash. It is equivalent to RPC eth_getTransactionByHash.

Parameters:
Name Type Description
txHash TransactionHashHeximal
Throws:
ClientError
Returns:
Type
Transaction | undefined