|
|
@ -111,32 +111,32 @@ fn get_transaction_by_hash(tx_hash: String) -> Template {
|
|
|
|
Template::render("transaction", context)
|
|
|
|
Template::render("transaction", context)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// #[get("/address/<wallet_address>?<tx_amount>&<tx_description>&<recipient_name>&<tx_payment_id>")]
|
|
|
|
#[get("/address/<wallet_address>?<tx_amount>&<tx_description>&<recipient_name>&<tx_payment_id>")]
|
|
|
|
// fn show_wallet_address(
|
|
|
|
fn show_wallet_address(
|
|
|
|
// wallet_address: String,
|
|
|
|
wallet_address: String,
|
|
|
|
// tx_amount: Option<String>,
|
|
|
|
tx_amount: Option<String>,
|
|
|
|
// tx_description: Option<String>,
|
|
|
|
tx_description: Option<String>,
|
|
|
|
// recipient_name: Option<String>,
|
|
|
|
recipient_name: Option<String>,
|
|
|
|
// tx_payment_id: Option<String>
|
|
|
|
tx_payment_id: Option<String>
|
|
|
|
// ) -> Template {
|
|
|
|
) -> Template {
|
|
|
|
// let address_uri = format!(
|
|
|
|
let address_uri = format!(
|
|
|
|
// "wownero:{}&tx_amount={}&tx_description={}&recipient_name={}&tx_payment_id={}",
|
|
|
|
"wownero:{}&tx_amount={}&tx_description={}&recipient_name={}&tx_payment_id={}",
|
|
|
|
// wallet_address,
|
|
|
|
wallet_address,
|
|
|
|
// tx_amount.unwrap_or("".to_string()),
|
|
|
|
tx_amount.unwrap_or("".to_string()),
|
|
|
|
// tx_description.unwrap_or("".to_string()),
|
|
|
|
tx_description.unwrap_or("".to_string()),
|
|
|
|
// recipient_name.unwrap_or("".to_string()),
|
|
|
|
recipient_name.unwrap_or("".to_string()),
|
|
|
|
// tx_payment_id.unwrap_or("".to_string())
|
|
|
|
tx_payment_id.unwrap_or("".to_string())
|
|
|
|
// );
|
|
|
|
);
|
|
|
|
// let qr_code: String = qrcode_generator::to_svg_to_string(address_uri, QrCodeEcc::Low, 256, None)
|
|
|
|
let qr_code: String = qrcode_generator::to_svg_to_string(address_uri, QrCodeEcc::Low, 256, None)
|
|
|
|
// .unwrap();
|
|
|
|
.unwrap();
|
|
|
|
// let qr_code: String = base64::encode(qr_code);
|
|
|
|
let qr_code: String = base64::encode(qr_code);
|
|
|
|
// let context: JsonValue = json!({
|
|
|
|
let context: JsonValue = json!({
|
|
|
|
// "qr_code": qr_code,
|
|
|
|
"qr_code": qr_code,
|
|
|
|
// "wallet_address": wallet_address
|
|
|
|
"wallet_address": wallet_address
|
|
|
|
// });
|
|
|
|
});
|
|
|
|
// Template::render("address", context)
|
|
|
|
Template::render("address", context)
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
//
|
|
|
|
|
|
|
|
// #[get("/search?<value>")]
|
|
|
|
// #[get("/search?<value>")]
|
|
|
|
// fn search(value: &RawStr) -> Redirect {
|
|
|
|
// fn search(value: &RawStr) -> Redirect {
|
|
|
|
// // This search implementation is not ideal but it works.
|
|
|
|
// // This search implementation is not ideal but it works.
|
|
|
@ -270,7 +270,7 @@ fn main() {
|
|
|
|
// get_block_by_height,
|
|
|
|
// get_block_by_height,
|
|
|
|
// get_block_by_hash,
|
|
|
|
// get_block_by_hash,
|
|
|
|
get_transaction_by_hash,
|
|
|
|
get_transaction_by_hash,
|
|
|
|
// show_wallet_address,
|
|
|
|
show_wallet_address,
|
|
|
|
error
|
|
|
|
error
|
|
|
|
])
|
|
|
|
])
|
|
|
|
.mount("/static", StaticFiles::from("./static"))
|
|
|
|
.mount("/static", StaticFiles::from("./static"))
|
|
|
|