LogoLogo
  • DFK Developer Docs
  • Contracts
    • Exchanges
      • The Trader
      • The Bazaar
    • Sales & Rentals
      • Hero Auction
      • Hero Rental
      • Equipment Auction
      • Pet Auction
      • Land Auction
    • Summoning
      • Hero Summoning
        • Dark Summoning
      • Pet Hatching
    • Meditation Circle
    • Quests
      • Quest Core
      • Historical Contracts
        • Quest Core
        • Profession Quests
        • Training Quests
    • Void Hunts
    • Patrols
    • PVP Combat
    • Influence System
    • Gardens
      • Master Gardener
    • Jeweler 2.0
      • Power-Ups
      • Jeweler 1.0
    • Profiles
    • DFK Duel
      • Previous Seasons
      • Raffle Master
    • Events
      • Gen0 Reroll
      • Gene Reroll
      • Perilous Journey
    • Bridging
      • Hero Bridge (Synapse)
      • Hero Bridge (LayerZero)
      • Equipment Bridge (Synapse)
      • Equipment Bridge (LayerZero)
      • Item Bridge V2
        • Item Bridge V1 (Deprecated)
      • Gaia's Tear Bridge
    • Miscellaneous
      • Airdrops
      • Charity
      • Flag Storage
      • Gen0 Airdrop (Harmony)
      • Gen0 Sale (Harmony)
      • Graveyard
      • Locked Token Claim
      • Locked Token Raffle
      • Token Disburse
  • NFTs
    • Heroes
      • HeroV4 (Metis)
    • Equipment
      • Weapons
      • Armor
      • Accessories
      • Shared Equipment Mappings
      • CacheCore
      • Equipment Shop
      • Visage Shop
    • Pets
      • Pet Exchange
    • Lands
  • Tokens
    • Ecosystem Token
    • Power Tokens
    • Governance Tokens
    • Currencies
      • DFK Gold
      • Gaia's Tears
    • Inventory Items
    • Gold Crops
    • Combat Items
    • Miscellaneous Tokens
      • Collectible Items
      • Raffle Tickets
  • Crafting
    • Alchemist
    • Nutritionist
    • Stone Carver
    • Vendor (Item Gold Trader)
  • Collections
    • Runes
    • Pet Eggs
    • Pet Treats
    • Potions & Consumables
      • Item Consumer
      • Potion Migrator
    • Enhancement Stones
    • Attunement Crystals
      • Atonement Crystals
    • Pages of the Eternal Story
  • API
    • Community GraphQL API
      • Getting Started
      • Auctions
      • Bazaar
      • Heroes
      • Pets
      • Profiles
    • Hero Metadata & Image API
    • Pet Metadata & Image API
    • Token Supply API
  • Community Builders
    • Kingdom Building Program
    • Developer Resources
    • Community Projects
  • DFK CHain
    • Getting Started
    • Nodes & Validators
    • Bridged Tokens
    • Ecosystem Partners
      • Covalent API
      • SupraOracles Price Feeds
      • SupraOracles VRF
    • Miscellaneous Contracts
Powered by GitBook
On this page
  • Queries
  • saleAuction
  • saleAuctions
  • assistingAuction
  • assistingAuctions
  • petAuction
  • petAuctions
  • Object Types
  • Auction
  • PetAuction
  • Examples
  1. API
  2. Community GraphQL API

Auctions

PreviousGetting StartedNextBazaar

Last updated 1 year ago

Queries

saleAuction

Returns a single Sale Auction according to its id.

saleAuction(id: ID!): Auction

saleAuctions

Returns multiple Sale Auctions according to the passed.

saleAuctions(
  skip: Int
  first: Int
  orderBy: AuctionOrderBy
  orderDirection: OrderDirection
  where: AuctionFilter
): [Auction]!

assistingAuction

Returns a single Assisting Auction according to its id.

