whisky_js/models/
deserialized_address.rs

1use crate::*;
2
3#[wasm_bindgen]
4#[derive(Clone, Debug, Eq, Hash, PartialEq)]
5pub struct WasmDeserializedAddress {
6    pub_key_hash: String,
7    script_hash: String,
8    stake_key_hash: String,
9    stake_key_script_hash: String,
10}
11
12#[wasm_bindgen]
13impl WasmDeserializedAddress {
14    pub fn new(
15        pub_key_hash: &str,
16        script_hash: &str,
17        stake_key_hash: &str,
18        stake_key_script_hash: &str,
19    ) -> Self {
20        Self {
21            pub_key_hash: pub_key_hash.to_string(),
22            script_hash: script_hash.to_string(),
23            stake_key_hash: stake_key_hash.to_string(),
24            stake_key_script_hash: stake_key_script_hash.to_string(),
25        }
26    }
27
28    pub fn get_pub_key_hash(&self) -> String {
29        self.pub_key_hash.clone()
30    }
31
32    pub fn get_script_hash(&self) -> String {
33        self.script_hash.clone()
34    }
35
36    pub fn get_stake_key_hash(&self) -> String {
37        self.stake_key_hash.clone()
38    }
39
40    pub fn get_stake_key_script_hash(&self) -> String {
41        self.stake_key_script_hash.clone()
42    }
43}