plutus-chain-index-core-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Plutus.ChainIndex.Api

Synopsis

Documentation

type API = ("healthcheck" :> (Description "Is the server alive?" :> Get '[JSON] NoContent)) :<|> (("from-hash" :> FromHashAPI) :<|> (("unspent-tx-out" :> (Description "Get an unspent transaction output from its reference." :> (ReqBody '[JSON] TxOutRef :> Post '[JSON] ChainIndexTxOut))) :<|> (("is-utxo" :> (Description "Check if the reference is an UTxO." :> (ReqBody '[JSON] TxOutRef :> Post '[JSON] IsUtxoResponse))) :<|> (("utxo-at-address" :> (Description "Get all UTxOs at an address." :> (ReqBody '[JSON] UtxoAtAddressRequest :> Post '[JSON] UtxosResponse))) :<|> (("utxo-with-currency" :> (Description "Get all UTxOs with a currency." :> (ReqBody '[JSON] UtxoWithCurrencyRequest :> Post '[JSON] UtxosResponse))) :<|> (("txo-at-address" :> (Description "Get TxOs at an address." :> (ReqBody '[JSON] TxoAtAddressRequest :> Post '[JSON] TxosResponse))) :<|> (("tip" :> (Description "Get the current synced tip." :> Get '[JSON] Tip)) :<|> (("collect-garbage" :> (Description "Collect chain index garbage to free up space." :> Put '[JSON] NoContent)) :<|> ("diagnostics" :> (Description "Get the current stats of the chain index." :> Get '[JSON] Diagnostics)))))))))) Source #

type FromHashAPI = ("datum" :> (Description "Get a datum from its hash." :> (ReqBody '[JSON] DatumHash :> Post '[JSON] Datum))) :<|> (("validator" :> (Description "Get a validator script from its hash." :> (ReqBody '[JSON] ValidatorHash :> Post '[JSON] Validator))) :<|> (("minting-policy" :> (Description "Get a minting policy from its hash." :> (ReqBody '[JSON] MintingPolicyHash :> Post '[JSON] MintingPolicy))) :<|> (("stake-validator" :> (Description "Get a stake validator from its hash." :> (ReqBody '[JSON] StakeValidatorHash :> Post '[JSON] StakeValidator))) :<|> ("redeemer" :> (Description "Get a redeemer from its hash." :> (ReqBody '[JSON] RedeemerHash :> Post '[JSON] Redeemer)))))) Source #

data IsUtxoResponse Source #

Response type for the is-utxo endpoint.

Constructors

IsUtxoResponse 

Fields

Instances

Instances details
Eq IsUtxoResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Show IsUtxoResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Generic IsUtxoResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Associated Types

type Rep IsUtxoResponse :: Type -> Type Source #

ToJSON IsUtxoResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

FromJSON IsUtxoResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

ToSchema IsUtxoResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

type Rep IsUtxoResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

