예제 #1
0
        public async Task <ActionResult <string> > Get(string module, string action, string address, string tag, string startblock, string endblock, string sort, string to, string value, string gasPrice, string gas, string apikey)
        {
            ActionResult <string> rtn = Json("");

            if (!apikey.Equals("geminis"))
            {
                return(rtn = Json("error"));
            }

            switch ($"{module}:{action}")
            {
            case "account:txlistinternal":
                rtn = GetTxListInternal(address, startblock, endblock, sort);
                break;

            case "account:txlist":
                rtn = GetTxList(address, startblock, endblock, sort);
                break;

            case "account:balance":
                rtn = await _aBiz.GetBalanceAsync(address, "latest");

                break;

            case "account:balancemulti":
                rtn = await _aBiz.GetBalanceMultiAsync(address, tag);

                break;

            case "stats:ethprice":
                rtn = GetEthPrice();
                break;

            case "proxy:eth_gasPrice":
                rtn = await _pBiz.GetGasPriceAsync();

                break;

            case "proxy:eth_estimateGas":
                rtn = await _pBiz.GetEstimateGasAsync(to, gas, gasPrice, value);

                break;

            case "proxy:eth_getTransactionCount":
                rtn = await _pBiz.GetTransactionCountAsync(address, tag);

                break;

            default:
                break;
            }

            return(rtn);
        }
예제 #2
0
        public async Task <ActionResult <IEnumerable <string> > > Get()
        {
            var str = await _esnBiz.GetBalanceAsync("0x8567bfdd8a06134d798f053f914598087ed57b76", "latest");

            return(new string[] { "BlockHeight", str.ToString() });
        }