pub struct StableBalanceConfig {
pub tokens: Vec<StableBalanceToken>,
pub default_active_label: Option<String>,
pub threshold_sats: Option<u64>,
pub max_slippage_bps: Option<u32>,
}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 active 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.
The active token can be changed at runtime via UpdateUserSettingsRequest.
Fields§
§tokens: Vec<StableBalanceToken>Available tokens that can be used for stable balance.
default_active_label: Option<String>The label of the token to activate by default.
If None, stable balance starts deactivated. The user can activate it
at runtime via UpdateUserSettingsRequest. If a user setting is cached
locally, it takes precedence over this default.
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 10 bps (0.1%) 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§
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