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 |
Promise<{ response: http.IncomingMessage; body: Array; }> listUniCurrencies()
List currencies for lending
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
const api = new GateApi.EarnUniApi(client);
api.listUniCurrencies()
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
This endpoint does not need any parameter.
Promise<{ response: AxiosResponse; body: Array; }> UniCurrency
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: UniCurrency; }> getUniCurrency(currency)
Get currency detail for lending
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
const api = new GateApi.EarnUniApi(client);
const currency = "btc"; // string | Currency
api.getUniCurrency(currency)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Currency | [default to undefined] |
Promise<{ response: AxiosResponse; body: UniCurrency; }> UniCurrency
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listUserUniLends(opts)
List user's lending orders
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.EarnUniApi(client);
const opts = {
'currency': "BTC", // string | Retrieve data of the specified currency
'page': 1, // number | Page number
'limit': 100 // number | Maximum response items. Default: 100, minimum: 1, Maximum: 100
};
api.listUserUniLends(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Retrieve data of the specified currency | [optional] [default to undefined] |
page | number | Page number | [optional] [default to 1] |
limit | number | Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] |
Promise<{ response: AxiosResponse; body: Array; }> UniLend
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body?: any; }> 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.
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.EarnUniApi(client);
const createUniLend = new CreateUniLend(); // CreateUniLend |
api.createUniLend(createUniLend)
.then(value => console.log('API called successfully.'),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
createUniLend | CreateUniLend |
Promise<{ response: AxiosResponse; body?: any; }>
- Content-Type: application/json
- Accept: Not defined
Promise<{ response: http.IncomingMessage; body?: any; }> changeUniLend(patchUniLend)
Amend lending order
Currently only supports amending the minimum interest rate (hour)
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.EarnUniApi(client);
const patchUniLend = new PatchUniLend(); // PatchUniLend |
api.changeUniLend(patchUniLend)
.then(value => console.log('API called successfully.'),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
patchUniLend | PatchUniLend |
Promise<{ response: AxiosResponse; body?: any; }>
- Content-Type: application/json
- Accept: Not defined
Promise<{ response: http.IncomingMessage; body: Array; }> listUniLendRecords(opts)
List records of lending
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.EarnUniApi(client);
const opts = {
'currency': "BTC", // string | Retrieve data of the specified currency
'page': 1, // number | Page number
'limit': 100, // number | Maximum response items. Default: 100, minimum: 1, Maximum: 100
'from': 1547706332, // number | Start timestamp
'to': 1547706332, // number | End timestamp
'type': "lend" // 'lend' | 'redeem' | type: lend - lend, redeem - redeem
};
api.listUniLendRecords(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Retrieve data of the specified currency | [optional] [default to undefined] |
page | number | Page number | [optional] [default to 1] |
limit | number | Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] |
from | number | Start timestamp | [optional] [default to undefined] |
to | number | End timestamp | [optional] [default to undefined] |
type | Type | type: lend - lend, redeem - redeem | [optional] [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> UniLendRecord
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: UniLendInterest; }> getUniInterest(currency)
Get the user's total interest income of specified currency
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.EarnUniApi(client);
const currency = "btc"; // string | Currency
api.getUniInterest(currency)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Currency | [default to undefined] |
Promise<{ response: AxiosResponse; body: UniLendInterest; }> UniLendInterest
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listUniInterestRecords(opts)
List interest records
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.EarnUniApi(client);
const opts = {
'currency': "BTC", // string | Retrieve data of the specified currency
'page': 1, // number | Page number
'limit': 100 // number | Maximum response items. Default: 100, minimum: 1, Maximum: 100
};
api.listUniInterestRecords(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Retrieve data of the specified currency | [optional] [default to undefined] |
page | number | Page number | [optional] [default to 1] |
limit | number | Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] |
Promise<{ response: AxiosResponse; body: Array; }> UniInterestRecord
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body?: any; }> switchInterestReinvest(uniInterestMode)
Set interest reinvestment toggle
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.EarnUniApi(client);
const uniInterestMode = new UniInterestMode(); // UniInterestMode |
api.switchInterestReinvest(uniInterestMode)
.then(value => console.log('API called successfully.'),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
uniInterestMode | UniInterestMode |
Promise<{ response: AxiosResponse; body?: any; }>
- Content-Type: application/json
- Accept: Not defined
Promise<{ response: http.IncomingMessage; body: UniCurrencyInterest; }> getUniInterestStatus(currency)
query currency interest compounding status
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.EarnUniApi(client);
const currency = "btc"; // string | Currency
api.getUniInterestStatus(currency)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Currency | [default to undefined] |
Promise<{ response: AxiosResponse; body: UniCurrencyInterest; }> UniCurrencyInterest
- Content-Type: Not defined
- Accept: application/json