@@ -80,8 +80,9 @@ pub struct OfferBuilder {
80
80
}
81
81
82
82
impl OfferBuilder {
83
- /// Creates a new builder for an offer with the given description, using the given pubkey for
84
- /// signing invoices. The associated secret key must be remembered while the offer is valid.
83
+ /// Creates a new builder for an offer setting the [`Offer::description`] and using the
84
+ /// [`Offer::signing_pubkey`] for signing invoices. The associated secret key must be remembered
85
+ /// while the offer is valid.
85
86
///
86
87
/// Use a different pubkey per offer to avoid correlating offers.
87
88
pub fn new ( description : String , signing_pubkey : PublicKey ) -> Self {
@@ -93,8 +94,8 @@ impl OfferBuilder {
93
94
OfferBuilder { offer }
94
95
}
95
96
96
- /// Sets a chain hash of the given [`Network`] for the offer . If not called,
97
- /// [`Network::Bitcoin`] is assumed.
97
+ /// Adds the chain hash of the given [`Network`] to [`Offer::chains`] . If not called,
98
+ /// the chain hash of [`Network::Bitcoin`] is assumed to be the only one supported .
98
99
///
99
100
/// Successive calls to this method will add another chain hash.
100
101
pub fn chain ( mut self , network : Network ) -> Self {
@@ -107,23 +108,23 @@ impl OfferBuilder {
107
108
self
108
109
}
109
110
110
- /// Sets the metadata for the offer. Useful for authentication and validating fields .
111
+ /// Sets the [`Offer:: metadata`] .
111
112
///
112
113
/// Successive calls to this method will override the previous setting.
113
114
pub fn metadata ( mut self , metadata : Vec < u8 > ) -> Self {
114
115
self . offer . metadata = Some ( metadata) ;
115
116
self
116
117
}
117
118
118
- /// Sets the amount for the offer .
119
+ /// Sets the [`Offer:: amount`] .
119
120
///
120
121
/// Successive calls to this method will override the previous setting.
121
122
pub fn amount ( mut self , amount : Amount ) -> Self {
122
123
self . offer . amount = Some ( amount) ;
123
124
self
124
125
}
125
126
126
- /// Sets the features for the offer .
127
+ /// Sets the [`Offer:: features`] .
127
128
///
128
129
/// Successive calls to this method will override the previous setting.
129
130
#[ cfg( test) ]
@@ -132,23 +133,24 @@ impl OfferBuilder {
132
133
self
133
134
}
134
135
135
- /// Sets the absolute expiry for the offer as seconds since the Unix epoch.
136
+ /// Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
137
+ /// already passed is valid and can be checked for using [`Offer::is_expired`].
136
138
///
137
139
/// Successive calls to this method will override the previous setting.
138
140
pub fn absolute_expiry ( mut self , absolute_expiry : Duration ) -> Self {
139
141
self . offer . absolute_expiry = Some ( absolute_expiry) ;
140
142
self
141
143
}
142
144
143
- /// Sets the issuer for the offer .
145
+ /// Sets the [`Offer:: issuer`] .
144
146
///
145
147
/// Successive calls to this method will override the previous setting.
146
148
pub fn issuer ( mut self , issuer : String ) -> Self {
147
149
self . offer . issuer = Some ( issuer) ;
148
150
self
149
151
}
150
152
151
- /// Sets a blinded path for the offer .
153
+ /// Adds a blinded path to [`Offer::paths`] .
152
154
///
153
155
/// Successive calls to this method will add another blinded path. Caller is responsible for not
154
156
/// adding duplicate paths.
@@ -157,7 +159,8 @@ impl OfferBuilder {
157
159
self
158
160
}
159
161
160
- /// Sets a fixed quantity of items for the offer. If not set, `1` is assumed.
162
+ /// Sets a fixed quantity of items for [`Offer::quantity_min`] and [`Offer::quantity_max`]. If
163
+ /// not set, `1` is assumed.
161
164
///
162
165
/// Successive calls to this method or [`quantity_range`] will override the previous setting.
163
166
///
@@ -169,7 +172,8 @@ impl OfferBuilder {
169
172
self
170
173
}
171
174
172
- /// Sets a quantity range of items for the offer. If not set, `1` is assumed.
175
+ /// Sets a quantity range of items for [`Offer::quantity_min`] and [`Offer::quantity_max`]. If
176
+ /// not set, `1` is assumed.
173
177
///
174
178
/// Successive calls to this method or [`quantity_fixed`] will override the previous setting.
175
179
///
0 commit comments