Ontology Developer Center
DISCOVERCOMMUNITYSUPPORT
  • Introduction
  • Discover Ontology
  • Getting Started
  • Glossary
  • Decentralized Identity and Data
    • ONT ID
      • Decentralized Identifiers
        • Method Specification for Ontology
        • Method Specification for Ethereum
        • Method Specification for BSC
      • Verifiable Credentials
        • Anonymous Credentials
      • ONT Login
        • Scenarios
        • Protocol Specification
        • Front-end JavaScript SDK
          • Integration and Usage
          • API Reference
        • Front-end UI SDK
          • Integration and Usage
          • API Reference
        • Back-end Go SDK
          • Integration and Usage
          • API Reference
        • Back-end Java SDK
          • Integration and Usage
          • API Reference
      • ONT TAG
        • Workflow
        • API Reference
      • Mercury
      • OScore
    • DDXF
      • Components and Interfaces
      • GREP
      • Overall Scheme
      • Solutions
        • Marketplace
          • Deployment
          • Scenarios
          • SaaS Tenant
          • Java SDK
        • Data Storage
          • Deployment
          • Java SDK
        • Resource Auditor
        • Offline Judge
      • Use Cases
        • E-Shops
  • ONTOLOGY ELEMENTS
    • Smart Contracts
      • Types of smart contracts
    • Token Protocols
    • Consensus Mechanism
    • Ontology Oracle
      • Oracle Process Flow
  • GUIDES & TUTORIALS
    • Development Guides
      • dApp Development
        • Using the dAPI
        • Data Synchronization
      • Smart Contract Development
        • EVM Contract
          • Development Environment and Tools
          • Wallet Setup
          • Contract Development
          • How to Deploy a Smart Contract with GetBlock
        • NeoVM Contract
          • Development tools and environment
          • Launching the IDE
          • Writing and editing program logic
          • Deploying and testing on private net
        • WASM Contract
          • Development Environment
          • Project Initiation - Hello World
          • Creating your own project
          • Development using SmartX
          • Runtime API
          • Contract Fundamentals
          • Inter-contract Interaction
          • Developing Contracts in C++
        • Publish Contract Source Code
    • Integration Guides
      • dApp Integration
        • dAPI Integration
          • Chrome Plugin
          • Mobile wallet dApp
          • QR code mechanism
          • Wake call mechanism
        • Cocos 2D-x
        • Unity 3D applications
      • Mobile Wallet Integration
        • SDK integration
        • dAPI Integration
          • In-wallet applications
          • QR code mechanism
          • Wake call mechanism
        • Stake
      • Using ONT ID
      • Exchange Integration
        • Exchange Docking Guide
        • Exchange API
      • Ontology for dApp Stores
    • EVM & Token Decimals Upgrade
  • ONTOLOGY NODE
    • Abstract
    • Node Deployment
      • Standard Node
      • Rosetta Node
    • Interacting with a Public Node
  • DEVELOPER TOOLS
    • dApp Development Framework
      • Punica CLI
      • Punica boxes
      • Solo Chain
    • IDE
    • APIs
      • HTTP API
        • Restful
        • WebSocket
        • Remote Procedure Call (RPC)
      • Explorer v2 API
        • Block
        • Address
        • Contract
        • Token
        • Transactions
        • ONT ID
        • Summary
        • Node
      • Native Token API
        • ONT Contract API
        • ONG Contract API
      • ONT ID Contract API
      • Web3 API
      • OScore Open API
      • Rosetta Node API
        • Data API
        • Construction API
      • DToken Contract API
      • DDXF
        • Marketplace Contract API
        • Storage API
      • Governance API
    • Digital Wallet
      • Chrome Plugin provider
      • Chrome Plugin dAPI
      • Mobile version provider
      • Mobile version dAPI
    • SDKs
    • Signing Server
      • Installation
      • API reference
  • COMMUNITY
    • Ecosystem Programs
    • Community Libraries
    • Community Events
    • Community Channels
    • Core Contributors
  • SUPPORT
    • FAQ
      • Basic blockchain concepts
      • Ontology Nodes
      • Ontology token protocols
      • Smart contracts
      • SDKs and APIs
    • Contact Us
