morley-1.20.0: Developer tools for the Michelson Language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Morley.Tezos.Address.Alias

Synopsis

Documentation

data AddressOrAlias kind where Source #

This type is meant to be used to parse CLI options where either an address or an alias of an implicit account or a contract can be accepted.

This can be later converted to an address using Morley.Client.resolveAddress or an alias using Morley.Client.getAlias.

This polymorphic type can be instantiated with AddressKindImplicit or AddressKindContract (see ImplicitAddressOrAlias and ContractAddressOrAlias), but not AddressKindSmartRollup. There is no octez-client command to list smart rollup aliases, unlike octez-client list known addresses/contracts, therefore:

  1. It wouldn't be possible to implement Morley.Client.resolveAddress for AddressAlias _ :: AddressOrAlias 'AddressKindTxRollup.
  2. It wouldn't be possible to implement Morley.Client.getAlias for AddressResolved _ :: AddressOrAlias 'AddressKindTxRollup.

This should be revisited if/when octez-client adds support for smart rollup aliases.

Constructors

AddressResolved 

Fields

AddressAlias 

Fields

Instances

Instances details
Show (AddressOrAlias kind) Source # 
Instance details

Defined in Morley.Tezos.Address.Alias

Eq (AddressOrAlias kind) Source # 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

(==) :: AddressOrAlias kind -> AddressOrAlias kind -> Bool #

(/=) :: AddressOrAlias kind -> AddressOrAlias kind -> Bool #

Ord (AddressOrAlias kind) Source # 
Instance details

Defined in Morley.Tezos.Address.Alias

(SingI kind, L1AddressKind kind) => HasCLReader (AddressOrAlias kind) Source # 
Instance details

Defined in Morley.Tezos.Address.Alias

Buildable (AddressOrAlias kind) Source # 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

build :: AddressOrAlias kind -> Doc

buildList :: [AddressOrAlias kind] -> Doc

addressOrAliasKindSanity :: forall kind. AddressOrAlias kind -> Dict (L1AddressKind kind, SingI kind) Source #

Given an AddressOrAlias, prove it's kind is well-defined (i.e. it has a SingI instance and satisfies L1AddressKind constraint)

data Alias (kind :: AddressKind) where Source #

octez-client can associate addresses with textual aliases. This type denotes such an alias.

Instances

Instances details
GCompare Alias Source # 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

gcompare :: forall (a :: k) (b :: k). Alias a -> Alias b -> GOrdering a b #

GEq Alias Source # 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

geq :: forall (a :: k) (b :: k). Alias a -> Alias b -> Maybe (a :~: b) #

(c 'AddressKindImplicit, c 'AddressKindContract) => Has (c :: AddressKind -> Constraint) Alias Source # 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

has :: forall (a :: k) r. Alias a -> (c a => r) -> r #

argDict :: forall (a :: k). Alias a -> Dict (c a) #

(SingI kind, L1AddressKind kind) => FromJSON (Alias kind) Source # 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

parseJSON :: Value -> Parser (Alias kind) #

parseJSONList :: Value -> Parser [Alias kind] #

ToJSON (Alias kind) Source # 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

toJSON :: Alias kind -> Value #

toEncoding :: Alias kind -> Encoding #

toJSONList :: [Alias kind] -> Value #

toEncodingList :: [Alias kind] -> Encoding #

Show (Alias kind) Source # 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

showsPrec :: Int -> Alias kind -> ShowS #

show :: Alias kind -> String #

showList :: [Alias kind] -> ShowS #

NFData (Alias kind) Source # 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

rnf :: Alias kind -> () #

Eq (Alias kind) Source # 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

(==) :: Alias kind -> Alias kind -> Bool #

(/=) :: Alias kind -> Alias kind -> Bool #

Ord (Alias kind) Source # 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

compare :: Alias kind -> Alias kind -> Ordering #

(<) :: Alias kind -> Alias kind -> Bool #

(<=) :: Alias kind -> Alias kind -> Bool #

(>) :: Alias kind -> Alias kind -> Bool #

(>=) :: Alias kind -> Alias kind -> Bool #

max :: Alias kind -> Alias kind -> Alias kind #

min :: Alias kind -> Alias kind -> Alias kind #

Buildable (Alias kind) Source # 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

build :: Alias kind -> Doc

buildList :: [Alias kind] -> Doc

type SomeAlias = Constrained NullConstraint Alias Source #

Existential wrapper over Alias.

pattern SomeAlias :: Alias a -> SomeAlias Source #

type ImplicitAlias = Alias 'AddressKindImplicit Source #

A type only allowing ImplicitAlias values.

type ContractAlias = Alias 'AddressKindContract Source #

A type only allowing ContractAlias values.

unAlias :: Alias kind -> Text Source #

Get raw alias text from Alias

mkAlias :: forall kind. (SingI kind, L1AddressKind kind) => Text -> Alias kind Source #

Construct an Alias from alias Text.

aliasKindSanity :: Alias kind -> Dict (L1AddressKind kind, SingI kind) Source #

Given an Alias, prove it's kind is well-defined (i.e. it has a SingI instance and satisfies L1AddressKind constraint)

aliasPrefix :: forall addressKind. (L1AddressKind addressKind, SingI addressKind) => Doc Source #

The prefix used to specify whether an alias belongs to a contract or an implicit account.