diff --git a/x/manifest/client/cli/tx.go b/x/manifest/client/cli/tx.go index 0134eeb..e4baa5b 100644 --- a/x/manifest/client/cli/tx.go +++ b/x/manifest/client/cli/tx.go @@ -27,6 +27,7 @@ func NewTxCmd() *cobra.Command { } txCmd.AddCommand( + MsgBurnCoins(), MsgUpdateParams(), MsgDeployStakeholderPayout(), ) @@ -117,6 +118,43 @@ func MsgDeployStakeholderPayout() *cobra.Command { return cmd } +// MsgBurnCoins returns a CLI command handler for burning held coins. +func MsgBurnCoins() *cobra.Command { + cmd := &cobra.Command{ + Use: "burn-coins [coins]", + Short: "Burn held coins", + Example: `burn-coins 50000umfx,100other`, + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + cliCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + sender := cliCtx.GetFromAddress() + + coins, err := sdk.ParseCoinsNormalized(args[0]) + if err != nil { + return err + } + + msg := &types.MsgBurnHeldBalance{ + Sender: sender.String(), + BurnCoins: coins, + } + + if err := msg.Validate(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(cliCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} + // fromStrToStakeholders converts a string to a slice of StakeHolders. // ex: address:1_000_000,address2:99_000_000 func fromStrToStakeholders(s string) ([]*types.StakeHolders, error) {