public NeoApiContractService(IClient client) : base(client)
 {
     GetContractState = new NeoGetContractState(client);
     InvokeContract   = new NeoInvokeContract(client);
     InvokeFunction   = new NeoInvokeFunction(client);
     InvokeScript     = new NeoInvokeScript(client);
 }
        public override async Task <Invoke> ExecuteAsync(IClient client)
        {
            var invokeFunction = new NeoInvokeFunction(client);
            var parametersList = new List <InvokeParameter>
            {
                new InvokeParameter
                {
                    Type  = "Hash160",
                    Value = "bfc469dd56932409677278f6b7422f3e1f34481d"
                }
            };

            return(await invokeFunction.SendRequestAsync("ecc6b20d3ccac1ee9ef109af5a7cdb85706b1df9", "balanceOf", parametersList));
        }
        public virtual async Task <double> EstimateGasAsync(string scriptHash, string operation,
                                                            List <InvokeParameter> parameterList)
        {
            if (Client == null)
            {
                throw new NullReferenceException("Client not configured");
            }
            if (scriptHash == null)
            {
                throw new ArgumentNullException(nameof(scriptHash));
            }
            var neoEstimateGas = new NeoInvokeFunction(Client);
            var invokeResult   = await neoEstimateGas.SendRequestAsync(scriptHash, operation, parameterList);

            return(double.Parse(invokeResult.GasConsumed, CultureInfo.InvariantCulture));
        }