public NeoApiContractService(IClient client) : base(client) { GetContractState = new NeoGetContractState(client); InvokeContract = new NeoInvokeContract(client); InvokeFunction = new NeoInvokeFunction(client); InvokeScript = new NeoInvokeScript(client); }
public virtual async Task <double> EstimateGasAsync(string serializedScriptHash) { if (Client == null) { throw new NullReferenceException("Client not configured"); } if (serializedScriptHash == null) { throw new ArgumentNullException(nameof(serializedScriptHash)); } var neoEstimateGas = new NeoInvokeScript(Client); var invokeResult = await neoEstimateGas.SendRequestAsync(serializedScriptHash); return(double.Parse(invokeResult.GasConsumed, CultureInfo.InvariantCulture)); }
public override async Task <Invoke> ExecuteAsync(IClient client) { var invokeScript = new NeoInvokeScript(client); return(await invokeScript.SendRequestAsync(Settings.GetContractHash())); }