Categorygithub.com/frozenpine/ngerest
repositorypackage
0.0.0-20191106053539-ba2100fcec34
Repository: https://github.com/frozenpine/ngerest.git
Documentation: pkg.go.dev

# README

Go API client for swagger

REST API for the BitMEX Trading Platform View Changelog #### Getting Started Base URI: https://www.bitmex.com/api/v1 ##### Fetching Data All REST endpoints are documented below. You can try out any query right from this interface. Most table queries accept count, start, and reverse params. Set reverse=true to get rows newest-first. Additional documentation regarding filters, timestamps, and authentication is available in the main API documentation. All table data is available via the Websocket. We highly recommend using the socket if you want to have the quickest possible data without being subject to ratelimits. ##### Return Types By default, all data is returned as JSON. Send ?_format=csv to get CSV data or ?_format=xml to get XML data. ##### Trade Data Queries This is only a small subset of what is available, to get you started. Fill in the parameters and click the Try it out! button to try any of these queries. * Pricing Data * Trade Data * OrderBook Data * Settlement Data * Exchange Statistics Every function of the BitMEX.com platform is exposed here and documented. Many more functions are available. ##### Swagger Specification ⇩ Download Swagger JSON ## All API Endpoints Click to expand a section.

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

  • API version: 1.2.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.GoClientCodegen

Installation

Put the package under your project folder and add the following in import:

import "./swagger"

Documentation for API Endpoints

All URIs are relative to https://localhost/api/v1

