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

GeniusYield.Types.TxOutRef

Description

 
Synopsis

Documentation

data GYTxOutRef #

Type that represents a reference to a GYTxOut.

Instances

Instances details
FromJSON GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

ToJSON 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

Show GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

PrintfArg 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

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

Defined in GeniusYield.Types.TxOutRef

Eq GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

Ord GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

Hashable GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

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

ToParamSchema GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

ToSchema GYTxOutRef # 
Instance details

Defined in GeniusYield.Types.TxOutRef

txOutRefToPlutusGYTxOutRefTxOutRef #

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

txOutRefFromPlutusTxOutRefEither 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, error: SerialiseAsRawBytesError {unSerialiseAsRawBytesError = \"Unable to deserialise TxId\"}"})
>>> 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"})

Helpers

CBOR format

newtype GYTxOutRefCbor #

Constructors

GYTxOutRefCbor 

Instances

Instances details
FromJSON GYTxOutRefCbor # 
Instance details

Defined in GeniusYield.Types.TxOutRef

Show GYTxOutRefCbor # 
Instance details

Defined in GeniusYield.Types.TxOutRef

PrintfArg GYTxOutRefCbor # 
Instance details

Defined in GeniusYield.Types.TxOutRef

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

ToSchema GYTxOutRefCbor # 
Instance details

Defined in GeniusYield.Types.TxOutRef