atlas-cardano-0.6.2: 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.PaymentKeyHash

Description

 
Synopsis

Documentation

data GYPaymentKeyHash #

Instances

Instances details
FromJSON GYPaymentKeyHash #
>>> Aeson.eitherDecode @GYPaymentKeyHash "\"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d\""
Right (GYPaymentKeyHash "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d")

Invalid characters:

>>> Aeson.eitherDecode @GYPaymentKeyHash "\"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6azzz\""
Left "Error in $: RawBytesHexErrorBase16DecodeFail \"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6azzz\" \"invalid character at offset: 53\""
Instance details

Defined in GeniusYield.Types.PaymentKeyHash

ToJSON GYPaymentKeyHash #
>>> let Just pkh = Aeson.decode @GYPaymentKeyHash "\"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d\""
>>> LBS8.putStrLn $ Aeson.encode pkh
"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
Instance details

Defined in GeniusYield.Types.PaymentKeyHash

AsPubKeyHash GYPaymentKeyHash # 
Instance details

Defined in GeniusYield.Types.PaymentKeyHash

CanSignTx GYPaymentKeyHash # 
Instance details

Defined in GeniusYield.Types.PaymentKeyHash

IsString GYPaymentKeyHash # 
Instance details

Defined in GeniusYield.Types.PaymentKeyHash

Show GYPaymentKeyHash # 
Instance details

Defined in GeniusYield.Types.PaymentKeyHash

PrintfArg GYPaymentKeyHash #
>>> Printf.printf "%s\n" $ paymentKeyHashFromApi "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d
Instance details

Defined in GeniusYield.Types.PaymentKeyHash

FromField GYPaymentKeyHash #
>>> Csv.runParser $ Csv.parseField @GYPaymentKeyHash "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
Right (GYPaymentKeyHash "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d")
>>> Csv.runParser $ Csv.parseField @GYPaymentKeyHash "not a payment key hash"
Left "RawBytesHexErrorBase16DecodeFail \"not a payment key hash\" \"invalid character at offset: 0\""
Instance details

Defined in GeniusYield.Types.PaymentKeyHash

ToField GYPaymentKeyHash #
>>> Csv.toField @GYPaymentKeyHash "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
Instance details

Defined in GeniusYield.Types.PaymentKeyHash

Eq GYPaymentKeyHash # 
Instance details

Defined in GeniusYield.Types.PaymentKeyHash

Ord GYPaymentKeyHash # 
Instance details

Defined in GeniusYield.Types.PaymentKeyHash

ToSchema GYPaymentKeyHash # 
Instance details

Defined in GeniusYield.Types.PaymentKeyHash

paymentKeyHashFromPlutusPubKeyHashEither PlutusToCardanoError GYPaymentKeyHash #

>>> paymentKeyHashFromPlutus "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
Right (GYPaymentKeyHash "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d")
>>> paymentKeyHashFromPlutus "abcd"
Left (DeserialiseRawBytesError {ptceTag = "paymentKeyHashFromPlutus \"\\171\\205\", error: SerialiseAsRawBytesError {unSerialiseAsRawBytesError = \"Unable to deserialise Hash PaymentKey\"}"})

paymentKeyHashToPlutusGYPaymentKeyHashPubKeyHash #

>>> let Just pkh = Aeson.decode @GYPaymentKeyHash "\"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d\""
>>> paymentKeyHashToPlutus pkh
e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d

paymentKeyHashToApiGYPaymentKeyHashHash PaymentKey #

>>> let Just pkh = Aeson.decode @GYPaymentKeyHash "\"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d\""
>>> paymentKeyHashToApi pkh
"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"

paymentKeyHashFromApiHash PaymentKeyGYPaymentKeyHash #

>>> paymentKeyHashFromApi "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
GYPaymentKeyHash "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"

paymentKeyHashFromLedgerKeyHash Payment StandardCryptoGYPaymentKeyHash #

Convert from corresponding ledger representation.

paymentKeyHashToLedgerGYPaymentKeyHashKeyHash Payment StandardCrypto #

Convert to corresponding ledger representation.