Skip to content

Latest commit

 

History

History
283 lines (186 loc) · 8.23 KB

AccountApi.md

File metadata and controls

283 lines (186 loc) · 8.23 KB

AccountApi

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

Method HTTP request Description
getAccountDetail GET /account/detail Get account detail
listSTPGroups GET /account/stp_groups List STP Groups
createSTPGroup POST /account/stp_groups Create STP Group
listSTPGroupsUsers GET /account/stp_groups/{stp_id}/users List users of the STP group
addSTPGroupUsers POST /account/stp_groups/{stp_id}/users Add users to the STP group
deleteSTPGroupUsers DELETE /account/stp_groups/{stp_id}/users Delete the user in the STP group

getAccountDetail

Promise<{ response: http.IncomingMessage; body: AccountDetail; }> getAccountDetail()

Get account detail

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.AccountApi(client);
api.getAccountDetail()
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

This endpoint does not need any parameter.

Return type

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

Authorization

apiv4

HTTP request headers

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

listSTPGroups

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

List STP Groups

Retrieve the list of STP groups created by the main account user only

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.AccountApi(client);
const opts = {
  'name': "group" // string | Perform a fuzzy search based on the name
};
api.listSTPGroups(opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
name string Perform a fuzzy search based on the name [optional] [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

createSTPGroup

Promise<{ response: http.IncomingMessage; body: StpGroup; }> createSTPGroup(stpGroup)

Create STP Group

Only the main account is allowed to create a new STP user group

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.AccountApi(client);
const stpGroup = new StpGroup(); // StpGroup | 
api.createSTPGroup(stpGroup)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
stpGroup StpGroup

Return type

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

Authorization

apiv4

HTTP request headers

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

listSTPGroupsUsers

Promise<{ response: http.IncomingMessage; body: Array; }> listSTPGroupsUsers(stpId)

List users of the STP group

Only the main account that created this STP group is allowed to list the user ID of the STP group

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.AccountApi(client);
const stpId = 1; // number | STP Group ID
api.listSTPGroupsUsers(stpId)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
stpId number STP Group ID [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

addSTPGroupUsers

Promise<{ response: http.IncomingMessage; body: Array; }> addSTPGroupUsers(stpId, requestBody)

Add users to the STP group

  • Only the master account that created the STP user group is allowed to add users to the STP user group.- Only accounts under the main account are allowed to be added. Cross-account is not permitted

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.AccountApi(client);
const stpId = 1; // number | STP Group ID
const requestBody = [[1,2,3]]; // Array<number> | User ID
api.addSTPGroupUsers(stpId, requestBody)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
stpId number STP Group ID [default to undefined]
requestBody Array<number> User ID

Return type

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

Authorization

apiv4

HTTP request headers

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

deleteSTPGroupUsers

Promise<{ response: http.IncomingMessage; body: Array; }> deleteSTPGroupUsers(stpId, requestBody)

Delete the user in the STP group

  • Only the main account that created this STP group is allowed to delete users from the STP user group - Deletion is limited to accounts under the current main account; cross-account deletion is not permitted

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.AccountApi(client);
const stpId = 1; // number | STP Group ID
const requestBody = [[1,2,3]]; // Array<number> | User ID
api.deleteSTPGroupUsers(stpId, requestBody)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
stpId number STP Group ID [default to undefined]
requestBody Array<number> User ID

Return type

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

Authorization

apiv4

HTTP request headers

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