private Function <TContractMessage> GetFunction(string contractAddress) { var contract = Eth.GetContract <TContractMessage>(contractAddress); var function = contract.GetFunction <TContractMessage>(); return(function); }
public Task <HexBigInteger> EstimateGasAsync(TContractMessage functionMessage, string contractAddress) { ValidateContractMessage(functionMessage); var contract = Eth.GetContract <TContractMessage>(contractAddress); var function = contract.GetFunction <TContractMessage>(); return(EstimateGasAsync(functionMessage, function)); }
public async Task <string> SendRequestAsync(TContractMessage functionMessage, string contractAddress) { ValidateContractMessage(functionMessage); var contract = Eth.GetContract <TContractMessage>(contractAddress); var function = contract.GetFunction <TContractMessage>(); var gasEstimate = await GetOrEstimateMaximumGas(functionMessage, function).ConfigureAwait(false); return(await ExecuteTransactionAsync(functionMessage, gasEstimate, function).ConfigureAwait(false)); }
public async Task <TransactionReceipt> SendRequestAndWaitForReceiptAsync(TContractMessage functionMessage, string contractAddress, CancellationTokenSource tokenSource = null) { ValidateContractMessage(functionMessage); var contract = Eth.GetContract <TContractMessage>(contractAddress); var function = contract.GetFunction <TContractMessage>(); var gasEstimate = await GetOrEstimateMaximumGas(functionMessage, function).ConfigureAwait(false); return(await ExecuteTransactionAsync(functionMessage, gasEstimate, function, tokenSource)); }
public async Task <TFunctionOutput> QueryAsync <TFunctionOutput>(TContractMessage contractFunctionMessage, string contractAddress, BlockParameter block = null) { var contract = Eth.GetContract <TContractMessage>(contractAddress); var function = contract.GetFunction <TContractMessage>(); ValidateContractMessage(contractFunctionMessage); return(await function.CallAsync <TFunctionOutput>(contractFunctionMessage, contractFunctionMessage.FromAddress, GetMaximumGas(contractFunctionMessage), GetValue(contractFunctionMessage), block).ConfigureAwait(false)); }
public async Task <TFunctionOutput> QueryDeserializingToObjectAsync <TFunctionOutput>( TContractMessage contractFunctionMessage, string contractAddress, BlockParameter block = null) where TFunctionOutput : new() { var contract = Eth.GetContract <TContractMessage>(contractAddress); var function = contract.GetFunction <TContractMessage>(); ValidateContractMessage(contractFunctionMessage); return(await function.CallDeserializingToObjectAsync <TFunctionOutput>(contractFunctionMessage, GetDefaultAddressFrom(contractFunctionMessage), GetMaximumGas(contractFunctionMessage), GetValue(contractFunctionMessage), block).ConfigureAwait(false)); }
public async Task <byte[]> QueryRawAsync(TContractMessage contractFunctionMessage, string contractAddress, BlockParameter block = null) { var contract = Eth.GetContract <TContractMessage>(contractAddress); var function = contract.GetFunction <TContractMessage>(); ValidateContractMessage(contractFunctionMessage); return(await function.CallRawAsync(contractFunctionMessage, GetDefaultAddressFrom(contractFunctionMessage), GetMaximumGas(contractFunctionMessage), GetValue(contractFunctionMessage), block).ConfigureAwait(false)); }
public async Task <TransactionInput> CreateTransactionInputAsync(TContractMessage functionMessage, string contractAddress) { ValidateContractMessage(functionMessage); var contract = Eth.GetContract <TContractMessage>(contractAddress); var function = contract.GetFunction <TContractMessage>(); var gasEstimate = await GetOrEstimateMaximumGas(functionMessage, function).ConfigureAwait(false); return(function.CreateTransactionInput( functionMessage, GetDefaultAddressFrom(functionMessage), gasEstimate, GetGasPrice(functionMessage), GetValue(functionMessage))); }