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

Morley.Client.RPC.Getters

Description

Some read-only actions (wrappers over RPC calls).

Synopsis

Documentation

readAllBigMapValues :: forall v k m. (NiceUnpackedValue v, HasTezosRpc m) => BigMapId k v -> m [v] Source #

Read all big_map values, given it's ID. If the values are not of the expected type, a ValueDecodeFailure will be thrown.

readAllBigMapValuesMaybe :: forall v k m. (NiceUnpackedValue v, HasTezosRpc m) => BigMapId k v -> m (Maybe [v]) Source #

Read all big_map values, given it's ID. If the values are not of the expected type, a ValueDecodeFailure will be thrown.

Returns Nothing if a big_map with the given ID does not exist.

readContractBigMapValue :: forall k v m. (PackedValScope k, HasTezosRpc m, SingI v) => ContractAddress -> Value k -> m (Value v) Source #

Read big_map value of given contract by key.

If the contract contains several big_maps with given key type, only one of them will be considered.

readBigMapValueMaybe :: forall v k m. (NicePackedValue k, NiceUnpackedValue v, HasTezosRpc m) => BigMapId k v -> k -> m (Maybe v) Source #

Read big_map value, given it's ID and a key. If the value is not of the expected type, a ValueDecodeFailure will be thrown.

Returns Nothing if a big_map with the given ID does not exist, or it does exist but does not contain the given key.

readBigMapValue :: forall v k m. (NicePackedValue k, NiceUnpackedValue v, HasTezosRpc m) => BigMapId k v -> k -> m v Source #

Read big_map value, given it's ID and a key. If the value is not of the expected type, a ValueDecodeFailure will be thrown.

getContract :: HasTezosRpc m => ContractAddress -> m Contract Source #

Get originated Contract for some address.

getImplicitContractCounter :: HasTezosRpc m => ImplicitAddress -> m TezosInt64 Source #

Get counter value for given implicit address.

getContractsParameterTypes :: HasTezosRpc m => [ContractAddress] -> m TcOriginatedContracts Source #

Extract parameter types for all smart contracts' addresses and return mapping from their hashes to their parameter types

getContractStorage :: HasTezosRpc m => ContractAddress -> m Expression Source #

getContractStorageAtBlock applied to the head block.

getBigMapValue :: HasTezosRpc m => Natural -> Text -> m Expression Source #

getBigMapValueAtBlock applied to the head block.

getBigMapValues :: HasTezosRpc m => Natural -> Maybe Natural -> Maybe Natural -> m Expression Source #

getBigMapValuesAtBlock applied to the head block.

getHeadBlock :: HasTezosRpc m => m BlockHash Source #

Get hash of the current head block, this head hash is used in other RPC calls.

getCounter :: HasTezosRpc m => ImplicitAddress -> m TezosInt64 Source #

getCounterAtBlock applied to the head block.

forgeOperation :: HasTezosRpc m => ForgeOperation -> m HexJSONByteString Source #

forgeOperationAtBlock applied to the head block.

getContractScript :: HasTezosRpc m => ContractAddress -> m OriginationScript Source #

getContractScriptAtBlock applied to the head block.

getContractBigMap :: HasTezosRpc m => ContractAddress -> GetBigMap -> m GetBigMapResult Source #

getContractBigMapAtBlock applied to the head block.

getBalance :: forall kind m. (HasTezosRpc m, L1AddressKind kind) => KindedAddress kind -> m Mutez Source #

getBalanceAtBlock applied to the head block.

getDelegate :: HasTezosRpc m => ContractAddress -> m (Maybe KeyHash) Source #

getDelegateAtBlock applied to the head block.

runCode :: HasTezosRpc m => RunCode -> m RunCodeResult Source #

runCodeAtBlock applied to the head block.

getManagerKey :: HasTezosRpc m => ImplicitAddress -> m (Maybe PublicKey) Source #