{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wall #-}
module Network.Bitcoin.Dump ( PrivateKey
, importPrivateKey
, dumpPrivateKey
) where
import Network.Bitcoin.Internal
type PrivateKey = Text
importPrivateKey :: Client
-> PrivateKey
-> Maybe Account
-> IO ()
importPrivateKey client pk Nothing =
unNil <$> callApi client "importprivkey" [ tj pk ]
importPrivateKey client pk (Just label) =
unNil <$> callApi client "importprivkey" [ tj pk, tj label ]
dumpPrivateKey :: Client
-> Address
-> IO PrivateKey
dumpPrivateKey client addr = callApi client "dumpprivkey" [ tj addr ]