예제 #1
0
        async Task test_getSAR4B()
        {
            Console.WriteLine("Input target addr:");
            string addr = Console.ReadLine();

            var result = await business_common.api_InvokeScript(business_common.sc_wneo, "getSAR4B", "(addr)" + addr);

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

            if (items != null)
            {
                Console.WriteLine("name:" + items[0].AsString());
                Console.WriteLine("symbol:" + items[1].AsString());
                Console.WriteLine("decimals:" + items[2].AsInteger());
                Console.WriteLine("owner:" + ThinNeo.Helper.GetAddressFromScriptHash(items[3].AsHash160()));
                Console.WriteLine("txid:" + items[4].AsHashString());
                Console.WriteLine("locked:" + items[5].AsInteger());
                Console.WriteLine("hasDrawed:" + items[6].AsInteger());
                Console.WriteLine("status:" + items[7].AsInteger());
                Console.WriteLine("anchor:" + items[8].AsString());
            }
            else
            {
                Console.WriteLine("no sar exists");
            }
        }
예제 #2
0
        //查询配置信息
        async Task test_getConfig()
        {
            Console.WriteLine("Input config key:");
            string key = Console.ReadLine();

            var result = await business_common.api_InvokeScript(business_common.sc_wneo, "getConfig", "(str)" + key);

            business_common.ResultItem item = result.value;

            Console.WriteLine(item.subItem[0].AsInteger());
        }