-
- All Implemented Interfaces:
-
dev.sublab.substrate.modules.state.StateModule
public final class StateModuleClient implements StateModule
State RPC client which handles fetching storage item and runtime metadata
-
-
Constructor Summary
Constructors Constructor Description StateModuleClient(ScaleCodec<String> codec, Rpc rpc, HashersProvider hashersProvider)
-
Method Summary
Modifier and Type Method Description RuntimeMetadatagetRuntimeMetadata()Gets runtime metadata <T extends Any> TfetchStorageItem(RuntimeModuleStorageItem item, RuntimeModuleStorage storage, KClass<T> type)Fetches a storage item <T extends Any> TfetchStorageItem(RuntimeModuleStorageItem item, ByteArrayConvertible key, RuntimeModuleStorage storage, KClass<T> type)Fetches a storage item <T extends Any> TfetchStorageItem(RuntimeModuleStorageItem item, List<ByteArrayConvertible> keys, RuntimeModuleStorage storage, KClass<T> type)Fetches a storage item -
-
Constructor Detail
-
StateModuleClient
StateModuleClient(ScaleCodec<String> codec, Rpc rpc, HashersProvider hashersProvider)
-
-
Method Detail
-
getRuntimeMetadata
RuntimeMetadata getRuntimeMetadata()
Gets runtime metadata
-
fetchStorageItem
<T extends Any> T fetchStorageItem(RuntimeModuleStorageItem item, RuntimeModuleStorage storage, KClass<T> type)
Fetches a storage item
- Parameters:
item- an item to be hashed to get a key which can be used asRpcRequest's parametersstorage- storage for which a storage hasher is created, which hashes the item
-
fetchStorageItem
<T extends Any> T fetchStorageItem(RuntimeModuleStorageItem item, ByteArrayConvertible key, RuntimeModuleStorage storage, KClass<T> type)
Fetches a storage item
- Parameters:
item- an item to be hashed to get a key which can be used asRpcRequest's parameterskey- A key to be used when hashing in a storage hasher.storage- storage for which a storage hasher is created, which hashes the item
-
fetchStorageItem
<T extends Any> T fetchStorageItem(RuntimeModuleStorageItem item, List<ByteArrayConvertible> keys, RuntimeModuleStorage storage, KClass<T> type)
Fetches a storage item
- Parameters:
item- an item to be hashed to get a key which can be used asRpcRequest's parameterskeys- Keys to be used when hashing in a storage hasher.storage- storage for which a storage hasher is created, which hashes the item
-
-
-
-