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::{offer::PriceRatio, Amount, AssetIdentifier};
#[derive(Debug, Clone)]
pub struct CreatePassiveOffer {
offer_id: i64,
selling: AssetIdentifier,
buying: AssetIdentifier,
amount: Amount,
price_ratio: PriceRatio,
price: Amount,
}
impl CreatePassiveOffer {
pub fn new(
offer_id: i64,
selling: AssetIdentifier,
buying: AssetIdentifier,
amount: Amount,
price_ratio: PriceRatio,
price: Amount,
) -> CreatePassiveOffer {
CreatePassiveOffer {
offer_id,
selling,
buying,
amount,
price_ratio,
price,
}
}
pub fn offer_id(&self) -> i64 {
self.offer_id
}
pub fn selling(&self) -> &AssetIdentifier {
&self.selling
}
pub fn buying(&self) -> &AssetIdentifier {
&self.buying
}
pub fn amount(&self) -> Amount {
self.amount
}
pub fn price_ratio(&self) -> &PriceRatio {
&self.price_ratio
}
pub fn price(&self) -> Amount {
self.price
}
}