Skip to content

Latest commit

 

History

History
381 lines (258 loc) · 11.8 KB

MarginUniApi.md

File metadata and controls

381 lines (258 loc) · 11.8 KB

MarginUniApi

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

listUniCurrencyPairs

Promise<{ response: http.IncomingMessage; body: Array; }> listUniCurrencyPairs()

List lending markets

Example

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));

Parameters

This endpoint does not need any parameter.

Return type

Promise<{ response: AxiosResponse; body: Array; }> UniCurrencyPair

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getUniCurrencyPair

Promise<{ response: http.IncomingMessage; body: UniCurrencyPair; }> getUniCurrencyPair(currencyPair)

Get detail of lending market

Example

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));

Parameters

Name Type Description Notes
currencyPair string Currency pair [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: UniCurrencyPair; }> UniCurrencyPair

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getMarginUniEstimateRate

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.

Example

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));

Parameters

Name Type Description Notes
currencies Array<string> An array of up to 10 specifying the currency name [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: { [key: string]: string; }; }> string

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

listUniLoans

Promise<{ response: http.IncomingMessage; body: Array; }> listUniLoans(opts)

List loans

Example

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));

Parameters

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]

Return type

Promise<{ response: AxiosResponse; body: Array; }> UniLoan

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

createUniLoan

Promise<{ response: http.IncomingMessage; body?: any; }> createUniLoan(createUniLoan)

Borrow or repay

Example

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));

Parameters

Name Type Description Notes
createUniLoan CreateUniLoan

Return type

Promise<{ response: AxiosResponse; body?: any; }>

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

listUniLoanRecords

Promise<{ response: http.IncomingMessage; body: Array; }> listUniLoanRecords(opts)

Get load records

Example

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));

Parameters

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]

Return type

Promise<{ response: AxiosResponse; body: Array; }> UniLoanRecord

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

listUniLoanInterestRecords

Promise<{ response: http.IncomingMessage; body: Array; }> listUniLoanInterestRecords(opts)

List interest records

Example

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));

Parameters

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]

Return type

Promise<{ response: AxiosResponse; body: Array; }> UniLoanInterestRecord

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getUniBorrowable

Promise<{ response: http.IncomingMessage; body: MaxUniBorrowable; }> getUniBorrowable(currency, currencyPair)

Get maximum borrowable

Example

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));

Parameters

Name Type Description Notes
currency string Retrieve data of the specified currency [default to undefined]
currencyPair string Currency pair [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: MaxUniBorrowable; }> MaxUniBorrowable

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json