Documentation ¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- func NewAPIKeyContext(key, secret string) context.Context
- type APIClient
- type APIKey
- type APIKeyApiService
- func (a *APIKeyApiService) APIKeyDisable(ctx context.Context, apiKeyID string) (ApiKey, *http.Response, error)
- func (a *APIKeyApiService) APIKeyEnable(ctx context.Context, apiKeyID string) (ApiKey, *http.Response, error)
- func (a *APIKeyApiService) APIKeyGet(ctx context.Context, localVarOptionals *APIKeyGetOpts) ([]ApiKey, *http.Response, error)
- func (a *APIKeyApiService) APIKeyNew(ctx context.Context, localVarOptionals *APIKeyNewOpts) (ApiKey, *http.Response, error)
- func (a *APIKeyApiService) APIKeyRemove(ctx context.Context, apiKeyID string) (InlineResponse200, *http.Response, error)
- type APIKeyGetOpts
- type APIKeyNewOpts
- type APIResponse
- type AccessToken
- type Affiliate
- type Announcement
- type AnnouncementApiService
- type AnnouncementGetOpts
- type ApiKey
- type Chat
- type ChatApiService
- func (a *ChatApiService) ChatGet(ctx context.Context, localVarOptionals *ChatGetOpts) ([]Chat, *http.Response, error)
- func (a *ChatApiService) ChatGetChannels(ctx context.Context) ([]ChatChannel, *http.Response, error)
- func (a *ChatApiService) ChatGetConnected(ctx context.Context) (ConnectedUsers, *http.Response, error)
- func (a *ChatApiService) ChatNew(ctx context.Context, message string, localVarOptionals *ChatNewOpts) (Chat, *http.Response, error)
- type ChatChannel
- type ChatGetOpts
- type ChatNewOpts
- type Configuration
- type ConnectedUsers
- type ErrorError
- type Execution
- type ExecutionApiService
- type ExecutionGetOpts
- type ExecutionGetTradeHistoryOpts
- type Funding
- type FundingApiService
- type FundingGetOpts
- type GenericSwaggerError
- type IndexComposite
- type InlineResponse200
- type InlineResponse2001
- type Instrument
- type InstrumentApiService
- func (a *InstrumentApiService) InstrumentGet(ctx context.Context, localVarOptionals *InstrumentGetOpts) ([]Instrument, *http.Response, error)
- func (a *InstrumentApiService) InstrumentGetActive(ctx context.Context) ([]Instrument, *http.Response, error)
- func (a *InstrumentApiService) InstrumentGetActiveAndIndices(ctx context.Context) ([]Instrument, *http.Response, error)
- func (a *InstrumentApiService) InstrumentGetActiveIntervals(ctx context.Context) (InstrumentInterval, *http.Response, error)
- func (a *InstrumentApiService) InstrumentGetCompositeIndex(ctx context.Context, localVarOptionals *InstrumentGetCompositeIndexOpts) ([]IndexComposite, *http.Response, error)
- func (a *InstrumentApiService) InstrumentGetIndices(ctx context.Context) ([]Instrument, *http.Response, error)
- type InstrumentGetCompositeIndexOpts
- type InstrumentGetOpts
- type InstrumentInterval
- type Insurance
- type InsuranceApiService
- type InsuranceGetOpts
- type Leaderboard
- type LeaderboardApiService
- type LeaderboardGetOpts
- type Liquidation
- type LiquidationApiService
- type LiquidationGetOpts
- type Margin
- type ModelError
- type Notification
- type NotificationApiService
- type Order
- type OrderAmendBulkOpts
- type OrderAmendOpts
- type OrderApiService
- func (a *OrderApiService) OrderAmend(ctx context.Context, localVarOptionals *OrderAmendOpts) (Order, *http.Response, error)
- func (a *OrderApiService) OrderAmendBulk(ctx context.Context, localVarOptionals *OrderAmendBulkOpts) ([]Order, *http.Response, error)
- func (a *OrderApiService) OrderCancel(ctx context.Context, localVarOptionals *OrderCancelOpts) ([]Order, *http.Response, error)
- func (a *OrderApiService) OrderCancelAll(ctx context.Context, localVarOptionals *OrderCancelAllOpts) ([]Order, *http.Response, error)
- func (a *OrderApiService) OrderCancelAllAfter(ctx context.Context, timeout float64) (interface{}, *http.Response, error)
- func (a *OrderApiService) OrderClosePosition(ctx context.Context, symbol string, localVarOptionals *OrderClosePositionOpts) (Order, *http.Response, error)
- func (a *OrderApiService) OrderGetOrders(ctx context.Context, localVarOptionals *OrderGetOrdersOpts) ([]Order, *http.Response, error)
- func (a *OrderApiService) OrderNew(ctx context.Context, symbol string, localVarOptionals *OrderNewOpts) (Order, *http.Response, error)
- func (a *OrderApiService) OrderNewBulk(ctx context.Context, localVarOptionals *OrderNewBulkOpts) ([]Order, *http.Response, error)
- type OrderBookApiService
- type OrderBookGetL2Opts
- type OrderBookL2
- type OrderCancelAllOpts
- type OrderCancelOpts
- type OrderClosePositionOpts
- type OrderGetOrdersOpts
- type OrderNewBulkOpts
- type OrderNewOpts
- type Position
- type PositionApiService
- func (a *PositionApiService) PositionGet(ctx context.Context, localVarOptionals *PositionGetOpts) ([]Position, *http.Response, error)
- func (a *PositionApiService) PositionIsolateMargin(ctx context.Context, symbol string, ...) (Position, *http.Response, error)
- func (a *PositionApiService) PositionTransferIsolatedMargin(ctx context.Context, symbol string, amount int) (Position, *http.Response, error)
- func (a *PositionApiService) PositionUpdateLeverage(ctx context.Context, symbol string, leverage float64) (Position, *http.Response, error)
- func (a *PositionApiService) PositionUpdateRiskLimit(ctx context.Context, symbol string, riskLimit int) (Position, *http.Response, error)
- type PositionGetOpts
- type PositionIsolateMarginOpts
- type Quote
- type QuoteApiService
- type QuoteGetBucketedOpts
- type QuoteGetOpts
- type SchemaApiService
- type SchemaGetOpts
- type Settlement
- type SettlementApiService
- type SettlementGetOpts
- type Stats
- type StatsApiService
- type StatsHistory
- type StatsUsd
- type Trade
- type TradeApiService
- type TradeBin
- type TradeGetBucketedOpts
- type TradeGetOpts
- type Transaction
- type User
- type UserApiService
- func (a *UserApiService) UserCancelWithdrawal(ctx context.Context, token string) (Transaction, *http.Response, error)
- func (a *UserApiService) UserCheckReferralCode(ctx context.Context, localVarOptionals *UserCheckReferralCodeOpts) (float64, *http.Response, error)
- func (a *UserApiService) UserConfirm(ctx context.Context, token string) (AccessToken, *http.Response, error)
- func (a *UserApiService) UserConfirmEnableTFA(ctx context.Context, token string, localVarOptionals *UserConfirmEnableTFAOpts) (bool, *http.Response, error)
- func (a *UserApiService) UserConfirmWithdrawal(ctx context.Context, token string) (Transaction, *http.Response, error)
- func (a *UserApiService) UserDisableTFA(ctx context.Context, token string, localVarOptionals *UserDisableTFAOpts) (bool, *http.Response, error)
- func (a *UserApiService) UserGet(ctx context.Context) (User, *http.Response, error)
- func (a *UserApiService) UserGetAffiliateStatus(ctx context.Context) (Affiliate, *http.Response, error)
- func (a *UserApiService) UserGetCommission(ctx context.Context) ([]UserCommission, *http.Response, error)
- func (a *UserApiService) UserGetDepositAddress(ctx context.Context, localVarOptionals *UserGetDepositAddressOpts) (string, *http.Response, error)
- func (a *UserApiService) UserGetMargin(ctx context.Context, localVarOptionals *UserGetMarginOpts) (Margin, *http.Response, error)
- func (a *UserApiService) UserGetWallet(ctx context.Context, localVarOptionals *UserGetWalletOpts) (Wallet, *http.Response, error)
- func (a *UserApiService) UserGetWalletHistory(ctx context.Context, localVarOptionals *UserGetWalletHistoryOpts) ([]Transaction, *http.Response, error)
- func (a *UserApiService) UserGetWalletSummary(ctx context.Context, localVarOptionals *UserGetWalletSummaryOpts) ([]Transaction, *http.Response, error)
- func (a *UserApiService) UserLogout(ctx context.Context) (*http.Response, error)
- func (a *UserApiService) UserLogoutAll(ctx context.Context) (float64, *http.Response, error)
- func (a *UserApiService) UserMinWithdrawalFee(ctx context.Context, localVarOptionals *UserMinWithdrawalFeeOpts) (UserWithdrawalFees, *http.Response, error)
- func (a *UserApiService) UserRequestEnableTFA(ctx context.Context, localVarOptionals *UserRequestEnableTFAOpts) (bool, *http.Response, error)
- func (a *UserApiService) UserRequestWithdrawal(ctx context.Context, currency string, amount int, address string, ...) (Transaction, *http.Response, error)
- func (a *UserApiService) UserSavePreferences(ctx context.Context, prefs string, localVarOptionals *UserSavePreferencesOpts) (User, *http.Response, error)
- func (a *UserApiService) UserUpdate(ctx context.Context, localVarOptionals *UserUpdateOpts) (User, *http.Response, error)
- type UserCheckReferralCodeOpts
- type UserCommission
- type UserConfirmEnableTFAOpts
- type UserDisableTFAOpts
- type UserGetDepositAddressOpts
- type UserGetMarginOpts
- type UserGetWalletHistoryOpts
- type UserGetWalletOpts
- type UserGetWalletSummaryOpts
- type UserMinWithdrawalFeeOpts
- type UserPreferences
- type UserRequestEnableTFAOpts
- type UserRequestWithdrawalOpts
- type UserSavePreferencesOpts
- type UserUpdateOpts
- type UserWithdrawalFees
- type Wallet
Constants ¶
This section is empty.
Variables ¶
var ContextAPIKey = contextKey("apikey")
Functions ¶
func CacheExpires ¶
CacheExpires helper function to determine remaining time before repeating a request.
func NewAPIKeyContext ¶
Types ¶
type APIClient ¶
type APIClient struct { APIKeyApi *APIKeyApiService AnnouncementApi *AnnouncementApiService ChatApi *ChatApiService ExecutionApi *ExecutionApiService FundingApi *FundingApiService InstrumentApi *InstrumentApiService InsuranceApi *InsuranceApiService LeaderboardApi *LeaderboardApiService LiquidationApi *LiquidationApiService NotificationApi *NotificationApiService OrderApi *OrderApiService OrderBookApi *OrderBookApiService PositionApi *PositionApiService QuoteApi *QuoteApiService SchemaApi *SchemaApiService SettlementApi *SettlementApiService StatsApi *StatsApiService TradeApi *TradeApiService UserApi *UserApiService // contains filtered or unexported fields }
APIClient manages communication with the BitMEX API API v1.2.0 In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(cfg *Configuration) *APIClient
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) ChangeBasePath ¶
Change base path to allow switching to mocks
type APIKey ¶
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIKeyApiService ¶
type APIKeyApiService service
func (*APIKeyApiService) APIKeyDisable ¶
func (a *APIKeyApiService) APIKeyDisable(ctx context.Context, apiKeyID string) (ApiKey, *http.Response, error)
APIKeyApiService Disable an API Key.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param apiKeyID API Key ID (public component).
@return ApiKey
func (*APIKeyApiService) APIKeyEnable ¶
func (a *APIKeyApiService) APIKeyEnable(ctx context.Context, apiKeyID string) (ApiKey, *http.Response, error)
APIKeyApiService Enable an API Key.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param apiKeyID API Key ID (public component).
@return ApiKey
func (*APIKeyApiService) APIKeyGet ¶
func (a *APIKeyApiService) APIKeyGet(ctx context.Context, localVarOptionals *APIKeyGetOpts) ([]ApiKey, *http.Response, error)
func (*APIKeyApiService) APIKeyNew ¶
func (a *APIKeyApiService) APIKeyNew(ctx context.Context, localVarOptionals *APIKeyNewOpts) (ApiKey, *http.Response, error)
func (*APIKeyApiService) APIKeyRemove ¶
func (a *APIKeyApiService) APIKeyRemove(ctx context.Context, apiKeyID string) (InlineResponse200, *http.Response, error)
APIKeyApiService Remove an API Key.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param apiKeyID API Key ID (public component).
@return InlineResponse200
type APIKeyGetOpts ¶
type APIKeyNewOpts ¶
type APIResponse ¶
type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` // Operation is the name of the swagger operation. Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. Payload []byte `json:"-"` }
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
type AccessToken ¶
type Affiliate ¶
type Affiliate struct { Account int `json:"account"` Currency string `json:"currency"` PrevPayout int `json:"prevPayout,omitempty"` PrevTurnover int `json:"prevTurnover,omitempty"` PrevComm int `json:"prevComm,omitempty"` PrevTimestamp time.Time `json:"prevTimestamp,omitempty"` ExecTurnover int `json:"execTurnover,omitempty"` ExecComm int `json:"execComm,omitempty"` TotalReferrals int `json:"totalReferrals,omitempty"` TotalTurnover int `json:"totalTurnover,omitempty"` TotalComm int `json:"totalComm,omitempty"` PayoutPcnt float64 `json:"payoutPcnt,omitempty"` PendingPayout int `json:"pendingPayout,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` ReferrerAccount int `json:"referrerAccount,omitempty"` }
type Announcement ¶
type Announcement struct { Id int `json:"id"` Link string `json:"link,omitempty"` Title string `json:"title,omitempty"` Content string `json:"content,omitempty"` Date time.Time `json:"date,omitempty"` }
Public Announcements
type AnnouncementApiService ¶
type AnnouncementApiService service
func (*AnnouncementApiService) AnnouncementGet ¶
func (a *AnnouncementApiService) AnnouncementGet(ctx context.Context, localVarOptionals *AnnouncementGetOpts) ([]Announcement, *http.Response, error)
func (*AnnouncementApiService) AnnouncementGetUrgent ¶
func (a *AnnouncementApiService) AnnouncementGetUrgent(ctx context.Context) ([]Announcement, *http.Response, error)
AnnouncementApiService Get urgent (banner) announcements.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []Announcement
type AnnouncementGetOpts ¶
type ApiKey ¶
type ApiKey struct { Id string `json:"id"` Secret string `json:"secret"` Name string `json:"name"` Nonce int `json:"nonce"` Cidr string `json:"cidr,omitempty"` Permissions []string `json:"permissions,omitempty"` Enabled bool `json:"enabled,omitempty"` UserId int `json:"userId"` Created time.Time `json:"created,omitempty"` }
Persistent API Keys for Developers
type Chat ¶
type Chat struct { Id int `json:"id,omitempty"` Date time.Time `json:"date"` User string `json:"user"` Message string `json:"message"` Html string `json:"html"` FromBot bool `json:"fromBot,omitempty"` ChannelID int `json:"channelID,omitempty"` }
Trollbox Data
type ChatApiService ¶
type ChatApiService service
func (*ChatApiService) ChatGet ¶
func (a *ChatApiService) ChatGet(ctx context.Context, localVarOptionals *ChatGetOpts) ([]Chat, *http.Response, error)
func (*ChatApiService) ChatGetChannels ¶
func (a *ChatApiService) ChatGetChannels(ctx context.Context) ([]ChatChannel, *http.Response, error)
ChatApiService Get available channels.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []ChatChannel
func (*ChatApiService) ChatGetConnected ¶
func (a *ChatApiService) ChatGetConnected(ctx context.Context) (ConnectedUsers, *http.Response, error)
ChatApiService Get connected users. Returns an array with browser users in the first position and API users (bots) in the second position.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ConnectedUsers
type ChatChannel ¶
type ChatGetOpts ¶
type ChatNewOpts ¶
type Configuration ¶
type Configuration struct { BasePath string `json:"basePath,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` HTTPClient *http.Client }
func NewConfiguration ¶
func NewConfiguration() *Configuration
func NewTestnetConfiguration ¶
func NewTestnetConfiguration() *Configuration
type ConnectedUsers ¶
type ErrorError ¶
type Execution ¶
type Execution struct { ExecID string `json:"execID"` OrderID string `json:"orderID,omitempty"` ClOrdID string `json:"clOrdID,omitempty"` ClOrdLinkID string `json:"clOrdLinkID,omitempty"` Account int `json:"account,omitempty"` Symbol string `json:"symbol,omitempty"` Side string `json:"side,omitempty"` LastQty int `json:"lastQty,omitempty"` LastPx float64 `json:"lastPx,omitempty"` UnderlyingLastPx float64 `json:"underlyingLastPx,omitempty"` LastMkt string `json:"lastMkt,omitempty"` LastLiquidityInd string `json:"lastLiquidityInd,omitempty"` SimpleOrderQty float64 `json:"simpleOrderQty,omitempty"` OrderQty int `json:"orderQty,omitempty"` Price float64 `json:"price,omitempty"` DisplayQty int `json:"displayQty,omitempty"` StopPx float64 `json:"stopPx,omitempty"` PegOffsetValue float64 `json:"pegOffsetValue,omitempty"` PegPriceType string `json:"pegPriceType,omitempty"` Currency string `json:"currency,omitempty"` SettlCurrency string `json:"settlCurrency,omitempty"` ExecType string `json:"execType,omitempty"` OrdType string `json:"ordType,omitempty"` TimeInForce string `json:"timeInForce,omitempty"` ExecInst string `json:"execInst,omitempty"` ContingencyType string `json:"contingencyType,omitempty"` ExDestination string `json:"exDestination,omitempty"` OrdStatus string `json:"ordStatus,omitempty"` Triggered string `json:"triggered,omitempty"` WorkingIndicator bool `json:"workingIndicator,omitempty"` OrdRejReason string `json:"ordRejReason,omitempty"` SimpleLeavesQty float64 `json:"simpleLeavesQty,omitempty"` LeavesQty int `json:"leavesQty,omitempty"` SimpleCumQty float64 `json:"simpleCumQty,omitempty"` CumQty int `json:"cumQty,omitempty"` AvgPx float64 `json:"avgPx,omitempty"` Commission float64 `json:"commission,omitempty"` TradePublishIndicator string `json:"tradePublishIndicator,omitempty"` MultiLegReportingType string `json:"multiLegReportingType,omitempty"` Text string `json:"text,omitempty"` TrdMatchID string `json:"trdMatchID,omitempty"` ExecCost int `json:"execCost,omitempty"` ExecComm int `json:"execComm,omitempty"` HomeNotional float64 `json:"homeNotional,omitempty"` ForeignNotional float64 `json:"foreignNotional,omitempty"` TransactTime time.Time `json:"transactTime,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` }
Raw Order and Balance Data
type ExecutionApiService ¶
type ExecutionApiService service
func (*ExecutionApiService) ExecutionGet ¶
func (a *ExecutionApiService) ExecutionGet(ctx context.Context, localVarOptionals *ExecutionGetOpts) ([]Execution, *http.Response, error)
func (*ExecutionApiService) ExecutionGetTradeHistory ¶
func (a *ExecutionApiService) ExecutionGetTradeHistory(ctx context.Context, localVarOptionals *ExecutionGetTradeHistoryOpts) ([]Execution, *http.Response, error)
type ExecutionGetOpts ¶
type Funding ¶
type Funding struct { Timestamp time.Time `json:"timestamp"` Symbol string `json:"symbol"` FundingInterval time.Time `json:"fundingInterval,omitempty"` FundingRate float64 `json:"fundingRate,omitempty"` FundingRateDaily float64 `json:"fundingRateDaily,omitempty"` }
Swap Funding History
type FundingApiService ¶
type FundingApiService service
func (*FundingApiService) FundingGet ¶
func (a *FundingApiService) FundingGet(ctx context.Context, localVarOptionals *FundingGetOpts) ([]Funding, *http.Response, error)
type FundingGetOpts ¶
type GenericSwaggerError ¶
type GenericSwaggerError struct {
// contains filtered or unexported fields
}
GenericSwaggerError Provides access to the body, error and model on returned errors.
func (GenericSwaggerError) Body ¶
func (e GenericSwaggerError) Body() []byte
Body returns the raw bytes of the response
func (GenericSwaggerError) Error ¶
func (e GenericSwaggerError) Error() string
Error returns non-empty string if there was an error.
func (GenericSwaggerError) Model ¶
func (e GenericSwaggerError) Model() interface{}
Model returns the unpacked model of the error
type IndexComposite ¶
type IndexComposite struct { Timestamp time.Time `json:"timestamp"` Symbol string `json:"symbol,omitempty"` IndexSymbol string `json:"indexSymbol,omitempty"` Reference string `json:"reference,omitempty"` LastPrice float64 `json:"lastPrice,omitempty"` Weight float64 `json:"weight,omitempty"` Logged time.Time `json:"logged,omitempty"` }
type InlineResponse200 ¶
type InlineResponse200 struct {
Success bool `json:"success,omitempty"`
}
type InlineResponse2001 ¶
type InlineResponse2001 struct {
Name string `json:"name,omitempty"`
}
type Instrument ¶
type Instrument struct { Symbol string `json:"symbol"` RootSymbol string `json:"rootSymbol,omitempty"` State string `json:"state,omitempty"` Typ string `json:"typ,omitempty"` Listing time.Time `json:"listing,omitempty"` Front time.Time `json:"front,omitempty"` Expiry time.Time `json:"expiry,omitempty"` Settle time.Time `json:"settle,omitempty"` RelistInterval time.Time `json:"relistInterval,omitempty"` InverseLeg string `json:"inverseLeg,omitempty"` SellLeg string `json:"sellLeg,omitempty"` BuyLeg string `json:"buyLeg,omitempty"` OptionStrikePcnt float64 `json:"optionStrikePcnt,omitempty"` OptionStrikeRound float64 `json:"optionStrikeRound,omitempty"` OptionStrikePrice float64 `json:"optionStrikePrice,omitempty"` OptionMultiplier float64 `json:"optionMultiplier,omitempty"` PositionCurrency string `json:"positionCurrency,omitempty"` Underlying string `json:"underlying,omitempty"` QuoteCurrency string `json:"quoteCurrency,omitempty"` UnderlyingSymbol string `json:"underlyingSymbol,omitempty"` Reference string `json:"reference,omitempty"` ReferenceSymbol string `json:"referenceSymbol,omitempty"` CalcInterval time.Time `json:"calcInterval,omitempty"` PublishInterval time.Time `json:"publishInterval,omitempty"` PublishTime time.Time `json:"publishTime,omitempty"` MaxOrderQty int `json:"maxOrderQty,omitempty"` MaxPrice float64 `json:"maxPrice,omitempty"` LotSize int `json:"lotSize,omitempty"` TickSize float64 `json:"tickSize,omitempty"` Multiplier int `json:"multiplier,omitempty"` SettlCurrency string `json:"settlCurrency,omitempty"` UnderlyingToPositionMultiplier int `json:"underlyingToPositionMultiplier,omitempty"` UnderlyingToSettleMultiplier int `json:"underlyingToSettleMultiplier,omitempty"` QuoteToSettleMultiplier int `json:"quoteToSettleMultiplier,omitempty"` IsQuanto bool `json:"isQuanto,omitempty"` IsInverse bool `json:"isInverse,omitempty"` InitMargin float64 `json:"initMargin,omitempty"` MaintMargin float64 `json:"maintMargin,omitempty"` RiskLimit int `json:"riskLimit,omitempty"` RiskStep int `json:"riskStep,omitempty"` Limit float64 `json:"limit,omitempty"` Capped bool `json:"capped,omitempty"` Taxed bool `json:"taxed,omitempty"` Deleverage bool `json:"deleverage,omitempty"` MakerFee float64 `json:"makerFee,omitempty"` TakerFee float64 `json:"takerFee,omitempty"` SettlementFee float64 `json:"settlementFee,omitempty"` InsuranceFee float64 `json:"insuranceFee,omitempty"` FundingBaseSymbol string `json:"fundingBaseSymbol,omitempty"` FundingQuoteSymbol string `json:"fundingQuoteSymbol,omitempty"` FundingPremiumSymbol string `json:"fundingPremiumSymbol,omitempty"` FundingTimestamp time.Time `json:"fundingTimestamp,omitempty"` FundingInterval time.Time `json:"fundingInterval,omitempty"` FundingRate float64 `json:"fundingRate,omitempty"` IndicativeFundingRate float64 `json:"indicativeFundingRate,omitempty"` RebalanceTimestamp time.Time `json:"rebalanceTimestamp,omitempty"` RebalanceInterval time.Time `json:"rebalanceInterval,omitempty"` OpeningTimestamp time.Time `json:"openingTimestamp,omitempty"` ClosingTimestamp time.Time `json:"closingTimestamp,omitempty"` SessionInterval time.Time `json:"sessionInterval,omitempty"` PrevClosePrice float64 `json:"prevClosePrice,omitempty"` LimitDownPrice float64 `json:"limitDownPrice,omitempty"` LimitUpPrice float64 `json:"limitUpPrice,omitempty"` BankruptLimitDownPrice float64 `json:"bankruptLimitDownPrice,omitempty"` BankruptLimitUpPrice float64 `json:"bankruptLimitUpPrice,omitempty"` PrevTotalVolume int `json:"prevTotalVolume,omitempty"` TotalVolume int `json:"totalVolume,omitempty"` Volume int `json:"volume,omitempty"` Volume24h int `json:"volume24h,omitempty"` PrevTotalTurnover int `json:"prevTotalTurnover,omitempty"` TotalTurnover int `json:"totalTurnover,omitempty"` Turnover int `json:"turnover,omitempty"` Turnover24h int `json:"turnover24h,omitempty"` PrevPrice24h float64 `json:"prevPrice24h,omitempty"` Vwap float64 `json:"vwap,omitempty"` HighPrice float64 `json:"highPrice,omitempty"` LowPrice float64 `json:"lowPrice,omitempty"` LastPrice float64 `json:"lastPrice,omitempty"` LastPriceProtected float64 `json:"lastPriceProtected,omitempty"` LastTickDirection string `json:"lastTickDirection,omitempty"` LastChangePcnt float64 `json:"lastChangePcnt,omitempty"` BidPrice float64 `json:"bidPrice,omitempty"` MidPrice float64 `json:"midPrice,omitempty"` AskPrice float64 `json:"askPrice,omitempty"` ImpactBidPrice float64 `json:"impactBidPrice,omitempty"` ImpactMidPrice float64 `json:"impactMidPrice,omitempty"` ImpactAskPrice float64 `json:"impactAskPrice,omitempty"` HasLiquidity bool `json:"hasLiquidity,omitempty"` OpenInterest int `json:"openInterest,omitempty"` OpenValue int `json:"openValue,omitempty"` FairMethod string `json:"fairMethod,omitempty"` FairBasisRate float64 `json:"fairBasisRate,omitempty"` FairBasis float64 `json:"fairBasis,omitempty"` FairPrice float64 `json:"fairPrice,omitempty"` MarkMethod string `json:"markMethod,omitempty"` MarkPrice float64 `json:"markPrice,omitempty"` IndicativeTaxRate float64 `json:"indicativeTaxRate,omitempty"` IndicativeSettlePrice float64 `json:"indicativeSettlePrice,omitempty"` OptionUnderlyingPrice float64 `json:"optionUnderlyingPrice,omitempty"` SettledPrice float64 `json:"settledPrice,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` }
Tradeable Contracts, Indices, and History
type InstrumentApiService ¶
type InstrumentApiService service
func (*InstrumentApiService) InstrumentGet ¶
func (a *InstrumentApiService) InstrumentGet(ctx context.Context, localVarOptionals *InstrumentGetOpts) ([]Instrument, *http.Response, error)
func (*InstrumentApiService) InstrumentGetActive ¶
func (a *InstrumentApiService) InstrumentGetActive(ctx context.Context) ([]Instrument, *http.Response, error)
InstrumentApiService Get all active instruments and instruments that have expired in <24hrs.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []Instrument
func (*InstrumentApiService) InstrumentGetActiveAndIndices ¶
func (a *InstrumentApiService) InstrumentGetActiveAndIndices(ctx context.Context) ([]Instrument, *http.Response, error)
InstrumentApiService Helper method. Gets all active instruments and all indices. This is a join of the result of /indices and /active.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []Instrument
func (*InstrumentApiService) InstrumentGetActiveIntervals ¶
func (a *InstrumentApiService) InstrumentGetActiveIntervals(ctx context.Context) (InstrumentInterval, *http.Response, error)
InstrumentApiService Return all active contract series and interval pairs. This endpoint is useful for determining which pairs are live. It returns two arrays of strings. The first is intervals, such as `[\"XBT:perpetual\", \"XBT:monthly\", \"XBT:quarterly\", \"ETH:monthly\", ...]`. These identifiers are usable in any query's `symbol` param. The second array is the current resolution of these intervals. Results are mapped at the same index.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return InstrumentInterval
func (*InstrumentApiService) InstrumentGetCompositeIndex ¶
func (a *InstrumentApiService) InstrumentGetCompositeIndex(ctx context.Context, localVarOptionals *InstrumentGetCompositeIndexOpts) ([]IndexComposite, *http.Response, error)
func (*InstrumentApiService) InstrumentGetIndices ¶
func (a *InstrumentApiService) InstrumentGetIndices(ctx context.Context) ([]Instrument, *http.Response, error)
InstrumentApiService Get all price indices.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []Instrument
type InstrumentGetOpts ¶
type InstrumentInterval ¶
type Insurance ¶
type Insurance struct { Currency string `json:"currency"` Timestamp time.Time `json:"timestamp"` WalletBalance int `json:"walletBalance,omitempty"` }
Insurance Fund Data
type InsuranceApiService ¶
type InsuranceApiService service
func (*InsuranceApiService) InsuranceGet ¶
func (a *InsuranceApiService) InsuranceGet(ctx context.Context, localVarOptionals *InsuranceGetOpts) ([]Insurance, *http.Response, error)
type InsuranceGetOpts ¶
type Leaderboard ¶
type Leaderboard struct { Name string `json:"name"` IsRealName bool `json:"isRealName,omitempty"` Profit float64 `json:"profit,omitempty"` }
Information on Top Users
type LeaderboardApiService ¶
type LeaderboardApiService service
func (*LeaderboardApiService) LeaderboardGet ¶
func (a *LeaderboardApiService) LeaderboardGet(ctx context.Context, localVarOptionals *LeaderboardGetOpts) ([]Leaderboard, *http.Response, error)
func (*LeaderboardApiService) LeaderboardGetName ¶
func (a *LeaderboardApiService) LeaderboardGetName(ctx context.Context) (InlineResponse2001, *http.Response, error)
LeaderboardApiService Get your alias on the leaderboard.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return InlineResponse2001
type LeaderboardGetOpts ¶
type Liquidation ¶
type Liquidation struct { OrderID string `json:"orderID"` Symbol string `json:"symbol,omitempty"` Side string `json:"side,omitempty"` Price float64 `json:"price,omitempty"` LeavesQty int `json:"leavesQty,omitempty"` }
Active Liquidations
type LiquidationApiService ¶
type LiquidationApiService service
func (*LiquidationApiService) LiquidationGet ¶
func (a *LiquidationApiService) LiquidationGet(ctx context.Context, localVarOptionals *LiquidationGetOpts) ([]Liquidation, *http.Response, error)
type LiquidationGetOpts ¶
type Margin ¶
type Margin struct { Account int `json:"account"` Currency string `json:"currency"` RiskLimit int `json:"riskLimit,omitempty"` PrevState string `json:"prevState,omitempty"` State string `json:"state,omitempty"` Action string `json:"action,omitempty"` Amount int `json:"amount,omitempty"` PendingCredit int `json:"pendingCredit,omitempty"` PendingDebit int `json:"pendingDebit,omitempty"` ConfirmedDebit int `json:"confirmedDebit,omitempty"` PrevRealisedPnl int `json:"prevRealisedPnl,omitempty"` PrevUnrealisedPnl int `json:"prevUnrealisedPnl,omitempty"` GrossComm int `json:"grossComm,omitempty"` GrossOpenCost int `json:"grossOpenCost,omitempty"` GrossOpenPremium int `json:"grossOpenPremium,omitempty"` GrossExecCost int `json:"grossExecCost,omitempty"` GrossMarkValue int `json:"grossMarkValue,omitempty"` RiskValue int `json:"riskValue,omitempty"` TaxableMargin int `json:"taxableMargin,omitempty"` InitMargin int `json:"initMargin,omitempty"` MaintMargin int `json:"maintMargin,omitempty"` SessionMargin int `json:"sessionMargin,omitempty"` TargetExcessMargin int `json:"targetExcessMargin,omitempty"` VarMargin int `json:"varMargin,omitempty"` RealisedPnl int `json:"realisedPnl,omitempty"` UnrealisedPnl int `json:"unrealisedPnl,omitempty"` IndicativeTax int `json:"indicativeTax,omitempty"` UnrealisedProfit int `json:"unrealisedProfit,omitempty"` SyntheticMargin int `json:"syntheticMargin,omitempty"` WalletBalance int `json:"walletBalance,omitempty"` MarginBalance int `json:"marginBalance,omitempty"` MarginBalancePcnt float64 `json:"marginBalancePcnt,omitempty"` MarginLeverage float64 `json:"marginLeverage,omitempty"` MarginUsedPcnt float64 `json:"marginUsedPcnt,omitempty"` ExcessMargin int `json:"excessMargin,omitempty"` ExcessMarginPcnt float64 `json:"excessMarginPcnt,omitempty"` AvailableMargin int `json:"availableMargin,omitempty"` WithdrawableMargin int `json:"withdrawableMargin,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` GrossLastValue int `json:"grossLastValue,omitempty"` Commission float64 `json:"commission,omitempty"` }
type ModelError ¶
type ModelError struct {
Error_ *ErrorError `json:"error"`
}
type Notification ¶
type Notification struct { Id int `json:"id,omitempty"` Date time.Time `json:"date"` Title string `json:"title"` Body string `json:"body"` Ttl int `json:"ttl"` Type_ string `json:"type,omitempty"` Closable bool `json:"closable,omitempty"` Persist bool `json:"persist,omitempty"` WaitForVisibility bool `json:"waitForVisibility,omitempty"` Sound string `json:"sound,omitempty"` }
Account Notifications
type NotificationApiService ¶
type NotificationApiService service
func (*NotificationApiService) NotificationGet ¶
func (a *NotificationApiService) NotificationGet(ctx context.Context) ([]Notification, *http.Response, error)
NotificationApiService Get your current notifications. This is an upcoming feature and currently does not return data.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []Notification
type Order ¶
type Order struct { OrderID string `json:"orderID"` ClOrdID string `json:"clOrdID,omitempty"` ClOrdLinkID string `json:"clOrdLinkID,omitempty"` Account int `json:"account,omitempty"` Symbol string `json:"symbol,omitempty"` Side string `json:"side,omitempty"` SimpleOrderQty float64 `json:"simpleOrderQty,omitempty"` OrderQty int `json:"orderQty,omitempty"` Price float64 `json:"price,omitempty"` DisplayQty int `json:"displayQty,omitempty"` StopPx float64 `json:"stopPx,omitempty"` PegOffsetValue float64 `json:"pegOffsetValue,omitempty"` PegPriceType string `json:"pegPriceType,omitempty"` Currency string `json:"currency,omitempty"` SettlCurrency string `json:"settlCurrency,omitempty"` OrdType string `json:"ordType,omitempty"` TimeInForce string `json:"timeInForce,omitempty"` ExecInst string `json:"execInst,omitempty"` ContingencyType string `json:"contingencyType,omitempty"` ExDestination string `json:"exDestination,omitempty"` OrdStatus string `json:"ordStatus,omitempty"` Triggered string `json:"triggered,omitempty"` WorkingIndicator bool `json:"workingIndicator,omitempty"` OrdRejReason string `json:"ordRejReason,omitempty"` SimpleLeavesQty float64 `json:"simpleLeavesQty,omitempty"` LeavesQty int `json:"leavesQty,omitempty"` SimpleCumQty float64 `json:"simpleCumQty,omitempty"` CumQty int `json:"cumQty,omitempty"` AvgPx float64 `json:"avgPx,omitempty"` MultiLegReportingType string `json:"multiLegReportingType,omitempty"` Text string `json:"text,omitempty"` TransactTime time.Time `json:"transactTime,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` }
Placement, Cancellation, Amending, and History
type OrderAmendBulkOpts ¶
type OrderAmendOpts ¶
type OrderAmendOpts struct { OrderID optional.String OrigClOrdID optional.String ClOrdID optional.String SimpleOrderQty optional.Float64 OrderQty optional.Int SimpleLeavesQty optional.Float64 LeavesQty optional.Int Price optional.Float64 StopPx optional.Float64 PegOffsetValue optional.Float64 Text optional.String }
type OrderApiService ¶
type OrderApiService service
func (*OrderApiService) OrderAmend ¶
func (a *OrderApiService) OrderAmend(ctx context.Context, localVarOptionals *OrderAmendOpts) (Order, *http.Response, error)
func (*OrderApiService) OrderAmendBulk ¶
func (a *OrderApiService) OrderAmendBulk(ctx context.Context, localVarOptionals *OrderAmendBulkOpts) ([]Order, *http.Response, error)
func (*OrderApiService) OrderCancel ¶
func (a *OrderApiService) OrderCancel(ctx context.Context, localVarOptionals *OrderCancelOpts) ([]Order, *http.Response, error)
func (*OrderApiService) OrderCancelAll ¶
func (a *OrderApiService) OrderCancelAll(ctx context.Context, localVarOptionals *OrderCancelAllOpts) ([]Order, *http.Response, error)
func (*OrderApiService) OrderCancelAllAfter ¶
func (a *OrderApiService) OrderCancelAllAfter(ctx context.Context, timeout float64) (interface{}, *http.Response, error)
OrderApiService Automatically cancel all your orders after a specified timeout. Useful as a dead-man's switch to ensure your orders are canceled in case of an outage. If called repeatedly, the existing offset will be canceled and a new one will be inserted in its place. Example usage: call this route at 15s intervals with an offset of 60000 (60s). If this route is not called within 60 seconds, all your orders will be automatically canceled. This is also available via [WebSocket](https://www.bitmex.com/app/wsAPI#Dead-Mans-Switch-Auto-Cancel).
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param timeout Timeout in ms. Set to 0 to cancel this timer.
@return interface{}
func (*OrderApiService) OrderClosePosition ¶
func (a *OrderApiService) OrderClosePosition(ctx context.Context, symbol string, localVarOptionals *OrderClosePositionOpts) (Order, *http.Response, error)
func (*OrderApiService) OrderGetOrders ¶
func (a *OrderApiService) OrderGetOrders(ctx context.Context, localVarOptionals *OrderGetOrdersOpts) ([]Order, *http.Response, error)
func (*OrderApiService) OrderNew ¶
func (a *OrderApiService) OrderNew(ctx context.Context, symbol string, localVarOptionals *OrderNewOpts) (Order, *http.Response, error)
func (*OrderApiService) OrderNewBulk ¶
func (a *OrderApiService) OrderNewBulk(ctx context.Context, localVarOptionals *OrderNewBulkOpts) ([]Order, *http.Response, error)
type OrderBookApiService ¶
type OrderBookApiService service
func (*OrderBookApiService) OrderBookGetL2 ¶
func (a *OrderBookApiService) OrderBookGetL2(ctx context.Context, symbol string, localVarOptionals *OrderBookGetL2Opts) ([]OrderBookL2, *http.Response, error)
type OrderBookGetL2Opts ¶
type OrderBookL2 ¶
type OrderCancelAllOpts ¶
type OrderCancelOpts ¶
type OrderClosePositionOpts ¶
type OrderGetOrdersOpts ¶
type OrderNewBulkOpts ¶
type OrderNewOpts ¶
type OrderNewOpts struct { Side optional.String SimpleOrderQty optional.Float64 OrderQty optional.Int Price optional.Float64 DisplayQty optional.Int StopPx optional.Float64 ClOrdID optional.String ClOrdLinkID optional.String PegOffsetValue optional.Float64 PegPriceType optional.String OrdType optional.String TimeInForce optional.String ExecInst optional.String ContingencyType optional.String Text optional.String }
type Position ¶
type Position struct { Account int `json:"account"` Symbol string `json:"symbol"` Currency string `json:"currency"` Underlying string `json:"underlying,omitempty"` QuoteCurrency string `json:"quoteCurrency,omitempty"` Commission float64 `json:"commission,omitempty"` InitMarginReq float64 `json:"initMarginReq,omitempty"` MaintMarginReq float64 `json:"maintMarginReq,omitempty"` RiskLimit int `json:"riskLimit,omitempty"` Leverage float64 `json:"leverage,omitempty"` CrossMargin bool `json:"crossMargin,omitempty"` DeleveragePercentile float64 `json:"deleveragePercentile,omitempty"` RebalancedPnl int `json:"rebalancedPnl,omitempty"` PrevRealisedPnl int `json:"prevRealisedPnl,omitempty"` PrevUnrealisedPnl int `json:"prevUnrealisedPnl,omitempty"` PrevClosePrice float64 `json:"prevClosePrice,omitempty"` OpeningTimestamp time.Time `json:"openingTimestamp,omitempty"` OpeningQty int `json:"openingQty,omitempty"` OpeningCost int `json:"openingCost,omitempty"` OpeningComm int `json:"openingComm,omitempty"` OpenOrderBuyQty int `json:"openOrderBuyQty,omitempty"` OpenOrderBuyCost int `json:"openOrderBuyCost,omitempty"` OpenOrderBuyPremium int `json:"openOrderBuyPremium,omitempty"` OpenOrderSellQty int `json:"openOrderSellQty,omitempty"` OpenOrderSellCost int `json:"openOrderSellCost,omitempty"` OpenOrderSellPremium int `json:"openOrderSellPremium,omitempty"` ExecBuyQty int `json:"execBuyQty,omitempty"` ExecBuyCost int `json:"execBuyCost,omitempty"` ExecSellQty int `json:"execSellQty,omitempty"` ExecSellCost int `json:"execSellCost,omitempty"` ExecQty int `json:"execQty,omitempty"` ExecCost int `json:"execCost,omitempty"` ExecComm int `json:"execComm,omitempty"` CurrentTimestamp time.Time `json:"currentTimestamp,omitempty"` CurrentQty int `json:"currentQty,omitempty"` CurrentCost int `json:"currentCost,omitempty"` CurrentComm int `json:"currentComm,omitempty"` RealisedCost int `json:"realisedCost,omitempty"` UnrealisedCost int `json:"unrealisedCost,omitempty"` GrossOpenCost int `json:"grossOpenCost,omitempty"` GrossOpenPremium int `json:"grossOpenPremium,omitempty"` GrossExecCost int `json:"grossExecCost,omitempty"` IsOpen bool `json:"isOpen,omitempty"` MarkPrice float64 `json:"markPrice,omitempty"` MarkValue int `json:"markValue,omitempty"` RiskValue int `json:"riskValue,omitempty"` HomeNotional float64 `json:"homeNotional,omitempty"` ForeignNotional float64 `json:"foreignNotional,omitempty"` PosState string `json:"posState,omitempty"` PosCost int `json:"posCost,omitempty"` PosCost2 int `json:"posCost2,omitempty"` PosCross int `json:"posCross,omitempty"` PosInit int `json:"posInit,omitempty"` PosComm int `json:"posComm,omitempty"` PosLoss int `json:"posLoss,omitempty"` PosMargin int `json:"posMargin,omitempty"` PosMaint int `json:"posMaint,omitempty"` PosAllowance int `json:"posAllowance,omitempty"` TaxableMargin int `json:"taxableMargin,omitempty"` InitMargin int `json:"initMargin,omitempty"` MaintMargin int `json:"maintMargin,omitempty"` SessionMargin int `json:"sessionMargin,omitempty"` TargetExcessMargin int `json:"targetExcessMargin,omitempty"` VarMargin int `json:"varMargin,omitempty"` RealisedGrossPnl int `json:"realisedGrossPnl,omitempty"` RealisedTax int `json:"realisedTax,omitempty"` RealisedPnl int `json:"realisedPnl,omitempty"` UnrealisedGrossPnl int `json:"unrealisedGrossPnl,omitempty"` LongBankrupt int `json:"longBankrupt,omitempty"` ShortBankrupt int `json:"shortBankrupt,omitempty"` TaxBase int `json:"taxBase,omitempty"` IndicativeTaxRate float64 `json:"indicativeTaxRate,omitempty"` IndicativeTax int `json:"indicativeTax,omitempty"` UnrealisedTax int `json:"unrealisedTax,omitempty"` UnrealisedPnl int `json:"unrealisedPnl,omitempty"` UnrealisedPnlPcnt float64 `json:"unrealisedPnlPcnt,omitempty"` UnrealisedRoePcnt float64 `json:"unrealisedRoePcnt,omitempty"` SimpleQty float64 `json:"simpleQty,omitempty"` SimpleCost float64 `json:"simpleCost,omitempty"` SimpleValue float64 `json:"simpleValue,omitempty"` SimplePnl float64 `json:"simplePnl,omitempty"` SimplePnlPcnt float64 `json:"simplePnlPcnt,omitempty"` AvgCostPrice float64 `json:"avgCostPrice,omitempty"` AvgEntryPrice float64 `json:"avgEntryPrice,omitempty"` BreakEvenPrice float64 `json:"breakEvenPrice,omitempty"` MarginCallPrice float64 `json:"marginCallPrice,omitempty"` LiquidationPrice float64 `json:"liquidationPrice,omitempty"` BankruptPrice float64 `json:"bankruptPrice,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` LastPrice float64 `json:"lastPrice,omitempty"` LastValue int `json:"lastValue,omitempty"` }
Summary of Open and Closed Positions
type PositionApiService ¶
type PositionApiService service
func (*PositionApiService) PositionGet ¶
func (a *PositionApiService) PositionGet(ctx context.Context, localVarOptionals *PositionGetOpts) ([]Position, *http.Response, error)
func (*PositionApiService) PositionIsolateMargin ¶
func (a *PositionApiService) PositionIsolateMargin(ctx context.Context, symbol string, localVarOptionals *PositionIsolateMarginOpts) (Position, *http.Response, error)
func (*PositionApiService) PositionTransferIsolatedMargin ¶
func (a *PositionApiService) PositionTransferIsolatedMargin(ctx context.Context, symbol string, amount int) (Position, *http.Response, error)
PositionApiService Transfer equity in or out of a position.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param symbol Symbol of position to isolate.
- @param amount Amount to transfer, in Satoshis. May be negative.
@return Position
func (*PositionApiService) PositionUpdateLeverage ¶
func (a *PositionApiService) PositionUpdateLeverage(ctx context.Context, symbol string, leverage float64) (Position, *http.Response, error)
PositionApiService Choose leverage for a position.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param symbol Symbol of position to adjust.
- @param leverage Leverage value. Send a number between 0.01 and 100 to enable isolated margin with a fixed leverage. Send 0 to enable cross margin.
@return Position
func (*PositionApiService) PositionUpdateRiskLimit ¶
func (a *PositionApiService) PositionUpdateRiskLimit(ctx context.Context, symbol string, riskLimit int) (Position, *http.Response, error)
PositionApiService Update your risk limit.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param symbol Symbol of position to update risk limit on.
- @param riskLimit New Risk Limit, in Satoshis.
@return Position
type PositionGetOpts ¶
type Quote ¶
type Quote struct { Timestamp time.Time `json:"timestamp"` Symbol string `json:"symbol"` BidSize int `json:"bidSize,omitempty"` BidPrice float64 `json:"bidPrice,omitempty"` AskPrice float64 `json:"askPrice,omitempty"` AskSize int `json:"askSize,omitempty"` }
Best Bid/Offer Snapshots & Historical Bins
type QuoteApiService ¶
type QuoteApiService service
func (*QuoteApiService) QuoteGet ¶
func (a *QuoteApiService) QuoteGet(ctx context.Context, localVarOptionals *QuoteGetOpts) ([]Quote, *http.Response, error)
func (*QuoteApiService) QuoteGetBucketed ¶
func (a *QuoteApiService) QuoteGetBucketed(ctx context.Context, localVarOptionals *QuoteGetBucketedOpts) ([]Quote, *http.Response, error)
type QuoteGetBucketedOpts ¶
type QuoteGetOpts ¶
type SchemaApiService ¶
type SchemaApiService service
func (*SchemaApiService) SchemaGet ¶
func (a *SchemaApiService) SchemaGet(ctx context.Context, localVarOptionals *SchemaGetOpts) (interface{}, *http.Response, error)
func (*SchemaApiService) SchemaWebsocketHelp ¶
func (a *SchemaApiService) SchemaWebsocketHelp(ctx context.Context) (interface{}, *http.Response, error)
SchemaApiService Returns help text & subject list for websocket usage.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return interface{}
type SchemaGetOpts ¶
type Settlement ¶
type Settlement struct { Timestamp time.Time `json:"timestamp"` Symbol string `json:"symbol"` SettlementType string `json:"settlementType,omitempty"` SettledPrice float64 `json:"settledPrice,omitempty"` OptionStrikePrice float64 `json:"optionStrikePrice,omitempty"` OptionUnderlyingPrice float64 `json:"optionUnderlyingPrice,omitempty"` Bankrupt int `json:"bankrupt,omitempty"` TaxBase int `json:"taxBase,omitempty"` TaxRate float64 `json:"taxRate,omitempty"` }
Historical Settlement Data
type SettlementApiService ¶
type SettlementApiService service
func (*SettlementApiService) SettlementGet ¶
func (a *SettlementApiService) SettlementGet(ctx context.Context, localVarOptionals *SettlementGetOpts) ([]Settlement, *http.Response, error)
type SettlementGetOpts ¶
type Stats ¶
type Stats struct { RootSymbol string `json:"rootSymbol"` Currency string `json:"currency,omitempty"` Volume24h int `json:"volume24h,omitempty"` Turnover24h int `json:"turnover24h,omitempty"` OpenInterest int `json:"openInterest,omitempty"` OpenValue int `json:"openValue,omitempty"` }
Exchange Statistics
type StatsApiService ¶
type StatsApiService service
func (*StatsApiService) StatsGet ¶
StatsApiService Get exchange-wide and per-series turnover and volume statistics.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []Stats
func (*StatsApiService) StatsHistory ¶
func (a *StatsApiService) StatsHistory(ctx context.Context) ([]StatsHistory, *http.Response, error)
StatsApiService Get historical exchange-wide and per-series turnover and volume statistics.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []StatsHistory
func (*StatsApiService) StatsHistoryUSD ¶
StatsApiService Get a summary of exchange statistics in USD.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []StatsUsd
type StatsHistory ¶
type Trade ¶
type Trade struct { Timestamp time.Time `json:"timestamp"` Symbol string `json:"symbol"` Side string `json:"side,omitempty"` Size int `json:"size,omitempty"` Price float64 `json:"price,omitempty"` TickDirection string `json:"tickDirection,omitempty"` TrdMatchID string `json:"trdMatchID,omitempty"` GrossValue int `json:"grossValue,omitempty"` HomeNotional float64 `json:"homeNotional,omitempty"` ForeignNotional float64 `json:"foreignNotional,omitempty"` }
Individual & Bucketed Trades
type TradeApiService ¶
type TradeApiService service
func (*TradeApiService) TradeGet ¶
func (a *TradeApiService) TradeGet(ctx context.Context, localVarOptionals *TradeGetOpts) ([]Trade, *http.Response, error)
func (*TradeApiService) TradeGetBucketed ¶
func (a *TradeApiService) TradeGetBucketed(ctx context.Context, localVarOptionals *TradeGetBucketedOpts) ([]TradeBin, *http.Response, error)
type TradeBin ¶
type TradeBin struct { Timestamp time.Time `json:"timestamp"` Symbol string `json:"symbol"` Open float64 `json:"open,omitempty"` High float64 `json:"high,omitempty"` Low float64 `json:"low,omitempty"` Close float64 `json:"close,omitempty"` Trades int `json:"trades,omitempty"` Volume int `json:"volume,omitempty"` Vwap float64 `json:"vwap,omitempty"` LastSize int `json:"lastSize,omitempty"` Turnover int `json:"turnover,omitempty"` HomeNotional float64 `json:"homeNotional,omitempty"` ForeignNotional float64 `json:"foreignNotional,omitempty"` }
type TradeGetBucketedOpts ¶
type TradeGetOpts ¶
type Transaction ¶
type Transaction struct { TransactID string `json:"transactID"` Account int `json:"account,omitempty"` Currency string `json:"currency,omitempty"` TransactType string `json:"transactType,omitempty"` Amount int `json:"amount,omitempty"` Fee int `json:"fee,omitempty"` WalletBalance int `json:"walletBalance,omitempty"` MarginBalance int `json:"marginBalance,omitempty"` TransactStatus string `json:"transactStatus,omitempty"` Address string `json:"address,omitempty"` Tx string `json:"tx,omitempty"` Text string `json:"text,omitempty"` TransactTime time.Time `json:"transactTime,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` }
type User ¶
type User struct { Id int `json:"id,omitempty"` OwnerId int `json:"ownerId,omitempty"` Firstname string `json:"firstname,omitempty"` Lastname string `json:"lastname,omitempty"` Username string `json:"username"` Email string `json:"email"` Phone string `json:"phone,omitempty"` Created time.Time `json:"created,omitempty"` LastUpdated time.Time `json:"lastUpdated,omitempty"` Preferences *UserPreferences `json:"preferences,omitempty"` TFAEnabled string `json:"TFAEnabled,omitempty"` AffiliateID string `json:"affiliateID,omitempty"` PgpPubKey string `json:"pgpPubKey,omitempty"` Country string `json:"country,omitempty"` GeoipCountry string `json:"geoipCountry,omitempty"` GeoipRegion string `json:"geoipRegion,omitempty"` Typ string `json:"typ,omitempty"` }
Account Operations
type UserApiService ¶
type UserApiService service
func (*UserApiService) UserCancelWithdrawal ¶
func (a *UserApiService) UserCancelWithdrawal(ctx context.Context, token string) (Transaction, *http.Response, error)
UserApiService Cancel a withdrawal.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param token
@return Transaction
func (*UserApiService) UserCheckReferralCode ¶
func (a *UserApiService) UserCheckReferralCode(ctx context.Context, localVarOptionals *UserCheckReferralCodeOpts) (float64, *http.Response, error)
func (*UserApiService) UserConfirm ¶
func (a *UserApiService) UserConfirm(ctx context.Context, token string) (AccessToken, *http.Response, error)
UserApiService Confirm your email address with a token.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param token
@return AccessToken
func (*UserApiService) UserConfirmEnableTFA ¶
func (a *UserApiService) UserConfirmEnableTFA(ctx context.Context, token string, localVarOptionals *UserConfirmEnableTFAOpts) (bool, *http.Response, error)
func (*UserApiService) UserConfirmWithdrawal ¶
func (a *UserApiService) UserConfirmWithdrawal(ctx context.Context, token string) (Transaction, *http.Response, error)
UserApiService Confirm a withdrawal.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param token
@return Transaction
func (*UserApiService) UserDisableTFA ¶
func (a *UserApiService) UserDisableTFA(ctx context.Context, token string, localVarOptionals *UserDisableTFAOpts) (bool, *http.Response, error)
func (*UserApiService) UserGet ¶
UserApiService Get your user model.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return User
func (*UserApiService) UserGetAffiliateStatus ¶
func (a *UserApiService) UserGetAffiliateStatus(ctx context.Context) (Affiliate, *http.Response, error)
UserApiService Get your current affiliate/referral status.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return Affiliate
func (*UserApiService) UserGetCommission ¶
func (a *UserApiService) UserGetCommission(ctx context.Context) ([]UserCommission, *http.Response, error)
UserApiService Get your account's commission status.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []UserCommission
func (*UserApiService) UserGetDepositAddress ¶
func (a *UserApiService) UserGetDepositAddress(ctx context.Context, localVarOptionals *UserGetDepositAddressOpts) (string, *http.Response, error)
func (*UserApiService) UserGetMargin ¶
func (a *UserApiService) UserGetMargin(ctx context.Context, localVarOptionals *UserGetMarginOpts) (Margin, *http.Response, error)
func (*UserApiService) UserGetWallet ¶
func (a *UserApiService) UserGetWallet(ctx context.Context, localVarOptionals *UserGetWalletOpts) (Wallet, *http.Response, error)
func (*UserApiService) UserGetWalletHistory ¶
func (a *UserApiService) UserGetWalletHistory(ctx context.Context, localVarOptionals *UserGetWalletHistoryOpts) ([]Transaction, *http.Response, error)
func (*UserApiService) UserGetWalletSummary ¶
func (a *UserApiService) UserGetWalletSummary(ctx context.Context, localVarOptionals *UserGetWalletSummaryOpts) ([]Transaction, *http.Response, error)
func (*UserApiService) UserLogout ¶
UserApiService Log out of BitMEX.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
func (*UserApiService) UserLogoutAll ¶
UserApiService Log all systems out of BitMEX. This will revoke all of your account's access tokens, logging you out on all devices.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return float64
func (*UserApiService) UserMinWithdrawalFee ¶
func (a *UserApiService) UserMinWithdrawalFee(ctx context.Context, localVarOptionals *UserMinWithdrawalFeeOpts) (UserWithdrawalFees, *http.Response, error)
func (*UserApiService) UserRequestEnableTFA ¶
func (a *UserApiService) UserRequestEnableTFA(ctx context.Context, localVarOptionals *UserRequestEnableTFAOpts) (bool, *http.Response, error)
func (*UserApiService) UserRequestWithdrawal ¶
func (a *UserApiService) UserRequestWithdrawal(ctx context.Context, currency string, amount int, address string, localVarOptionals *UserRequestWithdrawalOpts) (Transaction, *http.Response, error)
func (*UserApiService) UserSavePreferences ¶
func (a *UserApiService) UserSavePreferences(ctx context.Context, prefs string, localVarOptionals *UserSavePreferencesOpts) (User, *http.Response, error)
func (*UserApiService) UserUpdate ¶
func (a *UserApiService) UserUpdate(ctx context.Context, localVarOptionals *UserUpdateOpts) (User, *http.Response, error)
type UserCommission ¶
type UserDisableTFAOpts ¶
type UserGetMarginOpts ¶
type UserGetWalletOpts ¶
type UserPreferences ¶
type UserPreferences struct { AlertOnLiquidations bool `json:"alertOnLiquidations,omitempty"` AnimationsEnabled bool `json:"animationsEnabled,omitempty"` AnnouncementsLastSeen time.Time `json:"announcementsLastSeen,omitempty"` ChatChannelID float64 `json:"chatChannelID,omitempty"` ColorTheme string `json:"colorTheme,omitempty"` Currency string `json:"currency,omitempty"` Debug bool `json:"debug,omitempty"` DisableEmails []string `json:"disableEmails,omitempty"` HideConfirmDialogs []string `json:"hideConfirmDialogs,omitempty"` HideConnectionModal bool `json:"hideConnectionModal,omitempty"` HideFromLeaderboard bool `json:"hideFromLeaderboard,omitempty"` HideNameFromLeaderboard bool `json:"hideNameFromLeaderboard,omitempty"` HideNotifications []string `json:"hideNotifications,omitempty"` Locale string `json:"locale,omitempty"` MsgsSeen []string `json:"msgsSeen,omitempty"` OrderBookBinning *interface{} `json:"orderBookBinning,omitempty"` OrderBookType string `json:"orderBookType,omitempty"` OrderClearImmediate bool `json:"orderClearImmediate,omitempty"` OrderControlsPlusMinus bool `json:"orderControlsPlusMinus,omitempty"` ShowLocaleNumbers bool `json:"showLocaleNumbers,omitempty"` Sounds []string `json:"sounds,omitempty"` StrictIPCheck bool `json:"strictIPCheck,omitempty"` StrictTimeout bool `json:"strictTimeout,omitempty"` TickerGroup string `json:"tickerGroup,omitempty"` TickerPinned bool `json:"tickerPinned,omitempty"` TradeLayout string `json:"tradeLayout,omitempty"` }
type UserSavePreferencesOpts ¶
type UserUpdateOpts ¶
type UserWithdrawalFees ¶
type Wallet ¶
type Wallet struct { Account int `json:"account"` Currency string `json:"currency"` PrevDeposited int `json:"prevDeposited,omitempty"` PrevWithdrawn int `json:"prevWithdrawn,omitempty"` PrevTransferIn int `json:"prevTransferIn,omitempty"` PrevTransferOut int `json:"prevTransferOut,omitempty"` PrevAmount int `json:"prevAmount,omitempty"` PrevTimestamp time.Time `json:"prevTimestamp,omitempty"` DeltaDeposited int `json:"deltaDeposited,omitempty"` DeltaWithdrawn int `json:"deltaWithdrawn,omitempty"` DeltaTransferIn int `json:"deltaTransferIn,omitempty"` DeltaTransferOut int `json:"deltaTransferOut,omitempty"` DeltaAmount int `json:"deltaAmount,omitempty"` Deposited int `json:"deposited,omitempty"` Withdrawn int `json:"withdrawn,omitempty"` TransferIn int `json:"transferIn,omitempty"` TransferOut int `json:"transferOut,omitempty"` Amount int `json:"amount,omitempty"` PendingCredit int `json:"pendingCredit,omitempty"` PendingDebit int `json:"pendingDebit,omitempty"` ConfirmedDebit int `json:"confirmedDebit,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` Addr string `json:"addr,omitempty"` Script string `json:"script,omitempty"` WithdrawalLock []string `json:"withdrawalLock,omitempty"` }
Source Files ¶
- api_announcement.go
- api_api_key.go
- api_chat.go
- api_execution.go
- api_funding.go
- api_instrument.go
- api_insurance.go
- api_leaderboard.go
- api_liquidation.go
- api_notification.go
- api_order.go
- api_order_book.go
- api_position.go
- api_quote.go
- api_schema.go
- api_settlement.go
- api_stats.go
- api_trade.go
- api_user.go
- client.go
- configuration.go
- model_access_token.go
- model_affiliate.go
- model_announcement.go
- model_api_key.go
- model_chat.go
- model_chat_channel.go
- model_connected_users.go
- model_error.go
- model_error_error.go
- model_execution.go
- model_funding.go
- model_index_composite.go
- model_inline_response_200.go
- model_inline_response_200_1.go
- model_instrument.go
- model_instrument_interval.go
- model_insurance.go
- model_leaderboard.go
- model_liquidation.go
- model_margin.go
- model_notification.go
- model_order.go
- model_order_book_l2.go
- model_position.go
- model_quote.go
- model_settlement.go
- model_stats.go
- model_stats_history.go
- model_stats_usd.go
- model_trade.go
- model_trade_bin.go
- model_transaction.go
- model_user.go
- model_user_commission.go
- model_user_preferences.go
- model_user_withdrawal_fees.go
- model_wallet.go
- response.go