0.0.2 • Published 4 years ago

exonum-explorer-react v0.0.2

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
4 years ago

Exonum Explorer React

Installation

npm i exonum-explorer-react

Usage

import { BlockchainExplorer, BlockPage, TxPage, BlockList } from 'exonum-explorer-react'

const Explorer = ()=> {
    return (
        <BlockchainExplorer nodes={['https://node1.com', 'https://node2.com']}>
          
          /* Block page */
          <BlockPage height='BLOCK_HEIGHT'>
            /* Block rendering function */
            {block => <div>{block.height}</div>}
          </BlockPage>

          /* Transaction page */
          <TxPage hash='TX_HASH'>
            /* Transaction rendering function */
            {tx => <div>{tx.type}</div>}
          </TxPage>

          /* Block list page */
          <BlockList page={1} perPage={200}>
            /* Block list rendering function */
            {({blocks})=>
                {<div>{blocks.map(
                  block => <div>{block.height}</div>)}
                </div>}}
          </BlockList>
        </BlockchainExplorer>)
}
0.0.2

4 years ago

0.0.1

5 years ago