public async Task eth_getBalance_should_invoke_client_method() { var address = TestItem.AddressA; await _proxy.eth_getBalance(address); await _client.Received().SendAsync <UInt256?>(nameof(_proxy.eth_getBalance), address, null); }
private async Task <decimal?> GetBalanceAsync() { var result = await _ethJsonRpcClientProxy.eth_getBalance(_address); if (!result.IsValid || !result.Result.HasValue) { return(null); } return(decimal.Parse(result.Result.ToString()).WeiToEth()); }
private async Task UpdateBalanceAsync() { if (_balanceLabel is null) { return; } var balanceResult = await _ethJsonRpcClientProxy.eth_getBalance(_address); _balanceEth = WeiToEth(decimal.Parse(balanceResult.Result.ToString())); _transferWindow.Remove(_balanceLabel); _balanceLabel = new Label(65, 1, $"Balance: {_balanceEth} ETH"); _transferWindow.Add(_balanceLabel); }
public async Task <ResultWrapper <UInt256?> > eth_getBalance(Address address, BlockParameter blockParameter) => ResultWrapper <UInt256?> .From(await _proxy.eth_getBalance(address, MapBlockParameter(blockParameter)));