atlas-cardano-0.3.0: Application backend for Plutus smart contracts on Cardano
Copyright(c) 2023 GYELD GMBH
LicenseApache 2.0
Maintainer[email protected]
Stabilitydevelop
Safe HaskellNone
LanguageHaskell2010

GeniusYield.Types.TxOutRef

Description

 
Synopsis

Documentation

data GYTxOutRef #

Type that represents a reference to a GYTxOut.

Instances

Instances details
Eq GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

Methods

(==)GYTxOutRefGYTxOutRefBool #

(/=)GYTxOutRefGYTxOutRefBool #

Ord GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

Show GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

IsString GYTxOutRef #
>>> "4293386fef391299c9886dc0ef3e8676cbdbc2c9f2773507f1f838e00043a189#1" :: GYTxOutRef
GYTxOutRef (TxIn "4293386fef391299c9886dc0ef3e8676cbdbc2c9f2773507f1f838e00043a189" (TxIx 1))
>>> "not-a-tx-out-ref" :: GYTxOutRef
*** Exception: invalid GYTxOutRef: not-a-tx-out-ref
...
Instance details

Defined in GeniusYield.Types.TxOutRef

Methods

fromStringStringGYTxOutRef #

PrintfArg GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

FromJSON GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

Methods

parseJSON ∷ Value → Parser GYTxOutRef #

parseJSONList ∷ Value → Parser [GYTxOutRef] #

ToJSON GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

Methods

toJSONGYTxOutRef → Value #

toEncodingGYTxOutRef → Encoding #

toJSONList ∷ [GYTxOutRef] → Value #

toEncodingList ∷ [GYTxOutRef] → Encoding #

ToField GYTxOutRef #
>>> Csv.toField ("4293386fef391299c9886dc0ef3e8676cbdbc2c9f2773507f1f838e00043a189#1" :: GYTxOutRef)
"4293386fef391299c9886dc0ef3e8676cbdbc2c9f2773507f1f838e00043a189#1"
Instance details

Defined in GeniusYield.Types.TxOutRef

Methods

toFieldGYTxOutRef → Field

Hashable GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

Methods

hashWithSaltIntGYTxOutRefInt

hashGYTxOutRefInt

FromHttpApiData GYTxOutRef #
>>> Web.parseUrlPiece @GYTxOutRef "4293386fef391299c9886dc0ef3e8676cbdbc2c9f2773507f1f838e00043a189#1"
Right (GYTxOutRef (TxIn "4293386fef391299c9886dc0ef3e8676cbdbc2c9f2773507f1f838e00043a189" (TxIx 1)))
Instance details

Defined in GeniusYield.Types.TxOutRef

ToHttpApiData GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

FromField GYTxOutRef #
>>> Csv.runParser $ Csv.parseField @GYTxOutRef "4293386fef391299c9886dc0ef3e8676cbdbc2c9f2773507f1f838e00043a189#1"
Right (GYTxOutRef (TxIn "4293386fef391299c9886dc0ef3e8676cbdbc2c9f2773507f1f838e00043a189" (TxIx 1)))
>>> Csv.runParser $ Csv.parseField @GYTxOutRef "not a tx-out ref"
Left "GYTxOutRef: Failed reading: takeWhile1"
Instance details

Defined in GeniusYield.Types.TxOutRef

Methods

parseField ∷ Field → Parser GYTxOutRef

ToParamSchema GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

Methods

toParamSchema ∷ ∀ (t ∷ SwaggerKind Type). Proxy GYTxOutRef → ParamSchema t

ToSchema GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

Methods

declareNamedSchemaProxy GYTxOutRef → Declare (Definitions Schema) NamedSchema

txOutRefToPlutusGYTxOutRef → TxOutRef #

>>> txOutRefToPlutus "4293386fef391299c9886dc0ef3e8676cbdbc2c9f2773507f1f838e00043a189#1"
TxOutRef {txOutRefId = 4293386fef391299c9886dc0ef3e8676cbdbc2c9f2773507f1f838e00043a189, txOutRefIdx = 1}

txOutRefFromPlutus ∷ TxOutRef → Either PlutusToCardanoError GYTxOutRef #

>>> txOutRefFromPlutus $ Plutus.TxOutRef "4293386fef391299c9886dc0ef3e8676cbdbc2c9f2773507f1f838e00043a189" 12
Right (GYTxOutRef (TxIn "4293386fef391299c9886dc0ef3e8676cbdbc2c9f2773507f1f838e00043a189" (TxIx 12)))
>>> txOutRefFromPlutus $ Plutus.TxOutRef "ae" 12
Left (UnknownPlutusToCardanoError {ptceTag = "txOutRefFromPlutus: invalid txOutRefId ae"})
>>> txOutRefFromPlutus $ Plutus.TxOutRef "4293386fef391299c9886dc0ef3e8676cbdbc2c9f2773507f1f838e00043a189" (-2)
Left (UnknownPlutusToCardanoError {ptceTag = "txOutRefFromPlutus: negative txOutRefIdx -2"})
>>> txOutRefFromPlutus $ Plutus.TxOutRef "4293386fef391299c9886dc0ef3e8676cbdbc2c9f2773507f1f838e00043a189" 123456789012345678901
Left (UnknownPlutusToCardanoError {ptceTag = "txOutRefFromPlutus: txOutRefIdx 123456789012345678901 too large"})

txOutRefFromApiTxIdIx ∷ TxId → TxIx → GYTxOutRef #

wordToApiIxWord → TxIx #

Helpers

CBOR format

newtype GYTxOutRefCbor #

Constructors

GYTxOutRefCbor 

Instances

Instances details
Show GYTxOutRefCbor # 
Instance details

Defined in GeniusYield.Types.TxOutRef

PrintfArg GYTxOutRefCbor # 
Instance details

Defined in GeniusYield.Types.TxOutRef

FromJSON GYTxOutRefCbor # 
Instance details

Defined in GeniusYield.Types.TxOutRef

Methods

parseJSON ∷ Value → Parser GYTxOutRefCbor #

parseJSONList ∷ Value → Parser [GYTxOutRefCbor] #

FromHttpApiData GYTxOutRefCbor #
>>> Web.parseUrlPiece @GYTxOutRefCbor "8282582004ffecdf5f3ced5c5c788833415bcbef26e3e21290fcebcf8216327e21569e420082583900e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d1b930e9f7add78a174a21000e989ff551366dcd127028cb2aa39f6161a004c4b40"
Right GYTxOutRef (TxIn "04ffecdf5f3ced5c5c788833415bcbef26e3e21290fcebcf8216327e21569e42" (TxIx 0))
>>> Web.parseUrlPiece @GYTxOutRefCbor "00"
Left "Invalid TxIn CBOR structure"
Instance details

Defined in GeniusYield.Types.TxOutRef

ToParamSchema GYTxOutRefCbor # 
Instance details

Defined in GeniusYield.Types.TxOutRef

Methods

toParamSchema ∷ ∀ (t ∷ SwaggerKind Type). Proxy GYTxOutRefCbor → ParamSchema t

ToSchema GYTxOutRefCbor # 
Instance details

Defined in GeniusYield.Types.TxOutRef

Methods

declareNamedSchemaProxy GYTxOutRefCbor → Declare (Definitions Schema) NamedSchema