X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=api%2Froutes.go;h=385db9a8e7d1ba2646ac34e2d0ce2fbe82c54324;hb=refs%2Fheads%2Fpoloniex_balance;hp=d7e712c7c5f0495717ef850e88695a401781037c;hpb=3602fbf8412d69900d793a963c8e774f487f5e45;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FFront.git diff --git a/api/routes.go b/api/routes.go index d7e712c..385db9a 100644 --- a/api/routes.go +++ b/api/routes.go @@ -41,6 +41,7 @@ var Groups = []Group{ []Route{ {"GET", []gin.HandlerFunc{GetMarketConfig}, "/:name"}, {"POST", []gin.HandlerFunc{UpdateMarketConfig}, "/:name/update"}, + {"GET", []gin.HandlerFunc{GetMarketBalance}, "/:name/balance"}, }, }, } @@ -111,6 +112,16 @@ func GetMarketConfig(c *gin.Context) { RunQuery(query, c) } +func GetMarketBalance(c *gin.Context) { + query := &MarketBalanceQuery{} + + query.In.User = GetUser(c) + query.In.Market = c.Param("name") + query.In.Currency = "BTC" + + RunQuery(query, c) +} + func UpdateMarketConfig(c *gin.Context) { query := &UpdateMarketConfigQuery{}