Skip to content

Commit 984d242

Browse files
committed
spot public trades supports time range query
1 parent fbb4039 commit 984d242

9 files changed

Lines changed: 94 additions & 38 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
Gate API v4
44

5-
- API version: 4.22.2
6-
- SDK version: 6.22.2
5+
- API version: 4.22.3
6+
- SDK version: 6.22.3
77

88
Welcome to Gate.io API
99

@@ -67,7 +67,7 @@ Add this dependency to your project's POM:
6767
<dependency>
6868
<groupId>io.gate</groupId>
6969
<artifactId>gate-api</artifactId>
70-
<version>6.22.2</version>
70+
<version>6.22.3</version>
7171
<scope>compile</scope>
7272
</dependency>
7373
```
@@ -77,7 +77,7 @@ Add this dependency to your project's POM:
7777
Add this dependency to your project's build file:
7878

7979
```groovy
80-
compile "io.gate:gate-api:6.22.2"
80+
compile "io.gate:gate-api:6.22.3"
8181
```
8282

8383
### Others
@@ -90,7 +90,7 @@ mvn clean package
9090

9191
Then manually install the following JARs:
9292

93-
* `target/gate-api-6.22.2.jar`
93+
* `target/gate-api-6.22.3.jar`
9494
* `target/lib/*.jar`
9595

9696
## Getting Started

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'eclipse'
33
apply plugin: 'java'
44

55
group = 'io.gate'
6-
version = '6.22.2'
6+
version = '6.22.3'
77

88
buildscript {
99
repositories {

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
22
settings(
33
organization := "io.gate",
44
name := "gate-api",
5-
version := "6.22.2",
5+
version := "6.22.3",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),

docs/MarginApi.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,8 @@ public class Example {
327327
MarginApi apiInstance = new MarginApi(defaultClient);
328328
String currency = "currency_example"; // String | List records related to specified currency only. If specified, `currency_pair` is also required.
329329
String currencyPair = "currencyPair_example"; // String | List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided
330-
Long from = 56L; // Long | Time range beginning, default to 7 days before current time
331-
Long to = 56L; // Long | Time range ending, default to current time
330+
Long from = 1627706330L; // Long | Start timestamp of the query
331+
Long to = 1635329650L; // Long | Time range ending, default to current time
332332
Integer page = 1; // Integer | Page number
333333
Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
334334
try {
@@ -360,7 +360,7 @@ Name | Type | Description | Notes
360360
------------- | ------------- | ------------- | -------------
361361
**currency** | **String**| List records related to specified currency only. If specified, &#x60;currency_pair&#x60; is also required. | [optional]
362362
**currencyPair** | **String**| List records related to specified currency pair. Used in combination with &#x60;currency&#x60;. Ignored if &#x60;currency&#x60; is not provided | [optional]
363-
**from** | **Long**| Time range beginning, default to 7 days before current time | [optional]
363+
**from** | **Long**| Start timestamp of the query | [optional]
364364
**to** | **Long**| Time range ending, default to current time | [optional]
365365
**page** | **Integer**| Page number | [optional] [default to 1]
366366
**limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
@@ -1746,8 +1746,8 @@ public class Example {
17461746

17471747
MarginApi apiInstance = new MarginApi(defaultClient);
17481748
String currency = "currency_example"; // String | Filter by currency
1749-
Long from = 56L; // Long | Time range beginning, default to 7 days before current time
1750-
Long to = 56L; // Long | Time range ending, default to current time
1749+
Long from = 1627706330L; // Long | Start timestamp of the query
1750+
Long to = 1635329650L; // Long | Time range ending, default to current time
17511751
Integer page = 1; // Integer | Page number
17521752
Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
17531753
String type = "borrow"; // String | Only retrieve changes of the specified type. All types will be returned if not specified.
@@ -1779,7 +1779,7 @@ public class Example {
17791779
Name | Type | Description | Notes
17801780
------------- | ------------- | ------------- | -------------
17811781
**currency** | **String**| Filter by currency | [optional]
1782-
**from** | **Long**| Time range beginning, default to 7 days before current time | [optional]
1782+
**from** | **Long**| Start timestamp of the query | [optional]
17831783
**to** | **Long**| Time range ending, default to current time | [optional]
17841784
**page** | **Integer**| Page number | [optional] [default to 1]
17851785
**limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]

docs/SpotApi.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,12 @@ No authorization required
424424

425425
<a name="listTrades"></a>
426426
# **listTrades**
427-
> List&lt;Trade&gt; listTrades(currencyPair).limit(limit).lastId(lastId).reverse(reverse).execute();
427+
> List&lt;Trade&gt; listTrades(currencyPair).limit(limit).lastId(lastId).reverse(reverse).from(from).to(to).page(page).execute();
428428
429429
Retrieve market trades
430430

431+
You can use &#x60;from&#x60; and &#x60;to&#x60; to query by time range, or use &#x60;last_id&#x60; by scrolling page. The default behavior is by time range. Scrolling query using &#x60;last_id&#x60; is not recommended any more. If &#x60;last_id&#x60; is specified, time range query parameters will be ignored.
432+
431433
### Example
432434

433435
```java
@@ -449,11 +451,17 @@ public class Example {
449451
Integer limit = 100; // Integer | Maximum number of records to be returned in a single list
450452
String lastId = "12345"; // String | Specify list staring point using the `id` of last record in previous list-query results
451453
Boolean reverse = false; // Boolean | Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When `last_id` is specified. Set `reverse` to `true` to trace back trading history; `false` to retrieve latest tradings. No effect if `last_id` is not specified.
454+
Long from = 1627706330L; // Long | Start timestamp of the query
455+
Long to = 1635329650L; // Long | Time range ending, default to current time
456+
Integer page = 1; // Integer | Page number
452457
try {
453458
List<Trade> result = apiInstance.listTrades(currencyPair)
454459
.limit(limit)
455460
.lastId(lastId)
456461
.reverse(reverse)
462+
.from(from)
463+
.to(to)
464+
.page(page)
457465
.execute();
458466
System.out.println(result);
459467
} catch (GateApiException e) {
@@ -477,6 +485,9 @@ Name | Type | Description | Notes
477485
**limit** | **Integer**| Maximum number of records to be returned in a single list | [optional] [default to 100]
478486
**lastId** | **String**| Specify list staring point using the &#x60;id&#x60; of last record in previous list-query results | [optional]
479487
**reverse** | **Boolean**| Whether the id of records to be retrieved should be smaller than the last_id specified- true: Retrieve records where id is smaller than the specified last_id- false: Retrieve records where id is larger than the specified last_idDefault to false. When &#x60;last_id&#x60; is specified. Set &#x60;reverse&#x60; to &#x60;true&#x60; to trace back trading history; &#x60;false&#x60; to retrieve latest tradings. No effect if &#x60;last_id&#x60; is not specified. | [optional] [default to false]
488+
**from** | **Long**| Start timestamp of the query | [optional]
489+
**to** | **Long**| Time range ending, default to current time | [optional]
490+
**page** | **Integer**| Page number | [optional] [default to 1]
480491

481492
### Return type
482493

@@ -899,8 +910,8 @@ public class Example {
899910
Integer page = 1; // Integer | Page number
900911
Integer limit = 100; // Integer | Maximum number of records to be returned. If `status` is `open`, maximum of `limit` is 100
901912
String account = "cross_margin"; // String | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account
902-
Long from = 56L; // Long | Time range beginning, default to 7 days before current time
903-
Long to = 56L; // Long | Time range ending, default to current time
913+
Long from = 1627706330L; // Long | Start timestamp of the query
914+
Long to = 1635329650L; // Long | Time range ending, default to current time
904915
String side = "sell"; // String | All bids or asks. Both included if not specified
905916
try {
906917
List<Order> result = apiInstance.listOrders(currencyPair, status)
@@ -934,7 +945,7 @@ Name | Type | Description | Notes
934945
**page** | **Integer**| Page number | [optional] [default to 1]
935946
**limit** | **Integer**| Maximum number of records to be returned. If &#x60;status&#x60; is &#x60;open&#x60;, maximum of &#x60;limit&#x60; is 100 | [optional] [default to 100]
936947
**account** | **String**| Specify operation account. Default to spot and margin account if not specified. Set to &#x60;cross_margin&#x60; to operate against margin account | [optional]
937-
**from** | **Long**| Time range beginning, default to 7 days before current time | [optional]
948+
**from** | **Long**| Start timestamp of the query | [optional]
938949
**to** | **Long**| Time range ending, default to current time | [optional]
939950
**side** | **String**| All bids or asks. Both included if not specified | [optional] [enum: buy, sell]
940951

@@ -1352,8 +1363,8 @@ public class Example {
13521363
Integer page = 1; // Integer | Page number
13531364
String orderId = "12345"; // String | Filter trades with specified order ID. `currency_pair` is also required if this field is present
13541365
String account = "cross_margin"; // String | Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account
1355-
Long from = 56L; // Long | Time range beginning, default to 7 days before current time
1356-
Long to = 56L; // Long | Time range ending, default to current time
1366+
Long from = 1627706330L; // Long | Start timestamp of the query
1367+
Long to = 1635329650L; // Long | Time range ending, default to current time
13571368
try {
13581369
List<Trade> result = apiInstance.listMyTrades(currencyPair)
13591370
.limit(limit)
@@ -1386,7 +1397,7 @@ Name | Type | Description | Notes
13861397
**page** | **Integer**| Page number | [optional] [default to 1]
13871398
**orderId** | **String**| Filter trades with specified order ID. &#x60;currency_pair&#x60; is also required if this field is present | [optional]
13881399
**account** | **String**| Specify operation account. Default to spot and margin account if not specified. Set to &#x60;cross_margin&#x60; to operate against margin account | [optional]
1389-
**from** | **Long**| Time range beginning, default to 7 days before current time | [optional]
1400+
**from** | **Long**| Start timestamp of the query | [optional]
13901401
**to** | **Long**| Time range ending, default to current time | [optional]
13911402

13921403
### Return type

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>gate-api</artifactId>
66
<packaging>jar</packaging>
77
<name>gate-api</name>
8-
<version>6.22.2</version>
8+
<version>6.22.3</version>
99
<url>https://github.com/openapitools/openapi-generator</url>
1010
<description>Java client for gateapi</description>
1111
<scm>

src/main/java/io/gate/gateapi/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private void init() {
113113
json = new JSON();
114114

115115
// Set default User-Agent.
116-
setUserAgent("OpenAPI-Generator/6.22.2/java");
116+
setUserAgent("OpenAPI-Generator/6.22.3/java");
117117

118118
authentications = new HashMap<String, Authentication>();
119119
}

src/main/java/io/gate/gateapi/api/MarginApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ public APIlistMarginAccountBookRequest currencyPair(String currencyPair) {
633633

634634
/**
635635
* Set from
636-
* @param from Time range beginning, default to 7 days before current time (optional)
636+
* @param from Start timestamp of the query (optional)
637637
* @return APIlistMarginAccountBookRequest
638638
*/
639639
public APIlistMarginAccountBookRequest from(Long from) {
@@ -3287,7 +3287,7 @@ public APIlistCrossMarginAccountBookRequest currency(String currency) {
32873287

32883288
/**
32893289
* Set from
3290-
* @param from Time range beginning, default to 7 days before current time (optional)
3290+
* @param from Start timestamp of the query (optional)
32913291
* @return APIlistCrossMarginAccountBookRequest
32923292
*/
32933293
public APIlistCrossMarginAccountBookRequest from(Long from) {

0 commit comments

Comments
 (0)