shadow_drive_cli/command/nft/
mod.rs

1use clap::Parser;
2use shadow_drive_sdk::Signer;
3
4use self::{collection::*, creator_group::*, minter::*};
5
6pub mod collection;
7pub mod creator_group;
8pub mod minter;
9pub mod utils;
10
11#[derive(Debug, Parser)]
12pub enum NftCommand {
13    /// Commands for creating and managing shadow nft minters.
14    #[clap(subcommand)]
15    Minter(MinterCommand),
16
17    /// Commands for creating and managing creator groups.
18    #[clap(subcommand)]
19    CreatorGroup(CreatorGroupCommand),
20
21    /// Commands for creating and managing collections.
22    #[clap(subcommand)]
23    Collection(CollectionCommand),
24}
25
26impl NftCommand {
27    pub async fn process<T: Signer>(
28        &self,
29        signer: &T,
30        client_signer: T,
31        rpc_url: &str,
32    ) -> anyhow::Result<()> {
33        match self {
34            NftCommand::Minter(minter_cmd) => {
35                minter_cmd.process(signer, client_signer, rpc_url).await
36            }
37            NftCommand::CreatorGroup(group_command) => group_command.process(signer, rpc_url).await,
38            NftCommand::Collection(collection_command) => {
39                collection_command.process(signer, rpc_url).await
40            }
41        }
42    }
43}