async Task test_getSAR4B() { Console.WriteLine("Input target addr:"); string addr = Console.ReadLine(); if (addr.Length == 0) { addr = this.address; } var result = await newbusiness_common.api_InvokeScript(newbusiness_common.sc_wneo, "getSAR4B", "(addr)" + addr); newbusiness_common.ResultItem item = result.value; newbusiness_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"); } }
//查询配置信息 async Task test_getConfig() { Console.WriteLine("Input config key:"); string key = Console.ReadLine(); var result = await newbusiness_common.api_InvokeScript(newbusiness_common.sc_wneo, "getConfig", "(str)" + key); newbusiness_common.ResultItem item = result.value; Console.WriteLine(item.subItem[0].AsInteger()); }