Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Custom class to encapsulate the general purpose queries that we need for building transactions
Synopsis
- class Monad m ⇒ MonadUtxoQuery m where
- utxosByPayment ∷ MonadUtxoQuery m ⇒ PaymentCredential → m (UTxO BabbageEra)
- newtype BalancingError = BalancingError String
- balanceTx ∷ (MonadBlockchain m, MonadUtxoQuery m) ⇒ PaymentCredential → TxOut CtxTx BabbageEra → TxBodyContent BuildTx BabbageEra → m (Either BalancingError (BalancedTxBody BabbageEra, BalanceChanges))
- balanceAndSubmitOperator ∷ (MonadBlockchain m, MonadUtxoQuery m, MonadError BalanceAndSubmitError m) ⇒ Operator Signing → Maybe (TxOut CtxTx BabbageEra) → TxBodyContent BuildTx BabbageEra → m (Tx BabbageEra)
- balanceOperator ∷ (MonadBlockchain m, MonadUtxoQuery m, MonadError BalanceAndSubmitError m) ⇒ PaymentCredential → Maybe (TxOut CtxTx BabbageEra) → TxBodyContent BuildTx BabbageEra → m (Tx BabbageEra)
- signTxOperator ∷ Operator Signing → Tx BabbageEra → Tx BabbageEra
- signAndSubmitOperator ∷ (MonadBlockchain m, MonadError BalanceAndSubmitError m) ⇒ Operator Signing → Tx BabbageEra → m (Tx BabbageEra)
- operatorUtxos ∷ MonadUtxoQuery m ⇒ Operator k → m (UTxO BabbageEra)
- selectOperatorUTxO ∷ MonadUtxoQuery m ⇒ Operator k → m (Maybe (TxIn, TxOut CtxUTxO BabbageEra))
- data BalanceAndSubmitError
- newtype WalletAPIQueryT m a = WalletAPIQueryT {}
- runWalletAPIQueryT ∷ ClientEnv → WalletAPIQueryT m a → m a
Documentation
class Monad m ⇒ MonadUtxoQuery m where Source #
Instances
MonadUtxoQuery m ⇒ MonadUtxoQuery (MonadLogIgnoreT m) Source # | |
Defined in Convex.Query | |
MonadIO m ⇒ MonadUtxoQuery (WalletAPIQueryT m) Source # | |
Defined in Convex.Query | |
Monad m ⇒ MonadUtxoQuery (MockchainT m) Source # | |
Defined in Convex.Query | |
MonadUtxoQuery m ⇒ MonadUtxoQuery (MonadBlockchainWaitingT m) Source # | |
Defined in Convex.Query | |
MonadUtxoQuery m ⇒ MonadUtxoQuery (ResultT m) Source # | |
Defined in Convex.Query | |
MonadUtxoQuery m ⇒ MonadUtxoQuery (MonadBlockchainCardanoNodeT e m) Source # | |
Defined in Convex.Query | |
MonadUtxoQuery m ⇒ MonadUtxoQuery (ExceptT e m) Source # | |
Defined in Convex.Query | |
MonadUtxoQuery m ⇒ MonadUtxoQuery (ReaderT e m) Source # | |
Defined in Convex.Query | |
MonadUtxoQuery m ⇒ MonadUtxoQuery (StateT s m) Source # | |
Defined in Convex.Query | |
MonadUtxoQuery m ⇒ MonadUtxoQuery (StateT s m) Source # | |
Defined in Convex.Query |
utxosByPayment ∷ MonadUtxoQuery m ⇒ PaymentCredential → m (UTxO BabbageEra) Source #
newtype BalancingError Source #
Instances
Show BalancingError Source # | |
Defined in Convex.Query | |
Eq BalancingError Source # | |
Defined in Convex.Query (==) ∷ BalancingError → BalancingError → Bool Source # (/=) ∷ BalancingError → BalancingError → Bool Source # | |
Ord BalancingError Source # | |
Defined in Convex.Query compare ∷ BalancingError → BalancingError → Ordering Source # (<) ∷ BalancingError → BalancingError → Bool Source # (<=) ∷ BalancingError → BalancingError → Bool Source # (>) ∷ BalancingError → BalancingError → Bool Source # (>=) ∷ BalancingError → BalancingError → Bool Source # max ∷ BalancingError → BalancingError → BalancingError Source # min ∷ BalancingError → BalancingError → BalancingError Source # |
balanceTx ∷ (MonadBlockchain m, MonadUtxoQuery m) ⇒ PaymentCredential → TxOut CtxTx BabbageEra → TxBodyContent BuildTx BabbageEra → m (Either BalancingError (BalancedTxBody BabbageEra, BalanceChanges)) Source #
Balance the transaction body using the UTxOs locked by the payment credential, and returning any unused funds to the given payment credential and stake credential |
Tx balancing for operator
balanceAndSubmitOperator ∷ (MonadBlockchain m, MonadUtxoQuery m, MonadError BalanceAndSubmitError m) ⇒ Operator Signing → Maybe (TxOut CtxTx BabbageEra) → TxBodyContent BuildTx BabbageEra → m (Tx BabbageEra) Source #
Balance a transaction body, sign it with the operator's key, and submit it to the network.
balanceOperator ∷ (MonadBlockchain m, MonadUtxoQuery m, MonadError BalanceAndSubmitError m) ⇒ PaymentCredential → Maybe (TxOut CtxTx BabbageEra) → TxBodyContent BuildTx BabbageEra → m (Tx BabbageEra) Source #
Balance a transaction body using the funds locked by the payment credential
signTxOperator ∷ Operator Signing → Tx BabbageEra → Tx BabbageEra Source #
Add a signature to the transaction
signAndSubmitOperator ∷ (MonadBlockchain m, MonadError BalanceAndSubmitError m) ⇒ Operator Signing → Tx BabbageEra → m (Tx BabbageEra) Source #
Add the operator's signature to the transaction and send it to the blockchain
operatorUtxos ∷ MonadUtxoQuery m ⇒ Operator k → m (UTxO BabbageEra) Source #
UTxOs that are locked by the operator's payment credential |
selectOperatorUTxO ∷ MonadUtxoQuery m ⇒ Operator k → m (Maybe (TxIn, TxOut CtxUTxO BabbageEra)) Source #
Select a single UTxO that is controlled by the operator. |
data BalanceAndSubmitError Source #
Failures during txn balancing and submission
Instances
Show BalanceAndSubmitError Source # | |
Defined in Convex.Query |
Wallet API queries
newtype WalletAPIQueryT m a Source #
Instances
runWalletAPIQueryT ∷ ClientEnv → WalletAPIQueryT m a → m a Source #