cardano-rpc
Safe HaskellNone
LanguageHaskell2010

Cardano.Rpc.Server.Internal.UtxoRpc.Type.Tx

Synopsis

Documentation

txToUtxoRpcTx :: IsShelleyBasedEra era => Tx 'TopTx (ShelleyLedgerEra era) -> Proto Tx Source #

Convert a ledger transaction to the UTxO RPC Tx message. Populates hash, fee, successful, inputs, outputs, reference inputs, validity, mint, withdrawals, collateral, certificates, witnesses, auxiliary data and governance proposals, with spending, withdrawal and certificate redeemers wired to their respective entries. Era-gated fields are read through the any-era getters, whose Nothing maps to the proto default; the ShelleyBasedEra witness is recovered from IsShelleyBasedEra and brings the any-era reading classes into scope.

anyEraTxConstraints :: ShelleyBasedEra era -> ((IsShelleyBasedEra era, AnyEraTx (ShelleyLedgerEra era)) => a) -> a Source #

Bring the constraints of txToUtxoRpcTx into scope for a Shelley-based era: the uniform any-era transaction reading classes of cardano-ledger-api, whose era-gated getters return Nothing where the era predates a field, and IsShelleyBasedEra to recover the witness. Unlike the eon constraint bundles this dispatch is total, including Dijkstra.

txInToUtxoRpcTxInput :: TxIn -> Proto TxInput Source #

Convert a TxIn to the UTxO RPC TxInput message. Only the transaction hash and output index are populated: resolving as_output requires a UTxO lookup, and the caller attaches the spending redeemer where one exists.

metadatumToUtxoRpcMetadatum :: Metadatum -> Proto Metadatum Source #

Convert a ledger metadatum to the UTxO RPC Metadatum message. The UTxO RPC encoding only supports signed 64-bit metadata integers, while the ledger rules allow any integer with an 8-byte magnitude, i.e. within [-(2^64 - 1), 2^64 - 1]. Values outside of the Int64 range are therefore clamped to minBound and maxBound respectively. Consumers which need full fidelity should decode the native_bytes CBOR of the transaction instead.

txAuxDataScripts :: ShelleyBasedEra era -> TxAuxData (ShelleyLedgerEra era) -> [Script (ShelleyLedgerEra era)] Source #

Extract the auxiliary scripts of a transaction as ledger Script values. Shelley auxiliary data carries no scripts, Allegra and Mary carry timelock scripts, and Alonzo onwards additionally carry Plutus scripts. The dispatch matches on the concrete eras because the auxiliary data and script types of each era family only line up at concrete eras.