Add InitMessage
This commit is contained in:
parent
4f9775526e
commit
13957e3e1f
@ -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)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
pub struct Envelope {
|
pub struct Envelope {
|
||||||
pub flag: AnkFlag,
|
pub flag: AnkFlag,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user