atlas-cardano-0.9.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.StakePoolId

Description

 
Synopsis

Documentation

type GYStakePoolId = GYKeyHash 'GYKeyRoleStakePool #

type GYStakePoolId = GYKeyHash 'GYKeyRoleStakePool

stakePoolIdToApiGYStakePoolIdHash StakePoolKey #

>>> let Just spid = Aeson.decode @GYStakePoolId "\"c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27\""
>>> stakePoolIdToApi spid
"c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27"

stakePoolIdFromApiHash StakePoolKeyGYStakePoolId #

>>> stakePoolIdFromApi "c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27"
GYKeyHash (GYKeyRoleStakePool) "c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27"

stakePoolIdToLedgerGYStakePoolIdKeyHash StakePool StandardCrypto #

Convert to corresponding ledger type.

stakePoolIdFromLedgerKeyHash StakePool StandardCryptoGYStakePoolId #

Convert from corresponding ledger type.

stakePoolIdFromTextMaybeTextMaybe GYStakePoolId #

Obtain GYStakePoolId from bech32 encoding of stake pool id.

>>> stakePoolIdFromTextMaybe "pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt"
Just (GYKeyHash (GYKeyRoleStakePool) "c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27")
>>> stakePoolIdFromTextMaybe "c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27"
Nothing

stakePoolIdToTextGYStakePoolIdText #

Serialises GYStakePoolId to it's bech32 representation.

>>> stakePoolIdToText spId
"pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt"

data GYStakePoolIdBech32 #

GYStakePoolIdBech32 which uses "bech32" format

>>> Web.toUrlPiece $ stakePoolIdToBech32 spId
"pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt"

Instances

Instances details
FromJSON GYStakePoolIdBech32 #
>>> Aeson.decode @GYStakePoolIdBech32 "\"pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt\""
Just pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt
Instance details

Defined in GeniusYield.Types.StakePoolId

ToJSON GYStakePoolIdBech32 #
>>> LBS8.putStrLn $ Aeson.encode $ stakePoolIdToBech32 spId
"pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt"
Instance details

Defined in GeniusYield.Types.StakePoolId

IsString GYStakePoolIdBech32 # 
Instance details

Defined in GeniusYield.Types.StakePoolId

Show GYStakePoolIdBech32 # 
Instance details

Defined in GeniusYield.Types.StakePoolId

Eq GYStakePoolIdBech32 # 
Instance details

Defined in GeniusYield.Types.StakePoolId

Ord GYStakePoolIdBech32 # 
Instance details

Defined in GeniusYield.Types.StakePoolId

FromHttpApiData GYStakePoolIdBech32 #
>>> Web.parseUrlPiece @GYStakePoolIdBech32 "pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt"
Right pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt
Instance details

Defined in GeniusYield.Types.StakePoolId

ToHttpApiData GYStakePoolIdBech32 # 
Instance details

Defined in GeniusYield.Types.StakePoolId

ToParamSchema GYStakePoolIdBech32 # 
Instance details

Defined in GeniusYield.Types.StakePoolId

ToSchema GYStakePoolIdBech32 #
>>> Aeson.encode (Swagger.toSchema (Proxy :: Proxy GYStakePoolIdBech32))
"{\"description\":\"A stake pool id, serialised as Bech32.\",\"example\":\"pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt\",\"format\":\"bech32\",\"type\":\"string\"}"
Instance details

Defined in GeniusYield.Types.StakePoolId