use rocket::serde::json::{Value, json}; #[get("/height/")] pub fn height(height: i32) -> Value { let payload: Value = json!({ "method": "get_block", "params": { "height": height } }); return payload; } #[get("/hash/")] pub fn hash(hash: String) -> Value { let payload: Value = json!({ "method": "get_block", "params": { "hash": hash } }); return payload; }