use super::*; #[derive(Debug, PartialEq, Clone)] pub(crate) enum Outgoing { Amount(Amount), InscriptionId(InscriptionId), SatPoint(SatPoint), } impl FromStr for Outgoing { type Err = Error; fn from_str(s: &str) -> Result<Self, Self::Err> { Ok(if s.contains(':') { Self::SatPoint(s.parse()?) } else if s.len() >= 66 { Self::InscriptionId(s.parse()?) } else if s.contains(' ') { Self::Amount(s.parse()?) } else if let Some(i) = s.find(|c: char| c.is_alphabetic()) { let mut s = s.to_owned(); s.insert(i, ' '); Self::Amount(s.parse()?) } else { Self::Amount(s.parse()?) }) } } #[cfg(test)] mod tests { use super::*; #[test] fn parse() { assert_eq!( "0000000000000000000000000000000000000000000000000000000000000000i0" .parse::<Outgoing>() .unwrap(), Outgoing::InscriptionId( "0000000000000000000000000000000000000000000000000000000000000000i0" .parse() .unwrap() ), );

Inscription #44969936

ID

17347142f3...3fb4767ci0

Detail

History

Action
Price
Marketplace
From
To
Time

INSCRIBED

-

-

-04dx

8 months

Sign Up for our Newsletter

And be the first to know about any updates!

OrdinalHub logo

All Rights Reserved OrdinalHub.com 2024

Support

Follow Us