1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//! Centralized endpoint URL constants for the Fugle marketdata SDK.
//!
//! All production endpoints are defined here so version bumps (e.g. `v1.0`
//! → `v2.0`) are a single-line change. Internal callers (`ConnectionConfig`,
//! `RestClient`) read from this module instead of inlining literal strings.
//!
//! # Custom endpoints
//!
//! Two override paths are supported:
//!
//! - REST: chain [`RestClient::base_url`](crate::RestClient::base_url) onto
//! [`RestClient::new`](crate::RestClient::new) to point at a custom host.
//! - WebSocket: pass a custom URL directly to
//! [`ConnectionConfig::new`](crate::websocket::ConnectionConfig::new), or
//! use the
//! [`fugle_stock_at`](crate::websocket::ConnectionConfig::fugle_stock_at)
//! / [`fugle_futopt_at`](crate::websocket::ConnectionConfig::fugle_futopt_at)
//! helpers, which take only the host root and append
//! `{API_VERSION}/{type}/streaming` for you.
// ---- Full production endpoints (default values used by convenience constructors) ----
/// Stock market WebSocket streaming endpoint.
pub const STOCK_WS: &str = "wss://api.fugle.tw/marketdata/v1.0/stock/streaming";
/// Futures and options WebSocket streaming endpoint.
pub const FUTOPT_WS: &str = "wss://api.fugle.tw/marketdata/v1.0/futopt/streaming";
/// REST API base URL (host + version, no trailing slash).
pub const REST_BASE: &str = "https://api.fugle.tw/marketdata/v1.0";
// ---- Host roots (no version) used for staging / mock-server overrides ----
/// REST API host root (no version segment).
///
/// Combine with [`API_VERSION`] to derive a custom REST base.
pub const REST_BASE_ROOT: &str = "https://api.fugle.tw/marketdata";
/// WebSocket host root (no version segment).
///
/// Combine with [`API_VERSION`] and a channel suffix to derive a custom
/// WebSocket endpoint, or pass directly to
/// [`ConnectionConfig::fugle_stock_at`](crate::websocket::ConnectionConfig::fugle_stock_at)
/// / [`fugle_futopt_at`](crate::websocket::ConnectionConfig::fugle_futopt_at).
pub const WS_BASE_ROOT: &str = "wss://api.fugle.tw/marketdata";
/// API version segment shared by REST and WebSocket endpoints.
///
/// Bump in lockstep with [`STOCK_WS`] / [`FUTOPT_WS`] / [`REST_BASE`] when
/// the marketdata service publishes a new major version.
pub const API_VERSION: &str = "v1.0";