From bd1f1fd9ae9cb573e74c46e9ed0969d1e5bc66eb Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 4 Mar 2024 22:54:46 -0800 Subject: [PATCH] Use JSON labels --- src/subcommand/wallet/label.rs | 68 +++++++++++++++++----------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/src/subcommand/wallet/label.rs b/src/subcommand/wallet/label.rs index 77e1c22acc..01359f10c6 100644 --- a/src/subcommand/wallet/label.rs +++ b/src/subcommand/wallet/label.rs @@ -1,30 +1,27 @@ use super::*; -// todo: -// - flags: -// - sat-name -// - inscription-id -// - sat-number -// - inscription-number -// - rarity -// - all-ranges -// - first-range -// - first-sat -// - output labels with all ranges -// - require flag to only list first range -// - require flag to -// -// - consider taking lables from sparrow as input and outputting modified lables - #[derive(Serialize)] struct Label { - r#type: String, - r#ref: String, + first_sat: SatLabel, + inscriptions: BTreeMap>, +} + +#[derive(Serialize)] +struct SatLabel { + name: String, + number: u64, + rarity: Rarity, +} + +#[derive(Serialize)] +struct Line { label: String, + r#ref: String, + r#type: String, } pub(crate) fn run(wallet: Wallet) -> SubcommandResult { - let mut labels: Vec