diff --git a/swagger-docs/en/trade/asset/account.yml b/swagger-docs/en/trade/asset/account.yml index 0bb56338..fc8fe30a 100644 --- a/swagger-docs/en/trade/asset/account.yml +++ b/swagger-docs/en/trade/asset/account.yml @@ -21,12 +21,23 @@ paths: request_body: type: "python" value: | + from longbridge.http import Auth, Config, HttpClient + + URL = "https://openapi.lbkrs.com" + def example(): - from longbridge.http import Auth, Config, HttpClient - auth = Auth("${APP_KEY}", "${APP_SECRET}", "${ACCESS_TOKEN}") - config = Config(base_url = "https://openapi.lbkrs.com") - client = HttpClient(auth, config) - result = client.get("/v1/asset/account") + """ + 下单接口 + 前置条件:账号需要有充足金额 + """ + auth = Auth(os.getenv("LONGBRIDGE_APP_KEY"), os.getenv("LONGBRIDGE_APP_SECRET"), access_token=os.getenv("LONGBRIDGE_ACCESS_TOKEN")) + config = Config(base_url=URL) + client = HttpClient(auth, config) + result = client.get("/v1/asset/account") + print(result.data) + + if __name__ == "__main__": + example() response_body: { "code": 0, diff --git a/swagger-docs/en/trade/asset/cashflow.yml b/swagger-docs/en/trade/asset/cashflow.yml index 0ecd70db..0d154b82 100644 --- a/swagger-docs/en/trade/asset/cashflow.yml +++ b/swagger-docs/en/trade/asset/cashflow.yml @@ -47,12 +47,23 @@ paths: request_body: type: "python" value: | + from longbridge.http import Auth, Config, HttpClient + + URL = "https://openapi.lbkrs.com" + def example(): - from longbridge.http import Auth, Config, HttpClient - auth = Auth("${APP_KEY}", "${APP_SECRET}", "${ACCESS_TOKEN}") - config = Config(base_url = "https://openapi.lbkrs.com") - client = HttpClient(auth, config) - result = client.get("/v1/asset/cashflow",{"start_time":"1623881671","end_time":"1626881673"}) + """ + 下单接口 + 前置条件:账号需要有充足金额 + """ + auth = Auth(os.getenv("LONGBRIDGE_APP_KEY"), os.getenv("LONGBRIDGE_APP_SECRET"), access_token=os.getenv("LONGBRIDGE_ACCESS_TOKEN")) + config = Config(base_url=URL) + client = HttpClient(auth, config) + result = client.get("/v1/asset/cashflow",{"start_time":"1623881671","end_time":"1626881673"}) + print(result.data) + + if __name__ == "__main__": + example() response_body: { "code": 0, diff --git a/swagger-docs/en/trade/asset/fund.yml b/swagger-docs/en/trade/asset/fund.yml index bb6085c5..f8860bcf 100644 --- a/swagger-docs/en/trade/asset/fund.yml +++ b/swagger-docs/en/trade/asset/fund.yml @@ -26,12 +26,23 @@ paths: request_body: type: "python" value: | + from longbridge.http import Auth, Config, HttpClient + + URL = "https://openapi.lbkrs.com" + def example(): - from longbridge.http import Auth, Config, HttpClient - auth = Auth("${APP_KEY}", "${APP_SECRET}", "${ACCESS_TOKEN}") - config = Config(base_url = "https://openapi.lbkrs.com") - client = HttpClient(auth, config) - result = client.get("/v1/asset/fund") + """ + 下单接口 + 前置条件:账号需要有充足金额 + """ + auth = Auth(os.getenv("LONGBRIDGE_APP_KEY"), os.getenv("LONGBRIDGE_APP_SECRET"), access_token=os.getenv("LONGBRIDGE_ACCESS_TOKEN")) + config = Config(base_url=URL) + client = HttpClient(auth, config) + result = client.get("/v1/asset/fund") + print(result.data) + + if __name__ == "__main__": + example() response_body: { "code": 0, diff --git a/swagger-docs/en/trade/asset/stock.yml b/swagger-docs/en/trade/asset/stock.yml index ab5a8325..832cb0f6 100644 --- a/swagger-docs/en/trade/asset/stock.yml +++ b/swagger-docs/en/trade/asset/stock.yml @@ -26,12 +26,23 @@ paths: request_body: type: "python" value: | + from longbridge.http import Auth, Config, HttpClient + + URL = "https://openapi.lbkrs.com" + def example(): - from longbridge.http import Auth, Config, HttpClient - auth = Auth("${APP_KEY}", "${APP_SECRET}", "${ACCESS_TOKEN}") - config = Config(base_url = "https://openapi.lbkrs.com") - client = HttpClient(auth, config) - result = client.get("/v1/asset/stock") + """ + 下单接口 + 前置条件:账号需要有充足金额 + """ + auth = Auth(os.getenv("LONGBRIDGE_APP_KEY"), os.getenv("LONGBRIDGE_APP_SECRET"), access_token=os.getenv("LONGBRIDGE_ACCESS_TOKEN")) + config = Config(base_url=URL) + client = HttpClient(auth, config) + result = client.get("/v1/asset/stock") + print(result.data) + + if __name__ == "__main__": + example() response_body: { "code": 0, diff --git a/swagger-docs/zh-CN/trade/asset/account.yml b/swagger-docs/zh-CN/trade/asset/account.yml index 9585f825..d98c34f8 100644 --- a/swagger-docs/zh-CN/trade/asset/account.yml +++ b/swagger-docs/zh-CN/trade/asset/account.yml @@ -21,12 +21,23 @@ paths: request_body: type: "python" value: | - def example(): - from longbridge.http import Auth, Config, HttpClient - auth = Auth("${APP_KEY}", "${APP_SECRET}", "${ACCESS_TOKEN}") - config = Config(base_url = "https://openapi.lbkrs.com") - client = HttpClient(auth, config) - result = client.get("/v1/asset/account") + from longbridge.http import Auth, Config, HttpClient + + URL = "https://openapi.lbkrs.com" + + def example(): + """ + 下单接口 + 前置条件:账号需要有充足金额 + """ + auth = Auth(os.getenv("LONGBRIDGE_APP_KEY"), os.getenv("LONGBRIDGE_APP_SECRET"), access_token=os.getenv("LONGBRIDGE_ACCESS_TOKEN")) + config = Config(base_url=URL) + client = HttpClient(auth, config) + result = client.get("/v1/asset/account") + print(result.data) + + if __name__ == "__main__": + example() response_body: { "code": 0, diff --git a/swagger-docs/zh-CN/trade/asset/cashflow.yml b/swagger-docs/zh-CN/trade/asset/cashflow.yml index 9e4185fe..a43a643f 100644 --- a/swagger-docs/zh-CN/trade/asset/cashflow.yml +++ b/swagger-docs/zh-CN/trade/asset/cashflow.yml @@ -47,12 +47,23 @@ paths: request_body: type: "python" value: | - def example(): - from longbridge.http import Auth, Config, HttpClient - auth = Auth("${APP_KEY}", "${APP_SECRET}", "${ACCESS_TOKEN}") - config = Config(base_url = "https://openapi.lbkrs.com") - client = HttpClient(auth, config) - result = client.get("/v1/asset/cashflow",{"start_time":"1623881671","end_time":"1626881673"}) + from longbridge.http import Auth, Config, HttpClient + + URL = "https://openapi.lbkrs.com" + + def example(): + """ + 下单接口 + 前置条件:账号需要有充足金额 + """ + auth = Auth(os.getenv("LONGBRIDGE_APP_KEY"), os.getenv("LONGBRIDGE_APP_SECRET"), access_token=os.getenv("LONGBRIDGE_ACCESS_TOKEN")) + config = Config(base_url=URL) + client = HttpClient(auth, config) + result = client.get("/v1/asset/cashflow",{"start_time":"1623881671","end_time":"1626881673"}) + print(result.data) + + if __name__ == "__main__": + example() response_body: { "code": 0, diff --git a/swagger-docs/zh-CN/trade/asset/fund.yml b/swagger-docs/zh-CN/trade/asset/fund.yml index 53b871a7..a8e60749 100644 --- a/swagger-docs/zh-CN/trade/asset/fund.yml +++ b/swagger-docs/zh-CN/trade/asset/fund.yml @@ -26,12 +26,23 @@ paths: request_body: type: "python" value: | - def example(): - from longbridge.http import Auth, Config, HttpClient - auth = Auth("${APP_KEY}", "${APP_SECRET}", "${ACCESS_TOKEN}") - config = Config(base_url = "https://openapi.lbkrs.com") - client = HttpClient(auth, config) - result = client.get("/v1/asset/fund") + from longbridge.http import Auth, Config, HttpClient + + URL = "https://openapi.lbkrs.com" + + def example(): + """ + 下单接口 + 前置条件:账号需要有充足金额 + """ + auth = Auth(os.getenv("LONGBRIDGE_APP_KEY"), os.getenv("LONGBRIDGE_APP_SECRET"), access_token=os.getenv("LONGBRIDGE_ACCESS_TOKEN")) + config = Config(base_url=URL) + client = HttpClient(auth, config) + result = client.get("/v1/asset/fund") + print(result.data) + + if __name__ == "__main__": + example() response_body: { "code": 0, diff --git a/swagger-docs/zh-CN/trade/asset/stock.yml b/swagger-docs/zh-CN/trade/asset/stock.yml index 2afbe383..88985d1a 100644 --- a/swagger-docs/zh-CN/trade/asset/stock.yml +++ b/swagger-docs/zh-CN/trade/asset/stock.yml @@ -26,12 +26,23 @@ paths: request_body: type: "python" value: | - def example(): - from longbridge.http import Auth, Config, HttpClient - auth = Auth("${APP_KEY}", "${APP_SECRET}", "${ACCESS_TOKEN}") - config = Config(base_url = "https://openapi.lbkrs.com") - client = HttpClient(auth, config) - result = client.get("/v1/asset/stock") + from longbridge.http import Auth, Config, HttpClient + + URL = "https://openapi.lbkrs.com" + + def example(): + """ + 下单接口 + 前置条件:账号需要有充足金额 + """ + auth = Auth(os.getenv("LONGBRIDGE_APP_KEY"), os.getenv("LONGBRIDGE_APP_SECRET"), access_token=os.getenv("LONGBRIDGE_ACCESS_TOKEN")) + config = Config(base_url=URL) + client = HttpClient(auth, config) + result = client.get("/v1/asset/stock") + print(result.data) + + if __name__ == "__main__": + example() response_body: { "code": 0, diff --git a/swagger-docs/zh-HK/trade/asset/account.yml b/swagger-docs/zh-HK/trade/asset/account.yml index 76f9d25a..3cad5952 100644 --- a/swagger-docs/zh-HK/trade/asset/account.yml +++ b/swagger-docs/zh-HK/trade/asset/account.yml @@ -21,12 +21,23 @@ paths: request_body: type: "python" value: | - def example(): - from longbridge.http import Auth, Config, HttpClient - auth = Auth("${APP_KEY}", "${APP_SECRET}", "${ACCESS_TOKEN}") - config = Config(base_url = "https://openapi.lbkrs.com") - client = HttpClient(auth, config) - result = client.get("/v1/asset/account") + from longbridge.http import Auth, Config, HttpClient + + URL = "https://openapi.lbkrs.com" + + def example(): + """ + 下单接口 + 前置条件:账号需要有充足金额 + """ + auth = Auth(os.getenv("LONGBRIDGE_APP_KEY"), os.getenv("LONGBRIDGE_APP_SECRET"), access_token=os.getenv("LONGBRIDGE_ACCESS_TOKEN")) + config = Config(base_url=URL) + client = HttpClient(auth, config) + result = client.get("/v1/asset/account") + print(result.data) + + if __name__ == "__main__": + example() response_body: { "code": 0, diff --git a/swagger-docs/zh-HK/trade/asset/cashflow.yml b/swagger-docs/zh-HK/trade/asset/cashflow.yml index ebbac9e8..4f8b12a2 100644 --- a/swagger-docs/zh-HK/trade/asset/cashflow.yml +++ b/swagger-docs/zh-HK/trade/asset/cashflow.yml @@ -47,12 +47,23 @@ paths: request_body: type: "python" value: | - def example(): - from longbridge.http import Auth, Config, HttpClient - auth = Auth("${APP_KEY}", "${APP_SECRET}", "${ACCESS_TOKEN}") - config = Config(base_url = "https://openapi.lbkrs.com") - client = HttpClient(auth, config) - result = client.get("/v1/asset/cashflow",{"start_time":"1623881671","end_time":"1626881673"}) + from longbridge.http import Auth, Config, HttpClient + + URL = "https://openapi.lbkrs.com" + + def example(): + """ + 下单接口 + 前置条件:账号需要有充足金额 + """ + auth = Auth(os.getenv("LONGBRIDGE_APP_KEY"), os.getenv("LONGBRIDGE_APP_SECRET"), access_token=os.getenv("LONGBRIDGE_ACCESS_TOKEN")) + config = Config(base_url=URL) + client = HttpClient(auth, config) + result = client.get("/v1/asset/cashflow",{"start_time":"1623881671","end_time":"1626881673"}) + print(result.data) + + if __name__ == "__main__": + example() response_body: { "code": 0, diff --git a/swagger-docs/zh-HK/trade/asset/fund.yml b/swagger-docs/zh-HK/trade/asset/fund.yml index 89b49036..575d3762 100644 --- a/swagger-docs/zh-HK/trade/asset/fund.yml +++ b/swagger-docs/zh-HK/trade/asset/fund.yml @@ -26,12 +26,23 @@ paths: request_body: type: "python" value: | - def example(): - from longbridge.http import Auth, Config, HttpClient - auth = Auth("${APP_KEY}", "${APP_SECRET}", "${ACCESS_TOKEN}") - config = Config(base_url = "https://openapi.lbkrs.com") - client = HttpClient(auth, config) - result = client.get("/v1/asset/fund") + from longbridge.http import Auth, Config, HttpClient + + URL = "https://openapi.lbkrs.com" + + def example(): + """ + 下单接口 + 前置条件:账号需要有充足金额 + """ + auth = Auth(os.getenv("LONGBRIDGE_APP_KEY"), os.getenv("LONGBRIDGE_APP_SECRET"), access_token=os.getenv("LONGBRIDGE_ACCESS_TOKEN")) + config = Config(base_url=URL) + client = HttpClient(auth, config) + result = client.get("/v1/asset/fund") + print(result.data) + + if __name__ == "__main__": + example() response_body: { "code": 0, diff --git a/swagger-docs/zh-HK/trade/asset/stock.yml b/swagger-docs/zh-HK/trade/asset/stock.yml index 7c8dbed4..ce706364 100644 --- a/swagger-docs/zh-HK/trade/asset/stock.yml +++ b/swagger-docs/zh-HK/trade/asset/stock.yml @@ -26,12 +26,23 @@ paths: request_body: type: "python" value: | - def example(): - from longbridge.http import Auth, Config, HttpClient - auth = Auth("${APP_KEY}", "${APP_SECRET}", "${ACCESS_TOKEN}") - config = Config(base_url = "https://openapi.lbkrs.com") - client = HttpClient(auth, config) - result = client.get("/v1/asset/stock") + from longbridge.http import Auth, Config, HttpClient + + URL = "https://openapi.lbkrs.com" + + def example(): + """ + 下单接口 + 前置条件:账号需要有充足金额 + """ + auth = Auth(os.getenv("LONGBRIDGE_APP_KEY"), os.getenv("LONGBRIDGE_APP_SECRET"), access_token=os.getenv("LONGBRIDGE_ACCESS_TOKEN")) + config = Config(base_url=URL) + client = HttpClient(auth, config) + result = client.get("/v1/asset/stock") + print(result.data) + + if __name__ == "__main__": + example() response_body: { "code": 0,