atlas-cardano-0.6.2: 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

data GYStakePoolId #

Instances

Instances details
FromJSON GYStakePoolId #
>>> Aeson.eitherDecode @GYStakePoolId "\"c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27\""
Right (unsafeStakePoolIdFromText "pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt")

Invalid characters:

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

Defined in GeniusYield.Types.StakePoolId

ToJSON GYStakePoolId #
>>> let Just spid = Aeson.decode @GYStakePoolId "\"c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27\""
>>> LBS8.putStrLn $ Aeson.encode spid
"c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27"
Instance details

Defined in GeniusYield.Types.StakePoolId

AsPubKeyHash GYStakePoolId # 
Instance details

Defined in GeniusYield.Types.StakePoolId

IsString GYStakePoolId # 
Instance details

Defined in GeniusYield.Types.StakePoolId

Show GYStakePoolId # 
Instance details

Defined in GeniusYield.Types.StakePoolId

PrintfArg GYStakePoolId #
>>> Printf.printf "%s\n" $ stakePoolIdFromApi "c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27"
c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27
Instance details

Defined in GeniusYield.Types.StakePoolId

FromField GYStakePoolId #
>>> Csv.runParser $ Csv.parseField @GYStakePoolId "c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27"
Right (unsafeStakePoolIdFromText "pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt")
>>> Csv.runParser $ Csv.parseField @GYStakePoolId "not a pub stake key hash"
Left "RawBytesHexErrorBase16DecodeFail \"not a pub stake key hash\" \"invalid character at offset: 0\""
Instance details

Defined in GeniusYield.Types.StakePoolId

ToField GYStakePoolId #
>>> Csv.toField @GYStakePoolId "c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27"
"c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27"
Instance details

Defined in GeniusYield.Types.StakePoolId

Methods

toFieldGYStakePoolIdField #

Eq GYStakePoolId # 
Instance details

Defined in GeniusYield.Types.StakePoolId

Ord GYStakePoolId # 
Instance details

Defined in GeniusYield.Types.StakePoolId

ToSchema GYStakePoolId # 
Instance details

Defined in GeniusYield.Types.StakePoolId

stakePoolIdToApiGYStakePoolIdHash StakePoolKey #

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

stakePoolIdFromApiHash StakePoolKeyGYStakePoolId #

>>> stakePoolIdFromApi "c485ab20bd3f105e59f3c50a0d3fbaf615a51f70a1c6d29d00a1fd27"
unsafeStakePoolIdFromText "pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt"

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 (unsafeStakePoolIdFromText "pool1cjz6kg9a8ug9uk0nc59q60a67c2628ms58rd98gq587jwa2x5qt")
>>> 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