Skip to content

Latest commit

 

History

History
806 lines (625 loc) · 24.4 KB

File metadata and controls

806 lines (625 loc) · 24.4 KB

Io.Gate.GateApi.Api.SubAccountApi

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

Method HTTP request Description
ListSubAccounts GET /sub_accounts List sub-accounts
CreateSubAccounts POST /sub_accounts Create a new sub-account
GetSubAccount GET /sub_accounts/{user_id} Get sub-account
ListSubAccountKeys GET /sub_accounts/{user_id}/keys List all API key pairs of the sub-account
CreateSubAccountKeys POST /sub_accounts/{user_id}/keys Create new sub-account API key pair
GetSubAccountKey GET /sub_accounts/{user_id}/keys/{key} Get specific API key pair of the sub-account
UpdateSubAccountKeys PUT /sub_accounts/{user_id}/keys/{key} Update sub-account API key pair
DeleteSubAccountKeys DELETE /sub_accounts/{user_id}/keys/{key} Delete sub-account API key pair
LockSubAccount POST /sub_accounts/{user_id}/lock Lock sub-account
UnlockSubAccount POST /sub_accounts/{user_id}/unlock Unlock sub-account
ListUnifiedMode GET /sub_accounts/unified_mode Get sub-account mode

ListSubAccounts

List<SubAccount> ListSubAccounts (string type = null)

