def test_etf(self): etf_client = EtfClient(api_key=g_api_key, secret_key=g_secret_key, performance_test=True) # case get_etf_swap_config tc = TimeCost(function_name=etf_client.get_etf_swap_config.__name__) result, tc.server_req_cost, tc.server_api_cost = etf_client.get_etf_swap_config( etf_name="hb10") tc.run_status = RunStatus.SUCCESS if result else RunStatus.FAILED tc.add_record() # case get_etf_swap_list tc = TimeCost(function_name=etf_client.get_etf_swap_list.__name__) result, tc.server_req_cost, tc.server_api_cost = etf_client.get_etf_swap_list( etf_name="hb10", offset=0, size=10) tc.run_status = RunStatus.SUCCESS if len( result) >= 0 else RunStatus.FAILED tc.add_record()
from huobi.client.etf import EtfClient from huobi.constant import * from huobi.utils import * etf_client = EtfClient(api_key=g_api_key, secret_key=g_secret_key) etf_list = etf_client.get_etf_swap_list(etf_name="hb10", offset=0, size=20) LogInfo.output_list(etf_list)
from huobi.client.etf import EtfClient from huobi.constant import * etf_client = EtfClient(api_key=g_api_key, secret_key=g_secret_key) etf_swap_ret = etf_client.post_etf_swap_in("hb10", 1000) etf_swap_ret.print_object()
from huobi.client.etf import EtfClient etf_client = EtfClient() etf_config = etf_client.get_etf_swap_config("hb10") etf_config.print_object()