improved

NFT API – Improved Token ID Sequencing for V2 & V3

Improvement to NFT Token ID and Token Type ID Assignment in Venly NFT API v2 and v3

We've enhanced how Token IDs and Token Type IDs are assigned when minting NFTs. Previously, ID assignment could create non-sequential gaps, making token tracking difficult. Now, all IDs follow predictable sequential patterns.


What's New

Sequential NFT Token IDs

All minted NFT tokens under a contract (regardless of token type) receive sequential Token IDs starting from 1.

Example:

  • Mint 3 NFTs from any token type → Token IDs assigned: 1, 2, 3

Non-Fungible Token Type IDs

Non-fungible token types under a contract receive sequential Token Type IDs starting from 1,000,000,001.

Example:

  • Create first non-fungible token type → Token Type ID: 1,000,000,001
  • Create second non-fungible token type → Token Type ID: 1,000,000,002

Fungible Token Type IDs

Fungible token types under a contract receive sequential Token Type IDs starting from 1.

Example:

  • Create first fungible token type → Token Type ID: 1
  • Create second fungible token type → Token Type ID: 2

Fungible Token ID Alignment

For fungible tokens only: The Token ID always equals the Token Type ID.

Example:

  • Fungible token type created with Token Type ID 3 → All minted tokens from this type have Token ID 3

Example Scenarios

Scenario 1: Non-Fungible Tokens Only

  1. Create NFT token type → Token Type ID: 1,000,000,001
  2. Mint 2 NFTs from this type → Token IDs: 1, 2
  3. Create another NFT token type → Token Type ID: 1,000,000,002
  4. Mint 1 NFT from this type → Token ID: 3

Result: Sequential Token IDs 1, 2, 3 across all NFTs

Scenario 2: Mixed Fungible and Non-Fungible Tokens

  1. Create NFT token type → Token Type ID: 1,000,000,001
  2. Mint 2 NFTs → Token IDs: 1, 2
  3. Create fungible token type → Token Type ID: 3
  4. Mint fungible tokens → Token ID: 3 (matches Token Type ID)
  5. Create another NFT token type → Token Type ID: 1,000,000,002
  6. Mint 1 NFT → Token ID: 4

Final Results:

  • Token Type IDs: 1,000,000,001 (non-fungible), 3 (fungible), 1,000,000,002 (non-fungible)
  • Token IDs: 1, 2, 3, 4 (where Token ID 3 represents all fungible tokens from Token Type ID 3)

Key Benefits

  • Eliminates ID gaps: All Token IDs follow sequential order without skipping numbers
  • Simplified tracking: Predictable ID patterns make collection management easier
  • Clear differentiation: Non-fungible token types use 1,000,000,000+ range; fungible types use 1+ range
  • Consistent alignment: Fungible tokens maintain Token ID = Token Type ID relationship

This update provides complete predictability for NFT collection management and presentation.