module Blockfrost.Types.Cardano.Addresses
( AddressInfo (..)
, AddressInfoExtended (..)
, AddressType (..)
, AddressDetails (..)
, AddressUtxo (..)
, AddressTransaction (..)
) where
import Deriving.Aeson
import qualified Money
import Servant.Docs (ToSample (..), samples, singleSample)
import Blockfrost.Types.Cardano.Scripts (InlineDatum (..))
import Blockfrost.Types.Shared
data AddressInfo = AddressInfo
{ AddressInfo -> Address
_addressInfoAddress :: Address
, AddressInfo -> [Amount]
_addressInfoAmount :: [Amount]
, AddressInfo -> Maybe Address
_addressInfoStakeAddress :: Maybe Address
, AddressInfo -> AddressType
_addressInfoType :: AddressType
, AddressInfo -> Bool
_addressInfoScript :: Bool
} deriving stock (Int -> AddressInfo -> ShowS
[AddressInfo] -> ShowS
AddressInfo -> String
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
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. 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 (Maybe AddressInfo
Value -> Parser [AddressInfo]
Value -> Parser AddressInfo
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
omittedField :: Maybe AddressInfo
$comittedField :: Maybe AddressInfo
parseJSONList :: Value -> Parser [AddressInfo]
$cparseJSONList :: Value -> Parser [AddressInfo]
parseJSON :: Value -> Parser AddressInfo
$cparseJSON :: Value -> Parser AddressInfo
FromJSON, [AddressInfo] -> Encoding
[AddressInfo] -> Value
AddressInfo -> Bool
AddressInfo -> Encoding
AddressInfo -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
omitField :: AddressInfo -> Bool
$comitField :: AddressInfo -> Bool
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 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a. a -> [(Text, a)]
singleSample
AddressInfo
{ _addressInfoAddress :: Address
_addressInfoAddress = Address
"addr1qxqs59lphg8g6qndelq8xwqn60ag3aeyfcp33c2kdp46a09re5df3pzwwmyq946axfcejy5n4x0y99wqpgtp2gd0k09qsgy6pz"
, _addressInfoAmount :: [Amount]
_addressInfoAmount =
[ Lovelaces -> Amount
AdaAmount Discrete' "ADA" '(1000000, 1)
42000000
, SomeDiscrete -> Amount
AssetAmount
forall a b. (a -> b) -> a -> b
$ Text -> Scale -> Integer -> SomeDiscrete
Money.mkSomeDiscrete
Text
"b0d07d45fe9514f80213f4020e5a61241458be626841cde717cb38a76e7574636f696e"
Scale
unitScale
Integer
12
]
, _addressInfoStakeAddress :: Maybe Address
_addressInfoStakeAddress = forall (f :: * -> *) a. Applicative f => a -> f a
pure Address
"stake1ux3g2c9dx2nhhehyrezyxpkstartcqmu9hk63qgfkccw5rqttygt7"
, _addressInfoType :: AddressType
_addressInfoType = AddressType
Shelley
, _addressInfoScript :: Bool
_addressInfoScript = Bool
False
}
data AddressInfoExtended = AddressInfoExtended
{ AddressInfoExtended -> Address
_addressInfoExtendedAddress :: Address
, AddressInfoExtended -> [AmountExtended]
_addressInfoExtendedAmount :: [AmountExtended]
, AddressInfoExtended -> Maybe Address
_addressInfoExtendedStakeAddress :: Maybe Address
, AddressInfoExtended -> AddressType
_addressInfoExtendedType :: AddressType
, AddressInfoExtended -> Bool
_addressInfoExtendedScript :: Bool
} deriving stock (Int -> AddressInfoExtended -> ShowS
[AddressInfoExtended] -> ShowS
AddressInfoExtended -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddressInfoExtended] -> ShowS
$cshowList :: [AddressInfoExtended] -> ShowS
show :: AddressInfoExtended -> String
$cshow :: AddressInfoExtended -> String
showsPrec :: Int -> AddressInfoExtended -> ShowS
$cshowsPrec :: Int -> AddressInfoExtended -> ShowS
Show, AddressInfoExtended -> AddressInfoExtended -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddressInfoExtended -> AddressInfoExtended -> Bool
$c/= :: AddressInfoExtended -> AddressInfoExtended -> Bool
== :: AddressInfoExtended -> AddressInfoExtended -> Bool
$c== :: AddressInfoExtended -> AddressInfoExtended -> Bool
Eq, forall x. Rep AddressInfoExtended x -> AddressInfoExtended
forall x. AddressInfoExtended -> Rep AddressInfoExtended x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddressInfoExtended x -> AddressInfoExtended
$cfrom :: forall x. AddressInfoExtended -> Rep AddressInfoExtended x
Generic)
deriving (Maybe AddressInfoExtended
Value -> Parser [AddressInfoExtended]
Value -> Parser AddressInfoExtended
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
omittedField :: Maybe AddressInfoExtended
$comittedField :: Maybe AddressInfoExtended
parseJSONList :: Value -> Parser [AddressInfoExtended]
$cparseJSONList :: Value -> Parser [AddressInfoExtended]
parseJSON :: Value -> Parser AddressInfoExtended
$cparseJSON :: Value -> Parser AddressInfoExtended
FromJSON, [AddressInfoExtended] -> Encoding
[AddressInfoExtended] -> Value
AddressInfoExtended -> Bool
AddressInfoExtended -> Encoding
AddressInfoExtended -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
omitField :: AddressInfoExtended -> Bool
$comitField :: AddressInfoExtended -> Bool
toEncodingList :: [AddressInfoExtended] -> Encoding
$ctoEncodingList :: [AddressInfoExtended] -> Encoding
toJSONList :: [AddressInfoExtended] -> Value
$ctoJSONList :: [AddressInfoExtended] -> Value
toEncoding :: AddressInfoExtended -> Encoding
$ctoEncoding :: AddressInfoExtended -> Encoding
toJSON :: AddressInfoExtended -> Value
$ctoJSON :: AddressInfoExtended -> Value
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_addressInfoExtended", CamelToSnake]] AddressInfoExtended
instance ToSample AddressInfoExtended where
toSamples :: Proxy AddressInfoExtended -> [(Text, AddressInfoExtended)]
toSamples = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a. a -> [(Text, a)]
singleSample
AddressInfoExtended
{ _addressInfoExtendedAddress :: Address
_addressInfoExtendedAddress = Address
"addr1qxqs59lphg8g6qndelq8xwqn60ag3aeyfcp33c2kdp46a09re5df3pzwwmyq946axfcejy5n4x0y99wqpgtp2gd0k09qsgy6pz"
, _addressInfoExtendedAmount :: [AmountExtended]
_addressInfoExtendedAmount =
[ Lovelaces -> AmountExtended
AdaAmountExtended Discrete' "ADA" '(1000000, 1)
42000000
, AssetAmountExtended
{ assetAmountExtendedDecimals :: Maybe Int
assetAmountExtendedDecimals = forall a. Maybe a
Nothing
, assetAmountExtendedHasNftOnchainMetadata :: Bool
assetAmountExtendedHasNftOnchainMetadata = Bool
True
, assetAmountExtendedValue :: SomeDiscrete
assetAmountExtendedValue =
forall (currency :: Symbol) (scale :: (Natural, Natural)).
(KnownSymbol currency, GoodScale scale) =>
Discrete' currency scale -> SomeDiscrete
Money.toSomeDiscrete
(Discrete'
"b0d07d45fe9514f80213f4020e5a61241458be626841cde717cb38a76e7574636f696e"
'(1, 1)
12 :: Money.Discrete'
"b0d07d45fe9514f80213f4020e5a61241458be626841cde717cb38a76e7574636f696e"
'(1,1))
}
]
, _addressInfoExtendedStakeAddress :: Maybe Address
_addressInfoExtendedStakeAddress = forall (f :: * -> *) a. Applicative f => a -> f a
pure Address
"stake1ux3g2c9dx2nhhehyrezyxpkstartcqmu9hk63qgfkccw5rqttygt7"
, _addressInfoExtendedType :: AddressType
_addressInfoExtendedType = AddressType
Shelley
, _addressInfoExtendedScript :: Bool
_addressInfoExtendedScript = Bool
False
}
data AddressType = Byron | Shelley
deriving stock (Int -> AddressType -> ShowS
[AddressType] -> ShowS
AddressType -> String
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
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. 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 (Maybe AddressType
Value -> Parser [AddressType]
Value -> Parser AddressType
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
omittedField :: Maybe AddressType
$comittedField :: Maybe AddressType
parseJSONList :: Value -> Parser [AddressType]
$cparseJSONList :: Value -> Parser [AddressType]
parseJSON :: Value -> Parser AddressType
$cparseJSON :: Value -> Parser AddressType
FromJSON, [AddressType] -> Encoding
[AddressType] -> Value
AddressType -> Bool
AddressType -> Encoding
AddressType -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
omitField :: AddressType -> Bool
$comitField :: AddressType -> Bool
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 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ 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
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
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. 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 (Maybe AddressDetails
Value -> Parser [AddressDetails]
Value -> Parser AddressDetails
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
omittedField :: Maybe AddressDetails
$comittedField :: Maybe AddressDetails
parseJSONList :: Value -> Parser [AddressDetails]
$cparseJSONList :: Value -> Parser [AddressDetails]
parseJSON :: Value -> Parser AddressDetails
$cparseJSON :: Value -> Parser AddressDetails
FromJSON, [AddressDetails] -> Encoding
[AddressDetails] -> Value
AddressDetails -> Bool
AddressDetails -> Encoding
AddressDetails -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
omitField :: AddressDetails -> Bool
$comitField :: AddressDetails -> Bool
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 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a. a -> [(Text, a)]
singleSample
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 Discrete' "ADA" '(1000000, 1)
42000000
, SomeDiscrete -> Amount
AssetAmount
forall a b. (a -> b) -> a -> b
$ Text -> Scale -> Integer -> SomeDiscrete
Money.mkSomeDiscrete
Text
"b0d07d45fe9514f80213f4020e5a61241458be626841cde717cb38a76e7574636f696e"
Scale
unitScale
Integer
12
]
data AddressUtxo = AddressUtxo
{ AddressUtxo -> Address
_addressUtxoAddress :: Address
, AddressUtxo -> TxHash
_addressUtxoTxHash :: TxHash
, AddressUtxo -> Integer
_addressUtxoOutputIndex :: Integer
, AddressUtxo -> [Amount]
_addressUtxoAmount :: [Amount]
, AddressUtxo -> BlockHash
_addressUtxoBlock :: BlockHash
, AddressUtxo -> Maybe DatumHash
_addressUtxoDataHash :: Maybe DatumHash
, AddressUtxo -> Maybe InlineDatum
_addressUtxoInlineDatum :: Maybe InlineDatum
, AddressUtxo -> Maybe ScriptHash
_addressUtxoReferenceScriptHash :: Maybe ScriptHash
} deriving stock (Int -> AddressUtxo -> ShowS
[AddressUtxo] -> ShowS
AddressUtxo -> String
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
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. 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 (Maybe AddressUtxo
Value -> Parser [AddressUtxo]
Value -> Parser AddressUtxo
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
omittedField :: Maybe AddressUtxo
$comittedField :: Maybe AddressUtxo
parseJSONList :: Value -> Parser [AddressUtxo]
$cparseJSONList :: Value -> Parser [AddressUtxo]
parseJSON :: Value -> Parser AddressUtxo
$cparseJSON :: Value -> Parser AddressUtxo
FromJSON, [AddressUtxo] -> Encoding
[AddressUtxo] -> Value
AddressUtxo -> Bool
AddressUtxo -> Encoding
AddressUtxo -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
omitField :: AddressUtxo -> Bool
$comitField :: AddressUtxo -> Bool
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 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a. [a] -> [(Text, a)]
samples
[ AddressUtxo
{ _addressUtxoAddress :: Address
_addressUtxoAddress = Address
"addr1qxqs59lphg8g6qndelq8xwqn60ag3aeyfcp33c2kdp46a09re5df3pzwwmyq946axfcejy5n4x0y99wqpgtp2gd0k09qsgy6pz"
, _addressUtxoTxHash :: TxHash
_addressUtxoTxHash = TxHash
"39a7a284c2a0948189dc45dec670211cd4d72f7b66c5726c08d9b3df11e44d58"
, _addressUtxoOutputIndex :: Integer
_addressUtxoOutputIndex = Integer
0
, _addressUtxoAmount :: [Amount]
_addressUtxoAmount = [ Lovelaces -> Amount
AdaAmount Discrete' "ADA" '(1000000, 1)
42000000 ]
, _addressUtxoBlock :: BlockHash
_addressUtxoBlock = BlockHash
"7eb8e27d18686c7db9a18f8bbcfe34e3fed6e047afaa2d969904d15e934847e6"
, _addressUtxoDataHash :: Maybe DatumHash
_addressUtxoDataHash = forall a. a -> Maybe a
Just DatumHash
"9e478573ab81ea7a8e31891ce0648b81229f408d596a3483e6f4f9b92d3cf710"
, _addressUtxoInlineDatum :: Maybe InlineDatum
_addressUtxoInlineDatum = forall a. Maybe a
Nothing
, _addressUtxoReferenceScriptHash :: Maybe ScriptHash
_addressUtxoReferenceScriptHash = forall a. Maybe a
Nothing
}
, AddressUtxo
{ _addressUtxoAddress :: Address
_addressUtxoAddress = Address
"addr1qxqs59lphg8g6qndelq8xwqn60ag3aeyfcp33c2kdp46a09re5df3pzwwmyq946axfcejy5n4x0y99wqpgtp2gd0k09qsgy6pz"
, _addressUtxoTxHash :: TxHash
_addressUtxoTxHash = TxHash
"4c4e67bafa15e742c13c592b65c8f74c769cd7d9af04c848099672d1ba391b49"
, _addressUtxoOutputIndex :: Integer
_addressUtxoOutputIndex = Integer
0
, _addressUtxoAmount :: [Amount]
_addressUtxoAmount = [ Lovelaces -> Amount
AdaAmount Discrete' "ADA" '(1000000, 1)
729235000 ]
, _addressUtxoBlock :: BlockHash
_addressUtxoBlock = BlockHash
"953f1b80eb7c11a7ffcd67cbd4fde66e824a451aca5a4065725e5174b81685b7"
, _addressUtxoDataHash :: Maybe DatumHash
_addressUtxoDataHash = forall a. Maybe a
Nothing
, _addressUtxoInlineDatum :: Maybe InlineDatum
_addressUtxoInlineDatum = forall a. Maybe a
Nothing
, _addressUtxoReferenceScriptHash :: Maybe ScriptHash
_addressUtxoReferenceScriptHash = forall a. Maybe a
Nothing
}
, AddressUtxo
{ _addressUtxoAddress :: Address
_addressUtxoAddress = Address
"addr1qxqs59lphg8g6qndelq8xwqn60ag3aeyfcp33c2kdp46a09re5df3pzwwmyq946axfcejy5n4x0y99wqpgtp2gd0k09qsgy6pz"
, _addressUtxoTxHash :: TxHash
_addressUtxoTxHash = TxHash
"768c63e27a1c816a83dc7b07e78af673b2400de8849ea7e7b734ae1333d100d2"
, _addressUtxoOutputIndex :: Integer
_addressUtxoOutputIndex = Integer
1
, _addressUtxoAmount :: [Amount]
_addressUtxoAmount =
[ Lovelaces -> Amount
AdaAmount Discrete' "ADA" '(1000000, 1)
42000000
, SomeDiscrete -> Amount
AssetAmount
forall a b. (a -> b) -> a -> b
$ Text -> Scale -> Integer -> SomeDiscrete
Money.mkSomeDiscrete
Text
"b0d07d45fe9514f80213f4020e5a61241458be626841cde717cb38a76e7574636f696e"
Scale
unitScale
Integer
12
]
, _addressUtxoBlock :: BlockHash
_addressUtxoBlock = BlockHash
"5c571f83fe6c784d3fbc223792627ccf0eea96773100f9aedecf8b1eda4544d7"
, _addressUtxoDataHash :: Maybe DatumHash
_addressUtxoDataHash = forall a. Maybe a
Nothing
, _addressUtxoInlineDatum :: Maybe InlineDatum
_addressUtxoInlineDatum = forall a. Maybe a
Nothing
, _addressUtxoReferenceScriptHash :: Maybe ScriptHash
_addressUtxoReferenceScriptHash = forall a. Maybe a
Nothing
}
]
data AddressTransaction = AddressTransaction {
AddressTransaction -> TxHash
_addressTransactionTxHash :: TxHash
, AddressTransaction -> Integer
_addressTransactionTxIndex :: Integer
, AddressTransaction -> Integer
_addressTransactionBlockHeight :: Integer
, AddressTransaction -> POSIXTime
_addressTransactionBlockTime :: POSIXTime
} deriving stock (Int -> AddressTransaction -> ShowS
[AddressTransaction] -> ShowS
AddressTransaction -> String
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
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. 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 (Maybe AddressTransaction
Value -> Parser [AddressTransaction]
Value -> Parser AddressTransaction
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
omittedField :: Maybe AddressTransaction
$comittedField :: Maybe AddressTransaction
parseJSONList :: Value -> Parser [AddressTransaction]
$cparseJSONList :: Value -> Parser [AddressTransaction]
parseJSON :: Value -> Parser AddressTransaction
$cparseJSON :: Value -> Parser AddressTransaction
FromJSON, [AddressTransaction] -> Encoding
[AddressTransaction] -> Value
AddressTransaction -> Bool
AddressTransaction -> Encoding
AddressTransaction -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
omitField :: AddressTransaction -> Bool
$comitField :: AddressTransaction -> Bool
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 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall a. [a] -> [(Text, a)]
samples
[ AddressTransaction
{ _addressTransactionTxHash :: TxHash
_addressTransactionTxHash = TxHash
"8788591983aa73981fc92d6cddbbe643959f5a784e84b8bee0db15823f575a5b"
, _addressTransactionTxIndex :: Integer
_addressTransactionTxIndex = Integer
6
, _addressTransactionBlockHeight :: Integer
_addressTransactionBlockHeight = Integer
69
, _addressTransactionBlockTime :: POSIXTime
_addressTransactionBlockTime = POSIXTime
1635505891
}
, AddressTransaction
{ _addressTransactionTxHash :: TxHash
_addressTransactionTxHash = TxHash
"52e748c4dec58b687b90b0b40d383b9fe1f24c1a833b7395cdf07dd67859f46f"
, _addressTransactionTxIndex :: Integer
_addressTransactionTxIndex = Integer
9
, _addressTransactionBlockHeight :: Integer
_addressTransactionBlockHeight = Integer
4547
, _addressTransactionBlockTime :: POSIXTime
_addressTransactionBlockTime = POSIXTime
1635505987
}
, AddressTransaction
{ _addressTransactionTxHash :: TxHash
_addressTransactionTxHash = TxHash
"e8073fd5318ff43eca18a852527166aa8008bee9ee9e891f585612b7e4ba700b"
, _addressTransactionTxIndex :: Integer
_addressTransactionTxIndex = Integer
0
, _addressTransactionBlockHeight :: Integer
_addressTransactionBlockHeight = Integer
564654
, _addressTransactionBlockTime :: POSIXTime
_addressTransactionBlockTime = POSIXTime
1834505492
}
]