nautilus_kraken/python/
enums.rs

1// -------------------------------------------------------------------------------------------------
2//  Copyright (C) 2015-2025 Nautech Systems Pty Ltd. All rights reserved.
3//  https://nautechsystems.io
4//
5//  Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
6//  You may not use this file except in compliance with the License.
7//  You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
8//
9//  Unless required by applicable law or agreed to in writing, software
10//  distributed under the License is distributed on an "AS IS" BASIS,
11//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//  See the License for the specific language governing permissions and
13//  limitations under the License.
14// -------------------------------------------------------------------------------------------------
15
16//! Python-idiomatic enum aliases (SCREAMING_SNAKE_CASE).
17
18use pyo3::prelude::*;
19
20use crate::common::enums::{KrakenEnvironment, KrakenProductType};
21
22#[pymethods]
23impl KrakenEnvironment {
24    #[classattr]
25    #[pyo3(name = "MAINNET")]
26    fn py_mainnet() -> Self {
27        Self::Mainnet
28    }
29
30    #[classattr]
31    #[pyo3(name = "DEMO")]
32    fn py_demo() -> Self {
33        Self::Demo
34    }
35}
36
37#[pymethods]
38impl KrakenProductType {
39    #[classattr]
40    #[pyo3(name = "SPOT")]
41    fn py_spot() -> Self {
42        Self::Spot
43    }
44
45    #[classattr]
46    #[pyo3(name = "FUTURES")]
47    fn py_futures() -> Self {
48        Self::Futures
49    }
50}