Powered by GitBook
On this page
  • VM Category Type
  • 1. Get token list by token type
  • OEP8 Token
  • 2. Get token detail by token type and contracthash
  • OEP8 Token
  • 3. Get oep8 token transaction list by token name
  • 4. Get circulating supply of ONT and ONG
  • 5. Get list of token holder addresses
  • 6. Get the number of token holders

Was this helpful?

  1. DEVELOPER TOOLS
  2. APIs
  3. Explorer v2 API

Token

APIs to obtain token related details

PreviousContractNextTransactions

Last updated 2 years ago

Was this helpful?

VM Category Type

Value

Type

Description

neovm

String

Neo VM

wasvm

String

WASM VM

1. Get token list by token type

Please note that the API response will only contain the token records corresponding to the tokens that have been verified and are listed on the Explorer portal. The list of currently listed , and tokens can be accessed by following the respective links.

url:/v2/tokens/{token_type}?page_size=10&page_number=1, 
method:GET, 
successResponse:{
    "code":0, 
    "msg":"SUCCESS", 
    "result":{
        "records":[
            {
                "contract_hash": "16edbe366d1337eb...4c94aeef02", 
                "creator": "AUr5QUfeBADq6BMY6Tp5yuMsUNGpsD7nLZ", 
                "description": "30", 
                "logo": "", 
                "create_time":1516946305, 
                "update_time":1516948340, 
                "contact_info":"{\"website\":\"www.test.cn\", \"github\":\"github.com\"}", 
                "total_supply": 1000000000, 
                "name": "name", 
                "symbol": "MYT", 
                "decimals": 8, 
                "address_count": 1, 
                "tx_count": 30, 
                "vm_category":"neovm"
            }
        ], 
        "total":12
    }
}

Url RequestField

Type

Description

token_type

String

oep4, oep5, oep8

page_size

int

number of records in one page (The page size is limited between 1 and 20)

page_number

int

number of the page (At least 1 or greater)

ResponseField

Type

Description

contract_hash

String

contract hash

name

String

contract name

creator

String

creator address

description

String

contract description

logo

String

logo url

create_time

int

create time

update_time

int

update time

contact_info

String

contact information.JSON format string

total_supply

int

total supply of the token

symbol

String

symbol of the token

decimals

int

decimals of the token. If the token type is oep5, response not have this param

address_count

int

total address

tx_count

int

total transaction

vm_category

String

neovm or wasmvm

total

int

total contract

OEP8 Token

If the param token_type == oep8, then the result is:

successResponse:{
    "code":0, 
    "msg":"SUCCESS", 
    "result":{
        "records":[
            {
                "contract_hash": "16edbe366d1337eb...4c94aeef02", 
                "name": "name", 
                "creator": "AUr5QUfeBADq6BMY6Tp5yuMsUNGpsD7nLZ", 
                "description": "test contract", 
                "logo": "", 
                "create_time":1516946305, 
                "update_time":1516948340, 
                "contact_info":"{\"website\":\"www.tst.cn\", \"github\":\"github.com\"}", , 
                "total_supply": {
                	"01":"1002", 
                	"02":"899", 
                	"03":"321"
                }, 
                "symbol": {
                	"01":"TNA", 
                	"02":"TNB", 
                	"03":"TNC"
                }, 
                "token_name":{
                	"01":"TokenNameFrist", 
                	"02":"TokenNameSecond", 
                	"03":"TokenNameThird"
                }, 
                "token_id":{
                	"01":"01", 
                	"02":"02", 
                	"03":"03"
                }
                "address_count": 1, 
                "tx_count": 30, 
                "vm_category":"neovm"
            }
        ], 
        "total":12
    }
}

2. Get token detail by token type and contracthash

