nftTransfers - EVM Data Stream
Stream normalized ERC-721 and ERC-1155 transfers, mints, and burns. Complete guide on how to use the nftTransfers topic in GetBlock EVM Data Stream documentation.
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.
Parameters
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
# 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"}}]}// 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);
});Response Example
The first reply is the subscription ID:
Every later message is an event notification (an ERC-721 mint):
An ERC-1155 transfer carries an operator and an amount greater than one:
Response Parameters
The result object contains the event envelope and the payload in data.
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.
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
-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.
Last updated
Was this helpful?