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 the sub-account |
listSubAccountKeys | GET /sub_accounts/{user_id}/keys | List all API Key of the sub-account |
createSubAccountKeys | POST /sub_accounts/{user_id}/keys | Create API Key of the sub-account |
getSubAccountKey | GET /sub_accounts/{user_id}/keys/{key} | Get the API Key of the sub-account |
updateSubAccountKeys | PUT /sub_accounts/{user_id}/keys/{key} | Update API key of the sub-account |
deleteSubAccountKeys | DELETE /sub_accounts/{user_id}/keys/{key} | Delete API key of the sub-account |
lockSubAccount | POST /sub_accounts/{user_id}/lock | Lock the sub-account |
unlockSubAccount | POST /sub_accounts/{user_id}/unlock | Unlock the sub-account |
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 | `0` to list all types of sub-accounts (currently supporting cross margin accounts and sub-accounts). `1` to list sub-accounts only. If no parameter is passed, only sub-accounts will be listed 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 | `0` to list all types of sub-accounts (currently supporting cross margin accounts and sub-accounts). `1` to list sub-accounts only. If no parameter is passed, only sub-accounts will be listed 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 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.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 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: Array; }> createSubAccountKeys(userId, subAccountKey)
Create API Key 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 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: Array; }> SubAccountKey
- Content-Type: application/json
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: SubAccountKey; }> getSubAccountKey(userId, key)
Get the API Key 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 | The API Key of the sub-account
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 | The API Key of the sub-account | [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 API key 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 | The API Key of the sub-account
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 | The API Key of the sub-account | [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 API key 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 | The API Key of the sub-account
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 | The API Key of the sub-account | [default to undefined] |
Promise<{ response: AxiosResponse; body?: any; }>
- Content-Type: Not defined
- Accept: Not defined
Promise<{ response: http.IncomingMessage; body?: any; }> lockSubAccount(userId)
Lock 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 | The user id of the sub-account
api.lockSubAccount(userId)
.then(value => console.log('API called successfully.'),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
userId | number | The user id of the sub-account | [default to undefined] |
Promise<{ response: AxiosResponse; body?: any; }>
- Content-Type: Not defined
- Accept: Not defined
Promise<{ response: http.IncomingMessage; body?: any; }> unlockSubAccount(userId)
Unlock 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 | The user id of the sub-account
api.unlockSubAccount(userId)
.then(value => console.log('API called successfully.'),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
userId | number | The user id of the sub-account | [default to undefined] |
Promise<{ response: AxiosResponse; body?: any; }>
- Content-Type: Not defined
- Accept: Not defined