Skip to content

Primitive Types

evoskuil edited this page Dec 11, 2014 · 9 revisions

Primitive Types

BX defines the following set of Bitcoin primitive types in the bx::primitives namespace.

address
base2
base10
base16
base58
base64
btc160
btc256
ec_private
ec_public
encoding
endorsement
hashtype
hd_key
hd_priv
hd_pub
header
input
output
point
raw
script
signature
stealth
transaction
uri
wif
wrapper

These are individual classes that are for the most part simple wrappers around types and/or functions exposed by libbitcoin. The classes consistently implement overrides of stream operators by conversion to/from text encodings. As a result they drop seamlessly into input processing and output processing like any other serializable type.

Deserialization by any of these primitives, including string-based construction, can throw boost::program_options::invalid_option_value. One should consider handling this exception when using libbitcoin-explorer as a library.

The primitives that represent complex types also provide conversion functions to Boost property_tree, enabling complex textual serializations in addition to native formats. BX does not currently support complex textual deserializations apart from native formats, although that could be accomplished in part by extending the primitives with property_tree deserialization.

BX Menu

Clone this wiki locally