Table of Contents

Class EvmJsonRpcClient

Namespace
NArk.ArkadeIntents.Evm
Assembly
NArk.ArkadeIntents.dll

Production HTTP JSON-RPC implementation of the EVM read and receipt seam.

public sealed class EvmJsonRpcClient : IEvmSwapRpc
Inheritance
EvmJsonRpcClient
Implements
Inherited Members

Constructors

EvmJsonRpcClient(HttpClient, Uri?, EvmJsonRpcOptions?, TimeProvider?)

Creates a client over an externally managed HTTP connection pool.

public EvmJsonRpcClient(HttpClient http, Uri? endpoint = null, EvmJsonRpcOptions? options = null, TimeProvider? timeProvider = null)

Parameters

http HttpClient

Externally managed HTTP client.

endpoint Uri

Absolute HTTP endpoint, or the client's base address when omitted.

options EvmJsonRpcOptions

Receipt and untrusted-response limits.

timeProvider TimeProvider

Clock used for receipt polling.

Methods

CallAsync(string, byte[], BigInteger?, CancellationToken)

Executes an eth_call, optionally at a historical height.

public Task<byte[]> CallAsync(string to, byte[] data, BigInteger? blockNumber = null, CancellationToken cancellationToken = default)

Parameters

to string
data byte[]
blockNumber BigInteger?
cancellationToken CancellationToken

Returns

Task<byte[]>

GetBlockNumberAsync(CancellationToken)

Reads the current block height.

public Task<BigInteger> GetBlockNumberAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<BigInteger>

GetBlockTimestampAsync(BigInteger, CancellationToken)

Reads one block's unix timestamp.

public Task<long> GetBlockTimestampAsync(BigInteger blockNumber, CancellationToken cancellationToken = default)

Parameters

blockNumber BigInteger
cancellationToken CancellationToken

Returns

Task<long>

GetChainIdAsync(CancellationToken)

Reads the connected chain identifier.

public Task<BigInteger> GetChainIdAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<BigInteger>

WaitForReceiptAsync(string, CancellationToken)

Waits for a transaction receipt.

public Task<EvmTransactionReceipt> WaitForReceiptAsync(string transactionHash, CancellationToken cancellationToken = default)

Parameters

transactionHash string
cancellationToken CancellationToken

Returns

Task<EvmTransactionReceipt>