type Rep IsUtxoResponse = D1 ('MetaData "IsUtxoResponse" "Plutus.ChainIndex.Api" "plutus-chain-index-core-0.1.0.0-EG2fOrGca5623jCDzCiAyI" 'False) (C1 ('MetaCons "IsUtxoResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "currentTip") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Tip) :*: S1 ('MetaSel ('Just "isUtxo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))

type SwaggerAPI = "swagger" :> SwaggerSchemaUI "swagger-ui" "swagger.json" Source #

data UtxoAtAddressRequest Source #

When requesting UTxOs of a given address, you need to provide the address, and optionnally the number of elements per page and the last item of the last requested page.

Here's an example for requesting the first page:

{ "credential": { "tag": PubKeyCredential, "contents": { "getPubKeyHash": "88ff402b0522f27649ac742238c697c579beeb344eb723099d1f16ce" } } }

or

{ "pageQuery": { "pageQuerySize": { "getPageSize": 10 } }, "credential": { "tag": PubKeyCredential, "contents": { "getPubKeyHash": "88ff402b0522f27649ac742238c697c579beeb344eb723099d1f16ce" } } }

Here's an example for requesting the next page:

{ "pageQuery": { "pageQuerySize": { "getPageSize": 10 }, "pageQueryLastItem": { "txOutRefId": { "getTxId": "009b8c674b878cc68bd1d40562c5f14cdbb21be9266f605cfb68ed978e1a965b" }, "txOutRefIdx": 0 } }, "credential": { "tag": PubKeyCredential, "contents": { "getPubKeyHash": "88ff402b0522f27649ac742238c697c579beeb344eb723099d1f16ce" } } }

Instances

Instances details
Eq UtxoAtAddressRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Show UtxoAtAddressRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Generic UtxoAtAddressRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Associated Types

type Rep UtxoAtAddressRequest :: Type -> Type Source #

ToJSON UtxoAtAddressRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

FromJSON UtxoAtAddressRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

ToSchema UtxoAtAddressRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

type Rep UtxoAtAddressRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

type Rep UtxoAtAddressRequest = D1 ('MetaData "UtxoAtAddressRequest" "Plutus.ChainIndex.Api" "plutus-chain-index-core-0.1.0.0-EG2fOrGca5623jCDzCiAyI" 'False) (C1 ('MetaCons "UtxoAtAddressRequest" 'PrefixI 'True) (S1 ('MetaSel ('Just "pageQuery") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (PageQuery TxOutRef))) :*: S1 ('MetaSel ('Just "credential") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Credential)))

data UtxosResponse Source #

Response type for the utxo-{at-address|with-currency} endpoints.

Constructors

UtxosResponse 

Instances

Instances details
Eq UtxosResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Show UtxosResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Generic UtxosResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Associated Types

type Rep UtxosResponse :: Type -> Type Source #

ToJSON UtxosResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

FromJSON UtxosResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

ToSchema UtxosResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

type Rep UtxosResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

type Rep UtxosResponse = D1 ('MetaData "UtxosResponse" "Plutus.ChainIndex.Api" "plutus-chain-index-core-0.1.0.0-EG2fOrGca5623jCDzCiAyI" 'False) (C1 ('MetaCons "UtxosResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "currentTip") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Tip) :*: S1 ('MetaSel ('Just "page") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Page TxOutRef))))

data UtxoWithCurrencyRequest Source #

See the comment on UtxoAtAddressRequest.

The difference is using currency field instead of credential. { "pageQuery": { ... }, "currency": { "unAssetClass": [ { "unCurrencySymbol": "" }, { "unTokenName": "" } ] } }

Instances

Instances details
Eq UtxoWithCurrencyRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Show UtxoWithCurrencyRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Generic UtxoWithCurrencyRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Associated Types

type Rep UtxoWithCurrencyRequest :: Type -> Type Source #

ToJSON UtxoWithCurrencyRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

FromJSON UtxoWithCurrencyRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

ToSchema UtxoWithCurrencyRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

type Rep UtxoWithCurrencyRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

type Rep UtxoWithCurrencyRequest = D1 ('MetaData "UtxoWithCurrencyRequest" "Plutus.ChainIndex.Api" "plutus-chain-index-core-0.1.0.0-EG2fOrGca5623jCDzCiAyI" 'False) (C1 ('MetaCons "UtxoWithCurrencyRequest" 'PrefixI 'True) (S1 ('MetaSel ('Just "pageQuery") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (PageQuery TxOutRef))) :*: S1 ('MetaSel ('Just "currency") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AssetClass)))

swagger :: forall dir api. Server api ~ Handler Value => Server (SwaggerSchemaUI' dir api) Source #

data TxoAtAddressRequest Source #

Instances

Instances details
Eq TxoAtAddressRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Show TxoAtAddressRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Generic TxoAtAddressRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Associated Types

type Rep TxoAtAddressRequest :: Type -> Type Source #

ToJSON TxoAtAddressRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

FromJSON TxoAtAddressRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

ToSchema TxoAtAddressRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

type Rep TxoAtAddressRequest Source # 
Instance details

Defined in Plutus.ChainIndex.Api

type Rep TxoAtAddressRequest = D1 ('MetaData "TxoAtAddressRequest" "Plutus.ChainIndex.Api" "plutus-chain-index-core-0.1.0.0-EG2fOrGca5623jCDzCiAyI" 'False) (C1 ('MetaCons "TxoAtAddressRequest" 'PrefixI 'True) (S1 ('MetaSel ('Just "pageQuery") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (PageQuery TxOutRef))) :*: S1 ('MetaSel ('Just "credential") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Credential)))

data TxosResponse Source #

Response type for the txo-at-address endpoint.

Constructors

TxosResponse 

Fields

Instances

Instances details
Eq TxosResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Show TxosResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Generic TxosResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

Associated Types

type Rep TxosResponse :: Type -> Type Source #

ToJSON TxosResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

FromJSON TxosResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

ToSchema TxosResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

type Rep TxosResponse Source # 
Instance details

Defined in Plutus.ChainIndex.Api

type Rep TxosResponse = D1 ('MetaData "TxosResponse" "Plutus.ChainIndex.Api" "plutus-chain-index-core-0.1.0.0-EG2fOrGca5623jCDzCiAyI" 'False) (C1 ('MetaCons "TxosResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "paget") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Page TxOutRef))))