module Blockfrost.Types.Cardano.Assets
( AssetInfo (..)
, AssetDetails (..)
, AssetOnChainMetadata (..)
, MetadataMediaFile (..)
, parseStandardMetadata
, parseStandardMetadataInDetails
, AssetMetadata (..)
, AssetHistory (..)
, AssetAction (..)
, AssetTransaction (..)
, AssetAddress (..)
) where
import Blockfrost.Types.Shared
import Data.Aeson (Value (..), FromJSON(parseJSON))
import Data.Aeson.Types (parseMaybe)
import Data.Aeson.KeyMap (fromList)
import Data.Char (toLower)
import Data.Text (Text)
import qualified Data.Vector as V (singleton)
import Deriving.Aeson
import Servant.Docs (ToSample (..), samples, singleSample)
import Prelude hiding (String)
data AssetInfo = AssetInfo
{ AssetInfo -> Text
_assetInfoAsset :: Text
, AssetInfo -> Quantity
_assetInfoQuantity :: Quantity
}
deriving stock (Int -> AssetInfo -> ShowS
[AssetInfo] -> ShowS
AssetInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetInfo] -> ShowS
$cshowList :: [AssetInfo] -> ShowS
show :: AssetInfo -> String
$cshow :: AssetInfo -> String
showsPrec :: Int -> AssetInfo -> ShowS
$cshowsPrec :: Int -> AssetInfo -> ShowS
Show, AssetInfo -> AssetInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetInfo -> AssetInfo -> Bool
$c/= :: AssetInfo -> AssetInfo -> Bool
== :: AssetInfo -> AssetInfo -> Bool
$c== :: AssetInfo -> AssetInfo -> Bool
Eq, forall x. Rep AssetInfo x -> AssetInfo
forall x. AssetInfo -> Rep AssetInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssetInfo x -> AssetInfo
$cfrom :: forall x. AssetInfo -> Rep AssetInfo x
Generic)
deriving (Maybe AssetInfo
Value -> Parser [AssetInfo]
Value -> Parser AssetInfo
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
omittedField :: Maybe AssetInfo
$comittedField :: Maybe AssetInfo
parseJSONList :: Value -> Parser [AssetInfo]
$cparseJSONList :: Value -> Parser [AssetInfo]
parseJSON :: Value -> Parser AssetInfo
$cparseJSON :: Value -> Parser AssetInfo
FromJSON, [AssetInfo] -> Encoding
[AssetInfo] -> Value
AssetInfo -> Bool
AssetInfo -> Encoding
AssetInfo -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
omitField :: AssetInfo -> Bool
$comitField :: AssetInfo -> Bool
toEncodingList :: [AssetInfo] -> Encoding
$ctoEncodingList :: [AssetInfo] -> Encoding
toJSONList :: [AssetInfo] -> Value
$ctoJSONList :: [AssetInfo] -> Value
toEncoding :: AssetInfo -> Encoding
$ctoEncoding :: AssetInfo -> Encoding
toJSON :: AssetInfo -> Value
$ctoJSON :: AssetInfo -> Value
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_assetInfo", CamelToSnake]] AssetInfo
instance ToSample AssetInfo where
toSamples :: Proxy AssetInfo -> [(Text, AssetInfo)]
toSamples = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a. [a] -> [(Text, a)]
samples
[ AssetInfo
{ _assetInfoAsset :: Text
_assetInfoAsset = Text
"b0d07d45fe9514f80213f4020e5a61241458be626841cde717cb38a76e7574636f696e"
, _assetInfoQuantity :: Quantity
_assetInfoQuantity = Quantity
1
}
, AssetInfo
{ _assetInfoAsset :: Text
_assetInfoAsset = Text
"b0d07d45fe9514f80213f4020e5a61241458be626841cde717cb38a76e75d"
, _assetInfoQuantity :: Quantity
_assetInfoQuantity = Quantity
100000
}
, AssetInfo
{ _assetInfoAsset :: Text
_assetInfoAsset = Text
"6804edf9712d2b619edb6ac86861fe93a730693183a262b165fcc1ba1bc99cad"
, _assetInfoQuantity :: Quantity
_assetInfoQuantity = Quantity
18605647
}
]
data LowerHead
instance StringModifier LowerHead where
getStringModifier :: ShowS
getStringModifier (Char
f:String
rest) = Char -> Char
toLower Char
f forall a. a -> [a] -> [a]
: String
rest
getStringModifier [] = forall a. HasCallStack => String -> a
error String
"Empty field name"
data MetadataMediaFile = MetadataMediaFile
{ MetadataMediaFile -> Maybe Text
_metadataMediaFileName :: Maybe Text
, MetadataMediaFile -> Maybe Text
_metadataMediaFileMediaType :: Maybe Text
, MetadataMediaFile -> Maybe Text
_metadataMediaFileSrc :: Maybe Text
}
deriving stock (Int -> MetadataMediaFile -> ShowS
[MetadataMediaFile] -> ShowS
MetadataMediaFile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetadataMediaFile] -> ShowS
$cshowList :: [MetadataMediaFile] -> ShowS
show :: MetadataMediaFile -> String
$cshow :: MetadataMediaFile -> String
showsPrec :: Int -> MetadataMediaFile -> ShowS
$cshowsPrec :: Int -> MetadataMediaFile -> ShowS
Show, MetadataMediaFile -> MetadataMediaFile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetadataMediaFile -> MetadataMediaFile -> Bool
$c/= :: MetadataMediaFile -> MetadataMediaFile -> Bool
== :: MetadataMediaFile -> MetadataMediaFile -> Bool
$c== :: MetadataMediaFile -> MetadataMediaFile -> Bool
Eq, forall x. Rep MetadataMediaFile x -> MetadataMediaFile
forall x. MetadataMediaFile -> Rep MetadataMediaFile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetadataMediaFile x -> MetadataMediaFile
$cfrom :: forall x. MetadataMediaFile -> Rep MetadataMediaFile x
Generic)
deriving (Maybe MetadataMediaFile
Value -> Parser [MetadataMediaFile]
Value -> Parser MetadataMediaFile
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
omittedField :: Maybe MetadataMediaFile
$comittedField :: Maybe MetadataMediaFile
parseJSONList :: Value -> Parser [MetadataMediaFile]
$cparseJSONList :: Value -> Parser [MetadataMediaFile]
parseJSON :: Value -> Parser MetadataMediaFile
$cparseJSON :: Value -> Parser MetadataMediaFile
FromJSON, [MetadataMediaFile] -> Encoding
[MetadataMediaFile] -> Value
MetadataMediaFile -> Bool
MetadataMediaFile -> Encoding
MetadataMediaFile -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
omitField :: MetadataMediaFile -> Bool
$comitField :: MetadataMediaFile -> Bool
toEncodingList :: [MetadataMediaFile] -> Encoding
$ctoEncodingList :: [MetadataMediaFile] -> Encoding
toJSONList :: [MetadataMediaFile] -> Value
$ctoJSONList :: [MetadataMediaFile] -> Value
toEncoding :: MetadataMediaFile -> Encoding
$ctoEncoding :: MetadataMediaFile -> Encoding
toJSON :: MetadataMediaFile -> Value
$ctoJSON :: MetadataMediaFile -> Value
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_metadataMediaFile", LowerHead]] MetadataMediaFile
instance ToSample MetadataMediaFile where
toSamples :: Proxy MetadataMediaFile -> [(Text, MetadataMediaFile)]
toSamples = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a. a -> [(Text, a)]
singleSample MetadataMediaFile
sampleAssetOnChainMetadataFile
sampleAssetOnChainMetadataFile :: MetadataMediaFile
sampleAssetOnChainMetadataFile :: MetadataMediaFile
sampleAssetOnChainMetadataFile =
MetadataMediaFile
{ _metadataMediaFileName :: Maybe Text
_metadataMediaFileName = forall a. a -> Maybe a
Just Text
"Detailed image"
, _metadataMediaFileMediaType :: Maybe Text
_metadataMediaFileMediaType = forall a. a -> Maybe a
Just Text
"image/png"
, _metadataMediaFileSrc :: Maybe Text
_metadataMediaFileSrc = forall a. a -> Maybe a
Just Text
"ipfs://ipfs/QmfKyJ4tuvHowwKQCbCHj4L5T3fSj8cjs7Aau8V7BWv226"
}
data AssetOnChainMetadata = AssetOnChainMetadata
{ AssetOnChainMetadata -> Maybe Text
_assetOnChainMetadataName :: Maybe Text
, AssetOnChainMetadata -> Maybe Text
_assetOnChainMetadataDescription :: Maybe Text
, AssetOnChainMetadata -> Maybe Text
_assetOnChainMetadataImage :: Maybe Text
, AssetOnChainMetadata -> Maybe Text
_assetOnChainMetadataMediaType :: Maybe Text
, AssetOnChainMetadata -> Maybe [MetadataMediaFile]
_assetOnChainMetadataFiles :: Maybe [MetadataMediaFile]
}
deriving stock (Int -> AssetOnChainMetadata -> ShowS
[AssetOnChainMetadata] -> ShowS
AssetOnChainMetadata -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetOnChainMetadata] -> ShowS
$cshowList :: [AssetOnChainMetadata] -> ShowS
show :: AssetOnChainMetadata -> String
$cshow :: AssetOnChainMetadata -> String
showsPrec :: Int -> AssetOnChainMetadata -> ShowS
$cshowsPrec :: Int -> AssetOnChainMetadata -> ShowS
Show, AssetOnChainMetadata -> AssetOnChainMetadata -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetOnChainMetadata -> AssetOnChainMetadata -> Bool
$c/= :: AssetOnChainMetadata -> AssetOnChainMetadata -> Bool
== :: AssetOnChainMetadata -> AssetOnChainMetadata -> Bool
$c== :: AssetOnChainMetadata -> AssetOnChainMetadata -> Bool
Eq, forall x. Rep AssetOnChainMetadata x -> AssetOnChainMetadata
forall x. AssetOnChainMetadata -> Rep AssetOnChainMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssetOnChainMetadata x -> AssetOnChainMetadata
$cfrom :: forall x. AssetOnChainMetadata -> Rep AssetOnChainMetadata x
Generic)
deriving (Maybe AssetOnChainMetadata
Value -> Parser [AssetOnChainMetadata]
Value -> Parser AssetOnChainMetadata
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
omittedField :: Maybe AssetOnChainMetadata
$comittedField :: Maybe AssetOnChainMetadata
parseJSONList :: Value -> Parser [AssetOnChainMetadata]
$cparseJSONList :: Value -> Parser [AssetOnChainMetadata]
parseJSON :: Value -> Parser AssetOnChainMetadata
$cparseJSON :: Value -> Parser AssetOnChainMetadata
FromJSON, [AssetOnChainMetadata] -> Encoding
[AssetOnChainMetadata] -> Value
AssetOnChainMetadata -> Bool
AssetOnChainMetadata -> Encoding
AssetOnChainMetadata -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
omitField :: AssetOnChainMetadata -> Bool
$comitField :: AssetOnChainMetadata -> Bool
toEncodingList :: [AssetOnChainMetadata] -> Encoding
$ctoEncodingList :: [AssetOnChainMetadata] -> Encoding
toJSONList :: [AssetOnChainMetadata] -> Value
$ctoJSONList :: [AssetOnChainMetadata] -> Value
toEncoding :: AssetOnChainMetadata -> Encoding
$ctoEncoding :: AssetOnChainMetadata -> Encoding
toJSON :: AssetOnChainMetadata -> Value
$ctoJSON :: AssetOnChainMetadata -> Value
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_assetOnChainMetadata", LowerHead]] AssetOnChainMetadata
instance ToSample AssetOnChainMetadata where
toSamples :: Proxy AssetOnChainMetadata -> [(Text, AssetOnChainMetadata)]
toSamples = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a. a -> [(Text, a)]
singleSample forall a b. (a -> b) -> a -> b
$ AssetOnChainMetadata
sampleAssetOnChainMetadata
sampleAssetOnChainMetadata :: AssetOnChainMetadata
sampleAssetOnChainMetadata :: AssetOnChainMetadata
sampleAssetOnChainMetadata = AssetOnChainMetadata
{ _assetOnChainMetadataName :: Maybe Text
_assetOnChainMetadataName = forall a. a -> Maybe a
Just Text
"My NFT token"
, _assetOnChainMetadataDescription :: Maybe Text
_assetOnChainMetadataDescription = forall a. a -> Maybe a
Just Text
"A cool token for joy and fun."
, _assetOnChainMetadataImage :: Maybe Text
_assetOnChainMetadataImage = forall a. a -> Maybe a
Just Text
"ipfs://ipfs/QmfKyJ4tuvHowwKQCbCHj4L5T3fSj8cjs7Aau8V7BWv226"
, _assetOnChainMetadataMediaType :: Maybe Text
_assetOnChainMetadataMediaType = forall a. a -> Maybe a
Just Text
"image/png"
, _assetOnChainMetadataFiles :: Maybe [MetadataMediaFile]
_assetOnChainMetadataFiles = forall a. a -> Maybe a
Just [ MetadataMediaFile
sampleAssetOnChainMetadataFile ]
}
data AssetMetadata = AssetMetadata
{ AssetMetadata -> Text
_assetMetadataName :: Text
, AssetMetadata -> Text
_assetMetadataDescription :: Text
, AssetMetadata -> Maybe Text
_assetMetadataTicker :: Maybe Text
, AssetMetadata -> Maybe Text
_assetMetadataUrl :: Maybe Text
, AssetMetadata -> Maybe Text
_assetMetadataLogo :: Maybe Text
, AssetMetadata -> Maybe Int
_assetMetadataDecimals :: Maybe Int
}
deriving stock (Int -> AssetMetadata -> ShowS
[AssetMetadata] -> ShowS
AssetMetadata -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetMetadata] -> ShowS
$cshowList :: [AssetMetadata] -> ShowS
show :: AssetMetadata -> String
$cshow :: AssetMetadata -> String
showsPrec :: Int -> AssetMetadata -> ShowS
$cshowsPrec :: Int -> AssetMetadata -> ShowS
Show, AssetMetadata -> AssetMetadata -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetMetadata -> AssetMetadata -> Bool
$c/= :: AssetMetadata -> AssetMetadata -> Bool
== :: AssetMetadata -> AssetMetadata -> Bool
$c== :: AssetMetadata -> AssetMetadata -> Bool
Eq, forall x. Rep AssetMetadata x -> AssetMetadata
forall x. AssetMetadata -> Rep AssetMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssetMetadata x -> AssetMetadata
$cfrom :: forall x. AssetMetadata -> Rep AssetMetadata x
Generic)
deriving (Maybe AssetMetadata
Value -> Parser [AssetMetadata]
Value -> Parser AssetMetadata
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
omittedField :: Maybe AssetMetadata
$comittedField :: Maybe AssetMetadata
parseJSONList :: Value -> Parser [AssetMetadata]
$cparseJSONList :: Value -> Parser [AssetMetadata]
parseJSON :: Value -> Parser AssetMetadata
$cparseJSON :: Value -> Parser AssetMetadata
FromJSON, [AssetMetadata] -> Encoding
[AssetMetadata] -> Value
AssetMetadata -> Bool
AssetMetadata -> Encoding
AssetMetadata -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
omitField :: AssetMetadata -> Bool
$comitField :: AssetMetadata -> Bool
toEncodingList :: [AssetMetadata] -> Encoding
$ctoEncodingList :: [AssetMetadata] -> Encoding
toJSONList :: [AssetMetadata] -> Value
$ctoJSONList :: [AssetMetadata] -> Value
toEncoding :: AssetMetadata -> Encoding
$ctoEncoding :: AssetMetadata -> Encoding
toJSON :: AssetMetadata -> Value
$ctoJSON :: AssetMetadata -> Value
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_assetMetadata", CamelToSnake]] AssetMetadata
instance ToSample AssetMetadata where
toSamples :: Proxy AssetMetadata -> [(Text, AssetMetadata)]
toSamples = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a. a -> [(Text, a)]
singleSample
AssetMetadata
{ _assetMetadataName :: Text
_assetMetadataName = Text
"nutcoin"
, _assetMetadataDescription :: Text
_assetMetadataDescription = Text
"The Nut Coin"
, _assetMetadataTicker :: Maybe Text
_assetMetadataTicker = forall (f :: * -> *) a. Applicative f => a -> f a
pure Text
"nutc"
, _assetMetadataUrl :: Maybe Text
_assetMetadataUrl = forall (f :: * -> *) a. Applicative f => a -> f a
pure Text
"https://www.stakenuts.com/"
, _assetMetadataLogo :: Maybe Text
_assetMetadataLogo = forall (f :: * -> *) a. Applicative f => a -> f a
pure Text
"iVBORw0KGgoAAAANSUhEUgAAADAAAAAoCAYAAAC4h3lxAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUUH5QITCDUPjqwFHwAAB9xJREFUWMPVWXtsU9cZ/8499/r6dZ3E9rUdO7ZDEgglFWO8KaOsJW0pCLRKrN1AqqYVkqoqrYo0ja7bpElru1WairStFKY9WzaE1E1tx+jokKqwtqFNyhKahEJJyJNgJ37E9r1+3HvO/sFR4vhx7SBtfH/F3/l93/f7ne/4PBxEKYU72dj/ZfH772v1TU+HtqbTaX8wOO01GPQpRVH7JEm+vGHDuq6z7/8jUSoHKtaBKkEUFUXdajDy1hUrmrs6zn/wWS7m7pZVjMUirKGUTnzc+e9xLcTrPPVfZzDz06Sc2lyQGEIyAPzT7Xa+dvE/3e+XLaCxoflHsVj8MAAYs74aa/WHoenwvpkZKeFy2Z5NJlOPUkqXZccFwSSrKjlyffjLH+TL6XTUGTGL/6hklD3ldIrj2M5MRmkLBMcvaRLQ1Nj88sxM/HCBfMP+eu/OYGDqe6l0WmpoqJ/88upgrU7HrQNA/cFg6MlkKiLlBtVUO40cx54BgHvLIT/HJLvdeqh/4NKxogKWN7fsCoUi7xTLxLJ4vLq6ak//wKVOrdXtttrTDMPsqJA8AAAwDErdu3VL3alTf5ma9eWCpoKhn5dKpCiqJxicPucQPVu0FHaInn35yHMcKwPAa4SQ3QCwFgDWUko3qSr5vqqSgTypuEg4Mo/zvA74/Y0rZSnZU8akSHV17k2fXfy0txjI5224kEym1s/1EUI7LBbztweHrkzkizn49LP6U6feepFSeggAQK/n04SQZ8bGrxdeQjZrbRvGzLH5hcibRqOhPplMfS1fIY5jz4xPDBdcGggho2h3z9sOLRazdG3wqp9SMgUlzGZ17SSEPsRx7J8Cw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/Qih5ZqDcoxlMZ24MaJJAABA87IVJ8Lh6N65Pr1B/+LIyLUfAhRZQvnM6ah7ZDHkAQB0vK6/HHxNTc2ruT5Zkldn/y5LACFk+2LIAwAwCGl6yGSt88KHXbmrBCHkqEgAz+vWLFZALJb4qNwYhFDhCSknkSwnQ4sVgDFeWg7+gQe2r1tAmkGTFQlACHWVg89nhJA9ot3dphV/eeCLp/Pw6K5IQP0S39uLFXCLwDG7zf1cKZxD9LSlUunHc/12u/2t2Vzl/rzu8zb8PZlM7bwdQgDgPK/nX2nddt+53//ht3LW2dS0fF0iLj2vquojuQFmwXRucPBKa8UCmpe1iOFwpAsAfLdJBFBKwVIlXJ2JxqKCxbwyHkvoCkAlv9/71U+7Oq+UJWDZ0hViJBL1cRynbNq0sSeeiPl6ei4NqIqq6TSmlB7X6bjuTEY5pgWfzwxGPZhMpt39/b3vzvWXFGCzulZjjM/DrauDwcAr8bjcgzGjZUuVBMH8k2uDX7wCAFDr8n2LEPI7SqmhTP6SzVbz6MDlz0/nDpT8EmOM22HOvUeWU2wp8iyLgRL6hk7Hrc2SBwC4MTlykmXZRozxn00mbVcphNA5jJmV+chr6oDd5l6jN/A/TqfSuwEAGITGMIsvGo3GTwTB3Dc2NjGSxdZYq4VIOOoNBANnKE0XPXE3brjHOTQ08k2MmVZOxzVJCbkFIQSCYEphzPaFQuGzTpfjb319PZ8UFXin/5OvrHPg/9HueAH/BSUqOuNZm4fyAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIxLTAyLTE5VDA4OjUyOjI1KzAwOjAwCmFGlgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0wMi0xOVQwODo1MjoyMyswMDowMBjsyxAAAAAASUVORK5CYII="
, _assetMetadataDecimals :: Maybe Int
_assetMetadataDecimals = forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
6
}
data AssetDetails = AssetDetails
{ AssetDetails -> Text
_assetDetailsAsset :: Text
, AssetDetails -> PolicyId
_assetDetailsPolicyId :: PolicyId
, AssetDetails -> Maybe Text
_assetDetailsAssetName :: Maybe Text
, AssetDetails -> Text
_assetDetailsFingerprint :: Text
, AssetDetails -> Quantity
_assetDetailsQuantity :: Quantity
, AssetDetails -> TxHash
_assetDetailsInitialMintTxHash :: TxHash
, AssetDetails -> Integer
_assetDetailsMintOrBurnCount :: Integer
, AssetDetails -> Maybe Value
_assetDetailsOnchainMetadataValue :: Maybe Value
, AssetDetails -> Maybe AssetOnChainMetadata
_assetDetailsOnchainStandardMetadata :: Maybe AssetOnChainMetadata
, AssetDetails -> Maybe AssetMetadata
_assetDetailsMetadata :: Maybe AssetMetadata
, :: Maybe Text
}
deriving stock (Int -> AssetDetails -> ShowS
[AssetDetails] -> ShowS
AssetDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetDetails] -> ShowS
$cshowList :: [AssetDetails] -> ShowS
show :: AssetDetails -> String
$cshow :: AssetDetails -> String
showsPrec :: Int -> AssetDetails -> ShowS
$cshowsPrec :: Int -> AssetDetails -> ShowS
Show, AssetDetails -> AssetDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetDetails -> AssetDetails -> Bool
$c/= :: AssetDetails -> AssetDetails -> Bool
== :: AssetDetails -> AssetDetails -> Bool
$c== :: AssetDetails -> AssetDetails -> Bool
Eq, forall x. Rep AssetDetails x -> AssetDetails
forall x. AssetDetails -> Rep AssetDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssetDetails x -> AssetDetails
$cfrom :: forall x. AssetDetails -> Rep AssetDetails x
Generic)
deriving (Maybe AssetDetails
Value -> Parser [AssetDetails]
Value -> Parser AssetDetails
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
omittedField :: Maybe AssetDetails
$comittedField :: Maybe AssetDetails
parseJSONList :: Value -> Parser [AssetDetails]
$cparseJSONList :: Value -> Parser [AssetDetails]
parseJSON :: Value -> Parser AssetDetails
$cparseJSON :: Value -> Parser AssetDetails
FromJSON, [AssetDetails] -> Encoding
[AssetDetails] -> Value
AssetDetails -> Bool
AssetDetails -> Encoding
AssetDetails -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
omitField :: AssetDetails -> Bool
$comitField :: AssetDetails -> Bool
toEncodingList :: [AssetDetails] -> Encoding
$ctoEncodingList :: [AssetDetails] -> Encoding
toJSONList :: [AssetDetails] -> Value
$ctoJSONList :: [AssetDetails] -> Value
toEncoding :: AssetDetails -> Encoding
$ctoEncoding :: AssetDetails -> Encoding
toJSON :: AssetDetails -> Value
$ctoJSON :: AssetDetails -> Value
ToJSON)
via CustomJSON '[ FieldLabelModifier
'[ StripPrefix "_assetDetails"
, CamelToSnake
, Rename "onchain_metadata_value" "onchain_metadata"
]
] AssetDetails
parseStandardMetadata :: Maybe Value -> Maybe AssetOnChainMetadata
parseStandardMetadata :: Maybe Value -> Maybe AssetOnChainMetadata
parseStandardMetadata Maybe Value
mbValue = Maybe Value
mbValue forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall a b. (a -> Parser b) -> a -> Maybe b
parseMaybe forall a. FromJSON a => Value -> Parser a
parseJSON
parseStandardMetadataInDetails :: AssetDetails -> AssetDetails
parseStandardMetadataInDetails :: AssetDetails -> AssetDetails
parseStandardMetadataInDetails
details :: AssetDetails
details@AssetDetails{_assetDetailsOnchainMetadataValue :: AssetDetails -> Maybe Value
_assetDetailsOnchainMetadataValue = Maybe Value
mbValue} =
AssetDetails
details { _assetDetailsOnchainStandardMetadata :: Maybe AssetOnChainMetadata
_assetDetailsOnchainStandardMetadata = Maybe Value -> Maybe AssetOnChainMetadata
parseStandardMetadata Maybe Value
mbValue}
instance ToSample AssetDetails where
toSamples :: Proxy AssetDetails -> [(Text, AssetDetails)]
toSamples = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a. a -> [(Text, a)]
singleSample
AssetDetails
{ _assetDetailsAsset :: Text
_assetDetailsAsset = Text
"b0d07d45fe9514f80213f4020e5a61241458be626841cde717cb38a76e7574636f696e"
, _assetDetailsPolicyId :: PolicyId
_assetDetailsPolicyId = PolicyId
"b0d07d45fe9514f80213f4020e5a61241458be626841cde717cb38a7"
, _assetDetailsAssetName :: Maybe Text
_assetDetailsAssetName = forall (f :: * -> *) a. Applicative f => a -> f a
pure Text
"6e7574636f696e"
, _assetDetailsFingerprint :: Text
_assetDetailsFingerprint = Text
"asset1pkpwyknlvul7az0xx8czhl60pyel45rpje4z8w"
, _assetDetailsQuantity :: Quantity
_assetDetailsQuantity = Quantity
12000
, _assetDetailsInitialMintTxHash :: TxHash
_assetDetailsInitialMintTxHash = TxHash
"6804edf9712d2b619edb6ac86861fe93a730693183a262b165fcc1ba1bc99cad"
, _assetDetailsMintOrBurnCount :: Integer
_assetDetailsMintOrBurnCount = Integer
1
, _assetDetailsOnchainMetadataValue :: Maybe Value
_assetDetailsOnchainMetadataValue = forall a. a -> Maybe a
Just forall a b. (a -> b) -> a -> b
$
(
Object -> Value
Object
(forall v. [(Key, v)] -> KeyMap v
fromList
[ (Key
"id",Scientific -> Value
Number Scientific
630.0)
, (Key
"image",Text -> Value
String Text
"ipfs://ipfs/QmfKyJ4tuvHowwKQCbCHj4L5T3fSj8cjs7Aau8V7BWv226")
, (Key
"mediaType",Text -> Value
String Text
"image/png")
, (Key
"name",Text -> Value
String Text
"My NFT token")
, (Key
"files", Array -> Value
Array
( forall a. a -> Vector a
V.singleton
(Object -> Value
Object
(forall v. [(Key, v)] -> KeyMap v
fromList
[ (Key
"name", Text -> Value
String Text
"Detailed image")
, (Key
"mediaType", Text -> Value
String Text
"image/png")
, (Key
"src", Text -> Value
String Text
"ipfs://ipfs/QmfKyJ4tuvHowwKQCbCHj4L5T3fSj8cjs7Aau8V7BWv226")
]
)
)
)
)
]
)
)
, _assetDetailsOnchainStandardMetadata :: Maybe AssetOnChainMetadata
_assetDetailsOnchainStandardMetadata = forall (f :: * -> *) a. Applicative f => a -> f a
pure AssetOnChainMetadata
sampleAssetOnChainMetadata
, _assetDetailsMetadata :: Maybe AssetMetadata
_assetDetailsMetadata = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$
AssetMetadata
{ _assetMetadataName :: Text
_assetMetadataName = Text
"nutcoin"
, _assetMetadataDescription :: Text
_assetMetadataDescription = Text
"The Nut Coin"
, _assetMetadataTicker :: Maybe Text
_assetMetadataTicker = forall (f :: * -> *) a. Applicative f => a -> f a
pure Text
"nutc"
, _assetMetadataUrl :: Maybe Text
_assetMetadataUrl = forall (f :: * -> *) a. Applicative f => a -> f a
pure Text
"https://www.stakenuts.com/"
, _assetMetadataLogo :: Maybe Text
_assetMetadataLogo = forall (f :: * -> *) a. Applicative f => a -> f a
pure Text
"iVBORw0KGgoAAAANSUhEUgAAADAAAAAoCAYAAAC4h3lxAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUUH5QITCDUPjqwFHwAAB9xJREFUWMPVWXtsU9cZ/8499/r6dZ3E9rUdO7ZDEgglFWO8KaOsJW0pCLRKrN1AqqYVkqoqrYo0ja7bpElru1WairStFKY9WzaE1E1tx+jokKqwtqFNyhKahEJJyJNgJ37E9r1+3HvO/sFR4vhx7SBtfH/F3/l93/f7ne/4PBxEKYU72dj/ZfH772v1TU+HtqbTaX8wOO01GPQpRVH7JEm+vGHDuq6z7/8jUSoHKtaBKkEUFUXdajDy1hUrmrs6zn/wWS7m7pZVjMUirKGUTnzc+e9xLcTrPPVfZzDz06Sc2lyQGEIyAPzT7Xa+dvE/3e+XLaCxoflHsVj8MAAYs74aa/WHoenwvpkZKeFy2Z5NJlOPUkqXZccFwSSrKjlyffjL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r6oDd5l6jN/A/TqfSuwEAGITGMIsvGo3GTwTB3Dc2NjGSxdZYq4VIOOoNBANnKE0XPXE3brjHOTQ08k2MmVZOxzVJCbkFIQSCYEphzPaFQuGzTpfjb319PZ8UFXin/5OvrHPg/9HueAH/BSUqOuNZm4fyAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIxLTAyLTE5VDA4OjUyOjI1KzAwOjAwCmFGlgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0wMi0xOVQwODo1MjoyMyswMDowMBjsyxAAAAAASUVORK5CYII="
, _assetMetadataDecimals :: Maybe Int
_assetMetadataDecimals = forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
6
}
, _assetDetailsOnchainMetadataExtra :: Maybe Text
_assetDetailsOnchainMetadataExtra = forall a. a -> Maybe a
Just Text
"9f01582430303030303030302d303030302d303030302d303030302d3030303030303030303132334d47616d65585f4578616d706c65020203454c6576656c413145506f7765724231304553706565644131ff"
}
data AssetAction = Minted | Burned
deriving stock (Int -> AssetAction -> ShowS
[AssetAction] -> ShowS
AssetAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetAction] -> ShowS
$cshowList :: [AssetAction] -> ShowS
show :: AssetAction -> String
$cshow :: AssetAction -> String
showsPrec :: Int -> AssetAction -> ShowS
$cshowsPrec :: Int -> AssetAction -> ShowS
Show, AssetAction -> AssetAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetAction -> AssetAction -> Bool
$c/= :: AssetAction -> AssetAction -> Bool
== :: AssetAction -> AssetAction -> Bool
$c== :: AssetAction -> AssetAction -> Bool
Eq, forall x. Rep AssetAction x -> AssetAction
forall x. AssetAction -> Rep AssetAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssetAction x -> AssetAction
$cfrom :: forall x. AssetAction -> Rep AssetAction x
Generic)
deriving (Maybe AssetAction
Value -> Parser [AssetAction]
Value -> Parser AssetAction
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
omittedField :: Maybe AssetAction
$comittedField :: Maybe AssetAction
parseJSONList :: Value -> Parser [AssetAction]
$cparseJSONList :: Value -> Parser [AssetAction]
parseJSON :: Value -> Parser AssetAction
$cparseJSON :: Value -> Parser AssetAction
FromJSON, [AssetAction] -> Encoding
[AssetAction] -> Value
AssetAction -> Bool
AssetAction -> Encoding
AssetAction -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
omitField :: AssetAction -> Bool
$comitField :: AssetAction -> Bool
toEncodingList :: [AssetAction] -> Encoding
$ctoEncodingList :: [AssetAction] -> Encoding
toJSONList :: [AssetAction] -> Value
$ctoJSONList :: [AssetAction] -> Value
toEncoding :: AssetAction -> Encoding
$ctoEncoding :: AssetAction -> Encoding
toJSON :: AssetAction -> Value
$ctoJSON :: AssetAction -> Value
ToJSON)
via CustomJSON '[ConstructorTagModifier '[ToLower]] AssetAction
instance ToSample AssetAction where
toSamples :: Proxy AssetAction -> [(Text, AssetAction)]
toSamples = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a. [a] -> [(Text, a)]
samples [ AssetAction
Minted, AssetAction
Burned ]
data AssetHistory = AssetHistory
{ AssetHistory -> TxHash
_assetHistoryTxHash :: TxHash
, AssetHistory -> Quantity
_assetHistoryAmount :: Quantity
, AssetHistory -> AssetAction
_assetHistoryAction :: AssetAction
} deriving stock (Int -> AssetHistory -> ShowS
[AssetHistory] -> ShowS
AssetHistory -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetHistory] -> ShowS
$cshowList :: [AssetHistory] -> ShowS
show :: AssetHistory -> String
$cshow :: AssetHistory -> String
showsPrec :: Int -> AssetHistory -> ShowS
$cshowsPrec :: Int -> AssetHistory -> ShowS
Show, AssetHistory -> AssetHistory -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetHistory -> AssetHistory -> Bool
$c/= :: AssetHistory -> AssetHistory -> Bool
== :: AssetHistory -> AssetHistory -> Bool
$c== :: AssetHistory -> AssetHistory -> Bool
Eq, forall x. Rep AssetHistory x -> AssetHistory
forall x. AssetHistory -> Rep AssetHistory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssetHistory x -> AssetHistory
$cfrom :: forall x. AssetHistory -> Rep AssetHistory x
Generic)
deriving (Maybe AssetHistory
Value -> Parser [AssetHistory]
Value -> Parser AssetHistory
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
omittedField :: Maybe AssetHistory
$comittedField :: Maybe AssetHistory
parseJSONList :: Value -> Parser [AssetHistory]
$cparseJSONList :: Value -> Parser [AssetHistory]
parseJSON :: Value -> Parser AssetHistory
$cparseJSON :: Value -> Parser AssetHistory
FromJSON, [AssetHistory] -> Encoding
[AssetHistory] -> Value
AssetHistory -> Bool
AssetHistory -> Encoding
AssetHistory -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
omitField :: AssetHistory -> Bool
$comitField :: AssetHistory -> Bool
toEncodingList :: [AssetHistory] -> Encoding
$ctoEncodingList :: [AssetHistory] -> Encoding
toJSONList :: [AssetHistory] -> Value
$ctoJSONList :: [AssetHistory] -> Value
toEncoding :: AssetHistory -> Encoding
$ctoEncoding :: AssetHistory -> Encoding
toJSON :: AssetHistory -> Value
$ctoJSON :: AssetHistory -> Value
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_assetHistory", CamelToSnake]] AssetHistory
instance ToSample AssetHistory where
toSamples :: Proxy AssetHistory -> [(Text, AssetHistory)]
toSamples = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a. [a] -> [(Text, a)]
samples
[ AssetHistory
{ _assetHistoryTxHash :: TxHash
_assetHistoryTxHash = TxHash
"2dd15e0ef6e6a17841cb9541c27724072ce4d4b79b91e58432fbaa32d9572531"
, _assetHistoryAmount :: Quantity
_assetHistoryAmount = Quantity
10
, _assetHistoryAction :: AssetAction
_assetHistoryAction = AssetAction
Minted
}
, AssetHistory
{ _assetHistoryTxHash :: TxHash
_assetHistoryTxHash = TxHash
"9c190bc1ac88b2ab0c05a82d7de8b71b67a9316377e865748a89d4426c0d3005"
, _assetHistoryAmount :: Quantity
_assetHistoryAmount = Quantity
5
, _assetHistoryAction :: AssetAction
_assetHistoryAction = AssetAction
Burned
}
, AssetHistory
{ _assetHistoryTxHash :: TxHash
_assetHistoryTxHash = TxHash
"1a0570af966fb355a7160e4f82d5a80b8681b7955f5d44bec0dde628516157f0"
, _assetHistoryAmount :: Quantity
_assetHistoryAmount = Quantity
5
, _assetHistoryAction :: AssetAction
_assetHistoryAction = AssetAction
Burned
}
]
data AssetTransaction = AssetTransaction
{ AssetTransaction -> TxHash
_assetTransactionTxHash :: TxHash
, AssetTransaction -> Integer
_assetTransactionTxIndex :: Integer
, AssetTransaction -> Integer
_assetTransactionBlockHeight :: Integer
, AssetTransaction -> POSIXTime
_assetTransactionBlockTime :: POSIXTime
}
deriving stock (Int -> AssetTransaction -> ShowS
[AssetTransaction] -> ShowS
AssetTransaction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetTransaction] -> ShowS
$cshowList :: [AssetTransaction] -> ShowS
show :: AssetTransaction -> String
$cshow :: AssetTransaction -> String
showsPrec :: Int -> AssetTransaction -> ShowS
$cshowsPrec :: Int -> AssetTransaction -> ShowS
Show, AssetTransaction -> AssetTransaction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetTransaction -> AssetTransaction -> Bool
$c/= :: AssetTransaction -> AssetTransaction -> Bool
== :: AssetTransaction -> AssetTransaction -> Bool
$c== :: AssetTransaction -> AssetTransaction -> Bool
Eq, forall x. Rep AssetTransaction x -> AssetTransaction
forall x. AssetTransaction -> Rep AssetTransaction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssetTransaction x -> AssetTransaction
$cfrom :: forall x. AssetTransaction -> Rep AssetTransaction x
Generic)
deriving (Maybe AssetTransaction
Value -> Parser [AssetTransaction]
Value -> Parser AssetTransaction
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
omittedField :: Maybe AssetTransaction
$comittedField :: Maybe AssetTransaction
parseJSONList :: Value -> Parser [AssetTransaction]
$cparseJSONList :: Value -> Parser [AssetTransaction]
parseJSON :: Value -> Parser AssetTransaction
$cparseJSON :: Value -> Parser AssetTransaction
FromJSON, [AssetTransaction] -> Encoding
[AssetTransaction] -> Value
AssetTransaction -> Bool
AssetTransaction -> Encoding
AssetTransaction -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
omitField :: AssetTransaction -> Bool
$comitField :: AssetTransaction -> Bool
toEncodingList :: [AssetTransaction] -> Encoding
$ctoEncodingList :: [AssetTransaction] -> Encoding
toJSONList :: [AssetTransaction] -> Value
$ctoJSONList :: [AssetTransaction] -> Value
toEncoding :: AssetTransaction -> Encoding
$ctoEncoding :: AssetTransaction -> Encoding
toJSON :: AssetTransaction -> Value
$ctoJSON :: AssetTransaction -> Value
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_assetTransaction", CamelToSnake]] AssetTransaction
instance ToSample AssetTransaction where
toSamples :: Proxy AssetTransaction -> [(Text, AssetTransaction)]
toSamples = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a. [a] -> [(Text, a)]
samples
[ AssetTransaction
{ _assetTransactionTxHash :: TxHash
_assetTransactionTxHash = TxHash
"8788591983aa73981fc92d6cddbbe643959f5a784e84b8bee0db15823f575a5b"
, _assetTransactionTxIndex :: Integer
_assetTransactionTxIndex = Integer
6
, _assetTransactionBlockHeight :: Integer
_assetTransactionBlockHeight = Integer
69
, _assetTransactionBlockTime :: POSIXTime
_assetTransactionBlockTime = POSIXTime
1635505891
}
, AssetTransaction
{ _assetTransactionTxHash :: TxHash
_assetTransactionTxHash = TxHash
"52e748c4dec58b687b90b0b40d383b9fe1f24c1a833b7395cdf07dd67859f46f"
, _assetTransactionTxIndex :: Integer
_assetTransactionTxIndex = Integer
9
, _assetTransactionBlockHeight :: Integer
_assetTransactionBlockHeight = Integer
4547
, _assetTransactionBlockTime :: POSIXTime
_assetTransactionBlockTime = POSIXTime
1635505987
}
, AssetTransaction
{ _assetTransactionTxHash :: TxHash
_assetTransactionTxHash = TxHash
"e8073fd5318ff43eca18a852527166aa8008bee9ee9e891f585612b7e4ba700b"
, _assetTransactionTxIndex :: Integer
_assetTransactionTxIndex = Integer
0
, _assetTransactionBlockHeight :: Integer
_assetTransactionBlockHeight = Integer
564654
, _assetTransactionBlockTime :: POSIXTime
_assetTransactionBlockTime = POSIXTime
1834505492
}
]
data AssetAddress = AssetAddress
{ AssetAddress -> Address
_assetAddressAddress :: Address
, AssetAddress -> Quantity
_assetAddressQuantity :: Quantity
} deriving stock (Int -> AssetAddress -> ShowS
[AssetAddress] -> ShowS
AssetAddress -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetAddress] -> ShowS
$cshowList :: [AssetAddress] -> ShowS
show :: AssetAddress -> String
$cshow :: AssetAddress -> String
showsPrec :: Int -> AssetAddress -> ShowS
$cshowsPrec :: Int -> AssetAddress -> ShowS
Show, AssetAddress -> AssetAddress -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetAddress -> AssetAddress -> Bool
$c/= :: AssetAddress -> AssetAddress -> Bool
== :: AssetAddress -> AssetAddress -> Bool
$c== :: AssetAddress -> AssetAddress -> Bool
Eq, forall x. Rep AssetAddress x -> AssetAddress
forall x. AssetAddress -> Rep AssetAddress x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssetAddress x -> AssetAddress
$cfrom :: forall x. AssetAddress -> Rep AssetAddress x
Generic)
deriving (Maybe AssetAddress
Value -> Parser [AssetAddress]
Value -> Parser AssetAddress
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
omittedField :: Maybe AssetAddress
$comittedField :: Maybe AssetAddress
parseJSONList :: Value -> Parser [AssetAddress]
$cparseJSONList :: Value -> Parser [AssetAddress]
parseJSON :: Value -> Parser AssetAddress
$cparseJSON :: Value -> Parser AssetAddress
FromJSON, [AssetAddress] -> Encoding
[AssetAddress] -> Value
AssetAddress -> Bool
AssetAddress -> Encoding
AssetAddress -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
omitField :: AssetAddress -> Bool
$comitField :: AssetAddress -> Bool
toEncodingList :: [AssetAddress] -> Encoding
$ctoEncodingList :: [AssetAddress] -> Encoding
toJSONList :: [AssetAddress] -> Value
$ctoJSONList :: [AssetAddress] -> Value
toEncoding :: AssetAddress -> Encoding
$ctoEncoding :: AssetAddress -> Encoding
toJSON :: AssetAddress -> Value
$ctoJSON :: AssetAddress -> Value
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_assetAddress", CamelToSnake]] AssetAddress
instance ToSample AssetAddress where
toSamples :: Proxy AssetAddress -> [(Text, AssetAddress)]
toSamples = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a. [a] -> [(Text, a)]
samples
[ AssetAddress
{ _assetAddressAddress :: Address
_assetAddressAddress = Address
"addr1qxqs59lphg8g6qndelq8xwqn60ag3aeyfcp33c2kdp46a09re5df3pzwwmyq946axfcejy5n4x0y99wqpgtp2gd0k09qsgy6pz"
, _assetAddressQuantity :: Quantity
_assetAddressQuantity = Quantity
1
}
, AssetAddress
{ _assetAddressAddress :: Address
_assetAddressAddress = Address
"addr1qyhr4exrgavdcn3qhfcc9f939fzsch2re5ry9cwvcdyh4x4re5df3pzwwmyq946axfcejy5n4x0y99wqpgtp2gd0k09qdpvhza"
, _assetAddressQuantity :: Quantity
_assetAddressQuantity = Quantity
100000
}
, AssetAddress
{ _assetAddressAddress :: Address
_assetAddressAddress = Address
"addr1q8zup8m9ue3p98kxlxl9q8rnyan8hw3ul282tsl9s326dfj088lvedv4zckcj24arcpasr0gua4c5gq4zw2rpcpjk2lq8cmd9l"
, _assetAddressQuantity :: Quantity
_assetAddressQuantity = Quantity
18605647
}
]