Developers

Explorer Api

58min

The Explorer API is a documentation of the API of the caduceus browser explorer. You can find the explorer here: https://cmpscan.io/miscapis

Where you will be able to sign up, verify contracts and query the blockchain, helping you query data that is specific to NFT's or ERC20 Tokens. You can also get the log events or verify a contract via API. You must sign up at cmpscan.io to get an API key.

Account APIs

Get CMP Balance for a single Address

Text


Get CMP Balance for multiple Addresses in a single call

Text


Separate addresses by comma, up to a maxium of 20 accounts in a single batch

Get a list of 'Normal' Transactions By Address

[Optional Parameters] startblock: starting blockNo to retrieve results, endblock: ending blockNo to retrieve results

Text


(Returns up to a maximum of the last 10000 transactions only)

Another example:

Text


(To get paginated results use page=[page number] and offset=[max records to return])

Get a list of 'Internal' Transactions by Address

[Optional Parameters] startblock: starting blockNo to retrieve results, endblock: ending blockNo to retrieve results

Text


(Returns up to a maximum of the last 10000 transactions only)

Another example:

Text


(To get paginated results use page=[page number] and offset=[max records to return])

Get "Internal Transactions" by Transaction Hash

Text


(Returns up to a maximum of the last 10000 transactions only)

Get "Internal Transactions" by Block Range

Text


(Returns up to a maximum of the last 10000 transactions only)

Get a list of "CRC-20 - Token Transfer Events" by Address

[Optional Parameters] startblock: starting blockNo to retrieve results, endblock: ending blockNo to retrieve results

Text


(Returns up to a maximum of the last 10000 transactions only)

Another example:

Text


(To get paginated results use page=[page number] and offset=[max records to return])

Another example:

Text


(To get transfer events for a specific token contract, include the contractaddress parameter)

Get a list of "CRC-721 - Token Transfer Events" by Address

[Optional Parameters] startblock: starting blockNo to retrieve results, endblock: ending blockNo to retrieve results

Text


(Returns up to a maximum of the last 10000 transactions only)

Another example:

Text


(To get paginated results use page=[page number] and offset=[max records to return])

Get list of Blocks Validated by Address

Text


Another example:

Text


(To get paginated results use page=[page number] and offset=[max records to return])

** type = blocks (full blocks only)

Contract APIs

Get Contract ABI for Verified Contract Source Codes

Text


Get Contract Source Code for Verified Contract Source Codes

Text


Verify & Publish Contract Source Code

This is a POST request.

Text


Here are some example of how this api may be used:

Text


request params

name

type

required

desc

contract_address

string

true

The address of the contract to be verified.

compiler_type

string

true

SingleFile or MultiFile or Vyper.

compiler_version

string

true

Version of the compiler.

license_type

string

optional

Types of open source protocols.

contract_code

string

true

Contract source code.

contract_name

string

optional

Contract name.

evm_version

string

optional

Use 'default'.

abi

string

optional

JSON ABI of the contract.

optimization

string

optional

Enable optimization.

optimizer_runs

string

optional

Optimize the number of runs.

Transaction APIs

Check Transaction Receipt Status

Note: status: 0 = Fail, 1 = Pass.

Text


Block APIs

Get Block Rewards by BlockNo

Text


Get Estimated Block Countdown Time by BlockNo

Text


Get Block Number by Timestamp

[Parameters] timestamp format: Unix timestamp (supports Unix timestamps in seconds), closest value: 'before' or 'after'

Text


Log APIs

The Event Log API was designed to provide an alternative to the native eth_getLogs. This is a POST request.

Text


Here are some example of how this api may be used:

Example One

Get event logs from block number 13920 to block number 13930, where log address is 0x715aA09E6950ffDBda55Cea77f72dd7F52Ae1A62 and topic0 is "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"

Text


Example Two

Get event logs from block number 13920 to block number 13930, where log address is 0x715aA09E6950ffDBda55Cea77f72dd7F52Ae1A62 and topic0,topic1 is nay and topic3 is "0x00000000000000000000000075ecd1ab06c4e34763a47e1033e80de614d09fa4"

Text


Tips: max range between "fromBlock" and "toBlock" is 10000.

Token APIs

Get CRC20-Token TotalSupply by ContractAddress

Text


Get CRC20-Token Circulating Supply by ContractAddress

Text


Get CRC20-Token Account Balance for TokenContractAddress

Text


Proxy APIs

The following are the limited list of supported Proxied APIs for CMP available through HScan.

eth_blockNumber

Returns the number of most recent block

Text


eth_getBlockByNumber

Returns information about a block by block number

Text


eth_getBlockTransactionCountByNumber

Returns the number of transactions in a block from a block matching the given block number

Text


eth_getTransactionByHash

Returns the information about a transaction requested by transaction hash

Text


