Skip to content

Latest commit

 

History

History
459 lines (306 loc) · 13.5 KB

SubAccountApi.md

File metadata and controls

459 lines (306 loc) · 13.5 KB

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

listSubAccounts

Promise<{ response: http.IncomingMessage; body: Array; }> listSubAccounts(opts)

List sub-accounts

Example

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));

Parameters

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]

Return type

Promise<{ response: AxiosResponse; body: Array; }> SubAccount

Authorization

apiv4

HTTP request headers

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

createSubAccounts

Promise<{ response: http.IncomingMessage; body: SubAccount; }> createSubAccounts(subAccount)

Create a new sub-account

Example

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));

Parameters

Name Type Description Notes
subAccount SubAccount

Return type

Promise<{ response: AxiosResponse; body: SubAccount; }> SubAccount

Authorization

apiv4

HTTP request headers

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

getSubAccount

Promise<{ response: http.IncomingMessage; body: SubAccount; }> getSubAccount(userId)

Get the sub-account

Example

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));

Parameters

Name Type Description Notes
userId number Sub-account user id [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: SubAccount; }> SubAccount

Authorization

apiv4

HTTP request headers

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

listSubAccountKeys

Promise<{ response: http.IncomingMessage; body: Array; }> listSubAccountKeys(userId)

List all API Key of the sub-account

Example

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));

Parameters

Name Type Description Notes
userId number Sub-account user id [default to undefined]

Return type

Promise<{ response: AxiosResponse; body: Array; }> SubAccountKey

Authorization

apiv4

HTTP request headers

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

createSubAccountKeys

Promise<{ response: http.IncomingMessage; body: Array; }> createSubAccountKeys(userId, subAccountKey)

Create API Key of the sub-account

Example

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));

Parameters

Name Type Description Notes
userId number Sub-account user id [default to undefined]
subAccountKey SubAccountKey

Return type

Promise<{ response: AxiosResponse; body: Array; }> SubAccountKey

Authorization

apiv4

HTTP request headers

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

getSubAccountKey

Promise<{ response: http.IncomingMessage; body: SubAccountKey; }> getSubAccountKey(userId, key)

Get the API Key of the sub-account

Example

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));

Parameters

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]

Return type

Promise<{ response: AxiosResponse; body: SubAccountKey; }> SubAccountKey

Authorization

apiv4

HTTP request headers

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

updateSubAccountKeys

Promise<{ response: http.IncomingMessage; body?: any; }> updateSubAccountKeys(userId, key, subAccountKey)

Update API key of the sub-account

Example

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));

Parameters

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

Return type

Promise<{ response: AxiosResponse; body?: any; }>

Authorization

apiv4

HTTP request headers

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

deleteSubAccountKeys

Promise<{ response: http.IncomingMessage; body?: any; }> deleteSubAccountKeys(userId, key)

Delete API key of the sub-account

Example

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));

Parameters

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]

Return type

Promise<{ response: AxiosResponse; body?: any; }>

Authorization

apiv4

HTTP request headers

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

lockSubAccount

Promise<{ response: http.IncomingMessage; body?: any; }> lockSubAccount(userId)

Lock the sub-account

Example

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));

Parameters

Name Type Description Notes
userId number The user id of the sub-account [default to undefined]

Return type

Promise<{ response: AxiosResponse; body?: any; }>

Authorization

apiv4

HTTP request headers

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

unlockSubAccount

Promise<{ response: http.IncomingMessage; body?: any; }> unlockSubAccount(userId)

Unlock the sub-account

Example

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));

Parameters

Name Type Description Notes
userId number The user id of the sub-account [default to undefined]

Return type

Promise<{ response: AxiosResponse; body?: any; }>

Authorization

apiv4

HTTP request headers

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