View as Markdown

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
var request = Hiro.AuctionCreateRequest.new()
request.template_id = "template_auction_001";
request.condition_id = "condition_001";
request.instance_ids = ["item_instance_001"];

var auction = await hiro.auctionsCreate(session, request)
print(auction)

To restrict the auction to specific players, set allowed_user_ids to a list of user IDs when you create it: only those users can see or bid on the auction, which lets you set up a restricted auction, such as a guild sale, a friends-only listing, or a one-to-one trade, instead of a public listing.

1
2
3
4
5
6
7
8
var request = Hiro.AuctionCreateRequest.new()
request.template_id = "template_auction_001";
request.condition_id = "condition_001";
request.instance_ids = ["item_instance_001"];
request.allowed_user_ids = ["user_id_456", "user_id_789"];

var auction = await hiro.auctionsCreate(session, request)
print(auction)

Placing a Bid on an Auction #

You can place a bid on an auction using the auctionsBid function. A bid’s currencies field is optional: you can bid with inventory item instances instead of currency, or combine both in the same bid.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
var request = Hiro.AuctionBidRequest.new()
request.id = "auction_instance_123";
request.version = "1.0";
request.bid = Hiro.AuctionBidAmount.new()
request.bid.instance_ids = ["item_instance_042", "item_instance_043"];
request.bid.currencies = {
    "gold": "500"
};

var auction = await hiro.auctionsBid(session, request)
print(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
var request = Hiro.AuctionsCancelRequest.new()
request.id = "auction_instance_123";

var auctionCancel = await hiro.auctionsCancel(session, request)
print(auctionCancel)

Claiming a Winning Bid #

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

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

var auctionClaimBid = await hiro.auctionsClaimBid(session, request)
print(auctionClaimBid)

Listing Available Auctions #

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

1
2
3
4
var request = Hiro.AuctionListRequest.new()

var auctionList = await hiro.auctionsList(session, request)
print(auctionList)

Set allowed_only to true to only return directed auctions where you’re included in the allowed users list. Leave it false (the default) to only return public auctions instead: the two result sets are disjoint, so a single call returns one or the other, not both.

1
2
3
4
5
var request = Hiro.AuctionListRequest.new()
request.allowed_only = true

var auctionList = await hiro.auctionsList(session, request)
print(auctionList)