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
  • Transaction type
  • Description
  • Event Type
  • 1. Get latest transaction list
  • 2. Get transaction list by page
  • 3. Get latest non-ontid transaction list
  • 4. Get non-ontid transaction list by page
  • 5. Get transaction detail by txhash
  • detail field
  • 6. Get transaction input data

Was this helpful?

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

Transactions

APIs to obtain transaction related details

Transaction type

Value

Type

Description

208

int

deploy smart contract

209

int

invoke neovm smart contract

210

int

invoke wasmvm smart contract

Description

Value

Type

Description

transfer

String

transfer

gasconsume

String

consumed gas

ontId-

String

Ont ID

claimRecord-

String

claim Record

auth

String

authorization

{"NeedStorage":true, ...}

String

If the transaction type is 208, the filed content is the description of the contract

Event Type

Value

Type

Description

0

int

others

1

int

deploy contract

2

int

gas consumed

3

int

transfer

4

int

ONT ID

5

int

claim record

6

int

authorization

1. Get latest transaction list

url: /v2/latest-transactions?count=10, 
method: GET, 
params: {
}, 
successResponse: {
    "code":0, 
    "msg":"SUCCESS", 
    "result":[
        {
            "tx_hash":"9762458cd30612509f7c...a010ccc7b347057eb5", 
            "tx_type":209, 
            "tx_time":1522210288, 
            "block_height":1212, 
            "confirm_flag":1, 
            "block_index":1, 
            "fee":"0.01"
        }
    ]
}

Url RequestField

Type

Description

count

int

number of latest transactions (count is limited between 1 and 50)

ResponseField

Type

Description

tx_hash

String

transaction hash

tx_type

int

transaction type (208/209/210)

tx_time

int

UNIX time of the transaction

block_height

int

block height

confirm_flag

int

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

block_index

int

The index of transactions within a block

fee

String

fee

2. Get transaction list by page

url:/v2/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":23449
    }
}

Url RequestField

Type

Description

page_size

int

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

page_number

int

page number (atleast 1 or greater)

ResponseField

Type

Description

total

int

total transactions

tx_hash

String

transaction hash

tx_type

int

transaction type (208/209/210)

tx_time

int

UNIX time of the transaction

block_height

int

block height

confirm_flag

int

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

block_index

int

The index of transactions within a block

fee

String

transaction fee

3. Get latest non-ontid transaction list

url: /v2/latest-nonontid-transactions?count=10, 
method: GET, 
params: {
}, 
successResponse: {
    "code":0, 
    "msg":"SUCCESS", 
    "result":[
        {
            "tx_hash":"9762458cd30612509f7c...a010ccc7b347057eb5", 
            "tx_type":209, 
            "tx_time":1522210288, 
            "block_height":1212, 
            "confirm_flag":1, 
            "block_index":1, 
            "fee":"0.01"
        }
    ]
}

Url RequestField

Type

Description

count

int

number of latest non-ontid transactions (limited between 1 and 50)

ResponseField

Type

Description

tx_hash

String

transaction hash

tx_type

int

transaction type (209/210)

tx_time

int

UNIX time of the transaction

block_height

int

block height

confirm_flag

int

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

block_index

int

The index of transactions within a block

fee

String

transaction fee

4. Get non-ontid transaction list by page

url:/v2/nonontid-transactions?page_size=1&page_number=10, 
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":23449
    }
}

Url RequestField

Type

Description

page_size

int

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

page_number

int

page number (atleast 1 or greater)

ResponseField

Type

Description

total

int

total transactions

tx_hash

String

transaction hash

tx_type

int

transaction type (208/209/210)

tx_time

int

UNIX time of the transaction

block_height

int

block height

confirm_flag

int

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

block_index

int

The index of transactions within a block

fee

String

fee

5. Get transaction detail by txhash

url:/v2/transactions/{tx_hash}, 
method:GET, 
successResponse:{
    "code":0, 
    "msg":"SUCCESS", 
    "result":{
        "tx_hash":"000004c9903c338...ee5505e171e6d752dbd", 
        "tx_type":209, 
        "tx_time":1522210288, 
        "block_height":1212, 
        "confirm_flag":1, 
        "block_index":1, 
        "fee":"0.01", 
        "description":"transfer", 
        "event_type":3, 
        "detail":{
        
        }
    }
}

