using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Nethereum.ABI.FunctionEncoding; using Nethereum.Hex.HexTypes; using Nethereum.RPC.Eth.DTOs; namespace Nethereum.Contracts { public class Function : FunctionBase { public Function(Contract contract, FunctionBuilder functionBuilder) : base(contract, functionBuilder) { } protected FunctionBuilder FunctionBuilder => (FunctionBuilder) FunctionBuilderBase; public CallInput CreateCallInput(params object[] functionInput) { return FunctionBuilder.CreateCallInput(functionInput); } public CallInput CreateCallInput(string from, HexBigInteger gas, HexBigInteger value, params object[] functionInput) { return FunctionBuilder.CreateCallInput(from, gas, value, functionInput); } public string GetData(params object[] functionInput) { return FunctionBuilder.GetData(functionInput); } public TransactionInput CreateTransactionInput(string from, params object[] functionInput) { return FunctionBuilder.CreateTransactionInput(from, functionInput); } public TransactionInput CreateTransactionInput(string from, HexBigInteger gas, HexBigInteger value, params object[] functionInput) { return FunctionBuilder.CreateTransactionInput(from, gas, value, functionInput); } public TransactionInput CreateTransactionInput(string from, HexBigInteger gas, HexBigInteger gasPrice, HexBigInteger value, params object[] functionInput) { return FunctionBuilder.CreateTransactionInput(from, gas, gasPrice, value, functionInput); } public TransactionInput CreateTransactionInput(TransactionInput input, params object[] functionInput) { return FunctionBuilder.CreateTransactionInput(input, functionInput); } public TransactionInput CreateTransactionInput(HexBigInteger type, string from, HexBigInteger gas, HexBigInteger value, HexBigInteger maxFeePerGas, HexBigInteger maxPriorityFeePerGas, params object[] functionInput) { return FunctionBuilder.CreateTransactionInput(type, from, gas, value, maxFeePerGas, maxPriorityFeePerGas, functionInput); } public TransactionInput CreateTransactionInput(string from, HexBigInteger gas, HexBigInteger value, HexBigInteger maxFeePerGas, HexBigInteger maxPriorityFeePerGas, params object[] functionInput) { return FunctionBuilder.CreateTransactionInput(from, gas, value, maxFeePerGas, maxPriorityFeePerGas, functionInput); } #if !DOTNET35 public Task> CallDecodingToDefaultAsync(params object[] functionInput) { return base.CallDecodingToDefaultAsync(CreateCallInput(functionInput)); } public Task> CallDecodingToDefaultAsync(string from, HexBigInteger gas, HexBigInteger value, params object[] functionInput) { return base.CallDecodingToDefaultAsync(CreateCallInput(from, gas, value, functionInput)); } public Task> CallDecodingToDefaultAsync(string from, HexBigInteger gas, HexBigInteger value, BlockParameter block, params object[] functionInput) { return base.CallDecodingToDefaultAsync(CreateCallInput(from, gas, value, functionInput), block); } public Task> CallDecodingToDefaultAsync(BlockParameter block, params object[] functionInput) { return base.CallDecodingToDefaultAsync(CreateCallInput(functionInput), block); } public Task CallAsync(params object[] functionInput) { return base.CallAsync(CreateCallInput(functionInput)); } public Task CallAsync(string from, HexBigInteger gas, HexBigInteger value, params object[] functionInput) { return base.CallAsync(CreateCallInput(from, gas, value, functionInput)); } public Task CallAsync(string from, HexBigInteger gas, HexBigInteger value, BlockParameter block, params object[] functionInput) { return base.CallAsync(CreateCallInput(from, gas, value, functionInput), block); } public Task CallAsync(BlockParameter block, params object[] functionInput) { return base.CallAsync(CreateCallInput(functionInput), block); } public Task CallDeserializingToObjectAsync(params object[] functionInput) where TReturn : new() { return base.CallAsync(new TReturn(), CreateCallInput(functionInput)); } public Task CallDeserializingToObjectAsync(string from, HexBigInteger gas, HexBigInteger value, params object[] functionInput) where TReturn : new() { return base.CallAsync(new TReturn(), CreateCallInput(from, gas, value, functionInput)); } public Task CallDeserializingToObjectAsync(string from, HexBigInteger gas, HexBigInteger value, BlockParameter block, params object[] functionInput) where TReturn : new() { return base.CallAsync(new TReturn(), CreateCallInput(from, gas, value, functionInput), block); } public Task CallDeserializingToObjectAsync( BlockParameter blockParameter, params object[] functionInput) where TReturn : new() { return base.CallAsync(new TReturn(), CreateCallInput(functionInput), blockParameter); } public Task EstimateGasAsync(params object[] functionInput) { return EstimateGasFromEncAsync(CreateCallInput(functionInput)); } public Task EstimateGasAsync(string from, HexBigInteger gas, HexBigInteger value, params object[] functionInput) { return EstimateGasFromEncAsync(CreateCallInput(from, gas, value, functionInput)); } public Task SendTransactionAsync(string from, params object[] functionInput) { return base.SendTransactionAsync(CreateTransactionInput(from, functionInput)); } public Task SendTransactionAsync(string from, HexBigInteger gas, HexBigInteger value, params object[] functionInput) { return base.SendTransactionAsync(CreateTransactionInput(from, gas, value, functionInput)); } public Task SendTransactionAsync(HexBigInteger type, string from, HexBigInteger gas, HexBigInteger value, HexBigInteger maxFeePerGas, HexBigInteger maxPriorityFeePerGas, params object[] functionInput) { return base.SendTransactionAsync(CreateTransactionInput(type, from, gas, value, maxFeePerGas, maxPriorityFeePerGas, functionInput)); } public Task SendTransactionAsync(string from, HexBigInteger gas, HexBigInteger value, HexBigInteger maxFeePerGas, HexBigInteger maxPriorityFeePerGas, params object[] functionInput) { return base.SendTransactionAsync(CreateTransactionInput(from, gas, value, maxFeePerGas, maxPriorityFeePerGas, functionInput)); } public Task SendTransactionAsync(string from, HexBigInteger gas, HexBigInteger gasPrice, HexBigInteger value, params object[] functionInput) { return base.SendTransactionAsync(CreateTransactionInput(from, gas, gasPrice, value, functionInput)); } public Task SendTransactionAsync(TransactionInput input, params object[] functionInput) { return base.SendTransactionAsync(CreateTransactionInput(input, functionInput)); } public Task SendTransactionAndWaitForReceiptAsync(string from, CancellationTokenSource receiptRequestCancellationToken = null, params object[] functionInput) { return base.SendTransactionAndWaitForReceiptAsync(CreateTransactionInput(from, functionInput), receiptRequestCancellationToken); } public Task SendTransactionAndWaitForReceiptAsync(string from, HexBigInteger gas, HexBigInteger value, CancellationTokenSource receiptRequestCancellationToken = null, params object[] functionInput) { return base.SendTransactionAndWaitForReceiptAsync(CreateTransactionInput(from, gas, value, functionInput), receiptRequestCancellationToken); } public Task SendTransactionAndWaitForReceiptAsync(string from, HexBigInteger gas, HexBigInteger gasPrice, HexBigInteger value, CancellationTokenSource receiptRequestCancellationToken = null, params object[] functionInput) { return base.SendTransactionAndWaitForReceiptAsync( CreateTransactionInput(from, gas, gasPrice, value, functionInput), receiptRequestCancellationToken); } public Task SendTransactionAndWaitForReceiptAsync(TransactionInput input, CancellationTokenSource receiptRequestCancellationToken = null, params object[] functionInput) { return base.SendTransactionAndWaitForReceiptAsync(CreateTransactionInput(input, functionInput), receiptRequestCancellationToken); } public Task SendTransactionAndWaitForReceiptAsync(HexBigInteger type, string from, HexBigInteger gas, HexBigInteger value, HexBigInteger maxFeePerGas, HexBigInteger maxPriorityFeePerGas, params object[] functionInput) { return base.SendTransactionAndWaitForReceiptAsync(CreateTransactionInput(type, from, gas, value, maxFeePerGas, maxPriorityFeePerGas, functionInput)); } public Task SendTransactionAndWaitForReceiptAsync(string from, HexBigInteger gas, HexBigInteger value, HexBigInteger maxFeePerGas, HexBigInteger maxPriorityFeePerGas, params object[] functionInput) { return base.SendTransactionAndWaitForReceiptAsync(CreateTransactionInput(from, gas, value, maxFeePerGas, maxPriorityFeePerGas, functionInput)); } #endif } }