Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | [email protected] |
Stability | develop |
Safe Haskell | None |
Language | Haskell2010 |
GeniusYield.TxBuilder.Node
Description
Synopsis
- data GYTxMonadNode a
- data GYTxBuildResult f
- = GYTxBuildSuccess !(NonEmpty (f GYTxBody))
- | GYTxBuildPartialSuccess !GYValue !(NonEmpty (f GYTxBody))
- | GYTxBuildFailure !GYValue
- | GYTxBuildNoInputs
- runGYTxMonadNode ∷ GYNetworkId → GYProviders → [GYAddress] → GYAddress → Maybe (GYTxOutRef, Bool) → GYTxMonadNode (GYTxSkeleton v) → IO GYTxBody
- runGYTxMonadNodeC ∷ ∀ a. GYNetworkId → GYProviders → [GYAddress] → GYAddress → Maybe (GYTxOutRef, Bool) → GYTxMonadNode a → IO a
- runGYTxMonadNodeF ∷ ∀ f v. Traversable f ⇒ GYCoinSelectionStrategy → GYNetworkId → GYProviders → [GYAddress] → GYAddress → Maybe (GYTxOutRef, Bool) → GYTxMonadNode (f (GYTxSkeleton v)) → IO (f GYTxBody)
- runGYTxMonadNodeParallel ∷ GYNetworkId → GYProviders → [GYAddress] → GYAddress → Maybe (GYTxOutRef, Bool) → GYTxMonadNode [GYTxSkeleton v] → IO (GYTxBuildResult Identity)
- runGYTxMonadNodeParallelF ∷ Traversable f ⇒ GYCoinSelectionStrategy → GYNetworkId → GYProviders → [GYAddress] → GYAddress → Maybe (GYTxOutRef, Bool) → GYTxMonadNode [f (GYTxSkeleton v)] → IO (GYTxBuildResult f)
- runGYTxMonadNodeChaining ∷ GYNetworkId → GYProviders → [GYAddress] → GYAddress → Maybe (GYTxOutRef, Bool) → GYTxMonadNode [GYTxSkeleton v] → IO (GYTxBuildResult Identity)
- runGYTxMonadNodeChainingF ∷ Traversable f ⇒ GYCoinSelectionStrategy → GYNetworkId → GYProviders → [GYAddress] → GYAddress → Maybe (GYTxOutRef, Bool) → GYTxMonadNode [f (GYTxSkeleton v)] → IO (GYTxBuildResult f)
Documentation
data GYTxMonadNode a #
GYTxMonad
interpretation run against real node.
Instances
data GYTxBuildResult f #
Result of building GYTxBody
s with the option of recovery from error.
Consider the act of building five GYTxSkeleton
s into GYTxBody
s. If three out of the five succeed, but the next
one fails due to insufficient funds - this type facilitates recovering the three rather than failing outright and discarding
the results.
Constructors
GYTxBuildSuccess !(NonEmpty (f GYTxBody)) | All given |
GYTxBuildPartialSuccess !GYValue !(NonEmpty (f GYTxBody)) | Some of the given |
GYTxBuildFailure !GYValue | None of the given |
GYTxBuildNoInputs | Input did not contain any |
Arguments
∷ GYNetworkId | |
→ GYProviders | |
→ [GYAddress] | our addresses |
→ GYAddress | change address |
→ Maybe (GYTxOutRef, Bool) | collateral |
→ GYTxMonadNode (GYTxSkeleton v) | |
→ IO GYTxBody |
Arguments
∷ ∀ a. GYNetworkId | |
→ GYProviders | |
→ [GYAddress] | our addresses |
→ GYAddress | change address |
→ Maybe (GYTxOutRef, Bool) | collateral |
→ GYTxMonadNode a | |
→ IO a |
Arguments
∷ ∀ f v. Traversable f | |
⇒ GYCoinSelectionStrategy | |
→ GYNetworkId | |
→ GYProviders | |
→ [GYAddress] | our addresses |
→ GYAddress | change address |
→ Maybe (GYTxOutRef, Bool) | collateral |
→ GYTxMonadNode (f (GYTxSkeleton v)) | |
→ IO (f GYTxBody) |
The most basic version of GYTxMonadNode
interpreter over a generic Traversable
.
NOTE ==
This is not meant to be used with structures containing _multiple_ GYTxSkeleton
s. As the balancer
will end up using the same utxos across the different txs.
Consider using runGYTxMonadNodeParallel
or runGYTxMonadNodeChaining
instead.
runGYTxMonadNodeParallel ∷ GYNetworkId → GYProviders → [GYAddress] → GYAddress → Maybe (GYTxOutRef, Bool) → GYTxMonadNode [GYTxSkeleton v] → IO (GYTxBuildResult Identity) #
runGYTxMonadNodeParallelF ∷ Traversable f ⇒ GYCoinSelectionStrategy → GYNetworkId → GYProviders → [GYAddress] → GYAddress → Maybe (GYTxOutRef, Bool) → GYTxMonadNode [f (GYTxSkeleton v)] → IO (GYTxBuildResult f) #
A multi transaction building GYTxMonadNode
interpreter.
This does not perform chaining, i.e does not use utxos created by one of the given transactions in the next one. However, it does ensure that the balancer does not end up using the same own utxos when building multiple transactions at once.
This supports failure recovery by utilizing GYTxBuildResult
.
runGYTxMonadNodeChaining ∷ GYNetworkId → GYProviders → [GYAddress] → GYAddress → Maybe (GYTxOutRef, Bool) → GYTxMonadNode [GYTxSkeleton v] → IO (GYTxBuildResult Identity) #
runGYTxMonadNodeChainingF ∷ Traversable f ⇒ GYCoinSelectionStrategy → GYNetworkId → GYProviders → [GYAddress] → GYAddress → Maybe (GYTxOutRef, Bool) → GYTxMonadNode [f (GYTxSkeleton v)] → IO (GYTxBuildResult f) #
A chaining transaction building GYTxMonadNode
interpreter.
This will perform chaining, i.e it will use utxos created by one of the given transactions, when building the next one.
This supports failure recovery by utilizing GYTxBuildResult
.
- *EXPERIMENTAL**