| Copyright | No rights reserved |
|---|---|
| License | MIT |
| Maintainer | jprupp@protonmail.ch |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Haskoin.Transaction.Common
Contents
Description
Code related to transactions parsing and serialization.
Synopsis
- data Tx = Tx {}
- data TxIn = TxIn {}
- data TxOut = TxOut {
- value :: !Word64
- script :: !ByteString
- data OutPoint = OutPoint {}
- 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.
Constructors
| Tx | |
Instances
Data type representing a transaction input.
Constructors
| TxIn | |
Instances
| FromJSON TxIn Source # | |||||
Defined in Haskoin.Transaction.Common | |||||
| ToJSON TxIn Source # | |||||
| Generic TxIn Source # | |||||
Defined in Haskoin.Transaction.Common Associated Types
| |||||
| Read TxIn Source # | |||||
| Show TxIn Source # | |||||
| Binary TxIn Source # | |||||
| Serial TxIn Source # | |||||
Defined in Haskoin.Transaction.Common | |||||
| Serialize TxIn Source # | |||||
| NFData TxIn Source # | |||||
Defined in Haskoin.Transaction.Common | |||||
| Eq TxIn Source # | |||||
| Ord TxIn Source # | |||||
| Hashable 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-1.2.2-IqsPTB3lyDG9ChtLlvwlSX" 'False) (C1 ('MetaCons "TxIn" 'PrefixI 'True) (S1 ('MetaSel ('Just "outpoint") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 OutPoint) :*: (S1 ('MetaSel ('Just "script") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteString) :*: S1 ('MetaSel ('Just "sequence") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32)))) | |||||
Data type representing a transaction output.
Constructors
| TxOut | |
Fields
| |
Instances
| FromJSON TxOut Source # | |||||
Defined in Haskoin.Transaction.Common | |||||
| ToJSON TxOut Source # | |||||
| Generic TxOut Source # | |||||
Defined in Haskoin.Transaction.Common Associated Types
| |||||
| Read TxOut Source # | |||||
| Show TxOut Source # | |||||
| Binary TxOut Source # | |||||
| Serial TxOut Source # | |||||
Defined in Haskoin.Transaction.Common | |||||
| Serialize TxOut Source # | |||||
| NFData TxOut Source # | |||||
Defined in Haskoin.Transaction.Common | |||||
| Eq TxOut Source # | |||||
| Ord TxOut Source # | |||||
| Hashable 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-1.2.2-IqsPTB3lyDG9ChtLlvwlSX" 'False) (C1 ('MetaCons "TxOut" 'PrefixI 'True) (S1 ('MetaSel ('Just "value") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Just "script") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteString))) | |||||
The OutPoint refers to a transaction output being spent.
Constructors
| OutPoint | |
Instances
| FromJSON OutPoint Source # | |||||
Defined in Haskoin.Transaction.Common | |||||
| ToJSON OutPoint Source # | |||||
| Generic OutPoint Source # | |||||
Defined in Haskoin.Transaction.Common Associated Types
| |||||
| Read OutPoint Source # | |||||
| Show OutPoint Source # | |||||
| Binary OutPoint Source # | |||||
| Serial OutPoint Source # | |||||
Defined in Haskoin.Transaction.Common | |||||
| Serialize OutPoint Source # | |||||
| NFData OutPoint Source # | |||||
Defined in Haskoin.Transaction.Common | |||||
| Eq OutPoint Source # | |||||
| Ord OutPoint Source # | |||||
Defined in Haskoin.Transaction.Common | |||||
| Hashable 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-1.2.2-IqsPTB3lyDG9ChtLlvwlSX" 'False) (C1 ('MetaCons "OutPoint" 'PrefixI 'True) (S1 ('MetaSel ('Just "hash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TxHash) :*: S1 ('MetaSel ('Just "index") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32))) | |||||
Transaction id: hash of transaction excluding witness data.
Instances
| FromJSON TxHash Source # | |||||
Defined in Haskoin.Transaction.Common | |||||
| ToJSON TxHash Source # | |||||
| IsString TxHash Source # | |||||
Defined in Haskoin.Transaction.Common Methods fromString :: String -> TxHash # | |||||
| Generic TxHash Source # | |||||
Defined in Haskoin.Transaction.Common Associated Types
| |||||
| Read TxHash Source # | |||||
| Show TxHash Source # | |||||
| Binary TxHash Source # | |||||
| Serial TxHash Source # | |||||
Defined in Haskoin.Transaction.Common | |||||
| Serialize TxHash Source # | |||||
| NFData TxHash Source # | |||||
Defined in Haskoin.Transaction.Common | |||||
| Eq TxHash Source # | |||||
| Ord TxHash Source # | |||||
| Hashable 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.