2024-02-09 08:44:45 +00:00
|
|
|
package module
|
|
|
|
|
|
|
|
import (
|
|
|
|
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
|
|
|
"cosmossdk.io/client/v2/autocli"
|
2024-02-12 08:34:40 +00:00
|
|
|
|
2024-04-01 09:57:26 +00:00
|
|
|
auctionv1 "git.vdb.to/cerc-io/laconicd/api/cerc/auction/v1"
|
2024-02-09 08:44:45 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var _ autocli.HasAutoCLIConfig = AppModule{}
|
|
|
|
|
|
|
|
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
|
|
|
|
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
|
|
|
return &autocliv1.ModuleOptions{
|
2024-02-12 08:34:40 +00:00
|
|
|
Query: &autocliv1.ServiceCommandDescriptor{
|
|
|
|
Service: auctionv1.Query_ServiceDesc.ServiceName,
|
|
|
|
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
|
|
|
{
|
|
|
|
RpcMethod: "Params",
|
|
|
|
Use: "params",
|
|
|
|
Short: "Get the current auction parameters",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
RpcMethod: "Auctions",
|
|
|
|
Use: "list",
|
|
|
|
Short: "List auctions",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
RpcMethod: "GetAuction",
|
|
|
|
Use: "get [auction-id]",
|
|
|
|
Short: "Get auction info by auction id",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
|
|
{ProtoField: "id"},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
RpcMethod: "AuctionsByOwner",
|
|
|
|
Use: "by-owner [owner-address]",
|
|
|
|
Short: "Get auctions list by owner / creator address",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
|
|
{ProtoField: "owner_address"},
|
|
|
|
},
|
|
|
|
},
|
2024-02-15 06:56:18 +00:00
|
|
|
{
|
|
|
|
RpcMethod: "GetBid",
|
|
|
|
Use: "get-bid [auction-id] [bidder]",
|
|
|
|
Short: "Get auction bid by auction id and bidder",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
|
|
{ProtoField: "auction_id"},
|
|
|
|
{ProtoField: "bidder"},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
RpcMethod: "GetBids",
|
|
|
|
Use: "get-bids [auction-id]",
|
|
|
|
Short: "Get all auction bids",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
|
|
{ProtoField: "auction_id"},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
RpcMethod: "AuctionsByBidder",
|
|
|
|
Use: "by-bidder [bidder]",
|
|
|
|
Short: "Get auctions list by bidder",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
|
|
{ProtoField: "bidder_address"},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
RpcMethod: "GetAuctionModuleBalance",
|
|
|
|
Use: "balance",
|
|
|
|
Short: "Get auction module account balances",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{},
|
|
|
|
},
|
2024-02-12 08:34:40 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
Tx: &autocliv1.ServiceCommandDescriptor{
|
|
|
|
Service: auctionv1.Msg_ServiceDesc.ServiceName,
|
|
|
|
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
|
|
|
{
|
|
|
|
RpcMethod: "CreateAuction",
|
2024-09-25 12:38:49 +00:00
|
|
|
Use: "create [commits-duration] [reveals-duration] [commit-fee] [reveal-fee]",
|
2024-02-12 08:34:40 +00:00
|
|
|
Short: "Create an auction",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
|
|
{ProtoField: "commits_duration"},
|
|
|
|
{ProtoField: "reveals_duration"},
|
|
|
|
{ProtoField: "commit_fee"},
|
|
|
|
{ProtoField: "reveal_fee"},
|
2024-09-25 12:38:49 +00:00
|
|
|
},
|
|
|
|
FlagOptions: map[string]*autocliv1.FlagOptions{
|
|
|
|
"kind": {Name: "kind", DefaultValue: "vickrey", Usage: "Auction kind (vickrey|provider) (default: vickrey)"},
|
|
|
|
"minimum_bid": {Name: "minimum-bid", Usage: "Minimum bid (required for vickrey auctions)"},
|
|
|
|
"max_price": {Name: "max-price", Usage: "Max price (required for provider auctions)"},
|
|
|
|
"num_providers": {Name: "num-providers", Usage: "Number of desired providers (required for provider auctions)"},
|
2024-02-12 08:34:40 +00:00
|
|
|
},
|
|
|
|
},
|
2024-09-05 07:07:54 +00:00
|
|
|
{
|
|
|
|
RpcMethod: "UpdateParams",
|
|
|
|
Skip: true, // skipped because authority gated
|
|
|
|
},
|
2024-02-12 08:34:40 +00:00
|
|
|
},
|
2024-09-05 07:07:54 +00:00
|
|
|
|
2024-02-15 06:56:18 +00:00
|
|
|
EnhanceCustomCommand: true, // Allow additional manual commands
|
2024-02-12 08:34:40 +00:00
|
|
|
},
|
2024-02-09 08:44:45 +00:00
|
|
|
}
|
|
|
|
}
|