Prathamesh Musale
52e8d322fa
Some checks failed
Integration Tests / test-integration (push) Successful in 2m29s
E2E Tests / test-e2e (push) Successful in 4m6s
Unit Tests / test-unit (push) Successful in 2m3s
SDK Tests / sdk_tests_authority_auctions (push) Failing after 6m31s
SDK Tests / sdk_tests_nameservice_expiry (push) Successful in 9m11s
SDK Tests / sdk_tests (push) Failing after 10m14s
Part of [Service provider auctions](https://www.notion.so/Service-provider-auctions-a7b63697d818479493ec145ea6ea3c1c) - Add a new type of auction for service providers - Add a command to release provider auction funds - Remove unused auction module params Co-authored-by: IshaVenikar <ishavenikar7@gmail.com> Co-authored-by: Isha Venikar <ishavenikar@Ishas-MacBook-Air.local> Reviewed-on: #59 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
109 lines
3.5 KiB
Go
109 lines
3.5 KiB
Go
package module
|
|
|
|
import (
|
|
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
|
"cosmossdk.io/client/v2/autocli"
|
|
|
|
auctionv1 "git.vdb.to/cerc-io/laconicd/api/cerc/auction/v1"
|
|
)
|
|
|
|
var _ autocli.HasAutoCLIConfig = AppModule{}
|
|
|
|
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
|
|
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
|
return &autocliv1.ModuleOptions{
|
|
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"},
|
|
},
|
|
},
|
|
{
|
|
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{},
|
|
},
|
|
},
|
|
},
|
|
Tx: &autocliv1.ServiceCommandDescriptor{
|
|
Service: auctionv1.Msg_ServiceDesc.ServiceName,
|
|
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
|
{
|
|
RpcMethod: "CreateAuction",
|
|
Use: "create [commits-duration] [reveals-duration] [commit-fee] [reveal-fee]",
|
|
Short: "Create an auction",
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
{ProtoField: "commits_duration"},
|
|
{ProtoField: "reveals_duration"},
|
|
{ProtoField: "commit_fee"},
|
|
{ProtoField: "reveal_fee"},
|
|
},
|
|
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)"},
|
|
},
|
|
},
|
|
{
|
|
RpcMethod: "UpdateParams",
|
|
Skip: true, // skipped because authority gated
|
|
},
|
|
},
|
|
|
|
EnhanceCustomCommand: true, // Allow additional manual commands
|
|
},
|
|
}
|
|
}
|