Exemplo n.º 1
0
 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);
        }
Exemplo n.º 3
0
 public Task <RpcResult <byte[]> > eth_getCode(Address address, BlockParameterModel blockParameter = null)
 => _proxy.SendAsync <byte[]>(nameof(eth_getCode), address, MapBlockParameter(blockParameter));
Exemplo n.º 4
0
 public Task <RpcResult <byte[]> > eth_call(CallTransactionModel transaction,
                                            BlockParameterModel blockParameter = null)
 => _proxy.SendAsync <byte[]>(nameof(eth_call), transaction, MapBlockParameter(blockParameter));
Exemplo n.º 5
0
 public Task <RpcResult <UInt256?> > eth_getTransactionCount(Address address, BlockParameterModel blockParameter = null)
 => _proxy.SendAsync <UInt256?>(nameof(eth_getTransactionCount), address, MapBlockParameter(blockParameter));
Exemplo n.º 6
0
 public Task <RpcResult <UInt256?> > eth_getBalance(Address address, BlockParameterModel blockParameter = null)
 => _proxy.SendAsync <UInt256?>(nameof(eth_getBalance), address, MapBlockParameter(blockParameter));
Exemplo n.º 7
0
        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);
        }