Skip to content

Latest commit

 

History

History
705 lines (510 loc) · 34 KB

BotApi.md

File metadata and controls

705 lines (510 loc) · 34 KB

BotApi

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

Method HTTP request Description
getAIHubStrategyRecommend GET /bot/strategy/recommend Get AIHub strategy recommendations
postAIHubSpotGridCreate POST /bot/spot-grid/create Create spot grid
postAIHubMarginGridCreate POST /bot/margin-grid/create Create a lever grid
postAIHubInfiniteGridCreate POST /bot/infinite-grid/create Create infinite grid
postAIHubFuturesGridCreate POST /bot/futures-grid/create Create a contract grid
postAIHubSpotMartingaleCreate POST /bot/spot-martingale/create Create Spot Martin
postAIHubContractMartingaleCreate POST /bot/contract-martingale/create Create contract martin
getAIHubPortfolioRunning GET /bot/portfolio/running List running strategies.
getAIHubPortfolioDetail GET /bot/portfolio/detail Query order policy details
postAIHubPortfolioStop POST /bot/portfolio/stop Terminate a single running policy
postAIHubSmartPositionCreate POST /bot/smart-position/create Create rebalance bot
postAIHubFuturesComboCreate POST /bot/futures-combo/create Create futures-combo bot

getAIHubStrategyRecommend

Promise<{ response: http.IncomingMessage; body: AIHubDiscoverSuccessResponse; }> getAIHubStrategyRecommend(opts)

Get AIHub strategy recommendations

Six real official source types. Exact rebalance asset membership is filtered before ranking. contract_martingale and futures_combo are manual-only. Legacy APR/drawdown and ordinary two-segment refresh remain compatible. Exclusion binds one prior logical candidate before ranking; no alternative returns an empty list without relaxing constraints.

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.BotApi(client);
const opts = {
  'market': "market_example", // string | Trading pair, such as `BTC_USDT`
  'strategyType': "strategyType_example", // 'spot_grid' | 'margin_grid' | 'infinite_grid' | 'futures_grid' | 'spot_martingale' | 'smart_position' | Recommended target policy type; `contract_martingale` not allowed
  'direction': "direction_example", // 'buy' | 'sell' | 'neutral' | Market direction
  'investAmount': "investAmount_example", // string | Context only. No budget eligibility filter; reported unsupported when not consumed.
  'scene': "scene_example", // 'top1' | 'bundle' | 'filter' | 'refresh' | Recommended scenario; when empty, bot-service can automatically infer according to the implementation logic.
  'refreshRecommendationId': "refreshRecommendationId_example", // string | It is recommended to refresh the context. Used when `scene=refresh` is used; when `scene` is empty but the field exists, bot-service will also automatically determine as `refresh`. The official minimum format is `strategy_type|market`; if the `recommendation_id` of the previous recommendation is directly passed through, the third paragraph `backtest_id` will be ignored.
  'limit': 56, // number | Actual maximum result count, 1–10; defaults to 10.
  'maxDrawdownLte': "maxDrawdownLte_example", // string | Maximum drawdown limit
  'backtestAprGte': "backtestAprGte_example", // string | Backtest annualized lower limit
  'xGateServiceId': "xGateServiceId_example", // string | Call source identifier; injected by APIv4 if necessary
  'xGateAppLang': "xGateAppLang_example", // string | Language context, such as `zh-CN` / `en-US`
  'xRequestId': "xRequestId_example", // string | Request link ID; caller can transmit transparently
  'xTraceId': "xTraceId_example", // string | trace header; can be generated uniformly by APIv4
  'excludeRecommendationId': "excludeRecommendationId_example" // string | Refresh-only previous returned identity: type|market|backtest_id, with an optional stable parameter discriminator for colliding source IDs. Ambiguous old identities are rejected; metric-only changes do not produce a new plan.
};
api.getAIHubStrategyRecommend(opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
market string Trading pair, such as `BTC_USDT` [optional] [default to undefined]
strategyType StrategyType Recommended target policy type; `contract_martingale` not allowed [optional] [default to undefined]
direction Direction Market direction [optional] [default to undefined]
investAmount string Context only. No budget eligibility filter; reported unsupported when not consumed. [optional] [default to undefined]
scene Scene Recommended scenario; when empty, bot-service can automatically infer according to the implementation logic. [optional] [default to undefined]
refreshRecommendationId string It is recommended to refresh the context. Used when `scene=refresh` is used; when `scene` is empty but the field exists, bot-service will also automatically determine as `refresh`. The official minimum format is `strategy_type market`; if the `recommendation_id` of the previous recommendation is directly passed through, the third paragraph `backtest_id` will be ignored.
limit number Actual maximum result count, 1–10; defaults to 10. [optional] [default to undefined]
maxDrawdownLte string Maximum drawdown limit [optional] [default to undefined]
backtestAprGte string Backtest annualized lower limit [optional] [default to undefined]
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional] [default to undefined]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional] [default to undefined]
xRequestId string Request link ID; caller can transmit transparently [optional] [default to undefined]
xTraceId string trace header; can be generated uniformly by APIv4 [optional] [default to undefined]
excludeRecommendationId string Refresh-only previous returned identity: type market

