| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cometa.SubTransaction.Builder
Description
Build a local Dijkstra sub-transaction intent from explicit resolved inputs and outputs. The result can be inspected, signed and attached to an outer transaction. No wallet selection, fee or change is added.
import qualified Cometa.SubTransaction.Builder as Builder
import qualified Cometa.SubTransaction.Plan as Plan
import qualified Cometa.Transaction.Fields as Fields
buildIntent params slots input output =
Builder.build (Builder.Config params slots Fields.Testnet)
(Plan.spend input <> Plan.payTo output)
Synopsis
- data Config = Config {
- parameters :: !Parameters
- slotConfig :: !SlotConfig
- networkId :: !BodyNetwork
- build :: Config -> Plan -> IO (Either Error SubTransaction)
Documentation
Context for building an intent. Protocol parameters supply deposits, cost models and language availability; the schedule converts explicit validity slots, and the network is written into the local body.
Constructors
| Config | |
Fields
| |
build :: Config -> Plan -> IO (Either Error SubTransaction) Source #
Build exactly the requested inputs and outputs with no fee, collateral,
balancing or change. Deferred arguments run once on the local zero-fee draft
before native V4 evaluation and script-data commitment. An unused or cancelled
mint group does not invoke its callback. Native expected errors return Left;
callback exceptions propagate after native cleanup. Aggregate quantities and
deposits must fit signed 64-bit. The result must fit the configured transaction
size and execution limits, and output values must fit their configured limit.
Later signatures and enclosing fields consume additional transaction space.
Scripts are evaluated at position zero in an otherwise empty enclosing batch. A script that depends on the actual batch position or surrounding transaction can need different budgets or fail when later assembled. Building does not establish complete ledger admission, balance or the freshness of inputs.