morley-0.3.0: Developer tools for the Michelson Language

Safe HaskellNone
LanguageHaskell2010

Tezos.Address

Contents

Description

Address in Tezos.

Synopsis

Documentation

data Address Source #

Data type corresponding to address structure in Tezos.

Constructors

KeyAddress !KeyHash

tz address which is a hash of a public key.

ContractAddress !ByteString

KT address which corresponds to a callable contract. It's a hash of origination command. TODO: we should probably have a Hash type.

Instances
Eq Address Source # 
Instance details

Defined in Tezos.Address

Methods

(==) :: Address -> Address -> Bool #

(/=) :: Address -> Address -> Bool #

Ord Address Source # 
Instance details

Defined in Tezos.Address

Show Address Source # 
Instance details

Defined in Tezos.Address

Arbitrary Address Source # 
Instance details

Defined in Tezos.Address

ToJSON Address Source # 
Instance details

Defined in Tezos.Address

ToJSONKey Address Source # 
Instance details

Defined in Tezos.Address

FromJSON Address Source # 
Instance details

Defined in Tezos.Address

FromJSONKey Address Source # 
Instance details

Defined in Tezos.Address

Buildable Address Source # 
Instance details

Defined in Tezos.Address

Methods

build :: Address -> Builder #

IsoValue Address Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type ToT Address :: T Source #

IsoCValue Address Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type ToCT Address :: CT Source #

ArithOpHs Compare Address Address Source # 
Instance details

Defined in Lorentz.Arith

Associated Types

type ArithResHs Compare Address Address :: Type Source #

type ToT Address Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

type ToCT Address Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

type ArithResHs Compare Address Address Source # 
Instance details

Defined in Lorentz.Arith

mkKeyAddress :: PublicKey -> Address Source #

Smart constructor for KeyAddress.

mkContractAddressRaw :: ByteString -> Address Source #

Smart constructor for ContractAddress. Its argument is serialized origination operation.

Note: it's quite unsafe to pass ByteString, because we can pass some garbage which is not a serialized origination operation, but this operation includes contract itself and necessary types are defined in *. So we have to serialize this data outside this module and pass it here as a ByteString. Alternatively we could add some constraint, but it would be almost as unsafe as passing a ByteString. For this reason we add Raw suffix to this function and provide a safer function in Instr. We may reconsider it later.

Formatting

parseAddress :: Text -> Either ParseAddressError Address Source #

Parse an address from its human-readable textual representation used by Tezos (e. g. "tz1faswCTDciRzE4oJ9jn2Vm2dvjeyA9fUzU"). Or fail if it's invalid.

unsafeParseAddress :: HasCallStack => Text -> Address Source #

Partial version of parseAddress which assumes that the address is correct. Can be used in tests.