Add methods for creating auctions and add auction tests #28
18
src/index.ts
18
src/index.ts
@ -508,8 +508,7 @@ export class Registry {
|
|||||||
revealsDuration,
|
revealsDuration,
|
||||||
commitFee,
|
commitFee,
|
||||||
revealFee,
|
revealFee,
|
||||||
minimumBid,
|
minimumBid
|
||||||
signer
|
|
||||||
}: MsgCreateVickreyAuction,
|
}: MsgCreateVickreyAuction,
|
||||||
privateKey: string,
|
privateKey: string,
|
||||||
fee: StdFee | number = DEFAULT_GAS_ESTIMATION_MULTIPLIER): Promise<MsgCreateAuctionResponse> {
|
fee: StdFee | number = DEFAULT_GAS_ESTIMATION_MULTIPLIER): Promise<MsgCreateAuctionResponse> {
|
||||||
@ -518,17 +517,16 @@ export class Registry {
|
|||||||
const laconicClient = await this.getLaconicClient(account);
|
const laconicClient = await this.getLaconicClient(account);
|
||||||
|
|
||||||
return laconicClient.createAuction(
|
return laconicClient.createAuction(
|
||||||
|
account.address,
|
||||||
|
'vickrey',
|
||||||
commitsDuration,
|
commitsDuration,
|
||||||
revealsDuration,
|
revealsDuration,
|
||||||
commitFee,
|
commitFee,
|
||||||
revealFee,
|
revealFee,
|
||||||
minimumBid,
|
minimumBid,
|
||||||
signer,
|
|
||||||
'vickrey',
|
|
||||||
undefined,
|
undefined,
|
||||||
0,
|
0,
|
||||||
fee,
|
fee
|
||||||
privateKey
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -537,7 +535,6 @@ export class Registry {
|
|||||||
revealsDuration,
|
revealsDuration,
|
||||||
commitFee,
|
commitFee,
|
||||||
revealFee,
|
revealFee,
|
||||||
signer,
|
|
||||||
maxPrice,
|
maxPrice,
|
||||||
numProviders
|
numProviders
|
||||||
}: MsgCreateProviderAuction,
|
}: MsgCreateProviderAuction,
|
||||||
@ -548,17 +545,16 @@ export class Registry {
|
|||||||
const laconicClient = await this.getLaconicClient(account);
|
const laconicClient = await this.getLaconicClient(account);
|
||||||
|
|
||||||
return laconicClient.createAuction(
|
return laconicClient.createAuction(
|
||||||
|
account.address,
|
||||||
|
'provider',
|
||||||
commitsDuration,
|
commitsDuration,
|
||||||
revealsDuration,
|
revealsDuration,
|
||||||
commitFee,
|
commitFee,
|
||||||
revealFee,
|
revealFee,
|
||||||
undefined,
|
undefined,
|
||||||
signer,
|
|
||||||
'provider',
|
|
||||||
maxPrice,
|
maxPrice,
|
||||||
numProviders,
|
numProviders,
|
||||||
fee,
|
fee
|
||||||
privateKey
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -416,13 +416,13 @@ export class LaconicClient extends SigningStargateClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async createAuction (
|
public async createAuction (
|
||||||
commitsDuration: Duration | undefined,
|
|
||||||
revealsDuration: Duration | undefined,
|
|
||||||
commitFee: Coin | undefined,
|
|
||||||
revealFee: Coin | undefined,
|
|
||||||
minimumBid: Coin | undefined,
|
|
||||||
signer: string,
|
signer: string,
|
||||||
kind: string,
|
kind: string,
|
||||||
|
commitsDuration: Duration,
|
||||||
|
revealsDuration: Duration,
|
||||||
|
commitFee: Coin,
|
||||||
|
revealFee: Coin,
|
||||||
|
minimumBid: Coin | undefined,
|
||||||
maxPrice: Coin | undefined,
|
maxPrice: Coin | undefined,
|
||||||
numProviders: number,
|
numProviders: number,
|
||||||
fee: StdFee | 'auto' | number,
|
fee: StdFee | 'auto' | number,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { EncodeObject, GeneratedType } from '@cosmjs/proto-signing';
|
import { EncodeObject, GeneratedType } from '@cosmjs/proto-signing';
|
||||||
|
import { Coin } from '@cosmjs/amino';
|
||||||
|
|
||||||
import { MsgCommitBidResponse, MsgCommitBid, MsgRevealBid, MsgRevealBidResponse, MsgCreateAuction, MsgCreateAuctionResponse } from '../../../proto/cerc/auction/v1/tx';
|
import { MsgCommitBidResponse, MsgCommitBid, MsgRevealBid, MsgRevealBidResponse, MsgCreateAuction, MsgCreateAuctionResponse } from '../../../proto/cerc/auction/v1/tx';
|
||||||
import { Coin } from '@cosmjs/amino';
|
|
||||||
import { Duration } from '../../../proto/google/protobuf/duration';
|
import { Duration } from '../../../proto/google/protobuf/duration';
|
||||||
|
|
||||||
export const typeUrlMsgCreateAuction = '/cerc.auction.v1.MsgCreateAuction';
|
export const typeUrlMsgCreateAuction = '/cerc.auction.v1.MsgCreateAuction';
|
||||||
@ -51,7 +51,6 @@ export interface MsgCreateVickreyAuction {
|
|||||||
commitFee: Coin;
|
commitFee: Coin;
|
||||||
revealFee: Coin;
|
revealFee: Coin;
|
||||||
minimumBid: Coin;
|
minimumBid: Coin;
|
||||||
signer: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MsgCreateProviderAuction {
|
export interface MsgCreateProviderAuction {
|
||||||
@ -61,5 +60,4 @@ export interface MsgCreateProviderAuction {
|
|||||||
revealFee: Coin;
|
revealFee: Coin;
|
||||||
maxPrice: Coin;
|
maxPrice: Coin;
|
||||||
numProviders: number;
|
numProviders: number;
|
||||||
signer: string;
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user