Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Contains the common types used through bitcoin RPC calls, that aren't specific to a single submodule.
Synopsis
- type Client = ByteString -> IO ByteString
- data BitcoinException
- type HexString = Text
- type TransactionID = HexString
- data Satoshi = Satoshi
- type BTC = Fixed Satoshi
- type Account = Text
- type Address = HexString
Documentation
type Client = ByteString -> IO ByteString Source #
Client
describes authentication credentials and host info for
making API requests to the Bitcoin daemon.
data BitcoinException Source #
A BitcoinException
is thrown when 'callApi encounters an
error. The API error code is represented as an Int
, the message as
a String
.
It may also be thrown when the value returned by the bitcoin API wasn't what we expected.
WARNING: Any of the functions in this module's public API may throw this exception. You should plan on handling it.
BitcoinApiError Int Text | A |
BitcoinResultTypeError ByteString | The raw JSON returned, if we can't figure out what actually went wrong. |
Instances
Eq BitcoinException Source # | |
Defined in Network.Bitcoin.Types (==) :: BitcoinException -> BitcoinException -> Bool # (/=) :: BitcoinException -> BitcoinException -> Bool # | |
Ord BitcoinException Source # | |
Defined in Network.Bitcoin.Types compare :: BitcoinException -> BitcoinException -> Ordering # (<) :: BitcoinException -> BitcoinException -> Bool # (<=) :: BitcoinException -> BitcoinException -> Bool # (>) :: BitcoinException -> BitcoinException -> Bool # (>=) :: BitcoinException -> BitcoinException -> Bool # max :: BitcoinException -> BitcoinException -> BitcoinException # min :: BitcoinException -> BitcoinException -> BitcoinException # | |
Read BitcoinException Source # | |
Defined in Network.Bitcoin.Types | |
Show BitcoinException Source # | |
Defined in Network.Bitcoin.Types showsPrec :: Int -> BitcoinException -> ShowS # show :: BitcoinException -> String # showList :: [BitcoinException] -> ShowS # | |
Exception BitcoinException Source # | |
Defined in Network.Bitcoin.Types |
type HexString = Text Source #
A string returned by the bitcoind API, representing data as hex.
What that data represents depends on the API call, but should be dcumented accordingly.
type TransactionID = HexString Source #
A hexadecimal string representation of a 256-bit unsigned integer.
This integer is a unique transaction identifier.
A satoshi is the smallest subdivision of bitcoins. For the resolution,
use resolution
from Fixed
.
Instances
HasResolution Satoshi Source # | |
Defined in Network.Bitcoin.Types resolution :: p Satoshi -> Integer # |
An account on the wallet is just a label to easily specify private keys.
The default account is an empty string.