morley-client-0.1.0: 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 :: 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.

Storage type is limited to not have any bigmaps because their updates are treated differently in node RPC and its quite nontrivial to properly support storage update when storage type contains bigmaps.

runContractSimple Source #

Arguments

:: forall cp st m. (HasTezosRpc m, ParameterScope cp, StorageScope st) 
=> Contract cp st

Contract

-> Value cp

Parameter passed to the contract

-> Value st

Initial storage

-> Mutez

Initial balance

-> m (AsRPC (Value st)) 

Simplified version of runContract for convenience

Sets transfer amount to 0 and sender and source are both unspecified.

data RunContractParameters cp st Source #

A structure with all the parameters for runContract

Constructors

RunContractParameters 

Fields

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.