diff --git a/lib/bindings/langs/flutter/breez_sdk_liquid/include/breez_sdk_liquid.h b/lib/bindings/langs/flutter/breez_sdk_liquid/include/breez_sdk_liquid.h index 96d905482..b6c85d8a5 100644 --- a/lib/bindings/langs/flutter/breez_sdk_liquid/include/breez_sdk_liquid.h +++ b/lib/bindings/langs/flutter/breez_sdk_liquid/include/breez_sdk_liquid.h @@ -148,7 +148,7 @@ typedef struct wire_cst_pay_onchain_amount { typedef struct wire_cst_prepare_pay_onchain_request { struct wire_cst_pay_onchain_amount amount; - uint32_t *sat_per_vbyte; + uint32_t *fee_rate_msat_per_vbyte; } wire_cst_prepare_pay_onchain_request; typedef struct wire_cst_prepare_receive_request { @@ -159,7 +159,7 @@ typedef struct wire_cst_prepare_receive_request { typedef struct wire_cst_prepare_refund_request { struct wire_cst_list_prim_u_8_strict *swap_address; struct wire_cst_list_prim_u_8_strict *refund_address; - uint32_t sat_per_vbyte; + uint32_t fee_rate_msat_per_vbyte; } wire_cst_prepare_refund_request; typedef struct wire_cst_prepare_send_request { @@ -182,7 +182,7 @@ typedef struct wire_cst_receive_payment_request { typedef struct wire_cst_refund_request { struct wire_cst_list_prim_u_8_strict *swap_address; struct wire_cst_list_prim_u_8_strict *refund_address; - uint32_t sat_per_vbyte; + uint32_t fee_rate_msat_per_vbyte; } wire_cst_refund_request; typedef struct wire_cst_restore_request { diff --git a/lib/bindings/src/breez_sdk_liquid.udl b/lib/bindings/src/breez_sdk_liquid.udl index b5bc450e5..d8464bf66 100644 --- a/lib/bindings/src/breez_sdk_liquid.udl +++ b/lib/bindings/src/breez_sdk_liquid.udl @@ -419,7 +419,7 @@ interface PayOnchainAmount { dictionary PreparePayOnchainRequest { PayOnchainAmount amount; - u32? sat_per_vbyte = null; + u32? fee_rate_msat_per_vbyte = null; }; dictionary PreparePayOnchainResponse { @@ -519,7 +519,7 @@ dictionary RecommendedFees { dictionary PrepareRefundRequest { string swap_address; string refund_address; - u32 sat_per_vbyte; + u32 fee_rate_msat_per_vbyte; }; dictionary PrepareRefundResponse { @@ -531,7 +531,7 @@ dictionary PrepareRefundResponse { dictionary RefundRequest { string swap_address; string refund_address; - u32 sat_per_vbyte; + u32 fee_rate_msat_per_vbyte; }; dictionary RefundResponse { diff --git a/lib/core/src/frb_generated.rs b/lib/core/src/frb_generated.rs index c9cf6d666..68d9b2230 100644 --- a/lib/core/src/frb_generated.rs +++ b/lib/core/src/frb_generated.rs @@ -3331,10 +3331,10 @@ impl SseDecode for crate::model::PreparePayOnchainRequest { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { let mut var_amount = ::sse_decode(deserializer); - let mut var_satPerVbyte = >::sse_decode(deserializer); + let mut var_feeRateMsatPerVbyte = >::sse_decode(deserializer); return crate::model::PreparePayOnchainRequest { amount: var_amount, - sat_per_vbyte: var_satPerVbyte, + fee_rate_msat_per_vbyte: var_feeRateMsatPerVbyte, }; } } @@ -3384,11 +3384,11 @@ impl SseDecode for crate::model::PrepareRefundRequest { fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { let mut var_swapAddress = ::sse_decode(deserializer); let mut var_refundAddress = ::sse_decode(deserializer); - let mut var_satPerVbyte = ::sse_decode(deserializer); + let mut var_feeRateMsatPerVbyte = ::sse_decode(deserializer); return crate::model::PrepareRefundRequest { swap_address: var_swapAddress, refund_address: var_refundAddress, - sat_per_vbyte: var_satPerVbyte, + fee_rate_msat_per_vbyte: var_feeRateMsatPerVbyte, }; } } @@ -3491,11 +3491,11 @@ impl SseDecode for crate::model::RefundRequest { fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { let mut var_swapAddress = ::sse_decode(deserializer); let mut var_refundAddress = ::sse_decode(deserializer); - let mut var_satPerVbyte = ::sse_decode(deserializer); + let mut var_feeRateMsatPerVbyte = ::sse_decode(deserializer); return crate::model::RefundRequest { swap_address: var_swapAddress, refund_address: var_refundAddress, - sat_per_vbyte: var_satPerVbyte, + fee_rate_msat_per_vbyte: var_feeRateMsatPerVbyte, }; } } @@ -5140,7 +5140,7 @@ impl flutter_rust_bridge::IntoDart for crate::model::PreparePayOnchainRequest { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [ self.amount.into_into_dart().into_dart(), - self.sat_per_vbyte.into_into_dart().into_dart(), + self.fee_rate_msat_per_vbyte.into_into_dart().into_dart(), ] .into_dart() } @@ -5227,7 +5227,7 @@ impl flutter_rust_bridge::IntoDart for crate::model::PrepareRefundRequest { [ self.swap_address.into_into_dart().into_dart(), self.refund_address.into_into_dart().into_dart(), - self.sat_per_vbyte.into_into_dart().into_dart(), + self.fee_rate_msat_per_vbyte.into_into_dart().into_dart(), ] .into_dart() } @@ -5394,7 +5394,7 @@ impl flutter_rust_bridge::IntoDart for crate::model::RefundRequest { [ self.swap_address.into_into_dart().into_dart(), self.refund_address.into_into_dart().into_dart(), - self.sat_per_vbyte.into_into_dart().into_dart(), + self.fee_rate_msat_per_vbyte.into_into_dart().into_dart(), ] .into_dart() } @@ -6829,7 +6829,7 @@ impl SseEncode for crate::model::PreparePayOnchainRequest { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { ::sse_encode(self.amount, serializer); - >::sse_encode(self.sat_per_vbyte, serializer); + >::sse_encode(self.fee_rate_msat_per_vbyte, serializer); } } @@ -6864,7 +6864,7 @@ impl SseEncode for crate::model::PrepareRefundRequest { fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { ::sse_encode(self.swap_address, serializer); ::sse_encode(self.refund_address, serializer); - ::sse_encode(self.sat_per_vbyte, serializer); + ::sse_encode(self.fee_rate_msat_per_vbyte, serializer); } } @@ -6933,7 +6933,7 @@ impl SseEncode for crate::model::RefundRequest { fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { ::sse_encode(self.swap_address, serializer); ::sse_encode(self.refund_address, serializer); - ::sse_encode(self.sat_per_vbyte, serializer); + ::sse_encode(self.fee_rate_msat_per_vbyte, serializer); } } @@ -8474,7 +8474,7 @@ mod io { fn cst_decode(self) -> crate::model::PreparePayOnchainRequest { crate::model::PreparePayOnchainRequest { amount: self.amount.cst_decode(), - sat_per_vbyte: self.sat_per_vbyte.cst_decode(), + fee_rate_msat_per_vbyte: self.fee_rate_msat_per_vbyte.cst_decode(), } } } @@ -8513,7 +8513,7 @@ mod io { crate::model::PrepareRefundRequest { swap_address: self.swap_address.cst_decode(), refund_address: self.refund_address.cst_decode(), - sat_per_vbyte: self.sat_per_vbyte.cst_decode(), + fee_rate_msat_per_vbyte: self.fee_rate_msat_per_vbyte.cst_decode(), } } } @@ -8590,7 +8590,7 @@ mod io { crate::model::RefundRequest { swap_address: self.swap_address.cst_decode(), refund_address: self.refund_address.cst_decode(), - sat_per_vbyte: self.sat_per_vbyte.cst_decode(), + fee_rate_msat_per_vbyte: self.fee_rate_msat_per_vbyte.cst_decode(), } } } @@ -9464,7 +9464,7 @@ mod io { fn new_with_null_ptr() -> Self { Self { amount: Default::default(), - sat_per_vbyte: core::ptr::null_mut(), + fee_rate_msat_per_vbyte: core::ptr::null_mut(), } } } @@ -9519,7 +9519,7 @@ mod io { Self { swap_address: core::ptr::null_mut(), refund_address: core::ptr::null_mut(), - sat_per_vbyte: Default::default(), + fee_rate_msat_per_vbyte: Default::default(), } } } @@ -9628,7 +9628,7 @@ mod io { Self { swap_address: core::ptr::null_mut(), refund_address: core::ptr::null_mut(), - sat_per_vbyte: Default::default(), + fee_rate_msat_per_vbyte: Default::default(), } } } @@ -11382,7 +11382,7 @@ mod io { #[derive(Clone, Copy)] pub struct wire_cst_prepare_pay_onchain_request { amount: wire_cst_pay_onchain_amount, - sat_per_vbyte: *mut u32, + fee_rate_msat_per_vbyte: *mut u32, } #[repr(C)] #[derive(Clone, Copy)] @@ -11409,7 +11409,7 @@ mod io { pub struct wire_cst_prepare_refund_request { swap_address: *mut wire_cst_list_prim_u_8_strict, refund_address: *mut wire_cst_list_prim_u_8_strict, - sat_per_vbyte: u32, + fee_rate_msat_per_vbyte: u32, } #[repr(C)] #[derive(Clone, Copy)] @@ -11462,7 +11462,7 @@ mod io { pub struct wire_cst_refund_request { swap_address: *mut wire_cst_list_prim_u_8_strict, refund_address: *mut wire_cst_list_prim_u_8_strict, - sat_per_vbyte: u32, + fee_rate_msat_per_vbyte: u32, } #[repr(C)] #[derive(Clone, Copy)] diff --git a/lib/core/src/model.rs b/lib/core/src/model.rs index 0a57b91a1..4ff206152 100644 --- a/lib/core/src/model.rs +++ b/lib/core/src/model.rs @@ -332,8 +332,8 @@ pub enum PayOnchainAmount { #[derive(Debug, Serialize, Clone)] pub struct PreparePayOnchainRequest { pub amount: PayOnchainAmount, - /// The optional fee rate of the Bitcoin claim transaction. Defaults to the swapper estimated claim fee. - pub sat_per_vbyte: Option, + /// The optional fee rate of the Bitcoin claim transaction in msat/vB. Defaults to the swapper estimated claim fee. + pub fee_rate_msat_per_vbyte: Option, } /// Returned when calling [crate::sdk::LiquidSdk::prepare_pay_onchain]. diff --git a/lib/core/src/sdk.rs b/lib/core/src/sdk.rs index 320a60de2..674305163 100644 --- a/lib/core/src/sdk.rs +++ b/lib/core/src/sdk.rs @@ -1099,7 +1099,7 @@ impl LiquidSdk { let balance_sat = self.get_info().await?.balance_sat; let pair = self.get_chain_pair(Direction::Outgoing)?; - let claim_fees_sat = match req.sat_per_vbyte { + let claim_fees_sat = match req.fee_rate_msat_per_vbyte { Some(sat_per_vbyte) => ESTIMATED_BTC_CLAIM_TX_VSIZE * sat_per_vbyte as u64, None => pair.clone().fees.claim_estimate(), }; diff --git a/packages/dart/lib/src/frb_generated.dart b/packages/dart/lib/src/frb_generated.dart index 7789cde5c..67cf45276 100644 --- a/packages/dart/lib/src/frb_generated.dart +++ b/packages/dart/lib/src/frb_generated.dart @@ -2393,7 +2393,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { if (arr.length != 2) throw Exception('unexpected arr length: expect 2 but see ${arr.length}'); return PreparePayOnchainRequest( amount: dco_decode_pay_onchain_amount(arr[0]), - satPerVbyte: dco_decode_opt_box_autoadd_u_32(arr[1]), + feeRateMsatPerVbyte: dco_decode_opt_box_autoadd_u_32(arr[1]), ); } @@ -2440,7 +2440,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return PrepareRefundRequest( swapAddress: dco_decode_String(arr[0]), refundAddress: dco_decode_String(arr[1]), - satPerVbyte: dco_decode_u_32(arr[2]), + feeRateMsatPerVbyte: dco_decode_u_32(arr[2]), ); } @@ -2533,7 +2533,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return RefundRequest( swapAddress: dco_decode_String(arr[0]), refundAddress: dco_decode_String(arr[1]), - satPerVbyte: dco_decode_u_32(arr[2]), + feeRateMsatPerVbyte: dco_decode_u_32(arr[2]), ); } @@ -4097,8 +4097,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { PreparePayOnchainRequest sse_decode_prepare_pay_onchain_request(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_amount = sse_decode_pay_onchain_amount(deserializer); - var var_satPerVbyte = sse_decode_opt_box_autoadd_u_32(deserializer); - return PreparePayOnchainRequest(amount: var_amount, satPerVbyte: var_satPerVbyte); + var var_feeRateMsatPerVbyte = sse_decode_opt_box_autoadd_u_32(deserializer); + return PreparePayOnchainRequest(amount: var_amount, feeRateMsatPerVbyte: var_feeRateMsatPerVbyte); } @protected @@ -4136,9 +4136,11 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { // Codec=Sse (Serialization based), see doc to use other codecs var var_swapAddress = sse_decode_String(deserializer); var var_refundAddress = sse_decode_String(deserializer); - var var_satPerVbyte = sse_decode_u_32(deserializer); + var var_feeRateMsatPerVbyte = sse_decode_u_32(deserializer); return PrepareRefundRequest( - swapAddress: var_swapAddress, refundAddress: var_refundAddress, satPerVbyte: var_satPerVbyte); + swapAddress: var_swapAddress, + refundAddress: var_refundAddress, + feeRateMsatPerVbyte: var_feeRateMsatPerVbyte); } @protected @@ -4214,9 +4216,11 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { // Codec=Sse (Serialization based), see doc to use other codecs var var_swapAddress = sse_decode_String(deserializer); var var_refundAddress = sse_decode_String(deserializer); - var var_satPerVbyte = sse_decode_u_32(deserializer); + var var_feeRateMsatPerVbyte = sse_decode_u_32(deserializer); return RefundRequest( - swapAddress: var_swapAddress, refundAddress: var_refundAddress, satPerVbyte: var_satPerVbyte); + swapAddress: var_swapAddress, + refundAddress: var_refundAddress, + feeRateMsatPerVbyte: var_feeRateMsatPerVbyte); } @protected @@ -5694,7 +5698,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { void sse_encode_prepare_pay_onchain_request(PreparePayOnchainRequest self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_pay_onchain_amount(self.amount, serializer); - sse_encode_opt_box_autoadd_u_32(self.satPerVbyte, serializer); + sse_encode_opt_box_autoadd_u_32(self.feeRateMsatPerVbyte, serializer); } @protected @@ -5725,7 +5729,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_String(self.swapAddress, serializer); sse_encode_String(self.refundAddress, serializer); - sse_encode_u_32(self.satPerVbyte, serializer); + sse_encode_u_32(self.feeRateMsatPerVbyte, serializer); } @protected @@ -5786,7 +5790,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_String(self.swapAddress, serializer); sse_encode_String(self.refundAddress, serializer); - sse_encode_u_32(self.satPerVbyte, serializer); + sse_encode_u_32(self.feeRateMsatPerVbyte, serializer); } @protected diff --git a/packages/dart/lib/src/frb_generated.io.dart b/packages/dart/lib/src/frb_generated.io.dart index dfb700e4a..8566073b2 100644 --- a/packages/dart/lib/src/frb_generated.io.dart +++ b/packages/dart/lib/src/frb_generated.io.dart @@ -2462,7 +2462,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { void cst_api_fill_to_wire_prepare_pay_onchain_request( PreparePayOnchainRequest apiObj, wire_cst_prepare_pay_onchain_request wireObj) { cst_api_fill_to_wire_pay_onchain_amount(apiObj.amount, wireObj.amount); - wireObj.sat_per_vbyte = cst_encode_opt_box_autoadd_u_32(apiObj.satPerVbyte); + wireObj.fee_rate_msat_per_vbyte = cst_encode_opt_box_autoadd_u_32(apiObj.feeRateMsatPerVbyte); } @protected @@ -2493,7 +2493,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { PrepareRefundRequest apiObj, wire_cst_prepare_refund_request wireObj) { wireObj.swap_address = cst_encode_String(apiObj.swapAddress); wireObj.refund_address = cst_encode_String(apiObj.refundAddress); - wireObj.sat_per_vbyte = cst_encode_u_32(apiObj.satPerVbyte); + wireObj.fee_rate_msat_per_vbyte = cst_encode_u_32(apiObj.feeRateMsatPerVbyte); } @protected @@ -2551,7 +2551,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { void cst_api_fill_to_wire_refund_request(RefundRequest apiObj, wire_cst_refund_request wireObj) { wireObj.swap_address = cst_encode_String(apiObj.swapAddress); wireObj.refund_address = cst_encode_String(apiObj.refundAddress); - wireObj.sat_per_vbyte = cst_encode_u_32(apiObj.satPerVbyte); + wireObj.fee_rate_msat_per_vbyte = cst_encode_u_32(apiObj.feeRateMsatPerVbyte); } @protected @@ -4777,7 +4777,7 @@ final class wire_cst_pay_onchain_amount extends ffi.Struct { final class wire_cst_prepare_pay_onchain_request extends ffi.Struct { external wire_cst_pay_onchain_amount amount; - external ffi.Pointer sat_per_vbyte; + external ffi.Pointer fee_rate_msat_per_vbyte; } final class wire_cst_prepare_receive_request extends ffi.Struct { @@ -4793,7 +4793,7 @@ final class wire_cst_prepare_refund_request extends ffi.Struct { external ffi.Pointer refund_address; @ffi.Uint32() - external int sat_per_vbyte; + external int fee_rate_msat_per_vbyte; } final class wire_cst_prepare_send_request extends ffi.Struct { @@ -4826,7 +4826,7 @@ final class wire_cst_refund_request extends ffi.Struct { external ffi.Pointer refund_address; @ffi.Uint32() - external int sat_per_vbyte; + external int fee_rate_msat_per_vbyte; } final class wire_cst_restore_request extends ffi.Struct { diff --git a/packages/dart/lib/src/model.dart b/packages/dart/lib/src/model.dart index 5429a0103..4e593acb3 100644 --- a/packages/dart/lib/src/model.dart +++ b/packages/dart/lib/src/model.dart @@ -716,16 +716,16 @@ class PrepareBuyBitcoinResponse { class PreparePayOnchainRequest { final PayOnchainAmount amount; - /// The optional fee rate of the Bitcoin claim transaction. Defaults to the swapper estimated claim fee. - final int? satPerVbyte; + /// The optional fee rate of the Bitcoin claim transaction in msat/vB. Defaults to the swapper estimated claim fee. + final int? feeRateMsatPerVbyte; const PreparePayOnchainRequest({ required this.amount, - this.satPerVbyte, + this.feeRateMsatPerVbyte, }); @override - int get hashCode => amount.hashCode ^ satPerVbyte.hashCode; + int get hashCode => amount.hashCode ^ feeRateMsatPerVbyte.hashCode; @override bool operator ==(Object other) => @@ -733,7 +733,7 @@ class PreparePayOnchainRequest { other is PreparePayOnchainRequest && runtimeType == other.runtimeType && amount == other.amount && - satPerVbyte == other.satPerVbyte; + feeRateMsatPerVbyte == other.feeRateMsatPerVbyte; } /// Returned when calling [crate::sdk::LiquidSdk::prepare_pay_onchain]. @@ -816,17 +816,17 @@ class PrepareRefundRequest { /// The address to refund the swap funds to final String refundAddress; - /// The fee rate in sat/vB for the refund transaction - final int satPerVbyte; + /// The fee rate in msat/vB for the refund transaction + final int feeRateMsatPerVbyte; const PrepareRefundRequest({ required this.swapAddress, required this.refundAddress, - required this.satPerVbyte, + required this.feeRateMsatPerVbyte, }); @override - int get hashCode => swapAddress.hashCode ^ refundAddress.hashCode ^ satPerVbyte.hashCode; + int get hashCode => swapAddress.hashCode ^ refundAddress.hashCode ^ feeRateMsatPerVbyte.hashCode; @override bool operator ==(Object other) => @@ -835,7 +835,7 @@ class PrepareRefundRequest { runtimeType == other.runtimeType && swapAddress == other.swapAddress && refundAddress == other.refundAddress && - satPerVbyte == other.satPerVbyte; + feeRateMsatPerVbyte == other.feeRateMsatPerVbyte; } /// Returned when calling [crate::sdk::LiquidSdk::prepare_refund]. @@ -1004,17 +1004,17 @@ class RefundRequest { /// The address to refund the swap funds to final String refundAddress; - /// The fee rate in sat/vB for the refund transaction - final int satPerVbyte; + /// The fee rate in msat/vB for the refund transaction + final int feeRateMsatPerVbyte; const RefundRequest({ required this.swapAddress, required this.refundAddress, - required this.satPerVbyte, + required this.feeRateMsatPerVbyte, }); @override - int get hashCode => swapAddress.hashCode ^ refundAddress.hashCode ^ satPerVbyte.hashCode; + int get hashCode => swapAddress.hashCode ^ refundAddress.hashCode ^ feeRateMsatPerVbyte.hashCode; @override bool operator ==(Object other) => @@ -1023,7 +1023,7 @@ class RefundRequest { runtimeType == other.runtimeType && swapAddress == other.swapAddress && refundAddress == other.refundAddress && - satPerVbyte == other.satPerVbyte; + feeRateMsatPerVbyte == other.feeRateMsatPerVbyte; } /// Returned when calling [crate::sdk::LiquidSdk::refund]. diff --git a/packages/flutter/lib/flutter_breez_liquid_bindings_generated.dart b/packages/flutter/lib/flutter_breez_liquid_bindings_generated.dart index 8797523a6..60c3c1f1b 100644 --- a/packages/flutter/lib/flutter_breez_liquid_bindings_generated.dart +++ b/packages/flutter/lib/flutter_breez_liquid_bindings_generated.dart @@ -1594,7 +1594,7 @@ final class wire_cst_pay_onchain_amount extends ffi.Struct { final class wire_cst_prepare_pay_onchain_request extends ffi.Struct { external wire_cst_pay_onchain_amount amount; - external ffi.Pointer sat_per_vbyte; + external ffi.Pointer fee_rate_msat_per_vbyte; } final class wire_cst_prepare_receive_request extends ffi.Struct { @@ -1610,7 +1610,7 @@ final class wire_cst_prepare_refund_request extends ffi.Struct { external ffi.Pointer refund_address; @ffi.Uint32() - external int sat_per_vbyte; + external int fee_rate_msat_per_vbyte; } final class wire_cst_prepare_send_request extends ffi.Struct { @@ -1643,7 +1643,7 @@ final class wire_cst_refund_request extends ffi.Struct { external ffi.Pointer refund_address; @ffi.Uint32() - external int sat_per_vbyte; + external int fee_rate_msat_per_vbyte; } final class wire_cst_restore_request extends ffi.Struct { diff --git a/packages/react-native/android/src/main/java/com/breezsdkliquid/BreezSDKLiquidMapper.kt b/packages/react-native/android/src/main/java/com/breezsdkliquid/BreezSDKLiquidMapper.kt index 630cc69fc..86c4334be 100644 --- a/packages/react-native/android/src/main/java/com/breezsdkliquid/BreezSDKLiquidMapper.kt +++ b/packages/react-native/android/src/main/java/com/breezsdkliquid/BreezSDKLiquidMapper.kt @@ -1340,23 +1340,23 @@ fun asPreparePayOnchainRequest(preparePayOnchainRequest: ReadableMap): PreparePa return null } val amount = preparePayOnchainRequest.getMap("amount")?.let { asPayOnchainAmount(it) }!! - val satPerVbyte = + val feeRateMsatPerVbyte = if (hasNonNullKey( preparePayOnchainRequest, - "satPerVbyte", + "feeRateMsatPerVbyte", ) ) { - preparePayOnchainRequest.getInt("satPerVbyte").toUInt() + preparePayOnchainRequest.getInt("feeRateMsatPerVbyte").toUInt() } else { null } - return PreparePayOnchainRequest(amount, satPerVbyte) + return PreparePayOnchainRequest(amount, feeRateMsatPerVbyte) } fun readableMapOf(preparePayOnchainRequest: PreparePayOnchainRequest): ReadableMap = readableMapOf( "amount" to readableMapOf(preparePayOnchainRequest.amount), - "satPerVbyte" to preparePayOnchainRequest.satPerVbyte, + "feeRateMsatPerVbyte" to preparePayOnchainRequest.feeRateMsatPerVbyte, ) fun asPreparePayOnchainRequestList(arr: ReadableArray): List { @@ -1497,7 +1497,7 @@ fun asPrepareRefundRequest(prepareRefundRequest: ReadableMap): PrepareRefundRequ arrayOf( "swapAddress", "refundAddress", - "satPerVbyte", + "feeRateMsatPerVbyte", ), ) ) { @@ -1505,15 +1505,15 @@ fun asPrepareRefundRequest(prepareRefundRequest: ReadableMap): PrepareRefundRequ } val swapAddress = prepareRefundRequest.getString("swapAddress")!! val refundAddress = prepareRefundRequest.getString("refundAddress")!! - val satPerVbyte = prepareRefundRequest.getInt("satPerVbyte").toUInt() - return PrepareRefundRequest(swapAddress, refundAddress, satPerVbyte) + val feeRateMsatPerVbyte = prepareRefundRequest.getInt("feeRateMsatPerVbyte").toUInt() + return PrepareRefundRequest(swapAddress, refundAddress, feeRateMsatPerVbyte) } fun readableMapOf(prepareRefundRequest: PrepareRefundRequest): ReadableMap = readableMapOf( "swapAddress" to prepareRefundRequest.swapAddress, "refundAddress" to prepareRefundRequest.refundAddress, - "satPerVbyte" to prepareRefundRequest.satPerVbyte, + "feeRateMsatPerVbyte" to prepareRefundRequest.feeRateMsatPerVbyte, ) fun asPrepareRefundRequestList(arr: ReadableArray): List { @@ -1781,7 +1781,7 @@ fun asRefundRequest(refundRequest: ReadableMap): RefundRequest? { arrayOf( "swapAddress", "refundAddress", - "satPerVbyte", + "feeRateMsatPerVbyte", ), ) ) { @@ -1789,15 +1789,15 @@ fun asRefundRequest(refundRequest: ReadableMap): RefundRequest? { } val swapAddress = refundRequest.getString("swapAddress")!! val refundAddress = refundRequest.getString("refundAddress")!! - val satPerVbyte = refundRequest.getInt("satPerVbyte").toUInt() - return RefundRequest(swapAddress, refundAddress, satPerVbyte) + val feeRateMsatPerVbyte = refundRequest.getInt("feeRateMsatPerVbyte").toUInt() + return RefundRequest(swapAddress, refundAddress, feeRateMsatPerVbyte) } fun readableMapOf(refundRequest: RefundRequest): ReadableMap = readableMapOf( "swapAddress" to refundRequest.swapAddress, "refundAddress" to refundRequest.refundAddress, - "satPerVbyte" to refundRequest.satPerVbyte, + "feeRateMsatPerVbyte" to refundRequest.feeRateMsatPerVbyte, ) fun asRefundRequestList(arr: ReadableArray): List { diff --git a/packages/react-native/ios/BreezSDKLiquidMapper.swift b/packages/react-native/ios/BreezSDKLiquidMapper.swift index ac0aec68d..d0f130b98 100644 --- a/packages/react-native/ios/BreezSDKLiquidMapper.swift +++ b/packages/react-native/ios/BreezSDKLiquidMapper.swift @@ -1584,21 +1584,21 @@ enum BreezSDKLiquidMapper { } let amount = try asPayOnchainAmount(payOnchainAmount: amountTmp) - var satPerVbyte: UInt32? - if hasNonNilKey(data: preparePayOnchainRequest, key: "satPerVbyte") { - guard let satPerVbyteTmp = preparePayOnchainRequest["satPerVbyte"] as? UInt32 else { - throw SdkError.Generic(message: errUnexpectedValue(fieldName: "satPerVbyte")) + var feeRateMsatPerVbyte: UInt32? + if hasNonNilKey(data: preparePayOnchainRequest, key: "feeRateMsatPerVbyte") { + guard let feeRateMsatPerVbyteTmp = preparePayOnchainRequest["feeRateMsatPerVbyte"] as? UInt32 else { + throw SdkError.Generic(message: errUnexpectedValue(fieldName: "feeRateMsatPerVbyte")) } - satPerVbyte = satPerVbyteTmp + feeRateMsatPerVbyte = feeRateMsatPerVbyteTmp } - return PreparePayOnchainRequest(amount: amount, satPerVbyte: satPerVbyte) + return PreparePayOnchainRequest(amount: amount, feeRateMsatPerVbyte: feeRateMsatPerVbyte) } static func dictionaryOf(preparePayOnchainRequest: PreparePayOnchainRequest) -> [String: Any?] { return [ "amount": dictionaryOf(payOnchainAmount: preparePayOnchainRequest.amount), - "satPerVbyte": preparePayOnchainRequest.satPerVbyte == nil ? nil : preparePayOnchainRequest.satPerVbyte, + "feeRateMsatPerVbyte": preparePayOnchainRequest.feeRateMsatPerVbyte == nil ? nil : preparePayOnchainRequest.feeRateMsatPerVbyte, ] } @@ -1751,18 +1751,18 @@ enum BreezSDKLiquidMapper { guard let refundAddress = prepareRefundRequest["refundAddress"] as? String else { throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "refundAddress", typeName: "PrepareRefundRequest")) } - guard let satPerVbyte = prepareRefundRequest["satPerVbyte"] as? UInt32 else { - throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "satPerVbyte", typeName: "PrepareRefundRequest")) + guard let feeRateMsatPerVbyte = prepareRefundRequest["feeRateMsatPerVbyte"] as? UInt32 else { + throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "feeRateMsatPerVbyte", typeName: "PrepareRefundRequest")) } - return PrepareRefundRequest(swapAddress: swapAddress, refundAddress: refundAddress, satPerVbyte: satPerVbyte) + return PrepareRefundRequest(swapAddress: swapAddress, refundAddress: refundAddress, feeRateMsatPerVbyte: feeRateMsatPerVbyte) } static func dictionaryOf(prepareRefundRequest: PrepareRefundRequest) -> [String: Any?] { return [ "swapAddress": prepareRefundRequest.swapAddress, "refundAddress": prepareRefundRequest.refundAddress, - "satPerVbyte": prepareRefundRequest.satPerVbyte, + "feeRateMsatPerVbyte": prepareRefundRequest.feeRateMsatPerVbyte, ] } @@ -2071,18 +2071,18 @@ enum BreezSDKLiquidMapper { guard let refundAddress = refundRequest["refundAddress"] as? String else { throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "refundAddress", typeName: "RefundRequest")) } - guard let satPerVbyte = refundRequest["satPerVbyte"] as? UInt32 else { - throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "satPerVbyte", typeName: "RefundRequest")) + guard let feeRateMsatPerVbyte = refundRequest["feeRateMsatPerVbyte"] as? UInt32 else { + throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "feeRateMsatPerVbyte", typeName: "RefundRequest")) } - return RefundRequest(swapAddress: swapAddress, refundAddress: refundAddress, satPerVbyte: satPerVbyte) + return RefundRequest(swapAddress: swapAddress, refundAddress: refundAddress, feeRateMsatPerVbyte: feeRateMsatPerVbyte) } static func dictionaryOf(refundRequest: RefundRequest) -> [String: Any?] { return [ "swapAddress": refundRequest.swapAddress, "refundAddress": refundRequest.refundAddress, - "satPerVbyte": refundRequest.satPerVbyte, + "feeRateMsatPerVbyte": refundRequest.feeRateMsatPerVbyte, ] } diff --git a/packages/react-native/src/index.ts b/packages/react-native/src/index.ts index c2a96d925..8611774a0 100644 --- a/packages/react-native/src/index.ts +++ b/packages/react-native/src/index.ts @@ -246,7 +246,7 @@ export interface PrepareBuyBitcoinResponse { export interface PreparePayOnchainRequest { amount: PayOnchainAmount - satPerVbyte?: number + feeRateMsatPerVbyte?: number } export interface PreparePayOnchainResponse { @@ -269,7 +269,7 @@ export interface PrepareReceiveResponse { export interface PrepareRefundRequest { swapAddress: string refundAddress: string - satPerVbyte: number + feeRateMsatPerVbyte: number } export interface PrepareRefundResponse { @@ -314,7 +314,7 @@ export interface RecommendedFees { export interface RefundRequest { swapAddress: string refundAddress: string - satPerVbyte: number + feeRateMsatPerVbyte: number } export interface RefundResponse {