Safe Haskell | None |
---|---|
Language | Haskell2010 |
Pigy.Chain
Description
Monitor and act on the blockchain.
Synopsis
- kSecurity :: Int
- record :: SlotNo -> (Origins, Pendings) -> History -> History
- rollback :: SlotNo -> History -> History
- toSlotNo :: ChainPoint -> SlotNo
- makeActive :: Chain ()
- recordBlock :: SlotNo -> Chain ()
- recordRollback :: SlotNo -> Chain ()
- recordInput :: SlotNo -> TxIn -> Chain ()
- recordOutput :: [TxIn] -> TxIn -> MaryAddress -> Value -> Chain ()
- createPendingSingle :: Chain ()
- createPendingMultiple :: Chain ()
- createToken :: [TxIn] -> (MaryAddress, Value) -> Chain ()
- printRollback :: (Origins, Origins) -> (Pendings, Pendings) -> Chain ()
- printOrigins :: String -> Origins -> IO ()
- printPendings :: String -> Pendings -> IO ()
- runChain :: MonadFail m => MonadIO m => Context -> MantisM m ()
Documentation
Arguments
:: SlotNo | The curent slot number. |
-> (Origins, Pendings) | The tracked transactions and queued mintings. |
-> History | The original history. |
-> History | The augmented history. |
Record history.
Arguments
:: SlotNo | The slot number to revert to. |
-> History | The original history. |
-> History | The rolled-back history. |
Roll back history.
Arguments
:: ChainPoint | The chain point. |
-> SlotNo | The slot number. |
Extract the slot number from the chain point.
Arguments
:: SlotNo | The slot number. |
-> Chain () | Action to modify the chain state. |
Record a new block.
Arguments
:: SlotNo | The slot number to roll back to. |
-> Chain () | The action to modify the chain state. |
Roll back the chain state.
Arguments
:: SlotNo | The slot number. |
-> TxIn | The spent UTxO. |
-> Chain () | The action to modify the chain state. |
Record the input to a transaction.
Arguments
:: [TxIn] | The spend UTxOs. |
-> TxIn | The UTxO. |
-> MaryAddress | The destination address. |
-> Value | The total value. |
-> Chain () | The action to modify the chain state. |
Record the output of a transaction.
Arguments
:: Chain () | The action to modify the chain state. |
Mint a token from a single transaction.
createPendingMultiple Source #
Arguments
:: Chain () | The action to modify the chain state. |
Mint a token from multiple transactions.
Arguments
:: [TxIn] | The UTxOs to spend. |
-> (MaryAddress, Value) | The destination and total value. |
-> Chain () | The action to modify the chain state. |
Mint or burn a token.
Arguments
:: (Origins, Origins) | The prior and posterior tracking of transaction origins. |
-> (Pendings, Pendings) | The prior and posterior queues for minting. |
-> Chain () | The action to modify the chain state. |
Print diagnostic information for a rollback.
Arguments
:: String | The prefatory message. |
-> Origins | The transaction origins. |
-> IO () | The action to print the information. |
Print diagnostic information for transaction origins.
Arguments
:: String | The prefatory message. |
-> Pendings | The queued mintings. |
-> IO () | The action to print the information. |
Print diagnostic information for queued mintings.