Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- epNameToTezosEp :: EpName -> Text
- extractAddressesFromValue :: Value -> [Address]
- disableAlphanetWarning :: IO ()
- runContract :: forall cp st m. (HasTezosRpc m, StorageScope st) => RunContractParameters cp st -> m (AsRPC (Value st))
- data RunContractParameters cp st = RunContractParameters {
- rcpContract :: Contract cp st
- rcpParameter :: Value
- rcpStorage :: Value
- rcpBalance :: Mutez
- rcpNow :: Maybe Timestamp
- rcpLevel :: Maybe Natural
- rcpAmount :: Mutez
- rcpSender :: Maybe ImplicitAddress
- rcpSource :: Maybe ImplicitAddress
- runContractParameters :: (HasNoOp cp, HasNoOp st) => Contract cp st -> Value cp -> Value st -> RunContractParameters cp st
- withBalance :: forall cp st. Lens' (RunContractParameters cp st) Mutez
- withAmount :: forall cp st. Lens' (RunContractParameters cp st) Mutez
- withSender :: forall cp st. Lens' (RunContractParameters cp st) (Maybe ImplicitAddress)
- withSource :: forall cp st. Lens' (RunContractParameters cp st) (Maybe ImplicitAddress)
- withLevel :: forall cp st. Lens' (RunContractParameters cp st) (Maybe Natural)
- withNow :: forall cp st. Lens' (RunContractParameters cp st) (Maybe Timestamp)
- scrubbedBytesToString :: ScrubbedBytes -> String
- readScrubbedBytes :: MonadIO m => m ScrubbedBytes
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, 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
RunContractParameters | |
|
runContractParameters :: (HasNoOp cp, HasNoOp st) => Contract cp st -> Value cp -> 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 ImplicitAddress) Source #
withSource :: forall cp st. Lens' (RunContractParameters cp st) (Maybe ImplicitAddress) 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.