Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | [email protected] |
Stability | develop |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Synopsis
- newtype GYPubKeyHash = GYPubKeyHash (Hash PaymentKey)
- class AsPubKeyHash a where
- toPubKeyHash ∷ a → GYPubKeyHash
- fromPubKeyHash ∷ GYPubKeyHash → a
- class AsPubKeyHash a ⇒ CanSignTx a
- pubKeyHashFromPlutus ∷ PubKeyHash → Either PlutusToCardanoError GYPubKeyHash
- pubKeyHashToPlutus ∷ GYPubKeyHash → PubKeyHash
- pubKeyHashToApi ∷ GYPubKeyHash → Hash PaymentKey
- pubKeyHashFromApi ∷ Hash PaymentKey → GYPubKeyHash
- pubKeyHashToLedger ∷ GYPubKeyHash → KeyHash (a ∷ KeyRole) StandardCrypto
- pubKeyHashFromLedger ∷ KeyHash (a ∷ KeyRole) StandardCrypto → GYPubKeyHash
Documentation
newtype GYPubKeyHash #
Instances
FromJSON GYPubKeyHash # |
Invalid characters:
|
Defined in GeniusYield.Types.PubKeyHash | |
ToJSON GYPubKeyHash # |
|
Defined in GeniusYield.Types.PubKeyHash toJSON ∷ GYPubKeyHash → Value # toEncoding ∷ GYPubKeyHash → Encoding # toJSONList ∷ [GYPubKeyHash] → Value # toEncodingList ∷ [GYPubKeyHash] → Encoding # omitField ∷ GYPubKeyHash → Bool # | |
AsPubKeyHash GYPubKeyHash # | |
Defined in GeniusYield.Types.PubKeyHash | |
CanSignTx GYPubKeyHash # | |
Defined in GeniusYield.Types.PubKeyHash | |
IsString GYPubKeyHash # | |
Defined in GeniusYield.Types.PubKeyHash | |
Show GYPubKeyHash # | |
Defined in GeniusYield.Types.PubKeyHash showsPrec ∷ Int → GYPubKeyHash → ShowS # show ∷ GYPubKeyHash → String # showList ∷ [GYPubKeyHash] → ShowS # | |
PrintfArg GYPubKeyHash # |
|
Defined in GeniusYield.Types.PubKeyHash | |
FromField GYPubKeyHash # |
|
Defined in GeniusYield.Types.PubKeyHash | |
ToField GYPubKeyHash # |
|
Defined in GeniusYield.Types.PubKeyHash toField ∷ GYPubKeyHash → Field # | |
Eq GYPubKeyHash # | |
Defined in GeniusYield.Types.PubKeyHash (==) ∷ GYPubKeyHash → GYPubKeyHash → Bool # (/=) ∷ GYPubKeyHash → GYPubKeyHash → Bool # | |
Ord GYPubKeyHash # | |
Defined in GeniusYield.Types.PubKeyHash compare ∷ GYPubKeyHash → GYPubKeyHash → Ordering # (<) ∷ GYPubKeyHash → GYPubKeyHash → Bool # (<=) ∷ GYPubKeyHash → GYPubKeyHash → Bool # (>) ∷ GYPubKeyHash → GYPubKeyHash → Bool # (>=) ∷ GYPubKeyHash → GYPubKeyHash → Bool # max ∷ GYPubKeyHash → GYPubKeyHash → GYPubKeyHash # min ∷ GYPubKeyHash → GYPubKeyHash → GYPubKeyHash # | |
ToSchema GYPubKeyHash # | |
Defined in GeniusYield.Types.PubKeyHash |
class AsPubKeyHash a where #
toPubKeyHash ∷ a → GYPubKeyHash #
fromPubKeyHash ∷ GYPubKeyHash → a #
class AsPubKeyHash a ⇒ CanSignTx a #
Instances
CanSignTx GYPaymentKeyHash # | |
Defined in GeniusYield.Types.PaymentKeyHash | |
CanSignTx GYPubKeyHash # | |
Defined in GeniusYield.Types.PubKeyHash | |
CanSignTx GYStakeKeyHash # | |
Defined in GeniusYield.Types.StakeKeyHash |
pubKeyHashFromPlutus ∷ PubKeyHash → Either PlutusToCardanoError GYPubKeyHash #
>>>
pubKeyHashFromPlutus "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
Right (GYPubKeyHash "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d")
>>>
pubKeyHashFromPlutus "abcd"
Left (DeserialiseRawBytesError {ptceTag = "pubKeyHashFromPlutus \"\\171\\205\", error: SerialiseAsRawBytesError {unSerialiseAsRawBytesError = \"Unable to deserialise Hash PaymentKey\"}"})
pubKeyHashToPlutus ∷ GYPubKeyHash → PubKeyHash #
>>>
let Just pkh = Aeson.decode @GYPubKeyHash "\"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d\""
>>>
pubKeyHashToPlutus pkh
e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d
pubKeyHashToApi ∷ GYPubKeyHash → Hash PaymentKey #
>>>
let Just pkh = Aeson.decode @GYPubKeyHash "\"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d\""
>>>
pubKeyHashToApi pkh
"e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
pubKeyHashFromApi ∷ Hash PaymentKey → GYPubKeyHash #
>>>
pubKeyHashFromApi "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
GYPubKeyHash "e1cbb80db89e292269aeb93ec15eb963dda5176b66949fe1c2a6a38d"
pubKeyHashToLedger ∷ GYPubKeyHash → KeyHash (a ∷ KeyRole) StandardCrypto #
Convert to corresponding ledger representation.
pubKeyHashFromLedger ∷ KeyHash (a ∷ KeyRole) StandardCrypto → GYPubKeyHash #
Convert from corresponding ledger representation.