pub struct StableBalanceConfig {
pub token_identifier: String,
pub threshold_sats: Option<u64>,
pub max_slippage_bps: Option<u32>,
pub reserved_sats: Option<u64>,
}Expand description
Configuration for automatic conversion of Bitcoin to stable tokens.
When configured, the SDK automatically monitors the Bitcoin balance after each wallet sync. When the balance exceeds the configured threshold plus the reserved amount, the SDK automatically converts the excess balance (above the reserve) to the specified stable token.
When the balance is held in a stable token, Bitcoin payments can still be sent. The SDK automatically detects when there’s not enough Bitcoin balance to cover a payment and auto-populates the token-to-Bitcoin conversion options to facilitate the payment.
Fields§
§token_identifier: StringThe token identifier to convert Bitcoin to (required).
threshold_sats: Option<u64>The minimum sats balance that triggers auto-conversion.
If not provided, uses the minimum from conversion limits. If provided but less than the conversion limit minimum, the limit minimum is used.
max_slippage_bps: Option<u32>Maximum slippage in basis points (1/100 of a percent).
Defaults to 50 bps (0.5%) if not set.
reserved_sats: Option<u64>Amount of sats to keep as Bitcoin and not convert to stable tokens.
This reserve ensures you can send Bitcoin payments without hitting the minimum conversion limit. Defaults to the conversion minimum if not set.
Trait Implementations§
Source§impl Clone for StableBalanceConfig
impl Clone for StableBalanceConfig
Source§fn clone(&self) -> StableBalanceConfig
fn clone(&self) -> StableBalanceConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for StableBalanceConfig
impl RefUnwindSafe for StableBalanceConfig
impl Send for StableBalanceConfig
impl Sync for StableBalanceConfig
impl Unpin for StableBalanceConfig
impl UnwindSafe for StableBalanceConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request