-
Notifications
You must be signed in to change notification settings - Fork 18
/
Addresses.hs
52 lines (47 loc) · 1.4 KB
/
Addresses.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
-- | Addresses API endpoints
{-# OPTIONS_HADDOCK hide #-}
module Blockfrost.API.Cardano.Addresses
where
import Servant.API
import Servant.API.Generic
import Blockfrost.Types.Cardano.Addresses
import Blockfrost.Types.Shared
import Blockfrost.Util.Pagination
import Blockfrost.Util.Sorting
data AddressesAPI route =
AddressesAPI
{
_addressInfo
:: route
:- Summary "Specific address"
:> Description "Obtain information about a specific address."
:> Capture "address" Address
:> Get '[JSON] AddressInfo
, _addressDetails
:: route
:- Summary "Address details"
:> Description "Obtain details about an address."
:> Capture "address" Address
:> "total"
:> Get '[JSON] AddressDetails
, _addressUtxos
:: route
:- Summary "Address UTXOs"
:> Description "UTXOs of the address."
:> Capture "address" Address
:> "utxos"
:> Pagination
:> Sorting
:> Get '[JSON] [AddressUtxo]
, _addressTransactions
:: route
:- Summary "Address transactions"
:> Description "Transactions on the address."
:> Capture "address" Address
:> "transactions"
:> Pagination
:> Sorting
:> QueryParam "from" BlockIndex
:> QueryParam "to" BlockIndex
:> Get '[JSON] [AddressTransaction]
} deriving (Generic)