pub(crate) fn setup_wallet(
	private_key: PrivateKey,
) -> SBTCResult<Wallet<MemoryDatabase>> {
	let blockchain = init_blockchain()?;

	let wallet = Wallet::new(
		P2Wpkh(private_key),
		Some(P2Wpkh(private_key)),
		private_key.network,
		MemoryDatabase::default(),
	)
	.map_err(|err| SBTCError::BDKError("Could not open wallet", err))?;

	wallet
		.sync(&blockchain, SyncOptions::default())
		.map_err(|err| SBTCError::BDKError("Could not sync wallet", err))?;

	Ok(wallet)
}
Set up an electrum wallet for sBTC operations
sbtc-core/src/operations/utils.rs