feat(tauri): Allow export of wallet descriptors (#118)

This commit is contained in:
Einliterflasche 2024-10-15 14:22:35 +02:00 committed by GitHub
parent 898c7a2450
commit c91adb3ac8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 141 additions and 11 deletions

View file

@ -346,13 +346,22 @@ impl Request for GetConfig {
}
}
#[typeshare]
#[derive(Serialize, Deserialize, Debug)]
pub struct ExportBitcoinWalletArgs;
#[typeshare]
#[derive(Serialize, Deserialize, Debug)]
pub struct ExportBitcoinWalletResponse {
pub wallet_descriptor: serde_json::Value,
}
impl Request for ExportBitcoinWalletArgs {
type Response = serde_json::Value;
type Response = ExportBitcoinWalletResponse;
async fn request(self, ctx: Arc<Context>) -> Result<Self::Response> {
export_bitcoin_wallet(ctx).await
let wallet_descriptor = export_bitcoin_wallet(ctx).await?;
Ok(ExportBitcoinWalletResponse { wallet_descriptor })
}
}