Skip to main content

Schema Reference

The GraphQL API provides access to ERC token data through five tables. This page details the available fields, data types, and relationships.

erc_token

Stores metadata for pure ERC-20, ERC-721, and ERC-1400 token contracts deployed to Hedera's EVM.

Fields

FieldTypeDescription
token_idbigintHedera entity ID for the contract
token_evm_addressstringContract's EVM address (0x format)
contract_typestringToken type: ERC_20, ERC_721, ERC_1400, UNKNOWN, or FAILED_DEPLOYMENT
namestringToken name
symbolstringToken symbol
decimalsbigintDecimal places (ERC-20 and ERC-1400, NULL for ERC-721)
total_supplynumericTotal token supply (handles uint256 values)
metadata_reliability_scoredecimalQuality score from 0.00 to 1.00
created_timestampbigintContract creation time (nanoseconds since epoch)
processing_timestampbigintLast processing time (nanoseconds since epoch)
transfers_indexed_timestampbigintLast indexed transfer timestamp (nanoseconds, NULL if not indexed)

Token Features

  • Primary storage for token contract metadata
  • Distinguishes between ERC-20, ERC-721, and ERC-1400 standards
  • Tracks deployment failures and unknown contract types
  • Includes reliability scoring for metadata quality

erc_token_account

Tracks ERC-20/ERC-1400 balances and ERC-721 ownership counts with unified account tracking.

Fields

FieldTypeDescription
account_idbigintHedera account ID (resolved from EVM addresses)
token_idbigintReferences erc_token
token_evm_addresstextOriginal EVM address used for balance lookup
balancenumericToken balance (wei for ERC-20/ERC-1400, NFT count for ERC-721)
balance_timestampbigintLast balance update (nanoseconds since epoch)
created_timestampbigintFirst association time (nanoseconds since epoch)
associatedbooleanAlways true for pure ERC tokens

Account Features

  • All addresses resolved to Hedera account IDs (no fragmentation)
  • EVM addresses automatically resolved via account-num aliases or entity lookups
  • Stores balances as NUMERIC to handle uint256 values
  • For ERC-20/ERC-1400: Balance in wei (smallest unit)
  • For ERC-721: Count of NFTs owned by account
  • Primary key: (token_id, account_id) ensures one balance per account-token pair

erc_nft

Tracks individual NFTs within ERC-721 collections.

Fields

