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 credential_authorization;
25mod currency;
26mod exceptions;
27mod flag_collection;
28mod model;
29
30pub use amount::*;
31pub use credential_authorization::*;
32pub use currency::*;
33pub use exceptions::*;
34pub use flag_collection::*;
35pub use model::*;
36
37use alloc::borrow::Cow;
38use derive_new::new;
39use serde::{Deserialize, Serialize};
40
41#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Default, Clone, new)]
43#[serde(rename_all = "PascalCase")]
44pub struct PathStep<'a> {
45 account: Option<Cow<'a, str>>,
46 currency: Option<Cow<'a, str>>,
47 issuer: Option<Cow<'a, str>>,
48 r#type: Option<u8>,
49 type_hex: Option<Cow<'a, str>>,
50}
51
52impl<'a> PathStep<'a> {
53 pub fn with_account(mut self, account: Cow<'a, str>) -> Self {
55 self.account = Some(account);
56 self
57 }
58
59 pub fn with_currency(mut self, currency: Cow<'a, str>) -> Self {
61 self.currency = Some(currency);
62 self
63 }
64
65 pub fn with_issuer(mut self, issuer: Cow<'a, str>) -> Self {
67 self.issuer = Some(issuer);
68 self
69 }
70
71 pub fn with_type(mut self, r#type: u8) -> Self {
73 self.r#type = Some(r#type);
74 self
75 }
76
77 pub fn with_type_hex(mut self, type_hex: Cow<'a, str>) -> Self {
79 self.type_hex = Some(type_hex);
80 self
81 }
82}
83
84#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, derive_new::new)]
85#[serde(rename_all = "PascalCase")]
86pub struct XChainBridge<'a> {
87 pub issuing_chain_door: Cow<'a, str>,
88 pub issuing_chain_issue: Currency<'a>,
89 pub locking_chain_door: Cow<'a, str>,
90 pub locking_chain_issue: Currency<'a>,
91}
92
93fn default_false() -> Option<bool> {
95 Some(false)
96}
97
98pub trait ValidateCurrencies {
102 fn validate_currencies(&self) -> crate::models::XRPLModelResult<()>;
103}