module Network.Ipfs.Api.Swarm where
import Control.Monad.IO.Class (MonadIO)
import Data.Text (Text)
import Network.Ipfs.Api.Internal (_swarmConnect,
_swarmDisconnect,
_swarmFilterAdd,
_swarmFilterRm, _swarmFilters,
_swarmPeers)
import Network.Ipfs.Api.Internal.Call (call)
import Network.Ipfs.Api.Types (SwarmObj, SwarmPeersObj)
import Network.Ipfs.Client (IpfsT)
swarmPeers :: MonadIO m => IpfsT m SwarmPeersObj
swarmPeers = call _swarmPeers
connect :: MonadIO m => Text -> IpfsT m SwarmObj
connect = call . _swarmConnect . Just
disconnect :: MonadIO m => Text -> IpfsT m SwarmObj
disconnect = call . _swarmDisconnect . Just
filters :: MonadIO m => IpfsT m SwarmObj
filters = call _swarmFilters
filterAdd :: MonadIO m => Text -> IpfsT m SwarmObj
filterAdd = call . _swarmFilterAdd . Just
filterRm :: MonadIO m => Text -> IpfsT m SwarmObj
filterRm = call . _swarmFilterRm . Just