Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Interface to octez-client
(and its implementation).
Synopsis
- module Morley.Client.TezosClient.Class
- module Morley.Client.TezosClient.Types
- data TezosClientError
- = UnexpectedClientFailure Int Text Text
- | AlreadyRevealed ImplicitAlias
- | InvalidOperationHash OperationHash
- | CounterIsAlreadyUsed Text Text
- | EConnreset
- | ConfigParseError String
- | TezosClientCryptoParseError Text CryptoParseError
- | TezosClientParseAddressError Text ParseAddressError
- | TezosClientParseFeeError Text Text
- | TezosClientUnexpectedOutputFormat Text
- | CantRevealContract ImplicitAlias
- | ContractSender ContractAddress Text
- | EmptyImplicitContract ImplicitAlias
- | TezosClientUnexpectedSignatureOutput Text
- | TezosClientParseEncryptionTypeError Text Text
- | DuplicateAlias Text
- | AmbiguousAlias Text ContractAddress ImplicitAddress
- | AliasTxRollup Text (KindedAddress 'AddressKindTxRollup)
- | ResolveError ResolveError
- data AliasBehavior
- class Resolve addressOrAlias where
- type ResolvedAddress addressOrAlias :: Type
- type ResolvedAlias addressOrAlias :: Type
- data ResolveError where
- REAliasNotFound :: Text -> ResolveError
- REWrongKind :: Alias expectedKind -> Address -> ResolveError
- REAddressNotFound :: KindedAddress kind -> ResolveError
- resolveAddress :: forall addressOrAlias m env. (HasTezosClient m, MonadThrow m, WithClientLog env m, Resolve addressOrAlias) => addressOrAlias -> m (ResolvedAddress addressOrAlias)
- resolveAddressMaybe :: forall addressOrAlias m env. (HasTezosClient m, MonadThrow m, WithClientLog env m, Resolve addressOrAlias) => addressOrAlias -> m (Maybe (ResolvedAddress addressOrAlias))
- getAlias :: forall addressOrAlias m env. (HasTezosClient m, WithClientLog env m, MonadThrow m, Resolve addressOrAlias) => addressOrAlias -> m (ResolvedAlias addressOrAlias)
- getAliasMaybe :: forall addressOrAlias m env. (HasTezosClient m, WithClientLog env m, MonadThrow m, Resolve addressOrAlias) => addressOrAlias -> m (Maybe (ResolvedAlias addressOrAlias))
Documentation
data TezosClientError Source #
A data type for all predicatable errors that can happen during
octez-client
usage.
UnexpectedClientFailure |
|
AlreadyRevealed | Public key of the given address is already revealed. |
| |
InvalidOperationHash OperationHash | Can't wait for inclusion of operation with given hash because the hash is invalid. |
CounterIsAlreadyUsed | Error that indicates when given counter is already used for given contract. |
EConnreset | Network error with which |
ConfigParseError String | A parse error occurred during config parsing. |
TezosClientCryptoParseError Text CryptoParseError |
|
TezosClientParseAddressError Text ParseAddressError |
|
TezosClientParseFeeError Text Text |
|
TezosClientUnexpectedOutputFormat Text |
|
CantRevealContract | Given alias is a contract and cannot be revealed. |
| |
ContractSender ContractAddress Text | Given contract is a source of a transfer or origination operation. |
EmptyImplicitContract | Given alias is an empty implicit contract. |
| |
TezosClientUnexpectedSignatureOutput Text |
|
TezosClientParseEncryptionTypeError Text Text |
|
DuplicateAlias Text | Tried to save alias, but such alias already exists. |
AmbiguousAlias Text ContractAddress ImplicitAddress | Expected an alias to be associated with either an implicit address or a contract address, but it was associated with both. |
AliasTxRollup Text (KindedAddress 'AddressKindTxRollup) | Expected an alias to be associated with either an implicit address or a contract address, but it was associated with a transaction rollup address. |
ResolveError ResolveError |
Instances
Exception TezosClientError Source # | |
Defined in Morley.Client.TezosClient.Impl | |
Show TezosClientError Source # | |
Defined in Morley.Client.TezosClient.Impl showsPrec :: Int -> TezosClientError -> ShowS # show :: TezosClientError -> String # showList :: [TezosClientError] -> ShowS # | |
Buildable TezosClientError Source # | |
Defined in Morley.Client.TezosClient.Impl build :: TezosClientError -> Builder # |
data AliasBehavior Source #
How to save the originated contract address.
DontSaveAlias | Don't save the newly originated contract address. |
KeepDuplicateAlias | If an alias already exists, keep it, don't save the newly originated contract address. |
OverwriteDuplicateAlias | If an alias already exists, replace it with the address of the newly originated contract. |
ForbidDuplicateAlias | If an alias already exists, throw an exception without doing the origination |
Instances
class Resolve addressOrAlias Source #
type ResolvedAddress addressOrAlias :: Type Source #
type ResolvedAlias addressOrAlias :: Type Source #
Instances
data ResolveError where Source #
REAliasNotFound | |
| |
REWrongKind | |
| |
REAddressNotFound | |
|
Instances
Show ResolveError Source # | |
Defined in Morley.Client.TezosClient.Impl showsPrec :: Int -> ResolveError -> ShowS # show :: ResolveError -> String # showList :: [ResolveError] -> ShowS # | |
Buildable ResolveError Source # | |
Defined in Morley.Client.TezosClient.Impl build :: ResolveError -> Builder # |
resolveAddress :: forall addressOrAlias m env. (HasTezosClient m, MonadThrow m, WithClientLog env m, Resolve addressOrAlias) => addressOrAlias -> m (ResolvedAddress addressOrAlias) Source #
Looks up the address associated with the given addressOrAlias
.
Will throw a TezosClientError
if addressOrAlias
is an alias and:
- the alias does not exist.
- the alias exists but its address is of the wrong kind.
When the alias is associated with both an implicit and a contract address:
- The
SomeAddressOrAlias
instance will throw aTezosClientError
, unless the alias is prefixed withimplicit:
orcontract:
to disambiguate. - The
AddressOrAlias
instance will return the address with the requested kind.
resolveAddressMaybe :: forall addressOrAlias m env. (HasTezosClient m, MonadThrow m, WithClientLog env m, Resolve addressOrAlias) => addressOrAlias -> m (Maybe (ResolvedAddress addressOrAlias)) Source #
Looks up the address associated with the given addressOrAlias
.
Will return Nothing
if addressOrAlias
is an alias and:
- the alias does not exist.
- the alias exists but its address is of the wrong kind.
When the alias is associated with both an implicit and a contract address:
- The
SomeAddressOrAlias
instance will throw aTezosClientError
, unless the alias is prefixed withimplicit:
orcontract:
to disambiguate. - The
AddressOrAlias
instance will return the address with the requested kind.
getAlias :: forall addressOrAlias m env. (HasTezosClient m, WithClientLog env m, MonadThrow m, Resolve addressOrAlias) => addressOrAlias -> m (ResolvedAlias addressOrAlias) Source #
Looks up the alias associated with the given addressOrAlias
.
Will throw a TezosClientError
if addressOrAlias
:
- is an address that is not associated with any alias.
- is an alias that does not exist.
- is an alias that exists but its address is of the wrong kind.
When the alias is associated with both an implicit and a contract address:
- The
SomeAddressOrAlias
instance will throw aTezosClientError
, unless the alias is prefixed withimplicit:
orcontract:
to disambiguate. - The
AddressOrAlias
instance will return the alias.
getAliasMaybe :: forall addressOrAlias m env. (HasTezosClient m, WithClientLog env m, MonadThrow m, Resolve addressOrAlias) => addressOrAlias -> m (Maybe (ResolvedAlias addressOrAlias)) Source #
Looks up the alias associated with the given addressOrAlias
.
Will return Nothing
if addressOrAlias
:
- is an address that is not associated with any alias.
- is an alias that does not exist.
- is an alias that exists but its address is of the wrong kind.
When the alias is associated with both an implicit and a contract address:
- The
SomeAddressOrAlias
instance will throw aTezosClientError
, unless the alias is prefixed withimplicit:
orcontract:
to disambiguate. - The
AddressOrAlias
instance will return the alias.