Developers
Explorer Api
58 min
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 https //cmpscan io/api?module=account\&action=balance\&address=0xf2519c98a7c5920e28a1e3514726e224c7e27972\&tag=latest\&apikey=yourapikeytoken get cmp balance for multiple addresses in a single call https //cmpscan io/api?module=account\&action=balancemulti\&address=0xf2519c98a7c5920e28a1e3514726e224c7e27972,0xd3c22074bdbbb952b9aa861724448f14d2ac57f7,0x99135c5e7a6d3343f3239c50d8f4fd4d12594c55\&tag=latest\&apikey=yourapikeytoken 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 https //cmpscan io/api?module=account\&action=txlist\&address=0x3b03a6e6cf79a7e1d5af56e4eb3c1e1b04cffa7d\&startblock=2527710\&endblock=2541962\&sort=asc\&apikey=yourapikeytoken (returns up to a maximum of the last 10000 transactions only) another example https //cmpscan io/api?module=account\&action=txlist\&address=0x3b03a6e6cf79a7e1d5af56e4eb3c1e1b04cffa7d\&startblock=2527710\&endblock=2541962\&page=0\&offset=100\&sort=asc\&apikey=yourapikeytoken (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 https //cmpscan io/api?module=account\&action=txlistinternal\&address=0x1fcba3cb797465f38839f48ca7c9cda9d9aac28b\&startblock=2825812\&endblock=2825860\&sort=asc\&apikey=yourapikeytoken (returns up to a maximum of the last 10000 transactions only) another example https //cmpscan io/api?module=account\&action=txlistinternal\&address=0x1fcba3cb797465f38839f48ca7c9cda9d9aac28b\&startblock=2825812\&endblock=2825860\&sort=asc\&page=0\&offset=10\&apikey=yourapikeytoken (to get paginated results use page=\[page number] and offset=\[max records to return]) get "internal transactions" by transaction hash https //cmpscan io/api?module=account\&action=txlistinternal\&txhash=0x9602d3fc27ac45da81c24fe0fe92bfb358e5abc00257c4d4df1a4508cc2cca63\&apikey=yourapikeytoken (returns up to a maximum of the last 10000 transactions only) get "internal transactions" by block range https //cmpscan io/api?module=account\&action=txlistinternal\&startblock=2802313\&endblock=2825860\&sort=asc\&page=0\&offset=10\&apikey=yourapikeytoken (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 https //cmpscan io/api?module=account\&action=tokentx\&address=0xa2de1fccdce3774c99a33f9b23abe4063f937129\&startblock=2799201\&endblock=2799211\&sort=asc\&apikey=yourapikeytoken (returns up to a maximum of the last 10000 transactions only) another example https //cmpscan io/api?module=account\&action=tokentx\&address=0xa2de1fccdce3774c99a33f9b23abe4063f937129\&startblock=2799201\&endblock=2799211\&sort=asc\&page=0\&offset=2\&apikey=yourapikeytoken (to get paginated results use page=\[page number] and offset=\[max records to return]) another example https //cmpscan io/api?module=account\&action=tokentx\&address=0xa2de1fccdce3774c99a33f9b23abe4063f937129\&contractaddress=0xb7d2ea9b4dbeb599ffa2dcbb0093ccd8512fcc0d\&startblock=2799201\&endblock=2799211\&sort=asc\&apikey=yourapikeytoken (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 https //cmpscan io/api?module=account\&action=tokennfttx\&contractaddress=0xef2698ce160c3e8602ffa438e3d1cc62836c1ecc\&startblock=2792700\&endblock=2792712\&sort=asc\&apikey=yourapikeytoken (returns up to a maximum of the last 10000 transactions only) another example https //cmpscan io/api?module=account\&action=tokennfttx\&contractaddress=0xef2698ce160c3e8602ffa438e3d1cc62836c1ecc\&startblock=2792700\&endblock=2792712\&sort=asc\&page=0\&offset=10\&apikey=yourapikeytoken (to get paginated results use page=\[page number] and offset=\[max records to return]) get list of blocks validated by address https //cmpscan io/api?module=account\&action=getminedblocks\&address=0xf81f8d2a3c513fef8718ac4c870ef1d2db39646e\&blocktype=blocks\&apikey=yourapikeytoken another example https //cmpscan io/api?module=account\&action=getminedblocks\&address=0xf81f8d2a3c513fef8718ac4c870ef1d2db39646e\&blocktype=blocks\&page=1\&offset=10\&apikey=yourapikeytoken (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 https //cmpscan io/api?module=contract\&action=getabi\&address=0x1fcba3cb797465f38839f48ca7c9cda9d9aac28b\&apikey=yourapikeytoken get contract source code for verified contract source codes https //cmpscan io/api?module=contract\&action=getsourcecode\&address=0x1fcba3cb797465f38839f48ca7c9cda9d9aac28b\&apikey=yourapikeytoken verify & publish contract source code this is a post request https //cmpscan io/api?module=contract\&action=verify\&apikey=yourapikeytoken here are some example of how this api may be used { "contract address" "0x1fcba3cb797465f38839f48ca7c9cda9d9aac28b", "compiler type" "singlefile", "compiler version" "v0 8 13+commit abaa5c0e", "license type" "mit license", "contract code" "// spdx license identifier mit\npragma solidity ^0 8 12;\n\ncontract wcmp {\n string public name = \\"wrapped cmp\\";\n string public symbol = \\"wcmp\\";\n uint8 public decimals = 18;\n\n event approval(address indexed src, address indexed who, uint value);\n event transfer(address indexed src, address indexed dst, uint value);\n event deposit(address indexed dst, uint value);\n event withdrawal(address indexed src, uint value);\n\n mapping (address => uint) public balanceof;\n mapping (address => mapping (address => uint)) public allowance;\n\n receive() external payable {\n deposit();\n }\n function deposit() public payable {\n balanceof\[msg sender] += msg value;\n emit deposit(msg sender, msg value);\n }\n function withdraw(uint value) public {\n require(balanceof\[msg sender] >= value);\n balanceof\[msg sender] = value;\n payable(msg sender) transfer(value);\n emit withdrawal(msg sender, value);\n }\n\n function totalsupply() public view returns (uint) {\n return address(this) balance;\n }\n\n function approve(address who, uint value) public returns (bool) {\n allowance\[msg sender]\[who] = value;\n emit approval(msg sender, who, value);\n return true;\n }\n\n function transfer(address dst, uint value) public returns (bool) {\n return transferfrom(msg sender, dst, value);\n }\n\n function transferfrom(address src, address dst, uint value) public returns (bool)\n {\n require(balanceof\[src] >= value);\n\n if (src != msg sender) {\n require(allowance\[src]\[msg sender] >= value);\n allowance\[src]\[msg sender] = value;\n }\n\n balanceof\[src] = value;\n balanceof\[dst] += value;\n\n emit transfer(src, dst, value);\n\n return true;\n }\n}", "contract name" "wcmp", "evm version" "default", "abi" "", "optimization" true, "optimizer runs" 200 } request params true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type transaction apis check transaction receipt status note status 0 = fail, 1 = pass https //cmpscan io/api?module=transaction\&action=gettxreceiptstatus\&txhash=0x9c3c35834f6ea8b331bd6747d9a14c316475b863c4728238ca05e7734d5963c5\&apikey=yourapikeytoken block apis get block rewards by blockno https //cmpscan io/api?module=block\&action=getblockreward\&blockno=39258\&apikey=yourapikeytoken get estimated block countdown time by blockno https //cmpscan io/api?module=block\&action=getblockcountdown\&blockno=13787886\&apikey=yourapikeytoken get block number by timestamp \[parameters] timestamp format unix timestamp (supports unix timestamps in seconds), closest value 'before' or 'after' https //cmpscan io/api?module=block\&action=getblocknobytime\×tamp=1644245532\&closest=after\&apikey=yourapikeytoken log apis the event log api was designed to provide an alternative to the native eth getlogs this is a post request https //cmpscan io/api?module=log\&action=getlogs\&apikey=yourapikeytoken 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" { "toblock" 13930, "fromblock" 13920, "address" "0x1fcba3cb797465f38839f48ca7c9cda9d9aac28b", "topics" \[ \["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"] ] } 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" { "toblock" 13930, "fromblock" 13920, "address" "0x1fcba3cb797465f38839f48ca7c9cda9d9aac28b", "topics" \[ \[], \[], \["0x000000000000000000000000af09c38ad49acfd8068dcc342b29afe8201eee6f"] ] } tips max range between "fromblock" and "toblock" is 10000 token apis get crc20 token totalsupply by contractaddress https //cmpscan io/api?module=stats\&action=tokensupply\&contractaddress=0x1fcba3cb797465f38839f48ca7c9cda9d9aac28b\&apikey=yourapikeytoken get crc20 token circulating supply by contractaddress https //cmpscan io/api?module=stats\&action=tokencsupply\&contractaddress=0x1fcba3cb797465f38839f48ca7c9cda9d9aac28b\&apikey=yourapikeytoken get crc20 token account balance for tokencontractaddress https //cmpscan io/api?module=account\&action=tokenbalance\&contractaddress=0xb7d2ea9b4dbeb599ffa2dcbb0093ccd8512fcc0d\&address=0x298a116ba1ed7ca59eacb679b78217d47328561c\&tag=latest\&apikey=yourapikeytoken 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 https //cmpscan io/api?module=proxy\&action=blocknumber\&apikey=yourapikeytoken eth getblockbynumber returns information about a block by block number https //cmpscan io/api?module=proxy\&action=getblockbynumber\&tag=0xd3d8\&boolean=true\&apikey=yourapikeytoken eth getblocktransactioncountbynumber returns the number of transactions in a block from a block matching the given block number https //cmpscan io/api?module=proxy\&action=getblocktransactioncountbynumber\&tag=0x2b3560\&apikey=yourapikeytoken eth gettransactionbyhash returns the information about a transaction requested by transaction hash https //cmpscan io/api?module=proxy\&action=gettransactionbyhash\&txhash=0xb40f0f6a83afba8a305938b776b3dfb11a63ac73f3e5eb53b8816d10db04cb84\&apikey=yourapikeytoken eth gettransactionbyblocknumberandindex returns information about a transaction by block number and transaction index position https //cmpscan io/api?module=proxy\&action=gettransactionbyblocknumberandindex\&tag=0x1dcbd9\&index=0x0\&apikey=yourapikeytoken eth gettransactioncount returns the number of transactions sent from an address https //cmpscan io/api?module=proxy\&action=gettransactioncount\&address=0x2d104cc9db395d5bc1d0043f7be3f8f5c1cffc88\&tag=latest\&apikey=yourapikeytoken eth sendrawtransaction creates new message call transaction or a contract creation for signed transactions https //cmpscan io/api?module=proxy\&action=sendrawtransaction\&hex=0xf8ab1385ba43b7400082afc894715aa09e6950ffdbda55cea77f72dd7f52ae1a6280b84440c10f1900000000000000000000000075ecd1ab06c4e34763a47e1033e80de614d09fa4000000000000000000000000000000000000000000000000000000014b1a92c082023ea0fc44da2f85b9fc598124c81ed13a62b49e6edc6248d8c4940ed9a192f62717cea05832a187f1d413c0fa27669ad277f2bcaa390827c420e314af44d8ee194c0eb3\&apikey=yourapikeytoken (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 https //cmpscan io/api?module=proxy\&action=gettransactionreceipt\&txhash=0x4d4c7996d8c52ea12716408cc8a2c0d3fcd7eafc1f7fbb59485bd12b685204e0\&apikey=yourapikeytoken eth call executes a new message call immediately without creating a transaction on the block chain https //cmpscan io/api?module=proxy\&action=call\&to=0xbe05ac1fb417c9ea435b37a9cecd39bc70359d31\&data=0x18160ddd\&tag=latest\&apikey=yourapikeytoken (the gas parameter to eth call is 10000000) eth getcode returns code at a given address https //cmpscan io/api?module=proxy\&action=getcode\&address=0x1fcba3cb797465f38839f48ca7c9cda9d9aac28b\&tag=latest\&apikey=yourapikeytoken eth getstorageat returns the value from a storage position at a given address https //cmpscan io/api?module=proxy\&action=getstorageat\&address=0x1fcba3cb797465f38839f48ca7c9cda9d9aac28b\&position=0x0\&tag=latest\&apikey=yourapikeytoken eth gasprice returns the current price per gas in wei https //cmpscan io/api?module=proxy\&action=gasprice\&apikey=yourapikeytoken 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 https //cmpscan io/api?module=proxy\&action=estimategas\&data=0x40c10f1900000000000000000000000075ecd1ab06c4e34763a47e1033e80de614d09fa4000000000000000000000000000000000000000000000000000000014b1a92c0\&to=0x715aa09e6950ffdbda55cea77f72dd7f52ae1a62\&value=0x0\&gasprice=0x430e23400\&gas=0xf4240\&apikey=yourapikeytoken (the gas parameter to eth estimategas is 10000000) stats apis get total supply of cmp on the cmp chain https //cmpscan io/api?module=stats\&action=cmpsupply\&apikey=yourapikeytoken get circulation supply of cmp on the cmp chain https //cmpscan io/api?module=stats\&action=cmpcsupply\&apikey=yourapikeytoken get cmp last price https //cmpscan io/api?module=stats\&action=cmpprice\&apikey=yourapikeytoken nft apis get contract metadata https //cmpscan io/api?module=nft\&action=getcontractmetadata\&apikey=yourapikeytoken\&contractaddress=0x8cee805fe5fa49e81266fcbc27f37d85062c1707 request params true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type response data true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type get nft metadata https //cmpscan io/api?module=nft\&action=getnftmetadata\&apikey=yourapikeytoken\&contractaddress=0x5bd985f8caa0f4e5ad5124af429d99d1794a94c4\&tokenid=0\&tokentype=erc1155 request params true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type response data true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type get nfts https //cmpscan io/api?module=nft\&action=getnfts\&apikey=yourapikeytoken\&owner=0xab4ac15f46cc0d815da7aad30ff31060c0171dce\&withmetadata=true\&pagesize=10 request params true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type response data true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type