{-# LANGUAGE FlexibleContexts  #-}
{-# LANGUAGE OverloadedStrings #-}
module Network.Polkadot.Api.State where
import           Data.Text                  (Text)
import           Data.ByteArray.HexString   (HexString)
import           Network.JsonRpc.TinyClient (JsonRpc (..))
import           Network.Polkadot.Api.Types (Metadata, ReadProof,
                                             RuntimeVersion, StorageChangeSet)
call :: JsonRpc m
     => Text
     
     -> HexString
     
     -> Maybe HexString
     
     -> m HexString
{-# INLINE call #-}
call = remote "state_call"
getChildKeys :: JsonRpc m
             => HexString
             
             -> HexString
             
             -> Int
             
             -> HexString
             
             -> Maybe HexString
             
             -> m [HexString]
{-# INLINE getChildKeys #-}
getChildKeys = remote "state_getChildKeys"
getChildStorage :: JsonRpc m
                => HexString
                
                -> HexString
                
                -> Int
                
                -> HexString
                
                -> Maybe HexString
                
                -> m HexString
{-# INLINE getChildStorage #-}
getChildStorage = remote "state_getChildStorage"
getChildStorageHash :: JsonRpc m
                    => HexString
                    
                    -> HexString
                    
                    -> Int
                    
                    -> HexString
                    
                    -> Maybe HexString
                    
                    -> m HexString
{-# INLINE getChildStorageHash #-}
getChildStorageHash = remote "state_getChildStorageHash"
getChildStorageSize :: JsonRpc m
                    => HexString
                    
                    -> HexString
                    
                    -> Int
                    
                    -> HexString
                    
                    -> Maybe HexString
                    
                    -> m Int
{-# INLINE getChildStorageSize #-}
getChildStorageSize = remote "state_getChildStorageSize"
getKeys :: JsonRpc m
        => HexString
        
        -> Maybe HexString
        
        -> m [HexString]
{-# INLINE getKeys #-}
getKeys = remote "state_getKeys"
getMetadata :: JsonRpc m => m Metadata
{-# INLINE getMetadata #-}
getMetadata = remote "state_getMetadata"
getReadProof :: JsonRpc m
             => [HexString]
             
             -> Maybe HexString
             
             -> m ReadProof
{-# INLINE getReadProof #-}
getReadProof = remote "state_getReadProof"
getRuntimeVersion :: JsonRpc m
                  => Maybe HexString
                  
                  -> m RuntimeVersion
{-# INLINE getRuntimeVersion #-}
getRuntimeVersion = remote "state_getRuntimeVersion"
getStorage :: JsonRpc m
           => HexString
           
           -> Maybe HexString
           
           -> m HexString
{-# INLINE getStorage #-}
getStorage = remote "state_getStorage"
getStorageHash :: JsonRpc m
               => HexString
               
               -> Maybe HexString
               
               -> m HexString
{-# INLINE getStorageHash #-}
getStorageHash = remote "state_getStorageHash"
getStorageSize :: JsonRpc m
               => HexString
               
               -> Maybe HexString
               
               -> m Int
{-# INLINE getStorageSize #-}
getStorageSize = remote "state_getStorageSize"
queryStorage :: JsonRpc m
             => [HexString]
             
             -> HexString
             
             -> Maybe HexString
             
             -> m [StorageChangeSet]
{-# INLINE queryStorage #-}
queryStorage = remote "state_queryStorage"
queryStorageAt :: JsonRpc m
               => [HexString]
               
               -> Maybe HexString
               
               -> m [StorageChangeSet]
{-# INLINE queryStorageAt #-}
queryStorageAt = remote "state_queryStorageAt"