Esempio n. 1
0
        //查询余额
        async Task test_BalanceOf()
        {
            Console.WriteLine("Input target address (" + this.address + "):");
            string addr;

            try
            {
                addr = Console.ReadLine();
                if (addr == "\n")
                {
                    addr = this.address;
                }
            }
            catch (Exception e)
            {
                addr = this.address;
            }

            byte[] hash = ThinNeo.Helper.GetPublicKeyHashFromAddress(addr);

            var result = await pneo_common.api_InvokeScript(pneo_common.sc_pneo, "balanceOf", "(addr)" + addr);

            pneo_common.ResultItem item = result.value;

            Console.WriteLine(item.subItem[0].AsInteger());
        }
Esempio n. 2
0
        async Task test_totalDestory()
        {
            var result = await pneo_common.api_InvokeScript(sneo_common.sc_sneo, "totalDestory", null);

            pneo_common.ResultItem item = result.value;

            Console.WriteLine(item.subItem[0].AsInteger());
        }
Esempio n. 3
0
        //查询最小单位
        async Task test_decimals()
        {
            var result = await pneo_common.api_InvokeScript(pneo_common.sc_pneo, "decimals", null);

            pneo_common.ResultItem item = result.value;

            Console.WriteLine(item.subItem[0].AsInteger());
        }
Esempio n. 4
0
        //查询标志
        async Task test_symbol()
        {
            var result = await pneo_common.api_InvokeScript(pneo_common.sc_pneo, "symbol", null);

            pneo_common.ResultItem item = result.value;

            Console.WriteLine(item.subItem[0].AsString());
        }
Esempio n. 5
0
        async Task test_getTXInfo()
        {
            Console.WriteLine("Input txid:");
            string txid   = Console.ReadLine();
            var    result = await pneo_common.api_InvokeScript(pneo_common.sc_pneo, "getTXInfo", "(hex256)" + txid);

            pneo_common.ResultItem   item  = result.value;
            pneo_common.ResultItem[] items = item.subItem[0].subItem;

            //查询交易详细信息
            Console.WriteLine("from:" + ThinNeo.Helper.GetAddressFromScriptHash(items[0].AsHash160()));
            Console.WriteLine("to:" + ThinNeo.Helper.GetAddressFromScriptHash(items[1].AsHash160()));
            Console.WriteLine("value:" + items[2].AsInteger());
        }