solana_tools_lite_cli/flows/base58.rs
1use crate::flows::presenter::Presentable;
2use crate::models::cmds::Base58Action;
3use solana_tools_lite::handlers::base58;
4use crate::shell::error::CliError;
5
6/// Base58 flow: delegates to the pure handler and presents the result.
7pub fn execute(action: &Base58Action, json: bool) -> Result<(), CliError> {
8 let result = match action {
9 Base58Action::Encode { input } => base58::encode(input)?,
10 Base58Action::Decode { input } => base58::decode(input)?,
11 };
12
13 result.present(json, false, false)?;
14 Ok(())
15}