public Task <RpcResult <BlockModel> > eth_getBlockByNumber(BlockParameterModel blockParameter, bool returnFullTransactionObjects = false) => _proxy.SendAsync <BlockModel>(nameof(eth_getBlockByNumber), MapBlockParameter(blockParameter), returnFullTransactionObjects);
public async Task <Block?> FindBlockAsync(long blockNumber) { var result = await _proxy.eth_getBlockByNumber(BlockParameterModel.FromNumber(blockNumber)); return(result?.IsValid == true?result.Result?.ToBlock() : null); }
public Task <RpcResult <byte[]> > eth_getCode(Address address, BlockParameterModel blockParameter = null) => _proxy.SendAsync <byte[]>(nameof(eth_getCode), address, MapBlockParameter(blockParameter));
public Task <RpcResult <byte[]> > eth_call(CallTransactionModel transaction, BlockParameterModel blockParameter = null) => _proxy.SendAsync <byte[]>(nameof(eth_call), transaction, MapBlockParameter(blockParameter));
public Task <RpcResult <UInt256?> > eth_getTransactionCount(Address address, BlockParameterModel blockParameter = null) => _proxy.SendAsync <UInt256?>(nameof(eth_getTransactionCount), address, MapBlockParameter(blockParameter));
public Task <RpcResult <UInt256?> > eth_getBalance(Address address, BlockParameterModel blockParameter = null) => _proxy.SendAsync <UInt256?>(nameof(eth_getBalance), address, MapBlockParameter(blockParameter));
private async Task GetEstimateGasAsync() { _estimateGasLabel = new Label(PositionX, 21, "eth_estimateGas: fetching..."); _window.Add(_estimateGasLabel); var gasLimit = await Extensions.TryExecuteAsync(() => _ethJsonRpcClientProxy.eth_estimateGas(_transaction, BlockParameterModel.FromNumber(_latestBlock.Number))); SetEstimateGas(gasLimit); _window.Remove(_estimateGasLabel); _estimateGasLabel = new Label(PositionX, 21, $"Gas limit: {_estimateGas}"); _window.Add(_estimateGasLabel); }