Skip to content

Ledger Type Declarations`

gnumonik edited this page Jan 20, 2025 · 3 revisions

TODO: Format the declarations better

This file contains a pretty-printed representation of ledger type declarations, which are built into the compiler at a "deep" level and cannot be observed in a PureScript source file (and likely will not work with the documentation generator).

Every declaration here is imported with Prim, i.e., implicitly (both qualified an unqualified) into every module compiled by Purus.

The declarations:

newtype Address  = 
  Address ({ credential :: Prim.Credential, stakingCredential :: (Prim.Maybe (Prim.StakingCredential)) })

newtype AssocMap (k :: Prim.Type) (v :: Prim.Type) = 
  AssocMap (List (((Prim.Tuple2 ((k :: Prim.Type))) ((v :: Prim.Type)))))

data Credential  = 
  PubKeyCredential (Prim.PubKeyHash)
  | ScriptCredential (Prim.ScriptHash)

newtype CurrencySymbol  = 
  CurrencySymbol (Builtin.BuiltinByteString)

data DCert  = 
  DCertDelegRegKey (Prim.StakingCredential)
  | DCertDelegDeRegKey (Prim.StakingCredential)
  | DCertDelegDelegate (Prim.StakingCredential) (Prim.PubKeyHash)
  | DCertPoolRegister (Prim.PubKeyHash) (Prim.PubKeyHash)
  | DCertPoolRetire (Prim.PubKeyHash) (Prim.Int)
  | DCertGenesis 
  | DCertMir 

newtype Datum  = 
  Datum (Builtin.BuiltinData)

newtype DatumHash  = 
  DatumHash (Builtin.BuiltinByteString)

data Extended (a :: Prim.Type) = 
  NegInf 
  | Finite ((a :: Prim.Type))
  | PosInf 

newtype Interval (a :: Prim.Type) = 
  Interval ({ from :: (Prim.LowerBound ((a :: Prim.Type))), to :: (Prim.UpperBound ((a :: Prim.Type))) })

newtype LedgerBytes  = 
  LedgerBytes (Builtin.BuiltinByteString)

newtype Lovelace  = 
  Lovelace (Prim.Int)

newtype LowerBound (a :: Prim.Type) = 
  LowerBound ((Prim.Extended ((a :: Prim.Type))))

data Maybe (a :: Prim.Type) = 
  Nothing 
  | Just ((a :: Prim.Type))

data OutputDatum  = 
  NoOutputDatum 
  | OutputDatumHash (Prim.DatumHash)
  | OutputDatum (Prim.Datum)

newtype POSIXTime  = 
  POSIXTime (Prim.Int)

newtype PubKeyHash  = 
  PubKeyHash (Builtin.BuiltinByteString)

newtype Redeemer  = 
  Redeemer (Builtin.BuiltinData)

newtype RedeemerHash  = 
  RedeemerHash (Builtin.BuiltinByteString)

newtype ScriptContext  = 
  ScriptContext ({ txInfo :: Prim.TxInfo, purpose :: Prim.ScriptPurpose })

newtype ScriptHash  = 
  ScriptHash (Builtin.BuiltinByteString)

data ScriptPurpose  = 
  Minting (Prim.CurrencySymbol)
  | Spending (Prim.TxOutRef)
  | Rewarding (Prim.StakingCredential)
  | Certifying (Prim.DCert)

data StakingCredential  = 
  StakingHash (Prim.Credential)
  | StakingPtr (Prim.Int) (Prim.Int) (Prim.Int)

newtype TokenName  = 
  TokenName (Builtin.BuiltinByteString)

newtype TxId  = 
  TxId (Builtin.BuiltinByteString)

newtype TxInInfo  = 
  TxInInfo ({ txOutRef :: Prim.TxOutRef, resolved :: Prim.TxOut })

newtype TxInfo  = 
  TxInfo ({ inputs :: List (Prim.TxInInfo), referenceInputs :: List (Prim.TxInInfo), outputs :: List (Prim.TxOut), fee :: Prim.Value, mint :: Prim.Value, dCert :: List (Prim.DCert), wdrl :: ((Prim.AssocMap (Prim.StakingCredential)) (Prim.Int)), validRange :: (Prim.Interval (Prim.POSIXTime)), signatories :: List (Prim.PubKeyHash), redeemers :: ((Prim.AssocMap (Prim.ScriptPurpose)) (Prim.Redeemer)), data :: ((Prim.AssocMap (Prim.DatumHash)) (Prim.Datum)), id :: Prim.TxId })

newtype TxOut  = 
  TxOut ({ address :: Prim.Address, value :: Prim.Value, datum :: Prim.OutputDatum, referenceScript :: (Prim.Maybe (Prim.ScriptHash)) })

newtype TxOutRef  = 
  TxOutRef ({ id :: Prim.TxId, idx :: Prim.Int })

newtype UpperBound (a :: Prim.Type) = 
  UpperBound ((Prim.Extended ((a :: Prim.Type))))

newtype Value  = 
  Value (((Prim.AssocMap (Prim.CurrencySymbol)) (((Prim.AssocMap (Prim.TokenName)) (Prim.Int)))))

Clone this wiki locally