All URIs are relative to https://api.gateio.ws/api/v4
Method | HTTP request | Description |
---|---|---|
ListMarginAccounts | GET /margin/accounts | Margin account list |
ListMarginAccountBook | GET /margin/account_book | List margin account balance change history |
ListFundingAccounts | GET /margin/funding_accounts | Funding account list |
GetAutoRepayStatus | GET /margin/auto_repay | Retrieve user auto repayment setting |
SetAutoRepay | POST /margin/auto_repay | Update user's auto repayment setting |
GetMarginTransferable | GET /margin/transferable | Get the max transferable amount for a specific margin currency |
ListCrossMarginCurrencies | GET /margin/cross/currencies | Currencies supported by cross margin.(deprecated) |
GetCrossMarginCurrency | GET /margin/cross/currencies/{currency} | Retrieve detail of one single currency supported by cross margin. (deprecated) |
GetCrossMarginAccount | GET /margin/cross/accounts | Retrieve cross margin account. (deprecated) |
ListCrossMarginAccountBook | GET /margin/cross/account_book | Retrieve cross margin account change history. (deprecated) |
ListCrossMarginLoans | GET /margin/cross/loans | List cross margin borrow history. (deprecated) |
CreateCrossMarginLoan | POST /margin/cross/loans | Create a cross margin borrow loan. (deprecated) |
GetCrossMarginLoan | GET /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail. (deprecated) |
ListCrossMarginRepayments | GET /margin/cross/repayments | Retrieve cross margin repayments. (deprecated) |
RepayCrossMarginLoan | POST /margin/cross/repayments | Cross margin repayments. (deprecated) |
GetCrossMarginInterestRecords | GET /margin/cross/interest_records | Interest records for the cross margin account. (deprecated) |
GetCrossMarginTransferable | GET /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency. (deprecated) |
GetCrossMarginEstimateRate | GET /margin/cross/estimate_rate | Estimated interest rates. (deprecated) |
GetCrossMarginBorrowable | GET /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency. (deprecated) |
List<MarginAccount> ListMarginAccounts (string currencyPair = null)
Margin account list
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 ListMarginAccountsExample
{
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 MarginApi(config);
var currencyPair = "BTC_USDT"; // string | Currency pair (optional)
try
{
// Margin account list
List<MarginAccount> result = apiInstance.ListMarginAccounts(currencyPair);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.ListMarginAccounts: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
currencyPair | string | Currency pair | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<MarginAccountBook> ListMarginAccountBook (string currency = null, string currencyPair = null, string type = null, long? from = null, long? to = null, int? page = null, int? limit = null)
List margin account balance change history
Only transferals from and to margin account are provided for now. Time range allows 30 days at most
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 ListMarginAccountBookExample
{
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 MarginApi(config);
var currency = "currency_example"; // string | List records related to specified currency only. If specified, `currency_pair` is also required. (optional)
var currencyPair = "currencyPair_example"; // string | List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided (optional)
var type = "lend"; // string | Only retrieve changes of the specified type. All types will be returned if not specified. (optional)
var from = 1627706330; // long? | Start timestamp of the query (optional)
var to = 1635329650; // long? | Time range ending, default to current time (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)
try
{
// List margin account balance change history
List<MarginAccountBook> result = apiInstance.ListMarginAccountBook(currency, currencyPair, type, from, to, page, limit);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.ListMarginAccountBook: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
currency | string | List records related to specified currency only. If specified, `currency_pair` is also required. | [optional] |
currencyPair | string | List records related to specified currency pair. Used in combination with `currency`. Ignored if `currency` is not provided | [optional] |
type | string | Only retrieve changes of the specified type. All types will be returned if not specified. | [optional] |
from | long? | Start timestamp of the query | [optional] |
to | long? | Time range ending, default to current time | [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] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<FundingAccount> ListFundingAccounts (string currency = null)
Funding account list
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 ListFundingAccountsExample
{
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 MarginApi(config);
var currency = "BTC"; // string | Retrieve data of the specified currency (optional)
try
{
// Funding account list
List<FundingAccount> result = apiInstance.ListFundingAccounts(currency);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.ListFundingAccounts: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Retrieve data of the specified currency | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AutoRepaySetting GetAutoRepayStatus ()
Retrieve user auto repayment setting
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 GetAutoRepayStatusExample
{
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 MarginApi(config);
try
{
// Retrieve user auto repayment setting
AutoRepaySetting result = apiInstance.GetAutoRepayStatus();
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.GetAutoRepayStatus: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Current auto repayment setting | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AutoRepaySetting SetAutoRepay (string status)
Update user's auto repayment setting
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 SetAutoRepayExample
{
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 MarginApi(config);
var status = "on"; // string | New auto repayment status. `on` - enabled, `off` - disabled
try
{
// Update user's auto repayment setting
AutoRepaySetting result = apiInstance.SetAutoRepay(status);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.SetAutoRepay: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
status | string | New auto repayment status. `on` - enabled, `off` - disabled |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Current auto repayment setting | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MarginTransferable GetMarginTransferable (string currency, string currencyPair = null)
Get the max transferable amount for a specific margin currency
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 GetMarginTransferableExample
{
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 MarginApi(config);
var currency = "BTC"; // string | Retrieve data of the specified currency
var currencyPair = "BTC_USDT"; // string | Currency pair (optional)
try
{
// Get the max transferable amount for a specific margin currency
MarginTransferable result = apiInstance.GetMarginTransferable(currency, currencyPair);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.GetMarginTransferable: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Retrieve data of the specified currency | |
currencyPair | string | Currency pair | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<CrossMarginCurrency> ListCrossMarginCurrencies ()
Currencies supported by cross margin.(deprecated)
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 ListCrossMarginCurrenciesExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
var apiInstance = new MarginApi(config);
try
{
// Currencies supported by cross margin.(deprecated)
List<CrossMarginCurrency> result = apiInstance.ListCrossMarginCurrencies();
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.ListCrossMarginCurrencies: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This endpoint does not need any parameter.
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CrossMarginCurrency GetCrossMarginCurrency (string currency)
Retrieve detail of one single currency supported by cross margin. (deprecated)
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 GetCrossMarginCurrencyExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
var apiInstance = new MarginApi(config);
var currency = "BTC"; // string | Currency name
try
{
// Retrieve detail of one single currency supported by cross margin. (deprecated)
CrossMarginCurrency result = apiInstance.GetCrossMarginCurrency(currency);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.GetCrossMarginCurrency: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Currency name |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CrossMarginAccount GetCrossMarginAccount ()
Retrieve cross margin account. (deprecated)
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 GetCrossMarginAccountExample
{
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 MarginApi(config);
try
{
// Retrieve cross margin account. (deprecated)
CrossMarginAccount result = apiInstance.GetCrossMarginAccount();
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.GetCrossMarginAccount: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<CrossMarginAccountBook> ListCrossMarginAccountBook (string currency = null, long? from = null, long? to = null, int? page = null, int? limit = null, string type = null)
Retrieve cross margin account change history. (deprecated)
The record query time range is not allowed to exceed 30 days. When using the limit&page paging function to retrieve data, the maximum number of pages is 100,000, that is, (limit page - 1) <= 100000.
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 ListCrossMarginAccountBookExample
{
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 MarginApi(config);
var currency = "currency_example"; // string | Filter by currency (optional)
var from = 1627706330; // long? | Start timestamp of the query (optional)
var to = 1635329650; // long? | Time range ending, default to current time (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 type = "borrow"; // string | Only retrieve changes of the specified type. All types will be returned if not specified. (optional)
try
{
// Retrieve cross margin account change history. (deprecated)
List<CrossMarginAccountBook> result = apiInstance.ListCrossMarginAccountBook(currency, from, to, page, limit, type);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.ListCrossMarginAccountBook: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Filter by currency | [optional] |
from | long? | Start timestamp of the query | [optional] |
to | long? | Time range ending, default to current time | [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] |
type | string | Only retrieve changes of the specified type. All types will be returned if not specified. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<CrossMarginLoan> ListCrossMarginLoans (int status, string currency = null, int? limit = null, int? offset = null, bool? reverse = null)
List cross margin borrow history. (deprecated)
Sort by creation time in descending order by default. Set reverse=false
to return ascending results.
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 ListCrossMarginLoansExample
{
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 MarginApi(config);
var status = 56; // int | Filter by status. Supported values are 2 and 3. (deprecated.)
var currency = "currency_example"; // string | Filter by currency (optional)
var limit = 100; // int? | Maximum number of records to be returned in a single list (optional) (default to 100)
var offset = 0; // int? | List offset, starting from 0 (optional) (default to 0)
var reverse = true; // bool? | Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional) (default to true)
try
{
// List cross margin borrow history. (deprecated)
List<CrossMarginLoan> result = apiInstance.ListCrossMarginLoans(status, currency, limit, offset, reverse);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.ListCrossMarginLoans: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
status | int | Filter by status. Supported values are 2 and 3. (deprecated.) | |
currency | string | Filter by currency | [optional] |
limit | int? | Maximum number of records to be returned in a single list | [optional] [default to 100] |
offset | int? | List offset, starting from 0 | [optional] [default to 0] |
reverse | bool? | Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results | [optional] [default to true] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CrossMarginLoan CreateCrossMarginLoan (CrossMarginLoan crossMarginLoan)
Create a cross margin borrow loan. (deprecated)
Borrow amount cannot be less than currency minimum borrow amount
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 CreateCrossMarginLoanExample
{
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 MarginApi(config);
var crossMarginLoan = new CrossMarginLoan(); // CrossMarginLoan |
try
{
// Create a cross margin borrow loan. (deprecated)
CrossMarginLoan result = apiInstance.CreateCrossMarginLoan(crossMarginLoan);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.CreateCrossMarginLoan: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
crossMarginLoan | CrossMarginLoan |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully borrowed | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CrossMarginLoan GetCrossMarginLoan (string loanId)
Retrieve single borrow loan detail. (deprecated)
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 GetCrossMarginLoanExample
{
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 MarginApi(config);
var loanId = "12345"; // string | Borrow loan ID
try
{
// Retrieve single borrow loan detail. (deprecated)
CrossMarginLoan result = apiInstance.GetCrossMarginLoan(loanId);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.GetCrossMarginLoan: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
loanId | string | Borrow loan ID |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<CrossMarginRepayment> ListCrossMarginRepayments (string currency = null, string loanId = null, int? limit = null, int? offset = null, bool? reverse = null)
Retrieve cross margin repayments. (deprecated)
Sort by creation time in descending order by default. Set reverse=false
to return ascending results.
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 ListCrossMarginRepaymentsExample
{
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 MarginApi(config);
var currency = "BTC"; // string | (optional)
var loanId = "12345"; // string | (optional)
var limit = 100; // int? | Maximum number of records to be returned in a single list (optional) (default to 100)
var offset = 0; // int? | List offset, starting from 0 (optional) (default to 0)
var reverse = true; // bool? | Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results (optional) (default to true)
try
{
// Retrieve cross margin repayments. (deprecated)
List<CrossMarginRepayment> result = apiInstance.ListCrossMarginRepayments(currency, loanId, limit, offset, reverse);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.ListCrossMarginRepayments: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
currency | string | [optional] | |
loanId | string | [optional] | |
limit | int? | Maximum number of records to be returned in a single list | [optional] [default to 100] |
offset | int? | List offset, starting from 0 | [optional] [default to 0] |
reverse | bool? | Whether to sort in descending order, which is the default. Set `reverse=false` to return ascending results | [optional] [default to true] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<CrossMarginLoan> RepayCrossMarginLoan (CrossMarginRepayRequest crossMarginRepayRequest)
Cross margin repayments. (deprecated)
When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first
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 RepayCrossMarginLoanExample
{
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 MarginApi(config);
var crossMarginRepayRequest = new CrossMarginRepayRequest(); // CrossMarginRepayRequest |
try
{
// Cross margin repayments. (deprecated)
List<CrossMarginLoan> result = apiInstance.RepayCrossMarginLoan(crossMarginRepayRequest);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.RepayCrossMarginLoan: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
crossMarginRepayRequest | CrossMarginRepayRequest |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Loan repaid | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<UniLoanInterestRecord> GetCrossMarginInterestRecords (string currency = null, int? page = null, int? limit = null, long? from = null, long? to = null)
Interest records for the cross margin account. (deprecated)
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 GetCrossMarginInterestRecordsExample
{
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 MarginApi(config);
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)
var from = 1547706332; // long? | Start timestamp (optional)
var to = 1547706332; // long? | End timestamp (optional)
try
{
// Interest records for the cross margin account. (deprecated)
List<UniLoanInterestRecord> result = apiInstance.GetCrossMarginInterestRecords(currency, page, limit, from, to);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.GetCrossMarginInterestRecords: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
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] |
from | long? | Start timestamp | [optional] |
to | long? | End timestamp | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CrossMarginTransferable GetCrossMarginTransferable (string currency)
Get the max transferable amount for a specific cross margin currency. (deprecated)
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 GetCrossMarginTransferableExample
{
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 MarginApi(config);
var currency = "BTC"; // string | Retrieve data of the specified currency
try
{
// Get the max transferable amount for a specific cross margin currency. (deprecated)
CrossMarginTransferable result = apiInstance.GetCrossMarginTransferable(currency);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.GetCrossMarginTransferable: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Retrieve data of the specified currency |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Dictionary<string, string> GetCrossMarginEstimateRate (List currencies)
Estimated interest rates. (deprecated)
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.
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 GetCrossMarginEstimateRateExample
{
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 MarginApi(config);
var currencies = new List<string>(); // List<string> | An array of up to 10 specifying the currency name
try
{
// Estimated interest rates. (deprecated)
Dictionary<string, string> result = apiInstance.GetCrossMarginEstimateRate(currencies);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.GetCrossMarginEstimateRate: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
currencies | List<string> | An array of up to 10 specifying the currency name |
Dictionary<string, string>
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UnifiedBorrowable GetCrossMarginBorrowable (string currency)
Get the max borrowable amount for a specific cross margin currency. (deprecated)
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 GetCrossMarginBorrowableExample
{
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 MarginApi(config);
var currency = "BTC"; // string | Retrieve data of the specified currency
try
{
// Get the max borrowable amount for a specific cross margin currency. (deprecated)
UnifiedBorrowable result = apiInstance.GetCrossMarginBorrowable(currency);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling MarginApi.GetCrossMarginBorrowable: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Retrieve data of the specified currency |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]