//查询配置信息 async Task test_getMedian() { var result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getMedian", "(str)sds_price"); oracle_common.ResultItem item = result.value; Console.WriteLine("getMedian:" + item.subItem[0].AsInteger()); }
//查询配置信息 async Task test_getAnchorPrice() { Console.WriteLine("key:anchor_type_usd"); var result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getAnchorPrice", "(str)anchor_type_usd"); oracle_common.ResultItem item = result.value; Console.WriteLine(item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getAnchorPrice", "(str)anchor_type_eur"); item = result.value; Console.WriteLine(item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getAnchorPrice", "(str)anchor_type_jpy"); item = result.value; Console.WriteLine(item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getAnchorPrice", "(str)anchor_type_gbp"); item = result.value; Console.WriteLine(item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getAnchorPrice", "(str)anchor_type_gold"); item = result.value; Console.WriteLine(item.subItem[0].AsInteger()); }
async Task test_getAccount() { Console.WriteLine("addr:"); string addr = Console.ReadLine(); var result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getAccount", "(addr)" + addr); oracle_common.ResultItem item = result.value; Console.WriteLine("addr:" + item.subItem[0].AsInteger()); }
//查询配置信息 async Task test_getPrice() { var result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getPrice", "(str)sds_price"); oracle_common.ResultItem item = result.value; Console.WriteLine("sds_price:" + item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getPrice", "(str)neo_price"); item = result.value; Console.WriteLine("neo_price:" + item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getPrice", "(str)sneo_price"); item = result.value; Console.WriteLine("sneo_price:" + item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getPrice", "(str)cneo_price"); item = result.value; Console.WriteLine("cneo_price:" + item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getPrice", "(str)gas_price"); item = result.value; Console.WriteLine("gas_price:" + item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getPrice", "(str)anchor_type_usd"); item = result.value; Console.WriteLine("anchor_type_usd:" + item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getPrice", "(str)anchor_type_eur"); item = result.value; Console.WriteLine("anchor_type_eur:" + item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getPrice", "(str)anchor_type_jpy"); item = result.value; Console.WriteLine("anchor_type_jpy:" + item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getPrice", "(str)anchor_type_gbp"); item = result.value; Console.WriteLine("anchor_type_gbp:" + item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getPrice", "(str)anchor_type_gold"); item = result.value; Console.WriteLine("anchor_type_gold:" + item.subItem[0].AsInteger()); }
async Task test_getConfig() { var result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getConfig", "(str)liquidate_rate_b"); oracle_common.ResultItem item = result.value; Console.WriteLine("liquidate_rate_b:" + item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getConfig", "(str)liquidate_rate_c"); item = result.value; Console.WriteLine("liquidate_rate_c:" + item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getConfig", "(str)clear_rate"); item = result.value; Console.WriteLine("clear_rate:" + item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getConfig", "(str)resuce_rate_c"); item = result.value; Console.WriteLine("resuce_rate_c:" + item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getConfig", "(str)service_fee"); item = result.value; Console.WriteLine("service_fee:" + item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getConfig", "(str)anchor_type_usd"); item = result.value; Console.WriteLine(item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getConfig", "(str)anchor_type_eur"); item = result.value; Console.WriteLine(item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getConfig", "(str)anchor_type_jpy"); item = result.value; Console.WriteLine(item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getConfig", "(str)anchor_type_gbp"); item = result.value; Console.WriteLine(item.subItem[0].AsInteger()); result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getConfig", "(str)anchor_type_gold"); item = result.value; Console.WriteLine(item.subItem[0].AsInteger()); }
async Task test_getStructConfig() { var result = await oracle_common.api_InvokeScript(oracle_common.sc_wneo, "getStructConfig"); oracle_common.ResultItem item = result.value; oracle_common.ResultItem[] items = item.subItem[0].subItem; if (items != null) { Console.WriteLine("liquidate_rate_b:" + items[0].AsInteger()); Console.WriteLine("liquidate_rate_c:" + items[1].AsInteger()); Console.WriteLine("clear_rate:" + items[2].AsInteger()); Console.WriteLine("fee_rate_c:" + items[3].AsInteger()); Console.WriteLine("resuce_rate_c:" + items[4].AsInteger()); Console.WriteLine("bond_rate_c:" + items[5].AsInteger()); Console.WriteLine("release_rate_c:" + items[6].AsInteger()); Console.WriteLine("service_fee:" + items[7].AsInteger()); Console.WriteLine("release_max_c:" + items[8].AsInteger()); } }
async Task test_getStructConfig() { var result = await oracle_common.api_InvokeScript(Config.oracle, "getStructConfig"); oracle_common.ResultItem item = result.value; oracle_common.ResultItem[] items = item.subItem[0].subItem; if (items != null) { Console.WriteLine("liquidate_line_rate_b:" + items[0].AsInteger()); Console.WriteLine("liquidate_line_rate_c:" + items[1].AsInteger()); Console.WriteLine("liquidate_dis_rate_c:" + items[2].AsInteger()); Console.WriteLine("fee_rate_c:" + items[3].AsInteger()); Console.WriteLine("liquidate_top_rate_c:" + items[4].AsInteger()); Console.WriteLine("liquidate_line_rateT_c:" + items[5].AsInteger()); Console.WriteLine("issuing_fee_c:" + items[6].AsInteger()); Console.WriteLine("issuing_fee_b:" + items[7].AsInteger()); Console.WriteLine("debt_top_c:" + items[8].AsInteger()); } }