feat(gui): Allow to select from recently used monero addresses (#139)

* feat(gui): Allow user to select from recently used monero addresses in textfield
This commit is contained in:
binarybaron 2024-11-09 12:11:00 +01:00 committed by GitHub
parent 4867d2713f
commit bd3fca7e41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 271 additions and 78 deletions

View file

@ -416,6 +416,26 @@ impl Request for GetLogsArgs {
}
}
#[typeshare]
#[derive(Debug, Eq, PartialEq, Serialize, Deserialize)]
pub struct GetMoneroAddressesArgs;
#[typeshare]
#[derive(Serialize, Deserialize, Debug)]
pub struct GetMoneroAddressesResponse {
#[typeshare(serialized_as = "Vec<String>")]
pub addresses: Vec<monero::Address>,
}
impl Request for GetMoneroAddressesArgs {
type Response = GetMoneroAddressesResponse;
async fn request(self, ctx: Arc<Context>) -> Result<Self::Response> {
let addresses = ctx.db.get_monero_addresses().await?;
Ok(GetMoneroAddressesResponse { addresses })
}
}
#[tracing::instrument(fields(method = "suspend_current_swap"), skip(context))]
pub async fn suspend_current_swap(context: Arc<Context>) -> Result<SuspendCurrentSwapResponse> {
let swap_id = context.swap_lock.get_current_swap_id().await;