diff --git a/proto/cerc/auction/v1/auction.proto b/proto/cerc/auction/v1/auction.proto index 7de8647..4720cc9 100644 --- a/proto/cerc/auction/v1/auction.proto +++ b/proto/cerc/auction/v1/auction.proto @@ -53,7 +53,7 @@ message Auction { string id = 1; - // Auction's kind (vickrey | service_provider) + // Auction's kind (vickrey | provider) string kind = 2 [ (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" ]; @@ -101,7 +101,7 @@ message Auction { (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" ]; - // Addresses of the winners (one for vickrey and can be multiple for service_provider) + // Addresses of the winners (one for vickrey auctions and can be multiple for provider auctions) repeated string winner_addresses = 11; // Winning bids, i.e., the best bids diff --git a/proto/cerc/auction/v1/tx.proto b/proto/cerc/auction/v1/tx.proto index ec02f77..b454551 100644 --- a/proto/cerc/auction/v1/tx.proto +++ b/proto/cerc/auction/v1/tx.proto @@ -77,7 +77,7 @@ message MsgCreateAuction { string signer = 6 [ (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" ]; - // Auction's kind (vickrey | service_provider) + // Auction's kind (vickrey | provider) string kind = 7 [ (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" ]; diff --git a/src/auction.test.ts b/src/auction.test.ts index 0278b00..1f743df 100644 --- a/src/auction.test.ts +++ b/src/auction.test.ts @@ -71,7 +71,6 @@ const createAuctionTests = () => { commitFee, revealFee, minimumBid, - kind: 'vickrey', signer: auctionCreatorAccount.address }, auctionCreatorAccount.privateKey, fee); @@ -174,13 +173,12 @@ const createSPAuctionTests = () => { amount: '100000000' }; - const auction = await registry.createServiceProviderAuction({ + const auction = await registry.createProviderAuction({ commitsDuration, revealsDuration, commitFee, revealFee, signer: auctionCreatorAccount.address, - kind: 'service_provider', maxPrice, numProviders: 3 }, diff --git a/src/index.ts b/src/index.ts index 8e2d825..b172584 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,6 +23,7 @@ import { import { MessageMsgCommitBid, MessageMsgRevealBid, + MsgCreateProviderAuction, MsgCreateVickreyAuction } from './types/cerc/auction/message'; import { MessageMsgSendCoins } from './types/cosmos/bank/message'; @@ -508,8 +509,7 @@ export class Registry { commitFee, revealFee, minimumBid, - signer, - kind + signer }: MsgCreateVickreyAuction, privateKey: string, fee: StdFee | number = DEFAULT_GAS_ESTIMATION_MULTIPLIER): Promise { @@ -524,7 +524,7 @@ export class Registry { revealFee, minimumBid, signer, - kind, + 'vickrey', undefined, 0, fee, @@ -532,16 +532,15 @@ export class Registry { ); } - async createServiceProviderAuction ({ + async createProviderAuction ({ commitsDuration, revealsDuration, commitFee, revealFee, signer, - kind, maxPrice, numProviders - }: MsgCreateAuction, + }: MsgCreateProviderAuction, privateKey: string, fee: StdFee | number = DEFAULT_GAS_ESTIMATION_MULTIPLIER): Promise { const account = new Account(Buffer.from(privateKey, 'hex')); @@ -555,7 +554,7 @@ export class Registry { revealFee, undefined, signer, - kind, + 'provider', maxPrice, numProviders, fee, diff --git a/src/proto/cerc/auction/v1/auction.ts b/src/proto/cerc/auction/v1/auction.ts index ce70564..d9c7c8e 100644 --- a/src/proto/cerc/auction/v1/auction.ts +++ b/src/proto/cerc/auction/v1/auction.ts @@ -24,7 +24,7 @@ export interface Params { /** Auction represents a sealed-bid on-chain auction */ export interface Auction { id: string; - /** Auction's kind (vickrey | service_provider) */ + /** Auction's kind (vickrey | provider) */ kind: string; status: string; /** Address of the creator of the auction */ @@ -43,7 +43,7 @@ export interface Auction { revealFee?: Coin; /** Minimum acceptable bid amount for a valid commit */ minimumBid?: Coin; - /** Addresses of the winners (one for vickrey and can be multiple for service_provider) */ + /** Addresses of the winners (one for vickrey auctions and can be multiple for provider auctions) */ winnerAddresses: string[]; /** Winning bids, i.e., the best bids */ winningBids: Coin[]; diff --git a/src/proto/cerc/auction/v1/tx.ts b/src/proto/cerc/auction/v1/tx.ts index 0e5bc74..c576c51 100644 --- a/src/proto/cerc/auction/v1/tx.ts +++ b/src/proto/cerc/auction/v1/tx.ts @@ -21,7 +21,7 @@ export interface MsgCreateAuction { minimumBid?: Coin; /** Address of the signer */ signer: string; - /** Auction's kind (vickrey | service_provider) */ + /** Auction's kind (vickrey | provider) */ kind: string; /** Maximum acceptable bid amount (for service provider auctions) */ maxPrice?: Coin; diff --git a/src/types/cerc/auction/message.ts b/src/types/cerc/auction/message.ts index a620cb1..72ac7d8 100644 --- a/src/types/cerc/auction/message.ts +++ b/src/types/cerc/auction/message.ts @@ -46,11 +46,20 @@ export interface MessageMsgRevealBid { } export interface MsgCreateVickreyAuction { - commitsDuration?: Duration; - revealsDuration?: Duration; - commitFee?: Coin; - revealFee?: Coin; - minimumBid?: Coin; + commitsDuration: Duration; + revealsDuration: Duration; + commitFee: Coin; + revealFee: Coin; + minimumBid: Coin; + signer: string; +} + +export interface MsgCreateProviderAuction { + commitsDuration: Duration; + revealsDuration: Duration; + commitFee: Coin; + revealFee: Coin; + maxPrice: Coin; + numProviders: number; signer: string; - kind: string; }