Copyright | No rights reserved |
---|---|
License | MIT |
Maintainer | jprupp@protonmail.ch |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Code related to transactions parsing and serialization.
Synopsis
- data Tx = Tx {
- txVersion :: !Word32
- txIn :: ![TxIn]
- txOut :: ![TxOut]
- txWitness :: !WitnessData
- txLockTime :: !Word32
- data TxIn = TxIn {
- prevOutput :: !OutPoint
- scriptInput :: !ByteString
- txInSequence :: !Word32
- data TxOut = TxOut {
- outValue :: !Word64
- scriptOutput :: !ByteString
- data OutPoint = OutPoint {
- outPointHash :: !TxHash
- outPointIndex :: !Word32
- newtype TxHash = TxHash {}
- type WitnessData = [WitnessStack]
- type WitnessStack = [WitnessStackItem]
- type WitnessStackItem = ByteString
- txHash :: Tx -> TxHash
- hexToTxHash :: Text -> Maybe TxHash
- txHashToHex :: TxHash -> Text
- nosigTxHash :: Tx -> TxHash
- nullOutPoint :: OutPoint
Transactions
Data type representing a transaction.
Tx | |
|
Instances
Data type representing a transaction input.
TxIn | |
|
Instances
Eq TxIn Source # | |
Ord TxIn Source # | |
Read TxIn Source # | |
Show TxIn Source # | |
Generic TxIn Source # | |
Hashable TxIn Source # | |
Defined in Haskoin.Transaction.Common | |
ToJSON TxIn Source # | |
Defined in Haskoin.Transaction.Common | |
FromJSON TxIn Source # | |
Binary TxIn Source # | |
Serial TxIn Source # | |
Defined in Haskoin.Transaction.Common | |
Serialize TxIn Source # | |
NFData TxIn Source # | |
Defined in Haskoin.Transaction.Common | |
type Rep TxIn Source # | |
Defined in Haskoin.Transaction.Common type Rep TxIn = D1 ('MetaData "TxIn" "Haskoin.Transaction.Common" "haskoin-core-0.21.1-inplace" 'False) (C1 ('MetaCons "TxIn" 'PrefixI 'True) (S1 ('MetaSel ('Just "prevOutput") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 OutPoint) :*: (S1 ('MetaSel ('Just "scriptInput") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteString) :*: S1 ('MetaSel ('Just "txInSequence") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32)))) |
Data type representing a transaction output.
TxOut | |
|
Instances
Eq TxOut Source # | |
Ord TxOut Source # | |
Read TxOut Source # | |
Show TxOut Source # | |
Generic TxOut Source # | |
Hashable TxOut Source # | |
Defined in Haskoin.Transaction.Common | |
ToJSON TxOut Source # | |
Defined in Haskoin.Transaction.Common | |
FromJSON TxOut Source # | |
Binary TxOut Source # | |
Serial TxOut Source # | |
Defined in Haskoin.Transaction.Common | |
Serialize TxOut Source # | |
NFData TxOut Source # | |
Defined in Haskoin.Transaction.Common | |
type Rep TxOut Source # | |
Defined in Haskoin.Transaction.Common type Rep TxOut = D1 ('MetaData "TxOut" "Haskoin.Transaction.Common" "haskoin-core-0.21.1-inplace" 'False) (C1 ('MetaCons "TxOut" 'PrefixI 'True) (S1 ('MetaSel ('Just "outValue") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Just "scriptOutput") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteString))) |
The OutPoint
refers to a transaction output being spent.
OutPoint | |
|
Instances
Eq OutPoint Source # | |
Ord OutPoint Source # | |
Defined in Haskoin.Transaction.Common | |
Read OutPoint Source # | |
Show OutPoint Source # | |
Generic OutPoint Source # | |
Hashable OutPoint Source # | |
Defined in Haskoin.Transaction.Common | |
ToJSON OutPoint Source # | |
Defined in Haskoin.Transaction.Common | |
FromJSON OutPoint Source # | |
Binary OutPoint Source # | |
Serial OutPoint Source # | |
Defined in Haskoin.Transaction.Common | |
Serialize OutPoint Source # | |
NFData OutPoint Source # | |
Defined in Haskoin.Transaction.Common | |
type Rep OutPoint Source # | |
Defined in Haskoin.Transaction.Common type Rep OutPoint = D1 ('MetaData "OutPoint" "Haskoin.Transaction.Common" "haskoin-core-0.21.1-inplace" 'False) (C1 ('MetaCons "OutPoint" 'PrefixI 'True) (S1 ('MetaSel ('Just "outPointHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TxHash) :*: S1 ('MetaSel ('Just "outPointIndex") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32))) |
Transaction id: hash of transaction excluding witness data.
Instances
Eq TxHash Source # | |
Ord TxHash Source # | |
Read TxHash Source # | |
Show TxHash Source # | |
IsString TxHash Source # | |
Defined in Haskoin.Transaction.Common fromString :: String -> TxHash # | |
Generic TxHash Source # | |
Hashable TxHash Source # | |
Defined in Haskoin.Transaction.Common | |
ToJSON TxHash Source # | |
Defined in Haskoin.Transaction.Common | |
FromJSON TxHash Source # | |
Binary TxHash Source # | |
Serial TxHash Source # | |
Defined in Haskoin.Transaction.Common | |
Serialize TxHash Source # | |
NFData TxHash Source # | |
Defined in Haskoin.Transaction.Common | |
type Rep TxHash Source # | |
Defined in Haskoin.Transaction.Common |
type WitnessData = [WitnessStack] Source #
Witness stack for SegWit transactions.
type WitnessStack = [WitnessStackItem] Source #
Witness stack for SegWit transactions.
type WitnessStackItem = ByteString Source #
Witness stack item for SegWit transactions.
txHashToHex :: TxHash -> Text Source #
Convert transaction hash to hex form, reversing bytes.
nosigTxHash :: Tx -> TxHash Source #
Transaction hash excluding signatures.
nullOutPoint :: OutPoint Source #
Outpoint used in coinbase transactions.