Add InitMessage

This commit is contained in:
NicolasCantu 2025-01-02 10:00:46 +01:00 committed by Nicolas Cantu
parent 7f096ddc62
commit bfd7c6bcda

View File

@ -171,6 +171,28 @@ impl NewTxMessage {
}
}
#[derive(Debug, PartialEq, Serialize, Deserialize, Tsify)]
#[tsify(into_wasm_abi, from_wasm_abi)]
pub struct InitMessage {
pub sp_address: String,
pub peers_list: Option<String>,
pub processes_list: Option<String>,
}
impl InitMessage {
pub fn new(sp_address: String, peers_list: Option<String>, processes_list: Option<String>) -> Self {
Self {
sp_address,
peers_list,
processes_list,
}
}
pub fn to_string(&self) -> String {
serde_json::to_string(self).unwrap()
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Envelope {
pub flag: AnkFlag,