Skip to content

Commit a200c15

Browse files
committed
Clarify refund address input docs
1 parent 6760960 commit a200c15

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

lib/core/src/model.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,10 @@ pub struct PayOnchainRequest {
502502
pub struct PrepareRefundRequest {
503503
/// The address where the swap funds are locked up
504504
pub swap_address: String,
505-
/// The address to refund the swap funds to
505+
/// The Bitcoin address to refund to. To ensure a valid address is
506+
/// provided, user input should be validated using
507+
/// [LiquidSdk::parse](crate::sdk::LiquidSdk::parse), and `refund_address`
508+
/// should be obtained from the [BitcoinAddressData] in [InputType::BitcoinAddress].
506509
pub refund_address: String,
507510
/// The fee rate in sat/vB for the refund transaction
508511
pub fee_rate_sat_per_vbyte: u32,
@@ -521,7 +524,10 @@ pub struct PrepareRefundResponse {
521524
pub struct RefundRequest {
522525
/// The address where the swap funds are locked up
523526
pub swap_address: String,
524-
/// The address to refund the swap funds to
527+
/// The Bitcoin address to refund to. To ensure a valid address is
528+
/// provided, user input should be validated using
529+
/// [LiquidSdk::parse](crate::sdk::LiquidSdk::parse), and `refund_address`
530+
/// should be obtained from the [BitcoinAddressData] in [InputType::BitcoinAddress].
525531
pub refund_address: String,
526532
/// The fee rate in sat/vB for the refund transaction
527533
pub fee_rate_sat_per_vbyte: u32,

lib/core/src/sdk.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2203,7 +2203,9 @@ impl LiquidSdk {
22032203
///
22042204
/// * `req` - the [PrepareRefundRequest] containing:
22052205
/// * `swap_address` - the swap address to refund from [RefundableSwap::swap_address]
2206-
/// * `refund_address` - the Bitcoin address to refund to
2206+
/// * `refund_address` - the Bitcoin address to refund to. To ensure a valid address is
2207+
/// provided, user input should be validated using [LiquidSdk::parse], and `refund_address`
2208+
/// should be obtained from the [BitcoinAddressData] in [InputType::BitcoinAddress].
22072209
/// * `fee_rate_sat_per_vbyte` - the fee rate at which to broadcast the refund transaction
22082210
pub async fn prepare_refund(
22092211
&self,
@@ -2230,7 +2232,9 @@ impl LiquidSdk {
22302232
///
22312233
/// * `req` - the [RefundRequest] containing:
22322234
/// * `swap_address` - the swap address to refund from [RefundableSwap::swap_address]
2233-
/// * `refund_address` - the Bitcoin address to refund to
2235+
/// * `refund_address` - the Bitcoin address to refund to. To ensure a valid address is
2236+
/// provided, user input should be validated using [LiquidSdk::parse], and `refund_address`
2237+
/// should be obtained from the [BitcoinAddressData] in [InputType::BitcoinAddress].
22342238
/// * `fee_rate_sat_per_vbyte` - the fee rate at which to broadcast the refund transaction
22352239
pub async fn refund(&self, req: &RefundRequest) -> Result<RefundResponse, PaymentError> {
22362240
let refund_tx_id = self

0 commit comments

Comments
 (0)