plutus-pab-1.2.0.0
Safe Haskell None
Language Haskell2010

Cardano.Api.NetworkId.Extra

Synopsis

Documentation

newtype NetworkIdWrapper Source #

Wrapper for NetworkId to prevent the creation of orphan instances.

Instances

Instances details
Eq NetworkIdWrapper Source #
Instance details

Defined in Cardano.Api.NetworkId.Extra

Show NetworkIdWrapper Source #
Instance details

Defined in Cardano.Api.NetworkId.Extra

ToJSON NetworkIdWrapper Source #
Instance details

Defined in Cardano.Api.NetworkId.Extra

FromJSON NetworkIdWrapper Source #

Custom FromJSON instance for NetworkId needed for allowing a user to specify it in the MockServerConfig .

This instance parses NetworkId as a string value. An empty string refers to the Mainnet. A number encoded as a string refers to the NetworkMagic of the Testnet.

Here are some examples:

>>> decode "\"\"" :: Maybe NetworkId
Just Mainnet
>>> decode "\"1\"" :: Maybe NetworkId
Just (Testnet (NetworkMagic 1)))
>>> decode "\"1a\"" :: Maybe NetworkId
Nothing
>>> decode "\"other\"" :: Maybe NetworkId
Nothing
Instance details

Defined in Cardano.Api.NetworkId.Extra

testnetNetworkId :: NetworkIdWrapper Source #

A network ID for use in testing.