Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | [email protected] |
Stability | develop |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
GeniusYield.Types.StakePoolId
Description
Synopsis
- data GYStakePoolId
- stakePoolIdToApi ∷ GYStakePoolId → Hash StakePoolKey
- stakePoolIdFromApi ∷ Hash StakePoolKey → GYStakePoolId
- stakePoolIdToLedger ∷ GYStakePoolId → KeyHash StakePool StandardCrypto
- stakePoolIdFromLedger ∷ KeyHash StakePool StandardCrypto → GYStakePoolId
- stakePoolIdFromTextMaybe ∷ Text → Maybe GYStakePoolId
- unsafeStakePoolIdFromText ∷ Text → GYStakePoolId
- stakePoolIdToText ∷ GYStakePoolId → Text
- data GYStakePoolIdBech32
- stakePoolIdFromBech32 ∷ GYStakePoolIdBech32 → GYStakePoolId
- stakePoolIdToBech32 ∷ GYStakePoolId → GYStakePoolIdBech32
Documentation
data GYStakePoolId #
Instances
FromJSON GYStakePoolId # |
Invalid characters:
|
Defined in GeniusYield.Types.StakePoolId | |
ToJSON GYStakePoolId # |
|
Defined in GeniusYield.Types.StakePoolId Methods toJSON ∷ GYStakePoolId → Value # toEncoding ∷ GYStakePoolId → Encoding # toJSONList ∷ [GYStakePoolId] → Value # toEncodingList ∷ [GYStakePoolId] → Encoding # omitField ∷ GYStakePoolId → Bool # | |
AsPubKeyHash GYStakePoolId # | |
Defined in GeniusYield.Types.StakePoolId | |
IsString GYStakePoolId # | |
Defined in GeniusYield.Types.StakePoolId Methods | |
Show GYStakePoolId # | |
Defined in GeniusYield.Types.StakePoolId Methods showsPrec ∷ Int → GYStakePoolId → ShowS # show ∷ GYStakePoolId → String # showList ∷ [GYStakePoolId] → ShowS # | |
PrintfArg GYStakePoolId # |
|
Defined in GeniusYield.Types.StakePoolId | |
FromField GYStakePoolId # |
|
Defined in GeniusYield.Types.StakePoolId Methods | |
ToField GYStakePoolId # |
|
Defined in GeniusYield.Types.StakePoolId Methods toField ∷ GYStakePoolId → Field # | |
Eq GYStakePoolId # | |
Defined in GeniusYield.Types.StakePoolId | |
Ord GYStakePoolId # | |
Defined in GeniusYield.Types.StakePoolId Methods compare ∷ GYStakePoolId → GYStakePoolId → Ordering # (<) ∷ GYStakePoolId → GYStakePoolId → Bool # (<=) ∷ GYStakePoolId → GYStakePoolId → Bool # (>) ∷ GYStakePoolId → GYStakePoolId → Bool # (>=) ∷ GYStakePoolId → GYStakePoolId → Bool # | |
ToSchema GYStakePoolId # | |
Defined in GeniusYield.Types.StakePoolId Methods declareNamedSchema ∷ Proxy GYStakePoolId → Declare (Definitions Schema) NamedSchema # |
stakePoolIdToApi ∷ GYStakePoolId → Hash StakePoolKey #
>>>
let Just spid = Aeson.decode @GYStakePoolId "\"c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27\""
>>>
stakePoolIdToApi spid
"c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27"
stakePoolIdFromApi ∷ Hash StakePoolKey → GYStakePoolId #
>>>
stakePoolIdFromApi "c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27"
unsafeStakePoolIdFromText "pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt"
stakePoolIdToLedger ∷ GYStakePoolId → KeyHash StakePool StandardCrypto #
Convert to corresponding ledger type.
stakePoolIdFromLedger ∷ KeyHash StakePool StandardCrypto → GYStakePoolId #
Convert from corresponding ledger type.
stakePoolIdFromTextMaybe ∷ Text → Maybe GYStakePoolId #
Obtain GYStakePoolId
from bech32 encoding of stake pool id.
>>>
stakePoolIdFromTextMaybe "pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt"
Just (unsafeStakePoolIdFromText "pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt")>>>
stakePoolIdFromTextMaybe "c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27"
Nothing
unsafeStakePoolIdFromText ∷ Text → GYStakePoolId #
Like stakePoolIdFromTextMaybe
but errors on Nothing
case.
stakePoolIdToText ∷ GYStakePoolId → Text #
Serialises GYStakePoolId
to it's bech32 representation.
>>>
stakePoolIdToText spId
"pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt"
data GYStakePoolIdBech32 #
GYStakePoolIdBech32
which uses "bech32" format
>>>
Web.toUrlPiece $ stakePoolIdToBech32 spId
"pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt"