morley-client-0.1.1: Client to interact with the Tezos blockchain
Safe HaskellNone
LanguageHaskell2010

Morley.Client.Util

Synopsis

Documentation

epNameToTezosEp :: EpName -> Text Source #

Convert EpName to the textual representation used by RPC and tezos-client.

extractAddressesFromValue :: Value -> [Address] Source #

Extract all addresses value from given untyped Value.

Note that it returns all values that can be used as an address. However, some of fetched values can never be used as an address.

disableAlphanetWarning :: IO () Source #

Sets the environment variable for disabling tezos-client "not a mainnet" warning

runContract

runContract :: forall cp st m. (HasTezosRpc m, ParameterScope cp, StorageScope st) => RunContractParameters cp st -> m (AsRPC (Value st)) Source #

Run contract with given parameter and storage and get new storage without injecting anything to the chain.

data RunContractParameters cp st Source #

A structure with all the parameters for runContract

Constructors

RunContractParameters 

Fields

runContractParameters :: Contract cp st -> MaybeRPC (Value cp) -> MaybeRPC (Value st) -> RunContractParameters cp st Source #

Initializes the parameters for runContract with sensible defaults.

Use the with* lenses to set any optional parameters.

withBalance :: forall cp st. Lens' (RunContractParameters cp st) Mutez Source #

withAmount :: forall cp st. Lens' (RunContractParameters cp st) Mutez Source #

withSender :: forall cp st. Lens' (RunContractParameters cp st) (Maybe Address) Source #

withSource :: forall cp st. Lens' (RunContractParameters cp st) (Maybe Address) Source #

tezos-client password-related helpers

scrubbedBytesToString :: ScrubbedBytes -> String Source #

Convert ScrubbedBytes to String, so that it can be passed to tezos-client as a stdin

readScrubbedBytes :: MonadIO m => m ScrubbedBytes Source #

Function for relatively safe getting password from stdin. After reading bytes are converted to ScrubbedBytes, thus it's harder to accidentally leak them.