FieldTypeDescription
token_idbigintReferences the ERC-721 contract in erc_token
serial_numbernumericThe individual NFT's tokenId (supports full uint256 range)
account_idbigintCurrent owner's Hedera account ID (NULL for unresolved addresses)
deletedbooleanBurn status (true if NFT was burned)
metadatabyteaMetadata URI (e.g., ipfs://... or https://...)
created_timestampbigintWhen NFT was first minted (nanoseconds since epoch)
processing_timestampbigintWhen this record was processed (nanoseconds since epoch)

NFT Features

  • Individual NFT ownership tracking by tokenId
  • Automatic tokenURI metadata extraction for all NFTs
  • Burn status tracking via deleted flag
  • Supports full uint256 range for tokenIds
note

Many NFTs have NULL account_id values. This occurs when the owner is a pure EVM address that has never interacted with Hedera native services (no HBAR transfers, no HTS usage). These addresses exist only in the EVM layer and cannot be resolved to Hedera account IDs. The erc_token_account balance table only includes resolved owners.

erc_token_transfer

Stores transfer history for ERC-20 and ERC-1400 fungible tokens.

Fields

FieldTypeDescription
token_idbigintHedera contract ID for the token
consensus_timestampbigintTransfer time (nanoseconds since epoch)
log_indexintegerEvent index within transaction
token_evm_addresstextEVM address of token contract
contract_typevarcharToken type: ERC_20 or ERC_1400
transaction_hashtextTransaction hash
payer_account_idbigintHedera account ID of transaction payer
payer_evm_addresstextEVM address of payer
transfer_typevarcharType: transfer, mint, burn, partition_mint, partition_transfer, partition_burn
sender_account_idbigintSender's Hedera account ID (NULL for mints)
sender_evm_addresstextSender's EVM address
receiver_account_idbigintReceiver's Hedera account ID (NULL for burns)
receiver_evm_addresstextReceiver's EVM address
amountnumericTransfer amount in smallest unit (wei)
partition_idtextERC-1400 partition identifier (NULL for ERC-20)
operator_account_idbigintOperator account ID (ERC-1400 only)
operator_evm_addresstextOperator EVM address (ERC-1400 only)

Account ID Resolution

note

The *_account_id fields may be NULL for pure EVM addresses that haven't interacted with Hedera native services. Use the corresponding *_evm_address fields as a fallback when account IDs are unavailable.

Transfer Types

TypeStandardDescription
transferERC-20, ERC-1400Standard token transfer
mintERC-20, ERC-1400Token creation (from 0x0 address)
burnERC-20, ERC-1400Token destruction (to 0x0 address)
partition_mintERC-1400 onlySecurity token issued to partition
partition_transferERC-1400 onlyTransfer within/across partitions
partition_burnERC-1400 onlyPartition-based redemption

erc_nft_transfer

Stores transfer history for ERC-721 NFTs.

Fields

FieldTypeDescription
token_idbigintHedera contract ID for the NFT collection
serial_numbernumericNFT tokenId within the collection
consensus_timestampbigintTransfer time (nanoseconds since epoch)
log_indexintegerEvent index within transaction
token_evm_addresstextEVM address of NFT contract
transaction_hashtextTransaction hash
payer_account_idbigintHedera account ID of transaction payer
payer_evm_addresstextEVM address of payer
transfer_typevarcharType: transfer, mint, burn
sender_account_idbigintSender's Hedera account ID (NULL for mints)
sender_evm_addresstextSender's EVM address
receiver_account_idbigintReceiver's Hedera account ID (NULL for burns)
receiver_evm_addresstextReceiver's EVM address

Data Types and Constraints

Numeric Types

  • BIGINT: Used for Hedera IDs, timestamps, and counts
  • NUMERIC: Used for balances and supplies (handles uint256 values up to 2^256-1)
  • DECIMAL(3,2): Used for reliability scores (0.00 to 1.00)

Timestamp Formats

All timestamps use nanoseconds since epoch (Hedera format):

  • created_timestamp: Contract/entity creation time
  • balance_timestamp: Last balance update time
  • processing_timestamp: When the record was processed/synced
  • transfers_indexed_timestamp: Last indexed transfer time
  • consensus_timestamp: Transaction consensus time (transfer tables)

Contract Types

Valid values for contract_type field:

  • ERC_20: Standard ERC-20 fungible token
  • ERC_721: Standard ERC-721 NFT collection
  • ERC_1400: ERC-1400 security token
  • UNKNOWN: Contract type could not be determined
  • FAILED_DEPLOYMENT: Contract deployment failed

Relationships

The tables are related as follows:

erc_token (1) ─────────────┬──── (*) erc_token_account

├──── (*) erc_nft

├──── (*) erc_token_transfer

└──── (*) erc_nft_transfer
  • One token can have many account balances
  • One token can have many NFTs (for ERC-721 tokens)
  • One token can have many transfers (fungible or NFT)
  • Account balances reference tokens via token_id
  • NFTs reference their collection via token_id
  • Transfer history references tokens via token_id
  • NFT transfers also reference specific NFTs via serial_number

Query Examples

Get token with its holders

# Step 1: Get token metadata
query GetToken($tokenId: bigint!) {
erc_token_by_pk(token_id: $tokenId) {
token_id
name
symbol
contract_type
}
}

# Step 2: Get holders for that token (separate query)
query GetTokenHolders($tokenId: bigint!) {
erc_token_account(
where: {
token_id: { _eq: $tokenId }
balance: { _gt: "0" }
}
order_by: { balance: desc }
limit: 100
) {
account_id
balance
balance_timestamp
}
}

Get NFT collection with individual NFTs

# Step 1: Get NFT collection metadata
query GetNFTCollection($tokenId: bigint!) {
erc_token_by_pk(token_id: $tokenId) {
token_id
name
symbol
total_supply
}
}

# Step 2: Get NFTs in the collection (separate query)
query GetNFTsInCollection($tokenId: bigint!) {
erc_nft(
where: {
token_id: { _eq: $tokenId }
deleted: { _eq: false }
}
order_by: { serial_number: asc }
limit: 100
) {
serial_number
account_id
metadata
created_timestamp
}
}
note

The ERC schema uses separate tables without nested GraphQL relationships. Query the token first, then use its token_id to fetch related holders or NFTs.

For more comprehensive query examples, see the Query Examples page.