Skip to content

Commit 370dbdd

Browse files
committed
feat: update from v1 to v0 and refactor it's use
1 parent c8387d5 commit 370dbdd

File tree

1 file changed

+11
-8
lines changed
  • geniusyield-server-lib/src/GeniusYield/Server

1 file changed

+11
-8
lines changed

geniusyield-server-lib/src/GeniusYield/Server/Api.hs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,18 @@ type TradingFeesAPI =
8686

8787
type AssetsAPI = Summary "Get assets information" :> Description "Get information for a specific asset." :> Capture "asset" GYAssetClass :> Get '[JSON] AssetDetails
8888

89-
type V1API =
89+
type V0API =
9090
"settings" :> SettingsAPI
9191
:<|> "orders" :> DEXPartialOrderAPI
9292
:<|> "markets" :> MarketsAPI
9393
:<|> "tx" :> TxAPI
9494
:<|> "trading_fees" :> TradingFeesAPI
9595
:<|> "assets" :> AssetsAPI
9696

97-
type GeniusYieldAPI = "v1" :> V1API
97+
type V0 Symbol
98+
type V0 = "v0"
99+
100+
type GeniusYieldAPI = V0 :> V0API
98101

99102
geniusYieldAPI Proxy GeniusYieldAPI
100103
geniusYieldAPI = Proxy
@@ -116,12 +119,12 @@ geniusYieldAPISwagger =
116119
& info
117120
. description
118121
?~ "API to interact with GeniusYield DEX."
119-
& applyTagsFor (subOperations (Proxy Proxy ("v1" :> "tx" :> TxAPI)) (Proxy Proxy GeniusYieldAPI)) ["Transaction" & description ?~ "Endpoints related to transaction hex such as submitting a transaction"]
120-
& applyTagsFor (subOperations (Proxy Proxy ("v1" :> "markets" :> MarketsAPI)) (Proxy Proxy GeniusYieldAPI)) ["Markets" & description ?~ "Endpoints related to accessing markets information"]
121-
& applyTagsFor (subOperations (Proxy Proxy ("v1" :> "orders" :> DEXPartialOrderAPI)) (Proxy Proxy GeniusYieldAPI)) ["Orders" & description ?~ "Endpoints related to interacting with orders"]
122-
& applyTagsFor (subOperations (Proxy Proxy ("v1" :> "settings" :> SettingsAPI)) (Proxy Proxy GeniusYieldAPI)) ["Settings" & description ?~ "Endpoint to get server settings such as network, version, and revision"]
123-
& applyTagsFor (subOperations (Proxy Proxy ("v1" :> "trading_fees" :> TradingFeesAPI)) (Proxy Proxy GeniusYieldAPI)) ["Trading Fees" & description ?~ "Endpoint to get trading fees of DEX."]
124-
& applyTagsFor (subOperations (Proxy Proxy ("v1" :> "assets" :> AssetsAPI)) (Proxy Proxy GeniusYieldAPI)) ["Assets" & description ?~ "Endpoint to fetch asset details."]
122+
& applyTagsFor (subOperations (Proxy Proxy (V0 :> "tx" :> TxAPI)) (Proxy Proxy GeniusYieldAPI)) ["Transaction" & description ?~ "Endpoints related to transaction hex such as submitting a transaction"]
123+
& applyTagsFor (subOperations (Proxy Proxy (V0 :> "markets" :> MarketsAPI)) (Proxy Proxy GeniusYieldAPI)) ["Markets" & description ?~ "Endpoints related to accessing markets information"]
124+
& applyTagsFor (subOperations (Proxy Proxy (V0 :> "orders" :> DEXPartialOrderAPI)) (Proxy Proxy GeniusYieldAPI)) ["Orders" & description ?~ "Endpoints related to interacting with orders"]
125+
& applyTagsFor (subOperations (Proxy Proxy (V0 :> "settings" :> SettingsAPI)) (Proxy Proxy GeniusYieldAPI)) ["Settings" & description ?~ "Endpoint to get server settings such as network, version, and revision"]
126+
& applyTagsFor (subOperations (Proxy Proxy (V0 :> "trading_fees" :> TradingFeesAPI)) (Proxy Proxy GeniusYieldAPI)) ["Trading Fees" & description ?~ "Endpoint to get trading fees of DEX."]
127+
& applyTagsFor (subOperations (Proxy Proxy (V0 :> "assets" :> AssetsAPI)) (Proxy Proxy GeniusYieldAPI)) ["Assets" & description ?~ "Endpoint to fetch asset details."]
125128

126129
geniusYieldServer Ctx ServerT GeniusYieldAPI IO
127130
geniusYieldServer ctx =

0 commit comments

Comments
 (0)