1.1.1 • Published 2 years ago

gate-api-test v1.1.1

Weekly downloads
-
License
Apache License 2....
Repository
-
Last release
2 years ago

gate-api

GateApi - JavaScript client for gate-api Welcome to Gate.io API

APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 4.24.0
  • Package version: 5.24.0
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen For more information, please visit https://www.gate.io/page/contacts

Versioning

Trying our best to follow the semantic versioning, while enjoying recent features provided by programming language and libraries, from 4.15.2, one major versioning difference will be introduced:

If extra code rewrite is required when you upgrade the SDK, such as:

  • some outdated programming language version support is dropped
  • API method signature has breaking changes.

the MAJOR version will be incremented, but the MINOR and PATCH version are still following REST API's instead of resetting to 0, so that you can recognize it has some breaking changes, but still getting the idea of from which REST API version the change is introduced.

For example, the previous REST API and SDK version are both 4.14.0. But if we decide to introduce some breaking changes in SDK along with REST API 4.15.2 upgrade, then the version of next SDK release will be 5.15.2(the MAJOR version is incremented to denote breaking changes, but the MINOR and PATCH version are identical to REST API's instead of resetting them to 0)

If MAJOR version is incremented, make sure you read the release note on Releases page

Installation

git

If the library is hosted at a git repository, e.g. https://github.com/gateio/gateapi-js then install it via:

    npm install gateio/gateapi-js --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually use this library):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var GateApi = require('gate-api');

var apiInstance = new GateApi.DeliveryApi();
var settle = "usdt"; // String | Settle currency
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.listDeliveryContracts(settle, callback);

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
DeliveryApilistDeliveryContractsGET /delivery/{settle}/contractsList all futures contracts
DeliveryApigetDeliveryContractGET /delivery/{settle}/contracts/{contract}Get a single contract
DeliveryApilistDeliveryOrderBookGET /delivery/{settle}/order_bookFutures order book
DeliveryApilistDeliveryTradesGET /delivery/{settle}/tradesFutures trading history
DeliveryApilistDeliveryCandlesticksGET /delivery/{settle}/candlesticksGet futures candlesticks
DeliveryApilistDeliveryTickersGET /delivery/{settle}/tickersList futures tickers
DeliveryApilistDeliveryInsuranceLedgerGET /delivery/{settle}/insuranceFutures insurance balance history
FlashSwapApilistFlashSwapCurrenciesGET /flash_swap/currenciesList all supported currencies in flash swap
FuturesApilistFuturesContractsGET /futures/{settle}/contractsList all futures contracts
FuturesApigetFuturesContractGET /futures/{settle}/contracts/{contract}Get a single contract
FuturesApilistFuturesOrderBookGET /futures/{settle}/order_bookFutures order book
FuturesApilistFuturesTradesGET /futures/{settle}/tradesFutures trading history
FuturesApilistFuturesCandlesticksGET /futures/{settle}/candlesticksGet futures candlesticks
FuturesApilistFuturesTickersGET /futures/{settle}/tickersList futures tickers
FuturesApilistFuturesFundingRateHistoryGET /futures/{settle}/funding_rateFunding rate history
FuturesApilistFuturesInsuranceLedgerGET /futures/{settle}/insuranceFutures insurance balance history
FuturesApilistContractStatsGET /futures/{settle}/contract_statsFutures stats
FuturesApigetIndexConstituentsGET /futures/{settle}/index_constituents/{index}Get index constituents
FuturesApilistLiquidatedOrdersGET /futures/{settle}/liq_ordersRetrieve liquidation history
MarginApilistMarginCurrencyPairsGET /margin/currency_pairsList all supported currency pairs supported in margin trading
MarginApigetMarginCurrencyPairGET /margin/currency_pairs/{currency_pair}Query one single margin currency pair
MarginApilistFundingBookGET /margin/funding_bookOrder book of lending loans
MarginApilistCrossMarginCurrenciesGET /margin/cross/currenciesCurrencies supported by cross margin.
MarginApigetCrossMarginCurrencyGET /margin/cross/currencies/{currency}Retrieve detail of one single currency supported by cross margin
OptionsApilistOptionsUnderlyingsGET /options/underlyingsList all underlyings
OptionsApilistOptionsExpirationsGET /options/expirationsList all expiration times
OptionsApilistOptionsContractsGET /options/contractsList all the contracts with specified underlying and expiration time
OptionsApigetOptionsContractGET /options/contracts/{contract}Query specified contract detail
OptionsApilistOptionsSettlementsGET /options/settlementsList settlement history
OptionsApigetOptionsSettlementGET /options/settlements/{contract}Get specified contract's settlement
OptionsApilistOptionsOrderBookGET /options/order_bookFutures order book
OptionsApilistOptionsTickersGET /options/tickersList tickers of options contracts
OptionsApilistOptionsUnderlyingTickersGET /options/underlying/tickers/{underlying}Get underlying ticker
OptionsApilistOptionsCandlesticksGET /options/candlesticksGet futures candlesticks
OptionsApilistOptionsUnderlyingCandlesticksGET /options/underlying/candlesticksMark price candlesticks of an underlying
OptionsApilistOptionsTradesGET /options/tradesOptions trade history
SpotApilistCurrenciesGET /spot/currenciesList all currencies' details
SpotApigetCurrencyGET /spot/currencies/{currency}Get details of a specific currency
SpotApilistCurrencyPairsGET /spot/currency_pairsList all currency pairs supported
SpotApigetCurrencyPairGET /spot/currency_pairs/{currency_pair}Get details of a specifc order
SpotApilistTickersGET /spot/tickersRetrieve ticker information
SpotApilistOrderBookGET /spot/order_bookRetrieve order book
SpotApilistTradesGET /spot/tradesRetrieve market trades
SpotApilistCandlesticksGET /spot/candlesticksMarket candlesticks
WalletApilistCurrencyChainsGET /wallet/currency_chainsList chains supported for specified currency

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.