morley-client-0.2.1: Client to interact with the Tezos blockchain
Safe HaskellSafe-Inferred
LanguageHaskell2010

Morley.Client.TezosClient.Class

Description

Abstraction layer for tezos-client functionality. We use it to fake tezos-client in tests.

Synopsis

Documentation

class Monad m => HasTezosClient m where Source #

Type class that provides interaction with tezos-client binary

Methods

signBytes :: ImplicitAddressOrAlias -> Maybe ScrubbedBytes -> ByteString -> m Signature Source #

Sign an operation with tezos-client.

genKey :: ImplicitAlias -> m ImplicitAddress Source #

Generate a secret key and store it with given alias. If a key with this alias already exists, the corresponding address will be returned and no state will be changed.

genFreshKey :: ImplicitAlias -> m ImplicitAddress Source #

Generate a secret key and store it with given alias. Unlike genKey this function overwrites the existing key when given alias is already stored.

revealKey :: ImplicitAlias -> Maybe ScrubbedBytes -> m () Source #

Reveal public key associated with given implicit account.

rememberContract :: Bool -> ContractAddress -> ContractAlias -> m () Source #

Associate the given contract with alias. The Bool variable indicates whether or not we should replace already existing contract alias or not.

resolveAddressMaybe :: AddressOrAlias kind -> m (Maybe (KindedAddress kind)) Source #

Retrieve an address from given address or alias. If address or alias does not exist returns Nothing

getAlias :: L1AddressKind kind => AddressOrAlias kind -> m (Alias kind) Source #

Retrieve an alias from given address using tezos-client. The primary (and probably only) reason this function exists is that tezos-client sign command only works with aliases. It was reported upstream: https://gitlab.com/tezos/tezos/-/issues/836.

registerDelegate :: ImplicitAlias -> Maybe ScrubbedBytes -> m () Source #

Register a given address as delegate TODO [#869] move to HasTezosRpc

getKeyPassword :: ImplicitAddress -> m (Maybe ScrubbedBytes) Source #

Get password for secret key associated with given address in case this key is password-protected. Obtained password is used in two places: * 1) In signBytes call. * 2) in revealKey call.

Instances

Instances details
HasTezosClient MorleyClientM Source # 
Instance details

Defined in Morley.Client.Full

Methods

signBytes :: ImplicitAddressOrAlias -> Maybe ScrubbedBytes -> ByteString -> MorleyClientM Signature Source #

genKey :: ImplicitAlias -> MorleyClientM ImplicitAddress Source #

genFreshKey :: ImplicitAlias -> MorleyClientM ImplicitAddress Source #

revealKey :: ImplicitAlias -> Maybe ScrubbedBytes -> MorleyClientM () Source #

rememberContract :: Bool -> ContractAddress -> ContractAlias -> MorleyClientM () Source #

resolveAddressMaybe :: forall (kind :: AddressKind). AddressOrAlias kind -> MorleyClientM (Maybe (KindedAddress kind)) Source #

getAlias :: forall (kind :: AddressKind). L1AddressKind kind => AddressOrAlias kind -> MorleyClientM (Alias kind) Source #

registerDelegate :: ImplicitAlias -> Maybe ScrubbedBytes -> MorleyClientM () Source #

getKeyPassword :: ImplicitAddress -> MorleyClientM (Maybe ScrubbedBytes) Source #

HasTezosClient MorleyOnlyRpcM Source # 
Instance details

Defined in Morley.Client.OnlyRPC

Methods

signBytes :: ImplicitAddressOrAlias -> Maybe ScrubbedBytes -> ByteString -> MorleyOnlyRpcM Signature Source #

genKey :: ImplicitAlias -> MorleyOnlyRpcM ImplicitAddress Source #

genFreshKey :: ImplicitAlias -> MorleyOnlyRpcM ImplicitAddress Source #

revealKey :: ImplicitAlias -> Maybe ScrubbedBytes -> MorleyOnlyRpcM () Source #

rememberContract :: Bool -> ContractAddress -> ContractAlias -> MorleyOnlyRpcM () Source #

resolveAddressMaybe :: forall (kind :: AddressKind). AddressOrAlias kind -> MorleyOnlyRpcM (Maybe (KindedAddress kind)) Source #

getAlias :: forall (kind :: AddressKind). L1AddressKind kind => AddressOrAlias kind -> MorleyOnlyRpcM (Alias kind) Source #

registerDelegate :: ImplicitAlias -> Maybe ScrubbedBytes -> MorleyOnlyRpcM () Source #

getKeyPassword :: ImplicitAddress -> MorleyOnlyRpcM (Maybe ScrubbedBytes) Source #