본문으로 건너뛰기

Get activities data

Activities are enriched blockchain events which Immutable provides to developers through the Get Activity and List Activities functions.

Get activities dataGet activities data

Activity types

Currently, the following activityTypes are supported with Immutable's SDK functions:

Activity TypeDescription
mintAn activity of type mint means an NFT has been created and recorded onto a blockchain as a unique and indivisible digital asset, representing digital art, music, videos, or other creative works.
burnAn activity of type burn identifies an NFT that has been intentionally and permanently destroyed, usually by sending it to an unspendable address (0x0000000000000000000000000000000000000000).
transferAn activity of type transfer means an NFT has been sent from one person's digital wallet address to another person's digital wallet address, resulting in a change of ownership on the blockchain.
saleAn activity of type sale means an NFT has been exchanged for a certain amount of cryptocurrency or fiat currency between a buyer and a seller on an online marketplace.
depositAn activity of type deposit means an ERC20 token has been deposited from Ethereum
withdrawalAn activity of type withdrawal means an ERC20 token has been withdrawn to Ethereum

Request parameters

ParameterDescriptionRequired
chainNameString representing the name of the chain; only imtbl-zkevm-testnet is currently supportedYes
contractAddressThe contract address of ERC721 contract you want to filter byNo
activityTypeFilter by activityNo
Pagination parametersParameters such as page_size and page_cursor that allow you to control the size and order of the data retrievedNo

Usage

The ListActivities function returns a list of activities associated with a chain, collection or individual NFT. Specify the activityType that you wish to filter the activities returned by. Leaving this blank will return all activities. You can get a list of activities or details about a single activity with the following:

const chainName = CHAIN_NAME;
const contractAddress = CONTRACT_ADDRESS;
const activityType = ACTIVITY_TYPE;
const response = await client.listActivities({
chainName,
contractAddress,
activityType,
});

Example response

{
"result": [
{
"id": "4e28df8d-f65c-4c11-ba04-6a9dd47b179b",
"chain": {
"id": "eip155:13473",
"name": "imtbl-zkevm-testnet"
},
"type": "mint",
"details": {
"to": "0xe9b00a87700f660e46b6f5deaa1232836bcc07d3",
"amount": "1",
"asset": {
"contract_type": "ERC721",
"contract_address": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e",
"token_id": "1"
}
},
"indexed_at": "2022-08-16T17:43:26.991388Z",
"blockchain_metadata": {
"transaction_hash": "0x68d9eac5e3b3c3580404989a4030c948a78e1b07b2b5ea5688d8c38a6c61c93e",
"block_number": "1",
"transaction_index": "1",
"log_index": "1"
}
}
]
}
정보
  • Date parameters such as fromIndexedAt and toIndexedAt should be formated as ISO8601 UTC Date. :::