module Blockfrost.Types.Cardano.Addresses
( AddressInfo (..)
, AddressType (..)
, AddressDetails (..)
, AddressUTXO (..)
, AddressTransaction (..)
) where
import Blockfrost.Types.Shared
import Deriving.Aeson
import qualified Money
import Servant.Docs (ToSample (..), samples, singleSample)
data AddressInfo = AddressInfo
{ AddressInfo -> Address
_addressInfoAddress :: Address
, AddressInfo -> [Amount]
_addressInfoAmount :: [Amount]
, AddressInfo -> Maybe Address
_addressInfoStakeAddress :: Maybe Address
, AddressInfo -> AddressType
_addressInfoType :: AddressType
} deriving stock (Int -> AddressInfo -> ShowS
[AddressInfo] -> ShowS
AddressInfo -> String
(Int -> AddressInfo -> ShowS)
-> (AddressInfo -> String)
-> ([AddressInfo] -> ShowS)
-> Show AddressInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddressInfo] -> ShowS
$cshowList :: [AddressInfo] -> ShowS
show :: AddressInfo -> String
$cshow :: AddressInfo -> String
showsPrec :: Int -> AddressInfo -> ShowS
$cshowsPrec :: Int -> AddressInfo -> ShowS
Show, AddressInfo -> AddressInfo -> Bool
(AddressInfo -> AddressInfo -> Bool)
-> (AddressInfo -> AddressInfo -> Bool) -> Eq AddressInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddressInfo -> AddressInfo -> Bool
$c/= :: AddressInfo -> AddressInfo -> Bool
== :: AddressInfo -> AddressInfo -> Bool
$c== :: AddressInfo -> AddressInfo -> Bool
Eq, (forall x. AddressInfo -> Rep AddressInfo x)
-> (forall x. Rep AddressInfo x -> AddressInfo)
-> Generic AddressInfo
forall x. Rep AddressInfo x -> AddressInfo
forall x. AddressInfo -> Rep AddressInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddressInfo x -> AddressInfo
$cfrom :: forall x. AddressInfo -> Rep AddressInfo x
Generic)
deriving (Value -> Parser [AddressInfo]
Value -> Parser AddressInfo
(Value -> Parser AddressInfo)
-> (Value -> Parser [AddressInfo]) -> FromJSON AddressInfo
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [AddressInfo]
$cparseJSONList :: Value -> Parser [AddressInfo]
parseJSON :: Value -> Parser AddressInfo
$cparseJSON :: Value -> Parser AddressInfo
FromJSON, [AddressInfo] -> Encoding
[AddressInfo] -> Value
AddressInfo -> Encoding
AddressInfo -> Value
(AddressInfo -> Value)
-> (AddressInfo -> Encoding)
-> ([AddressInfo] -> Value)
-> ([AddressInfo] -> Encoding)
-> ToJSON AddressInfo
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [AddressInfo] -> Encoding
$ctoEncodingList :: [AddressInfo] -> Encoding
toJSONList :: [AddressInfo] -> Value
$ctoJSONList :: [AddressInfo] -> Value
toEncoding :: AddressInfo -> Encoding
$ctoEncoding :: AddressInfo -> Encoding
toJSON :: AddressInfo -> Value
$ctoJSON :: AddressInfo -> Value
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_addressInfo", CamelToSnake]] AddressInfo
instance ToSample AddressInfo where
toSamples :: Proxy AddressInfo -> [(Text, AddressInfo)]
toSamples = [(Text, AddressInfo)] -> Proxy AddressInfo -> [(Text, AddressInfo)]
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([(Text, AddressInfo)]
-> Proxy AddressInfo -> [(Text, AddressInfo)])
-> [(Text, AddressInfo)]
-> Proxy AddressInfo
-> [(Text, AddressInfo)]
forall a b. (a -> b) -> a -> b
$ AddressInfo -> [(Text, AddressInfo)]
forall a. a -> [(Text, a)]
singleSample
AddressInfo :: Address -> [Amount] -> Maybe Address -> AddressType -> AddressInfo
AddressInfo
{ _addressInfoAddress :: Address
_addressInfoAddress = Address
"addr1qxqs59lphg8g6qndelq8xwqn60ag3aeyfcp33c2kdp46a09re5df3pzwwmyq946axfcejy5n4x0y99wqpgtp2gd0k09qsgy6pz"
, _addressInfoAmount :: [Amount]
_addressInfoAmount =
[ Lovelaces -> Amount
AdaAmount Lovelaces
42000000
, SomeDiscrete -> Amount
AssetAmount
(SomeDiscrete -> Amount) -> SomeDiscrete -> Amount
forall a b. (a -> b) -> a -> b
$ Text -> Scale -> Integer -> SomeDiscrete
Money.mkSomeDiscrete
Text
"b0d07d45fe9514f80213f4020e5a61241458be626841cde717cb38a76e7574636f696e"
Scale
unitScale
Integer
12
]
, _addressInfoStakeAddress :: Maybe Address
_addressInfoStakeAddress = Address -> Maybe Address
forall (f :: * -> *) a. Applicative f => a -> f a
pure Address
"stake1ux3g2c9dx2nhhehyrezyxpkstartcqmu9hk63qgfkccw5rqttygt7"
, _addressInfoType :: AddressType
_addressInfoType = AddressType
Shelley
}
data AddressType = Byron | Shelley
deriving stock (Int -> AddressType -> ShowS
[AddressType] -> ShowS
AddressType -> String
(Int -> AddressType -> ShowS)
-> (AddressType -> String)
-> ([AddressType] -> ShowS)
-> Show AddressType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddressType] -> ShowS
$cshowList :: [AddressType] -> ShowS
show :: AddressType -> String
$cshow :: AddressType -> String
showsPrec :: Int -> AddressType -> ShowS
$cshowsPrec :: Int -> AddressType -> ShowS
Show, AddressType -> AddressType -> Bool
(AddressType -> AddressType -> Bool)
-> (AddressType -> AddressType -> Bool) -> Eq AddressType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddressType -> AddressType -> Bool
$c/= :: AddressType -> AddressType -> Bool
== :: AddressType -> AddressType -> Bool
$c== :: AddressType -> AddressType -> Bool
Eq, (forall x. AddressType -> Rep AddressType x)
-> (forall x. Rep AddressType x -> AddressType)
-> Generic AddressType
forall x. Rep AddressType x -> AddressType
forall x. AddressType -> Rep AddressType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddressType x -> AddressType
$cfrom :: forall x. AddressType -> Rep AddressType x
Generic)
deriving (Value -> Parser [AddressType]
Value -> Parser AddressType
(Value -> Parser AddressType)
-> (Value -> Parser [AddressType]) -> FromJSON AddressType
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [AddressType]
$cparseJSONList :: Value -> Parser [AddressType]
parseJSON :: Value -> Parser AddressType
$cparseJSON :: Value -> Parser AddressType
FromJSON, [AddressType] -> Encoding
[AddressType] -> Value
AddressType -> Encoding
AddressType -> Value
(AddressType -> Value)
-> (AddressType -> Encoding)
-> ([AddressType] -> Value)
-> ([AddressType] -> Encoding)
-> ToJSON AddressType
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [AddressType] -> Encoding
$ctoEncodingList :: [AddressType] -> Encoding
toJSONList :: [AddressType] -> Value
$ctoJSONList :: [AddressType] -> Value
toEncoding :: AddressType -> Encoding
$ctoEncoding :: AddressType -> Encoding
toJSON :: AddressType -> Value
$ctoJSON :: AddressType -> Value
ToJSON)
via CustomJSON '[ConstructorTagModifier '[ToLower]] AddressType
instance ToSample AddressType where
toSamples :: Proxy AddressType -> [(Text, AddressType)]
toSamples = [(Text, AddressType)] -> Proxy AddressType -> [(Text, AddressType)]
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([(Text, AddressType)]
-> Proxy AddressType -> [(Text, AddressType)])
-> [(Text, AddressType)]
-> Proxy AddressType
-> [(Text, AddressType)]
forall a b. (a -> b) -> a -> b
$ [AddressType] -> [(Text, AddressType)]
forall a. [a] -> [(Text, a)]
samples [ AddressType
Byron, AddressType
Shelley ]
data AddressDetails = AddressDetails
{ AddressDetails -> Address
_addressDetailsAddress :: Address
, AddressDetails -> [Amount]
_addressDetailsReceivedSum :: [Amount]
, AddressDetails -> [Amount]
_addressDetailsSentSum :: [Amount]
, AddressDetails -> Integer
_addressDetailsTxCount :: Integer
} deriving stock (Int -> AddressDetails -> ShowS
[AddressDetails] -> ShowS
AddressDetails -> String
(Int -> AddressDetails -> ShowS)
-> (AddressDetails -> String)
-> ([AddressDetails] -> ShowS)
-> Show AddressDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddressDetails] -> ShowS
$cshowList :: [AddressDetails] -> ShowS
show :: AddressDetails -> String
$cshow :: AddressDetails -> String
showsPrec :: Int -> AddressDetails -> ShowS
$cshowsPrec :: Int -> AddressDetails -> ShowS
Show, AddressDetails -> AddressDetails -> Bool
(AddressDetails -> AddressDetails -> Bool)
-> (AddressDetails -> AddressDetails -> Bool) -> Eq AddressDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddressDetails -> AddressDetails -> Bool
$c/= :: AddressDetails -> AddressDetails -> Bool
== :: AddressDetails -> AddressDetails -> Bool
$c== :: AddressDetails -> AddressDetails -> Bool
Eq, (forall x. AddressDetails -> Rep AddressDetails x)
-> (forall x. Rep AddressDetails x -> AddressDetails)
-> Generic AddressDetails
forall x. Rep AddressDetails x -> AddressDetails
forall x. AddressDetails -> Rep AddressDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddressDetails x -> AddressDetails
$cfrom :: forall x. AddressDetails -> Rep AddressDetails x
Generic)
deriving (Value -> Parser [AddressDetails]
Value -> Parser AddressDetails
(Value -> Parser AddressDetails)
-> (Value -> Parser [AddressDetails]) -> FromJSON AddressDetails
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [AddressDetails]
$cparseJSONList :: Value -> Parser [AddressDetails]
parseJSON :: Value -> Parser AddressDetails
$cparseJSON :: Value -> Parser AddressDetails
FromJSON, [AddressDetails] -> Encoding
[AddressDetails] -> Value
AddressDetails -> Encoding
AddressDetails -> Value
(AddressDetails -> Value)
-> (AddressDetails -> Encoding)
-> ([AddressDetails] -> Value)
-> ([AddressDetails] -> Encoding)
-> ToJSON AddressDetails
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [AddressDetails] -> Encoding
$ctoEncodingList :: [AddressDetails] -> Encoding
toJSONList :: [AddressDetails] -> Value
$ctoJSONList :: [AddressDetails] -> Value
toEncoding :: AddressDetails -> Encoding
$ctoEncoding :: AddressDetails -> Encoding
toJSON :: AddressDetails -> Value
$ctoJSON :: AddressDetails -> Value
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_addressDetails", CamelToSnake]] AddressDetails
instance ToSample AddressDetails where
toSamples :: Proxy AddressDetails -> [(Text, AddressDetails)]
toSamples = [(Text, AddressDetails)]
-> Proxy AddressDetails -> [(Text, AddressDetails)]
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([(Text, AddressDetails)]
-> Proxy AddressDetails -> [(Text, AddressDetails)])
-> [(Text, AddressDetails)]
-> Proxy AddressDetails
-> [(Text, AddressDetails)]
forall a b. (a -> b) -> a -> b
$ AddressDetails -> [(Text, AddressDetails)]
forall a. a -> [(Text, a)]
singleSample
AddressDetails :: Address -> [Amount] -> [Amount] -> Integer -> AddressDetails
AddressDetails
{ _addressDetailsAddress :: Address
_addressDetailsAddress = Address
"addr1qxqs59lphg8g6qndelq8xwqn60ag3aeyfcp33c2kdp46a09re5df3pzwwmyq946axfcejy5n4x0y99wqpgtp2gd0k09qsgy6pz"
, _addressDetailsReceivedSum :: [Amount]
_addressDetailsReceivedSum = [Amount]
amounts
, _addressDetailsSentSum :: [Amount]
_addressDetailsSentSum = [Amount]
amounts
, _addressDetailsTxCount :: Integer
_addressDetailsTxCount = Integer
12
}
where amounts :: [Amount]
amounts =
[ Lovelaces -> Amount
AdaAmount Lovelaces
42000000
, SomeDiscrete -> Amount
AssetAmount
(SomeDiscrete -> Amount) -> SomeDiscrete -> Amount
forall a b. (a -> b) -> a -> b
$ Text -> Scale -> Integer -> SomeDiscrete
Money.mkSomeDiscrete
Text
"b0d07d45fe9514f80213f4020e5a61241458be626841cde717cb38a76e7574636f696e"
Scale
unitScale
Integer
12
]
data AddressUTXO = AddressUTXO
{ AddressUTXO -> TxHash
_addressUTXOTxHash :: TxHash
, AddressUTXO -> Integer
_addressUTXOOutputIndex :: Integer
, AddressUTXO -> [Amount]
_addressUTXOAmount :: [Amount]
, AddressUTXO -> BlockHash
_addressUTXOBlock :: BlockHash
} deriving stock (Int -> AddressUTXO -> ShowS
[AddressUTXO] -> ShowS
AddressUTXO -> String
(Int -> AddressUTXO -> ShowS)
-> (AddressUTXO -> String)
-> ([AddressUTXO] -> ShowS)
-> Show AddressUTXO
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddressUTXO] -> ShowS
$cshowList :: [AddressUTXO] -> ShowS
show :: AddressUTXO -> String
$cshow :: AddressUTXO -> String
showsPrec :: Int -> AddressUTXO -> ShowS
$cshowsPrec :: Int -> AddressUTXO -> ShowS
Show, AddressUTXO -> AddressUTXO -> Bool
(AddressUTXO -> AddressUTXO -> Bool)
-> (AddressUTXO -> AddressUTXO -> Bool) -> Eq AddressUTXO
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddressUTXO -> AddressUTXO -> Bool
$c/= :: AddressUTXO -> AddressUTXO -> Bool
== :: AddressUTXO -> AddressUTXO -> Bool
$c== :: AddressUTXO -> AddressUTXO -> Bool
Eq, (forall x. AddressUTXO -> Rep AddressUTXO x)
-> (forall x. Rep AddressUTXO x -> AddressUTXO)
-> Generic AddressUTXO
forall x. Rep AddressUTXO x -> AddressUTXO
forall x. AddressUTXO -> Rep AddressUTXO x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddressUTXO x -> AddressUTXO
$cfrom :: forall x. AddressUTXO -> Rep AddressUTXO x
Generic)
deriving (Value -> Parser [AddressUTXO]
Value -> Parser AddressUTXO
(Value -> Parser AddressUTXO)
-> (Value -> Parser [AddressUTXO]) -> FromJSON AddressUTXO
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [AddressUTXO]
$cparseJSONList :: Value -> Parser [AddressUTXO]
parseJSON :: Value -> Parser AddressUTXO
$cparseJSON :: Value -> Parser AddressUTXO
FromJSON, [AddressUTXO] -> Encoding
[AddressUTXO] -> Value
AddressUTXO -> Encoding
AddressUTXO -> Value
(AddressUTXO -> Value)
-> (AddressUTXO -> Encoding)
-> ([AddressUTXO] -> Value)
-> ([AddressUTXO] -> Encoding)
-> ToJSON AddressUTXO
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [AddressUTXO] -> Encoding
$ctoEncodingList :: [AddressUTXO] -> Encoding
toJSONList :: [AddressUTXO] -> Value
$ctoJSONList :: [AddressUTXO] -> Value
toEncoding :: AddressUTXO -> Encoding
$ctoEncoding :: AddressUTXO -> Encoding
toJSON :: AddressUTXO -> Value
$ctoJSON :: AddressUTXO -> Value
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_addressUTXO", CamelToSnake]] AddressUTXO
instance ToSample AddressUTXO where
toSamples :: Proxy AddressUTXO -> [(Text, AddressUTXO)]
toSamples = [(Text, AddressUTXO)] -> Proxy AddressUTXO -> [(Text, AddressUTXO)]
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([(Text, AddressUTXO)]
-> Proxy AddressUTXO -> [(Text, AddressUTXO)])
-> [(Text, AddressUTXO)]
-> Proxy AddressUTXO
-> [(Text, AddressUTXO)]
forall a b. (a -> b) -> a -> b
$ [AddressUTXO] -> [(Text, AddressUTXO)]
forall a. [a] -> [(Text, a)]
samples
[ AddressUTXO :: TxHash -> Integer -> [Amount] -> BlockHash -> AddressUTXO
AddressUTXO
{ _addressUTXOTxHash :: TxHash
_addressUTXOTxHash = TxHash
"39a7a284c2a0948189dc45dec670211cd4d72f7b66c5726c08d9b3df11e44d58"
, _addressUTXOOutputIndex :: Integer
_addressUTXOOutputIndex = Integer
0
, _addressUTXOAmount :: [Amount]
_addressUTXOAmount = [ Lovelaces -> Amount
AdaAmount Lovelaces
42000000 ]
, _addressUTXOBlock :: BlockHash
_addressUTXOBlock = BlockHash
"7eb8e27d18686c7db9a18f8bbcfe34e3fed6e047afaa2d969904d15e934847e6"
}
, AddressUTXO :: TxHash -> Integer -> [Amount] -> BlockHash -> AddressUTXO
AddressUTXO
{ _addressUTXOTxHash :: TxHash
_addressUTXOTxHash = TxHash
"4c4e67bafa15e742c13c592b65c8f74c769cd7d9af04c848099672d1ba391b49"
, _addressUTXOOutputIndex :: Integer
_addressUTXOOutputIndex = Integer
0
, _addressUTXOAmount :: [Amount]
_addressUTXOAmount = [ Lovelaces -> Amount
AdaAmount Lovelaces
729235000 ]
, _addressUTXOBlock :: BlockHash
_addressUTXOBlock = BlockHash
"953f1b80eb7c11a7ffcd67cbd4fde66e824a451aca5a4065725e5174b81685b7"
}
, AddressUTXO :: TxHash -> Integer -> [Amount] -> BlockHash -> AddressUTXO
AddressUTXO
{ _addressUTXOTxHash :: TxHash
_addressUTXOTxHash = TxHash
"768c63e27a1c816a83dc7b07e78af673b2400de8849ea7e7b734ae1333d100d2"
, _addressUTXOOutputIndex :: Integer
_addressUTXOOutputIndex = Integer
1
, _addressUTXOAmount :: [Amount]
_addressUTXOAmount =
[ Lovelaces -> Amount
AdaAmount Lovelaces
42000000
, SomeDiscrete -> Amount
AssetAmount
(SomeDiscrete -> Amount) -> SomeDiscrete -> Amount
forall a b. (a -> b) -> a -> b
$ Text -> Scale -> Integer -> SomeDiscrete
Money.mkSomeDiscrete
Text
"b0d07d45fe9514f80213f4020e5a61241458be626841cde717cb38a76e7574636f696e"
Scale
unitScale
Integer
12
]
, _addressUTXOBlock :: BlockHash
_addressUTXOBlock = BlockHash
"5c571f83fe6c784d3fbc223792627ccf0eea96773100f9aedecf8b1eda4544d7"
}
]
data AddressTransaction = AddressTransaction {
AddressTransaction -> TxHash
_addressTransactionTxHash :: TxHash
, AddressTransaction -> Integer
_addressTransactionTxIndex :: Integer
, AddressTransaction -> Integer
_addressTransactionBlockHeight :: Integer
} deriving stock (Int -> AddressTransaction -> ShowS
[AddressTransaction] -> ShowS
AddressTransaction -> String
(Int -> AddressTransaction -> ShowS)
-> (AddressTransaction -> String)
-> ([AddressTransaction] -> ShowS)
-> Show AddressTransaction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddressTransaction] -> ShowS
$cshowList :: [AddressTransaction] -> ShowS
show :: AddressTransaction -> String
$cshow :: AddressTransaction -> String
showsPrec :: Int -> AddressTransaction -> ShowS
$cshowsPrec :: Int -> AddressTransaction -> ShowS
Show, AddressTransaction -> AddressTransaction -> Bool
(AddressTransaction -> AddressTransaction -> Bool)
-> (AddressTransaction -> AddressTransaction -> Bool)
-> Eq AddressTransaction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddressTransaction -> AddressTransaction -> Bool
$c/= :: AddressTransaction -> AddressTransaction -> Bool
== :: AddressTransaction -> AddressTransaction -> Bool
$c== :: AddressTransaction -> AddressTransaction -> Bool
Eq, (forall x. AddressTransaction -> Rep AddressTransaction x)
-> (forall x. Rep AddressTransaction x -> AddressTransaction)
-> Generic AddressTransaction
forall x. Rep AddressTransaction x -> AddressTransaction
forall x. AddressTransaction -> Rep AddressTransaction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddressTransaction x -> AddressTransaction
$cfrom :: forall x. AddressTransaction -> Rep AddressTransaction x
Generic)
deriving (Value -> Parser [AddressTransaction]
Value -> Parser AddressTransaction
(Value -> Parser AddressTransaction)
-> (Value -> Parser [AddressTransaction])
-> FromJSON AddressTransaction
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [AddressTransaction]
$cparseJSONList :: Value -> Parser [AddressTransaction]
parseJSON :: Value -> Parser AddressTransaction
$cparseJSON :: Value -> Parser AddressTransaction
FromJSON, [AddressTransaction] -> Encoding
[AddressTransaction] -> Value
AddressTransaction -> Encoding
AddressTransaction -> Value
(AddressTransaction -> Value)
-> (AddressTransaction -> Encoding)
-> ([AddressTransaction] -> Value)
-> ([AddressTransaction] -> Encoding)
-> ToJSON AddressTransaction
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [AddressTransaction] -> Encoding
$ctoEncodingList :: [AddressTransaction] -> Encoding
toJSONList :: [AddressTransaction] -> Value
$ctoJSONList :: [AddressTransaction] -> Value
toEncoding :: AddressTransaction -> Encoding
$ctoEncoding :: AddressTransaction -> Encoding
toJSON :: AddressTransaction -> Value
$ctoJSON :: AddressTransaction -> Value
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_addressTransaction", CamelToSnake]] AddressTransaction
instance ToSample AddressTransaction where
toSamples :: Proxy AddressTransaction -> [(Text, AddressTransaction)]
toSamples = [(Text, AddressTransaction)]
-> Proxy AddressTransaction -> [(Text, AddressTransaction)]
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([(Text, AddressTransaction)]
-> Proxy AddressTransaction -> [(Text, AddressTransaction)])
-> [(Text, AddressTransaction)]
-> Proxy AddressTransaction
-> [(Text, AddressTransaction)]
forall a b. (a -> b) -> a -> b
$ [AddressTransaction] -> [(Text, AddressTransaction)]
forall a. [a] -> [(Text, a)]
samples
[ AddressTransaction :: TxHash -> Integer -> Integer -> AddressTransaction
AddressTransaction
{ _addressTransactionTxHash :: TxHash
_addressTransactionTxHash = TxHash
"8788591983aa73981fc92d6cddbbe643959f5a784e84b8bee0db15823f575a5b"
, _addressTransactionTxIndex :: Integer
_addressTransactionTxIndex = Integer
6
, _addressTransactionBlockHeight :: Integer
_addressTransactionBlockHeight = Integer
69
}
, AddressTransaction :: TxHash -> Integer -> Integer -> AddressTransaction
AddressTransaction
{ _addressTransactionTxHash :: TxHash
_addressTransactionTxHash = TxHash
"52e748c4dec58b687b90b0b40d383b9fe1f24c1a833b7395cdf07dd67859f46f"
, _addressTransactionTxIndex :: Integer
_addressTransactionTxIndex = Integer
9
, _addressTransactionBlockHeight :: Integer
_addressTransactionBlockHeight = Integer
4547
}
, AddressTransaction :: TxHash -> Integer -> Integer -> AddressTransaction
AddressTransaction
{ _addressTransactionTxHash :: TxHash
_addressTransactionTxHash = TxHash
"e8073fd5318ff43eca18a852527166aa8008bee9ee9e891f585612b7e4ba700b"
, _addressTransactionTxIndex :: Integer
_addressTransactionTxIndex = Integer
0
, _addressTransactionBlockHeight :: Integer
_addressTransactionBlockHeight = Integer
564654
}
]