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
  • 1. Get contract list
  • 2. Get contract detail by contract_hash
  • 3. Get contract transaction list by contracthash
  • HyperDragon OEP5 Contract
  • 4. Get contract transaction list by contracthash
  • Hyperdragon OEP5 Contract

Was this helpful?

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

Contract

APIs to obtain contract related details

1. Get contract list

url:/v2/contracts?page_size=10&page_number=1, 
method:GET, 
successResponse:{
    "code":0, 
    "msg":"SUCCESS", 
    "result":{
        "records":[
            {
                "contract_hash": "16edbe366d...99424c94aeef02", 
                "name": "name", 
                "logo":"", 
                "description": "is a decentralized, tru.....", 
                "creator": "AFmseVrdL9f9oyCzZefL9tG6UbvhPbdYzM", 
                "create_time":1516946305, 
                "update_time":1516948340, 
                "contact_info":"{\"website\":\"www.test.cn\", \"github\":\"github.com\"}", 
                "ont_sum": "2123", 
                "ong_sum": "1233123123.002", 
                "address_count": 122, 
                "tx_count": 30, 
                "token_sum":{\"Ht\":\"124\"}", 
                "category":"oep", 
                "type":"oep4", 
                "dapp_name":""
            }
        ], 
        "total":12
    }
}

Url RequestField

Type

Description

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)

Response Parameter

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

category

String

category

type

String

oep4, oep5, oep8, other

dapp_name

String

dapp name

total

int

total contract

2. Get contract detail by contract_hash

url:/v2/contracts/{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": "LuckyNumber is a decentralized, tru.....", 
        "creator": "AFmseVrdL9f9oyCzZefL9tG6UbvhPbdYzM", 
        "ont_sum": "2123", 
        "ong_sum": "1233123123", 
        "address_count": 122, 
        "tx_count": 30, 
        "token_sum":{\"Ht\":\"124\"}", 
        "category":"oep", 
        "type":"oep5", 
        "dapp_name":""
    }
}
Response Parameter
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

dapp_name

String

dapp name

vm_type

String

VM type

compiler_type

String

compiler type

compiler_version

String

compiler version

optimization

boolean

whether to optimize

optimization_run

int

optimization steps

vm_version

String

EVM version

licenseType

String

license type

constructorArgument

String

constructor arguments

setting

String

setting

3. Get contract transaction list by contracthash

url:/v2/contracts/{contract_type}/{contract_hash}/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

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)

contract_type

String

oep4, oep5, oep8, other

contract_hash

String

contract_hash

ResponseField

Type

Description

records.tx_hash

String

transaction hash

records.tx_type

int

transaction type (208/209/210)

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

txs.fee

String

fee

total

int

total

HyperDragon OEP5 Contract

Response two more parameters:

  • asset_name:asset name

  • json_url:json data

successResponse:{
    "code":0, 
    "msg":"SUCCESS", 
    "result":{
    	"txs":[
    		{
                "tx_hash":"9762458cd30612509f7c...a010ccc7b347057eb5", 
                "tx_type":209, 
                "tx_time":1522210288, 
                "block_height":1212, 
                "confirm_flag":1, 
                "block_index":1, 
                "fee":"0.01", 
                "asset_name":"HyperDragons: 1360", 
                "json_url":"{\"image\":\"https://hyd-go-res.alfakingdom.com/normal/1360.svg\", \"name\":\"dragon#1360\"}"   //如果asset_name没有找到对应的json描述,该字段不返回
    		}
    	], 
    	"total":20
    }
}

4. Get contract transaction list by contracthash

url:/v2/contracts/{contract_hash}/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

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)

contract_type

String

oep4, oep5, oep8, other

contract_hash

String

contract_hash

ResponseField

Type

Description

records.tx_hash

String

transaction hash

records.tx_type

int

transaction type (208/209/210)

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

txs.fee

String

fee

total

int

total

Hyperdragon OEP5 Contract

Two extra fields in response:

  • asset_name:Name of the asset

  • json_url: JSON string of the dragon logo and name. If the asset_name doesn't have a corresponding JSON description, this field will not be returned

successResponse:{
    "code":0, 
    "msg":"SUCCESS", 
    "result":{
    	"txs":[
    		{
                "tx_hash":"9762458cd30612509f7c...a010ccc7b347057eb5", 
                "tx_type":209, 
                "tx_time":1522210288, 
                "block_height":1212, 
                "confirm_flag":1, 
                "block_index":1, 
                "fee":"0.01", 
                "asset_name":"HyperDragons: 1360", 
                "json_url":"{\"image\":\"https://hyd-go-res.alfakingdom.com/normal/1360.svg\", \"name\":\"dragon#1360\"}"   //If the `asset_name` doesn't have a corresponding JSON description, this field will not be returned
    		}
    	], 
    	"total":20
    }
}
PreviousAddressNextToken

Last updated 2 years ago

Was this helpful?