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
  • Asset Type
  • Native Asset
  • 1. Get address balance by token type
  • 2. Get address balance by asset name
  • 3. Get address balance by contract hash
  • 4. Get transaction list by address and page
  • 5. Get transaction list by address and time
  • 6. Get transaction list by address and asset name and page
  • 7. Get transaction list by address and asset name and time
  • 8. Get staking information in all nodes by address

Was this helpful?

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

Address

APIs to obtain address related details

Asset Type

Asset

Type

Description

OEP4

String

oep4 asset

OEP5

String

oep5 asset

OEP8

String

oep8 asset

Native

String

ont, ong, waitbound ong, unbound ong

Native Asset

Value

Type

Description

ont

String

ont

ong

String

ong

waitboundong

String

waitbound ong

unboundong

String

unbound ong

1. Get address balance by token type

jsurl:/v2/addresses/{address}/{token_type}/balances, 
method:GET, 
successResponse:{
    "code":0, 
    "msg":"SUCCESS", 
    "result":[
		{
			"balance": "138172.922008484", 
			"asset_name": "ong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "14006.83021186", 
			"asset_name": "waitboundong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "71472.14798338", 
			"asset_name": "unboundong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "8637767", 
			"asset_name": "ont", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"asset_name": "pumpkin01", 
			"balance": "7", 
			"asset_type":"oep8", 
            "contract_hash":""
		}, 
		{
			"asset_name": "TNT", 
			"balance": "19888", 
			"asset_type":"oep4", 
            "contract_hash":""
		}, 
		{
			"asset_name": "HyperDragons:2", 
			"balance": "3", 
			"asset_type":"oep5", 
            "contract_hash":""
		}
	]
}

URL Field

Type

Description

address

String

address

token_type

String

oep4|OEP4|oep5|OEP5|oep8|OEP8|native|NATIVE|all|ALL

ResponseField

Type

Description

asset_name

String

asset name

balance

String

balance

asset_type

String

asset type:oep4, oep5, oep8, native

contract_hash

String

contract hash

2. Get address balance by asset name

url:/v2/addresses/{address}/balances?asset_name={assetName}, 
method:GET, 
successResponse:{
    "code":0, 
    "msg":"SUCCESS", 
    "result":[
		{
			"balance": "138172.922008484", 
			"asset_name": "ong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "14006.83021186", 
			"asset_name": "waitboundong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "71472.14798338", 
			"asset_name": "unboundong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "8637767", 
			"asset_name": "ont", 
			"asset_type":"native", 
            "contract_hash":""
		}
	]
}

URL Field

Type

Description

address

String

address

assetName

String

asset name. ong, ont or oep token symbol

ResponseField

Type

Description

asset_name

String

asset name

balance

String

balance

asset_type

String

asset type:oep4, oep5, oep8, native

contract_hash

String

contract hash

3. Get address balance by contract hash

url:/v2/addresses/{address}/balances?contract_hash={contractHash}, 
method:GET, 
successResponse:{
    "code":0, 
    "msg":"SUCCESS", 
    "result":[
		{
			"balance": "138172.922008484", 
			"asset_name": "ong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "14006.83021186", 
			"asset_name": "waitboundong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "71472.14798338", 
			"asset_name": "unboundong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "8637767", 
			"asset_name": "ont", 
			"asset_type":"native", 
            "contract_hash":""
		}
	]
}

URL Field

Type

Description

address

String

address

contractHash

String

contract hash

ResponseField

Type

Description

asset_name

String

asset name

balance

String

balance

asset_type

String

asset type:oep4, oep5, oep8, native

contract_hash

String

contract Hash

4. Get transaction list by address and page

url:/v2/addresses/{address}/transactions?page_size=10&page_number=1, 
method:GET, 
successResponse:{
    "code":0, 
    "msg":"SUCCESS", 
    "result":[
			{
				"tx_hash":"09e599ecde6ee....55239e1b1bd291558e5a6ef3fa", 
				"confirm_flag":1, 
				"tx_type":208, 
				"tx_time":1522207168, 
				"block_height":11, 
				"fee":"0.01", 
				"block_index":1, 
				"transfers": [
					{
                        "amount": "2.01", 
                        "from_address":"Aege6VvWEiKauFa2ngrtwdXt8FeGkWNPRH", 
                        "to_address":"ATUD7W6t6tLPGgd8H9tCN6Kwkb9WKFddch", 
                        "asset_name":"ont", 
                        "contract_hash":""
					}, 
                    {
                        "amount": "0.01", 
                        "from_address":"Aege6VvWEiKauFa2ngrtwdXt8FeGkWNPRH", 
                        "to_address":"ATUD7W6t6tLPGgd8H9tCN6Kwkb9WKFddch", 
                        "asset_name":"ong", 
                        "contract_hash":""
					}
				]
			}
		]
}

Url RequestField

Type

Description

address

String

address

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

tx_hash

String

transaction hash

confirm_flag

int

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

block_height

int

block height

tx_type

int

(208/209/210)

tx_time

int

UNIX time of the transaction

fee

String

fee

block_index

int

index in the block

transfers.from_address

String

from_address

transfers.to_address

String

to_address

transfers.amount

String

amount

transfers.asset_name

String

asset name

transfers.contract_hash

String

contract hash

5. Get transaction list by address and time

