Skip to content

feat(cli): add top-level blesstoken-disable-mint command#29

Open
Joinhack wants to merge 2 commits intomainfrom
feat/blesstoken-disable-mint-command
Open

feat(cli): add top-level blesstoken-disable-mint command#29
Joinhack wants to merge 2 commits intomainfrom
feat/blesstoken-disable-mint-command

Conversation

@Joinhack
Copy link
Collaborator

Implemented a new top-level CLI command for disabling BLESS mint authority and updated docs accordingly.

What changed

  1. Added standalone command blesstoken-disable-mint (with aliases):
  • blesstoken_disable_mint
  • disable-mint
  • disable_mint
  1. Registered blesstoken-disable-mint at the root command level (parallel to blesstoken), instead of nesting it under blesstoken.
  2. Updated README.md command usage/help examples:
  • blesstoken now shown without subcommands
  • Added dedicated usage section for blesstoken-disable-mint

Notes

  • Kept backward-compatible aliases for existing scripts/users.
  • This MR only includes CLI wiring + documentation for command structure changes.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new top-level CLI entrypoint for disabling BLESS token mint authority, and updates the README to document the new command alongside existing blesstoken usage.

Changes:

  • Added a new standalone blesstoken-disable-mint command (with several aliases).
  • Registered blesstoken-disable-mint at the root CLI level in index.js.
  • Updated README.md to include the new command usage and refreshed the blesstoken help snippet.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
index.js Registers the new blesstoken-disable-mint command at the top level.
command/blesstoken_disable_mint.js Implements the new CLI command wiring for disabling mint authority (local and Squads flows).
README.md Documents the updated CLI structure and adds usage for blesstoken-disable-mint.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Usage: @blessnetwork/blesscontract blesstoken [options] <wallets> <mint> <mintAuthority>

blesstoken: initial blesstoken registration
blesstoken: initial blesstoken token mint and disptch bless token to wallet1-5 by rules.
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

The updated help text includes a typo: "disptch" should be "dispatch" (and consider aligning the CLI command description/help output accordingly so README and --help stay consistent).

Suggested change
blesstoken: initial blesstoken token mint and disptch bless token to wallet1-5 by rules.
blesstoken: initial blesstoken token mint and dispatch bless token to wallet1-5 by rules.

Copilot uses AI. Check for mistakes.
)
.option(
"--squads <true/false>",
"squads: if squads true, use squads to signature, default is false.",
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

--squads <true/false> is parsed by commander as a string, so --squads false results in options.squads === 'false' (truthy) and the Squads branch will run anyway. Consider changing this to a boolean flag (--squads) or providing a coercion function so only 'true' enables Squads mode.

Suggested change
"squads: if squads true, use squads to signature, default is false.",
"squads: if squads true, use squads to signature, default is false.",
(value) => value === "true",
false,

Copilot uses AI. Check for mistakes.
try {
mintPubkey = new PublicKey(mint);
} catch (e) {
console.log(chalk.red("invaild mint parameter: " + e));
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

Typo in error message: "invaild" should be "invalid".

Suggested change
console.log(chalk.red("invaild mint parameter: " + e));
console.log(chalk.red("invalid mint parameter: " + e));

Copilot uses AI. Check for mistakes.
Comment on lines +59 to +62
const [blessStatePda] = PublicKey.findProgramAddressSync(
[Buffer.from(BLESS_CONTRACT_STATE_SEED), mintPubkey.toBuffer()],
client.programId,
);
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

blessStatePda is computed unconditionally but only used in the non-Squads path. Consider moving the PDA derivation into the else branch to avoid extra work and reduce confusion about which inputs are required for Squads mode.

Copilot uses AI. Check for mistakes.
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