Skip to main content

explorer_tx_url

Function explorer_tx_url 

Source
pub fn explorer_tx_url(chain: &str, txid: &str) -> Option<String>
Expand description

The explorer page for one transaction, or None when the chain has no public explorer or txid is not 64 lowercase-or-uppercase hex characters.

ยงExamples

use solid_pod_rs_forge::gitmark::explorer_tx_url;

let txid = "cd".repeat(32);
assert_eq!(
    explorer_tx_url("txbt4", &txid).unwrap(),
    format!("https://mempool.guide/testnet4/tx/{txid}")
);
assert!(explorer_tx_url("txbt4", "not-a-txid").is_none());