All URIs are relative to https://api.gateio.ws/api/v4
Method | HTTP request | Description |
---|---|---|
listOptionsUnderlyings | GET /options/underlyings | List all underlyings |
listOptionsExpirations | GET /options/expirations | List all expiration times |
listOptionsContracts | GET /options/contracts | List all the contracts with specified underlying and expiration time |
getOptionsContract | GET /options/contracts/{contract} | Query specified contract detail |
listOptionsSettlements | GET /options/settlements | List settlement history |
getOptionsSettlement | GET /options/settlements/{contract} | Get specified contract's settlement |
listMyOptionsSettlements | GET /options/my_settlements | List my options settlements |
listOptionsOrderBook | GET /options/order_book | Options order book |
listOptionsTickers | GET /options/tickers | List tickers of options contracts |
listOptionsUnderlyingTickers | GET /options/underlying/tickers/{underlying} | Get underlying ticker |
listOptionsCandlesticks | GET /options/candlesticks | Get options candlesticks |
listOptionsUnderlyingCandlesticks | GET /options/underlying/candlesticks | Mark price candlesticks of an underlying |
listOptionsTrades | GET /options/trades | Options trade history |
listOptionsAccount | GET /options/accounts | List options account |
listOptionsAccountBook | GET /options/account_book | List account changing history |
listOptionsPositions | GET /options/positions | List user's positions of specified underlying |
getOptionsPosition | GET /options/positions/{contract} | Get specified contract position |
listOptionsPositionClose | GET /options/position_close | List user's liquidation history of specified underlying |
listOptionsOrders | GET /options/orders | List options orders |
createOptionsOrder | POST /options/orders | Create an options order |
cancelOptionsOrders | DELETE /options/orders | Cancel all `open` orders matched |
getOptionsOrder | GET /options/orders/{order_id} | Get a single order |
cancelOptionsOrder | DELETE /options/orders/{order_id} | Cancel a single order |
listMyOptionsTrades | GET /options/my_trades | List personal trading history |
Promise<{ response: http.IncomingMessage; body: Array; }> listOptionsUnderlyings()
List all underlyings
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
const api = new GateApi.OptionsApi(client);
api.listOptionsUnderlyings()
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
This endpoint does not need any parameter.
Promise<{ response: AxiosResponse; body: Array; }> OptionsUnderlying
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listOptionsExpirations(underlying)
List all expiration times
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
const api = new GateApi.OptionsApi(client);
const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint)
api.listOptionsExpirations(underlying)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
underlying | string | Underlying (Obtained by listing underlying endpoint) | [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> number
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listOptionsContracts(underlying, opts)
List all the contracts with specified underlying and expiration time
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
const api = new GateApi.OptionsApi(client);
const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint)
const opts = {
'expiration': 1636588800 // number | Unix timestamp of the expiration time
};
api.listOptionsContracts(underlying, opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
underlying | string | Underlying (Obtained by listing underlying endpoint) | [default to undefined] |
expiration | number | Unix timestamp of the expiration time | [optional] [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> OptionsContract
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: OptionsContract; }> getOptionsContract(contract)
Query specified contract detail
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
const api = new GateApi.OptionsApi(client);
const contract = "BTC_USDT-20211130-65000-C"; // string |
api.getOptionsContract(contract)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
contract | string | [default to undefined] |
Promise<{ response: AxiosResponse; body: OptionsContract; }> OptionsContract
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listOptionsSettlements(underlying, opts)
List settlement history
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
const api = new GateApi.OptionsApi(client);
const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint)
const opts = {
'limit': 100, // number | Maximum number of records to be returned in a single list
'offset': 0, // number | List offset, starting from 0
'from': 1547706332, // number | Start timestamp
'to': 1547706332 // number | End timestamp
};
api.listOptionsSettlements(underlying, opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
underlying | string | Underlying (Obtained by listing underlying endpoint) | [default to undefined] |
limit | number | Maximum number of records to be returned in a single list | [optional] [default to 100] |
offset | number | List offset, starting from 0 | [optional] [default to 0] |
from | number | Start timestamp | [optional] [default to undefined] |
to | number | End timestamp | [optional] [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> OptionsSettlement
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: OptionsSettlement; }> getOptionsSettlement(contract, underlying, at)
Get specified contract's settlement
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
const api = new GateApi.OptionsApi(client);
const contract = "BTC_USDT-20211130-65000-C"; // string |
const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint)
const at = 56; // number |
api.getOptionsSettlement(contract, underlying, at)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
contract | string | [default to undefined] | |
underlying | string | Underlying (Obtained by listing underlying endpoint) | [default to undefined] |
at | number | [default to undefined] |
Promise<{ response: AxiosResponse; body: OptionsSettlement; }> OptionsSettlement
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listMyOptionsSettlements(underlying, opts)
List my options settlements
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.OptionsApi(client);
const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint)
const opts = {
'contract': "BTC_USDT-20210916-5000-C", // string | Options contract name
'limit': 100, // number | Maximum number of records to be returned in a single list
'offset': 0, // number | List offset, starting from 0
'from': 1547706332, // number | Start timestamp
'to': 1547706332 // number | End timestamp
};
api.listMyOptionsSettlements(underlying, opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
underlying | string | Underlying (Obtained by listing underlying endpoint) | [default to undefined] |
contract | string | Options contract name | [optional] [default to undefined] |
limit | number | Maximum number of records to be returned in a single list | [optional] [default to 100] |
offset | number | List offset, starting from 0 | [optional] [default to 0] |
from | number | Start timestamp | [optional] [default to undefined] |
to | number | End timestamp | [optional] [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> OptionsMySettlements
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: FuturesOrderBook; }> listOptionsOrderBook(contract, opts)
Options order book
Bids will be sorted by price from high to low, while asks sorted reversely
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
const api = new GateApi.OptionsApi(client);
const contract = "BTC_USDT-20210916-5000-C"; // string | Options contract name
const opts = {
'interval': '0', // '0' | '0.1' | '0.01' | Order depth. 0 means no aggregation is applied. default to 0
'limit': 10, // number | Maximum number of order depth data in asks or bids
'withId': false // boolean | Whether the order book update ID will be returned. This ID increases by 1 on every order book update
};
api.listOptionsOrderBook(contract, opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
contract | string | Options contract name | [default to undefined] |
interval | Interval | Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to '0'] |
limit | number | Maximum number of order depth data in asks or bids | [optional] [default to 10] |
withId | boolean | Whether the order book update ID will be returned. This ID increases by 1 on every order book update | [optional] [default to undefined] |
Promise<{ response: AxiosResponse; body: FuturesOrderBook; }> FuturesOrderBook
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listOptionsTickers(underlying)
List tickers of options contracts
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
const api = new GateApi.OptionsApi(client);
const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint)
api.listOptionsTickers(underlying)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
underlying | string | Underlying (Obtained by listing underlying endpoint) | [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> OptionsTicker
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: OptionsUnderlyingTicker; }> listOptionsUnderlyingTickers(underlying)
Get underlying ticker
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
const api = new GateApi.OptionsApi(client);
const underlying = "BTC_USDT"; // string | Underlying
api.listOptionsUnderlyingTickers(underlying)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
underlying | string | Underlying | [default to undefined] |
Promise<{ response: AxiosResponse; body: OptionsUnderlyingTicker; }> OptionsUnderlyingTicker
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listOptionsCandlesticks(contract, opts)
Get options candlesticks
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
const api = new GateApi.OptionsApi(client);
const contract = "BTC_USDT-20210916-5000-C"; // string | Options contract name
const opts = {
'limit': 100, // number | Maximum number of records to be returned in a single list
'from': 1547706332, // number | Start timestamp
'to': 1547706332, // number | End timestamp
'interval': '5m' // '1m' | '5m' | '15m' | '30m' | '1h' | Interval time between data points
};
api.listOptionsCandlesticks(contract, opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
contract | string | Options contract name | [default to undefined] |
limit | number | Maximum number of records to be returned in a single list | [optional] [default to 100] |
from | number | Start timestamp | [optional] [default to undefined] |
to | number | End timestamp | [optional] [default to undefined] |
interval | Interval | Interval time between data points | [optional] [default to '5m'] |
Promise<{ response: AxiosResponse; body: Array; }> OptionsCandlestick
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listOptionsUnderlyingCandlesticks(underlying, opts)
Mark price candlesticks of an underlying
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
const api = new GateApi.OptionsApi(client);
const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint)
const opts = {
'limit': 100, // number | Maximum number of records to be returned in a single list
'from': 1547706332, // number | Start timestamp
'to': 1547706332, // number | End timestamp
'interval': '5m' // '1m' | '5m' | '15m' | '30m' | '1h' | Interval time between data points
};
api.listOptionsUnderlyingCandlesticks(underlying, opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
underlying | string | Underlying (Obtained by listing underlying endpoint) | [default to undefined] |
limit | number | Maximum number of records to be returned in a single list | [optional] [default to 100] |
from | number | Start timestamp | [optional] [default to undefined] |
to | number | End timestamp | [optional] [default to undefined] |
interval | Interval | Interval time between data points | [optional] [default to '5m'] |
Promise<{ response: AxiosResponse; body: Array; }> FuturesCandlestick
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listOptionsTrades(opts)
Options trade history
const GateApi = require('gate-api');
const client = new GateApi.ApiClient();
// uncomment the next line to change base path
// client.basePath = "https://some-other-host"
const api = new GateApi.OptionsApi(client);
const opts = {
'contract': "BTC_USDT-20210916-5000-C", // string | Options contract name
'type': "1546935600", // string | `C` is call, while `P` is put
'limit': 100, // number | Maximum number of records to be returned in a single list
'offset': 0, // number | List offset, starting from 0
'from': 1547706332, // number | Start timestamp
'to': 1547706332 // number | End timestamp
};
api.listOptionsTrades(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
contract | string | Options contract name | [optional] [default to undefined] |
type | string | `C` is call, while `P` is put | [optional] [default to undefined] |
limit | number | Maximum number of records to be returned in a single list | [optional] [default to 100] |
offset | number | List offset, starting from 0 | [optional] [default to 0] |
from | number | Start timestamp | [optional] [default to undefined] |
to | number | End timestamp | [optional] [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> FuturesTrade
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: OptionsAccount; }> listOptionsAccount()
List options 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.OptionsApi(client);
api.listOptionsAccount()
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
This endpoint does not need any parameter.
Promise<{ response: AxiosResponse; body: OptionsAccount; }> OptionsAccount
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listOptionsAccountBook(opts)
List account changing history
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.OptionsApi(client);
const opts = {
'limit': 100, // number | Maximum number of records to be returned in a single list
'offset': 0, // number | List offset, starting from 0
'from': 1547706332, // number | Start timestamp
'to': 1547706332, // number | End timestamp
'type': "dnw" // 'dnw' | 'prem' | 'fee' | 'refr' | 'set' | Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: settlement PNL
};
api.listOptionsAccountBook(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
limit | number | Maximum number of records to be returned in a single list | [optional] [default to 100] |
offset | number | List offset, starting from 0 | [optional] [default to 0] |
from | number | Start timestamp | [optional] [default to undefined] |
to | number | End timestamp | [optional] [default to undefined] |
type | Type | Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: settlement PNL | [optional] [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> OptionsAccountBook
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listOptionsPositions(opts)
List user's positions of specified underlying
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.OptionsApi(client);
const opts = {
'underlying': "BTC_USDT" // string | Underlying
};
api.listOptionsPositions(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
underlying | string | Underlying | [optional] [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> OptionsPosition
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: OptionsPosition; }> getOptionsPosition(contract)
Get specified contract position
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.OptionsApi(client);
const contract = "BTC_USDT-20211130-65000-C"; // string |
api.getOptionsPosition(contract)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
contract | string | [default to undefined] |
Promise<{ response: AxiosResponse; body: OptionsPosition; }> OptionsPosition
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listOptionsPositionClose(underlying, opts)
List user's liquidation history of specified underlying
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.OptionsApi(client);
const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint)
const opts = {
'contract': "BTC_USDT-20210916-5000-C" // string | Options contract name
};
api.listOptionsPositionClose(underlying, opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
underlying | string | Underlying (Obtained by listing underlying endpoint) | [default to undefined] |
contract | string | Options contract name | [optional] [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> OptionsPositionClose
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listOptionsOrders(status, opts)
List options orders
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.OptionsApi(client);
const status = "open"; // 'open' | 'finished' | Only list the orders with this status
const opts = {
'contract': "BTC_USDT-20210916-5000-C", // string | Options contract name
'underlying': "BTC_USDT", // string | Underlying
'limit': 100, // number | Maximum number of records to be returned in a single list
'offset': 0, // number | List offset, starting from 0
'from': 1547706332, // number | Start timestamp
'to': 1547706332 // number | End timestamp
};
api.listOptionsOrders(status, opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
status | Status | Only list the orders with this status | [default to undefined] |
contract | string | Options contract name | [optional] [default to undefined] |
underlying | string | Underlying | [optional] [default to undefined] |
limit | number | Maximum number of records to be returned in a single list | [optional] [default to 100] |
offset | number | List offset, starting from 0 | [optional] [default to 0] |
from | number | Start timestamp | [optional] [default to undefined] |
to | number | End timestamp | [optional] [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> OptionsOrder
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: OptionsOrder; }> createOptionsOrder(optionsOrder)
Create an options order
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.OptionsApi(client);
const optionsOrder = new OptionsOrder(); // OptionsOrder |
api.createOptionsOrder(optionsOrder)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
optionsOrder | OptionsOrder |
Promise<{ response: AxiosResponse; body: OptionsOrder; }> OptionsOrder
- Content-Type: application/json
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> cancelOptionsOrders(opts)
Cancel all `open` orders matched
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.OptionsApi(client);
const opts = {
'contract': "BTC_USDT-20210916-5000-C", // string | Options contract name
'underlying': "BTC_USDT", // string | Underlying
'side': "ask" // 'ask' | 'bid' | All bids or asks. Both included if not specified
};
api.cancelOptionsOrders(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
contract | string | Options contract name | [optional] [default to undefined] |
underlying | string | Underlying | [optional] [default to undefined] |
side | Side | All bids or asks. Both included if not specified | [optional] [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> OptionsOrder
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: OptionsOrder; }> getOptionsOrder(orderId)
Get a single order
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.OptionsApi(client);
const orderId = 12345; // number | Order ID returned on successful order creation
api.getOptionsOrder(orderId)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
orderId | number | Order ID returned on successful order creation | [default to undefined] |
Promise<{ response: AxiosResponse; body: OptionsOrder; }> OptionsOrder
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: OptionsOrder; }> cancelOptionsOrder(orderId)
Cancel a single order
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.OptionsApi(client);
const orderId = 12345; // number | Order ID returned on successful order creation
api.cancelOptionsOrder(orderId)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
orderId | number | Order ID returned on successful order creation | [default to undefined] |
Promise<{ response: AxiosResponse; body: OptionsOrder; }> OptionsOrder
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listMyOptionsTrades(underlying, opts)
List personal trading history
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.OptionsApi(client);
const underlying = "BTC_USDT"; // string | Underlying (Obtained by listing underlying endpoint)
const opts = {
'contract': "BTC_USDT-20210916-5000-C", // string | Options contract name
'limit': 100, // number | Maximum number of records to be returned in a single list
'offset': 0, // number | List offset, starting from 0
'from': 1547706332, // number | Start timestamp
'to': 1547706332 // number | End timestamp
};
api.listMyOptionsTrades(underlying, opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
underlying | string | Underlying (Obtained by listing underlying endpoint) | [default to undefined] |
contract | string | Options contract name | [optional] [default to undefined] |
limit | number | Maximum number of records to be returned in a single list | [optional] [default to 100] |
offset | number | List offset, starting from 0 | [optional] [default to 0] |
from | number | Start timestamp | [optional] [default to undefined] |
to | number | End timestamp | [optional] [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> OptionsMyTrade
- Content-Type: Not defined
- Accept: application/json