List sub-accounts

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 ListSubAccountsExample
    {
        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 SubAccountApi(config);
            var type = "0";  // string | Enter `0` to list all types of sub-accounts (currently supporting cross-margin sub-accounts and regular sub-accounts). Enter `1` to query regular sub-accounts only. If no parameter is passed, only regular sub-accounts will be queried by default. (optional) 

            try
            {
                // List sub-accounts
                List<SubAccount> result = apiInstance.ListSubAccounts(type);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling SubAccountApi.ListSubAccounts: " + 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 Enter `0` to list all types of sub-accounts (currently supporting cross-margin sub-accounts and regular sub-accounts). Enter `1` to query regular sub-accounts only. If no parameter is passed, only regular sub-accounts will be queried by default. [optional]

Return type

List<SubAccount>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved successfully -

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

CreateSubAccounts

SubAccount CreateSubAccounts (SubAccount subAccount)

Create a new sub-account

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 CreateSubAccountsExample
    {
        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 SubAccountApi(config);
            var subAccount = new SubAccount(); // SubAccount | 

            try
            {
                // Create a new sub-account
                SubAccount result = apiInstance.CreateSubAccounts(subAccount);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling SubAccountApi.CreateSubAccounts: " + 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
subAccount SubAccount

Return type

SubAccount

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Created successfully -

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

GetSubAccount

SubAccount GetSubAccount (long userId)

Get sub-account

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 GetSubAccountExample
    {
        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 SubAccountApi(config);
            var userId = 56;  // long | Sub-account user ID

            try
            {
                // Get sub-account
                SubAccount result = apiInstance.GetSubAccount(userId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling SubAccountApi.GetSubAccount: " + 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
userId long Sub-account user ID

Return type

SubAccount

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]

ListSubAccountKeys

List<SubAccountKey> ListSubAccountKeys (int userId)

List all API key pairs of the sub-account

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 ListSubAccountKeysExample
    {
        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 SubAccountApi(config);
            var userId = 56;  // int | Sub-account user ID

            try
            {
                // List all API key pairs of the sub-account
                List<SubAccountKey> result = apiInstance.ListSubAccountKeys(userId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling SubAccountApi.ListSubAccountKeys: " + 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
userId int Sub-account user ID

Return type

List<SubAccountKey>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved successfully -

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

CreateSubAccountKeys

SubAccountKey CreateSubAccountKeys (long userId, SubAccountKey subAccountKey)

Create new sub-account API key pair

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 CreateSubAccountKeysExample
    {
        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 SubAccountApi(config);
            var userId = 56;  // long | Sub-account user ID
            var subAccountKey = new SubAccountKey(); // SubAccountKey | 

            try
            {
                // Create new sub-account API key pair
                SubAccountKey result = apiInstance.CreateSubAccountKeys(userId, subAccountKey);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling SubAccountApi.CreateSubAccountKeys: " + 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
userId long Sub-account user ID
subAccountKey SubAccountKey

Return type

SubAccountKey

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Created successfully -

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

GetSubAccountKey

SubAccountKey GetSubAccountKey (int userId, string key)

Get specific API key pair of the sub-account

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 GetSubAccountKeyExample
    {
        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 SubAccountApi(config);
            var userId = 56;  // int | Sub-account user ID
            var key = "key_example";  // string | Sub-account API key

            try
            {
                // Get specific API key pair of the sub-account
                SubAccountKey result = apiInstance.GetSubAccountKey(userId, key);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling SubAccountApi.GetSubAccountKey: " + 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
userId int Sub-account user ID
key string Sub-account API key

Return type

SubAccountKey

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]

UpdateSubAccountKeys

void UpdateSubAccountKeys (int userId, string key, SubAccountKey subAccountKey)

Update sub-account API key pair

Modify Sub-account API Key Pair (Note: This interface cannot modify the mode account type attribute)

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 UpdateSubAccountKeysExample
    {
        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 SubAccountApi(config);
            var userId = 56;  // int | Sub-account user ID
            var key = "key_example";  // string | Sub-account API key
            var subAccountKey = new SubAccountKey(); // SubAccountKey | 

            try
            {
                // Update sub-account API key pair
                apiInstance.UpdateSubAccountKeys(userId, key, subAccountKey);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling SubAccountApi.UpdateSubAccountKeys: " + 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
userId int Sub-account user ID
key string Sub-account API key
subAccountKey SubAccountKey

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 Updated successfully -

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

DeleteSubAccountKeys

void DeleteSubAccountKeys (int userId, string key)

Delete sub-account API key pair

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 DeleteSubAccountKeysExample
    {
        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 SubAccountApi(config);
            var userId = 56;  // int | Sub-account user ID
            var key = "key_example";  // string | Sub-account API key

            try
            {
                // Delete sub-account API key pair
                apiInstance.DeleteSubAccountKeys(userId, key);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling SubAccountApi.DeleteSubAccountKeys: " + 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
userId int Sub-account user ID
key string Sub-account API key

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
204 Deleted successfully -

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

LockSubAccount

void LockSubAccount (long userId)

Lock sub-account

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 LockSubAccountExample
    {
        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 SubAccountApi(config);
            var userId = 56;  // long | Sub-account user ID

            try
            {
                // Lock sub-account
                apiInstance.LockSubAccount(userId);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling SubAccountApi.LockSubAccount: " + 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
userId long Sub-account user ID

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
204 Locked successfully -

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

UnlockSubAccount

void UnlockSubAccount (long userId)

Unlock sub-account

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 UnlockSubAccountExample
    {
        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 SubAccountApi(config);
            var userId = 56;  // long | Sub-account user ID

            try
            {
                // Unlock sub-account
                apiInstance.UnlockSubAccount(userId);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling SubAccountApi.UnlockSubAccount: " + 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
userId long Sub-account user ID

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
204 Unlocked successfully -

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

ListUnifiedMode

List<SubUserMode> ListUnifiedMode ()

Get sub-account mode

Unified account mode: - classic: Classic account mode - multi_currency: Cross-currency margin mode - portfolio: Portfolio margin mode - single_currency: Single-currency margin mode

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 ListUnifiedModeExample
    {
        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 SubAccountApi(config);

            try
            {
                // Get sub-account mode
                List<SubUserMode> result = apiInstance.ListUnifiedMode();
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling SubAccountApi.ListUnifiedMode: " + 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<SubUserMode>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Query successful -

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