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
use resources::{Amount, AssetIdentifier};
#[derive(Debug, Clone)]
pub struct PathPayment {
from: String,
to: String,
destination_asset: AssetIdentifier,
destination_amount: Amount,
source_asset: AssetIdentifier,
source_max: Amount,
}
impl PathPayment {
pub fn new(
from: String,
to: String,
destination_asset: AssetIdentifier,
destination_amount: Amount,
source_asset: AssetIdentifier,
source_max: Amount,
) -> PathPayment {
PathPayment {
from,
to,
destination_asset,
destination_amount,
source_asset,
source_max,
}
}
pub fn from(&self) -> &str {
&self.from
}
pub fn to(&self) -> &str {
&self.to
}
pub fn destination_asset(&self) -> &AssetIdentifier {
&self.destination_asset
}
pub fn destination_amount(&self) -> Amount {
self.destination_amount
}
pub fn source_asset(&self) -> &AssetIdentifier {
&self.source_asset
}
pub fn source_max(&self) -> Amount {
self.source_max
}
}