Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetQueryCmd ¶
GetQueryCmd returns the parent command for all the module's CLI query commands.
func NewCreateWalletCmd ¶
func NewSignTransactionCmd ¶
func NewCreateTransactionCmd() *cobra.Command { cmd := &cobra.Command{ Use: "create-transaction [wallet] [receiver] [coins]", Short: "Creates transaction for multisig wallet to send coins. Transaction sender must be in wallet owners", Long: fmt.Sprintf(`Creates new transaction to send coins from multisignature wallet to receiver.
Coins must be comma separated coins.
Example: $ %s tx %s create-transaction dx1..wallet dx1..receiver 1000del,200tony --from mykey`, config.AppBinName, types.ModuleName),
Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } var ( from = clientCtx.GetFromAddress() wallet = args[0] receiver = args[1] coinsString = args[2] ) if _, err := sdk.AccAddressFromBech32(wallet); err != nil { return fmt.Errorf("invalid wallet address %s: %s", wallet, err.Error()) } if _, err := sdk.AccAddressFromBech32(receiver); err != nil { return fmt.Errorf("invalid receiver address %s: %s", receiver, err.Error()) } coins, err := sdk.ParseCoinsNormalized(coinsString) if err != nil { return fmt.Errorf("error whil parse coins %s: %s", coinsString, err.Error()) } msg := types.NewMsgCreateTransaction(from, wallet, receiver, coins) err = msg.ValidateBasic() if err != nil { return err } return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } flags.AddTxFlagsToCmd(cmd) // workaround for cosmos cmd.Flags().String(flags.FlagChainID, "", "network chain id") _ = cmd.MarkFlagRequired(flags.FlagFrom) // nolint:errcheck return cmd }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.