Skip to content

Latest commit

 

History

History
555 lines (373 loc) · 19.2 KB

MultiCollateralLoanApi.md

File metadata and controls

555 lines (373 loc) · 19.2 KB

MultiCollateralLoanApi

All URIs are relative to https://api.gateio.ws/api/v4

Method HTTP request Description
listMultiCollateralOrders GET /loan/multi_collateral/orders List Multi-Collateral Orders
createMultiCollateral POST /loan/multi_collateral/orders Create Multi-Collateral Order
getMultiCollateralOrderDetail GET /loan/multi_collateral/orders/{order_id} Get Multi-Collateral Order Detail
listMultiRepayRecords GET /loan/multi_collateral/repay List Multi-Collateral Repay Records
repayMultiCollateralLoan POST /loan/multi_collateral/repay Repay Multi-Collateral Loan
listMultiCollateralRecords GET /loan/multi_collateral/mortgage Query collateral adjustment records
operateMultiCollateral POST /loan/multi_collateral/mortgage Operate Multi-Collateral
listUserCurrencyQuota GET /loan/multi_collateral/currency_quota List User Currency Quota
listMultiCollateralCurrencies GET /loan/multi_collateral/currencies Query supported borrowing and collateral currencies in Multi-Collateral
getMultiCollateralLtv GET /loan/multi_collateral/ltv Get Multi-Collateral ratio
getMultiCollateralFixRate GET /loan/multi_collateral/fixed_rate Query fixed interest rates for the currency for 7 days and 30 days
getMultiCollateralCurrentRate GET /loan/multi_collateral/current_rate Query the current interest rate of the currency

listMultiCollateralOrders

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

