Block explorer API

The block explorer API is defined in blocks.js ,which contain the BlockExplorer class.


Using the BlockExplorer class

To use the blockexplorer API, first need to import the block.js file

<script type="text/javascript" src="/assets/js/blocks.js"></script>

And create a new instance of the blockexplorer class :

<script type="text/javascript" >

MyBlocks = new BlockExplorer();

</script>

And then calling MyBlocks methods to fetch and update data on the webpage.

Creating HTML blocks

create_block_list(root_element)


create_addr_panel(root_element,addr)


create_tx_panel(root_element, txid)


create_day_nav(root_element,currentTime)


create_block_infos(root_element)


Retrieving information from the node


new_blocks()


list_addr_txs()


get_addr_balance()


get_lastblock()


get_lasttxs()


list_blocks(date, lastBlock)


list_txs(date)


list_block_txs(hash)


get_tx(hash)


Adding block filers

add_block_filter(key, op, val)


remove_filter(i)

Reacting to webpage events


selectBlockTxs(hash)


SelectTx(hash)


selectBlock(hash)


selectAddress(saddr)


Updating HTML layouts


update_addr_balance()


update_filter_list()


update_txs()


update_addr_txs()


update_tx(tx)


update_blocks_calendar(d, reload)


update_blocks()


updateblock(block)


resetblock(block)

New block event source


seteventsrc(in_url = '/newblock_event', handler)