All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.knowm.xchange.kucoin.service.SymbolAPI Maven / Gradle / Ivy

The newest version!
/** Copyright 2019 Mek Global Limited. */
package org.knowm.xchange.kucoin.service;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import org.knowm.xchange.kucoin.dto.KucoinException;
import org.knowm.xchange.kucoin.dto.response.AllTickersResponse;
import org.knowm.xchange.kucoin.dto.response.CurrenciesResponse;
import org.knowm.xchange.kucoin.dto.response.CurrencyResponseV2;
import org.knowm.xchange.kucoin.dto.response.KucoinResponse;
import org.knowm.xchange.kucoin.dto.response.SymbolResponse;
import org.knowm.xchange.kucoin.dto.response.SymbolTickResponse;
import org.knowm.xchange.kucoin.dto.response.TickerResponse;

/** Based on code by chenshiwei on 2019/1/11. */
@Path("api")
@Produces(MediaType.APPLICATION_JSON)
public interface SymbolAPI {

  /**
   * Get a list of available currency pairs for trading.
   *
   * @return The available symbols.
   * @deprecated use {@link #getSymbolsV2()}
   */
  @GET
  @Path("/v1/symbols")
  @Deprecated
  KucoinResponse> getSymbols() throws IOException, KucoinException;

  /**
   * Get a list of available currency pairs for trading.
   *
   * @return The available symbols.
   */
  @GET
  @Path("/v2/symbols")
  KucoinResponse> getSymbolsV2() throws IOException, KucoinException;

  /**
   * Get a list of available currencies for trading.
   *
   * @return The available currencies.
   */
  @GET
  @Path("/v1/currencies")
  KucoinResponse> getCurrencies() throws IOException, KucoinException;

  /**
   * Get currency detail.
   *
   * @return The available currencies.
   */
  @GET
  @Path("/v2/currencies/{currency}")
  KucoinResponse getCurrencies(@PathParam("currency") String currency) throws IOException, KucoinException;

  /**
   * Get the fiat price of the currencies for the available trading pairs.
   *
   * @return USD fiat price of the currencies.
   */
  @GET
  @Path("/v1/prices")
  KucoinResponse> getPrices() throws IOException, KucoinException;

  /**
   * Ticker include only the inside (i.e. best) bid and ask data , last price and last trade size.
   *
   * @param symbol The currency
   * @return The ticker.
   */
  @GET
  @Path("/v1/market/orderbook/level1")
  KucoinResponse getTicker(@QueryParam("symbol") String symbol) throws IOException, KucoinException;

  /**
   * Request market tickers for all the trading pairs in the market (including 24h volume).
   *
   * @return The allTickersTickerResponse.
   */
  @GET
  @Path("/v1/market/allTickers")
  KucoinResponse getTickers() throws IOException, KucoinException;

  /**
   * Get 24 hr stats for the symbol. volume is in base currency units. open, high, low are in quote
   * currency units.
   *
   * @param symbol The symbol to fetch.
   * @return The 24hr stats for the symbol.
   */
  @GET
  @Path("/v1/market/stats")
  KucoinResponse getMarketStats(@QueryParam("symbol") String symbol)
      throws IOException, KucoinException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy