| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.Chain.Backend
Synopsis
- blockfrostProjectPath :: FilePath
- class ChainBackend m where
- queryGenesisParameters :: m (GenesisParameters ShelleyEra)
- queryScriptRegistry :: [TxId] -> m ScriptRegistry
- queryNetworkId :: m NetworkId
- queryTip :: m ChainPoint
- queryUTxO :: [Address ShelleyAddr] -> m UTxO
- queryUTxOByTxIn :: [TxIn] -> m UTxO
- queryEraHistory :: QueryPoint -> m EraHistory
- querySystemStart :: QueryPoint -> m SystemStart
- queryProtocolParameters :: QueryPoint -> m (PParams LedgerEra)
- queryStakePools :: QueryPoint -> m (Set PoolId)
- queryUTxOFor :: QueryPoint -> VerificationKey PaymentKey -> m UTxO
- submitTransaction :: Tx -> m ()
- awaitTransaction :: Tx -> VerificationKey PaymentKey -> m UTxO
- getBlockTime :: m NominalDiffTime
- buildTransaction :: ChainBackend m => MonadIO m => AddressInEra -> UTxO -> [TxIn] -> [TxOut CtxTx] -> m (Either (TxBodyErrorAutoBalance Era) Tx)
- buildTransactionWithMintingScript :: ChainBackend m => MonadIO m => AddressInEra -> UTxO -> [TxIn] -> [TxOut CtxTx] -> Maybe PlutusScript -> m (Either (TxBodyErrorAutoBalance Era) Tx)
- buildTransactionWithPParams :: ChainBackend m => MonadIO m => PParams LedgerEra -> AddressInEra -> UTxO -> [TxIn] -> [TxOut CtxTx] -> Maybe PlutusScript -> m (Either (TxBodyErrorAutoBalance Era) Tx)
- buildTransactionWithPParams' :: PParams LedgerEra -> SystemStart -> EraHistory -> Set PoolId -> AddressInEra -> UTxO -> [TxIn] -> [TxOut CtxTx] -> Maybe PlutusScript -> Either (TxBodyErrorAutoBalance Era) Tx
- buildTransactionWithBody :: PParams LedgerEra -> SystemStart -> EraHistory -> Set PoolId -> AddressInEra -> TxBodyContent BuildTx -> UTxO -> Either (TxBodyErrorAutoBalance Era) Tx
Documentation
class ChainBackend m where Source #
Methods
queryGenesisParameters :: m (GenesisParameters ShelleyEra) Source #
queryScriptRegistry :: [TxId] -> m ScriptRegistry Source #
queryNetworkId :: m NetworkId Source #
queryTip :: m ChainPoint Source #
queryUTxO :: [Address ShelleyAddr] -> m UTxO Source #
queryUTxOByTxIn :: [TxIn] -> m UTxO Source #
queryEraHistory :: QueryPoint -> m EraHistory Source #
querySystemStart :: QueryPoint -> m SystemStart Source #
queryProtocolParameters :: QueryPoint -> m (PParams LedgerEra) Source #
queryStakePools :: QueryPoint -> m (Set PoolId) Source #
queryUTxOFor :: QueryPoint -> VerificationKey PaymentKey -> m UTxO Source #
submitTransaction :: Tx -> m () Source #
awaitTransaction :: Tx -> VerificationKey PaymentKey -> m UTxO Source #
Instances
Arguments
| :: ChainBackend m | |
| => MonadIO m | |
| => AddressInEra | Change address to send |
| -> UTxO | Unspent transaction outputs to spend. |
| -> [TxIn] | Collateral inputs. |
| -> [TxOut CtxTx] | Outputs to create. |
| -> m (Either (TxBodyErrorAutoBalance Era) Tx) |
buildTransactionWithMintingScript Source #
Arguments
| :: ChainBackend m | |
| => MonadIO m | |
| => AddressInEra | Change address to send |
| -> UTxO | Unspent transaction outputs to spend. |
| -> [TxIn] | Collateral inputs. |
| -> [TxOut CtxTx] | Outputs to create. |
| -> Maybe PlutusScript | |
| -> m (Either (TxBodyErrorAutoBalance Era) Tx) |
buildTransactionWithPParams Source #
Arguments
| :: ChainBackend m | |
| => MonadIO m | |
| => PParams LedgerEra | Protocol parameters |
| -> AddressInEra | Change address to send |
| -> UTxO | Unspent transaction outputs to spend. |
| -> [TxIn] | Collateral inputs. |
| -> [TxOut CtxTx] | Outputs to create. |
| -> Maybe PlutusScript | |
| -> m (Either (TxBodyErrorAutoBalance Era) Tx) |
Construct a simple payment consuming some inputs and producing some outputs (no certificates or withdrawals involved).
On success, the returned transaction is fully balanced. On error, return
TxBodyErrorAutoBalance.
buildTransactionWithPParams' Source #
Arguments
| :: PParams LedgerEra | Protocol parameters |
| -> SystemStart | |
| -> EraHistory | |
| -> Set PoolId | |
| -> AddressInEra | Change address to send |
| -> UTxO | Unspent transaction outputs to spend. |
| -> [TxIn] | Collateral inputs. |
| -> [TxOut CtxTx] | Outputs to create. |
| -> Maybe PlutusScript | |
| -> Either (TxBodyErrorAutoBalance Era) Tx |
NOTE: If there are any non ADA assets present in the output Value and
minting scrips is specified this function will mint them using provided
script as the script witness.