@@ -5,11 +5,13 @@ import (
55 "fmt"
66 "os"
77 "strconv"
8+ "strings"
89
910 "github.com/cosmos/cosmos-sdk/client"
1011 "github.com/cosmos/cosmos-sdk/client/flags"
1112 "github.com/cosmos/cosmos-sdk/client/tx"
1213 sdk "github.com/cosmos/cosmos-sdk/types"
14+ "github.com/cosmos/cosmos-sdk/version"
1315 "github.com/spf13/cobra"
1416
1517 "github.com/persistenceOne/pstake-native/v2/x/liquidstakeibc/types"
@@ -44,6 +46,12 @@ func NewRegisterHostChainCmd() *cobra.Command {
4446 Use : "register-host-chain [connection-id] [channel-id] [port-id] [deposit-fee] [restake-fee] [unstake-fee] [redemption-fee] [host-denom] [minimum-deposit] [unbonding-factor] [autocompound-factor]" ,
4547 Args : cobra .ExactArgs (11 ),
4648 Short : "Register a host chain" ,
49+ Long : strings .TrimSpace (
50+ fmt .Sprintf (
51+ `Submit a register host chain transaction: $ %s tx liquidstakeibc register-host-chain connection-0 channel-0 transfer 0.00 0.05 0.00 0.005 uatom 1 4 20` ,
52+ version .AppName ,
53+ ),
54+ ),
4755 RunE : func (cmd * cobra.Command , args []string ) error {
4856 clientCtx , err := client .GetClientTxContext (cmd )
4957 if err != nil {
@@ -99,6 +107,30 @@ func NewUpdateHostChainCmd() *cobra.Command {
99107 Use : "update-host-chain [chain-id] [updates]" ,
100108 Args : cobra .ExactArgs (2 ),
101109 Short : "Update a host chain" ,
110+ Long : strings .TrimSpace (
111+ fmt .Sprintf (
112+ `Submit an update host chain transaction:
113+ $ %s tx liquidstakeibc update-host-chain gaia-1 '[
114+ {
115+ "key": "active",
116+ "value": "true"
117+ },
118+ {
119+ "key": "set_withdraw_address",
120+ "value": ""
121+ },
122+ {
123+ "key": "flags",
124+ "value": "{\"lsm\": true}"
125+ },
126+ {
127+ "key": "add_validator",
128+ "value": "{\"operator_address\": \"cosmosvaloper1hcqg5wj9t42zawqkqucs7la85ffyv08le09ljt\", \"status\": \"BOND_STATUS_BONDED\", \"weight\": \"1\", \"delegated_amount\": \"0\", \"exchange_rate\": \"0\", \"unbonding_epoch\": 0}"
129+ }
130+ ]'` ,
131+ version .AppName ,
132+ ),
133+ ),
102134 RunE : func (cmd * cobra.Command , args []string ) error {
103135 clientCtx , err := client .GetClientTxContext (cmd )
104136 if err != nil {
@@ -133,7 +165,13 @@ func NewLiquidStakeCmd() *cobra.Command {
133165 cmd := & cobra.Command {
134166 Use : "liquid-stake [amount]" ,
135167 Short : `Liquid Stake tokens from a registered host chain into stk tokens` ,
136- Args : cobra .ExactArgs (1 ),
168+ Long : strings .TrimSpace (
169+ fmt .Sprintf (
170+ `Submit a liquid stake transaction: $ %s tx liquidstakeibc liquid-stake 100000000ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2` ,
171+ version .AppName ,
172+ ),
173+ ),
174+ Args : cobra .ExactArgs (1 ),
137175 RunE : func (cmd * cobra.Command , args []string ) error {
138176
139177 clientctx , err := client .GetClientTxContext (cmd )
@@ -162,7 +200,13 @@ func NewLiquidUnstakeCmd() *cobra.Command {
162200 cmd := & cobra.Command {
163201 Use : "liquid-unstake [amount]" ,
164202 Short : `Unstake stk tokens from a registered host chain` ,
165- Args : cobra .ExactArgs (1 ),
203+ Long : strings .TrimSpace (
204+ fmt .Sprintf (
205+ `Submit a liquid unstake transaction: $ %s tx liquidstakeibc liquid-unstake 100000000stk/uatom` ,
206+ version .AppName ,
207+ ),
208+ ),
209+ Args : cobra .ExactArgs (1 ),
166210 RunE : func (cmd * cobra.Command , args []string ) error {
167211
168212 clientctx , err := client .GetClientTxContext (cmd )
@@ -191,7 +235,13 @@ func NewRedeemCmd() *cobra.Command {
191235 cmd := & cobra.Command {
192236 Use : "redeem [amount]" ,
193237 Short : `Instantly redeem stk tokens from a registered host chain` ,
194- Args : cobra .ExactArgs (1 ),
238+ Long : strings .TrimSpace (
239+ fmt .Sprintf (
240+ `Submit a redeem transaction: $ %s tx liquidstakeibc redeem 50000000stk/uatom` ,
241+ version .AppName ,
242+ ),
243+ ),
244+ Args : cobra .ExactArgs (1 ),
195245 RunE : func (cmd * cobra.Command , args []string ) error {
196246
197247 clientctx , err := client .GetClientTxContext (cmd )
@@ -222,6 +272,30 @@ func NewUpdateParamsCmd() *cobra.Command {
222272 Use : "update-params [params-file]" ,
223273 Args : cobra .ExactArgs (1 ),
224274 Short : "Update the module params" ,
275+ Long : strings .TrimSpace (
276+ fmt .Sprintf (
277+ `Submit an update params transaction: $ %s tx liquidstakeibc update-params /params-file.json
278+
279+ Params file contents:
280+
281+ {
282+ "messages": [{
283+ "@type": "/pstake.liquidstakeibc.v1beta1.MsgUpdateParams",
284+ "authority": "persistence10d07y265gmmuvt4z0w9aw880jnsr700j5w4kch",
285+ "params": {
286+ "admin_address": "persistence10khgeppewe4rgfrcy809r9h00aquwxxxrk6glr",
287+ "fee_address": "persistence1xruvjju28j0a5ud5325rfdak8f5a04h0s30mld"
288+ }
289+ }],
290+ "deposit": "10000000uxprt",
291+ "proposer": "persistence1hcqg5wj9t42zawqkqucs7la85ffyv08ljhhesu",
292+ "title": "Update module addresses",
293+ "summary": "Updates both the admin and the fee address of the module",
294+ "metadata": ""
295+ }` ,
296+ version .AppName ,
297+ ),
298+ ),
225299 RunE : func (cmd * cobra.Command , args []string ) error {
226300 clientCtx , err := client .GetClientTxContext (cmd )
227301 if err != nil {
0 commit comments