You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
468 B
Rust

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