All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| listUniCurrencies | GET /earn/uni/currencies | List currencies for lending |
| getUniCurrency | GET /earn/uni/currencies/{currency} | Get currency detail for lending |
| listUserUniLends | GET /earn/uni/lends | List user's lending orders |
| createUniLend | POST /earn/uni/lends | Lend or redeem |
| changeUniLend | PATCH /earn/uni/lends | Amend lending order |
| listUniLendRecords | GET /earn/uni/lend_records | List records of lending |
| getUniInterest | GET /earn/uni/interests/{currency} | Get the user's total interest income of specified currency |
| listUniInterestRecords | GET /earn/uni/interest_records | List interest records |
| switchInterestReinvest | PUT /earn/uni/interest_reinvest | Set interest reinvestment toggle |
| getUniInterestStatus | GET /earn/uni/interest_status/{currency} | query currency interest compounding status |
List<UniCurrency> listUniCurrencies()
List currencies for lending
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.EarnUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
EarnUniApi apiInstance = new EarnUniApi(defaultClient);
try {
List<UniCurrency> result = apiInstance.listUniCurrencies();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling EarnUniApi#listUniCurrencies");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}This endpoint does not need any parameter.
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
UniCurrency getUniCurrency(currency)
Get currency detail for lending
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.EarnUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
EarnUniApi apiInstance = new EarnUniApi(defaultClient);
String currency = "btc"; // String | Currency
try {
UniCurrency result = apiInstance.getUniCurrency(currency);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling EarnUniApi#getUniCurrency");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| currency | String | Currency |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
List<UniLend> listUserUniLends().currency(currency).page(page).limit(limit).execute();
List user's lending orders
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.EarnUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
EarnUniApi apiInstance = new EarnUniApi(defaultClient);
String currency = "BTC"; // String | Retrieve data of the specified currency
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100
try {
List<UniLend> result = apiInstance.listUserUniLends()
.currency(currency)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling EarnUniApi#listUserUniLends");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| currency | String | Retrieve data of the specified currency | [optional] |
| page | Integer | Page number | [optional] [default to 1] |
| limit | Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
createUniLend(createUniLend)
Lend or redeem
`Lending`: The minimum interest rate is required in lending. The lending result is updated hourly and the interest profit is paid on the next hour. A high interest rate might lead to unsuccessful lending and no profit will be gained for that hour. If the funds are redeemed before the hourly settlement, no interest can be obtained for that hour. About priority: the orders created or amended first under the same interest rate will be lent out first `Redemption`: Funds that failed to be lent can be redeemed immediately. For the successfully lent funds, enjoy the hourly income, and the redemption will arrive at the next hour `Note`: Two minutes before and after the hour is the settlement time, lending and redemption are prohibited.
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.EarnUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
EarnUniApi apiInstance = new EarnUniApi(defaultClient);
CreateUniLend createUniLend = new CreateUniLend(); // CreateUniLend |
try {
apiInstance.createUniLend(createUniLend);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling EarnUniApi#createUniLend");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| createUniLend | CreateUniLend |
null (empty response body)
- Content-Type: application/json
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Operated successfully | - |
changeUniLend(patchUniLend)
Amend lending order
Currently only supports amending the minimum interest rate (hour)
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.EarnUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
EarnUniApi apiInstance = new EarnUniApi(defaultClient);
PatchUniLend patchUniLend = new PatchUniLend(); // PatchUniLend |
try {
apiInstance.changeUniLend(patchUniLend);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling EarnUniApi#changeUniLend");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| patchUniLend | PatchUniLend |
null (empty response body)
- Content-Type: application/json
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Updated | - |
List<UniLendRecord> listUniLendRecords().currency(currency).page(page).limit(limit).from(from).to(to).type(type).execute();
List records of lending
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.EarnUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
EarnUniApi apiInstance = new EarnUniApi(defaultClient);
String currency = "BTC"; // String | Retrieve data of the specified currency
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100
Long from = 1547706332L; // Long | Start timestamp
Long to = 1547706332L; // Long | End timestamp
String type = "lend"; // String | type: lend - lend, redeem - redeem
try {
List<UniLendRecord> result = apiInstance.listUniLendRecords()
.currency(currency)
.page(page)
.limit(limit)
.from(from)
.to(to)
.type(type)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling EarnUniApi#listUniLendRecords");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| currency | String | Retrieve data of the specified currency | [optional] |
| page | Integer | Page number | [optional] [default to 1] |
| limit | Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] |
| from | Long | Start timestamp | [optional] |
| to | Long | End timestamp | [optional] |
| type | String | type: lend - lend, redeem - redeem | [optional] [enum: lend, redeem] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
UniLendInterest getUniInterest(currency)
Get the user's total interest income of specified currency
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.EarnUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
EarnUniApi apiInstance = new EarnUniApi(defaultClient);
String currency = "btc"; // String | Currency
try {
UniLendInterest result = apiInstance.getUniInterest(currency);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling EarnUniApi#getUniInterest");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| currency | String | Currency |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
List<UniInterestRecord> listUniInterestRecords().currency(currency).page(page).limit(limit).execute();
List interest records
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.EarnUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
EarnUniApi apiInstance = new EarnUniApi(defaultClient);
String currency = "BTC"; // String | Retrieve data of the specified currency
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100
try {
List<UniInterestRecord> result = apiInstance.listUniInterestRecords()
.currency(currency)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling EarnUniApi#listUniInterestRecords");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| currency | String | Retrieve data of the specified currency | [optional] |
| page | Integer | Page number | [optional] [default to 1] |
| limit | Integer | Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
switchInterestReinvest(uniInterestMode)
Set interest reinvestment toggle
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.EarnUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
EarnUniApi apiInstance = new EarnUniApi(defaultClient);
UniInterestMode uniInterestMode = new UniInterestMode(); // UniInterestMode |
try {
apiInstance.switchInterestReinvest(uniInterestMode);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling EarnUniApi#switchInterestReinvest");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| uniInterestMode | UniInterestMode |
null (empty response body)
- Content-Type: application/json
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Success | - |
UniCurrencyInterest getUniInterestStatus(currency)
query currency interest compounding status
// Import classes:
import io.gate.gateapi.ApiClient;
import io.gate.gateapi.ApiException;
import io.gate.gateapi.Configuration;
import io.gate.gateapi.GateApiException;
import io.gate.gateapi.auth.*;
import io.gate.gateapi.models.*;
import io.gate.gateapi.api.EarnUniApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4
defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
EarnUniApi apiInstance = new EarnUniApi(defaultClient);
String currency = "btc"; // String | Currency
try {
UniCurrencyInterest result = apiInstance.getUniInterestStatus(currency);
System.out.println(result);
} catch (GateApiException e) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiException e) {
System.err.println("Exception when calling EarnUniApi#getUniInterestStatus");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| currency | String | Currency |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |