atlas-cardano
Copyright(c) 2024 GYELD GMBH
LicenseApache 2.0
Maintainer[email protected]
Stabilitydevelop
Safe HaskellNone
LanguageGHC2021

GeniusYield.Types.Anchor

Description

 
Synopsis

Documentation

data GYUrl #

URL to a JSON payload of metadata. Note that we require URL to be at most 128 bytes. >>> textToUrl "https://geniusyield.co" GYUrl (Url {urlToText = "https://geniusyield.co"})

Instances

Instances details
FromJSON GYUrl # 
Instance details

Defined in GeniusYield.Types.Anchor

ToJSON GYUrl # 
Instance details

Defined in GeniusYield.Types.Anchor

Show GYUrl # 
Instance details

Defined in GeniusYield.Types.Anchor

Methods

showsPrec :: Int -> GYUrl -> ShowS #

show :: GYUrl -> String #

showList :: [GYUrl] -> ShowS #

Eq GYUrl # 
Instance details

Defined in GeniusYield.Types.Anchor

Methods

(==) :: GYUrl -> GYUrl -> Bool #

(/=) :: GYUrl -> GYUrl -> Bool #

Ord GYUrl # 
Instance details

Defined in GeniusYield.Types.Anchor

Methods

compare :: GYUrl -> GYUrl -> Ordering #

(<) :: GYUrl -> GYUrl -> Bool #

(<=) :: GYUrl -> GYUrl -> Bool #

(>) :: GYUrl -> GYUrl -> Bool #

(>=) :: GYUrl -> GYUrl -> Bool #

max :: GYUrl -> GYUrl -> GYUrl #

min :: GYUrl -> GYUrl -> GYUrl #

textToUrl :: MonadFail m => Text -> m GYUrl #

Convert a Text to a GYUrl checking that it is at most 128 bytes in the process.

urlToText :: GYUrl -> Text #

Convert a GYUrl to a Text.

type GYAnchorData = ByteString #

Anchor data.

data GYAnchorDataHash #

Hash of anchor data. >>> hashAnchorData "Hello, World!" GYAnchorDataHash (SafeHash "511bc81dde11180838c562c82bb35f3223f46061ebde4a955c27b3f489cf1e03")

anchorDataHashToByteString :: GYAnchorDataHash -> ByteString #

Convert a GYAnchorDataHash to a ByteString. >>> let h = hashAnchorData "Hello, World!"

>>> show h
"GYAnchorDataHash (SafeHash \"511bc81dde11180838c562c82bb35f3223f46061ebde4a955c27b3f489cf1e03\")"
>>> BS16.encode $ anchorDataHashToByteString h
"511bc81dde11180838c562c82bb35f3223f46061ebde4a955c27b3f489cf1e03"
>>> anchorDataHashFromByteString $ anchorDataHashToByteString h
Just (GYAnchorDataHash (SafeHash "511bc81dde11180838c562c82bb35f3223f46061ebde4a955c27b3f489cf1e03"))

data GYAnchor #

Anchor.

Instances

Instances details
Show GYAnchor # 
Instance details

Defined in GeniusYield.Types.Anchor

Eq GYAnchor # 
Instance details

Defined in GeniusYield.Types.Anchor

Ord GYAnchor # 
Instance details

Defined in GeniusYield.Types.Anchor