nftTransfers - EVM Data Stream
The nftTransfers topic normalizes ERC-721 Transfer and ERC-1155 TransferSingle and TransferBatch events into one item per token moved, labelled as a transfer, mint, or burn. You get the same shape whichever standard the collection uses.
WebSocket-only topic. Subscribe with getblock_subscribe on any network endpoint.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
filters.tokenContract | string | No | NFT contract address. |
filters.from | string | No | Sender address. |
filters.to | string | No | Recipient address. |
filters.operator | string | No | ERC-1155 operator: the address that executed the transfer. Only ERC-1155 events carry an operator. |
filters.tokenId | string | No | One token ID as a hex quantity, for example "0x14e2e4". Decimal strings are rejected. |
filters.standard | string | No | erc721 or erc1155. |
filters.transferType | string | No | transfer, mint (from the zero address), or burn (to the zero address). |
Request Example
bash# WebSocket-only. Connect first:
wscat -c 'wss://stream.eu-central-1.getblock.io/v1/eth-mainnet/stream' -H 'Authorization: Bearer <API-KEY>'
# Then send:
{"jsonrpc":"2.0","id":1,"method":"getblock_subscribe","params":[{"topic":"nftTransfers","filters":{"tokenContract":"0xc36442b4a4522e871399cd717abdd847ab11fe88","transferType":"mint"}}]}javascript// npm install ws
import WebSocket from 'ws';
const ws = new WebSocket('wss://stream.eu-central-1.getblock.io/v1/eth-mainnet/stream', {
headers: { Authorization: 'Bearer <API-KEY>' }
});
ws.on('open', () => {
ws.send(JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getblock_subscribe',
params: [{
topic: 'nftTransfers',
filters: {
tokenContract: '0xc36442b4a4522e871399cd717abdd847ab11fe88',
transferType: 'mint'
}
}]
}));
});
ws.on('message', (raw) => {
const msg = JSON.parse(raw);
// First reply is the subscription ID (or an error)
if (msg.id !== undefined) {
console.log(msg.error ?? `Subscribed: ${msg.result}`);
return;
}
const { removed, data } = msg.params.result;
console.log(removed ? 'REVERTED' : data.transferType, data.standard, data.tokenContract, 'id', BigInt(data.tokenId).toString(), '→', data.to);
});python# pip install "websockets>=14"
import asyncio, json, websockets
URL = "wss://stream.eu-central-1.getblock.io/v1/eth-mainnet/stream"
HEADERS = {"Authorization": "Bearer <API-KEY>"}
async def main():
# ping_interval=None: the server sends its own keepalive pings (see Connection keepalive)
async with websockets.connect(URL, additional_headers=HEADERS, ping_interval=None) as ws:
await ws.send(json.dumps({
"jsonrpc": "2.0",
"id": 1,
"method": "getblock_subscribe",
"params": [{
"topic": "nftTransfers",
"filters": {
"tokenContract": "0xc36442b4a4522e871399cd717abdd847ab11fe88",
"transferType": "mint"
}
}]
}))
async for message in ws:
msg = json.loads(message)
# First reply is the subscription ID (or an error)
if "id" in msg:
print(msg.get("error") or f"Subscribed: {msg['result']}")
continue
event = msg["params"]["result"]
removed, data = event["removed"], event["data"]
print('REVERTED' if removed else data['transferType'], data['standard'], data['tokenContract'], 'id', int(data['tokenId'], 16), '→', data['to'])
asyncio.run(main())Response Example
The first reply is the subscription ID:
json{
"jsonrpc": "2.0",
"id": 1,
"result": "0x90665748bf0dc9af925b430bbf29ae3d"
}Every later message is an event notification (an ERC-721 mint):
json{
"jsonrpc": "2.0",
"method": "getblock_subscribe",
"params": {
"subscription": "0x90665748bf0dc9af925b430bbf29ae3d",
"result": {
"eventId": "eth:mainnet:receipts:0x830b6a483c183023519b834acfac62e7392ab7918c8…",
"removed": false,
"revision": 116877272,
"data": {
"standard": "erc721",
"tokenContract": "0xc36442b4a4522e871399cd717abdd847ab11fe88",
"from": "0x0000000000000000000000000000000000000000",
"to": "0x32ce7c9bc35243aba1d6a06933ec4081b2117881",
"tokenId": "0x14e2e4",
"amount": "0x1",
"transferType": "mint",
"address": "0xc36442b4a4522e871399cd717abdd847ab11fe88",
"blockNumber": "0x18d1e1f",
"transactionHash": "0xe0623924811bb927416695a43800b6647a53984bf85effbe094e26f04bdc1f2d",
"transactionIndex": "0xb3",
"blockHash": "0x830b6a483c183023519b834acfac62e7392ab7918c8f31b8d4188293e364d38f",
"blockTimestamp": "0x6ab110cf",
"logIndex": "0x135",
"removed": false
}
}
}
}An ERC-1155 transfer carries an operator and an amount greater than one:
json{
"data": {
"standard": "erc1155",
"tokenContract": "0xe8bd225aab19cd3cc0e98bd510e4b2fab91247a4",
"operator": "0xf4002e2535785ae17f28d2ed894fecb69b0d8f75",
"from": "0xf4002e2535785ae17f28d2ed894fecb69b0d8f75",
"to": "0x7f6f77c8ecc3828e02cd0bc0d40b24e61291cfbd",
"tokenId": "0xb4ae194a0dcf1b4080b164c1d775ee06e0817305",
"amount": "0x64",
"transferType": "transfer",
"address": "0xe8bd225aab19cd3cc0e98bd510e4b2fab91247a4",
"blockNumber": "0x18d1ece",
"transactionHash": "0x29f2dedcb2b82553ab82356ca9aa07d4c67e77505d03f390b5af935dac489245",
"transactionIndex": "0x74",
"blockHash": "0x3fee5dee0da3eecd8fc862fe5ced2f950207a4fbe16f466c370d4785c4dbc0cd",
"blockTimestamp": "0x6ab1191b",
"logIndex": "0xca",
"removed": false
}
}Response Parameters
The result object contains the event envelope and the payload in data.
| Field | Type | Description |
|---|---|---|
eventId | string | Stable event identifier. A reorg correction reuses it. |
removed | boolean | true when a reorg removed this previously delivered event. |
revision | number | Event version. For one eventId, a greater revision is newer. |
data.standard | string | erc721 or erc1155. |
data.transferType | string | transfer, mint, or burn. |
data.tokenContract | string | NFT contract address. |
data.from | string | Sender. The zero address for a mint. |
data.to | string | Recipient. The zero address for a burn. |
data.operator | string | ERC-1155 only: the address that executed the transfer. |
data.tokenId | string | Token ID, hex-encoded. Convert with BigInt(tokenId); IDs can exceed 2^53. |
data.amount | string | Number of tokens moved, hex-encoded. Always 0x1 for ERC-721. |
data.address | string | Address of the contract that emitted the log. |
data.blockNumber | string | Block number, hex-encoded. |
data.blockHash | string | Hash of the block that contains the log. |
data.blockTimestamp | string | Block timestamp in Unix seconds, hex-encoded. |
data.transactionHash | string | Hash of the transaction that emitted the log. |
data.transactionIndex | string | Transaction's position in the block, hex-encoded. |
data.logIndex | string | Log's position in the block, hex-encoded. |
data.removed | boolean | The underlying log's removed flag. Use the envelope's removed for reorg handling. |
An ERC-1155 TransferBatch becomes one notification per token ID in the batch. They share transactionHash and logIndex but have different eventId values.
Use Cases
- NFT portfolio and wallet views that update in real time
- Mint trackers and drop monitors (
transferType: "mint") - Marketplace and collection activity feeds
- Game-item inventories on ERC-1155 contracts
Error Handling
| Code | Message | Cause |
|---|---|---|
-32602 | invalid standard "…": must be erc721 or erc1155 | standard has an unsupported value. |
-32602 | invalid transferType "…": must be transfer, mint, or burn | transferType has an unsupported value. |
-32602 | … cannot unmarshal hex string without 0x prefix … | A hex-quantity filter was sent as a decimal string. Encode it as 0x…. |
-32602 | invalid tokenContract: invalid EVM address "…" | tokenContract is not a 20-byte hex address. |
-32602 | invalid nftTransfers request: json: unknown field "…" | The request has a field this topic does not accept. |
-32001 | subscription limit exceeded | You already have 15 active or pending subscriptions. |