pub struct SdkBuilder { /* private fields */ }Expand description
Builder for creating BreezSdk instances with customizable components.
Implementations§
Source§impl SdkBuilder
impl SdkBuilder
Sourcepub fn new(config: Config, seed: Seed) -> Self
pub fn new(config: Config, seed: Seed) -> Self
Creates a new SdkBuilder with the provided configuration.
Arguments:
config: The configuration to be used.seed: The seed for wallet generation.
Sourcepub fn with_default_storage(self, storage_dir: String) -> Self
pub fn with_default_storage(self, storage_dir: String) -> Self
Sets the root storage directory to initialize the default storage with. This initializes both storage and real-time sync storage with the default implementations. Arguments:
storage_dir: The data directory for storage.
Sourcepub fn with_storage(self, storage: Arc<dyn Storage>) -> Self
pub fn with_storage(self, storage: Arc<dyn Storage>) -> Self
Sets the storage implementation to be used by the SDK. Arguments:
storage: The storage implementation to be used.
Sourcepub fn with_real_time_sync_storage(self, storage: Arc<dyn SyncStorage>) -> Self
pub fn with_real_time_sync_storage(self, storage: Arc<dyn SyncStorage>) -> Self
Sets the real-time sync storage implementation to be used by the SDK. Arguments:
storage: The sync storage implementation to be used.
Sourcepub fn with_key_set(
self,
key_set_type: KeySetType,
use_address_index: bool,
account_number: Option<u32>,
) -> Self
pub fn with_key_set( self, key_set_type: KeySetType, use_address_index: bool, account_number: Option<u32>, ) -> Self
Sets the key set type to be used by the SDK. Arguments:
key_set_type: The key set type which determines the derivation path.use_address_index: Controls the structure of the BIP derivation path.
Sourcepub fn with_chain_service(
self,
chain_service: Arc<dyn BitcoinChainService>,
) -> Self
pub fn with_chain_service( self, chain_service: Arc<dyn BitcoinChainService>, ) -> Self
Sets the chain service to be used by the SDK. Arguments:
chain_service: The chain service to be used.
Sourcepub fn with_rest_chain_service(
self,
url: String,
credentials: Option<Credentials>,
) -> Self
pub fn with_rest_chain_service( self, url: String, credentials: Option<Credentials>, ) -> Self
Sets the REST chain service to be used by the SDK. Arguments:
url: The base URL of the REST API.credentials: Optional credentials for basic authentication.
Sourcepub fn with_fiat_service(self, fiat_service: Arc<dyn FiatService>) -> Self
pub fn with_fiat_service(self, fiat_service: Arc<dyn FiatService>) -> Self
Sets the fiat service to be used by the SDK. Arguments:
fiat_service: The fiat service to be used.
pub fn with_lnurl_client(self, lnurl_client: Arc<dyn RestClient>) -> Self
pub fn with_lnurl_server_client( self, lnurl_serverclient: Arc<dyn LnurlServerClient>, ) -> Self
Sourcepub fn with_payment_observer(
self,
payment_observer: Arc<dyn PaymentObserver>,
) -> Self
pub fn with_payment_observer( self, payment_observer: Arc<dyn PaymentObserver>, ) -> Self
Sets the payment observer to be used by the SDK. This observer will receive callbacks before outgoing payments for Lightning, Spark and onchain Bitcoin. Arguments:
payment_observer: The payment observer to be used.
Trait Implementations§
Source§impl Clone for SdkBuilder
impl Clone for SdkBuilder
Source§fn clone(&self) -> SdkBuilder
fn clone(&self) -> SdkBuilder
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 SdkBuilder
impl !RefUnwindSafe for SdkBuilder
impl Send for SdkBuilder
impl Sync for SdkBuilder
impl Unpin for SdkBuilder
impl !UnwindSafe for SdkBuilder
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