[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
603 lines (473 loc) · 19.8 KB

MarginUniApi.md

File metadata and controls

603 lines (473 loc) · 19.8 KB

Io.Gate.GateApi.Api.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

List<UniCurrencyPair> ListUniCurrencyPairs ()

List lending markets

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class ListUniCurrencyPairsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            var apiInstance = new MarginUniApi(config);

            try
            {
                // List lending markets
                List<UniCurrencyPair> result = apiInstance.ListUniCurrencyPairs();
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling MarginUniApi.ListUniCurrencyPairs: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

List<UniCurrencyPair>

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetUniCurrencyPair

UniCurrencyPair GetUniCurrencyPair (string currencyPair)

Get detail of lending market

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class GetUniCurrencyPairExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            var apiInstance = new MarginUniApi(config);
            var currencyPair = "AE_USDT";  // string | Currency pair

            try
            {
                // Get detail of lending market
                UniCurrencyPair result = apiInstance.GetUniCurrencyPair(currencyPair);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling MarginUniApi.GetUniCurrencyPair: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
currencyPair string Currency pair

Return type

UniCurrencyPair

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetMarginUniEstimateRate

Dictionary<string, string> GetMarginUniEstimateRate (List 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

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class GetMarginUniEstimateRateExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new MarginUniApi(config);
            var currencies = new List<string>(); // List<string> | An array of up to 10 specifying the currency name

            try
            {
                // Estimate interest Rate
                Dictionary<string, string> result = apiInstance.GetMarginUniEstimateRate(currencies);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling MarginUniApi.GetMarginUniEstimateRate: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
currencies List<string> An array of up to 10 specifying the currency name

Return type

Dictionary<string, string>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListUniLoans

List<UniLoan> ListUniLoans (string currencyPair = null, string currency = null, int? page = null, int? limit = null)

List loans

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class ListUniLoansExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new MarginUniApi(config);
            var currencyPair = "BTC_USDT";  // string | Currency pair (optional) 
            var currency = "BTC";  // string | Retrieve data of the specified currency (optional) 
            var page = 1;  // int? | Page number (optional)  (default to 1)
            var limit = 100;  // int? | Maximum response items.  Default: 100, minimum: 1, Maximum: 100 (optional)  (default to 100)

            try
            {
                // List loans
                List<UniLoan> result = apiInstance.ListUniLoans(currencyPair, currency, page, limit);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling MarginUniApi.ListUniLoans: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
currencyPair string Currency pair [optional]
currency string Retrieve data of the specified currency [optional]
page int? Page number [optional] [default to 1]
limit int? Maximum response items. Default: 100, minimum: 1, Maximum: 100 [optional] [default to 100]

Return type

List<UniLoan>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreateUniLoan

void CreateUniLoan (CreateUniLoan createUniLoan)

Borrow or repay

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class CreateUniLoanExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new MarginUniApi(config);
            var createUniLoan = new CreateUniLoan(); // CreateUniLoan | 

            try
            {
                // Borrow or repay
                apiInstance.CreateUniLoan(createUniLoan);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling MarginUniApi.CreateUniLoan: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
createUniLoan CreateUniLoan

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Operated successfully -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListUniLoanRecords

List<UniLoanRecord> ListUniLoanRecords (string type = null, string currency = null, string currencyPair = null, int? page = null, int? limit = null)

Get load records

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class ListUniLoanRecordsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new MarginUniApi(config);
            var type = "type_example";  // string | type: borrow - borrow, repay - repay (optional) 
            var currency = "BTC";  // string | Retrieve data of the specified currency (optional) 
            var currencyPair = "BTC_USDT";  // string | Currency pair (optional) 
            var page = 1;  // int? | Page number (optional)  (default to 1)
            var limit = 100;  // int? | Maximum response items.  Default: 100, minimum: 1, Maximum: 100 (optional)  (default to 100)

            try
            {
                // Get load records
                List<UniLoanRecord> result = apiInstance.ListUniLoanRecords(type, currency, currencyPair, page, limit);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling MarginUniApi.ListUniLoanRecords: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
type string type: borrow - borrow, repay - repay [optional]
currency string Retrieve data of the specified currency [optional]
currencyPair string Currency pair [optional]
page int? Page number [optional] [default to 1]
limit int? Maximum response items. Default: 100, minimum: 1, Maximum: 100 [optional] [default to 100]

Return type

List<UniLoanRecord>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListUniLoanInterestRecords

List<UniLoanInterestRecord> ListUniLoanInterestRecords (string currencyPair = null, string currency = null, int? page = null, int? limit = null, long? from = null, long? to = null)

List interest records

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class ListUniLoanInterestRecordsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new MarginUniApi(config);
            var currencyPair = "BTC_USDT";  // string | Currency pair (optional) 
            var currency = "BTC";  // string | Retrieve data of the specified currency (optional) 
            var page = 1;  // int? | Page number (optional)  (default to 1)
            var limit = 100;  // int? | Maximum number of records to be returned in a single list (optional)  (default to 100)
            var from = 1547706332;  // long? | Start timestamp (optional) 
            var to = 1547706332;  // long? | End timestamp (optional) 

            try
            {
                // List interest records
                List<UniLoanInterestRecord> result = apiInstance.ListUniLoanInterestRecords(currencyPair, currency, page, limit, from, to);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling MarginUniApi.ListUniLoanInterestRecords: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
currencyPair string Currency pair [optional]
currency string Retrieve data of the specified currency [optional]
page int? Page number [optional] [default to 1]
limit int? Maximum number of records to be returned in a single list [optional] [default to 100]
from long? Start timestamp [optional]
to long? End timestamp [optional]

Return type

List<UniLoanInterestRecord>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetUniBorrowable

MaxUniBorrowable GetUniBorrowable (string currency, string currencyPair)

Get maximum borrowable

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class GetUniBorrowableExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new MarginUniApi(config);
            var currency = "BTC";  // string | Retrieve data of the specified currency
            var currencyPair = "BTC_USDT";  // string | Currency pair

            try
            {
                // Get maximum borrowable
                MaxUniBorrowable result = apiInstance.GetUniBorrowable(currency, currencyPair);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling MarginUniApi.GetUniBorrowable: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
currency string Retrieve data of the specified currency
currencyPair string Currency pair

Return type

MaxUniBorrowable

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

[Back to top] [Back to API list] [Back to Model list] [Back to README]