1#[cfg(feature = "models")]
11#[allow(clippy::too_many_arguments)]
12pub mod ledger;
13#[cfg(feature = "models")]
14#[allow(clippy::too_many_arguments)]
15pub mod requests;
16#[cfg(feature = "models")]
17#[allow(clippy::too_many_arguments)]
18pub mod results;
19#[cfg(feature = "models")]
20#[allow(clippy::too_many_arguments)]
21pub mod transactions;
22
23mod amount;
24mod currency;
25mod exceptions;
26mod flag_collection;
27mod model;
28
29pub use amount::*;
30pub use currency::*;
31pub use exceptions::*;
32pub use flag_collection::*;
33pub use model::*;
34
35use alloc::borrow::Cow;
36use derive_new::new;
37use serde::{Deserialize, Serialize};
38
39#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Default, Clone, new)]
41#[serde(rename_all = "PascalCase")]
42pub struct PathStep<'a> {
43 account: Option<Cow<'a, str>>,
44 currency: Option<Cow<'a, str>>,
45 issuer: Option<Cow<'a, str>>,
46 r#type: Option<u8>,
47 type_hex: Option<Cow<'a, str>>,
48}
49
50impl<'a> PathStep<'a> {
51 pub fn with_account(mut self, account: Cow<'a, str>) -> Self {
53 self.account = Some(account);
54 self
55 }
56
57 pub fn with_currency(mut self, currency: Cow<'a, str>) -> Self {
59 self.currency = Some(currency);
60 self
61 }
62
63 pub fn with_issuer(mut self, issuer: Cow<'a, str>) -> Self {
65 self.issuer = Some(issuer);
66 self
67 }
68
69 pub fn with_type(mut self, r#type: u8) -> Self {
71 self.r#type = Some(r#type);
72 self
73 }
74
75 pub fn with_type_hex(mut self, type_hex: Cow<'a, str>) -> Self {
77 self.type_hex = Some(type_hex);
78 self
79 }
80}
81
82#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, derive_new::new)]
83#[serde(rename_all = "PascalCase")]
84pub struct XChainBridge<'a> {
85 pub issuing_chain_door: Cow<'a, str>,
86 pub issuing_chain_issue: Currency<'a>,
87 pub locking_chain_door: Cow<'a, str>,
88 pub locking_chain_issue: Currency<'a>,
89}
90
91fn default_false() -> Option<bool> {
93 Some(false)
94}
95
96pub trait ValidateCurrencies {
100 fn validate_currencies(&self) -> crate::models::XRPLModelResult<()>;
101}