module Network.Ipfs.Api.Pubsub where
import Control.Monad.IO.Class (MonadIO)
import Data.Text (Text)
import Servant.API.ContentTypes (NoContent)
import Network.Ipfs.Api.Internal (_pubsubLs, _pubsubPeers,
_pubsubPublish)
import Network.Ipfs.Api.Internal.Call (call)
import Network.Ipfs.Api.Types (PubsubObj)
import Network.Ipfs.Client (IpfsT)
ls :: MonadIO m => IpfsT m PubsubObj
ls = call _pubsubLs
peers :: MonadIO m => IpfsT m PubsubObj
peers = call _pubsubPeers
publish :: MonadIO m => Text -> Text -> IpfsT m NoContent
publish topic = call . _pubsubPublish topic . Just