Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype UTxO era = UTxO { }
- txins :: HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))) => TxBody era -> Set ( TxIn ( Crypto era))
- txinLookup :: TxIn ( Crypto era) -> UTxO era -> Maybe ( TxOut era)
- txouts :: forall era. Era era => TxBody era -> UTxO era
- txup :: forall era tx. ( HasField "update" ( TxBody era) ( StrictMaybe ( Update era)), HasField "body" tx ( TxBody era)) => tx -> Maybe ( Update era)
- balance :: forall era. Era era => UTxO era -> Value era
- sumAllValue :: forall era tx f. ( Foldable f, HasField "value" tx ( Value era), Monoid ( Value era)) => f tx -> Value era
- totalDeposits :: ( HasField "_poolDeposit" pp Coin , HasField "_keyDeposit" pp Coin ) => pp -> ( KeyHash ' StakePool crypto -> Bool ) -> [ DCert crypto] -> Coin
- makeWitnessVKey :: forall c kr. ( Crypto c, DSignable c ( Hash ( HASH c) EraIndependentTxBody )) => SafeHash c EraIndependentTxBody -> KeyPair kr c -> WitVKey ' Witness c
- makeWitnessesVKey :: forall c kr. ( Crypto c, DSignable c ( Hash ( HASH c) EraIndependentTxBody )) => SafeHash c EraIndependentTxBody -> [ KeyPair kr c] -> Set ( WitVKey ' Witness c)
- makeWitnessesFromScriptKeys :: ( Crypto crypto, DSignable crypto ( Hash crypto EraIndependentTxBody )) => SafeHash crypto EraIndependentTxBody -> Map ( KeyHash kr crypto) ( KeyPair kr crypto) -> Set ( KeyHash kr crypto) -> Set ( WitVKey ' Witness crypto)
- verifyWitVKey :: ( Typeable kr, Crypto crypto, DSignable crypto ( Hash crypto EraIndependentTxBody )) => Hash crypto EraIndependentTxBody -> WitVKey kr crypto -> Bool
- getScriptHash :: Addr crypto -> Maybe ( ScriptHash crypto)
- scriptsNeeded :: forall era tx. ( Era era, HasField "body" tx ( TxBody era), HasField "certs" ( TxBody era) ( StrictSeq ( DCert ( Crypto era))), HasField "wdrls" ( TxBody era) ( Wdrl ( Crypto era)), HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era)))) => UTxO era -> tx -> Set ( ScriptHash ( Crypto era))
- scriptCred :: Credential kr crypto -> Maybe ( ScriptHash crypto)
- scriptStakeCred :: DCert crypto -> Maybe ( ScriptHash crypto)
- type TransUTxO (c :: Type -> Constraint ) era = (c ( TxOut era), TransTxId c era)
Primitives
The unspent transaction outputs.
Instances
Functions
txins :: HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))) => TxBody era -> Set ( TxIn ( Crypto era)) Source #
Compute the UTxO inputs of a transaction. txins has the same problems as txouts, see notes below.
txinLookup :: TxIn ( Crypto era) -> UTxO era -> Maybe ( TxOut era) Source #
Lookup a txin for a given UTxO collection
txouts :: forall era. Era era => TxBody era -> UTxO era Source #
Compute the transaction outputs of a transaction.
txup :: forall era tx. ( HasField "update" ( TxBody era) ( StrictMaybe ( Update era)), HasField "body" tx ( TxBody era)) => tx -> Maybe ( Update era) Source #
balance :: forall era. Era era => UTxO era -> Value era Source #
Determine the total balance contained in the UTxO.
sumAllValue :: forall era tx f. ( Foldable f, HasField "value" tx ( Value era), Monoid ( Value era)) => f tx -> Value era Source #
Sum all the value in any Foldable with elements that have a field "value"
totalDeposits :: ( HasField "_poolDeposit" pp Coin , HasField "_keyDeposit" pp Coin ) => pp -> ( KeyHash ' StakePool crypto -> Bool ) -> [ DCert crypto] -> Coin Source #
Determine the total deposit amount needed. The block may (legitimately) contain multiple registration certificates for the same pool, where the first will be treated as a registration and any subsequent ones as re-registration. As such, we must only take a deposit for the first such registration.
Note that this is not an issue for key registrations since subsequent registration certificates would be invalid.
makeWitnessVKey :: forall c kr. ( Crypto c, DSignable c ( Hash ( HASH c) EraIndependentTxBody )) => SafeHash c EraIndependentTxBody -> KeyPair kr c -> WitVKey ' Witness c Source #
Create a witness for transaction
makeWitnessesVKey :: forall c kr. ( Crypto c, DSignable c ( Hash ( HASH c) EraIndependentTxBody )) => SafeHash c EraIndependentTxBody -> [ KeyPair kr c] -> Set ( WitVKey ' Witness c) Source #
Create witnesses for transaction
makeWitnessesFromScriptKeys :: ( Crypto crypto, DSignable crypto ( Hash crypto EraIndependentTxBody )) => SafeHash crypto EraIndependentTxBody -> Map ( KeyHash kr crypto) ( KeyPair kr crypto) -> Set ( KeyHash kr crypto) -> Set ( WitVKey ' Witness crypto) Source #
From a list of key pairs and a set of key hashes required for a multi-sig scripts, return the set of required keys.
verifyWitVKey :: ( Typeable kr, Crypto crypto, DSignable crypto ( Hash crypto EraIndependentTxBody )) => Hash crypto EraIndependentTxBody -> WitVKey kr crypto -> Bool Source #
Verify a transaction body witness
getScriptHash :: Addr crypto -> Maybe ( ScriptHash crypto) Source #
Extract script hash from value address with script.
scriptsNeeded :: forall era tx. ( Era era, HasField "body" tx ( TxBody era), HasField "certs" ( TxBody era) ( StrictSeq ( DCert ( Crypto era))), HasField "wdrls" ( TxBody era) ( Wdrl ( Crypto era)), HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era)))) => UTxO era -> tx -> Set ( ScriptHash ( Crypto era)) Source #
Computes the set of script hashes required to unlock the transcation inputs and the withdrawals.
scriptCred :: Credential kr crypto -> Maybe ( ScriptHash crypto) Source #
scriptStakeCred :: DCert crypto -> Maybe ( ScriptHash crypto) Source #