nautilus_bybit/python/
urls.rs1use pyo3::prelude::*;
19
20use crate::common::{
21 enums::{BybitEnvironment, BybitProductType},
22 urls,
23};
24
25#[pyfunction]
27#[pyo3_stub_gen::derive::gen_stub_pyfunction(module = "nautilus_trader.adapters.bybit")]
28#[pyo3(name = "get_bybit_http_base_url")]
29pub fn py_get_bybit_http_base_url(environment: BybitEnvironment) -> &'static str {
30 urls::bybit_http_base_url(environment)
31}
32
33#[pyfunction]
35#[pyo3_stub_gen::derive::gen_stub_pyfunction(module = "nautilus_trader.adapters.bybit")]
36#[pyo3(name = "get_bybit_ws_url_public")]
37pub fn py_get_bybit_ws_url_public(
38 product_type: BybitProductType,
39 environment: BybitEnvironment,
40) -> String {
41 urls::bybit_ws_public_url(product_type, environment)
42}
43
44#[pyfunction]
46#[pyo3_stub_gen::derive::gen_stub_pyfunction(module = "nautilus_trader.adapters.bybit")]
47#[pyo3(name = "get_bybit_ws_url_private")]
48pub fn py_get_bybit_ws_url_private(environment: BybitEnvironment) -> &'static str {
49 urls::bybit_ws_private_url(environment)
50}
51
52#[pyfunction]
54#[pyo3_stub_gen::derive::gen_stub_pyfunction(module = "nautilus_trader.adapters.bybit")]
55#[pyo3(name = "get_bybit_ws_url_trade")]
56pub fn py_get_bybit_ws_url_trade(environment: BybitEnvironment) -> &'static str {
57 urls::bybit_ws_trade_url(environment)
58}