url:/v2/tokens/{token_type}/{contract_hash}, 
method:GET, 
successResponse:{
    "code":0, 
    "msg":"SUCCESS", 
    "result":{
        "contract_hash": "16edbe366d...99424c94aeef02", 
        "name": "name", 
        "abi":"25a80bbc...5381", 
        "code": "013ec56b6...006a5", 
        "source_code":"", 
        "create_time":1516946305, 
        "update_time":1516948340, 
        "contact_info":"{\"website\":\"www.test.cn\", \"github\":\"github.com\"}", 
        "logo":"", 
        "description": "oep4 token", 
        "creator": "AFmseVrdL9f9oyC....G6UbvhPbdYzM", 
        "ont_sum": "2123.000000000", 
        "ong_sum": "1233123123.000000000", 
        "address_count": 122, 
        "tx_count": 30, 
        "token_sum":{\"Ht\":\"124\"}", 
        "category":"oep", 
        "type":"oep4", 
        "total_supply": 1000000000, 
        "symbol": "MYT", 
        "decimals": 8, 
        "vm_category":""
    }
}

Url RequestField

Type

Description

token_type

String

oep4, oep5, oep8

contract_hash

String

contract_hash

ResponseField

Type

Description

contract_hash

String

contract hash

name

String

contract name

create_time

int

create time

update_time

int

update time

contact_info

String

contact information.JSON format string

logo

String

logo url

description

String

contract description

creator

String

creator address

ong_sum

String

total ong

ont_sum

String

total ont

address_count

int

total address

tx_count

int

total transaction

token_sum

String

total token.JSON format string

type

String

oep4, oep5, oep8, others

abi

String

contract abi

code

String

contract code

source_code

String

contract source code

category

String

category

total_supply

int

total supply of the token

symbol

String

symbol of the token

decimals

int

decimals of the token. If the token type is oep5, response not have this param

vm_category

String

neovm or wasmvm

OEP8 Token

If the param token_type == oep8, then the result is:

successResponse:{
    "code":0, 
    "msg":"SUCCESS", 
    "result":{
        "contract_hash": "16edbe366d...99424c94aeef02", 
        "name": "name", 
        "abi":"25a80bbc...5381", 
        "code": "013ec56b6...006a5", 
        "source_code":"", 
        "create_time":1516946305, 
        "update_time":1516948340, 
        "contact_info":"{\"website\":\"www.test.cn\", \"github\":\"github.com\"}", 
        "logo":"", 
        "description": "LuckyNumber is a decentralized, tru.....", 
        "creator": "AFmseVrdL9f9oyCzZefL9tG6UbvhPbdYzM", 
        "ont_sum": "2123.000000000", 
        "ong_sum": "1233123123.000000000", 
        "address_count": 122, 
        "tx_count": 30, 
        "token_sum":{\"Ht\":\"124\"}", 
        "category":"oep", 
        "type":"oep8", 
        "total_supply": {
            "01":"1002", 
            "02":"899", 
            "03":"321"
        }, 
        "symbol": {
            "01":"TNA", 
            "02":"TNB", 
            "03":"TNC"
        }, 
        "token_name":{
            "01":"TokenNameFrist", 
            "02":"TokenNameSecond", 
            "03":"TokenNameThird"
        }, 
        "token_id":{
            "01":"01", 
            "02":"02", 
            "03":"03"
        }
    }
}

3. Get oep8 token transaction list by token name

url:/v2/tokens/oep8/{contract_hash}/{token_name}/transactions?page_size=10&page_number=1, 
method:GET, 
successResponse:{
    "code":0, 
    "msg":"SUCCESS", 
    "result":{
    	"records":[
    		{
                "tx_hash":"9762458cd30612509f7c...a010ccc7b347057eb5", 
                "tx_type":209, 
                "tx_time":1522210288, 
                "block_height":1212, 
                "confirm_flag":1, 
                "block_index":1, 
                "fee":"0.01", 
    		}
    	], 
    	"total":20
    }
}

Url RequestField

Type

Description

contract_hash

String

oep8 token contract hash

token_name

String

oep8 token name

page_size

int

number of records in one page (The page size is limited between 1 and 20)

page_number

int

number of the page (At least 1 or greater)

ResponseField

Type

Description

records.tx_hash

String

transaction hash

records.tx_type

int

transaction type (208/209)

records.tx_time

int

UNIX time of the transaction

records.block_height

int

block height

records.confirm_flag

int

transaction state on the blockchain, 0:failure 1:success

records.block_index

int

The index of transactions within a block

records.fee

String

fee

total

int

total

4. Get circulating supply of ONT and ONG

url:/v2/summary/native/circulating-supply/{token}
method:GET
URL Request Field
Type
Description

token

String

"ont" or "ong"

Example Response

696743794   // number of tokens in circulation

5. Get list of token holder addresses

Return addresses with balance greater than 0. The addresses retuned from the balckend has been processed, they are ready for display in the frontend directly without furuter processing. But the balance value requires the frontend to process based on the token's precision.

Native tokens (ONT&ONG):
url:/ontholder/getAssetHolder?qid=1&contract={contract_hash}}&from=0&count=10

oep4 tokens:
url:/ontholder/oep4/getAssetHolder?qid=1&contract={contract_hash}&from=0&count=10

orc20 tokens:
url:/ontholder/orc20/getAssetHolder?qid=1&contract={contract_hash}&from=0&count=10

method:GET
URL Request Parameter
Type
Description

qid

String

request ID, default: 1

contract

String

token contract address

from

int

first entry to query

count

int

number or entries to query

Example Response

{
    "qid": "1",
    "method": "getAssetHolder",
    "error_code": 0,
    "error_info": "",
    "result": [
        {
            "address": "ALVbBHBEquMgtAMrFywT8yBYRmdGBLbGiV",
            "contract": "2f34b28eb98a1dd901d303f5294c87546fb37fe7",
            "balance": "20010000000000000",
            "percent": 0.9955223880597015
        },
        {
            "address": "AbtTQJYKfQxq4UdygDsbLVjE8uRrJ2H3tP",
            "contract": "2f34b28eb98a1dd901d303f5294c87546fb37fe7",
            "balance": "69990000000000",
            "percent": 0.003482089552238805
        },
        {
            "address": "AG4pZwKa9cr8ca7PED7FqzUfcwnrQ2N26w",
            "contract": "2f34b28eb98a1dd901d303f5294c87546fb37fe7",
            "balance": "10000000000000",
            "percent": 4.97512437810945E-4
        },
        {
            "address": "AcNsGxJdopi1hz6MXziFraWcgEKxdNDwSx",
            "contract": "2f34b28eb98a1dd901d303f5294c87546fb37fe7",
            "balance": "9895145371331",
            "percent": 4.92295789618457E-4
        },
        {
            "address": "AeWeheZi7a7XoHw2AoivCFDa68xfa436eg",
            "contract": "2f34b28eb98a1dd901d303f5294c87546fb37fe7",
            "balance": "104569135801",
            "percent": 5.202444567213E-6
        },
        {
            "address": "AT9sH4s84NGJYVqNHQWN6vkgb7jQ12eR7p",
            "contract": "2f34b28eb98a1dd901d303f5294c87546fb37fe7",
            "balance": "8900000000",
            "percent": 4.42786069651E-7
        },
        {
            "address": "AFqw9nGHiskTsrfqyMQr3Y3hZ759VpH5j1",
            "contract": "2f34b28eb98a1dd901d303f5294c87546fb37fe7",
            "balance": "1100000000",
            "percent": 5.4726368159E-8
        },
        {
            "address": "AZ8duTd8sPgRS2NQAArkbP3puRYtuGaCF7",
            "contract": "2f34b28eb98a1dd901d303f5294c87546fb37fe7",
            "balance": "285492868",
            "percent": 1.4203625273E-8
        }
    ]
}
Response Parameter
Type
Description

address

String

token holder address

contract

String

token contract address

balance

String

value of token holder address balance multiplied by the token precision

percent

Double

percentage of balance accounting for token total supply

6. Get the number of token holders

Native tokens (ONT&ONG):
url:/ontholder/getAssetHolderCount?qid=1&contract={contract_hash}

oep4 tokens:
url:/ontholder/oep4/getAssetHolderCount?qid=1&contract={contract_hash}

orc20 tokens:
url:/ontholder/orc20/getAssetHolderCount?qid=1&contract={contract_hash}

method:GET
Request Parameter
Type
Description

qid

String

request id, default: 1

contract

String

token contract address

Example response

{
    "qid": "1",
    "method": "getAssetHolderCount",
    "error_code": 0,
    "error_info": "",
    "result": 8
}
Response Parameter
Type
Description

result

int

number of addresses with a balance greater than 0

OEP-4
OEP-5
OEP-8