diff --git a/src/utils.rs b/src/utils.rs index 25b754b..39c2dd6 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -42,7 +42,6 @@ macro_rules! pub_struct { } } } - pub async fn get_nft( quest_id: u32, @@ -826,4 +825,18 @@ impl Clone for Box { fn clone(&self) -> Box { self.box_clone() } -} \ No newline at end of file +} + +pub fn parse_string(input: &str, address: FieldElement) -> String { + let mut result = input.to_string(); + + if input.contains("{addr_hex}") { + result = result.replace("{addr_hex}", to_hex(address).as_str()); + } + + if input.contains("{addr_dec}") { + result = result.replace("{addr_dec}", address.to_string().as_str()); + } + + result +}