Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR reorganizes and expands the CLI commands, adds full stake contract support
Reorganizes command modules into subfolders (meta, program, register, stake, time, tools)
Fixes many require path issues, adds getBlsStakeContractClient in utils, and improves user-facing messages (e.g., "fail" → "failed", "invaild" → "invalid").
Add a new "stake" command group to the CLI with multiple subcommands to manage the BLESS staking contract.
New commands:
stake init — initialize stake state
stake deposit — deposit tokens and create a stake
stake unstake — mark stake for unstaking (by sequence)
stake withdraw — withdraw tokens (by sequence)
stake pending-admin — set a pending admin
stake accept-admin — accept pending admin
stake set-apr — set APR configuration (range)
stake set-factor — set APR factor (secondsPerPeriods, periodsPerYear)
stake pause — pause/resume stake activity
Adds index for stake commands at command/stake/index.js and implements related utility interactions.
Why
Exposes stake contract lifecycle and admin operations via CLI to make it easy to manage staking configuration and user stake flows from scripts or the terminal.
Supports both locally-signed and Squads (external multisig) signing flows via --squads option for compatible operations.
Files added
command/stake/index.js
command/stake/stake_init.js
command/stake/deposit.js
command/stake/unstake.js
command/stake/withdraw.js
command/stake/set_pending_admin.js
command/stake/accept_admin.js
command/stake/set_apr.js
command/stake/set_apr_factor.js
command/stake/pause.js
Key details
Each command supports:
--cluster: mainnet/testnet/devnet/localnet or custom RPC
--signer: path to signer keypair (defaults to WALLET_PATH)
--programId: override program id (useful for testnet/devnet/localnet)
--squads: if set, the command will create an unsigned/signable-by-Squads transaction (bs58 output) instead of submitting a signed transaction
For admin operations, there is --admin argument to specify admin pubkey or keypair depending on mode
Commands perform input validation (e.g., parsing BN for sequence/amount, validating public keys, JSON parsing for APR)
On squads mode, commands produce a base58 serialized transaction (via bs58Message) for external signing/relay
On non-squads mode, commands read local keypairs and submit transactions directly