forked from luno/luno-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLuno.java
69 lines (60 loc) · 2.08 KB
/
Luno.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package com.luno;
import java.io.IOException;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import com.luno.dto.LunoException;
import com.luno.dto.marketdata.LunoOrderBook;
import com.luno.dto.marketdata.LunoTicker;
import com.luno.dto.marketdata.LunoTickers;
import com.luno.dto.marketdata.LunoTrades;
/**
* @see https://www.luno.com/en/api
*/
@Path("api/1")
@Produces(MediaType.APPLICATION_JSON)
public interface Luno {
/**
* Market data API calls can be accessed by anyone without authentication.
* @param pair required - Currency pair e.g. XBTZAR
* @return
* @throws IOException
* @throws LunoException
*/
@GET
@Path("ticker")
LunoTicker ticker(@QueryParam("pair") String pair) throws IOException, LunoException;
/**
* Returns the latest ticker indicators from all active Luno exchanges.
* @return
* @throws IOException
* @throws LunoException
*/
@GET
@Path("tickers")
LunoTickers tickers() throws IOException, LunoException;
/**
* Returns a list of bids and asks in the order book. Ask orders are sorted by price ascending. Bid orders are sorted by
* price descending. Note that multiple orders at the same price are not necessarily conflated.
* @param pair required - Currency pair e.g. XBTZAR
* @return
* @throws IOException
* @throws LunoException
*/
@GET
@Path("orderbook")
LunoOrderBook orderbook(@QueryParam("pair") String pair) throws IOException, LunoException;
/**
* Returns a list of the most recent trades. At most 100 results are returned per call.
* @param pair required - Currency pair e.g. XBTZAR
* @param since optional - Fetch trades executed after this time, specified as a Unix timestamp in milliseconds.
* @return
* @throws IOException
* @throws LunoException
*/
@GET
@Path("trades")
LunoTrades trades(@QueryParam("pair") String pair, @QueryParam("since") Long since) throws IOException, LunoException;
}