shadow_drive_cli/command/nft/collection/
mod.rs

1use clap::Parser;
2use shadow_drive_sdk::{Pubkey, Signer};
3
4mod get;
5mod init;
6mod withdraw;
7
8#[derive(Debug, Parser)]
9pub enum CollectionCommand {
10    /// Initialize a collection
11    Init,
12
13    /// Retrieve and print an onchain Collection account
14    Get { collection: Pubkey },
15
16    /// Withdraw mint fees from an onchain Collection account
17    Withdraw { collection: Pubkey },
18}
19impl CollectionCommand {
20    pub async fn process(&self, signer: &impl Signer, rpc_url: &str) -> anyhow::Result<()> {
21        match self {
22            CollectionCommand::Init => init::process(signer, rpc_url).await,
23
24            CollectionCommand::Get { collection } => get::process(collection, rpc_url).await,
25            CollectionCommand::Withdraw { collection } => {
26                withdraw::process(signer, *collection, rpc_url).await
27            }
28        }
29    }
30}