[#btck] = btck :mrdocs: Type‐safe C++ RAII wrapper over the libbitcoinkernel C API. == Description Each type in this namespace owns or views a `btck_*` C handle and forwards to the matching `btck_*` C function, adding ownership semantics, ranges, and exceptions on top of the plain C interface declared in `kernel/bitcoinkernel.h`. == Types [cols="1,4"] |=== | Name| Description | xref:btck/Block.adoc[`Block`] | Owning wrapper over a `btck_Block`, a full block with its transactions. | xref:btck/BlockHash.adoc[`BlockHash`] | Owning wrapper over a `btck_BlockHash`. | xref:btck/BlockHashApi-00.adoc[`BlockHashApi`] | CRTP mixin adding block‐hash operations shared by the view and owning types. | xref:btck/BlockHashView.adoc[`BlockHashView`] | Non‐owning view over a `btck_BlockHash`. | xref:btck/BlockHeader.adoc[`BlockHeader`] | Owning wrapper over a `btck_BlockHeader`. | xref:btck/BlockHeaderApi-03.adoc[`BlockHeaderApi`] | CRTP mixin adding block‐header accessors shared by the view and owning types. | xref:btck/BlockHeaderView.adoc[`BlockHeaderView`] | Non‐owning view over a `btck_BlockHeader`. | xref:btck/BlockSpentOutputs.adoc[`BlockSpentOutputs`] | Owning wrapper over a `btck_BlockSpentOutputs`, the undo data of a whole block. | xref:btck/BlockTreeEntry.adoc[`BlockTreeEntry`] | Non‐owning view over a `btck_BlockTreeEntry`, a node in the block index tree. | xref:btck/BlockValidationState.adoc[`BlockValidationState`] | Owning wrapper over a `btck_BlockValidationState`, holding a block's validation outcome. | xref:btck/BlockValidationStateApi-0c.adoc[`BlockValidationStateApi`] | CRTP mixin adding block‐validation‐state accessors shared by the view and owning types. | xref:btck/BlockValidationStateView.adoc[`BlockValidationStateView`] | Non‐owning view over a `btck_BlockValidationState`. | xref:btck/ChainMan.adoc[`ChainMan`] | Owning wrapper over a `btck_ChainstateManager`, the entry point for block processing. | xref:btck/ChainParams.adoc[`ChainParams`] | Owning wrapper over `btck_ChainParameters`, the consensus parameters for a network. | xref:btck/ChainView.adoc[`ChainView`] | Non‐owning view over a `btck_Chain`, a sequence of block tree entries by height. | xref:btck/ChainstateManagerOptions.adoc[`ChainstateManagerOptions`] | Owning wrapper over `btck_ChainstateManagerOptions`, configuring a ChainMan. | xref:btck/Coin.adoc[`Coin`] | Owning wrapper over a `btck_Coin`. | xref:btck/CoinApi-06.adoc[`CoinApi`] | CRTP mixin adding coin accessors shared by the view and owning types. | xref:btck/CoinView.adoc[`CoinView`] | Non‐owning view over a `btck_Coin`, an unspent transaction output entry. | xref:btck/ConsensusParamsView.adoc[`ConsensusParamsView`] | Non‐owning view over `btck_ConsensusParams`, the consensus parameters of a chain. | xref:btck/Context.adoc[`Context`] | Owning wrapper over a `btck_Context`, the top‐level kernel execution context. | xref:btck/ContextOptions.adoc[`ContextOptions`] | Owning wrapper over `btck_ContextOptions`, configuring a Context before creation. | xref:btck/Handle-046.adoc[`Handle`] | Owning RAII handle for a copyable C object of type `CType.` | xref:btck/Iterator.adoc[`Iterator`] | Random‐access iterator that lazily materializes views of a collection by index. | xref:btck/KernelNotifications.adoc[`KernelNotifications`] | Base class for receiving kernel notifications; override the handlers you need. | xref:btck/Logger.adoc[`Logger`] | Connects a user log sink of type `T` to the kernel logging system. | xref:btck/OutPoint.adoc[`OutPoint`] | Owning wrapper over a `btck_TransactionOutPoint`. | xref:btck/OutPointApi-0b.adoc[`OutPointApi`] | CRTP mixin adding out‐point accessors shared by the view and owning types. | xref:btck/OutPointView.adoc[`OutPointView`] | Non‐owning view over a `btck_TransactionOutPoint`. | xref:btck/PrecomputedTransactionData.adoc[`PrecomputedTransactionData`] | Owning wrapper over `btck_PrecomputedTransactionData` used to cache signature hashes. | xref:btck/Range-01.adoc[`Range`] | Read‐only random‐access view over an indexed C‐handle collection. | xref:btck/Range-0b.adoc[`Range`] | Read‐only random‐access view over an indexed C‐handle collection. | xref:btck/ScriptPubkey.adoc[`ScriptPubkey`] | Owning wrapper over a `btck_ScriptPubkey` output script. | xref:btck/ScriptPubkeyApi-02.adoc[`ScriptPubkeyApi`] | CRTP mixin adding script‐pubkey operations shared by the view and owning types. | xref:btck/ScriptPubkeyView.adoc[`ScriptPubkeyView`] | Non‐owning view over a `btck_ScriptPubkey`. | xref:btck/Transaction.adoc[`Transaction`] | Owning wrapper over a `btck_Transaction`. | xref:btck/TransactionApi-08.adoc[`TransactionApi`] | CRTP mixin adding transaction accessors shared by the view and owning types. | xref:btck/TransactionInput.adoc[`TransactionInput`] | Owning wrapper over a `btck_TransactionInput`. | xref:btck/TransactionInputApi-0b.adoc[`TransactionInputApi`] | CRTP mixin adding transaction‐input accessors shared by the view and owning types. | xref:btck/TransactionInputView.adoc[`TransactionInputView`] | Non‐owning view over a `btck_TransactionInput`. | xref:btck/TransactionOutput.adoc[`TransactionOutput`] | Owning wrapper over a `btck_TransactionOutput`. | xref:btck/TransactionOutputApi-04.adoc[`TransactionOutputApi`] | CRTP mixin adding transaction‐output accessors shared by the view and owning types. | xref:btck/TransactionOutputView.adoc[`TransactionOutputView`] | Non‐owning view over a `btck_TransactionOutput`. | xref:btck/TransactionSpentOutputs.adoc[`TransactionSpentOutputs`] | Owning wrapper over a `btck_TransactionSpentOutputs`, the coins spent by one transaction. | xref:btck/TransactionSpentOutputsApi-0d.adoc[`TransactionSpentOutputsApi`] | CRTP mixin adding accessors over the coins spent by one transaction. | xref:btck/TransactionSpentOutputsView.adoc[`TransactionSpentOutputsView`] | Non‐owning view over a `btck_TransactionSpentOutputs`. | xref:btck/TransactionView.adoc[`TransactionView`] | Non‐owning view over a `btck_Transaction`. | xref:btck/TxValidationState.adoc[`TxValidationState`] | Owning wrapper over a `btck_TxValidationState`, holding a transaction's validation outcome. | xref:btck/Txid.adoc[`Txid`] | Owning wrapper over a `btck_Txid` transaction identifier. | xref:btck/TxidApi-020.adoc[`TxidApi`] | CRTP mixin adding transaction‐id operations shared by the view and owning types. | xref:btck/TxidView.adoc[`TxidView`] | Non‐owning view over a `btck_Txid`. | xref:btck/UniqueHandle-0da.adoc[`UniqueHandle`] | Owning RAII handle for a non‐copyable C object, backed by std::unique_ptr. | xref:btck/ValidationInterface.adoc[`ValidationInterface`] | Base class for receiving validation events; override the handlers you need. | xref:btck/View-041.adoc[`View`] | Non‐owning view over a const C handle of type `CType.` | xref:btck/WitnessStack.adoc[`WitnessStack`] | Owning wrapper over a `btck_WitnessStack`. | xref:btck/WitnessStackApi-04.adoc[`WitnessStackApi`] | CRTP mixin adding witness‐stack accessors shared by the view and owning types. | xref:btck/WitnessStackView.adoc[`WitnessStackView`] | Non‐owning view over a `btck_WitnessStack`. | xref:btck/is_bitmask_enum-04.adoc[`is_bitmask_enum`] | Trait marking an enum as a bitmask; specialize to `std::true_type` to opt in. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:btck/BlockCheckFlags.adoc[`BlockCheckFlags`] | Selects which block checks to run, mirroring `btck_BlockCheckFlags`; combinable as a bitmask. | xref:btck/BlockValidationResult.adoc[`BlockValidationResult`] | Reason a block failed validation, mirroring `btck_BlockValidationResult`. | xref:btck/ChainType.adoc[`ChainType`] | Bitcoin network the chain parameters describe, mirroring `btck_ChainType`. | xref:btck/LogCategory.adoc[`LogCategory`] | Logging category, mirroring `btck_LogCategory`. | xref:btck/LogLevel.adoc[`LogLevel`] | Logging verbosity level, mirroring `btck_LogLevel`. | xref:btck/ScriptVerificationFlags.adoc[`ScriptVerificationFlags`] | Script verification flags, mirroring `btck_ScriptVerificationFlags`; combinable as a bitmask. | xref:btck/ScriptVerifyStatus.adoc[`ScriptVerifyStatus`] | Status of a script verification call, mirroring `btck_ScriptVerifyStatus`. | xref:btck/SynchronizationState.adoc[`SynchronizationState`] | Stage of block synchronization, mirroring `btck_SynchronizationState`. | xref:btck/TxValidationResult.adoc[`TxValidationResult`] | Reason a transaction failed validation, mirroring `btck_TxValidationResult`. | xref:btck/ValidationMode.adoc[`ValidationMode`] | Outcome of a validation operation, mirroring `btck_ValidationMode`. | xref:btck/Warning.adoc[`Warning`] | Kernel warning condition, mirroring `btck_Warning`. |=== == Functions [cols="1,4"] |=== | Name| Description | xref:btck/CheckTransaction.adoc[`CheckTransaction`] | Runs consensus‐level checks on a standalone transaction. | xref:btck/check.adoc[`check`] | Throws if a freshly returned C handle is null, otherwise passes it through. | xref:btck/logging_disable.adoc[`logging_disable`] | Disables all kernel logging. | xref:btck/logging_disable_category.adoc[`logging_disable_category`] | Disables logging for a category. | xref:btck/logging_enable_category.adoc[`logging_enable_category`] | Enables logging for a category. | xref:btck/logging_set_level_category.adoc[`logging_set_level_category`] | Sets the log level for a single category. | xref:btck/logging_set_options.adoc[`logging_set_options`] | Applies global logging options. | xref:btck/operator_bitand.adoc[`operator&`] | Bitwise AND of two bitmask‐enum values. | xref:btck/operator_and_eq.adoc[`operator&=`] | Bitwise AND‐assign for a bitmask‐enum value. | xref:btck/operator_plus.adoc[`operator+`] | Returns an iterator advanced by `n` positions (offset on the left). | xref:btck/operator_xor.adoc[`operatorˆ`] | Bitwise XOR of two bitmask‐enum values. | xref:btck/operator_xor_eq.adoc[`operatorˆ=`] | Bitwise XOR‐assign for a bitmask‐enum value. | xref:btck/operator_bitor.adoc[`operator|`] | Bitwise OR of two bitmask‐enum values. | xref:btck/operator_or_eq.adoc[`operator|=`] | Bitwise OR‐assign for a bitmask‐enum value. | xref:btck/operator_bitnot.adoc[`operator~`] | Bitwise complement of a bitmask‐enum value. | xref:btck/set_mock_time.adoc[`set_mock_time`] | Overrides the kernel's notion of the current time, for testing. | xref:btck/write_bytes.adoc[`write_bytes`] | Serializes a C object into a byte vector using its `to_bytes` callback. |=== == Concepts [cols="1,4"] |=== | Name| Description | xref:btck/BitmaskEnum.adoc[`BitmaskEnum`] | Satisfied by enums opted into bitmask operators via is_bitmask_enum. | xref:btck/IndexedContainer.adoc[`IndexedContainer`] | Satisfied when a container exposes a size accessor and an indexed element accessor. | xref:btck/Log.adoc[`Log`] | Satisfied by a type exposing `LogMessage(std::string_view)` returning void. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#