ClassMethodHTTP requestDescription
APIKeyApiAPIKeyDisablePost /apiKey/disableDisable an API Key.
APIKeyApiAPIKeyEnablePost /apiKey/enableEnable an API Key.
APIKeyApiAPIKeyGetGet /apiKeyGet your API Keys.
APIKeyApiAPIKeyNewPost /apiKeyCreate a new API Key.
APIKeyApiAPIKeyRemoveDelete /apiKeyRemove an API Key.
AnnouncementApiAnnouncementGetGet /announcementGet site announcements.
AnnouncementApiAnnouncementGetUrgentGet /announcement/urgentGet urgent (banner) announcements.
ChatApiChatGetGet /chatGet chat messages.
ChatApiChatGetChannelsGet /chat/channelsGet available channels.
ChatApiChatGetConnectedGet /chat/connectedGet connected users.
ChatApiChatNewPost /chatSend a chat message.
ExecutionApiExecutionGetGet /executionGet all raw executions for your account.
ExecutionApiExecutionGetTradeHistoryGet /execution/tradeHistoryGet all balance-affecting executions. This includes each trade, insurance charge, and settlement.
FundingApiFundingGetGet /fundingGet funding history.
InstrumentApiInstrumentGetGet /instrumentGet instruments.
InstrumentApiInstrumentGetActiveGet /instrument/activeGet all active instruments and instruments that have expired in <24hrs.
InstrumentApiInstrumentGetActiveAndIndicesGet /instrument/activeAndIndicesHelper method. Gets all active instruments and all indices. This is a join of the result of /indices and /active.
InstrumentApiInstrumentGetActiveIntervalsGet /instrument/activeIntervalsReturn all active contract series and interval pairs.
InstrumentApiInstrumentGetCompositeIndexGet /instrument/compositeIndexShow constituent parts of an index.
InstrumentApiInstrumentGetIndicesGet /instrument/indicesGet all price indices.
InsuranceApiInsuranceGetGet /insuranceGet insurance fund history.
LeaderboardApiLeaderboardGetGet /leaderboardGet current leaderboard.
LeaderboardApiLeaderboardGetNameGet /leaderboard/nameGet your alias on the leaderboard.
LiquidationApiLiquidationGetGet /liquidationGet liquidation orders.
NotificationApiNotificationGetGet /notificationGet your current notifications.
OrderApiOrderAmendPut /orderAmend the quantity or price of an open order.
OrderApiOrderAmendBulkPut /order/bulkAmend multiple orders for the same symbol.
OrderApiOrderCancelDelete /orderCancel order(s). Send multiple order IDs to cancel in bulk.
OrderApiOrderCancelAllDelete /order/allCancels all of your orders.
OrderApiOrderCancelAllAfterPost /order/cancelAllAfterAutomatically cancel all your orders after a specified timeout.
OrderApiOrderClosePositionPost /order/closePositionClose a position. [Deprecated, use POST /order with execInst: 'Close']
OrderApiOrderGetOrdersGet /orderGet your orders.
OrderApiOrderNewPost /orderCreate a new order.
OrderApiOrderNewBulkPost /order/bulkCreate multiple new orders for the same symbol.
OrderBookApiOrderBookGetL2Get /orderBook/L2Get current orderbook in vertical format.
PositionApiPositionGetGet /positionGet your positions.
PositionApiPositionIsolateMarginPost /position/isolateEnable isolated margin or cross margin per-position.
PositionApiPositionTransferIsolatedMarginPost /position/transferMarginTransfer equity in or out of a position.
PositionApiPositionUpdateLeveragePost /position/leverageChoose leverage for a position.
PositionApiPositionUpdateRiskLimitPost /position/riskLimitUpdate your risk limit.
QuoteApiQuoteGetGet /quoteGet Quotes.
QuoteApiQuoteGetBucketedGet /quote/bucketedGet previous quotes in time buckets.
SchemaApiSchemaGetGet /schemaGet model schemata for data objects returned by this API.
SchemaApiSchemaWebsocketHelpGet /schema/websocketHelpReturns help text & subject list for websocket usage.
SettlementApiSettlementGetGet /settlementGet settlement history.
StatsApiStatsGetGet /statsGet exchange-wide and per-series turnover and volume statistics.
StatsApiStatsHistoryGet /stats/historyGet historical exchange-wide and per-series turnover and volume statistics.
StatsApiStatsHistoryUSDGet /stats/historyUSDGet a summary of exchange statistics in USD.
TradeApiTradeGetGet /tradeGet Trades.
TradeApiTradeGetBucketedGet /trade/bucketedGet previous trades in time buckets.
UserApiUserCancelWithdrawalPost /user/cancelWithdrawalCancel a withdrawal.
UserApiUserCheckReferralCodeGet /user/checkReferralCodeCheck if a referral code is valid.
UserApiUserConfirmPost /user/confirmEmailConfirm your email address with a token.
UserApiUserConfirmEnableTFAPost /user/confirmEnableTFAConfirm two-factor auth for this account. If using a Yubikey, simply send a token to this endpoint.
UserApiUserConfirmWithdrawalPost /user/confirmWithdrawalConfirm a withdrawal.
UserApiUserDisableTFAPost /user/disableTFADisable two-factor auth for this account.
UserApiUserGetGet /userGet your user model.
UserApiUserGetAffiliateStatusGet /user/affiliateStatusGet your current affiliate/referral status.
UserApiUserGetCommissionGet /user/commissionGet your account's commission status.
UserApiUserGetDepositAddressGet /user/depositAddressGet a deposit address.
UserApiUserGetMarginGet /user/marginGet your account's margin status. Send a currency of &quot;all&quot; to receive an array of all supported currencies.
UserApiUserGetWalletGet /user/walletGet your current wallet information.
UserApiUserGetWalletHistoryGet /user/walletHistoryGet a history of all of your wallet transactions (deposits, withdrawals, PNL).
UserApiUserGetWalletSummaryGet /user/walletSummaryGet a summary of all of your wallet transactions (deposits, withdrawals, PNL).
UserApiUserLogoutPost /user/logoutLog out of BitMEX.
UserApiUserLogoutAllPost /user/logoutAllLog all systems out of BitMEX. This will revoke all of your account's access tokens, logging you out on all devices.
UserApiUserMinWithdrawalFeeGet /user/minWithdrawalFeeGet the minimum withdrawal fee for a currency.
UserApiUserRequestEnableTFAPost /user/requestEnableTFAGet secret key for setting up two-factor auth.
UserApiUserRequestWithdrawalPost /user/requestWithdrawalRequest a withdrawal to an external wallet.
UserApiUserSavePreferencesPost /user/preferencesSave user preferences.
UserApiUserUpdatePut /userUpdate your password, name, and other attributes.

Documentation For Models

Documentation For Authorization

apiKey

  • Type: API key

Example

auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
	Key: "APIKEY",
	Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)

apiNonce

  • Type: API key

Example

auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
	Key: "APIKEY",
	Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)

apiSignature

  • Type: API key

Example

auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
	Key: "APIKEY",
	Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)

Author

[email protected]