-- | Assets API endpoints

{-# OPTIONS_HADDOCK hide #-}

module Blockfrost.API.Cardano.Assets
  where

import Servant.API
import Servant.API.Generic

import Blockfrost.Types.Cardano.Assets
import Blockfrost.Types.Shared
import Blockfrost.Util.Pagination
import Blockfrost.Util.Sorting

data AssetsAPI route =
  AssetsAPI
    {
      forall route.
AssetsAPI route
-> route
   :- (Summary "Assets"
       :> (Description "List of assets."
           :> (Pagination :> (Sorting :> Get '[JSON] [AssetInfo]))))
_listAssets
        :: route
        :- Summary "Assets"
        :> Description "List of assets."
        :> Pagination
        :> Sorting
        :> Get '[JSON] [AssetInfo]
    , forall route.
AssetsAPI route
-> route
   :- (Summary "Specific asset"
       :> (Description "Information about a specific asset."
           :> (Capture "asset" AssetId :> Get '[JSON] AssetDetails)))
_assetDetails
        :: route
        :- Summary "Specific asset"
        :> Description "Information about a specific asset."
        :> Capture "asset" AssetId
        :> Get '[JSON] AssetDetails
    , forall route.
AssetsAPI route
-> route
   :- (Summary "Asset history"
       :> (Description "History of a specific asset."
           :> (Capture "asset" AssetId
               :> ("history"
                   :> (Pagination :> (Sorting :> Get '[JSON] [AssetHistory]))))))
_assetHistory
        :: route
        :- Summary "Asset history"
        :> Description "History of a specific asset."
        :> Capture "asset" AssetId
        :> "history"
        :> Pagination
        :> Sorting
        :> Get '[JSON] [AssetHistory]
    , forall route.
AssetsAPI route
-> route
   :- (Summary "Asset transactions"
       :> (Description "List of a specific asset transactions"
           :> (Capture "asset" AssetId
               :> ("transactions"
                   :> (Pagination :> (Sorting :> Get '[JSON] [AssetTransaction]))))))
_assetTransactions
        :: route
        :- Summary "Asset transactions"
        :> Description "List of a specific asset transactions"
        :> Capture "asset" AssetId
        :> "transactions"
        :> Pagination
        :> Sorting
        :> Get '[JSON] [AssetTransaction]
    , forall route.
AssetsAPI route
-> route
   :- (Summary "Asset addresses"
       :> (Description "List of a addresses containing a specific asset"
           :> (Capture "asset" AssetId
               :> ("addresses"
                   :> (Pagination :> (Sorting :> Get '[JSON] [AssetAddress]))))))
_assetAddresses
        :: route
        :- Summary "Asset addresses"
        :> Description "List of a addresses containing a specific asset"
        :> Capture "asset" AssetId
        :> "addresses"
        :> Pagination
        :> Sorting
        :> Get '[JSON] [AssetAddress]
    , forall route.
AssetsAPI route
-> route
   :- (Summary "Assets of a specific policy"
       :> (Description "List of asset minted under a specific policy."
           :> ("policy"
               :> (Capture "policy_id" PolicyId
                   :> (Pagination :> (Sorting :> Get '[JSON] [AssetInfo]))))))
_listAssetsPolicy
        :: route
        :- Summary "Assets of a specific policy"
        :> Description "List of asset minted under a specific policy."
        :> "policy"
        :> Capture "policy_id" PolicyId
        :> Pagination
        :> Sorting
        :> Get '[JSON] [AssetInfo]
    } deriving (forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall route x. Rep (AssetsAPI route) x -> AssetsAPI route
forall route x. AssetsAPI route -> Rep (AssetsAPI route) x
$cto :: forall route x. Rep (AssetsAPI route) x -> AssetsAPI route
$cfrom :: forall route x. AssetsAPI route -> Rep (AssetsAPI route) x
Generic)