plutus-ledger-0.1.0.0: Wallet API
Safe HaskellNone
LanguageHaskell2010

Ledger.Blockchain

Synopsis

Documentation

data OnChainTx Source #

A transaction on the blockchain. Invalid transactions are still put on the chain to be able to collect fees.

Constructors

Invalid Tx 
Valid Tx 

Instances

Instances details
Eq OnChainTx Source # 
Instance details

Defined in Ledger.Blockchain

Show OnChainTx Source # 
Instance details

Defined in Ledger.Blockchain

Generic OnChainTx Source # 
Instance details

Defined in Ledger.Blockchain

Associated Types

type Rep OnChainTx :: Type -> Type Source #

NFData OnChainTx Source # 
Instance details

Defined in Ledger.Blockchain

Methods

rnf :: OnChainTx -> () Source #

ToJSON OnChainTx Source # 
Instance details

Defined in Ledger.Blockchain

FromJSON OnChainTx Source # 
Instance details

Defined in Ledger.Blockchain

Serialise OnChainTx Source # 
Instance details

Defined in Ledger.Blockchain

Pretty OnChainTx Source # 
Instance details

Defined in Ledger.Blockchain

Methods

pretty :: OnChainTx -> Doc ann Source #

prettyList :: [OnChainTx] -> Doc ann Source #

type Rep OnChainTx Source # 
Instance details

Defined in Ledger.Blockchain

type Rep OnChainTx = D1 ('MetaData "OnChainTx" "Ledger.Blockchain" "plutus-ledger-0.1.0.0-BAhdPNOPbMF52ZvZJtxBkz" 'False) (C1 ('MetaCons "Invalid" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Tx)) :+: C1 ('MetaCons "Valid" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Tx)))

type Block = [OnChainTx] Source #

A block on the blockchain. This is just a list of transactions following on from the chain so far.

newtype BlockId Source #

Block identifier (usually a hash)

Constructors

BlockId 

Instances

Instances details
Eq BlockId Source # 
Instance details

Defined in Ledger.Blockchain

Ord BlockId Source # 
Instance details

Defined in Ledger.Blockchain

Show BlockId Source # 
Instance details

Defined in Ledger.Blockchain

Generic BlockId Source # 
Instance details

Defined in Ledger.Blockchain

Associated Types

type Rep BlockId :: Type -> Type Source #

ToJSON BlockId Source # 
Instance details

Defined in Ledger.Blockchain

FromJSON BlockId Source # 
Instance details

Defined in Ledger.Blockchain

ToSchema BlockId Source # 
Instance details

Defined in Ledger.Blockchain

Pretty BlockId Source # 
Instance details

Defined in Ledger.Blockchain

Methods

pretty :: BlockId -> Doc ann Source #

prettyList :: [BlockId] -> Doc ann Source #

type Rep BlockId Source # 
Instance details

Defined in Ledger.Blockchain

type Rep BlockId = D1 ('MetaData "BlockId" "Ledger.Blockchain" "plutus-ledger-0.1.0.0-BAhdPNOPbMF52ZvZJtxBkz" 'True) (C1 ('MetaCons "BlockId" 'PrefixI 'True) (S1 ('MetaSel ('Just "getBlockId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

type Blockchain = [Block] Source #

A blockchain, which is just a list of blocks, starting with the newest.

newtype Context Source #

Information about the state of the blockchain and about the transaction that is currently being validated, represented as a value in Data.

Constructors

Context BuiltinData 

Instances

Instances details
Show Context 
Instance details

Defined in Plutus.V1.Ledger.Scripts

ToJSON Context 
Instance details

Defined in Plutus.V1.Ledger.Scripts

FromJSON Context 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Pretty Context 
Instance details

Defined in Plutus.V1.Ledger.Scripts

Methods

pretty :: Context -> Doc ann Source #

prettyList :: [Context] -> Doc ann Source #

eitherTx :: (Tx -> r) -> (Tx -> r) -> OnChainTx -> r Source #

outputsProduced :: OnChainTx -> [TxOut] Source #

Outputs added to the UTXO set by the OnChainTx

transaction :: Blockchain -> TxId -> Maybe OnChainTx Source #

Lookup a transaction in a Blockchain by its id.

out :: Blockchain -> TxOutRef -> Maybe TxOut Source #

Determine the unspent output that an input refers to

value :: Blockchain -> TxOutRef -> Maybe Value Source #

Determine the unspent value that a transaction output refers to.

unspentOutputsTx :: Tx -> Map TxOutRef TxOut Source #

The unspent outputs of a transaction.

spentOutputs :: Tx -> Set TxOutRef Source #

The transaction output references consumed by a transaction.

unspentOutputs :: Blockchain -> Map TxOutRef TxOut Source #

The unspent transaction outputs of the ledger as a whole.

datumTxo :: Blockchain -> TxOutRef -> Maybe DatumHash Source #

Determine the data script that a transaction output refers to.

updateUtxo :: Tx -> Map TxOutRef TxOut -> Map TxOutRef TxOut Source #

Update a map of unspent transaction outputs and signatures based on the inputs and outputs of a transaction.

txOutPubKey :: TxOut -> Maybe PubKeyHash Source #

The public key attached to a TxOut, if there is one.

pubKeyTxo :: Blockchain -> TxOutRef -> Maybe PubKeyHash Source #

Determine the public key that locks a transaction output, if there is one.

validValuesTx :: Tx -> Bool Source #

Check that all values in a transaction are non-negative.

toOutRefMap :: OnChainTx -> Map TxOutRef TxOutTx Source #

A map of UTXO refs to TxOutTx values for a single on-chain transaction.