feat(swap-controller): Add monero-seed RPC command (#511)

This commit is contained in:
Mohan 2025-08-11 09:48:23 +02:00 committed by GitHub
parent dac835f925
commit 6861f38f16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 37 additions and 2 deletions

View file

@ -3,7 +3,7 @@ mod repl;
use clap::Parser;
use cli::{Cli, Cmd};
use swap_controller_api::AsbApiClient;
use swap_controller_api::{AsbApiClient, MoneroSeedResponse};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
@ -43,6 +43,19 @@ async fn dispatch(cmd: Cmd, client: impl AsbApiClient) -> anyhow::Result<()> {
let response = client.monero_address().await?;
println!("The primary Monero address is {}", response.address);
}
Cmd::MoneroSeed => {
let MoneroSeedResponse {
seed,
restore_height,
} = client.monero_seed().await?;
println!("The seed of the internal Monero wallet is: \n{}", seed);
println!();
println!(
"The restore height of the internal Monero wallet is {}",
restore_height
);
}
Cmd::Multiaddresses => {
let response = client.multiaddresses().await?;
if response.multiaddresses.is_empty() {