All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| listDualInvestmentPlans | GET /earn/dual/investment_plan | Dual Investment product list |
| listDualOrders | GET /earn/dual/orders | Dual Investment order list |
| placeDualOrder | POST /earn/dual/orders | Place Dual Investment order |
| listDualBalance | GET /earn/dual/balance | Dual-Currency Earning Assets |
| getDualOrderRefundPreview | GET /earn/dual/order-refund-preview | Dual-currency early redemption preview |
| placeDualOrderRefund | POST /earn/dual/order-refund | Dual-currency order early redemption |
| modifyDualOrderReinvest | POST /earn/dual/modify-order-reinvest | Modify dual-currency order reinvest |
| getDualProjectRecommend | GET /earn/dual/project-recommend | Dual-currency recommended projects |
| findCoin | GET /earn/staking/coins | Staking coins |
| swapStakingCoin | POST /earn/staking/swap | On-chain token swap for earned coins |
| orderList | GET /earn/staking/order_list | List of on-chain coin-earning orders |
| awardList | GET /earn/staking/award_list | On-chain coin-earning dividend records |
| assetList | GET /earn/staking/assets | On-chain coin-earning assets |
| createAutoInvestPlan | POST /earn/autoinvest/plans/create | Create auto invest plan |
| updateAutoInvestPlan | POST /earn/autoinvest/plans/update | UpdateAuto invest plan |
| stopAutoInvestPlan | POST /earn/autoinvest/plans/stop | StopAuto invest plan |
| addPositionAutoInvestPlan | POST /earn/autoinvest/plans/add_position | Add position immediately |
| listAutoInvestCoins | GET /earn/autoinvest/coins | QueryCurrencies supporting auto invest |
| getAutoInvestMinAmount | POST /earn/autoinvest/min_invest_amount | Get minimum investment amount |
| listAutoInvestPlanRecords | GET /earn/autoinvest/plans/records | List plan execution records |
| listAutoInvestOrders | GET /earn/autoinvest/orders | List plan execution recordsDetails(OrderDetails) |
| listAutoInvestConfig | GET /earn/autoinvest/config | List investment currency configuration |
| getAutoInvestPlanDetail | GET /earn/autoinvest/plans/detail | QueryAuto invest planDetails |
| listAutoInvestPlans | GET /earn/autoinvest/plans/list_info | QueryAuto invest planList |
| listEarnFixedTermProducts | GET /earn/fixed-term/product | Get product list |
| listEarnFixedTermProductsByAsset | GET /earn/fixed-term/product/{asset}/list | Get product list by single currency |
| listEarnFixedTermLends | GET /earn/fixed-term/user/lend | Subscription list |
| createEarnFixedTermLend | POST /earn/fixed-term/user/lend | Subscription |
| createEarnFixedTermPreRedeem | POST /earn/fixed-term/user/pre-redeem | Redeem |
| listEarnFixedTermHistory | GET /earn/fixed-term/user/history | Subscription history |
List<DualGetPlans> listDualInvestmentPlans().planId(planId).coin(coin).type(type).quoteCurrency(quoteCurrency).sort(sort).page(page).pageSize(pageSize).execute();
Dual Investment product list
// 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.EarnApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
EarnApi apiInstance = new EarnApi(defaultClient);
Long planId = 1L; // Long | Financial project ID
String coin = "BTC"; // String | Investment Token
String type = "call"; // String | Type enum: `put` — buy low; `call` — sell high
String quoteCurrency = "quoteCurrency_example"; // String | Settlement currency enum: defaults to USDT; GUSD optional
String sort = "sort_example"; // String | Sort field enum: `apy` — highest APY first `short-period` — shortest tenor first `multiple` — highest premium first
Integer page = 1; // Integer | page number
Integer pageSize = 3; // Integer | Items per page
try {
List<DualGetPlans> result = apiInstance.listDualInvestmentPlans()
.planId(planId)
.coin(coin)
.type(type)
.quoteCurrency(quoteCurrency)
.sort(sort)
.page(page)
.pageSize(pageSize)
.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 EarnApi#listDualInvestmentPlans");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| planId | Long | Financial project ID | [optional] |
| coin | String | Investment Token | [optional] |
| type | String | Type enum: `put` — buy low; `call` — sell high | [optional] |
| quoteCurrency | String | Settlement currency enum: defaults to USDT; GUSD optional | [optional] |
| sort | String | Sort field enum: `apy` — highest APY first `short-period` — shortest tenor first `multiple` — highest premium first | [optional] |
| page | Integer | page number | [optional] |
| pageSize | Integer | Items per page | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
List<DualGetOrders> listDualOrders().from(from).to(to).type(type).status(status).coin(coin).page(page).limit(limit).execute();
Dual Investment order list
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
Long from = 1740727000L; // Long | Start settlement time
Long to = 1740729000L; // Long | End settlement time
String type = "put"; // String | Type enum: `put` — buy low; `call` — sell high
String status = "HOLD"; // String | Order status enum: `HOLD` — open position `REPAY` — historical position `PROCESSING` — position active `SETTLEMENT_PROCESSING` — settlement in progress `ALL` — all
String coin = "BTC"; // String | Investment Token
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Maximum number of records returned in a single list
try {
List<DualGetOrders> result = apiInstance.listDualOrders()
.from(from)
.to(to)
.type(type)
.status(status)
.coin(coin)
.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 EarnApi#listDualOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| from | Long | Start settlement time | [optional] |
| to | Long | End settlement time | [optional] |
| type | String | Type enum: `put` — buy low; `call` — sell high | [optional] |
| status | String | Order status enum: `HOLD` — open position `REPAY` — historical position `PROCESSING` — position active `SETTLEMENT_PROCESSING` — settlement in progress `ALL` — all | [optional] |
| coin | String | Investment Token | [optional] |
| page | Integer | Page number | [optional] [default to 1] |
| limit | Integer | Maximum number of records returned in a single list | [optional] [default to 100] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
PlaceDualInvestmentOrder placeDualOrder(placeDualInvestmentOrderParams)
Place Dual Investment order
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
PlaceDualInvestmentOrderParams placeDualInvestmentOrderParams = new PlaceDualInvestmentOrderParams(); // PlaceDualInvestmentOrderParams |
try {
PlaceDualInvestmentOrder result = apiInstance.placeDualOrder(placeDualInvestmentOrderParams);
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 EarnApi#placeDualOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| placeDualInvestmentOrderParams | PlaceDualInvestmentOrderParams |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Order placed successfully | - |
DualGetBalance listDualBalance()
Dual-Currency Earning Assets
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
try {
DualGetBalance result = apiInstance.listDualBalance();
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 EarnApi#listDualBalance");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
DualOrderRefundPreview getDualOrderRefundPreview(orderId)
Dual-currency early redemption preview
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
String orderId = "9497"; // String | Order ID
try {
DualOrderRefundPreview result = apiInstance.getDualOrderRefundPreview(orderId);
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 EarnApi#getDualOrderRefundPreview");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| orderId | String | Order ID |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
placeDualOrderRefund(dualOrderRefundParams)
Dual-currency order early redemption
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
DualOrderRefundParams dualOrderRefundParams = new DualOrderRefundParams(); // DualOrderRefundParams |
try {
apiInstance.placeDualOrderRefund(dualOrderRefundParams);
} 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 EarnApi#placeDualOrderRefund");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| dualOrderRefundParams | DualOrderRefundParams |
null (empty response body)
- Content-Type: application/json
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 200 | Redemption successful | - |
modifyDualOrderReinvest(dualModifyOrderReinvestParams)
Modify dual-currency order reinvest
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
DualModifyOrderReinvestParams dualModifyOrderReinvestParams = new DualModifyOrderReinvestParams(); // DualModifyOrderReinvestParams |
try {
apiInstance.modifyDualOrderReinvest(dualModifyOrderReinvestParams);
} 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 EarnApi#modifyDualOrderReinvest");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| dualModifyOrderReinvestParams | DualModifyOrderReinvestParams |
null (empty response body)
- Content-Type: application/json
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 200 | Updated successfully | - |
List<DualProjectRecommend> getDualProjectRecommend().mode(mode).coin(coin).type(type).historyPids(historyPids).execute();
Dual-currency recommended projects
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
String mode = "normal"; // String | Sort mode; default `normal`: `senior` — curated picks (APR/tenor) `apy_up` — APY ascending `ep_down` — target price descending `ep_up` — target price ascending `dt_down` — maturity time descending `dt_up` — maturity time ascending
String coin = "ETH"; // String | Investment Token
String type = "call"; // String | `call`: sell high; `put`: buy low
String historyPids = "110656,110652"; // String | Comma-separated project IDs to exclude already recommended items
try {
List<DualProjectRecommend> result = apiInstance.getDualProjectRecommend()
.mode(mode)
.coin(coin)
.type(type)
.historyPids(historyPids)
.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 EarnApi#getDualProjectRecommend");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| mode | String | Sort mode; default `normal`: `senior` — curated picks (APR/tenor) `apy_up` — APY ascending `ep_down` — target price descending `ep_up` — target price ascending `dt_down` — maturity time descending `dt_up` — maturity time ascending | [optional] |
| coin | String | Investment Token | [optional] |
| type | String | `call`: sell high; `put`: buy low | [optional] |
| historyPids | String | Comma-separated project IDs to exclude already recommended items | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
List<Object> findCoin().cointype(cointype).execute();
Staking coins
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
String cointype = "cointype_example"; // String | Currency type: swap - voucher; lock - locked position; debt - US Treasury bond.
try {
List<Object> result = apiInstance.findCoin()
.cointype(cointype)
.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 EarnApi#findCoin");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| cointype | String | Currency type: swap - voucher; lock - locked position; debt - US Treasury bond. | [optional] |
List<Object>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
SwapCoinStruct swapStakingCoin(swapCoin)
On-chain token swap for earned coins
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
SwapCoin swapCoin = new SwapCoin(); // SwapCoin |
try {
SwapCoinStruct result = apiInstance.swapStakingCoin(swapCoin);
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 EarnApi#swapStakingCoin");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| swapCoin | SwapCoin |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Swap successful | - |
OrderListStruct orderList().pid(pid).coin(coin).type(type).page(page).execute();
List of on-chain coin-earning 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
Integer pid = 7; // Integer | Product ID
String coin = "ETH"; // String | Currency name
Integer type = 0; // Integer | Type 0-staking 1-redemption
Integer page = 1; // Integer | Page number
try {
OrderListStruct result = apiInstance.orderList()
.pid(pid)
.coin(coin)
.type(type)
.page(page)
.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 EarnApi#orderList");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| pid | Integer | Product ID | [optional] |
| coin | String | Currency name | [optional] |
| type | Integer | Type 0-staking 1-redemption | [optional] |
| page | Integer | Page number | [optional] [default to 1] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
AwardListStruct awardList().pid(pid).coin(coin).page(page).execute();
On-chain coin-earning dividend 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
Integer pid = 7; // Integer | Product ID
String coin = "ETH"; // String | Currency name
Integer page = 1; // Integer | Page number
try {
AwardListStruct result = apiInstance.awardList()
.pid(pid)
.coin(coin)
.page(page)
.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 EarnApi#awardList");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| pid | Integer | Product ID | [optional] |
| coin | String | Currency name | [optional] |
| page | Integer | Page number | [optional] [default to 1] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
List<Object> assetList().coin(coin).execute();
On-chain coin-earning assets
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
String coin = "ETH"; // String | Currency name
try {
List<Object> result = apiInstance.assetList()
.coin(coin)
.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 EarnApi#assetList");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| coin | String | Currency name | [optional] |
List<Object>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
AutoInvestPlanCreateResp createAutoInvestPlan(autoInvestPlanCreate)
Create auto invest plan
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
AutoInvestPlanCreate autoInvestPlanCreate = new AutoInvestPlanCreate(); // AutoInvestPlanCreate |
try {
AutoInvestPlanCreateResp result = apiInstance.createAutoInvestPlan(autoInvestPlanCreate);
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 EarnApi#createAutoInvestPlan");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| autoInvestPlanCreate | AutoInvestPlanCreate |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Created successfully | - |
updateAutoInvestPlan(autoInvestPlanUpdate)
UpdateAuto invest plan
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
AutoInvestPlanUpdate autoInvestPlanUpdate = new AutoInvestPlanUpdate(); // AutoInvestPlanUpdate |
try {
apiInstance.updateAutoInvestPlan(autoInvestPlanUpdate);
} 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 EarnApi#updateAutoInvestPlan");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| autoInvestPlanUpdate | AutoInvestPlanUpdate |
null (empty response body)
- Content-Type: application/json
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 200 | Updated successfully | - |
stopAutoInvestPlan(autoInvestPlanStop)
StopAuto invest plan
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
AutoInvestPlanStop autoInvestPlanStop = new AutoInvestPlanStop(); // AutoInvestPlanStop |
try {
apiInstance.stopAutoInvestPlan(autoInvestPlanStop);
} 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 EarnApi#stopAutoInvestPlan");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| autoInvestPlanStop | AutoInvestPlanStop |
null (empty response body)
- Content-Type: application/json
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 200 | Stopped successfully | - |
addPositionAutoInvestPlan(autoInvestPlanAddPosition)
Add position immediately
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
AutoInvestPlanAddPosition autoInvestPlanAddPosition = new AutoInvestPlanAddPosition(); // AutoInvestPlanAddPosition |
try {
apiInstance.addPositionAutoInvestPlan(autoInvestPlanAddPosition);
} 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 EarnApi#addPositionAutoInvestPlan");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| autoInvestPlanAddPosition | AutoInvestPlanAddPosition |
null (empty response body)
- Content-Type: application/json
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 200 | Add PositionSuccess | - |
List<AutoInvestCoinsItem> listAutoInvestCoins().planMoney(planMoney).execute();
QueryCurrencies supporting auto invest
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
String planMoney = "USDT"; // String | Pricing currency,Optional: USDT or BTC,Default: USDT
try {
List<AutoInvestCoinsItem> result = apiInstance.listAutoInvestCoins()
.planMoney(planMoney)
.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 EarnApi#listAutoInvestCoins");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| planMoney | String | Pricing currency,Optional: USDT or BTC,Default: USDT | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
AutoInvestMinInvestAmountResp getAutoInvestMinAmount(autoInvestMinInvestAmount)
Get minimum investment amount
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
AutoInvestMinInvestAmount autoInvestMinInvestAmount = new AutoInvestMinInvestAmount(); // AutoInvestMinInvestAmount |
try {
AutoInvestMinInvestAmountResp result = apiInstance.getAutoInvestMinAmount(autoInvestMinInvestAmount);
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 EarnApi#getAutoInvestMinAmount");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| autoInvestMinInvestAmount | AutoInvestMinInvestAmount |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
AutoInvestPlanRecordsResp listAutoInvestPlanRecords(planId).page(page).pageSize(pageSize).execute();
List plan execution 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
Long planId = 141378L; // Long | Plan ID
Long page = 1L; // Long | page number
Long pageSize = 10L; // Long | Items per page,Maximum 100
try {
AutoInvestPlanRecordsResp result = apiInstance.listAutoInvestPlanRecords(planId)
.page(page)
.pageSize(pageSize)
.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 EarnApi#listAutoInvestPlanRecords");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| planId | Long | Plan ID | |
| page | Long | page number | [optional] |
| pageSize | Long | Items per page,Maximum 100 | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
List<AutoInvestOrderItem> listAutoInvestOrders(planId, recordId)
List plan execution recordsDetails(OrderDetails)
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
Long planId = 142583L; // Long | Plan ID
Long recordId = 1770805384904919L; // Long | Record ID
try {
List<AutoInvestOrderItem> result = apiInstance.listAutoInvestOrders(planId, recordId);
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 EarnApi#listAutoInvestOrders");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| planId | Long | Plan ID | |
| recordId | Long | Record ID |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
List<AutoInvestConfigItem> listAutoInvestConfig()
List investment currency configuration
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
try {
List<AutoInvestConfigItem> result = apiInstance.listAutoInvestConfig();
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 EarnApi#listAutoInvestConfig");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
AutoInvestPlanDetail getAutoInvestPlanDetail(planId)
QueryAuto invest planDetails
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
Long planId = 142609L; // Long | Plan ID
try {
AutoInvestPlanDetail result = apiInstance.getAutoInvestPlanDetail(planId);
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 EarnApi#getAutoInvestPlanDetail");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| planId | Long | Plan ID |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
AutoInvestPlanListInfoResp listAutoInvestPlans(status).page(page).pageSize(pageSize).execute();
QueryAuto invest planList
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
String status = "active"; // String | Plan status,History history,Active active
Long page = 56L; // Long | page number
Long pageSize = 56L; // Long | Items per page,Maximum 100
try {
AutoInvestPlanListInfoResp result = apiInstance.listAutoInvestPlans(status)
.page(page)
.pageSize(pageSize)
.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 EarnApi#listAutoInvestPlans");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| status | String | Plan status,History history,Active active | |
| page | Long | page number | [optional] |
| pageSize | Long | Items per page,Maximum 100 | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved | - |
ListEarnFixedTermProductsResponse listEarnFixedTermProducts(page, limit).asset(asset).type(type).execute();
Get product list
Query fixed-term earn product list. Supports filtering by currency, product type, status, etc. Returns product interest rate, lock-up period, quota, and reward campaign information
// 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.EarnApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
EarnApi apiInstance = new EarnApi(defaultClient);
Integer page = 1; // Integer | Page number
Integer limit = 100; // Integer | Page size
String asset = "USDT"; // String | Currency
Integer type = 1; // Integer | Product type: 1 for regular, 2 for VIP
try {
ListEarnFixedTermProductsResponse result = apiInstance.listEarnFixedTermProducts(page, limit)
.asset(asset)
.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 EarnApi#listEarnFixedTermProducts");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| page | Integer | Page number | |
| limit | Integer | Page size | |
| asset | String | Currency | [optional] |
| type | Integer | Product type: 1 for regular, 2 for VIP | [optional] |
ListEarnFixedTermProductsResponse
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Product list retrieved successfully | - |
ListEarnFixedTermProductsByAssetResponse listEarnFixedTermProductsByAsset(asset).type(type).execute();
Get product list by single currency
Sort by product term in ascending order
// 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.EarnApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
EarnApi apiInstance = new EarnApi(defaultClient);
String asset = "USDT"; // String | Currency name, e.g., USDT, BTC
String type = "1"; // String | Product type: \"\" or 1 for regular product list, 2 for VIP product list, 0 for all products
try {
ListEarnFixedTermProductsByAssetResponse result = apiInstance.listEarnFixedTermProductsByAsset(asset)
.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 EarnApi#listEarnFixedTermProductsByAsset");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| asset | String | Currency name, e.g., USDT, BTC | |
| type | String | Product type: "" or 1 for regular product list, 2 for VIP product list, 0 for all products | [optional] |
ListEarnFixedTermProductsByAssetResponse
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Single currency product list retrieved successfully | - |
ListEarnFixedTermLendsResponse listEarnFixedTermLends(orderType, page, limit).productId(productId).orderId(orderId).asset(asset).subBusiness(subBusiness).businessFilter(businessFilter).execute();
Subscription list
Query the user's fixed-term earn subscription order list. Supports filtering by product, currency, order type, etc. Returns order details, earnings, rewards, and interest rate boost coupon information
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
String orderType = "1"; // String | Order type: 1 for current orders, 2 for historical orders
Integer page = 1; // Integer | Page number
Integer limit = 10; // Integer | Page size
Integer productId = 56; // Integer | Product ID
Long orderId = 56L; // Long | Order ID
String asset = "asset_example"; // String | Currency
Integer subBusiness = 56; // Integer | Sub-business
String businessFilter = "[{\"business\":1, \"sub_business\": 0},{\"business\":2, \"sub_business\": 0}]"; // String | Business filter conditions, JSON array format, e.g., [{\"business\":1, \"sub_business\": 0}]. business: 1 for regular, 2 for VIP
try {
ListEarnFixedTermLendsResponse result = apiInstance.listEarnFixedTermLends(orderType, page, limit)
.productId(productId)
.orderId(orderId)
.asset(asset)
.subBusiness(subBusiness)
.businessFilter(businessFilter)
.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 EarnApi#listEarnFixedTermLends");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| orderType | String | Order type: 1 for current orders, 2 for historical orders | |
| page | Integer | Page number | |
| limit | Integer | Page size | |
| productId | Integer | Product ID | [optional] |
| orderId | Long | Order ID | [optional] |
| asset | String | Currency | [optional] |
| subBusiness | Integer | Sub-business | [optional] |
| businessFilter | String | Business filter conditions, JSON array format, e.g., [{"business":1, "sub_business": 0}]. business: 1 for regular, 2 for VIP | [optional] |
ListEarnFixedTermLendsResponse
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Subscription order list retrieved successfully | - |
CreateEarnFixedTermLendResponse createEarnFixedTermLend(fixedTermLendRequest)
Subscription
Subscribe to a fixed-term earn product by specifying the product ID and subscription amount. Optionally enable auto-renewal and apply an interest rate boost coupon
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
FixedTermLendRequest fixedTermLendRequest = new FixedTermLendRequest(); // FixedTermLendRequest |
try {
CreateEarnFixedTermLendResponse result = apiInstance.createEarnFixedTermLend(fixedTermLendRequest);
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 EarnApi#createEarnFixedTermLend");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| fixedTermLendRequest | FixedTermLendRequest | [optional] |
CreateEarnFixedTermLendResponse
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Subscription successful | - |
CreateEarnFixedTermPreRedeemResponse createEarnFixedTermPreRedeem(earnFixedTermPreRedeemRequest)
Redeem
Early redemption of a fixed-term earn order, order ID is required
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
EarnFixedTermPreRedeemRequest earnFixedTermPreRedeemRequest = new EarnFixedTermPreRedeemRequest(); // EarnFixedTermPreRedeemRequest |
try {
CreateEarnFixedTermPreRedeemResponse result = apiInstance.createEarnFixedTermPreRedeem(earnFixedTermPreRedeemRequest);
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 EarnApi#createEarnFixedTermPreRedeem");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| earnFixedTermPreRedeemRequest | EarnFixedTermPreRedeemRequest | [optional] |
CreateEarnFixedTermPreRedeemResponse
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Redemption successful | - |
ListEarnFixedTermHistoryResponse listEarnFixedTermHistory(type, page, limit).productId(productId).orderId(orderId).asset(asset).startAt(startAt).endAt(endAt).subBusiness(subBusiness).businessFilter(businessFilter).execute();
Subscription history
Query the user's fixed-term earn history records. Supports filtering by type (subscription, redemption, interest, bonus rewards) and time range
// 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.EarnApi;
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");
EarnApi apiInstance = new EarnApi(defaultClient);
String type = "1"; // String | 1 for subscription, 2 for redemption, 3 for interest, 4 for bonus reward
Integer page = 1; // Integer | Page number
Integer limit = 10; // Integer | Page size
Integer productId = 56; // Integer | Product ID
String orderId = "orderId_example"; // String | Order ID
String asset = "asset_example"; // String | Currency
Integer startAt = 56; // Integer | Start timestamp
Integer endAt = 56; // Integer | End Timestamp
Integer subBusiness = 56; // Integer | Sub-business
String businessFilter = "[{\"business\":1, \"sub_business\": 0},{\"business\":2, \"sub_business\": 0}]"; // String | Business filter conditions, JSON array format, e.g., [{\"business\":1, \"sub_business\": 0}]. business: 1 for regular, 2 for VIP
try {
ListEarnFixedTermHistoryResponse result = apiInstance.listEarnFixedTermHistory(type, page, limit)
.productId(productId)
.orderId(orderId)
.asset(asset)
.startAt(startAt)
.endAt(endAt)
.subBusiness(subBusiness)
.businessFilter(businessFilter)
.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 EarnApi#listEarnFixedTermHistory");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| type | String | 1 for subscription, 2 for redemption, 3 for interest, 4 for bonus reward | |
| page | Integer | Page number | |
| limit | Integer | Page size | |
| productId | Integer | Product ID | [optional] |
| orderId | String | Order ID | [optional] |
| asset | String | Currency | [optional] |
| startAt | Integer | Start timestamp | [optional] |
| endAt | Integer | End Timestamp | [optional] |
| subBusiness | Integer | Sub-business | [optional] |
| businessFilter | String | Business filter conditions, JSON array format, e.g., [{"business":1, "sub_business": 0}]. business: 1 for regular, 2 for VIP | [optional] |
ListEarnFixedTermHistoryResponse
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | History records retrieved successfully | - |