feat(cli): add top-level blesstoken-disable-mint command#29
feat(cli): add top-level blesstoken-disable-mint command#29
Conversation
There was a problem hiding this comment.
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-mintcommand (with several aliases). - Registered
blesstoken-disable-mintat the root CLI level inindex.js. - Updated
README.mdto include the new command usage and refreshed theblesstokenhelp 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. |
There was a problem hiding this comment.
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).
| 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. |
| ) | ||
| .option( | ||
| "--squads <true/false>", | ||
| "squads: if squads true, use squads to signature, default is false.", |
There was a problem hiding this comment.
--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.
| "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, |
| try { | ||
| mintPubkey = new PublicKey(mint); | ||
| } catch (e) { | ||
| console.log(chalk.red("invaild mint parameter: " + e)); |
There was a problem hiding this comment.
Typo in error message: "invaild" should be "invalid".
| console.log(chalk.red("invaild mint parameter: " + e)); | |
| console.log(chalk.red("invalid mint parameter: " + e)); |
| const [blessStatePda] = PublicKey.findProgramAddressSync( | ||
| [Buffer.from(BLESS_CONTRACT_STATE_SEED), mintPubkey.toBuffer()], | ||
| client.programId, | ||
| ); |
There was a problem hiding this comment.
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.
Implemented a new top-level CLI command for disabling BLESS mint authority and updated docs accordingly.
What changed
Notes