All URIs are relative to https://api.gateio.ws/api/v4
Method | HTTP request | Description |
---|---|---|
listFlashSwapCurrencies | GET /flash_swap/currencies | List All Supported Currencies In Flash Swap (deprecated) |
listFlashSwapCurrencyPair | GET /flash_swap/currency_pairs | List All Supported Currency Pairs In Flash Swap |
listFlashSwapOrders | GET /flash_swap/orders | List all flash swap orders |
createFlashSwapOrder | POST /flash_swap/orders | Create a flash swap order |
getFlashSwapOrder | GET /flash_swap/orders/{order_id} | Get a single flash swap order's detail |
previewFlashSwapOrder | POST /flash_swap/orders/preview | Initiate a flash swap order preview |
Promise<{ response: http.IncomingMessage; body: Array; }> listFlashSwapCurrencies()
List All Supported Currencies In Flash Swap (deprecated)
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.FlashSwapApi(client);
api.listFlashSwapCurrencies()
.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; }> FlashSwapCurrency
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listFlashSwapCurrencyPair(opts)
List All Supported Currency Pairs In Flash Swap
`BTC_GT` represents selling BTC and buying GT. The limits for each currency may vary across different currency pairs. It is not necessary that two currencies that can be swapped instantaneously can be exchanged with each other. For example, it is possible to sell BTC and buy GT, but it does not necessarily mean that GT can be sold to buy BTC.
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.FlashSwapApi(client);
const opts = {
'currency': "BTC" // string | Retrieve data of the specified currency
};
api.listFlashSwapCurrencyPair(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Retrieve data of the specified currency | [optional] [default to undefined] |
Promise<{ response: AxiosResponse; body: Array; }> FlashSwapCurrencyPair
No authorization required
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: Array; }> listFlashSwapOrders(opts)
List all flash swap 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.FlashSwapApi(client);
const opts = {
'status': 1, // number | Flash swap order status `1` - success `2` - failure
'sellCurrency': "BTC", // string | Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies`
'buyCurrency': "BTC", // string | Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies`
'reverse': true, // boolean | If results are sorted by id in reverse order. Default to `true` - `true`: sort by id in descending order(recent first) - `false`: sort by id in ascending order(oldest first)
'limit': 100, // number | Maximum number of records to be returned in a single list
'page': 1 // number | Page number
};
api.listFlashSwapOrders(opts)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
status | number | Flash swap order status `1` - success `2` - failure | [optional] [default to undefined] |
sellCurrency | string | Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` | [optional] [default to undefined] |
buyCurrency | string | Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` | [optional] [default to undefined] |
reverse | boolean | If results are sorted by id in reverse order. Default to `true` - `true`: sort by id in descending order(recent first) - `false`: sort by id in ascending order(oldest first) | [optional] [default to undefined] |
limit | number | Maximum number of records to be returned in a single list | [optional] [default to 100] |
page | number | Page number | [optional] [default to 1] |
Promise<{ response: AxiosResponse; body: Array; }> FlashSwapOrder
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: FlashSwapOrder; }> createFlashSwapOrder(flashSwapOrderRequest)
Create a flash swap order
Initiate a flash swap preview in advance because order creation requires a preview result
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.FlashSwapApi(client);
const flashSwapOrderRequest = new FlashSwapOrderRequest(); // FlashSwapOrderRequest |
api.createFlashSwapOrder(flashSwapOrderRequest)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
flashSwapOrderRequest | FlashSwapOrderRequest |
Promise<{ response: AxiosResponse; body: FlashSwapOrder; }> FlashSwapOrder
- Content-Type: application/json
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: FlashSwapOrder; }> getFlashSwapOrder(orderId)
Get a single flash swap order's 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"
// Configure Gate APIv4 key authentication:
client.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
const api = new GateApi.FlashSwapApi(client);
const orderId = 1; // number | Flash swap order ID
api.getFlashSwapOrder(orderId)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
orderId | number | Flash swap order ID | [default to undefined] |
Promise<{ response: AxiosResponse; body: FlashSwapOrder; }> FlashSwapOrder
- Content-Type: Not defined
- Accept: application/json
Promise<{ response: http.IncomingMessage; body: FlashSwapOrderPreview; }> previewFlashSwapOrder(flashSwapPreviewRequest)
Initiate a flash swap order preview
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.FlashSwapApi(client);
const flashSwapPreviewRequest = new FlashSwapPreviewRequest(); // FlashSwapPreviewRequest |
api.previewFlashSwapOrder(flashSwapPreviewRequest)
.then(value => console.log('API called successfully. Returned data: ', value.body),
error => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
flashSwapPreviewRequest | FlashSwapPreviewRequest |
Promise<{ response: AxiosResponse; body: FlashSwapOrderPreview; }> FlashSwapOrderPreview
- Content-Type: application/json
- Accept: application/json