Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Conversion functions and other conveniences
Synopsis
- scriptFromCbor ∷ String → Either String (PlutusScript PlutusScriptV2)
- unsafeScriptFromCbor ∷ String → PlutusScript PlutusScriptV2
- scriptAddress ∷ NetworkId → PlutusScript PlutusScriptV2 → AddressInEra BabbageEra
- scriptFromCborV1 ∷ String → Either String (PlutusScript PlutusScriptV1)
- unsafeScriptFromCborV1 ∷ String → PlutusScript PlutusScriptV1
- scriptAddressV1 ∷ NetworkId → PlutusScript PlutusScriptV1 → AddressInEra BabbageEra
- txFromCbor ∷ String → Either String (Tx BabbageEra)
- unsafeTxFromCbor ∷ String → Tx BabbageEra
- liftResult ∷ MonadError e m ⇒ (String → e) → ResultT m a → m a
- liftEither ∷ MonadError e m ⇒ (ee → e) → m (Either ee a) → m a
- mapError ∷ MonadError e m ⇒ (ee → e) → ExceptT ee m a → m a
- failOnLeft ∷ MonadIO m ⇒ (e → String) → Either e a → m a
- failOnLeftLog ∷ (MonadLog m, MonadIO m) ⇒ (e → String) → Either e a → m a
- readSigningKeyFromFile ∷ FilePath → IO (SigningKey PaymentKey)
- readVerificationKeyFromFile ∷ FilePath → IO (VerificationKey PaymentKey)
- readStakingKeyFromFile ∷ FilePath → IO (VerificationKey StakeKey)
- extractTx ∷ ∀ m. MonadIO m ⇒ Set TxId → BlockInMode CardanoMode → m ()
- txnUtxos ∷ Tx era → [(TxIn, TxOut CtxTx era)]
- slotToUtcTime ∷ EraHistory mode → SystemStart → SlotNo → Either String UTCTime
- utcTimeToSlot ∷ EraHistory mode → SystemStart → UTCTime → Either String (SlotNo, NominalDiffTime, NominalDiffTime)
- utcTimeToSlotUnsafe ∷ EraHistory mode → SystemStart → UTCTime → Either String (SlotNo, NominalDiffTime, NominalDiffTime)
- utcTimeToPosixTime ∷ UTCTime → POSIXTime
- posixTimeToSlot ∷ EraHistory mode → SystemStart → POSIXTime → Either String (SlotNo, NominalDiffTime, NominalDiffTime)
- posixTimeToSlotUnsafe ∷ EraHistory mode → SystemStart → POSIXTime → Either String (SlotNo, NominalDiffTime, NominalDiffTime)
- toShelleyPaymentCredential ∷ PaymentCredential → PaymentCredential StandardCrypto
Documentation
scriptAddress ∷ NetworkId → PlutusScript PlutusScriptV2 → AddressInEra BabbageEra Source #
Script address without staking key
Plutus V1
scriptAddressV1 ∷ NetworkId → PlutusScript PlutusScriptV1 → AddressInEra BabbageEra Source #
Script address without staking key
Serialised transactions
txFromCbor ∷ String → Either String (Tx BabbageEra) Source #
Dealing with errors
liftResult ∷ MonadError e m ⇒ (String → e) → ResultT m a → m a Source #
liftEither ∷ MonadError e m ⇒ (ee → e) → m (Either ee a) → m a Source #
mapError ∷ MonadError e m ⇒ (ee → e) → ExceptT ee m a → m a Source #
Reading key files
readSigningKeyFromFile ∷ FilePath → IO (SigningKey PaymentKey) Source #
Read a serialised signing key from a file
readVerificationKeyFromFile ∷ FilePath → IO (VerificationKey PaymentKey) Source #
Read a serialised verification key from a file. Try bech32 encoding first, then text envelope (JSON)
readStakingKeyFromFile ∷ FilePath → IO (VerificationKey StakeKey) Source #
Read a serialised signing key from a file
Etc.
extractTx ∷ ∀ m. MonadIO m ⇒ Set TxId → BlockInMode CardanoMode → m () Source #
Search for interesting transactions in a block and serialise them to JSON files
slotToUtcTime ∷ EraHistory mode → SystemStart → SlotNo → Either String UTCTime Source #
Convert a slot number to UTC time
utcTimeToSlot ∷ EraHistory mode → SystemStart → UTCTime → Either String (SlotNo, NominalDiffTime, NominalDiffTime) Source #
Convert a UTC time to slot no. Returns the time spent and time left in this slot.
utcTimeToSlotUnsafe ∷ EraHistory mode → SystemStart → UTCTime → Either String (SlotNo, NominalDiffTime, NominalDiffTime) Source #
Convert a UTC time to slot no. Returns the time spent and time left in this slot. Extends the interpreter range to infinity before running the query, ignoring any future hard forks. This avoids horizon errors for times that are in the future. It may still fail for times that are in the past (before the beginning of the horizin)
posixTimeToSlot ∷ EraHistory mode → SystemStart → POSIXTime → Either String (SlotNo, NominalDiffTime, NominalDiffTime) Source #
Convert a POSIXTime
to slot no. Returns the time spent and time left in this slot.
posixTimeToSlotUnsafe ∷ EraHistory mode → SystemStart → POSIXTime → Either String (SlotNo, NominalDiffTime, NominalDiffTime) Source #
Convert a POSIXTime
to slot no. Returns the time spent and time left in this slot.