url:/v2/addresses/{address}/transactions?begin_time=1556017050&end_time=1556017250, 
method:GET, 
successResponse:{
    "code":0, 
    "msg":"SUCCESS", 
    "result":[
			{
				"tx_hash":"09e599ecde6ee....55239e1b1bd291558e5a6ef3fa", 
				"confirm_flag":1, 
				"tx_type":208, 
				"tx_time":1522207168, 
				"block_height":11, 
				"fee":"0.01", 
				"block_index":1, 
				"transfers": [
					{
                        "amount": "2.01", 
                        "from_address":"Aege6VvWEiKauFa2ngrtwdXt8FeGkWNPRH", 
                        "to_address":"ATUD7W6t6tLPGgd8H9tCN6Kwkb9WKFddch", 
                        "asset_name":"ont", 
                        "contract_hash":""
					}, 
                    {
                        "amount": "0.01", 
                        "from_address":"Aege6VvWEiKauFa2ngrtwdXt8FeGkWNPRH", 
                        "to_address":"ATUD7W6t6tLPGgd8H9tCN6Kwkb9WKFddch", 
                        "asset_name":"ong", 
                        "contract_hash":""
					}
				]
			}
    ]
}

Url RequestField

Type

Description

address

String

address

end_time

int

unxi time

begin_time

int

UNIX time. The maximum time range is one week.

ResponseField

Type

Description

tx_hash

String

transaction hash

confirm_flag

int

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

block_height

int

block height

tx_type

int

208 or 209

tx_time

int

UNIX time of the transaction

fee

String

fee

block_index

int

index in the block

transfers.from_address

String

from_address

transfers.to_address

String

to_address

transfers.amount

String

amount

transfers.asset_name

String

asset name

transfers.contract_hash

String

contract hash

6. Get transaction list by address and asset name and page

url:/v2/addresses/{address}/{asset_name}/transactions?page_size=10&page_number=1, 
method:GET, 
successResponse:{
    "code":0, 
    "msg":"SUCCESS", 
    "result":[
			{
				"tx_hash":"09e599ecde6ee....55239e1b1bd291558e5a6ef3fa", 
				"confirm_flag":1, 
				"tx_type":208, 
				"tx_time":1522207168, 
				"block_height":11, 
				"fee":"0.01", 
				"block_index":1, 
				"transfers": [
					{
                        "amount": "2.01", 
                        "from_address":"Aege6VvWEiKauFa2ngrtwdXt8FeGkWNPRH", 
                        "to_address":"ATUD7W6t6tLPGgd8H9tCN6Kwkb9WKFddch", 
                        "asset_name":"ont", 
                        "contract_hash":""
					}
				]
			}
    	]
}

Url RequestField

Type

Description

address

String

address

asset_name

String

asset 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

tx_hash

String

transaction hash

confirm_flag

int

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

block_height

int

block height

tx_type

int

208 or 209

tx_time

int

UNIX time of the transaction

fee

String

fee

block_index

int

index in the block

transfers.from_address

String

from_address

transfers.to_address

String

to_address

transfers.amount

String

amount

transfers.asset_name

String

asset name

transfers.contract_hash

String

contract hash

7. Get transaction list by address and asset name and time

url:/v2/addresses/{address}/{asset_name}/transactions?begin_time=1556017050&end_time=1556017250, 
method:GET, 
successResponse:{
    "code":0, 
    "msg":"SUCCESS", 
    "result":[
			{
				"tx_hash":"09e599ecde6ee....55239e1b1bd291558e5a6ef3fa", 
				"confirm_flag":1, 
				"tx_type":208, 
				"tx_time":1522207168, 
				"block_height":11, 
				"fee":"0.01", 
				"block_index":1, 
				"transfers": [
					{
                        "amount": "2.01", 
                        "from_address":"Aege6VvWEiKauFa2ngrtwdXt8FeGkWNPRH", 
                        "to_address":"ATUD7W6t6tLPGgd8H9tCN6Kwkb9WKFddch", 
                        "asset_name":"ont", 
                        "contract_hash":""
					}
				]
			}
    ]
}

Url RequestField

Type

Description

address

String

address

asset_name

String

asset name

begin_time

int

UNIX time

end_time

int

UNIX time The maximum time range is one week.

ResponseField

Type

Description

tx_hash

String

transaction hash

confirm_flag

int

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

block_height

int

block height

tx_type

int

208 or 209

tx_time

int

UNIX time of the transaction

fee

String

fee

block_index

int

index in the block

transfers.from_address

String

from_address

transfers.to_address

String

to_address

transfers.amount

String

amount

transfers.asset_name

String

asset name

transfers.contract_hash

String

contract hash

8. Get staking information in all nodes by address

url:/v2/addresses/{address}/staking-info
method:GET
  • request:

Field_Name
Type
Description

address

String

wallet address

  • response:

{
    "code": 0,
    "msg": "SUCCESS",
    "result": [
        {
            "node_name": "Phecda (Coinbase Cloud)",
            "node_pub_key": "022e911fb5a20b4b2e4f917f10eb92f27d17cad16b916bce8fd2dd8c11ac2878c0",
            "amount": "200",
            "state": 1
        },
        {
            "node_name": "Merak (Coinbase Cloud)",
            "node_pub_key": "0251f06bc247b1da94ec7d9fe25f5f913cedaecba8524140353b826cf9b1cbd9f4",
            "amount": "500",
            "state": 2
        },
        {
            "node_name": "Dubhe (Coinbase Cloud)",
            "node_pub_key": "02bcdd278a27e4969d48de95d6b7b086b65b8d1d4ff6509e7a9eab364a76115af7",
            "amount": "136",
            "state": 3
        },
        {
            "node_name": "Alkaid",
            "node_pub_key": "03c8f63775536eb420c96228cdccc9de7d80e87f1b562a6eb93c0838064350aa53",
            "amount": "66",
            "state": 4
        }
    ]
}
Field_Name
Type
Description

node_name

String

node name

node_pub_key

String

node public key

amount

String

ONT amount

state

int

state: 1-processing;2-staking;3-claimable;4-cancelling

PreviousBlockNextContract

Last updated 1 year ago

Was this helpful?