Safe Haskell | None |
---|---|
Language | Haskell98 |
An interface to bitcoind's available block-chain-related RPC calls. The implementation of these functions can be found at https://github.com/bitcoin/bitcoin/blob/master/src/rpcblockchain.cpp.
If any APIs are missing, patches are always welcome. If you look at the source of this module, you'll see that the interface code is trivial.
- type Client = ByteString -> IO ByteString
- type TransactionID = HexString
- type BTC = Fixed Satoshi
- getBlockCount :: Client -> IO Integer
- getDifficulty :: Client -> IO Integer
- setTransactionFee :: Client -> BTC -> IO ()
- getRawMemoryPool :: Client -> IO (Vector TransactionID)
- type BlockHash = HexString
- getBlockHash :: Client -> Integer -> IO BlockHash
- data Block = Block {
- blockHash :: BlockHash
- blkConfirmations :: Integer
- blkSize :: Integer
- blkHeight :: Integer
- blkVersion :: Integer
- merkleRoot :: BlockHash
- subTransactions :: Vector TransactionID
- blkTime :: Integer
- blkNonce :: Integer
- blkBits :: HexString
- blkDifficulty :: Integer
- nextBlock :: Maybe BlockHash
- prevBlock :: Maybe BlockHash
- getBlock :: Client -> BlockHash -> IO Block
- data OutputSetInfo = OutputSetInfo {}
- getOutputSetInfo :: Client -> IO OutputSetInfo
- data OutputInfo = OutputInfo {}
- getOutputInfo :: Client -> TransactionID -> Integer -> IO OutputInfo
Documentation
type Client = ByteString -> IO ByteString Source
Client
describes authentication credentials and host info for
making API requests to the Bitcoin daemon.
type TransactionID = HexString Source
A hexadecimal string representation of a 256-bit unsigned integer.
This integer is a unique transaction identifier.
getBlockCount :: Client -> IO Integer Source
Returns the number of blocks in the longest block chain.
getDifficulty :: Client -> IO Integer Source
Returns the proof-of-work difficulty as a multiple of the minimum difficulty.
setTransactionFee :: Client -> BTC -> IO () Source
Sets the transaction fee will will pay to the network. Values of 0 are rejected.
getRawMemoryPool :: Client -> IO (Vector TransactionID) Source
Returns all transaction identifiers in the memory pool.
Returns the hash of the block in best-block-chain at the given index.
Information about a given block in the block chain.
Block | |
|
data OutputSetInfo Source
Information on the unspent transaction in the output set.
OutputSetInfo | |
|
getOutputSetInfo :: Client -> IO OutputSetInfo Source
Returns statistics about the unspent transaction output set.
data OutputInfo Source
Details about an unspent transaction output.
OutputInfo | |
|
:: Client | |
-> TransactionID | |
-> Integer | The index we're looking at. |
-> IO OutputInfo |
Returns details about an unspent transaction output.