laconicd/x/bond/module/autocli.go
prathamesh0 e511051f3e
Add commands to create and list bonds (#3)
* Add message service with a create bond command

* Add query proto file with bonds list query

* Remove legacy amino coded registration

* Add bond to auth module config

* Use collections package for bond module state
2024-02-02 15:09:10 +05:30

41 lines
1.0 KiB
Go

package module
import (
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
"cosmossdk.io/client/v2/autocli"
bondv1 "git.vdb.to/cerc-io/laconic2d/api/cerc/bond/v1"
)
var _ autocli.HasAutoCLIConfig = AppModule{}
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
return &autocliv1.ModuleOptions{
Query: &autocliv1.ServiceCommandDescriptor{
Service: bondv1.Query_ServiceDesc.ServiceName,
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Bonds",
Use: "list",
Short: "List bonds",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{},
},
},
},
Tx: &autocliv1.ServiceCommandDescriptor{
Service: bondv1.Msg_ServiceDesc.ServiceName,
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "CreateBond",
Use: "create [amount]",
Short: "Create bond",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "coins"},
},
},
},
},
}
}