-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Binding to mybitcoin.com's Shopping Cart Interface. -- -- See http://bitcoin.org and http://mybitcoin.com for more -- information. @package mybitcoin-sci @version 0.2 -- | Interface to mybitcoin.com's shopping cart interface. -- -- After entering your credentials into the config structure, you should -- be able to use the library like this: -- -- Behold my glorious fortune: -- --
-- *Network.MyBitcoin> mbcGetBalance myConfig
-- [("SCI Version","1.0"),("SCI Code","1"),("SCI Reason","OK"),("SCI Balance","0.49000000000")]
--
--
-- Well, how much are 0.49 bitcoins worth?
--
-- -- *Network.MyBitcoin> fmap (lookup "SCI Currency USD Rate") $ mbcGetRates myConfig -- Just "17.113100" ---- -- Can we be sure the responses are authentic? -- --
-- *Network.MyBitcoin> mbcPostProcess myConfig "response" -- *** Exception: GPG Signature failure! ---- -- This library is shaped after the PHP interface to mybitcoin.com. It -- uses libcurl and verifies responses with GPG. To enable verification, -- you need to add the mybitcoin public key to your GPG keychain. module Network.MyBitcoin data Config Config :: String -> String -> FilePath -> Bool -> Config cfgUserName :: Config -> String cfgAutoKey :: Config -> String cfgGPGBinary :: Config -> FilePath cfgEnableGPG :: Config -> Bool -- | This method is used for sending bitcoins to other bitcoin addresses. -- Mybitcoin.com uses a two-step commit procedure where you have to -- confirm a receipt before the transaction is final. mbcSpend :: Config -> String -> Rational -> String -> String -> IO [(String, String)] -- | Returns the key "SCI Balance" with your account balance. mbcGetBalance :: Config -> IO [(String, String)] -- | Lists bitcoin exchange rates for various currencies. Presumably taken -- from Mt. Gox. mbcGetRates :: Config -> IO [(String, String)] -- | This function is used for receiving payments. You receive payments by -- redirecting customers to the mybitcoin pay page with your bitcoin -- address in the query arguments. This method lets you do that without -- revealing your bitcoin address. See the Merchant Tools at -- mybitcoin.com for more information. mbcEncryptFormData :: Config -> String -> IO [(String, String)] -- | Parse and verify (if enabled) a message from mybitcoin.com. This -- method is used when processing receipts. See mbcSpend. mbcPostProcess :: Config -> String -> IO [(String, String)]