Struct bitcoins::nets::Bitcoin [−][src]
pub struct Bitcoin<T: AddressEncoder>(_);
Expand description
A newtype for Bitcoin networks, parameterized by an encoder. We change the encoder to differentiate between main, test, and signet.
Trait Implementations
A type handling the network’s address semantics. This will typically represent some
predicate on the transaction. It is used by both the Encoder
and the Builder
. Read more
type Error = EncodingError
type Error = EncodingError
An error type that will be used by the Encoder
, and returned by the passthrough
encode_address
and decode_address
functions Read more
type RecipientIdentifier = ScriptPubkey
type RecipientIdentifier = ScriptPubkey
A type representing the in-protocol recipient. This is usually different from the Address type. Read more
type Encoder = T
type Encoder = T
An Encoder
that uses the Address
and Error
types above. This Encoder
must
implement AddressEncoder
. It handles translating the Address
type to the networks
RecipientIdentifier
type. Read more
type TxIn = BitcoinTxIn
type TxIn = BitcoinTxIn
A transaction Input type. This type is used within the Transaction
and specificies UTXOs
being spent by the transaction. Read more
A transaction Output type. This type is used within the Transaction
and specificies
UTXOs being consumed by the transaction. Read more
type Builder = BitcoinTxBuilder<T>
type Builder = BitcoinTxBuilder<T>
A transaction Builder that uses the Encoder
and Transaction
types defined earlier.
The builder is returned by Network::tx_builder()
, and provides a convenient interface
for transaction construction. Read more
Returns a new instance of the associated transaction builder.
Instantiate a builder from a tx object
Instantiate a builder from a tx object
fn builder_from_hex(
hex_tx: &str
) -> Result<Self::Builder, <Self::Tx as Transaction>::TxError>
fn builder_from_hex(
hex_tx: &str
) -> Result<Self::Builder, <Self::Tx as Transaction>::TxError>
Instantiate a builder from a hex-serialized transaction
Encode an address using the network’s Address
semantics
Decode an address using the network’s Address
semantics