pub struct CreateParams { /* private fields */ }Expand description
Parameters for Wallet::create or PersistedWallet::create.
Implementations§
Source§impl CreateParams
impl CreateParams
Sourcepub fn new_single<D: IntoWalletDescriptor + Send + 'static>(
descriptor: D,
) -> Self
pub fn new_single<D: IntoWalletDescriptor + Send + 'static>( descriptor: D, ) -> Self
Construct parameters with provided descriptor.
Default values:
change_descriptor=Nonenetwork=Network::Bitcoingenesis_hash=Nonelookahead=DEFAULT_LOOKAHEAD
Use this method only when building a wallet with a single descriptor. See
also Wallet::create_single.
Sourcepub fn new<D: IntoWalletDescriptor + Send + 'static>(
descriptor: D,
change_descriptor: D,
) -> Self
pub fn new<D: IntoWalletDescriptor + Send + 'static>( descriptor: D, change_descriptor: D, ) -> Self
Construct parameters with provided descriptor and change_descriptor.
Default values:
network=Network::Bitcoingenesis_hash=Nonelookahead=DEFAULT_LOOKAHEAD
Sourcepub fn new_two_path<D: IntoWalletDescriptor + Send + Clone + 'static>(
two_path_descriptor: D,
) -> Self
pub fn new_two_path<D: IntoWalletDescriptor + Send + Clone + 'static>( two_path_descriptor: D, ) -> Self
Construct parameters with a two-path descriptor that will be parsed into receive and change descriptors.
This function parses a two-path descriptor (receive and change) and creates parameters using the existing receive and change wallet creation logic.
Default values:
network=Network::Bitcoingenesis_hash=Nonelookahead=DEFAULT_LOOKAHEAD
Sourcepub fn keymap(self, keychain: KeychainKind, keymap: KeyMap) -> Self
pub fn keymap(self, keychain: KeychainKind, keymap: KeyMap) -> Self
Extend the given keychain’s keymap.
Sourcepub fn genesis_hash(self, genesis_hash: BlockHash) -> Self
pub fn genesis_hash(self, genesis_hash: BlockHash) -> Self
Use a custom genesis_hash.
Sourcepub fn lookahead(self, lookahead: u32) -> Self
pub fn lookahead(self, lookahead: u32) -> Self
Use a custom lookahead value.
The lookahead defines a number of script pubkeys to derive over and above the last
revealed index. Without a lookahead the indexer will miss outputs you own when processing
transactions whose output script pubkeys lie beyond the last revealed index. In most cases
the default value DEFAULT_LOOKAHEAD is sufficient.
Sourcepub fn use_spk_cache(self, use_spk_cache: bool) -> Self
pub fn use_spk_cache(self, use_spk_cache: bool) -> Self
Use a persistent cache of indexed script pubkeys (SPKs).
Note: To persist across restarts, this option must also be set at load time with
LoadParams.
Sourcepub fn create_wallet<P>(
self,
persister: &mut P,
) -> Result<PersistedWallet<P>, CreateWithPersistError<P::Error>>where
P: WalletPersister,
pub fn create_wallet<P>(
self,
persister: &mut P,
) -> Result<PersistedWallet<P>, CreateWithPersistError<P::Error>>where
P: WalletPersister,
Create PersistedWallet with the given WalletPersister.
Sourcepub async fn create_wallet_async<P>(
self,
persister: &mut P,
) -> Result<PersistedWallet<P>, CreateWithPersistError<P::Error>>where
P: AsyncWalletPersister,
pub async fn create_wallet_async<P>(
self,
persister: &mut P,
) -> Result<PersistedWallet<P>, CreateWithPersistError<P::Error>>where
P: AsyncWalletPersister,
Create PersistedWallet with the given AsyncWalletPersister.
Sourcepub fn create_wallet_no_persist(self) -> Result<Wallet, DescriptorError>
pub fn create_wallet_no_persist(self) -> Result<Wallet, DescriptorError>
Create Wallet without persistence.