bitcoin-hs-0.0.1: Partial implementation of the Bitcoin protocol (as of 2013)

Safe HaskellNone
LanguageHaskell98

Bitcoin.BlockChain.Tx

Description

Transaction data structures

Synopsis

Documentation

newtype RawTx Source #

"Raw" transaction (basically a ByteString)

Constructors

RawTx 

Fields

Instances

Eq RawTx Source # 

Methods

(==) :: RawTx -> RawTx -> Bool #

(/=) :: RawTx -> RawTx -> Bool #

Show RawTx Source # 

Methods

showsPrec :: Int -> RawTx -> ShowS #

show :: RawTx -> String #

showList :: [RawTx] -> ShowS #

data LockTime Source #

Lock time

Constructors

LockImmed

immediate (0x00000000)

LockBlock !Int

not until block #

LockTime !UnixTimeStamp

not before

data Tx inscript outscript Source #

Transactions, parametrized by the script types

Constructors

Tx 

Fields

Instances

BiTraversable Tx Source # 

Methods

mapAccumLFst :: (acc -> b -> (acc, c)) -> acc -> Tx b d -> (acc, Tx c d) Source #

mapAccumLSnd :: (acc -> c -> (acc, d)) -> acc -> Tx b c -> (acc, Tx b d) Source #

mapAccumLBoth :: (acc -> b -> (acc, d)) -> (acc -> c -> (acc, e)) -> acc -> Tx b c -> (acc, Tx d e) Source #

BiFoldable Tx Source # 

Methods

bifoldl :: (a -> b -> a) -> (a -> c -> a) -> a -> Tx b c -> a Source #

bifoldr :: (b -> a -> a) -> (c -> a -> a) -> Tx b c -> a -> a Source #

BiFunctor Tx Source # 

Methods

fmapFst :: (a -> b) -> Tx a c -> Tx b c Source #

fmapSnd :: (b -> c) -> Tx a b -> Tx a c Source #

fmapBoth :: (a -> c) -> (b -> d) -> Tx a b -> Tx c d Source #

(Eq inscript, Eq outscript) => Eq (Tx inscript outscript) Source # 

Methods

(==) :: Tx inscript outscript -> Tx inscript outscript -> Bool #

(/=) :: Tx inscript outscript -> Tx inscript outscript -> Bool #

(Show inscript, Show outscript) => Show (Tx inscript outscript) Source # 

Methods

showsPrec :: Int -> Tx inscript outscript -> ShowS #

show :: Tx inscript outscript -> String #

showList :: [Tx inscript outscript] -> ShowS #

data TxInput inscript Source #

Constructors

TxInput 

Fields

Instances

Functor TxInput Source # 

Methods

fmap :: (a -> b) -> TxInput a -> TxInput b #

(<$) :: a -> TxInput b -> TxInput a #

Eq inscript => Eq (TxInput inscript) Source # 

Methods

(==) :: TxInput inscript -> TxInput inscript -> Bool #

(/=) :: TxInput inscript -> TxInput inscript -> Bool #

Show inscript => Show (TxInput inscript) Source # 

Methods

showsPrec :: Int -> TxInput inscript -> ShowS #

show :: TxInput inscript -> String #

showList :: [TxInput inscript] -> ShowS #

data TxOutput outscript Source #

Constructors

TxOutput 

Fields

Instances

Functor TxOutput Source # 

Methods

fmap :: (a -> b) -> TxOutput a -> TxOutput b #

(<$) :: a -> TxOutput b -> TxOutput a #

Eq outscript => Eq (TxOutput outscript) Source # 

Methods

(==) :: TxOutput outscript -> TxOutput outscript -> Bool #

(/=) :: TxOutput outscript -> TxOutput outscript -> Bool #

Show outscript => Show (TxOutput outscript) Source # 

Methods

showsPrec :: Int -> TxOutput outscript -> ShowS #

show :: TxOutput outscript -> String #

showList :: [TxOutput outscript] -> ShowS #

txFee :: Tx (Tx a b) c -> Integer Source #

Computes the transaction fee, in satoshis.

We return an Integer so that this can be used to check the validity of a transaction. See CVE-2010-5139 vulnerability: https://en.bitcoin.it/wiki/Common_Vulnerabilities_and_Exposures#CVE-2010-5139

isCoinBaseTx :: Tx a b -> Bool Source #

We recognize coinbase transactions.

isCoinBaseTx' :: Tx a b -> Maybe a Source #

We recognize coinbase transactions, and return the coinbase data.