Added client for payouts endpoint.
[?]
Jan 15, 2015, 5:37 AM
4IQVQL4TS35GL2GYZJG254TKJLL5EHMRSFT77Z4VTRZIG2TMBM3QCDependencies
- [2]
W35DDBFYFactor common JSON conversions up into client lib module. - [3]
64C6AWH6Rename Ananke -> Quixotic, project reboot. - [4]
WZUHEZSBStart of migration back toward snap. - [*]
5W5M56VJMove library code to 'lib' - [*]
OBFPJS2GProject successfully builds and tests under nix. - [*]
TCOAKCGGCompleted conversion to snap. - [*]
WO2MINIFAuctions now compile!
Change contents
- file addition: Client.hs[6.18]
{-# LANGUAGE ScopedTypeVariables, OverloadedStrings, NoImplicitPrelude #-}module Quixotic.Client whereimport ClassyPreludeimport Control.Lensimport Network.Wreqimport Quixotic.Jsonimport Quixotic.TimeLogdata QCConfig = QCConfig{ quixoticHost :: String, quixoticPort :: Int}currentPayouts :: QCConfig -> IO PayoutscurrentPayouts cfg = doresp <- get (quixoticHost cfg <> "/payouts")payoutsResponse <- asJSON resppure . runPayoutsResponse $ payoutsResponse ^. responseBody - replacement in lib/Quixotic/Json.hs at line 15
newtype PayoutsResponse = PayoutsResponse Payoutsnewtype PayoutsResponse = PayoutsResponse { runPayoutsResponse :: Payouts } - replacement in lib/Quixotic/Json.hs at line 18
toJSON (PayoutsResponse p) = toJSON m wherem :: Map Text Doublem = fmap fromRational $ mapKeys (^. address) ptoJSON (PayoutsResponse p) =toJSON $ mapKeys (^. address) p - edit in lib/Quixotic/Json.hs at line 21
instance FromJSON PayoutsResponse whereparseJSON v =fmap (PayoutsResponse . mapKeys BtcAddr) $ parseJSON v - edit in payouts/Main.hs at line 11
import Quixotic.Client - replacement in quixotic.cabal at line 4
Description: A service to enable groups of trusted contributors to be paid for their effortsin collaboratively developing commercial applications.Description: A time logging and payment distribution service to enable groups of trusted contributorsto collaboratively develop commercial applications. - edit in quixotic.cabal at line 20
Quixotic.Client - edit in quixotic.cabal at line 42[9.2111][3.1311]
, network-bitcoin, wreq