# [−] Trait rpc::v1::BlockChain

    pub trait BlockChain: Sized + Send + Sync + 'static {
        fn best_block_hash(&self) -> Result<H256, Error>;
        fn block_count(&self) -> Result<u32, Error>;
        fn block_hash(&self, _: u32) -> Result<H256, Error>;
        fn difficulty(&self) -> Result<f64, Error>;
        fn block(
            &self,
            _: H256,
            _: Trailing<bool>
        ) -> Result<GetBlockResponse, Error>;
        fn transaction_out(
            &self,
            _: H256,
            _: u32,
            _: Trailing<bool>
        ) -> Result<GetTxOutResponse, Error>;
        fn transaction_out_set_info(&self) -> Result<GetTxOutSetInfoResponse, Error>;

        fn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M> { ... }
    }

Parity-bitcoin blockchain data interface.

## Required Methods

### `fn best_block_hash(&self) -> Result<H256, Error>`

Get hash of best block. @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getbestblockhash", "params": [], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/

### `fn block_count(&self) -> Result<u32, Error>`

Get height of best block. @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getblockcount", "params": [], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/

### `fn block_hash(&self, _: u32) -> Result<H256, Error>`

Get hash of block at given height. @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getblockhash", "params": [0], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/

### `fn difficulty(&self) -> Result<f64, Error>`

Get proof-of-work difficulty as a multiple of the minimum difficulty @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getdifficulty", "params": [], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/

### `fn block(&self, _: H256, _: Trailing<bool>) -> Result<GetBlockResponse, Error>`

Get information on given block. @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getblock", "params": ["000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/

### `fn transaction_out(
&self,
_: H256,
_: u32,
_: Trailing<bool>
) -> Result<GetTxOutResponse, Error>`

Get details about an unspent transaction output. @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "gettxout", "params": ["4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b", 0], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/

### `fn transaction_out_set_info(&self) -> Result<GetTxOutSetInfoResponse, Error>`

Get statistics about the unspent transaction output set. @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "gettxoutsetinfo", "params": [], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/

## Provided Methods

### `fn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M>`

Transform this into an `IoDelegate`, automatically wrapping the parameters.

## Implementors

###

`impl<T> BlockChain for BlockChainClient<T> where T: BlockChainClientCoreApi,`

[src]

####

`fn best_block_hash(&self) -> Result<H256, Error>`

[src]

####

`fn block_count(&self) -> Result<u32, Error>`

[src]

####

`fn block_hash(&self, height: u32) -> Result<H256, Error>`

[src]

####

`fn difficulty(&self) -> Result<f64, Error>`

[src]

####

`fn block( &self, hash: H256, verbose: Trailing<bool> ) -> Result<GetBlockResponse, Error>`

[src]

####

`fn transaction_out( &self, transaction_hash: H256, out_index: u32, _include_mempool: Trailing<bool> ) -> Result<GetTxOutResponse, Error>`

[src]

####

`fn transaction_out_set_info(&self) -> Result<GetTxOutSetInfoResponse, Error>`

[src]

####

`fn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M>` |

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)