Skip to content

Latest commit

 

History

History
411 lines (269 loc) · 11.6 KB

AccountApi.md

File metadata and controls

411 lines (269 loc) · 11.6 KB

AccountApi

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

Method HTTP request Description
getAccountDetail GET /account/detail Get account detail
getAccountRateLimit GET /account/rate_limit Get user transaction rate limit information
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
getDebitFee GET /account/debit_fee Query GT deduction configuration.
setDebitFee POST /account/debit_fee Set GT deduction.

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

getAccountRateLimit

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

Get user transaction rate limit information

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.getAccountRateLimit()
   .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: Array; }> AccountRateLimit

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, userId)

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 userId = 1; // number | STP user ID, multiple can be separated by commas
api.deleteSTPGroupUsers(stpId, userId)
   .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]
userId number STP user ID, multiple can be separated by commas [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

getDebitFee

Promise<{ response: http.IncomingMessage; body: DebitFee; }> getDebitFee()

Query GT deduction configuration.

Query the current GT deduction configuration for the 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.AccountApi(client);
api.getDebitFee()
   .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: DebitFee; }> DebitFee

Authorization

apiv4

HTTP request headers

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

setDebitFee

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

Set GT deduction.

Enable or disable GT deduction for the current 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.AccountApi(client);
const debitFee = new DebitFee(); // DebitFee | 
api.setDebitFee(debitFee)
   .then(value => console.log('API called successfully.'),
         error => console.error(error));

Parameters

Name Type Description Notes
debitFee DebitFee

Return type

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

Authorization

apiv4

HTTP request headers

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