{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
module Network.Ipfs.Api.Key where
import Control.Monad.IO.Class (MonadIO)
import Data.Text (Text)
import Network.Ipfs.Api.Internal (_keyGen, _keyList, _keyRename,
_keyRm)
import Network.Ipfs.Api.Internal.Call (call)
import Network.Ipfs.Api.Types (KeyDetailsObj, KeyObj,
KeyRenameObj)
import Network.Ipfs.Client (IpfsT)
list :: MonadIO m => IpfsT m KeyObj
list = call _keyList
gen :: MonadIO m => Text -> Text -> IpfsT m KeyDetailsObj
gen name = call . _keyGen name . Just
rename :: MonadIO m => Text -> Text -> IpfsT m KeyRenameObj
rename was = call . _keyRename was . Just
rm :: MonadIO m => Text -> IpfsT m KeyObj
rm = call . _keyRm