Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data AddressOrAlias kind where
- AddressResolved :: L1AddressKind kind => KindedAddress kind -> AddressOrAlias kind
- AddressAlias :: Alias kind -> AddressOrAlias kind
- addressOrAliasKindSanity :: forall kind. AddressOrAlias kind -> Dict (L1AddressKind kind, SingI kind)
- data Alias (kind :: AddressKind) where
- type SomeAlias = Constrained NullConstraint Alias
- pattern SomeAlias :: Alias a -> SomeAlias
- type ImplicitAlias = Alias 'AddressKindImplicit
- type ContractAlias = Alias 'AddressKindContract
- type ImplicitAddressOrAlias = AddressOrAlias 'AddressKindImplicit
- type ContractAddressOrAlias = AddressOrAlias 'AddressKindContract
- unAlias :: Alias kind -> Text
- mkAlias :: forall kind. (SingI kind, L1AddressKind kind) => Text -> Alias kind
- aliasKindSanity :: Alias kind -> Dict (L1AddressKind kind, SingI kind)
- data SomeAddressOrAlias where
- aliasPrefix :: forall addressKind. (L1AddressKind addressKind, SingI addressKind) => Doc
- contractPrefix :: Doc
- implicitPrefix :: Doc
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:
- It wouldn't be possible to implement
Morley.Client.resolveAddress
forAddressAlias _ :: AddressOrAlias 'AddressKindTxRollup
. - It wouldn't be possible to implement
Morley.Client.getAlias
forAddressResolved _ :: AddressOrAlias 'AddressKindTxRollup
.
This should be revisited if/when octez-client
adds support for smart rollup
aliases.
AddressResolved | |
| |
AddressAlias | |
|
Instances
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.
ImplicitAlias :: Text -> Alias 'AddressKindImplicit | |
ContractAlias :: Text -> Alias 'AddressKindContract |
Instances
GCompare Alias Source # | |
GEq Alias Source # | |
(c 'AddressKindImplicit, c 'AddressKindContract) => Has (c :: AddressKind -> Constraint) Alias Source # | |
(SingI kind, L1AddressKind kind) => FromJSON (Alias kind) Source # | |
ToJSON (Alias kind) Source # | |
Defined in Morley.Tezos.Address.Alias | |
Show (Alias kind) Source # | |
NFData (Alias kind) Source # | |
Defined in Morley.Tezos.Address.Alias | |
Eq (Alias kind) Source # | |
Ord (Alias kind) Source # | |
Defined in Morley.Tezos.Address.Alias | |
Buildable (Alias kind) Source # | |
Defined in Morley.Tezos.Address.Alias |
type SomeAlias = Constrained NullConstraint Alias Source #
Existential wrapper over Alias
.
type ImplicitAlias = Alias 'AddressKindImplicit Source #
A type only allowing ImplicitAlias
values.
type ContractAlias = Alias 'AddressKindContract Source #
A type only allowing ContractAlias
values.
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)
data SomeAddressOrAlias where Source #
SAOAKindSpecified :: AddressOrAlias kind -> SomeAddressOrAlias | |
SAOAKindUnspecified :: Text -> SomeAddressOrAlias |
Instances
Show SomeAddressOrAlias Source # | |
Defined in Morley.Tezos.Address.Alias showsPrec :: Int -> SomeAddressOrAlias -> ShowS # show :: SomeAddressOrAlias -> String # showList :: [SomeAddressOrAlias] -> ShowS # | |
HasCLReader SomeAddressOrAlias Source # | |
Defined in Morley.Tezos.Address.Alias | |
Buildable SomeAddressOrAlias Source # | The output of |
Defined in Morley.Tezos.Address.Alias build :: SomeAddressOrAlias -> Doc buildList :: [SomeAddressOrAlias] -> Doc |
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.
contractPrefix :: Doc Source #
implicitPrefix :: Doc Source #