use std::collections::HashMap; use anyhow::{Error, Result}; use serde::{Deserialize, Serialize}; use serde_json::{Map, Value}; use sp_client::bitcoin::OutPoint; use tsify::Tsify; use uuid::Uuid; use wasm_bindgen::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, Tsify)] #[tsify(into_wasm_abi, from_wasm_abi)] pub struct Process { pub uuid: String, pub html: String, pub style: String, pub script: String, pub init_state: Map, pub commited_in: OutPoint, } impl Process { pub fn new( html: String, style: String, script: String, init_state: Map, commited_in: OutPoint, ) -> Self { Self { uuid: Uuid::new_v4().to_string(), html, style, script, init_state, commited_in, } } }