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 |
Promise<{ response: http.IncomingMessage; body: Array; }> listSubAccounts(opts)
List sub-accounts
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.SubAccountApi(client);
const opts = {
'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.
};
api.listSubAccounts(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| 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] [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> SubAccount
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: SubAccount; }> createSubAccounts(subAccount)
Create a new sub-account
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.SubAccountApi(client);
const subAccount = new SubAccount(); // SubAccount |
api.createSubAccounts(subAccount)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| subAccount | SubAccount |
Promise<{ response: AxiosResponse; body: SubAccount; }> SubAccount
- Content-Type: application/json
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: SubAccount; }> getSubAccount(userId)
Get sub-account
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.SubAccountApi(client);
const userId = 56; // number | Sub-account user ID
api.getSubAccount(userId)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| userId | number | Sub-account user ID | [default to undefined] |
Promise<{ response: AxiosResponse; body: SubAccount; }> SubAccount
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listSubAccountKeys(userId)
List all API key pairs of the sub-account
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.SubAccountApi(client);
const userId = 56; // number | Sub-account user ID
api.listSubAccountKeys(userId)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| userId | number | Sub-account user ID | [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> SubAccountKey
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: SubAccountKey; }> createSubAccountKeys(userId, subAccountKey)
Create new sub-account API key pair
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.SubAccountApi(client);
const userId = 56; // number | Sub-account user ID
const subAccountKey = new SubAccountKey(); // SubAccountKey |
api.createSubAccountKeys(userId, subAccountKey)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| userId | number | Sub-account user ID | [default to undefined] |
| subAccountKey | SubAccountKey |
Promise<{ response: AxiosResponse; body: SubAccountKey; }> SubAccountKey
- Content-Type: application/json
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: SubAccountKey; }> getSubAccountKey(userId, key)
Get specific API key pair of the sub-account
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.SubAccountApi(client);
const userId = 56; // number | Sub-account user ID
const key = "key_example"; // string | Sub-account API key
api.getSubAccountKey(userId, key)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| userId | number | Sub-account user ID | [default to undefined] |
| key | string | Sub-account API key | [default to undefined] |
Promise<{ response: AxiosResponse; body: SubAccountKey; }> SubAccountKey
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body?: any; }> updateSubAccountKeys(userId, key, subAccountKey)
Update sub-account API key pair
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.SubAccountApi(client);
const userId = 56; // number | Sub-account user ID
const key = "key_example"; // string | Sub-account API key
const subAccountKey = new SubAccountKey(); // SubAccountKey |
api.updateSubAccountKeys(userId, key, subAccountKey)
.then(value => console.log('API called successfully.'),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| userId | number | Sub-account user ID | [default to undefined] |
| key | string | Sub-account API key | [default to undefined] |
| subAccountKey | SubAccountKey |
Promise<{ response: AxiosResponse; body?: any; }>
- Content-Type: application/json
- Accept: Not defined
Promise<{ response: http.IncomingMessage; body?: any; }> deleteSubAccountKeys(userId, key)
Delete sub-account API key pair
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.SubAccountApi(client);
const userId = 56; // number | Sub-account user ID
const key = "key_example"; // string | Sub-account API key
api.deleteSubAccountKeys(userId, key)
.then(value => console.log('API called successfully.'),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| userId | number | Sub-account user ID | [default to undefined] |
| key | string | Sub-account API key | [default to undefined] |
Promise<{ response: AxiosResponse; body?: any; }>
- Content-Type: Not defined
- Accept: Not defined
Promise<{ response: http.IncomingMessage; body?: any; }> lockSubAccount(userId)
Lock sub-account
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.SubAccountApi(client);
const userId = 56; // number | Sub-account user ID
api.lockSubAccount(userId)
.then(value => console.log('API called successfully.'),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| userId | number | Sub-account user ID | [default to undefined] |
Promise<{ response: AxiosResponse; body?: any; }>
- Content-Type: Not defined
- Accept: Not defined
Promise<{ response: http.IncomingMessage; body?: any; }> unlockSubAccount(userId)
Unlock sub-account
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.SubAccountApi(client);
const userId = 56; // number | Sub-account user ID
api.unlockSubAccount(userId)
.then(value => console.log('API called successfully.'),
error => console.error(error));| Name | Type | Description | Notes |
|---|---|---|---|
| userId | number | Sub-account user ID | [default to undefined] |
Promise<{ response: AxiosResponse; body?: any; }>
- Content-Type: Not defined
- Accept: Not defined
Promise<{ response: http.IncomingMessage; body: Array; }> listUnifiedMode()
Get sub-account mode
Unified account mode: - `classic`: Classic account mode - `multi_currency`: Multi-currency margin mode - `portfolio`: Portfolio margin mode
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.SubAccountApi(client);
api.listUnifiedMode()
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));This endpoint does not need any parameter.
Promise<{ response: AxiosResponse; body: Array; }> SubUserMode
- Content-Type: Not defined
- Accept: application/json