yellowstone_shield_cli/command/
mod.rs1pub mod identity;
2pub mod policy;
3
4use anyhow::Result;
5use solana_client::nonblocking::rpc_client::RpcClient;
6use solana_sdk::pubkey::Pubkey;
7use solana_sdk::signature::Keypair;
8use spl_token_metadata_interface::state::TokenMetadata;
9
10use crate::policy::PolicyVersion;
11
12pub struct CommandContext {
13 pub client: RpcClient,
14 pub keypair: Keypair,
15}
16
17pub struct SolanaAccount<T>(pub Pubkey, pub Option<T>);
18pub struct CommandComplete(
19 pub SolanaAccount<TokenMetadata>,
20 pub SolanaAccount<PolicyVersion>,
21);
22
23pub type RunResult = Result<CommandComplete>;
24
25#[async_trait::async_trait]
26pub trait RunCommand {
27 async fn run(&mut self, context: CommandContext) -> RunResult;
28}