Skip to content

Commit 96bf1e3

Browse files
docs: add api docs for FeeRate type
1 parent 55e0453 commit 96bf1e3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bdk-ffi/src/bitcoin.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ pub struct FeeRate(pub BdkFeeRate);
125125

126126
#[uniffi::export]
127127
impl FeeRate {
128+
// Constructs `FeeRate` from satoshis per virtual bytes.
128129
#[uniffi::constructor]
129130
pub fn from_sat_per_vb(sat_vb: u64) -> Result<Self, FeeRateError> {
130131
let fee_rate: Option<BdkFeeRate> = BdkFeeRate::from_sat_per_vb(sat_vb);
@@ -134,19 +135,23 @@ impl FeeRate {
134135
}
135136
}
136137

138+
// Constructs `FeeRate` from satoshis per 1000 weight units.
137139
#[uniffi::constructor]
138140
pub fn from_sat_per_kwu(sat_kwu: u64) -> Self {
139141
FeeRate(BdkFeeRate::from_sat_per_kwu(sat_kwu))
140142
}
141143

144+
/// Converts to sat/vB rounding up.
142145
pub fn to_sat_per_vb_ceil(&self) -> u64 {
143146
self.0.to_sat_per_vb_ceil()
144147
}
145148

149+
/// Converts to sat/vB rounding down.
146150
pub fn to_sat_per_vb_floor(&self) -> u64 {
147151
self.0.to_sat_per_vb_floor()
148152
}
149153

154+
/// Returns raw fee rate.
150155
pub fn to_sat_per_kwu(&self) -> u64 {
151156
self.0.to_sat_per_kwu()
152157
}

0 commit comments

Comments
 (0)