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
  • bazaarOrder
  • bazaarOrders
  • bazaarTransactions
  • Object Types
  • BazaarOrder
  • Bazaar Transaction
  • Examples
  1. API
  2. Community GraphQL API

Bazaar

PreviousAuctionsNextHeroes

Last updated 1 year ago

Queries

bazaarOrder

Returns a single Bazaar Order according to its orderId.

bazaarOrder(orderId: ID!): BazaarOrder

bazaarOrders

Returns multiple Bazaar Orders according to the passed.

bazaarOrders(
  skip: Int
  first: Int
  orderBy: BazaarOrderOrderBy
  orderDirection: OrderDirection
  where: BazaarOrderFilter
): [BazaarOrder]!

bazaarTransactions

Returns multiple Bazaar Transactions according to the passed.

bazaarTransactions(
  skip: Int
  first: Int
  orderBy: BazaarTransactionOrderBy
  orderDirection: OrderDirection
  where: BazaarTransactionFilter
): [BazaarTransaction]!

Object Types

BazaarOrder

The BazaarOrder object type contains the following fields:

  • orderId: ID - the order ID - Crystalvale IDs are padded by 1000000000000 (one trillion), and Serendale (Klaytn) IDs are padded by 2000000000000 (two trillion).

  • network: String - the network of the order, either dfk or kla

  • open: Boolean - whether the order is currently open (true) or closed (false)

  • cancelledStamp: Int - if the order was cancelled, the Unix timestamp of the cancellation

  • createdStamp: Int - the Unix timestamp at which the order was created

  • tokenAddress: String - the contract address of the order token

  • tokenId: Int - for ERC-1155 tokens, the tokenId; for ERC-20 tokens, 0

  • isErc20: Boolean - whether the order token is an ERC-20 token (true) or an ERC-1155 token (false)

  • side: Int - whether the order is submitted to the buy (0) or sell (1) side of the order book

  • price: String - the pricePerUnit (in wei) * 10^12

Note: The JEWEL Price per Unit (in ether) is equal to: price / 10^30.

  • initialQuantity: String - the quantity of tokens initially submitted with the order

  • remainingQuantity: String - the remaining quantity of items that are unfulfilled in the order

  • baseTokenAddress: String - the contract address of the base token (always JEWEL)

  • owner: Profile - the Profile of the owner/creator of the order

Bazaar Transaction

The BazaarTransaction object type contains the following fields:

  • orderId: ID - the order ID that is being transacted upon - Crystalvale IDs are padded by 1000000000000 (one trillion), and Serendale (Klaytn) IDs are padded by 2000000000000 (two trillion).

  • network: String - the network of the order/transaction, either dfk or kla

  • txHash: String - the blockchain transaction hash of the transaction

  • executedStamp: Int - the Unix timestamp at which the transaction was executed

  • quantity: String - the quantity of tokens executed in the transaction

  • price: String - the pricePerUnit (in wei) * 10^12

Note: The JEWEL Price per Unit (in ether) is equal to: price / 10^30.

  • side: Int - whether the order being transacted upon is on the buy (0) or sell (1) side of the order book

  • tokenAddress: String - the contract address of the transacted token

  • tokenId: Int - for ERC-1155 tokens, the tokenId; for ERC-20 tokens, 0

  • initiator: Profile - the Profile of the initiator of the transaction

  • owner: Profile - the Profile of the owner/creator of the order that is being transacted upon

Examples

Example 1

The first 100 open Bazaar Orders sorted by most recently created:

{
  bazaarOrders(
    first: 100,
    orderBy: createdStamp,
    orderDirection: desc,
    where: {
      open: true
    }
  ) {
    orderId
    tokenAddress
    price
    side
  }
}

Example 2

All Bazaar Transactions for Bloaters executed against buy orders on DFK Chain

{
  bazaarTransactions(
    where: {
      network: "dfk",
      side: 0,
      tokenAddress: "0x268CC8248FFB72Cd5F3e73A9a20Fa2FF40EfbA61"
    }
  ) {
    orderId
    price
    executedStamp
    quantity
  }
}

Note: The results returned will be for sell transactions (side 1), since they are being executed against open buy orders (side 0).

arguments
arguments