NFT Collection Events

Live-streamed transactions for an NFT collection.

ℹ️

This endpoint is available on Codex Growth and Enterprise Plans

Endpoint: onNftEventsCreated

Method: POST

Arguments

NameTypeDescription
addressString

The contract address for the NFT collection.

networkIdInt

The network ID the NFT collection is deployed on.

Response

NameTypeDescription
addressString!The contract address of the NFT collection.
events[NftEvent]!A list of NFT transactions streaming real-time.
idString!The id of the collection (address:networkId).
networkIdInt!The network ID the collection is deployed on.

NameTypeDescription
aggregatorAddressStringThe contract address of the marketplace aggregator that routed the transaction.
blockNumberInt!The block number for the transaction.
contractAddressString!The contract address of the NFT collection.
eventTypeString!The event type of the transaction.
exchangeAddressString!The NFT marketplace address of the transaction.
fillSourceStringThe name of the marketplace that processed the transaction.
idString!The ID of the NFT event (contractAddress:tokenId:networkId).
individualPriceNetworkBaseTokenStringThe price of each individual NFT in the network's base token.
individualPriceUsdStringThe price of each individual NFT in USD.
individualTradePriceStringThe price of each individual NFT in the purchasing token.
logIndexInt!The index of the log in the block.
makerString!The wallet address of the buyer.
networkIdInt!The network ID the NFT collection is deployed on.
numberOfTokensStringThe number of assets involved in the transaction.
orderDirectionNftEventOrderDirectionThe direction of the order. One of 'BUY', 'SELL', or 'OFFER_ACCEPTED'.
paymentTokenAddressString!The contract address of the purchasing token.
poolAddressStringThe contract address of the NFT pool, if applicable.
priceErrorStringThe reason for the price error, if applicable. Can be NO_TOKEN_DATA, NO_TOKEN_PRICE, or LOW_LIQUIDITY_PAIR.
sortKeyString!The sortKey for the event (blockNumber#transactionIndex#logIndex (+ #marketplaceEventLogIndex if applicable), zero padded). For example, 0000000016414564#00000224#00000413#00000414.
takerString!The wallet address of the seller.
timestampInt!The unix timestamp for the transaction.
tokenIdString!The token ID of the NFT asset involved in the transaction.
totalPriceNetworkBaseTokenStringThe total trade price for the transaction in the network's base token. (The transaction can include more than 1 token).
totalPriceUsdStringThe total trade price for the transaction in USD. (The transaction can include more than 1 token).
totalTradePriceStringThe total trade price for the transaction in the purchasing token. (The transaction can include more than 1 token).
tradeOffer[NftEventTradeItem!]The tokens/NFTs that were offered to make this transaction occur.
tradeReceived[NftEventTradeItem!]The tokens/NFTs that were received in this transaction.
transactionHashString!The unique hash for the transaction.
transactionIndexInt!The index of the transaction within the block.

Example

Query

subscription MySubscription($address: String, $networkId: Int) {
  onCreateNftEvents(address: $address, networkId: $networkId) {
    address
    id
    networkId
    events {
      blockNumber
      contractAddress
      data {
        buyHash
        metadata
        price
        maker
        taker
        type
        sellHash
      }
      eventType
      exchangeAddress
      fillSource
      id
      individualPriceNetworkBaseToken
      individualPriceUsd
      individualTradePrice
      logIndex
      maker
      networkId
      numberOfTokens
      paymentTokenAddress
      poolAddress
      priceError
      sortKey
      taker
      timestamp
      tokenId
      totalPriceNetworkBaseToken
      totalPriceUsd
      totalTradePrice
      transactionHash
      transactionIndex
    }
  }
}

Response

{
  "id": "bayc",
  "type": "data",
  "payload": {
    "data": {
      "onCreateNftEvents": {
        "address": "0x60bb1e2aa1c9acafb4d34f71585d7e959f387769",
        "id": "0x60bb1e2aa1c9acafb4d34f71585d7e959f387769:1",
        "networkId": 1,
        "events": [
          {
            "blockNumber": 16414564,
            "contractAddress": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
            "data": {
              "buyHash": "0xf2e04cc65511238148ba6e20cee69b1256a8bab0832c03821efd002896b7b0cb",
              "metadata": null,
              "price": "69000000000000000000",
              "maker": "0x8bc110db7029197c3621bea8092ab1996d5dd7be",
              "taker": "0x70bc9c82dec52c50bc17077a1b0dda5f1c7e5b64",
              "type": "BlurOrdersMatched",
              "sellHash": "0xeb5fcc8a086a726553720247d62f393e11bf9ae63c6954e56289eb0ce789c310"
            },
            "eventType": "BlurOrdersMatched",
            "exchangeAddress": "0x000000000000ad05ccc4f10045630fb830b95127",
            "fillSource": "BLUR",
            "id": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d:1886:1",
            "individualPriceNetworkBaseToken": "69",
            "individualPriceUsd": "106969.830378848997",
            "individualTradePrice": "69",
            "logIndex": 413,
            "maker": "0x8bc110db7029197c3621bea8092ab1996d5dd7be",
            "networkId": 1,
            "numberOfTokens": "1",
            "paymentTokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
            "poolAddress": null,
            "priceError": null,
            "sortKey": "0000000016414564#00000224#00000413#00000414",
            "taker": "0x70bc9c82dec52c50bc17077a1b0dda5f1c7e5b64",
            "timestamp": 1673814263,
            "tokenId": "1886",
            "totalPriceNetworkBaseToken": "69",
            "totalPriceUsd": "106969.830378848997",
            "totalTradePrice": "69",
            "transactionHash": "0xd1649f072b59a84cac3fdea46904d4c9f07820d57b35273c956ce4f8252580be",
            "transactionIndex": 224
          }
        ]
      }
    }
  }
}

👋

Join our Discord

Ask questions, share what you're working on and request new features 👬👭