Return type

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

Authorization

apiv4

HTTP request headers

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

postAIHubSpotGridCreate

Promise<{ response: http.IncomingMessage; body: AIHubCreateSuccessResponse; }> postAIHubSpotGridCreate(spotGridCreateRequest, opts)

Create spot grid

Create a spot grid strategy based on the incoming parameters.

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.BotApi(client);
const spotGridCreateRequest = new SpotGridCreateRequest(); // SpotGridCreateRequest | 
const opts = {
  'xGateServiceId': "xGateServiceId_example", // string | Call source identifier; injected by APIv4 if necessary
  'xGateAppLang': "xGateAppLang_example", // string | Language context, such as `zh-CN` / `en-US`
  'xRequestId': "xRequestId_example", // string | Request link ID; caller can transmit transparently
  'xTraceId': "xTraceId_example" // string | trace header; can be generated uniformly by APIv4
};
api.postAIHubSpotGridCreate(spotGridCreateRequest, opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
spotGridCreateRequest SpotGridCreateRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional] [default to undefined]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional] [default to undefined]
xRequestId string Request link ID; caller can transmit transparently [optional] [default to undefined]
xTraceId string trace header; can be generated uniformly by APIv4 [optional] [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

postAIHubMarginGridCreate

Promise<{ response: http.IncomingMessage; body: AIHubCreateSuccessResponse; }> postAIHubMarginGridCreate(marginGridCreateRequest, opts)

Create a lever grid

Create a leverage grid strategy based on the passed parameters.

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.BotApi(client);
const marginGridCreateRequest = new MarginGridCreateRequest(); // MarginGridCreateRequest | 
const opts = {
  'xGateServiceId': "xGateServiceId_example", // string | Call source identifier; injected by APIv4 if necessary
  'xGateAppLang': "xGateAppLang_example", // string | Language context, such as `zh-CN` / `en-US`
  'xRequestId': "xRequestId_example", // string | Request link ID; caller can transmit transparently
  'xTraceId': "xTraceId_example" // string | trace header; can be generated uniformly by APIv4
};
api.postAIHubMarginGridCreate(marginGridCreateRequest, opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
marginGridCreateRequest MarginGridCreateRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional] [default to undefined]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional] [default to undefined]
xRequestId string Request link ID; caller can transmit transparently [optional] [default to undefined]
xTraceId string trace header; can be generated uniformly by APIv4 [optional] [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

postAIHubInfiniteGridCreate

Promise<{ response: http.IncomingMessage; body: AIHubCreateSuccessResponse; }> postAIHubInfiniteGridCreate(infiniteGridCreateRequest, opts)

Create infinite grid

Create an infinite grid strategy based on passed parameters.

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.BotApi(client);
const infiniteGridCreateRequest = new InfiniteGridCreateRequest(); // InfiniteGridCreateRequest | 
const opts = {
  'xGateServiceId': "xGateServiceId_example", // string | Call source identifier; injected by APIv4 if necessary
  'xGateAppLang': "xGateAppLang_example", // string | Language context, such as `zh-CN` / `en-US`
  'xRequestId': "xRequestId_example", // string | Request link ID; caller can transmit transparently
  'xTraceId': "xTraceId_example" // string | trace header; can be generated uniformly by APIv4
};
api.postAIHubInfiniteGridCreate(infiniteGridCreateRequest, opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
infiniteGridCreateRequest InfiniteGridCreateRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional] [default to undefined]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional] [default to undefined]
xRequestId string Request link ID; caller can transmit transparently [optional] [default to undefined]
xTraceId string trace header; can be generated uniformly by APIv4 [optional] [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

postAIHubFuturesGridCreate

Promise<{ response: http.IncomingMessage; body: AIHubCreateSuccessResponse; }> postAIHubFuturesGridCreate(futuresGridCreateRequest, opts)

Create a contract grid

Create a contract grid strategy based on the incoming parameters.

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.BotApi(client);
const futuresGridCreateRequest = new FuturesGridCreateRequest(); // FuturesGridCreateRequest | 
const opts = {
  'xGateServiceId': "xGateServiceId_example", // string | Call source identifier; injected by APIv4 if necessary
  'xGateAppLang': "xGateAppLang_example", // string | Language context, such as `zh-CN` / `en-US`
  'xRequestId': "xRequestId_example", // string | Request link ID; caller can transmit transparently
  'xTraceId': "xTraceId_example" // string | trace header; can be generated uniformly by APIv4
};
api.postAIHubFuturesGridCreate(futuresGridCreateRequest, opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
futuresGridCreateRequest FuturesGridCreateRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional] [default to undefined]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional] [default to undefined]
xRequestId string Request link ID; caller can transmit transparently [optional] [default to undefined]
xTraceId string trace header; can be generated uniformly by APIv4 [optional] [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

postAIHubSpotMartingaleCreate

Promise<{ response: http.IncomingMessage; body: AIHubCreateSuccessResponse; }> postAIHubSpotMartingaleCreate(spotMartingaleCreateRequest, opts)

Create Spot Martin

Create a spot martingale strategy from the given parameters. Stop-loss semantics match the app / `MartingaleBot`: - Use `create_params.stop_loss_per_cycle` (ratio per round as a decimal string) for creation-side stop-loss; do not use `stop_loss_price` for creation logic. - Stop-loss prices shown on detail pages are computed per round by the engine; creation accepts optional `create_params.trigger_price` (trigger price).

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.BotApi(client);
const spotMartingaleCreateRequest = new SpotMartingaleCreateRequest(); // SpotMartingaleCreateRequest | 
const opts = {
  'xGateServiceId': "xGateServiceId_example", // string | Call source identifier; injected by APIv4 if necessary
  'xGateAppLang': "xGateAppLang_example", // string | Language context, such as `zh-CN` / `en-US`
  'xRequestId': "xRequestId_example", // string | Request link ID; caller can transmit transparently
  'xTraceId': "xTraceId_example" // string | trace header; can be generated uniformly by APIv4
};
api.postAIHubSpotMartingaleCreate(spotMartingaleCreateRequest, opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
spotMartingaleCreateRequest SpotMartingaleCreateRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional] [default to undefined]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional] [default to undefined]
xRequestId string Request link ID; caller can transmit transparently [optional] [default to undefined]
xTraceId string trace header; can be generated uniformly by APIv4 [optional] [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

postAIHubContractMartingaleCreate

Promise<{ response: http.IncomingMessage; body: AIHubCreateSuccessResponse; }> postAIHubContractMartingaleCreate(contractMartingaleCreateRequest, opts)

Create contract martin

Create a contract Martin strategy based on the input parameters.

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.BotApi(client);
const contractMartingaleCreateRequest = new ContractMartingaleCreateRequest(); // ContractMartingaleCreateRequest | 
const opts = {
  'xGateServiceId': "xGateServiceId_example", // string | Call source identifier; injected by APIv4 if necessary
  'xGateAppLang': "xGateAppLang_example", // string | Language context, such as `zh-CN` / `en-US`
  'xRequestId': "xRequestId_example", // string | Request link ID; caller can transmit transparently
  'xTraceId': "xTraceId_example" // string | trace header; can be generated uniformly by APIv4
};
api.postAIHubContractMartingaleCreate(contractMartingaleCreateRequest, opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
contractMartingaleCreateRequest ContractMartingaleCreateRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional] [default to undefined]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional] [default to undefined]
xRequestId string Request link ID; caller can transmit transparently [optional] [default to undefined]
xTraceId string trace header; can be generated uniformly by APIv4 [optional] [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

getAIHubPortfolioRunning

Promise<{ response: http.IncomingMessage; body: AIHubPortfolioRunningSuccessResponse; }> getAIHubPortfolioRunning(opts)

List running strategies.

Query the list of AIHub strategies currently running by the user, and support filtering by strategy type, trading pair and paging conditions.

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.BotApi(client);
const opts = {
  'strategyType': "strategyType_example", // 'spot_grid' | 'margin_grid' | 'infinite_grid' | 'futures_grid' | 'spot_martingale' | 'contract_martingale' | 'smart_position' | 'futures_combo' | Filter by policy type
  'market': "market_example", // string | Filter by trading pair
  'page': 1, // number | Page number, default 1
  'pageSize': 20, // number | Paging size, default 20, maximum 50
  'xGateServiceId': "xGateServiceId_example", // string | Call source identifier; injected by APIv4 if necessary
  'xGateAppLang': "xGateAppLang_example", // string | Language context, such as `zh-CN` / `en-US`
  'xRequestId': "xRequestId_example", // string | Request link ID; caller can transmit transparently
  'xTraceId': "xTraceId_example" // string | trace header; can be generated uniformly by APIv4
};
api.getAIHubPortfolioRunning(opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
strategyType StrategyType Filter by policy type [optional] [default to undefined]
market string Filter by trading pair [optional] [default to undefined]
page number Page number, default 1 [optional] [default to 1]
pageSize number Paging size, default 20, maximum 50 [optional] [default to 20]
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional] [default to undefined]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional] [default to undefined]
xRequestId string Request link ID; caller can transmit transparently [optional] [default to undefined]
xTraceId string trace header; can be generated uniformly by APIv4 [optional] [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

getAIHubPortfolioDetail

Promise<{ response: http.IncomingMessage; body: AIHubPortfolioDetailSuccessResponse; }> getAIHubPortfolioDetail(strategyId, strategyType, opts)

Query order policy details

Both `strategy_id` and `strategy_type` must be passed in the request, where `strategy_type` is used to distribute to the underlying detailed implementation by strategy type.

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.BotApi(client);
const strategyId = "strategyId_example"; // string | Policy ID
const strategyType = "strategyType_example"; // 'spot_grid' | 'margin_grid' | 'infinite_grid' | 'futures_grid' | 'spot_martingale' | 'contract_martingale' | 'smart_position' | 'futures_combo' | Policy type; used for underlying detail distribution
const opts = {
  'xGateServiceId': "xGateServiceId_example", // string | Call source identifier; injected by APIv4 if necessary
  'xGateAppLang': "xGateAppLang_example", // string | Language context, such as `zh-CN` / `en-US`
  'xRequestId': "xRequestId_example", // string | Request link ID; caller can transmit transparently
  'xTraceId': "xTraceId_example" // string | trace header; can be generated uniformly by APIv4
};
api.getAIHubPortfolioDetail(strategyId, strategyType, opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
strategyId string Policy ID [default to undefined]
strategyType StrategyType Policy type; used for underlying detail distribution [default to undefined]
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional] [default to undefined]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional] [default to undefined]
xRequestId string Request link ID; caller can transmit transparently [optional] [default to undefined]
xTraceId string trace header; can be generated uniformly by APIv4 [optional] [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

postAIHubPortfolioStop

Promise<{ response: http.IncomingMessage; body: AIHubPortfolioStopSuccessResponse; }> postAIHubPortfolioStop(aIHubPortfolioStopRequest, opts)

Terminate a single running policy

Only one policy is allowed to be terminated per request. Risk warning and secondary confirmation are borne by the upper layer of OpenClaw; this interface is only responsible for executing stop.

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.BotApi(client);
const aIHubPortfolioStopRequest = new AIHubPortfolioStopRequest(); // AIHubPortfolioStopRequest | 
const opts = {
  'xGateServiceId': "xGateServiceId_example", // string | Call source identifier; injected by APIv4 if necessary
  'xGateAppLang': "xGateAppLang_example", // string | Language context, such as `zh-CN` / `en-US`
  'xRequestId': "xRequestId_example", // string | Request link ID; caller can transmit transparently
  'xTraceId': "xTraceId_example" // string | trace header; can be generated uniformly by APIv4
};
api.postAIHubPortfolioStop(aIHubPortfolioStopRequest, opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
aIHubPortfolioStopRequest AIHubPortfolioStopRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional] [default to undefined]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional] [default to undefined]
xRequestId string Request link ID; caller can transmit transparently [optional] [default to undefined]
xTraceId string trace header; can be generated uniformly by APIv4 [optional] [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

postAIHubSmartPositionCreate

Promise<{ response: http.IncomingMessage; body: AIHubCreateSuccessResponse; }> postAIHubSmartPositionCreate(aIHubRebalanceCreateRequest, opts)

Create rebalance bot

Typed AIHub adapter; authenticated owner comes only from trusted gateway context.

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.BotApi(client);
const aIHubRebalanceCreateRequest = new AIHubRebalanceCreateRequest(); // AIHubRebalanceCreateRequest | 
const opts = {
  'xGateServiceId': "xGateServiceId_example", // string | Call source identifier; injected by APIv4 if necessary
  'xGateAppLang': "xGateAppLang_example", // string | Language context, such as `zh-CN` / `en-US`
  'xRequestId': "xRequestId_example", // string | Request link ID; caller can transmit transparently
  'xTraceId': "xTraceId_example" // string | trace header; can be generated uniformly by APIv4
};
api.postAIHubSmartPositionCreate(aIHubRebalanceCreateRequest, opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
aIHubRebalanceCreateRequest AIHubRebalanceCreateRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional] [default to undefined]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional] [default to undefined]
xRequestId string Request link ID; caller can transmit transparently [optional] [default to undefined]
xTraceId string trace header; can be generated uniformly by APIv4 [optional] [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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

postAIHubFuturesComboCreate

Promise<{ response: http.IncomingMessage; body: AIHubCreateSuccessResponse; }> postAIHubFuturesComboCreate(aIHubFuturesComboCreateRequest, opts)

Create futures-combo bot

Typed AIHub adapter; authenticated owner comes only from trusted gateway context.

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.BotApi(client);
const aIHubFuturesComboCreateRequest = new AIHubFuturesComboCreateRequest(); // AIHubFuturesComboCreateRequest | 
const opts = {
  'xGateServiceId': "xGateServiceId_example", // string | Call source identifier; injected by APIv4 if necessary
  'xGateAppLang': "xGateAppLang_example", // string | Language context, such as `zh-CN` / `en-US`
  'xRequestId': "xRequestId_example", // string | Request link ID; caller can transmit transparently
  'xTraceId': "xTraceId_example" // string | trace header; can be generated uniformly by APIv4
};
api.postAIHubFuturesComboCreate(aIHubFuturesComboCreateRequest, opts)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
aIHubFuturesComboCreateRequest AIHubFuturesComboCreateRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional] [default to undefined]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional] [default to undefined]
xRequestId string Request link ID; caller can transmit transparently [optional] [default to undefined]
xTraceId string trace header; can be generated uniformly by APIv4 [optional] [default to undefined]

Return type

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

Authorization

apiv4

HTTP request headers

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