cardano-wallet-core-2022.7.1: The Wallet Backend for a Cardano node.
Copyright © 2018-2021 IOHK
License Apache-2.0
Safe Haskell None
Language Haskell2010

Cardano.Wallet.TokenMetadata.MockServer

Description

A mock metadata-server for testing, metadata requests. Created using the metadata-server Haskell source code as a reference.

Synopsis

Documentation

withMetadataServer :: IO ( Server MetadataQueryApi) -> ( TokenMetadataServer -> IO a) -> IO a Source #

Start a metadata server on any random port. See withMetadataServerOptions for running a server with middleware and predefined port.

To be used with queryServerStatic .

queryServerStatic :: FilePath -> IO ( BatchRequest -> Handler BatchResponse ) Source #

Serve a json file.

Will filter the json and only serve metadata for the requested subjects.

queryServerReloading :: FilePath -> BatchRequest -> Handler BatchResponse Source #

Like queryServerStatic , except that the JSON file will be reloaded before every request.

Helpers

assetIdFromSubject :: Subject -> AssetId Source #

The reverse of subjectToAssetId

Orphan instances

ToJSON AssetDecimals Source #
Instance details

ToJSON AssetURL Source #
Instance details

ToJSON AssetLogo Source #
Instance details

ToJSON Signature Source #
Instance details

ToJSON SubjectProperties Source #
Instance details

ToJSON BatchResponse Source #
Instance details

FromJSON BatchRequest Source #
Instance details

ToJSON ( PropertyValue name) => ToJSON ( Property name) Source #
Instance details