All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| listUniCurrencyPairs | GET /margin/uni/currency_pairs | List lending markets |
| getUniCurrencyPair | GET /margin/uni/currency_pairs/{currency_pair} | Get lending market details |
| getMarginUniEstimateRate | GET /margin/uni/estimate_rate | Estimate interest rate for isolated margin currencies |
| listUniLoans | GET /margin/uni/loans | Query loans |
| createUniLoan | POST /margin/uni/loans | Borrow or repay |
| listUniLoanRecords | GET /margin/uni/loan_records | Query loan records |
| listUniLoanInterestRecords | GET /margin/uni/interest_records | Query interest deduction records |
| getUniBorrowable | GET /margin/uni/borrowable | Query maximum borrowable amount by currency |
Promise<{ response: http.IncomingMessage; body: Array; }> listUniCurrencyPairs()
List lending markets
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.MarginUniApi(client);
api.listUniCurrencyPairs()
.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; }> UniCurrencyPair
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: UniCurrencyPair; }> getUniCurrencyPair(currencyPair)
Get lending market details
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.MarginUniApi(client);
const currencyPair = "AE_USDT"; // string | Currency pair
api.getUniCurrencyPair(currencyPair)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| currencyPair | string | Currency pair | [default to undefined] |
Promise<{ response: AxiosResponse; body: UniCurrencyPair; }> UniCurrencyPair
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: { [key: string]: string; }; }> getMarginUniEstimateRate(currencies)
Estimate interest rate for isolated margin currencies
Interest rates change hourly based on lending depth, so completely accurate rates cannot be provided.
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.MarginUniApi(client);
const currencies = [["BTC","GT"]]; // Array<string> | Array of currency names to query, maximum 10
api.getMarginUniEstimateRate(currencies)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| currencies | Array<string> | Array of currency names to query, maximum 10 | [default to undefined] |
Promise<{ response: AxiosResponse; body: { [key: string]: string; }; }> string
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listUniLoans(opts)
Query loans
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.MarginUniApi(client);
const opts = {
'currencyPair': "BTC_USDT", // string | Currency pair
'currency': "BTC", // string | Query by specified currency name
'page': 1, // number | Page number
'limit': 100 // number | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100
};
api.listUniLoans(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| currencyPair | string | Currency pair | [optional] [default to undefined] |
| currency | string | Query by specified currency name | [optional] [default to undefined] |
| page | number | Page number | [optional] [default to 1] |
| limit | number | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] |
Promise<{ response: AxiosResponse; body: Array; }> UniLoan
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body?: any; }> createUniLoan(createUniLoan)
Borrow or repay
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.MarginUniApi(client);
const createUniLoan = new CreateUniLoan(); // CreateUniLoan |
api.createUniLoan(createUniLoan)
.then(value => console.log('API called successfully.'),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| createUniLoan | CreateUniLoan |
Promise<{ response: AxiosResponse; body?: any; }>
- Content-Type: application/json
- Accept: Not defined
Promise<{ response: http.IncomingMessage; body: Array; }> listUniLoanRecords(opts)
Query loan 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.MarginUniApi(client);
const opts = {
'type': "type_example", // 'borrow' | 'repay' | Type: `borrow` - borrow, `repay` - repay
'currency': "BTC", // string | Query by specified currency name
'currencyPair': "BTC_USDT", // string | Currency pair
'page': 1, // number | Page number
'limit': 100 // number | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100
};
api.listUniLoanRecords(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| type | Type | Type: `borrow` - borrow, `repay` - repay | [optional] [default to undefined] |
| currency | string | Query by specified currency name | [optional] [default to undefined] |
| currencyPair | string | Currency pair | [optional] [default to undefined] |
| page | number | Page number | [optional] [default to 1] |
| limit | number | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] |
Promise<{ response: AxiosResponse; body: Array; }> UniLoanRecord
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listUniLoanInterestRecords(opts)
Query interest deduction 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.MarginUniApi(client);
const opts = {
'currencyPair': "BTC_USDT", // string | Currency pair
'currency': "BTC", // string | Query by specified currency name
'page': 1, // number | Page number
'limit': 100, // number | Maximum number of records returned in a single list
'from': 1547706332, // number | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit)
'to': 1547706332 // number | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp
};
api.listUniLoanInterestRecords(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| currencyPair | string | Currency pair | [optional] [default to undefined] |
| currency | string | Query by specified currency name | [optional] [default to undefined] |
| page | number | Page number | [optional] [default to 1] |
| limit | number | Maximum number of records returned in a single list | [optional] [default to 100] |
| from | number | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] [default to undefined] |
| to | number | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> UniLoanInterestRecord
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: MaxUniBorrowable; }> getUniBorrowable(currency, currencyPair)
Query maximum borrowable amount by 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.MarginUniApi(client);
const currency = "BTC"; // string | Query by specified currency name
const currencyPair = "BTC_USDT"; // string | Currency pair
api.getUniBorrowable(currency, currencyPair)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| currency | string | Query by specified currency name | [default to undefined] |
| currencyPair | string | Currency pair | [default to undefined] |
Promise<{ response: AxiosResponse; body: MaxUniBorrowable; }> MaxUniBorrowable
- Content-Type: Not defined
- Accept: application/json