All URIs are relative to https://api.gateio.ws/api/v4
Method | HTTP request | Description |
---|---|---|
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 |
List<FlashSwapCurrencyPair> ListFlashSwapCurrencyPair (string currency = null, int? page = null, int? limit = null)
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.
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class ListFlashSwapCurrencyPairExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
var apiInstance = new FlashSwapApi(config);
var currency = "BTC"; // string | Retrieve data of the specified currency (optional)
var page = 1; // int? | Page number (optional) (default to 1)
var limit = 1000; // int? | Maximum response items. Default: 100, minimum: 1, Maximum: 1000 (optional) (default to 1000)
try
{
// List All Supported Currency Pairs In Flash Swap
List<FlashSwapCurrencyPair> result = apiInstance.ListFlashSwapCurrencyPair(currency, page, limit);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling FlashSwapApi.ListFlashSwapCurrencyPair: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Retrieve data of the specified currency | [optional] |
page | int? | Page number | [optional] [default to 1] |
limit | int? | Maximum response items. Default: 100, minimum: 1, Maximum: 1000 | [optional] [default to 1000] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<FlashSwapOrder> ListFlashSwapOrders (int? status = null, string sellCurrency = null, string buyCurrency = null, bool? reverse = null, int? limit = null, int? page = null)
List all flash swap orders
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class ListFlashSwapOrdersExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new FlashSwapApi(config);
var status = 1; // int? | Flash swap order status `1` - success `2` - failure (optional)
var sellCurrency = "BTC"; // string | Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` (optional)
var buyCurrency = "BTC"; // string | Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` (optional)
var reverse = true; // bool? | 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)
var limit = 100; // int? | Maximum number of records to be returned in a single list (optional) (default to 100)
var page = 1; // int? | Page number (optional) (default to 1)
try
{
// List all flash swap orders
List<FlashSwapOrder> result = apiInstance.ListFlashSwapOrders(status, sellCurrency, buyCurrency, reverse, limit, page);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling FlashSwapApi.ListFlashSwapOrders: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
status | int? | Flash swap order status `1` - success `2` - failure | [optional] |
sellCurrency | string | Currency to sell which can be retrieved from supported currency list API `GET /flash_swap/currencies` | [optional] |
buyCurrency | string | Currency to buy which can be retrieved from supported currency list API `GET /flash_swap/currencies` | [optional] |
reverse | bool? | 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] |
limit | int? | Maximum number of records to be returned in a single list | [optional] [default to 100] |
page | int? | Page number | [optional] [default to 1] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FlashSwapOrder CreateFlashSwapOrder (FlashSwapOrderRequest flashSwapOrderRequest)
Create a flash swap order
Initiate a flash swap preview in advance because order creation requires a preview result
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class CreateFlashSwapOrderExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new FlashSwapApi(config);
var flashSwapOrderRequest = new FlashSwapOrderRequest(); // FlashSwapOrderRequest |
try
{
// Create a flash swap order
FlashSwapOrder result = apiInstance.CreateFlashSwapOrder(flashSwapOrderRequest);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling FlashSwapApi.CreateFlashSwapOrder: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
flashSwapOrderRequest | FlashSwapOrderRequest |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | The flash swap order is created successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FlashSwapOrder GetFlashSwapOrder (int orderId)
Get a single flash swap order's detail
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class GetFlashSwapOrderExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new FlashSwapApi(config);
var orderId = 1; // int | Flash swap order ID
try
{
// Get a single flash swap order's detail
FlashSwapOrder result = apiInstance.GetFlashSwapOrder(orderId);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling FlashSwapApi.GetFlashSwapOrder: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
orderId | int | Flash swap order ID |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FlashSwapOrderPreview PreviewFlashSwapOrder (FlashSwapPreviewRequest flashSwapPreviewRequest)
Initiate a flash swap order preview
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class PreviewFlashSwapOrderExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new FlashSwapApi(config);
var flashSwapPreviewRequest = new FlashSwapPreviewRequest(); // FlashSwapPreviewRequest |
try
{
// Initiate a flash swap order preview
FlashSwapOrderPreview result = apiInstance.PreviewFlashSwapOrder(flashSwapPreviewRequest);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling FlashSwapApi.PreviewFlashSwapOrder: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
flashSwapPreviewRequest | FlashSwapPreviewRequest |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | The flash swap order successfully previewed | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]