assistingAuction(id: ID!): Auction

assistingAuctions

assistingAuctions(
  skip: Int
  first: Int
  orderBy: AuctionOrderBy
  orderDirection: OrderDirection
  where: AuctionFilter
): [Auction]!

petAuction

Returns a single Pet Auction according to its id.

petAuction(id: ID!): PetAuction

petAuctions

petAuctions(
  skip: Int
  first: Int
  orderBy: AuctionOrderBy
  orderDirection: OrderDirection
  where: AuctionFilter
): [PetAuction]!

Object Types

Auction

The Auction object type contains the following fields:

Basic Information

  • id: ID - the Auction ID. Crystalvale IDs are padded by 10000000000000 (ten trillion), and Serendale (Klaytn) IDs are padded by 20000000000000 (twenty trillion).

  • seller: Profile - the Profile of the Auction seller

  • tokenId: Hero - the Hero being Sold/Rented

The tokenId field will return current values for the Hero, not its historical values at the time of the Auction.

  • startingPrice: String - the price set at the start of the Auction in wei

  • endingPrice: String - the price at the end of the Auction in wei

  • duration: Int - the duration of the Auction in seconds; not currently in use

  • startedAt: Int - the Unix timestamp of the Auction start

  • winner: Profile - the Profile of the Auction winner; will be pre-filled for Private Auctions, even when open

  • endedAt: Int - the Unix timestamp of the Auction end

  • open: Boolean - whether the Auction is open or not

  • purchasePrice: String - the price paid by the winner in wei

PetAuction

The PetAuction object type contains the following fields:

Basic Information

  • id: ID - the Auction ID

  • seller: Profile - the Profile of the Auction seller

  • tokenId: Pet - the Pet being Sold

  • startingPrice: String - the price set at the start of the Auction in wei

  • endingPrice: String - the price at the end of the Auction in wei

  • duration: Int - the duration of the Auction in seconds; not currently in use

  • startedAt: Int - the Unix timestamp of the Auction start

  • winner: Profile - the Profile of the Auction winner; will be pre-filled for Private Auctions, even when open

  • endedAt: Int - the Unix timestamp of the Auction end

  • open: Boolean - whether the Auction is open or not

  • purchasePrice: String - the price paid by the winner in wei

Examples

Example 1

The first 100 open, non-private Sale Auctions sorted by lowest priced Hero:

{
  saleAuctions(first: 100, orderBy: startingPrice, orderDirection: asc, where: {endedAt: null, winner: null}) {
    id
    startingPrice
    open
    tokenId {
      id
      mainClass
    }
    seller {
      name
    }
  }
}

Using where: {open: true} would generally work as well, but a handful of completed Auctions got stuck with the open flag set to True and will appear in results otherwise.

Example 2

The five most expensive Pet sales that were successfully completed:

{
  petAuctions(first: 5, orderBy: purchasePrice, orderDirection: desc, where: {purchasePrice_not: null}) {
    id
    tokenId {
      id
    }
    purchasePrice
    winner {
      name
    }
  }
}

Example 3

The entire Sale history (successful or not) of an individual Hero:

{
  saleAuctions(where: {tokenId: 420}) {
    id
    startingPrice
    purchasePrice
    endedAt
    seller {
      name
    }
    winner {
      name
    }
  }
}

Example 4

All successful Rentals (Assisting Auctions) purchased by an individual player:

{
  assistingAuctions(where: {winner: "0x2E7669F61eA77F02445A015FBdcFe2DE47083E02"}) {
    id
    purchasePrice
    endedAt
    tokenId {
      id
    }
    seller {
      name
    }
  }
}

Note that the tokenId in this example is that of the Hero that was Hired out, not the one it was paired with during summoning, or the Id of the Hero summoned by the transaction.

Returns multiple Assisting Auctions according to the passed.

Returns multiple Pet Auctions according to the passed.

arguments
arguments
arguments