cardano-wasm:cardano-wasi-lib
Safe HaskellNone
LanguageHaskell2010

Cardano.Wasm.Api.Address

Synopsis

Documentation

newtype AddressInfo Source #

Information about a valid address, as returned by inspectAddressImpl.

Constructors

AddressInfo 

Fields

Instances

Instances details
ToJSON AddressInfo Source # 
Instance details

Defined in Cardano.Wasm.Api.Address

Methods

toJSON :: AddressInfo -> Value #

toEncoding :: AddressInfo -> Encoding #

toJSONList :: [AddressInfo] -> Value #

toEncodingList :: [AddressInfo] -> Encoding #

omitField :: AddressInfo -> Bool #

Eq AddressInfo Source # 
Instance details

Defined in Cardano.Wasm.Api.Address

Show AddressInfo Source # 
Instance details

Defined in Cardano.Wasm.Api.Address

inspectAddressImpl :: String -> Maybe AddressInfo Source #

Inspect an address given as a string. If the address is a well-formed Shelley-era address (bech32, like addr... or addr_test...), it returns information about the address: currently, the network it belongs to. Otherwise it returns Nothing (serialised as null in the JavaScript API). It never throws.

Note that an address only encodes whether it belongs to mainnet or a testnet: it is not possible to distinguish between different testnets (like preprod and preview) from an address alone, because they only differ in the network magic, which is not part of the address.