Auctions #

Read more about the Auctions system in Hiro here.

Creating a New Auction #

To create a new auction, use the auctionsCreate function.

1
2
3
4
5
6
7
8
9
const request = new AuctionCreateRequest();
request.templateId = "template_auction_001";
request.conditionId = "condition_001";
request.instanceIds = {
    "item_instance_001": "1"
};

const auction = await hiroClient.auctionsCreate(session, request);
console.log(auction);

Placing a Bid on an Auction #

You can place a bid on an auction using the auctionsBid function.

1
2
3
4
5
6
7
8
9
const request = new AuctionBidRequest();
request.id = "auction_instance_123";
request.version = "1.0";
request.instanceIds = {
    "gold": "1000"
};

const auction = await hiroClient.auctionsBid(session, request);
console.log(auction);

Canceling an Auction #

If an auction needs to be canceled before it ends, the auctionsCancel method can be used.

1
2
3
4
5
const request = new AuctionsCancelRequest();
request.id = "auction_instance_123";

const auctionCancel = await hiroClient.auctionsCancel(session, request);
console.log(auctionCancel);

Claiming a Winning Bid #

Once an auction has ended, the winning bidder can claim their item using auctionsClaimBid.

1
2
3
4
5
const request = new AuctionClaimBidRequest();
request.id = "auction_instance_123";

const auctionClaimBid = await hiroClient.auctionsClaimBid(session, request);
console.log(auctionClaimBid);

Listing Available Auctions #

You can list the currently available auctions using the auctionsList function.

1
2
3
4
const request = new AuctionListRequest();

const auctionList = await hiroClient.auctionsList(session, request);
console.log(auctionList);