[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
509 lines (397 loc) · 16.1 KB

EarnApi.md

File metadata and controls

509 lines (397 loc) · 16.1 KB

Io.Gate.GateApi.Api.EarnApi

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

Method HTTP request Description
SwapETH2 POST /earn/staking/eth2/swap ETH2 swap
ListDualInvestmentPlans GET /earn/dual/investment_plan Dual Investment product list
ListDualOrders GET /earn/dual/orders Dual Investment order list
PlaceDualOrder POST /earn/dual/orders Place Dual Investment order
ListStructuredProducts GET /earn/structured/products Structured Product List
ListStructuredOrders GET /earn/structured/orders Structured Product Order List
PlaceStructuredOrder POST /earn/structured/orders Place Structured Product Order

SwapETH2

void SwapETH2 (Eth2Swap eth2Swap)

ETH2 swap

Example

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 SwapETH2Example
    {
        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 EarnApi(config);
            var eth2Swap = new Eth2Swap(); // Eth2Swap | 

            try
            {
                // ETH2 swap
                apiInstance.SwapETH2(eth2Swap);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling EarnApi.SwapETH2: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
eth2Swap Eth2Swap

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 swap success -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListDualInvestmentPlans

List<DualGetPlans> ListDualInvestmentPlans ()

Dual Investment product list

Example

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 ListDualInvestmentPlansExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            var apiInstance = new EarnApi(config);

            try
            {
                // Dual Investment product list
                List<DualGetPlans> result = apiInstance.ListDualInvestmentPlans();
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling EarnApi.ListDualInvestmentPlans: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

List<DualGetPlans>

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListDualOrders

List<DualGetOrders> ListDualOrders ()

Dual Investment order list

Example

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 ListDualOrdersExample
    {
        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 EarnApi(config);

            try
            {
                // Dual Investment order list
                List<DualGetOrders> result = apiInstance.ListDualOrders();
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling EarnApi.ListDualOrders: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

List<DualGetOrders>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PlaceDualOrder

void PlaceDualOrder (PlaceDualInvestmentOrder placeDualInvestmentOrder)

Place Dual Investment order

Example

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 PlaceDualOrderExample
    {
        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 EarnApi(config);
            var placeDualInvestmentOrder = new PlaceDualInvestmentOrder(); // PlaceDualInvestmentOrder | 

            try
            {
                // Place Dual Investment order
                apiInstance.PlaceDualOrder(placeDualInvestmentOrder);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling EarnApi.PlaceDualOrder: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
placeDualInvestmentOrder PlaceDualInvestmentOrder

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListStructuredProducts

List<StructuredGetProjectList> ListStructuredProducts (string status, string type = null, int? page = null, int? limit = null)

Structured Product List

Example

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 ListStructuredProductsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            var apiInstance = new EarnApi(config);
            var status = "in_process";  // string | Status (default: all)  `in_process`-processing  `will_begin`-unstarted  `wait_settlement`-unsettled  `done`-finish
            var type = "BullishSharkFin";  // string | Product Type (default all)  `SharkFin2.0`-SharkFin  `BullishSharkFin`-BullishSharkFin  `BearishSharkFin`-BearishSharkFin `DoubleNoTouch`-DoubleNoTouch `RangeAccrual`-RangeAccrual `SnowBall`-SnowBall (optional) 
            var page = 1;  // int? | Page number (optional)  (default to 1)
            var limit = 100;  // int? | Maximum number of records to be returned in a single list (optional)  (default to 100)

            try
            {
                // Structured Product List
                List<StructuredGetProjectList> result = apiInstance.ListStructuredProducts(status, type, page, limit);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling EarnApi.ListStructuredProducts: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
status string Status (default: all) `in_process`-processing `will_begin`-unstarted `wait_settlement`-unsettled `done`-finish
type string Product Type (default all) `SharkFin2.0`-SharkFin `BullishSharkFin`-BullishSharkFin `BearishSharkFin`-BearishSharkFin `DoubleNoTouch`-DoubleNoTouch `RangeAccrual`-RangeAccrual `SnowBall`-SnowBall [optional]
page int? Page number [optional] [default to 1]
limit int? Maximum number of records to be returned in a single list [optional] [default to 100]

Return type

List<StructuredGetProjectList>

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListStructuredOrders

List<StructuredOrderList> ListStructuredOrders (long? from = null, long? to = null, int? page = null, int? limit = null)

Structured Product Order List

Example

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 ListStructuredOrdersExample
    {
        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 EarnApi(config);
            var from = 1547706332;  // long? | Start timestamp (optional) 
            var to = 1547706332;  // long? | End timestamp (optional) 
            var page = 1;  // int? | Page number (optional)  (default to 1)
            var limit = 100;  // int? | Maximum number of records to be returned in a single list (optional)  (default to 100)

            try
            {
                // Structured Product Order List
                List<StructuredOrderList> result = apiInstance.ListStructuredOrders(from, to, page, limit);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling EarnApi.ListStructuredOrders: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
from long? Start timestamp [optional]
to long? End timestamp [optional]
page int? Page number [optional] [default to 1]
limit int? Maximum number of records to be returned in a single list [optional] [default to 100]

Return type

List<StructuredOrderList>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PlaceStructuredOrder

void PlaceStructuredOrder (StructuredBuy structuredBuy)

Place Structured Product Order

Example

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 PlaceStructuredOrderExample
    {
        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 EarnApi(config);
            var structuredBuy = new StructuredBuy(); // StructuredBuy | 

            try
            {
                // Place Structured Product Order
                apiInstance.PlaceStructuredOrder(structuredBuy);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling EarnApi.PlaceStructuredOrder: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
structuredBuy StructuredBuy

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -

[Back to top] [Back to API list] [Back to Model list] [Back to README]