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

GeniusYield.Types.KeyHash

Description

 
Synopsis

Documentation

data GYKeyHash (kr ∷ GYKeyRole) #

Hash of a public key corresponding to a given GYKeyRole.

Instances

Instances details
SingGYKeyRoleI kr ⇒ FromJSON (GYKeyHash kr) #
>>> Aeson.eitherDecode @(GYKeyHash 'GYKeyRolePayment) "\"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d\""
Right (GYKeyHash (GYKeyRolePayment) "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d")

Invalid characters:

>>> Aeson.eitherDecode @(GYKeyHash 'GYKeyRolePayment) "\"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6azzz\""
Left "Error in $: \"GeniusYield.Types.KeyHash.keyHashFromRawBytesHex: unable to decode hash from hex string: e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6azzz, error: invalid character at offset: 53\""
Instance details

Defined in GeniusYield.Types.KeyHash

ToJSON (GYKeyHash kr) #
>>> LBS8.putStrLn $ Aeson.encode pkh
"ec91ac77b581ba928db86cd91d11e64032450677c6b80748ce0b9a81"
Instance details

Defined in GeniusYield.Types.KeyHash

AsPubKeyHash (GYKeyHash kr) # 
Instance details

Defined in GeniusYield.Types.KeyHash

CanSignTx (GYKeyHash kr) # 
Instance details

Defined in GeniusYield.Types.KeyHash

IsString (GYKeyHash kr) # 
Instance details

Defined in GeniusYield.Types.KeyHash

Methods

fromStringStringGYKeyHash kr #

SingGYKeyRoleI kr ⇒ Show (GYKeyHash kr) # 
Instance details

Defined in GeniusYield.Types.KeyHash

Methods

showsPrecIntGYKeyHash kr → ShowS #

showGYKeyHash kr → String #

showList ∷ [GYKeyHash kr] → ShowS #

PrintfArg (GYKeyHash kr) #
>>> Printf.printf "%s\n" $ pkh
ec91ac77b581ba928db86cd91d11e64032450677c6b80748ce0b9a81
Instance details

Defined in GeniusYield.Types.KeyHash

FromField (GYKeyHash kr) #
>>> Csv.runParser $ Csv.parseField @(GYKeyHash 'GYKeyRolePayment) "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
Right (GYKeyHash (GYKeyRolePayment) "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d")
>>> Csv.runParser $ Csv.parseField @(GYKeyHash 'GYKeyRolePayment) "not a payment key hash"
Left "\"GeniusYield.Types.KeyHash.keyHashFromRawBytesHex: unable to decode hash from hex string: not a payment key hash, error: invalid character at offset: 0\""
Instance details

Defined in GeniusYield.Types.KeyHash

Methods

parseFieldFieldParser (GYKeyHash kr) #

ToField (GYKeyHash kr) #
>>> Csv.toField pkh
"ec91ac77b581ba928db86cd91d11e64032450677c6b80748ce0b9a81"
Instance details

Defined in GeniusYield.Types.KeyHash

Methods

toFieldGYKeyHash kr → Field #

Eq (GYKeyHash kr) # 
Instance details

Defined in GeniusYield.Types.KeyHash

Methods

(==)GYKeyHash kr → GYKeyHash kr → Bool #

(/=)GYKeyHash kr → GYKeyHash kr → Bool #

Ord (GYKeyHash kr) # 
Instance details

Defined in GeniusYield.Types.KeyHash

Methods

compareGYKeyHash kr → GYKeyHash kr → Ordering #

(<)GYKeyHash kr → GYKeyHash kr → Bool #

(<=)GYKeyHash kr → GYKeyHash kr → Bool #

(>)GYKeyHash kr → GYKeyHash kr → Bool #

(>=)GYKeyHash kr → GYKeyHash kr → Bool #

maxGYKeyHash kr → GYKeyHash kr → GYKeyHash kr #

minGYKeyHash kr → GYKeyHash kr → GYKeyHash kr #

SingGYKeyRoleI kr ⇒ ToSchema (GYKeyHash kr) #
>>> Aeson.encode (Swagger.toSchema (Proxy :: Proxy (GYKeyHash 'GYKeyRolePayment)))
"{\"description\":\"The hash of a key with role as GYKeyRolePayment\",\"example\":\"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d\",\"format\":\"hex\",\"maxLength\":56,\"minLength\":56,\"type\":\"string\"}"
Instance details

Defined in GeniusYield.Types.KeyHash

keyHashToLedgerGYKeyHash kr → KeyHash (GYKeyRoleToLedger kr) StandardCrypto #

Convert to corresponding ledger representation.

keyHashFromLedgerKeyHash (GYKeyRoleToLedger kr) StandardCryptoGYKeyHash kr #

Convert from corresponding ledger representation.

keyHashToApi ∷ ∀ kr. SingGYKeyRoleI kr ⇒ GYKeyHash kr → GYHashToApi kr #

>>> keyHashToApi pkh
"ec91ac77b581ba928db86cd91d11e64032450677c6b80748ce0b9a81"

keyHashFromApi ∷ ∀ kr. SingGYKeyRoleI kr ⇒ GYHashToApi kr → GYKeyHash kr #

>>> keyHashFromApi @'GYKeyRolePayment "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
GYKeyHash (GYKeyRolePayment) "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"

keyHashToRawBytesGYKeyHash kr → ByteString #

Get corresponding raw bytes.

keyHashToRawBytesHexGYKeyHash kr → ByteString #

Get corresponding raw bytes represented as hex.

keyHashToRawBytesHexTextGYKeyHash kr → Text #

Get corresponding raw bytes represented as hex text.

keyHashFromRawBytesByteStringMaybe (GYKeyHash kr) #

Decode from raw bytes.

keyHashFromRawBytesHexByteStringEither String (GYKeyHash kr) #

Decode from raw bytes represented as hex.

data GYVRFVerKeyHash (kr ∷ GYKeyRoleVRF) #

Hash of a public key corresponding to a given GYKeyRoleVRF.

Instances

Instances details
IsString (GYVRFVerKeyHash kr) #
>>> "e132b26f3af1bd2a3d6af837ab09a60742625726415a29ca60d4778ff93da74e" :: (GYVRFVerKeyHash 'GYKeyRoleVRFStakePool)
GYVRFVerKeyHash (GYKeyRoleVRFStakePool) "e132b26f3af1bd2a3d6af837ab09a60742625726415a29ca60d4778ff93da74e"
Instance details

Defined in GeniusYield.Types.KeyHash

Show (GYVRFVerKeyHash kr) # 
Instance details

Defined in GeniusYield.Types.KeyHash

Eq (GYVRFVerKeyHash kr) # 
Instance details

Defined in GeniusYield.Types.KeyHash

Ord (GYVRFVerKeyHash kr) # 
Instance details

Defined in GeniusYield.Types.KeyHash

vrfVerKeyHashToRawBytesGYVRFVerKeyHash kr → ByteString #

Get corresponding raw bytes.

vrfVerKeyHashToRawBytesHexGYVRFVerKeyHash kr → ByteString #

Get corresponding raw bytes represented as hex.

vrfVerKeyHashToRawBytesHexTextGYVRFVerKeyHash kr → Text #

Get corresponding raw bytes represented as hex text.

vrfVerKeyHashFromRawBytesByteStringMaybe (GYVRFVerKeyHash kr) #

Decode from raw bytes.

vrfVerKeyHashFromRawBytesHexByteStringEither String (GYVRFVerKeyHash kr) #

Decode from raw bytes represented as hex.