Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Hydra.Cluster.Faucet
Synopsis
- data FaucetException
- = FaucetHasNotEnoughFunds {
- faucetUTxO :: UTxO
- | FaucetFailedToBuildTx {
- reason :: TxBodyErrorAutoBalance Era
- | FaucetBlockfrostError { }
- = FaucetHasNotEnoughFunds {
- data FaucetLog
- = TraceResourceExhaustedHandled Text
- | ReturnedFunds {
- returnAmount :: Coin
- seedFromFaucet :: ChainBackend backend => backend -> VerificationKey PaymentKey -> Coin -> Tracer IO FaucetLog -> IO UTxO
- findFaucetUTxO :: ChainBackend backend => NetworkId -> backend -> Coin -> IO UTxO
- seedFromFaucetBlockfrost :: VerificationKey PaymentKey -> Coin -> BlockfrostClientT IO UTxO
- seedFromFaucet_ :: ChainBackend backend => backend -> VerificationKey PaymentKey -> Coin -> Tracer IO FaucetLog -> IO ()
- returnFundsToFaucet :: ChainBackend backend => Tracer IO FaucetLog -> backend -> Actor -> IO ()
- returnFundsToFaucet' :: ChainBackend backend => Tracer IO FaucetLog -> backend -> SigningKey PaymentKey -> IO Coin
- createOutputAtAddress :: ChainBackend backend => NetworkId -> backend -> AddressInEra -> TxOutDatum CtxTx -> Value -> IO (TxIn, TxOut CtxUTxO)
- retryOnExceptions :: (MonadCatch m, MonadDelay m) => Tracer m FaucetLog -> m a -> m a
- publishHydraScriptsAs :: ChainBackend backend => backend -> Actor -> IO [TxId]
Documentation
data FaucetException Source #
Constructors
FaucetHasNotEnoughFunds | |
Fields
| |
FaucetFailedToBuildTx | |
Fields
| |
FaucetBlockfrostError | |
Fields |
Instances
Exception FaucetException Source # | |
Defined in Hydra.Cluster.Faucet Methods toException :: FaucetException -> SomeException Source # fromException :: SomeException -> Maybe FaucetException Source # | |
Show FaucetException Source # | |
Defined in Hydra.Cluster.Faucet |
Constructors
TraceResourceExhaustedHandled Text | |
ReturnedFunds | |
Fields
|
Instances
ToJSON FaucetLog Source # | |
Defined in Hydra.Cluster.Faucet Methods toEncoding :: FaucetLog -> Encoding toJSONList :: [FaucetLog] -> Value toEncodingList :: [FaucetLog] -> Encoding | |
Generic FaucetLog Source # | |
Show FaucetLog Source # | |
Eq FaucetLog Source # | |
type Rep FaucetLog Source # | |
Defined in Hydra.Cluster.Faucet type Rep FaucetLog = D1 ('MetaData "FaucetLog" "Hydra.Cluster.Faucet" "hydra-cluster-0.22.2-GzptauxaFT6APkmcXCipvr" 'False) (C1 ('MetaCons "TraceResourceExhaustedHandled" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "ReturnedFunds" 'PrefixI 'True) (S1 ('MetaSel ('Just "returnAmount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Coin))) |
Arguments
:: ChainBackend backend | |
=> backend | |
-> VerificationKey PaymentKey | Recipient of the funds |
-> Coin | Amount to get from faucet |
-> Tracer IO FaucetLog | |
-> IO UTxO |
Create a specially marked "seed" UTXO containing requested Lovelace
by
redeeming funds available to the well-known faucet.
findFaucetUTxO :: ChainBackend backend => NetworkId -> backend -> Coin -> IO UTxO Source #
seedFromFaucetBlockfrost Source #
Arguments
:: VerificationKey PaymentKey | Recipient of the funds |
-> Coin | Amount to get from faucet |
-> BlockfrostClientT IO UTxO |
Arguments
:: ChainBackend backend | |
=> backend | |
-> VerificationKey PaymentKey | Recipient of the funds |
-> Coin | Amount to get from faucet |
-> Tracer IO FaucetLog | |
-> IO () |
Like seedFromFaucet
, but without returning the seeded UTxO'
.
returnFundsToFaucet :: ChainBackend backend => Tracer IO FaucetLog -> backend -> Actor -> IO () Source #
Return the remaining funds to the faucet
returnFundsToFaucet' :: ChainBackend backend => Tracer IO FaucetLog -> backend -> SigningKey PaymentKey -> IO Coin Source #
createOutputAtAddress :: ChainBackend backend => NetworkId -> backend -> AddressInEra -> TxOutDatum CtxTx -> Value -> IO (TxIn, TxOut CtxUTxO) Source #
retryOnExceptions :: (MonadCatch m, MonadDelay m) => Tracer m FaucetLog -> m a -> m a Source #
Try to submit tx and retry when some caught exception/s take place.
publishHydraScriptsAs :: ChainBackend backend => backend -> Actor -> IO [TxId] Source #
Publish current Hydra scripts as scripts outputs for later referencing them.
The key of the given Actor is used to pay for fees in required transactions, it is expected to have sufficient funds.