| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Wasm.Api.Address
Synopsis
- newtype AddressInfo = AddressInfo {}
- inspectAddressImpl :: String -> Maybe AddressInfo
Documentation
newtype AddressInfo Source #
Information about a valid address, as returned by inspectAddressImpl.
Constructors
| AddressInfo | |
Fields
| |
Instances
| ToJSON AddressInfo Source # | |
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 # | |
Defined in Cardano.Wasm.Api.Address Methods (==) :: AddressInfo -> AddressInfo -> Bool Source # (/=) :: AddressInfo -> AddressInfo -> Bool Source # | |
| Show AddressInfo Source # | |
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.