Url RequestField

Type

Description

tx_hash

String

transaction hash

ResponseField

Type

Description

tx_hash

String

transaction hash

tx_type

int

transaction type (208/209/210)

tx_time

int

UNIX time of the transaction

block_height

int

block height

confirm_flag

int

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

block_index

int

The index of transactions within a block

fee

String

fee

description

String

transaction description for given ONT ID

event_type

int

event type reference

detail

Object

transaction detail

detail field

  • Deploy smart contract transaction

Smart contract detail in description filed

{
	"detail":{}
}
  • Transfer transaction

{
	"detail":{
		"transfers": [
			{
				"amount": "0.02", 
				"from_address":"Aege6VvWEiKauFa2ngrtwdXt8FeGkWNPRH", 
				"to_address":"ATUD7W6t6tLPGgd8H9tCN6Kwkb9WKFddch", 
				"asset_name":"ont", 
				"contract_hash":"9762458cd30612509f7c...",
				"description":"transfer"
			}
		]
	}
}

ResponseField

Type

Description

transfers.asset_name

String

asset name

transfers.to_address

String

toaddres

transfers.from_address

String

fromaddress

transfers.amount

String

amount

transfers.description

String

transfer reference

transfers.contract_hash

String

contract hash

  • ONT ID transaction

{
	"detail":{
		"ontid":"did:ont:Ahctt129csbc612enxGTss6", 
		"description":"register OntId"
	}
}

ResponseField

Type

Description

ontid

String

ONT ID

description

String

transaction description for given ONT ID

6. Get transaction input data

Returns input data and contract abi (if exists) for EVM transactions. Returns input data and resolution results of responses (if can be resolved) for naive and neoVM transactions.

url:/v2/transactions/input-data/{txHash}
method:GET
URL Request Parameter
Type
Description

txHash

String

transaction hash

Example Response

Returns from the EVM:

{
    "code": 0,
    "msg": "SUCCESS",
    "result": {
        "original_view": "0xa9059cbb000000000000000000000000d0efc52b329699a071be1b0745fcc0dc5cfd0d600000000000000000000000000000000000000000000000000000000000989680",
        "abi": "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"
    }
}

Resolution results of native VM and neoVM transactions:

{
    "code": 0,
    "msg": "SUCCESS",
    "result": {
        "original_view": "00c66b149b27fff7d06c214f4f4ae2e13ec844a9ea7a46636a7cc814a68d0c9ef4806f6e67a5e5b168af3afa1a452be06a7cc80400d8c1426a7cc86c51c10a7472616e7366657256321400000000000000000000000000000000000000010068164f6e746f6c6f67792e4e61746976652e496e766f6b65",
        "default_view": {
            "function": "transferV2(Address from,Address to,Long value)",
            "method_id": "7472616e736665725632",
            "params": [
                "9b27fff7d06c214f4f4ae2e13ec844a9ea7a4663",
                "a68d0c9ef4806f6e67a5e5b168af3afa1a452be0",
                "00d8c142"
            ]
        },
        "decode": [
            {
                "name": "from",
                "type": "Address",
                "data": [
                    "AVvGJULMaKwvJvKpQSN7s5PU7mVz4hKJim"
                ]
            },
            {
                "name": "to",
                "type": "Address",
                "data": [
                    "AWxWncsrqnUL6oWhmpL1QkLL7echaD9JEs"
                ]
            },
            {
                "name": "value",
                "type": "Long",
                "data": [
                    1120000000
                ]
            }
        ]
    }
}

Returns for wasmVM transactions and transactions that can't be resolved:

{
    "code": 0,
    "msg": "SUCCESS",
    "result": {
        "original_view": "438f52b0e107dc0d79f0b7b2ee3fde304a922f6b4e0b6f72633230546f4f657034acae7a1a3ca81df404c312b57a520a52006fc7a79899b83824870f81a4f25879e49f720f266657f000bca0650100000000000000000000000957494e472d57494e47"
    }
}
Response Parameter
Type
Description

original_view

String

original input data

abi

String

contract abi, returns when query is for EVM transactions and contract abi exists, otherwise this field is not returned

default_view

Map

default view of the corresponding page, only returns when resolution is successful

decode

List

resolution result, only returns when resolution is successful

PreviousTokenNextONT ID

Last updated 2 years ago

Was this helpful?