pub struct Builder<T, S, O> { /* private fields */ }Expand description
Builder pattern for creating a crate::ddk::DlcDevKit process.
Implementationsยง
Sourceยงimpl<T: Transport, S: Storage, O: Oracle> Builder<T, S, O>
impl<T: Transport, S: Storage, O: Oracle> Builder<T, S, O>
Sourcepub fn set_name(&mut self, name: &str) -> &mut Self
pub fn set_name(&mut self, name: &str) -> &mut Self
Set the name of the DDK process. Used as an identifier for the process created.
Creates a directory for the process with the name specifed. All file-based components
will be stored in a directory under the storage path set in the DdkConfig and the name.
If no name is set, defaults to a generated uuid.
Sourcepub fn set_transport(&mut self, transport: Arc<T>) -> &mut Self
pub fn set_transport(&mut self, transport: Arc<T>) -> &mut Self
The communication layer of DDK. Type MUST implement crate::Transport.
Transport sets up listeners, communicates with counterparties, and passes
DLC messages to the Manager.
Sourcepub fn set_storage(&mut self, storage: Arc<S>) -> &mut Self
pub fn set_storage(&mut self, storage: Arc<S>) -> &mut Self
DLC contract storage. Storage is used by the ddk_manager::manager::Manager to create, update, retrieve, and
delete contracts. MUST implement crate::Storage.
Sourcepub fn set_oracle(&mut self, oracle: Arc<O>) -> &mut Self
pub fn set_oracle(&mut self, oracle: Arc<O>) -> &mut Self
Oracle implementation for the ddk_manager::manager::Manager to retrieve oracle attestations and announcements.
MUST implement crate::Oracle.
Sourcepub fn set_contract_address_generator(
&mut self,
contract_address_generator: Arc<dyn AddressGenerator + Send + Sync + 'static>,
) -> &mut Self
pub fn set_contract_address_generator( &mut self, contract_address_generator: Arc<dyn AddressGenerator + Send + Sync + 'static>, ) -> &mut Self
Wallet implementation for the ddk_manager::manager::Manager to retrieve wallet keys and sign transactions.
For now, just uses the DlcDevKitWallet implementation. Optionally can use a custom address generation.
Sourcepub fn set_esplora_host(&mut self, host: String) -> &mut Self
pub fn set_esplora_host(&mut self, host: String) -> &mut Self
Set the esplora server to connect to.
Sourcepub fn set_network(&mut self, network: Network) -> &mut Self
pub fn set_network(&mut self, network: Network) -> &mut Self
Set the network DDK connects to.
Sourcepub fn set_seed_bytes(
&mut self,
seed_config: SeedConfig,
) -> Result<&mut Self, BuilderError>
pub fn set_seed_bytes( &mut self, seed_config: SeedConfig, ) -> Result<&mut Self, BuilderError>
Set the seed bytes for the wallet.
Sourcepub fn set_logger(&mut self, logger: Arc<Logger>) -> &mut Self
pub fn set_logger(&mut self, logger: Arc<Logger>) -> &mut Self
Set the logger for the DDK instance.