mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-17 01:24:02 -05:00
feat(asb): Add registration-status controller cmd (#671)
* feat(asb): Add registration-status controller cmd * fmt * add changelog entry * condense * remove redundant attributes * rename * add comment
This commit is contained in:
parent
7ca9c1442c
commit
1026a51c98
8 changed files with 159 additions and 4 deletions
|
|
@ -33,6 +33,32 @@ pub struct ActiveConnectionsResponse {
|
|||
pub connections: usize,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub enum RendezvousConnectionStatus {
|
||||
Disconnected,
|
||||
Dialling,
|
||||
Connected,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub enum RendezvousRegistrationStatus {
|
||||
RegisterOnNextConnection,
|
||||
Pending,
|
||||
Registered,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub struct RegistrationStatusItem {
|
||||
pub address: String,
|
||||
pub connection: RendezvousConnectionStatus,
|
||||
pub registration: RendezvousRegistrationStatus,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub struct RegistrationStatusResponse {
|
||||
pub registrations: Vec<RegistrationStatusItem>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub struct Swap {
|
||||
pub id: String,
|
||||
|
|
@ -65,4 +91,6 @@ pub trait AsbApi {
|
|||
async fn active_connections(&self) -> Result<ActiveConnectionsResponse, ErrorObjectOwned>;
|
||||
#[method(name = "get_swaps")]
|
||||
async fn get_swaps(&self) -> Result<Vec<Swap>, ErrorObjectOwned>;
|
||||
#[method(name = "registration_status")]
|
||||
async fn registration_status(&self) -> Result<RegistrationStatusResponse, ErrorObjectOwned>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue