package
0.0.0-20240529012907-9f8f5e699732
Repository: https://github.com/bitmex/api-connectors.git
Documentation: pkg.go.dev

# README

Go API client for swagger

REST API for the BitMEX Trading Platform If you are building automated tools, please subscribe to the BitMEX API RSS Feed for changes. The feed will be updated regularly and is the most reliable way to get downtime and update announcements. 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://www.bitmex.com/api/v1

ClassMethodHTTP requestDescription
APIKeyApiAPIKeyGetGet /apiKeyGet your API Keys.
AddressApiAddressGetGet /addressGet your addresses.
AddressApiAddressNewPost /addressCreates a new saved address.
AnnouncementApiAnnouncementGetGet /announcementGet site announcements.
AnnouncementApiAnnouncementGetUrgentGet /announcement/urgentGet urgent (banner) announcements.
ChatApiChatGetGet /chatGet chat messages.
ChatApiChatGetChannelsGet /chat/channelsGet available channels.
ChatApiChatGetConnectedGet /chat/connectedGet connected users.
ChatApiChatGetPinnedMessageGet /chat/pinnedGet pinned message for a channel.
ChatApiChatNewPost /chatSend a chat message.
ExecutionApiExecutionGetGet /executionGet all raw executions for your account.
ExecutionApiExecutionGetTradeHistoryGet /execution/tradeHistoryGet all balance-affecting executions.
FundingApiFundingGetGet /fundingGet funding history.
GlobalNotificationApiGlobalNotificationGetGet /globalNotificationGet your current GlobalNotifications.
GuildApiGuildArchivePost /guild/archiveArchive a guild
GuildApiGuildEditPut /guildEdit guild new guild
GuildApiGuildGetGet /guildGet all guilds
GuildApiGuildJoinPost /guild/joinRequest to Join a private guild or join a public guild
GuildApiGuildKickPost /guild/kickKick member from guild
GuildApiGuildLeavePost /guild/leaveLeave guild or cancel guild join request
GuildApiGuildNewPost /guildCreates a new guild
GuildApiGuildShareTradesPost /guild/shareTradesToggle share trades for your account, which controls whether your guild members can see your orders and positions in their UI
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.
InstrumentApiInstrumentGetUsdVolumeGet /instrument/usdVolumeGet a summary of exchange statistics in USD.
InsuranceApiInsuranceGetGet /insuranceGet insurance fund history.
LeaderboardApiLeaderboardGetGet /leaderboardGet current leaderboard.
LeaderboardApiLeaderboardGetNameGet /leaderboard/nameGet your alias on the leaderboard.
LiquidationApiLiquidationGetGet /liquidationGet liquidation orders.
OrderApiOrderAmendPut /orderAmend the quantity or price of an open order.
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.
OrderBookApiOrderBookGetL2Get /orderBook/L2Get current orderbook in vertical format.
PorlApiPorlGetNonceGet /porl/nonceGet your Proof of Reserves nonce and data.
PorlApiPorlGetSnapshotsGet /porl/snapshotsGet Proof of Reserves historical snapshots
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.
UserApiUserCancelPendingWithdrawalDelete /user/withdrawalCancel pending withdrawal
UserApiUserCancelWithdrawalPost /user/cancelWithdrawalCancel a withdrawal.
UserApiUserCheckReferralCodeGet /user/checkReferralCodeCheck if a referral code is valid.
UserApiUserCommunicationTokenPost /user/communicationTokenRegister your communication token for mobile clients
UserApiUserConfirmPost /user/confirmEmailConfirm your email address with a token.
UserApiUserConfirmWithdrawalPost /user/confirmWithdrawalConfirm a withdrawal.
UserApiUserCreateSubAccountPost /user/addSubaccountCreates a new sub-account.
UserApiUserCreateUnstakingRequestsPost /user/unstakingRequestsCreate unstaking request
UserApiUserDeleteUnstakingRequestsDelete /user/unstakingRequestsCancel unstaking request
UserApiUserGetGet /userGet your user model.
UserApiUserGetAffiliateStatusGet /user/affiliateStatusGet your current affiliate/referral status.
UserApiUserGetCSAGet /user/csaGet your account's CSA status.
UserApiUserGetCommissionGet /user/commissionGet your account's commission status.
UserApiUserGetDepositAddressGet /user/depositAddressGet a deposit address.
UserApiUserGetDepositAddressInformationGet /user/depositAddressInformationGet a deposit address.
UserApiUserGetExecutionHistoryGet /user/executionHistoryGet the execution history by day.
UserApiUserGetMarginGet /user/marginGet your account's margin status. Send a currency of &quot;all&quot; to receive an array of all supported currencies.
UserApiUserGetQuoteFillRatioGet /user/quoteFillRatioGet 7 days worth of Quote Fill Ratio statistics.
UserApiUserGetQuoteValueRatioGet /user/quoteValueRatioGet Quote Value Ratio statistics over the last 3 days
UserApiUserGetStakingGet /user/stakingGet the current user staking amount.
UserApiUserGetStakingInstrumentsGet /user/staking/instrumentsList staking instruments
UserApiUserGetStakingTiersGet /user/staking/tiersList staking tiers for a given currency
UserApiUserGetTradingVolumeGet /user/tradingVolumeGet your 30 days USD average trading volume
UserApiUserGetUnstakingRequestsGet /user/unstakingRequestsGet the current user unstaking requests
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).
UserApiUserGetWalletTransferAccountsGet /user/getWalletTransferAccountsGet the list of accounts you can transfer funds between.
UserApiUserLogoutPost /user/logoutLog out of BitMEX.
UserApiUserRequestWithdrawalPost /user/requestWithdrawalRequest a withdrawal to an external wallet.
UserApiUserSavePreferencesPost /user/preferencesSave user preferences.
UserApiUserUpdateSubAccountPost /user/updateSubaccountUpdates the sub-account name.
UserApiUserWalletTransferPost /user/walletTransferExecute a transfer to a paired account.
UserAffiliatesApiUserAffiliatesGetGet /userAffiliatesGet user's affiliates to a given depth
UserEventApiUserEventGetGet /userEventGet your user events
WalletApiWalletGetAssetsConfigGet /wallet/assetsGet Assets Config
WalletApiWalletGetNetworksConfigGet /wallet/networksGet Networks Config

Documentation For Models

Documentation For Authorization

apiExpires

  • 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)

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)

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]

# Functions

CacheExpires helper function to determine remaining time before repeating a request.
NewAPIClient creates a new API client.
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKey takes an APIKey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Public Announcements.
No description provided by the author
APIClient manages communication with the BitMEX API API v1.2.0 In most cases there should be only one, shared, APIClient.
Persistent API Keys for Developers.
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
Trollbox Data.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
User communication SNS token.
No description provided by the author
No description provided by the author
Deposit Address.
No description provided by the author
Raw Order and Balance Data.
No description provided by the author
No description provided by the author
Swap Funding History.
No description provided by the author
GenericSwaggerError Provides access to the body, error and model on returned errors.
Account Notifications.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Tradeable Contracts, Indices, and History.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Insurance Fund Data.
No description provided by the author
Information on Top Users.
No description provided by the author
Active Liquidations.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Placement, Cancellation, Amending, and History.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Pinned Messages.
Proof of Reserves/Liabilities.
Summary of Open and Closed Positions.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Best Bid/Offer Snapshots & Historical Bins.
No description provided by the author
No description provided by the author
Daily Quote Fill Ratio Statistic.
Hourly Quote Value Ratio Statistic.
No description provided by the author
Historical Settlement Data.
No description provided by the author
Get the current user staking amount in vertical format.
Exchange Statistics.
No description provided by the author
No description provided by the author
No description provided by the author
Individual & Bucketed Trades.
No description provided by the author
No description provided by the author
No description provided by the author
30 days USD average trading volume.
No description provided by the author
Account Operations.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
User Events for Auditing.
No description provided by the author
No description provided by the author
Assets and Networks Data.
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author