module Bitcoin: sig
.. end
OCaml interface to the official Bitcoin client API.
Exceptions
exception Unspecified_connection
Raised when connection parameter is not given and no default connection exists.
exception Bitcoin_error of int * string
Error reported by the Bitcoin client.
exception Internal_error of int * string
Unexpected response from the Bitcoin client
exception Httpclient_error of exn
Type definitions
type
address_t = string
Bitcoin address (hash of the public portion of public/private ECDSA keypair)
type
account_t = [ `Default | `Named of string ]
Besides the default account, one may also create named accounts
type
amount_t = int64
Amount in BTC, represented as a multiple of Bitcoin's base unit (= 10 nanoBTC).
type
txid_t = string
Transaction identifier
type
txoutput_t = txid_t * int
Transaction output
type
blkhash_t = string
Block hash
type
priv_t = string
Private portion of public/private ECDSA keypair
type
pub_t = string
Public portion of a public/private ECDSA keypair
type
sig_t = string
Message signature
type
sigcomp_t = [ `All | `None | `Single ]
How to compute signature hash
type
hextx_t = string
Hex representation of raw transaction
type
hexspk_t = string
Hex representation of script public key
type
hexblk_t = string
Hex representation of block data
type
hexwork_t = string
Hex representation of mining work data
type
node_t = string
Node representation
type
addnodeop_t = [ `Add | `Onetry | `Remove ]
Sub-commands associated with addnode
type
lockop_t = [ `Lock | `Unlock ]
Available operations for lockunspent
type
assoc_t = (string * Yojson.Safe.json) list
Association list
type
conn_t = {
|
inet_addr : Unix.inet_addr ; |
|
host : string ; |
|
port : int ; |
|
username : string ; |
|
password : string ; |
}
Public module types
module type HTTPCLIENT = sig
.. end
Interface that any module offering HTTP POST client calls must obey.
module type CONNECTION = sig
.. end
Module encapsulating all connection information.
module type ENGINE = sig
.. end
Actual engine offering the Bitcoin API.
Public functions and values
val amount_of_float : float -> amount_t
Converts a BTC quantity expressed as a
float
into its
Bitcoin.amount_t
representation.
val float_of_amount : amount_t -> float
Converts a BTC quantity expressed as an
Bitcoin.amount_t
into its
float
representation.
Public functors
module Make: