View on GitHub
File Changes
-- have to be revisited later.
type API
     = "wallets" :> (Get '[ JSON] [Wallet]
-
                     :<|> "active" :> "pubkey" :> Get '[ JSON] PubKey
-
                     :<|> "active" :> "sign" :> ReqBody '[JSON] BSL.ByteString :> Post '[ JSON] Signature
+
                     :<|> "active" :> ("pubkey" :> Get '[ JSON] PubKey
+
                                       :<|> "sign" :> ReqBody '[ JSON] BSL.ByteString :> Post '[ JSON] Signature)
                     :<|> (Capture "walletId" WalletId :> ("coin-selections" :> "random" :> ReqBody '[ JSON] Value :> Get '[ JSON] ( [Value]
                                                                                                                                   , Value)
                                                           :<|> "addresses" :> "new" :> Post '[ JSON] PubKey)))
  where
    api = client (Proxy @API)
    getWallets_ = left api
-
    getOwnPubKey_ = right api & left
-
    sign_ = right api & right & left
-
    byWalletId = right api & right & right
+
    active_ = right api & left
+
    getOwnPubKey_ = left active_
+
    sign_ = right active_
+
    byWalletId =  right api & right
    selectCoins_ walletId = byWalletId walletId & left
    allocateAddress_ walletId = byWalletId walletId & right

                      
app =
    serve (Proxy @API) $
    hoistServer (Proxy @API) asHandler $
-
    wallets :<|> getOwnPubKey :<|> sign :<|>
+
    wallets :<|> (getOwnPubKey :<|> sign) :<|>
    capture (selectCoin :<|> allocateAddress)

                      
main :: (MonadIO m, MonadLogger m) => m ()