shadow_drive_cli/command/nft/minter/
mod.rs

1use clap::Parser;
2
3use shadow_drive_sdk::{Pubkey, Signer};
4
5mod get;
6mod init;
7mod mint;
8
9#[derive(Debug, Parser)]
10pub enum MinterCommand {
11    /// Initializes a minter given a creator_group and collection
12    Init,
13
14    /// Gets a minter from the chain and prints its state
15    Get { minter: Pubkey },
16
17    /// Mints an nft from the provided minter
18    Mint { minter: Pubkey },
19}
20
21impl MinterCommand {
22    pub async fn process(
23        &self,
24        signer: &impl Signer,
25        client_signer: impl Signer,
26        rpc_url: &str,
27    ) -> anyhow::Result<()> {
28        match self {
29            MinterCommand::Init => init::process(signer, client_signer, rpc_url).await,
30
31            MinterCommand::Get { minter } => get::process(minter, rpc_url).await,
32
33            MinterCommand::Mint { minter } => mint::process(signer, *minter, rpc_url).await,
34        }
35    }
36}