noah_sdk/models/
channels.rs

1//! Channel-related models
2
3use crate::models::common::*;
4use crate::models::payment_methods::PaymentMethodDisplay;
5use serde::{Deserialize, Serialize};
6
7/// Channel limits
8#[derive(Debug, Clone, Serialize, Deserialize)]
9pub struct ChannelLimits {
10    /// Minimum limit
11    #[serde(rename = "MinLimit")]
12    pub min_limit: PositiveDecimal,
13    /// Maximum limit
14    #[serde(rename = "MaxLimit")]
15    pub max_limit: Option<PositiveDecimal>,
16}
17
18/// Channel calculated fees
19#[derive(Debug, Clone, Serialize, Deserialize)]
20pub struct ChannelCalculated {
21    /// Total fee
22    #[serde(rename = "TotalFee")]
23    pub total_fee: PositiveDecimal,
24}
25
26/// Channel
27#[derive(Debug, Clone, Serialize, Deserialize)]
28pub struct Channel {
29    /// Channel ID
30    #[serde(rename = "ID")]
31    pub id: ChannelID,
32    /// Payment method category
33    #[serde(rename = "PaymentMethodCategory")]
34    pub payment_method_category: PaymentMethodCategory,
35    /// Payment method type
36    #[serde(rename = "PaymentMethodType")]
37    pub payment_method_type: PaymentMethodType,
38    /// Fiat currency
39    #[serde(rename = "FiatCurrency")]
40    pub fiat_currency: FiatCurrencyCode,
41    /// Country
42    #[serde(rename = "Country")]
43    pub country: CountryCode,
44    /// Calculated fees (optional)
45    #[serde(rename = "Calculated")]
46    pub calculated: Option<ChannelCalculated>,
47    /// Limits
48    #[serde(rename = "Limits")]
49    pub limits: ChannelLimits,
50    /// Exchange rate
51    #[serde(rename = "Rate")]
52    pub rate: PositiveDecimal,
53    /// Payment methods (optional)
54    #[serde(rename = "PaymentMethods")]
55    pub payment_methods: Option<Vec<PaymentMethodDisplay>>,
56    /// Processing time in seconds
57    #[serde(rename = "ProcessingSeconds")]
58    pub processing_seconds: u64,
59    /// Processing tier
60    #[serde(rename = "ProcessingTier")]
61    pub processing_tier: Option<ProcessingTier>,
62    /// Form schema (optional)
63    #[serde(rename = "FormSchema")]
64    pub form_schema: Option<serde_json::Value>,
65}
66
67/// Get channels response
68#[derive(Debug, Clone, Serialize, Deserialize)]
69pub struct GetChannelsResponse {
70    /// List of channels
71    #[serde(rename = "Items")]
72    pub items: Vec<Channel>,
73    /// Pagination token
74    #[serde(rename = "PageToken")]
75    pub page_token: Option<String>,
76}
77
78/// Channels countries response
79#[derive(Debug, Clone, Serialize, Deserialize)]
80pub struct ChannelsCountriesResponse {
81    #[serde(flatten)]
82    pub countries: std::collections::HashMap<CountryCode, Vec<FiatCurrencyCode>>,
83}