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.PubKeyHash

Description

 
Synopsis

Documentation

newtype GYPubKeyHash #

Constructors

GYPubKeyHash (Hash PaymentKey) 

Instances

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

Invalid characters:

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

Defined in GeniusYield.Types.PubKeyHash

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

Defined in GeniusYield.Types.PubKeyHash

AsPubKeyHash GYPubKeyHash # 
Instance details

Defined in GeniusYield.Types.PubKeyHash

CanSignTx GYPubKeyHash # 
Instance details

Defined in GeniusYield.Types.PubKeyHash

IsString GYPubKeyHash # 
Instance details

Defined in GeniusYield.Types.PubKeyHash

Show GYPubKeyHash # 
Instance details

Defined in GeniusYield.Types.PubKeyHash

PrintfArg GYPubKeyHash #
>>> Printf.printf "%s\n" $ pubKeyHashFromApi "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d
Instance details

Defined in GeniusYield.Types.PubKeyHash

FromField GYPubKeyHash #
>>> Csv.runParser $ Csv.parseField @GYPubKeyHash "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
Right (GYPubKeyHash "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d")
>>> Csv.runParser $ Csv.parseField @GYPubKeyHash "not a pubkey hash"
Left "RawBytesHexErrorBase16DecodeFail \"not a pubkey hash\" \"invalid bytestring size\""
Instance details

Defined in GeniusYield.Types.PubKeyHash

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

Defined in GeniusYield.Types.PubKeyHash

Eq GYPubKeyHash # 
Instance details

Defined in GeniusYield.Types.PubKeyHash

Ord GYPubKeyHash # 
Instance details

Defined in GeniusYield.Types.PubKeyHash

ToSchema GYPubKeyHash # 
Instance details

Defined in GeniusYield.Types.PubKeyHash

class AsPubKeyHash a ⇒ CanSignTx a #

Instances

Instances details
CanSignTx GYPaymentKeyHash # 
Instance details

Defined in GeniusYield.Types.PaymentKeyHash

CanSignTx GYPubKeyHash # 
Instance details

Defined in GeniusYield.Types.PubKeyHash

CanSignTx GYStakeKeyHash # 
Instance details

Defined in GeniusYield.Types.StakeKeyHash

pubKeyHashFromPlutusPubKeyHashEither PlutusToCardanoError GYPubKeyHash #

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

pubKeyHashToPlutusGYPubKeyHashPubKeyHash #

>>> let Just pkh = Aeson.decode @GYPubKeyHash "\"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d\""
>>> pubKeyHashToPlutus pkh
e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d

pubKeyHashToApiGYPubKeyHashHash PaymentKey #

>>> let Just pkh = Aeson.decode @GYPubKeyHash "\"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d\""
>>> pubKeyHashToApi pkh
"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"

pubKeyHashFromApiHash PaymentKeyGYPubKeyHash #

>>> pubKeyHashFromApi "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
GYPubKeyHash "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"