pub struct Config {Show 16 fields
pub api_key: Option<String>,
pub network: Network,
pub sync_interval_secs: u32,
pub max_deposit_claim_fee: Option<MaxFee>,
pub lnurl_domain: Option<String>,
pub prefer_spark_over_lightning: bool,
pub external_input_parsers: Option<Vec<ExternalInputParser>>,
pub use_default_external_input_parsers: bool,
pub real_time_sync_server_url: Option<String>,
pub private_enabled_default: bool,
pub leaf_optimization_config: LeafOptimizationConfig,
pub token_optimization_config: TokenOptimizationConfig,
pub stable_balance_config: Option<StableBalanceConfig>,
pub max_concurrent_claims: u32,
pub spark_config: Option<SparkConfig>,
pub background_tasks_enabled: bool,
}Fields§
§api_key: Option<String>§network: Network§sync_interval_secs: u32§max_deposit_claim_fee: Option<MaxFee>§lnurl_domain: Option<String>The domain used for receiving through lnurl-pay and lightning address.
prefer_spark_over_lightning: boolWhen this is set to true we will prefer to use spark payments over
lightning when sending and receiving. This has the benefit of lower fees
but is at the cost of privacy.
external_input_parsers: Option<Vec<ExternalInputParser>>A set of external input parsers that are used by BreezSdk::parse when the input
is not recognized. See ExternalInputParser for more details on how to configure
external parsing.
use_default_external_input_parsers: boolThe SDK includes some default external input parsers
(DEFAULT_EXTERNAL_INPUT_PARSERS).
Set this to false in order to prevent their use.
real_time_sync_server_url: Option<String>Url to use for the real-time sync server. Defaults to the Breez real-time sync server.
private_enabled_default: boolWhether the Spark private mode is enabled by default.
If set to true, the Spark private mode will be enabled on the first initialization of the SDK. If set to false, no changes will be made to the Spark private mode.
This default is only auto-applied when background_tasks_enabled is
true. When background_tasks_enabled is false, the SDK does not
touch the Spark private mode on startup; call update_user_settings
with spark_private_mode_enabled set as needed on a one-time setup
pass.
leaf_optimization_config: LeafOptimizationConfigConfiguration for leaf optimization.
Leaf optimization controls the denominations of leaves that are held in the wallet. Fewer, bigger leaves allow for more funds to be exited unilaterally. More leaves allow payments to be made without needing a swap, reducing payment latency.
token_optimization_config: TokenOptimizationConfigConfiguration for token-output optimization.
Token-output optimization controls automatic consolidation of a token’s available outputs. Keeping the output set small reduces transaction size, while keeping enough distinct outputs preserves concurrency for parallel sends.
stable_balance_config: Option<StableBalanceConfig>Configuration for automatic conversion of Bitcoin to stable tokens.
When set, received sats will be automatically converted to the specified token once the balance exceeds the threshold.
max_concurrent_claims: u32Maximum number of concurrent transfer claims.
Default is 4. Increase for server environments with high incoming payment volume.
spark_config: Option<SparkConfig>Optional custom Spark environment configuration.
When set, overrides the default Spark operator pool, service provider, threshold, and token settings. Use this to connect to alternative Spark deployments (e.g. dev/staging environments).
background_tasks_enabled: boolMaster switch for per-instance background services.
When true (default), the SDK runs its standard background work:
periodic sync, lightning-address recovery, private-mode initialization,
the leaf and token-output optimizers, the Spark server-event
subscription, and the real-time sync client (when
real_time_sync_server_url is set).
When false, no background service is started, regardless of any
other setting on this config. This is intended for multi-tenant server
deployments where the host application orchestrates sync and claims
explicitly and receives events via webhooks. Use
default_server_config to get this preset.
Explicit operations (sync_wallet, claim_deposit,
list_unclaimed_deposits, refund_deposit,
refund_pending_conversions, leaf/token optimization, etc.) work
regardless of this flag.
When false, the SDK rejects builds where fields whose backing
service is gated off are still in their active shape:
stable_balance_config must be None, real_time_sync_server_url
must be None, and optimization_config.auto_enabled must be false.
default_server_config already sets these compatible values.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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