[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
347 lines (226 loc) · 9.54 KB

EarnApi.md

File metadata and controls

347 lines (226 loc) · 9.54 KB

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
cancelDualOrder DELETE /earn/dual/orders/{order_id} Cancel 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

Promise<{ response: http.IncomingMessage; body?: any; }> swapETH2(eth2Swap)

ETH2 swap

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.EarnApi(client);
const eth2Swap = new Eth2Swap(); // Eth2Swap | 
api.swapETH2(eth2Swap)
   .then(value => console.log('API called successfully.'),
         error => console.error(error));

Parameters

Name Type Description Notes
eth2Swap Eth2Swap

Return type

Promise<{ response: AxiosResponse; body?: any; }>

Authorization

apiv4

HTTP request headers

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

listDualInvestmentPlans

Promise<{ response: http.IncomingMessage; body: Array; }> listDualInvestmentPlans()

Dual Investment product list

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"

const api = new GateApi.EarnApi(client);
api.listDualInvestmentPlans()
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

This endpoint does not need any parameter.

Return type

Promise<{ response: AxiosResponse; body: Array; }> DualGetPlans

Authorization

No authorization required

HTTP request headers

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

listDualOrders

Promise<{ response: http.IncomingMessage; body: Array; }> listDualOrders()

Dual Investment order list

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.EarnApi(client);
api.listDualOrders()
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

This endpoint does not need any parameter.

Return type

Promise<{ response: AxiosResponse; body: Array; }> DualGetOrders

Authorization

apiv4

HTTP request headers

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

placeDualOrder

Promise<{ response: http.IncomingMessage; body?: any; }> placeDualOrder(placeDualInvestmentOrder)

Place Dual Investment order

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.EarnApi(client);
const placeDualInvestmentOrder = new PlaceDualInvestmentOrder(); // PlaceDualInvestmentOrder | 
api.placeDualOrder(placeDualInvestmentOrder)
   .then(value => console.log('API called successfully.'),
         error => console.error(error));

Parameters

Name Type Description Notes
placeDualInvestmentOrder PlaceDualInvestmentOrder

Return type

Promise<{ response: AxiosResponse; body?: any; }>

Authorization

apiv4

HTTP request headers

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

cancelDualOrder

Promise<{ response: http.IncomingMessage; body?: any; }> cancelDualOrder(orderId)

Cancel Dual Investment order

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.EarnApi(client);
const orderId = 1; // number | Order ID
api.cancelDualOrder(orderId)
   .then(value => console.log('API called successfully.'),
         error => console.error(error));

Parameters

Name Type Description Notes
orderId number Order ID [default to undefined]

Return type

Promise<{ response: AxiosResponse; body?: any; }>

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

listStructuredProducts

Promise<{ response: http.IncomingMessage; body: Array; }> listStructuredProducts(structuredGetProjectListRequest)

Structured Product List

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"

const api = new GateApi.EarnApi(client);
const structuredGetProjectListRequest = new StructuredGetProjectListRequest(); // StructuredGetProjectListRequest | 
api.listStructuredProducts(structuredGetProjectListRequest)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
structuredGetProjectListRequest StructuredGetProjectListRequest

Return type

Promise<{ response: AxiosResponse; body: Array; }> StructuredGetProjectList

Authorization

No authorization required

HTTP request headers

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

listStructuredOrders

Promise<{ response: http.IncomingMessage; body: Array; }> listStructuredOrders(structuredOrderListRequest)

Structured Product Order List

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.EarnApi(client);
const structuredOrderListRequest = new StructuredOrderListRequest(); // StructuredOrderListRequest | 
api.listStructuredOrders(structuredOrderListRequest)
   .then(value => console.log('API called successfully. Returned data: ', value.body),
         error => console.error(error));

Parameters

Name Type Description Notes
structuredOrderListRequest StructuredOrderListRequest

Return type

Promise<{ response: AxiosResponse; body: Array; }> StructuredOrderList

Authorization

apiv4

HTTP request headers

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

placeStructuredOrder

Promise<{ response: http.IncomingMessage; body?: any; }> placeStructuredOrder(structuredBuy)

Place Structured Product Order

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.EarnApi(client);
const structuredBuy = new StructuredBuy(); // StructuredBuy | 
api.placeStructuredOrder(structuredBuy)
   .then(value => console.log('API called successfully.'),
         error => console.error(error));

Parameters

Name Type Description Notes
structuredBuy StructuredBuy

Return type

Promise<{ response: AxiosResponse; body?: any; }>

Authorization

apiv4

HTTP request headers

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