@@ -19,7 +19,7 @@ import (
1919func txCreatePlan () * cobra.Command {
2020 cmd := & cobra.Command {
2121 Use : "create-plan [bytes] [duration]" ,
22- Short : "Create a new subscription plan with bytes, duration and pricing details" ,
22+ Short : "Create a new subscription plan with bytes, duration, pricing details, and privacy setting " ,
2323 Args : cobra .ExactArgs (2 ),
2424 RunE : func (cmd * cobra.Command , args []string ) error {
2525 ctx , err := client .GetClientTxContext (cmd )
@@ -42,11 +42,17 @@ func txCreatePlan() *cobra.Command {
4242 return err
4343 }
4444
45+ private , err := GetPrivate (cmd .Flags ())
46+ if err != nil {
47+ return err
48+ }
49+
4550 msg := v3 .NewMsgCreatePlanRequest (
4651 ctx .FromAddress .Bytes (),
4752 bytes ,
4853 duration ,
4954 prices ,
55+ private ,
5056 )
5157 if err := msg .ValidateBasic (); err != nil {
5258 return err
@@ -57,6 +63,7 @@ func txCreatePlan() *cobra.Command {
5763 }
5864
5965 flags .AddTxFlagsToCmd (cmd )
66+ cmd .Flags ().Bool (flagPrivate , false , "set whether the plan should be private or not" )
6067 cmd .Flags ().String (flagPrices , "" , "specify the list of prices (e.g., 1000token)" )
6168
6269 return cmd
@@ -140,6 +147,46 @@ func txUnlinkNode() *cobra.Command {
140147 return cmd
141148}
142149
150+ func txUpdatePlanDetails () * cobra.Command {
151+ cmd := & cobra.Command {
152+ Use : "update-plan-details [id]" ,
153+ Short : "Update the details of an existing subscription plan" ,
154+ Args : cobra .ExactArgs (2 ),
155+ RunE : func (cmd * cobra.Command , args []string ) error {
156+ ctx , err := client .GetClientTxContext (cmd )
157+ if err != nil {
158+ return err
159+ }
160+
161+ id , err := strconv .ParseUint (args [0 ], 10 , 64 )
162+ if err != nil {
163+ return err
164+ }
165+
166+ private , err := GetPrivate (cmd .Flags ())
167+ if err != nil {
168+ return err
169+ }
170+
171+ msg := v3 .NewMsgUpdatePlanDetailsRequest (
172+ ctx .FromAddress .Bytes (),
173+ id ,
174+ private ,
175+ )
176+ if err := msg .ValidateBasic (); err != nil {
177+ return err
178+ }
179+
180+ return tx .GenerateOrBroadcastTxCLI (ctx , cmd .Flags (), msg )
181+ },
182+ }
183+
184+ flags .AddTxFlagsToCmd (cmd )
185+ cmd .Flags ().Bool (flagPrivate , false , "set whether the plan should be private or not" )
186+
187+ return cmd
188+ }
189+
143190func txUpdatePlanStatus () * cobra.Command {
144191 cmd := & cobra.Command {
145192 Use : "update-plan-status [id] [status]" ,
0 commit comments