getNFTEvents

Get NFT events (mint, burn, transfer) associated with a single NFT.

How to use getNFTEvents method ?

Below, you'll find an in-depth guide that provides a comprehensive explanation of how to utilize the getNFTEvents method effectively using Blast.

Parameters

Below, you can find the query parameters accepted by the method.

ParameterTypeDescription

contractAddress*

string

The contract address of the NFT

tokenId

string

The token Id (hex or number)

fromBlock

number

Starting block for querying

toBlock

number

Ending block for querying

pageSize

number

Maximum number of records to be retrieved in one page (max 100, default 25)

pageKey

string

Key used to get the next page of results. Must be set to the value of nextPageKey returned in the previous response

Returns

ParameterTypeDescription

count

number

The number of NFT events

nextPageKey

string

Key to get the next page of results if more are available.

events

array<object>

array of NFTEvent objects

contractAddress

string

The address of the NFT contract

contractName

string

The name of the NFT contract

contractSymbol

string

The symbol of the NFT contract

contractType

string

The type of the NFT contract ('erc721' or 'erc1155')

tokenId

string

The token ID of the NFT

eventType

string

The event type (Mint, Transfer, Burn)

amount

string

The quantity of tokens transferred

toAddress

string

The destination address for the NFT Event

blockHash

string

The block hash of the NFT Event Occurrence

blockNumber

number

The height of the block of the NFT Event Occurrence

blockTimestamp

string

The block timestamp of the NFT Event Occurrence

transactionHash

string

Transaction Hash of the NFT Event Occurrence

This API is paginated, response items are ordered descending by:

  • blockNumber

  • transferIndex

Example Request and Result for getNFTEvents

In this section, you can find an illustrative example of a request made to retrieve the count of the NFTEvents and the events objects using the getNFTEvents method.

The example in this section uses a non-existing project id.

Make sure you replace it with your Starknet endpoint when issuing the Builder API calls.

Don't have a project id? Here's a straightforward guide on how to obtain one!

Returns the total number of NFT events and the array of NFTEvent objects.

GET https://starknet-mainnet.blastapi.io/<project_id>/builder/getNFTEvents?

Query Parameters

NameTypeValue

contractAddress

string

0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1

tokenId

string

3095038
{
  "count": 1,
  "events": [
    {
      "contractAddress": "0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1",
      "contractName": "Spok",
      "contractSymbol": "SPOK",
      "contractType": "erc721",
      "tokenId": "3095038",
      "eventType": "Mint",
      "amount": "1",
      "fromAddress": "0x0000000000000000000000000000000000000000000000000000000000000000",
      "toAddress": "0x0500bfd99cca3525caf7e2757b160cd0fa097c5736def17c484f45f436f0e07a",
      "blockHash": "0x07d939d2a29da4388477864f12e52b678d1e82d5ad6b2d39f6b5edfff4b6b9b6",
      "blockNumber": 623016,
      "blockTimestamp": "2024-03-19T18:16:48.000Z",
      "transactionHash": "0x06d9a4b33ad6bb76ea5782919de4507865f295ae5e78e0f381b66528128e85a3"
    }
  ]
}
curl -X GET https://starknet-mainnet.blastapi.io/<project-id>/builder/getNFTEvents?contractAddress=0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1&tokenId=3095038 \
-H 'Content-Type: application/json' \

Last updated