Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Building transactions
Synopsis
- class Monad m ⇒ MonadBuildTx m where
- newtype BuildTxT m a = BuildTxT {
- unBuildTxT ∷ WriterT BTX m a
- runBuildTxT ∷ Functor m ⇒ BuildTxT m a → m (a, TxBuild)
- runBuildTx ∷ BuildTxT Identity a → (a, TxBuild)
- execBuildTxT ∷ Monad m ⇒ BuildTxT m a → m TxBuild
- execBuildTx ∷ BuildTxT Identity a → TxBuild
- execBuildTx' ∷ BuildTxT Identity a → TxBodyContent BuildTx BabbageEra
- evalBuildTxT ∷ Monad m ⇒ BuildTxT m a → m a
- type TxBuild = TxBodyContent BuildTx BabbageEra → TxBodyContent BuildTx BabbageEra
- spendPublicKeyOutput ∷ MonadBuildTx m ⇒ TxIn → m ()
- payToAddress ∷ MonadBuildTx m ⇒ AddressInEra BabbageEra → Value → m ()
- payToAddressTxOut ∷ AddressInEra BabbageEra → Value → TxOut CtxTx BabbageEra
- payToPublicKey ∷ MonadBuildTx m ⇒ NetworkId → Hash PaymentKey → Value → m ()
- payToScriptHash ∷ MonadBuildTx m ⇒ NetworkId → ScriptHash → HashableScriptData → StakeAddressReference → Value → m ()
- payToPlutusV1 ∷ ∀ a m. (MonadBuildTx m, ToData a) ⇒ NetworkId → PlutusScript PlutusScriptV1 → a → StakeAddressReference → Value → m ()
- payToPlutusV2 ∷ ∀ a m. (MonadBuildTx m, ToData a) ⇒ NetworkId → PlutusScript PlutusScriptV2 → a → StakeAddressReference → Value → m ()
- payToPlutusV2InlineDatum ∷ ∀ a m. (MonadBuildTx m, ToData a) ⇒ NetworkId → PlutusScript PlutusScriptV2 → a → StakeAddressReference → Value → m ()
- spendPlutusV1 ∷ ∀ datum redeemer m. (MonadBuildTx m, ToData datum, ToData redeemer) ⇒ TxIn → PlutusScript PlutusScriptV1 → datum → redeemer → m ()
- spendPlutusV2 ∷ ∀ datum redeemer m. (MonadBuildTx m, ToData datum, ToData redeemer) ⇒ TxIn → PlutusScript PlutusScriptV2 → datum → redeemer → m ()
- spendPlutusV2Ref ∷ ∀ datum redeemer m. (MonadBuildTx m, ToData datum, ToData redeemer) ⇒ TxIn → TxIn → Maybe ScriptHash → datum → redeemer → m ()
- spendPlutusV2RefWithInlineDatum ∷ ∀ redeemer m. (MonadBuildTx m, ToData redeemer) ⇒ TxIn → TxIn → Maybe ScriptHash → redeemer → m ()
- spendPlutusV2RefWithoutInRef ∷ ∀ datum redeemer m. (MonadBuildTx m, ToData datum, ToData redeemer) ⇒ TxIn → TxIn → Maybe ScriptHash → datum → redeemer → m ()
- spendPlutusV2RefWithoutInRefInlineDatum ∷ ∀ redeemer m. (MonadBuildTx m, ToData redeemer) ⇒ TxIn → TxIn → Maybe ScriptHash → redeemer → m ()
- spendPlutusV2InlineDatum ∷ ∀ redeemer m. (MonadBuildTx m, ToData redeemer) ⇒ TxIn → PlutusScript PlutusScriptV2 → redeemer → m ()
- mintPlutusV1 ∷ ∀ redeemer m. (ToData redeemer, MonadBuildTx m) ⇒ PlutusScript PlutusScriptV1 → redeemer → AssetName → Quantity → m ()
- mintPlutusV2 ∷ ∀ redeemer m. (ToData redeemer, MonadBuildTx m) ⇒ PlutusScript PlutusScriptV2 → redeemer → AssetName → Quantity → m ()
- mintPlutusV2Ref ∷ ∀ redeemer m. (ToData redeemer, MonadBuildTx m) ⇒ TxIn → ScriptHash → redeemer → AssetName → Quantity → m ()
- payToPlutusV2Inline ∷ MonadBuildTx m ⇒ AddressInEra BabbageEra → PlutusScript PlutusScriptV2 → Value → m ()
- payToPlutusV2InlineWithInlineDatum ∷ ∀ a m. (MonadBuildTx m, ToData a) ⇒ AddressInEra BabbageEra → PlutusScript PlutusScriptV2 → a → Value → m ()
- payToPlutusV2InlineWithDatum ∷ ∀ a m. (MonadBuildTx m, ToData a) ⇒ AddressInEra BabbageEra → PlutusScript PlutusScriptV2 → a → Value → m ()
- addReference ∷ MonadBuildTx m ⇒ TxIn → m ()
- addCollateral ∷ MonadBuildTx m ⇒ TxIn → m ()
- addAuxScript ∷ MonadBuildTx m ⇒ ScriptInEra BabbageEra → m ()
- assetValue ∷ ScriptHash → AssetName → Quantity → Value
- setScriptsValid ∷ MonadBuildTx m ⇒ m ()
- addRequiredSignature ∷ MonadBuildTx m ⇒ Hash PaymentKey → m ()
- prependTxOut ∷ MonadBuildTx m ⇒ TxOut CtxTx BabbageEra → m ()
- minAdaDeposit ∷ BundledProtocolParameters BabbageEra → TxOut CtxTx BabbageEra → Quantity
- setMinAdaDeposit ∷ BundledProtocolParameters BabbageEra → TxOut CtxTx BabbageEra → TxOut CtxTx BabbageEra
- setMinAdaDepositAll ∷ MonadBuildTx m ⇒ BundledProtocolParameters BabbageEra → m ()
Effect
class Monad m ⇒ MonadBuildTx m where Source #
Instances
MonadBuildTx m ⇒ MonadBuildTx (MonadLogIgnoreT m) Source # | |
Defined in Convex.BuildTx addBtx ∷ TxBuild → MonadLogIgnoreT m () Source # | |
MonadBuildTx m ⇒ MonadBuildTx (MonadLogKatipT m) Source # | |
Defined in Convex.BuildTx addBtx ∷ TxBuild → MonadLogKatipT m () Source # | |
Monad m ⇒ MonadBuildTx (BuildTxT m) Source # | |
MonadBuildTx m ⇒ MonadBuildTx (MonadBlockchainCardanoNodeT e m) Source # | |
Defined in Convex.BuildTx addBtx ∷ TxBuild → MonadBlockchainCardanoNodeT e m () Source # | |
MonadBuildTx m ⇒ MonadBuildTx (ExceptT e m) Source # | |
MonadBuildTx m ⇒ MonadBuildTx (StateT e m) Source # | |
MonadBuildTx m ⇒ MonadBuildTx (StateT e m) Source # | |
(Monoid w, MonadBuildTx m) ⇒ MonadBuildTx (WriterT w m) Source # | |
Monad transformer for the MonadBuildTx
effect
BuildTxT | |
|
Instances
execBuildTxT ∷ Monad m ⇒ BuildTxT m a → m TxBuild Source #
Run the BuildTxT
monad transformer, returning the TxBuild
part only
execBuildTx' ∷ BuildTxT Identity a → TxBodyContent BuildTx BabbageEra Source #
Run the BuildTx
action and produce a transaction body
evalBuildTxT ∷ Monad m ⇒ BuildTxT m a → m a Source #
Run the BuildTxT
monad transformer, returnin only the result
Building transactions
spendPublicKeyOutput ∷ MonadBuildTx m ⇒ TxIn → m () Source #
Spend an output locked by a public key
payToAddress ∷ MonadBuildTx m ⇒ AddressInEra BabbageEra → Value → m () Source #
payToPublicKey ∷ MonadBuildTx m ⇒ NetworkId → Hash PaymentKey → Value → m () Source #
payToScriptHash ∷ MonadBuildTx m ⇒ NetworkId → ScriptHash → HashableScriptData → StakeAddressReference → Value → m () Source #
payToPlutusV1 ∷ ∀ a m. (MonadBuildTx m, ToData a) ⇒ NetworkId → PlutusScript PlutusScriptV1 → a → StakeAddressReference → Value → m () Source #
payToPlutusV2 ∷ ∀ a m. (MonadBuildTx m, ToData a) ⇒ NetworkId → PlutusScript PlutusScriptV2 → a → StakeAddressReference → Value → m () Source #
payToPlutusV2InlineDatum ∷ ∀ a m. (MonadBuildTx m, ToData a) ⇒ NetworkId → PlutusScript PlutusScriptV2 → a → StakeAddressReference → Value → m () Source #
spendPlutusV1 ∷ ∀ datum redeemer m. (MonadBuildTx m, ToData datum, ToData redeemer) ⇒ TxIn → PlutusScript PlutusScriptV1 → datum → redeemer → m () Source #
spendPlutusV2 ∷ ∀ datum redeemer m. (MonadBuildTx m, ToData datum, ToData redeemer) ⇒ TxIn → PlutusScript PlutusScriptV2 → datum → redeemer → m () Source #
spendPlutusV2Ref ∷ ∀ datum redeemer m. (MonadBuildTx m, ToData datum, ToData redeemer) ⇒ TxIn → TxIn → Maybe ScriptHash → datum → redeemer → m () Source #
spendPlutusV2RefWithInlineDatum ∷ ∀ redeemer m. (MonadBuildTx m, ToData redeemer) ⇒ TxIn → TxIn → Maybe ScriptHash → redeemer → m () Source #
same as spendPlutusV2Ref but considers inline datum at the spent utxo
spendPlutusV2RefWithoutInRef ∷ ∀ datum redeemer m. (MonadBuildTx m, ToData datum, ToData redeemer) ⇒ TxIn → TxIn → Maybe ScriptHash → datum → redeemer → m () Source #
same as spendPlutusV2Ref but does not add the reference script in the reference input list This is to cover the case whereby the reference script utxo is expected to be consumed in the same tx.
spendPlutusV2RefWithoutInRefInlineDatum ∷ ∀ redeemer m. (MonadBuildTx m, ToData redeemer) ⇒ TxIn → TxIn → Maybe ScriptHash → redeemer → m () Source #
same as spendPlutusV2RefWithoutInRef but considers inline datum at the spent utxo
spendPlutusV2InlineDatum ∷ ∀ redeemer m. (MonadBuildTx m, ToData redeemer) ⇒ TxIn → PlutusScript PlutusScriptV2 → redeemer → m () Source #
Spend an output locked by a Plutus V2 validator with an inline datum
mintPlutusV1 ∷ ∀ redeemer m. (ToData redeemer, MonadBuildTx m) ⇒ PlutusScript PlutusScriptV1 → redeemer → AssetName → Quantity → m () Source #
mintPlutusV2 ∷ ∀ redeemer m. (ToData redeemer, MonadBuildTx m) ⇒ PlutusScript PlutusScriptV2 → redeemer → AssetName → Quantity → m () Source #
mintPlutusV2Ref ∷ ∀ redeemer m. (ToData redeemer, MonadBuildTx m) ⇒ TxIn → ScriptHash → redeemer → AssetName → Quantity → m () Source #
payToPlutusV2Inline ∷ MonadBuildTx m ⇒ AddressInEra BabbageEra → PlutusScript PlutusScriptV2 → Value → m () Source #
payToPlutusV2InlineWithInlineDatum ∷ ∀ a m. (MonadBuildTx m, ToData a) ⇒ AddressInEra BabbageEra → PlutusScript PlutusScriptV2 → a → Value → m () Source #
same as payToPlutusV2Inline but also specify an inline datum
payToPlutusV2InlineWithDatum ∷ ∀ a m. (MonadBuildTx m, ToData a) ⇒ AddressInEra BabbageEra → PlutusScript PlutusScriptV2 → a → Value → m () Source #
same as payToPlutusV2Inline but also specify a datum
addReference ∷ MonadBuildTx m ⇒ TxIn → m () Source #
addCollateral ∷ MonadBuildTx m ⇒ TxIn → m () Source #
addAuxScript ∷ MonadBuildTx m ⇒ ScriptInEra BabbageEra → m () Source #
assetValue ∷ ScriptHash → AssetName → Quantity → Value Source #
A value containing the given amount of the native asset
setScriptsValid ∷ MonadBuildTx m ⇒ m () Source #
addRequiredSignature ∷ MonadBuildTx m ⇒ Hash PaymentKey → m () Source #
Add a public key hash to the list of required signatures.
prependTxOut ∷ MonadBuildTx m ⇒ TxOut CtxTx BabbageEra → m () Source #
Add a transaction output to the start of the list of transaction outputs.
Minimum Ada deposit
setMinAdaDeposit ∷ BundledProtocolParameters BabbageEra → TxOut CtxTx BabbageEra → TxOut CtxTx BabbageEra Source #
Set the Ada component in an output's value to at least the amount needed to cover the minimum UTxO deposit for this output
setMinAdaDepositAll ∷ MonadBuildTx m ⇒ BundledProtocolParameters BabbageEra → m () Source #
Apply setMinAdaDeposit
to all outputs