List Multi-Collateral Orders

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.MultiCollateralLoanApi(client);
const opts = {
  'page': 1, // number | Page number
  'limit': 10, // number | Maximum number of records to be returned in a single list
  'sort': "ltv_asc", // string | Sort types: time_desc - default sorting by creation time in descending order, ltv_asc - ascending order of ltv, ltv_desc - descending order of ltv.
  'orderType': "current" // string | Order type, current - query current orders, fixed - query fixed orders. If not specified, default to querying current orders
};
api.listMultiCollateralOrders(opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
page number Page number [optional] [default to 1]
limit number Maximum number of records to be returned in a single list [optional] [default to 10]
sort string Sort types: time_desc - default sorting by creation time in descending order, ltv_asc - ascending order of ltv, ltv_desc - descending order of ltv. [optional] [default to undefined]
orderType string Order type, current - query current orders, fixed - query fixed orders. If not specified, default to querying current orders [optional] [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

createMultiCollateral

Promise<{ response: http.IncomingMessage; body: OrderResp; }> createMultiCollateral(createMultiCollateralOrder)

Create Multi-Collateral Order

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.MultiCollateralLoanApi(client);
const createMultiCollateralOrder = new CreateMultiCollateralOrder(); // CreateMultiCollateralOrder | 
api.createMultiCollateral(createMultiCollateralOrder)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
createMultiCollateralOrder CreateMultiCollateralOrder

Return type

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

Authorization

apiv4

HTTP request headers

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

getMultiCollateralOrderDetail

Promise<{ response: http.IncomingMessage; body: MultiCollateralOrder; }> getMultiCollateralOrderDetail(orderId)

Get Multi-Collateral Order Detail

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.MultiCollateralLoanApi(client);
const orderId = "12345"; // string | Order ID returned on successful order creation
api.getMultiCollateralOrderDetail(orderId)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
orderId string Order ID returned on successful order creation [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

listMultiRepayRecords

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

List Multi-Collateral Repay 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.MultiCollateralLoanApi(client);
const type = "repay"; // string | Operation type: repay - Regular repayment, liquidate - Liquidation
const opts = {
  'borrowCurrency': "USDT", // string | Borrowed currency
  'page': 1, // number | Page number
  'limit': 10, // number | Maximum number of records to be returned in a single list
  'from': 1609459200, // number | Start timestamp of the query
  'to': 1609459200 // number | Time range ending, default to current time
};
api.listMultiRepayRecords(type, opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
type string Operation type: repay - Regular repayment, liquidate - Liquidation [default to undefined]
borrowCurrency string Borrowed currency [optional] [default to undefined]
page number Page number [optional] [default to 1]
limit number Maximum number of records to be returned in a single list [optional] [default to 10]
from number Start timestamp of the query [optional] [default to undefined]
to number Time range ending, default to current time [optional] [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

repayMultiCollateralLoan

Promise<{ response: http.IncomingMessage; body: MultiRepayResp; }> repayMultiCollateralLoan(repayMultiLoan)

Repay Multi-Collateral Loan

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.MultiCollateralLoanApi(client);
const repayMultiLoan = new RepayMultiLoan(); // RepayMultiLoan | 
api.repayMultiCollateralLoan(repayMultiLoan)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
repayMultiLoan RepayMultiLoan

Return type

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

Authorization

apiv4

HTTP request headers

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

listMultiCollateralRecords

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

Query collateral adjustment 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.MultiCollateralLoanApi(client);
const opts = {
  'page': 1, // number | Page number
  'limit': 10, // number | Maximum number of records to be returned in a single list
  'from': 1609459200, // number | Start timestamp of the query
  'to': 1609459200, // number | Time range ending, default to current time
  'collateralCurrency': "BTC" // string | Collateral
};
api.listMultiCollateralRecords(opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
page number Page number [optional] [default to 1]
limit number Maximum number of records to be returned in a single list [optional] [default to 10]
from number Start timestamp of the query [optional] [default to undefined]
to number Time range ending, default to current time [optional] [default to undefined]
collateralCurrency string Collateral [optional] [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

operateMultiCollateral

Promise<{ response: http.IncomingMessage; body: CollateralAdjustRes; }> operateMultiCollateral(collateralAdjust)

Operate Multi-Collateral

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.MultiCollateralLoanApi(client);
const collateralAdjust = new CollateralAdjust(); // CollateralAdjust | 
api.operateMultiCollateral(collateralAdjust)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
collateralAdjust CollateralAdjust

Return type

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

Authorization

apiv4

HTTP request headers

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

listUserCurrencyQuota

Promise<{ response: http.IncomingMessage; body: Array; }> listUserCurrencyQuota(type, currency)

List User Currency Quota

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.MultiCollateralLoanApi(client);
const type = "collateral"; // string | Currency types: collateral - collateral currency, borrow - borrowing currency.
const currency = "BTC"; // string | When specifying collateral currencies, you can use commas to separate multiple currencies; for borrowing currencies, only one currency can be provided.
api.listUserCurrencyQuota(type, currency)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
type string Currency types: collateral - collateral currency, borrow - borrowing currency. [default to undefined]
currency string When specifying collateral currencies, you can use commas to separate multiple currencies; for borrowing currencies, only one currency can be provided. [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

listMultiCollateralCurrencies

Promise<{ response: http.IncomingMessage; body: MultiCollateralCurrency; }> listMultiCollateralCurrencies()

Query supported borrowing and collateral currencies in Multi-Collateral

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.MultiCollateralLoanApi(client);
api.listMultiCollateralCurrencies()
   .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: MultiCollateralCurrency; }> MultiCollateralCurrency

Authorization

No authorization required

HTTP request headers

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

getMultiCollateralLtv

Promise<{ response: http.IncomingMessage; body: CollateralLtv; }> getMultiCollateralLtv()

Get Multi-Collateral ratio

The Multi-Collateral ratio is fixed, irrespective of the currency.

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.MultiCollateralLoanApi(client);
api.getMultiCollateralLtv()
   .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: CollateralLtv; }> CollateralLtv

Authorization

No authorization required

HTTP request headers

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

getMultiCollateralFixRate

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

Query fixed interest rates for the currency for 7 days and 30 days

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.MultiCollateralLoanApi(client);
api.getMultiCollateralFixRate()
   .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; }> CollateralFixRate

Authorization

No authorization required

HTTP request headers

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

getMultiCollateralCurrentRate

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

Query the current interest rate of the currency

Query the current interest rate of the currency in the last hour. The current interest rate is updated every hour.

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.MultiCollateralLoanApi(client);
const currencies = [["BTC","GT"]]; // Array<string> | Specify the currency name to query the array. The array is separated by commas and has a maximum of 100 items.
const opts = {
  'vipLevel': '0' // string | VIP level, defaults to 0 if not transferred
};
api.getMultiCollateralCurrentRate(currencies, opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
currencies Array<string> Specify the currency name to query the array. The array is separated by commas and has a maximum of 100 items. [default to undefined]
vipLevel string VIP level, defaults to 0 if not transferred [optional] [default to '0']

Return type

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

Authorization

No authorization required

HTTP request headers

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