Safe Haskell | None |
---|---|
Language | Haskell2010 |
Abstraction layer for tezos-client
functionality.
We use it to fake tezos-client
in tests.
Synopsis
- class Monad m => HasTezosClient m where
- signBytes :: AddressOrAlias -> Maybe ScrubbedBytes -> ByteString -> m Signature
- genKey :: AliasOrAliasHint -> m Address
- genFreshKey :: AliasOrAliasHint -> m Address
- revealKey :: Alias -> Maybe ScrubbedBytes -> m ()
- waitForOperation :: OperationHash -> m ()
- rememberContract :: Bool -> Address -> AliasOrAliasHint -> m ()
- importKey :: Bool -> AliasOrAliasHint -> SecretKey -> m Alias
- resolveAddressMaybe :: AddressOrAlias -> m (Maybe Address)
- getAlias :: AddressOrAlias -> m Alias
- getPublicKey :: AddressOrAlias -> m PublicKey
- registerDelegate :: AliasOrAliasHint -> Maybe ScrubbedBytes -> m ()
- getTezosClientConfig :: m TezosClientConfig
- calcTransferFee :: AddressOrAlias -> Maybe ScrubbedBytes -> TezosInt64 -> [CalcTransferFeeData] -> m [TezosMutez]
- calcOriginationFee :: UntypedValScope st => CalcOriginationFeeData cp st -> m TezosMutez
- getKeyPassword :: Address -> m (Maybe ScrubbedBytes)
Documentation
class Monad m => HasTezosClient m where Source #
Type class that provides interaction with tezos-client
binary
signBytes :: AddressOrAlias -> Maybe ScrubbedBytes -> ByteString -> m Signature Source #
Sign an operation with tezos-client
.
genKey :: AliasOrAliasHint -> m Address 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 :: AliasOrAliasHint -> m Address 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 :: Alias -> Maybe ScrubbedBytes -> m () Source #
Reveal public key associated with given implicit account.
waitForOperation :: OperationHash -> m () Source #
Wait until operation known by some hash is included into the chain.
rememberContract :: Bool -> Address -> AliasOrAliasHint -> m () Source #
Associate the given contract with alias.
The Bool
variable indicates whether or not we should replace already
existing contract alias or not.
importKey :: Bool -> AliasOrAliasHint -> SecretKey -> m Alias Source #
Saves SecretKey
via tezos-client
with given alias or hint associated.
The Bool
variable indicates whether or not we should replace already
existing alias key or not.
The returned Alias
is the alias under which the key will be accessible.
resolveAddressMaybe :: AddressOrAlias -> m (Maybe Address) Source #
Retrieve an address from given address or alias. If address or alias does not exist
returns Nothing
getAlias :: AddressOrAlias -> m Alias 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.
getPublicKey :: AddressOrAlias -> m PublicKey Source #
Get public key for given address. Public keys are often used when interacting with the multising contracts
registerDelegate :: AliasOrAliasHint -> Maybe ScrubbedBytes -> m () Source #
Register a given address as delegate
getTezosClientConfig :: m TezosClientConfig Source #
Retrieve the current tezos-client
config.
calcTransferFee :: AddressOrAlias -> Maybe ScrubbedBytes -> TezosInt64 -> [CalcTransferFeeData] -> m [TezosMutez] Source #
Calculate fee for transfer using `--dry-run` flag.
calcOriginationFee :: UntypedValScope st => CalcOriginationFeeData cp st -> m TezosMutez Source #
Calculate fee for origination using `--dry-run` flag.
getKeyPassword :: Address -> 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.