mirror of
https://github.com/colinear-labs/chain.git
synced 2026-03-05 08:04:26 -08:00
basic linear vesting payouts (manual claim)
This commit is contained in:
@@ -35,6 +35,7 @@ func GetTxCmd() *cobra.Command {
|
||||
cmd.AddCommand(CmdLockFunds())
|
||||
cmd.AddCommand(CmdUnlockFunds())
|
||||
cmd.AddCommand(CmdUnlockAllFunds())
|
||||
cmd.AddCommand(CmdClaimFunds())
|
||||
// this line is used by starport scaffolding # 1
|
||||
|
||||
return cmd
|
||||
|
||||
42
x/colinearcore/client/cli/tx_claim_funds.go
Normal file
42
x/colinearcore/client/cli/tx_claim_funds.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"colinear/x/colinearcore/types"
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/client/tx"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var _ = strconv.Itoa(0)
|
||||
|
||||
func CmdClaimFunds() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "claim-funds [auction-id]",
|
||||
Short: "Broadcast message claimFunds",
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
||||
argAuctionId := args[0]
|
||||
|
||||
clientCtx, err := client.GetClientTxContext(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
msg := types.NewMsgClaimFunds(
|
||||
clientCtx.GetFromAddress().String(),
|
||||
argAuctionId,
|
||||
)
|
||||
if err := msg.ValidateBasic(); err != nil {
|
||||
return err
|
||||
}
|
||||
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
|
||||
},
|
||||
}
|
||||
|
||||
flags.AddTxFlagsToCmd(cmd)
|
||||
|
||||
return cmd
|
||||
}
|
||||
Reference in New Issue
Block a user