{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Network.Polkadot.Api.Chain where
import Data.ByteArray.HexString (HexString)
import Network.JsonRpc.TinyClient (JsonRpc (..))
import Network.Polkadot.Api.Types (Header, SignedBlock)
getBlock :: JsonRpc m
=> Maybe HexString
-> m (Maybe SignedBlock)
{-# INLINE getBlock #-}
getBlock = remote "chain_getBlock"
getBlockHash :: JsonRpc m
=> Maybe Int
-> m (Maybe HexString)
{-# INLINE getBlockHash #-}
getBlockHash = remote "chain_getBlockHash"
getFinalizedHead :: JsonRpc m => m HexString
{-# INLINE getFinalizedHead #-}
getFinalizedHead = remote "chain_getFinalizedHead"
getHeader :: JsonRpc m
=> Maybe HexString
-> m (Maybe Header)
{-# INLINE getHeader #-}
getHeader = remote "chain_getHeader"