eth_getTransactionByBlockNumberAndIndex

Returns information about a transaction by block number and transaction index position

Text


eth_getTransactionCount

Returns the number of transactions sent from an address

Text


eth_sendRawTransaction

Creates new message call transaction or a contract creation for signed transactions

Text


(Replace the hex value with your raw hex encoded transaction that you want to send.)

eth_getTransactionReceipt

Returns the receipt of a transaction by transaction hash

Text


eth_call

Executes a new message call immediately without creating a transaction on the block chain

Text


(The gas parameter to eth_call is 10000000)

eth_getCode

Returns code at a given address

Text


eth_getStorageAt

Returns the value from a storage position at a given address

Text


eth_gasPrice

Returns the current price per gas in wei

Text


eth_estimateGas

Makes a call or transaction, which won't be added to the blockchain and returns the used gas, which can be used for estimating the used gas

Text


(The gas parameter to eth_estimateGas is 10000000)

Stats APIs

Get Total Supply of CMP on the CMP Chain

Text


Get Circulation Supply of CMP on the CMP Chain

Text


Get CMP Last Price

Text


NFT APIs

Get Contract Metadata

Text


request params

name

type

required

desc

contractAddress

string

true

NFT contract address, eg: 0x8cee805fe5fa49e81266fcbc27f37d85062c1707

response data

name

type

desc

» address

string

contract address

» contractMetadata

object



»» name

string

The name attribute of the contract

»» symbol

string

The symbol attribute of the contract

»» totalSupply

string

The totalSupply attribute of the contract

»» tokenType

string

NFT type, ERC721, ERC1155, UNKNOWN

»» contractDeployer

string

Contract deployer

»» deployedBlockNumber

integer

The height of the block where the contract is deployed

»» openSea

object



Get NFT Metadata

Text


request params

name

type

required

desc

contractAddress

string

true

NFT contract address

tokenId

string

true

NFT token ID, decimal number

tokenType

string

optional

optional. ERC721 or ERC1155

response data

name

type

desc

» contract

object



»» address

string

NFT contract address

» id

object



»» tokenId

string

NFT token ID

»» tokenMetadata

object



»»» tokenType

string

ERC721 or ERC1155

» title

string

The name attribute of the metadata

» description

string

The description attribute of the metadata

» tokenUri

object



»» gateway

string

IPFS proxy gateway

»» raw

string

The token uri attribute of the contract

» media

object



»» gateway

string

Image gateway

»» thumbnail

string

Thumbnail gateway

»» raw

string

Raw image

»» format

string

Image format

»» bytes

integer

Image length

» metadata

object

The metadata of the token uri

» timeLastUpdated

string

Last update time

» contractMetadata

object

Same as returned by getcontractmetadata

»» name

string



»» symbol

string



»» totalSupply

string



»» tokenType

string



»» contractDeployer

string



»» deployedBlockNumber

integer



»» openSea

object



Get NFTs

Text


request params

name

type

required

desc

owner

string

true

owner address

withMetadata

string

optional

optional. Return metadata, true or false. Defaults to true.

contractAddresses

array

optional

optional. Array of contract addresses to filter the responses with. Max limit 45 contracts.

pageSize

string

optional

optional. Number of NFTs to be returned per page. Defaults to 100. Max is 100.

pageKey

string

optional

optional. key for pagination. If more results are available, a pageKey will be returned in the response. Pass back the pageKey as a param to fetch the next page of results.

response data

name

type

desc

» ownedNfts

object



»» contract

object



»»» address

string

NFT contract address

»» id

object



»»» tokenId

string

NFT token ID

»»» tokenMetadata

object



»»»» tokenType

string

ERC721 or ERC1155

»» balance

string

Token balance

»» title

string

The name attribute of the metadata

»» description

string

The description attribute of the metadata

»» tokenUri

object



»»» gateway

string

IPFS proxy gateway

»»» raw

string

The token uri attribute of the contract

»» media

object



»»» gateway

string

Image gateway

»»» thumbnail

string

Thumbnail gateway

»»» raw

string

Raw image

»»» format

string

Image format

»»» bytes

integer

Image length

»» metadata

object

The metadata of the token uri

»» timeLastUpdated

string

Last update time

»» contractMetadata

object

Same as returned by getContractMetadata

»»» name

string



»»» symbol

string



»»» totalSupply

string



»»» tokenType

string



»»» contractDeployer

string



»»» deployedBlockNumber

integer



»»» openSea

object



»» spamInfo

object



»»» isSpam

string



»»» classifications

string



» totalCount

integer

Total number of NFTs (distinct tokenIds) owned by the given address

» pageKey

string

key for pagination. If more results are available, a pageKey will be returned in the response. Pass back the pageKey as a param to fetch the next page of results.

» blockHash

string

The canonical head block hash of when your request was received