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