Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added command for minting fungible tokens #321

Conversation

sunguru98
Copy link
Contributor

@sunguru98 sunguru98 commented Feb 4, 2024

Support added for fungible token minting. The following screenshot represents the structure of the command.

Screenshot 2024-02-05 at 1 54 50 AM

The amount doesn't need to take account of decimals as the calculation is done inside the processor function.

src/mint.rs Outdated
@@ -267,6 +269,93 @@ pub fn mint_from_uris(
Ok(())
}

#[allow(clippy::too_many_arguments)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a MintFungibleArgs struct here to fix the clippy issue and follow the patterns of other commands?

@@ -852,6 +852,24 @@ pub enum FindSubcommands {

#[derive(Debug, StructOpt)]
pub enum MintSubcommands {
/// Mint a normal SPL Token from the Token Program
Fungible {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about changing this to Tokens to clarify and maybe the docs comment can be:

/// Mint SPL tokens from an existing mint account using the Token Program.

Copy link
Contributor Author

@sunguru98 sunguru98 Feb 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking of following the already built command structure in create
metaboss create fungible
metaboss mint fungible

Would be a bit relatable for users.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think the problem is that the naming is already inconsistent as "mint" basically means "create" when used for an asset like a NFT but I also have the "create" commands for setting up a fungible mint. I guess Fungible is ok if we change the doc comment to explain.

@samuelvanderwaal samuelvanderwaal merged commit 55373fb into samuelvanderwaal:main Feb 4, 2024
3 checks passed
@sunguru98 sunguru98 deleted the feat/add-mint-fungible-command branch February 4, 2024 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants