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:
Mohan 2025-11-02 23:13:28 +01:00 committed by GitHub
parent 7ca9c1442c
commit 1026a51c98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 159 additions and 4 deletions

View file

@ -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>;
}