| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Bitcoin.Transaction
Synopsis
- decode :: HexString -> Transaction
- encode :: Transaction -> HexString
- transactionId :: Transaction -> TransactionId
- data TxnOutputType
- data TransactionHash = TransactionHash Integer
- data OutPoint = OutPoint {}
- outPointIndex :: Lens' OutPoint Word32
- outPointHash :: Lens' OutPoint TransactionHash
- data TransactionIn = TransactionIn {}
- txInSequence :: Lens' TransactionIn Word32
- scriptInput :: Lens' TransactionIn Script
- prevOutput :: Lens' TransactionIn OutPoint
- data TransactionOut = TransactionOut {}
- scriptOutput :: Lens' TransactionOut Script
- outValue :: Lens' TransactionOut Word64
- data Transaction = Transaction {
- _txVersion :: Word32
- _txIn :: [TransactionIn]
- _txOut :: [TransactionOut]
- _txLockTime :: Word32
- txVersion :: Lens' Transaction Word32
- txOut :: Lens' Transaction [TransactionOut]
- txLockTime :: Lens' Transaction Word32
- txIn :: Lens' Transaction [TransactionIn]
- data Coinbase = Coinbase {}
- cbVersion :: Lens' Coinbase Word32
- cbPrevOutput :: Lens' Coinbase OutPoint
- cbOut :: Lens' Coinbase [TransactionOut]
- cbLockTime :: Lens' Coinbase Word32
- cbInSequence :: Lens' Coinbase Word32
- cbData :: Lens' Coinbase ByteString
Documentation
Arguments
| :: HexString | The hexadecimal representation of the transaction |
| -> Transaction | The decoded |
Decodes a hex representation of a transaction into a Transaction object.
Arguments
| :: Transaction | The |
| -> HexString | The hexadecimal representation of the transaction |
Encodes a Transaction object into a hex representation.
transactionId :: Transaction -> TransactionId #
Calculates the transaction id of a Transaction as a TransactionId so it
can be used in RPC interfaces.
data TxnOutputType #
Constructors
| TxnPubKey | JSON of "pubkey" received. |
| TxnPubKeyHash | JSON of "pubkeyhash" received. |
| TxnScriptHash | JSON of "scripthash" received. |
| TxnMultisig | JSON of "multisig" received. |
Instances
| Eq TxnOutputType # | |
Defined in Data.Bitcoin.Transaction.Types Methods (==) :: TxnOutputType -> TxnOutputType -> Bool # (/=) :: TxnOutputType -> TxnOutputType -> Bool # | |
| Ord TxnOutputType # | |
Defined in Data.Bitcoin.Transaction.Types Methods compare :: TxnOutputType -> TxnOutputType -> Ordering # (<) :: TxnOutputType -> TxnOutputType -> Bool # (<=) :: TxnOutputType -> TxnOutputType -> Bool # (>) :: TxnOutputType -> TxnOutputType -> Bool # (>=) :: TxnOutputType -> TxnOutputType -> Bool # max :: TxnOutputType -> TxnOutputType -> TxnOutputType # min :: TxnOutputType -> TxnOutputType -> TxnOutputType # | |
| Read TxnOutputType # | |
Defined in Data.Bitcoin.Transaction.Types Methods readsPrec :: Int -> ReadS TxnOutputType # readList :: ReadS [TxnOutputType] # | |
| Show TxnOutputType # | |
Defined in Data.Bitcoin.Transaction.Types Methods showsPrec :: Int -> TxnOutputType -> ShowS # show :: TxnOutputType -> String # showList :: [TxnOutputType] -> ShowS # | |
data TransactionHash #
Constructors
| TransactionHash Integer |
Instances
| Eq TransactionHash # | |
Defined in Data.Bitcoin.Transaction.Types Methods (==) :: TransactionHash -> TransactionHash -> Bool # (/=) :: TransactionHash -> TransactionHash -> Bool # | |
| Read TransactionHash # | |
Defined in Data.Bitcoin.Transaction.Types Methods readsPrec :: Int -> ReadS TransactionHash # readList :: ReadS [TransactionHash] # | |
| Show TransactionHash # | |
Defined in Data.Bitcoin.Transaction.Types Methods showsPrec :: Int -> TransactionHash -> ShowS # show :: TransactionHash -> String # showList :: [TransactionHash] -> ShowS # | |
| Binary TransactionHash # | |
Defined in Data.Bitcoin.Transaction.Types Methods put :: TransactionHash -> Put # get :: Get TransactionHash # putList :: [TransactionHash] -> Put # | |
The OutPoint is used inside a transaction input to reference the previous transaction output that it is spending.
Constructors
| OutPoint | |
Fields
| |
data TransactionIn #
Data type representing a transaction input.
Constructors
| TransactionIn | |
Fields
| |
Instances
| Eq TransactionIn # | |
Defined in Data.Bitcoin.Transaction.Types Methods (==) :: TransactionIn -> TransactionIn -> Bool # (/=) :: TransactionIn -> TransactionIn -> Bool # | |
| Read TransactionIn # | |
Defined in Data.Bitcoin.Transaction.Types Methods readsPrec :: Int -> ReadS TransactionIn # readList :: ReadS [TransactionIn] # | |
| Show TransactionIn # | |
Defined in Data.Bitcoin.Transaction.Types Methods showsPrec :: Int -> TransactionIn -> ShowS # show :: TransactionIn -> String # showList :: [TransactionIn] -> ShowS # | |
| Binary TransactionIn # | |
Defined in Data.Bitcoin.Transaction.Types | |
data TransactionOut #
Data type representing a transaction output.
Constructors
| TransactionOut | |
Fields
| |
Instances
| Eq TransactionOut # | |
Defined in Data.Bitcoin.Transaction.Types Methods (==) :: TransactionOut -> TransactionOut -> Bool # (/=) :: TransactionOut -> TransactionOut -> Bool # | |
| Read TransactionOut # | |
Defined in Data.Bitcoin.Transaction.Types Methods readsPrec :: Int -> ReadS TransactionOut # readList :: ReadS [TransactionOut] # | |
| Show TransactionOut # | |
Defined in Data.Bitcoin.Transaction.Types Methods showsPrec :: Int -> TransactionOut -> ShowS # show :: TransactionOut -> String # showList :: [TransactionOut] -> ShowS # | |
| Binary TransactionOut # | |
Defined in Data.Bitcoin.Transaction.Types Methods put :: TransactionOut -> Put # get :: Get TransactionOut # putList :: [TransactionOut] -> Put # | |
data Transaction #
Data type representing a bitcoin transaction
Constructors
| Transaction | |
Fields
| |
Instances
| Eq Transaction # | |
Defined in Data.Bitcoin.Transaction.Types | |
| Read Transaction # | |
Defined in Data.Bitcoin.Transaction.Types Methods readsPrec :: Int -> ReadS Transaction # readList :: ReadS [Transaction] # readPrec :: ReadPrec Transaction # readListPrec :: ReadPrec [Transaction] # | |
| Show Transaction # | |
Defined in Data.Bitcoin.Transaction.Types Methods showsPrec :: Int -> Transaction -> ShowS # show :: Transaction -> String # showList :: [Transaction] -> ShowS # | |
| Binary Transaction # | |
Defined in Data.Bitcoin.Transaction.Types | |
txOut :: Lens' Transaction [TransactionOut] #
txIn :: Lens' Transaction [TransactionIn] #
Data type representing the coinbase transaction of a Block. Coinbase
transactions are special types of transactions which are created by miners
when they find a new block. Coinbase transactions have no inputs. They have
outputs sending the newly generated bitcoins together with all the block's
fees to a bitcoin address (usually the miners address). Data can be embedded
in a Coinbase transaction which can be chosen by the miner of a block. This
data also typically contains some randomness which is used, together with
the nonce, to find a partial hash collision on the block's hash.
Constructors
| Coinbase | |
Fields
| |
cbOut :: Lens' Coinbase [TransactionOut] #