|
|
|
@ -109,19 +109,26 @@ fn show_wallet_address(
|
|
|
|
|
recipient_name: Option<String>,
|
|
|
|
|
tx_payment_id: Option<String>
|
|
|
|
|
) -> Template {
|
|
|
|
|
let qr_data: QRData = QRData {
|
|
|
|
|
tx_amount: tx_amount.unwrap_or("".to_string()),
|
|
|
|
|
tx_description: tx_description.unwrap_or("".to_string()),
|
|
|
|
|
recipient_name: recipient_name.unwrap_or("".to_string()),
|
|
|
|
|
tx_payment_id: tx_payment_id.unwrap_or("".to_string())
|
|
|
|
|
};
|
|
|
|
|
let address_uri = format!(
|
|
|
|
|
"wownero:{}&tx_amount={}&tx_description={}&recipient_name={}&tx_payment_id={}",
|
|
|
|
|
wallet_address,
|
|
|
|
|
tx_amount.unwrap_or("".to_string()),
|
|
|
|
|
tx_description.unwrap_or("".to_string()),
|
|
|
|
|
recipient_name.unwrap_or("".to_string()),
|
|
|
|
|
tx_payment_id.unwrap_or("".to_string())
|
|
|
|
|
qr_data.tx_amount,
|
|
|
|
|
qr_data.tx_description,
|
|
|
|
|
qr_data.recipient_name,
|
|
|
|
|
qr_data.tx_payment_id
|
|
|
|
|
);
|
|
|
|
|
let qr_code: String = qrcode_generator::to_svg_to_string(address_uri, QrCodeEcc::Low, 256, None)
|
|
|
|
|
.unwrap();
|
|
|
|
|
let qr_code: String = base64::encode(qr_code);
|
|
|
|
|
let context: JsonValue = json!({
|
|
|
|
|
"qr_code": qr_code,
|
|
|
|
|
"qr_data": qr_data,
|
|
|
|
|
"wallet_address": wallet_address
|
|
|
|
|
});
|
|
|
|
|
Template::render("address", context)
|
|
|
|
|