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 detail of lending market |
getMarginUniEstimateRate | GET /margin/uni/estimate_rate | Estimate interest Rate |
listUniLoans | GET /margin/uni/loans | List loans |
createUniLoan | POST /margin/uni/loans | Borrow or repay |
listUniLoanRecords | GET /margin/uni/loan_records | Get load records |
listUniLoanInterestRecords | GET /margin/uni/interest_records | List interest records |
getUniBorrowable | GET /margin/uni/borrowable | Get maximum borrowable |
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 detail of lending market
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
Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate.
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> | An array of up to 10 specifying the currency name
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> | An array of up to 10 specifying the currency name | [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)
List 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 | Retrieve data of the specified currency
'page': 1, // number | Page number
'limit': 100 // number | Maximum response items. 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 | 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; }> 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)
Get load 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 | Retrieve data of the specified currency
'currencyPair': "BTC_USDT", // string | Currency pair
'page': 1, // number | Page number
'limit': 100 // number | Maximum response items. 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 | Retrieve data of the specified currency | [optional] [default to undefined] |
currencyPair | string | Currency pair | [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; }> UniLoanRecord
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listUniLoanInterestRecords(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.MarginUniApi(client);
const opts = {
'currencyPair': "BTC_USDT", // string | Currency pair
'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.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 | 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; }> UniLoanInterestRecord
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: MaxUniBorrowable; }> getUniBorrowable(currency, currencyPair)
Get maximum borrowable
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 | Retrieve data of the specified currency
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 | Retrieve data of the specified currency | [default to undefined] |
currencyPair | string | Currency pair | [default to undefined] |
Promise<{ response: AxiosResponse; body: MaxUniBorrowable; }> MaxUniBorrowable
- Content-Type: Not defined
- Accept: application/json