Documentation
¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- func CalSignature(apiSecret, payload string) string
- func DebugHttpRequest(r *http.Request)
- func SetAuthHeader(request *http.Request, apiKey APIKey, c *Configuration, ...)
- func Signature(apiSecret, method, rawurl, query, nonce, bodyStr string) string
- type APIClient
- type APIKey
- type APIKeyApiAPIKeyGetOpts
- type APIKeyApiService
- type APIResponse
- type AccessToken
- type Affiliate
- type Announcement
- type AnnouncementApiAnnouncementGetOpts
- type AnnouncementApiService
- type ApiKey
- type BasicAuth
- type Chat
- type ChatApiChatGetOpts
- type ChatApiChatNewOpts
- type ChatApiService
- func (a *ChatApiService) ChatGet(ctx context.Context, localVarOptionals *ChatApiChatGetOpts) ([]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 *ChatApiChatNewOpts) (Chat, *http.Response, error)
- type ChatChannel
- type CommunicationToken
- type Configuration
- type ConnectedUsers
- type ErrorError
- type Execution
- type ExecutionApiExecutionGetOpts
- type ExecutionApiExecutionGetTradeHistoryOpts
- type ExecutionApiService
- type Funding
- type FundingApiFundingGetOpts
- type FundingApiService
- type GenericSwaggerError
- type GlobalNotification
- type GlobalNotificationApiService
- type IndexComposite
- type InlineResponse200
- type Instrument
- type InstrumentApiInstrumentGetCompositeIndexOpts
- type InstrumentApiInstrumentGetOpts
- type InstrumentApiInstrumentGetUsdVolumeOpts
- type InstrumentApiService
- func (a *InstrumentApiService) InstrumentGet(ctx context.Context, localVarOptionals *InstrumentApiInstrumentGetOpts) ([]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, ...) ([]IndexComposite, *http.Response, error)
- func (a *InstrumentApiService) InstrumentGetIndices(ctx context.Context) ([]Instrument, *http.Response, error)
- func (a *InstrumentApiService) InstrumentGetUsdVolume(ctx context.Context, ...) ([]StatsUsdBySymbol, *http.Response, error)
- type InstrumentInterval
- type Insurance
- type InsuranceApiInsuranceGetOpts
- type InsuranceApiService
- type Leaderboard
- type LeaderboardApiLeaderboardGetOpts
- type LeaderboardApiService
- type Liquidation
- type LiquidationApiLiquidationGetOpts
- type LiquidationApiService
- type Margin
- type ModelError
- type Order
- type OrderApiOrderAmendOpts
- type OrderApiOrderCancelAllOpts
- type OrderApiOrderCancelOpts
- type OrderApiOrderClosePositionOpts
- type OrderApiOrderGetOrdersOpts
- type OrderApiOrderNewOpts
- type OrderApiService
- func (a *OrderApiService) OrderAmend(ctx context.Context, localVarOptionals *OrderApiOrderAmendOpts) (Order, *http.Response, error)
- func (a *OrderApiService) OrderCancel(ctx context.Context, localVarOptionals *OrderApiOrderCancelOpts) ([]Order, *http.Response, error)
- func (a *OrderApiService) OrderCancelAll(ctx context.Context, localVarOptionals *OrderApiOrderCancelAllOpts) ([]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, ...) (Order, *http.Response, error)
- func (a *OrderApiService) OrderGetOrders(ctx context.Context, localVarOptionals *OrderApiOrderGetOrdersOpts) ([]Order, *http.Response, error)
- func (a *OrderApiService) OrderNew(ctx context.Context, symbol string, localVarOptionals *OrderApiOrderNewOpts) (Order, *http.Response, error)
- type OrderBookApiOrderBookGetL2Opts
- type OrderBookApiService
- type OrderBookL2
- type Position
- type PositionApiPositionGetOpts
- type PositionApiPositionIsolateMarginOpts
- type PositionApiService
- func (a *PositionApiService) PositionGet(ctx context.Context, localVarOptionals *PositionApiPositionGetOpts) ([]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 float32) (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 float32) (Position, *http.Response, error)
- type Quote
- type QuoteApiQuoteGetBucketedOpts
- type QuoteApiQuoteGetOpts
- type QuoteApiService
- type QuoteFillRatio
- type QuoteValueRatio
- type SchemaApiSchemaGetOpts
- type SchemaApiService
- type Settlement
- type SettlementApiService
- type SettlementApiSettlementGetOpts
- type Stats
- type StatsApiService
- type StatsHistory
- type StatsUsd
- type StatsUsdBySymbol
- type Trade
- type TradeApiService
- type TradeApiTradeGetBucketedOpts
- type TradeApiTradeGetOpts
- type TradeBin
- type TradingVolume
- 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 *UserApiUserCheckReferralCodeOpts) (float64, *http.Response, error)
- func (a *UserApiService) UserCommunicationToken(ctx context.Context, token string, platformAgent string) ([]CommunicationToken, *http.Response, error)
- func (a *UserApiService) UserConfirm(ctx context.Context, token string) (AccessToken, *http.Response, error)
- func (a *UserApiService) UserConfirmWithdrawal(ctx context.Context, token string) (Transaction, *http.Response, error)
- func (a *UserApiService) UserGet(ctx context.Context) (User, *http.Response, error)
- func (a *UserApiService) UserGetAffiliateStatus(ctx context.Context, localVarOptionals *UserApiUserGetAffiliateStatusOpts) (Affiliate, *http.Response, error)
- func (a *UserApiService) UserGetCommission(ctx context.Context) (UserCommissionsBySymbol, *http.Response, error)
- func (a *UserApiService) UserGetDepositAddress(ctx context.Context, localVarOptionals *UserApiUserGetDepositAddressOpts) (string, *http.Response, error)
- func (a *UserApiService) UserGetExecutionHistory(ctx context.Context, symbol string, timestamp time.Time) (interface{}, *http.Response, error)
- func (a *UserApiService) UserGetMargin(ctx context.Context, localVarOptionals *UserApiUserGetMarginOpts) (Margin, *http.Response, error)
- func (a *UserApiService) UserGetQuoteFillRatio(ctx context.Context) (QuoteFillRatio, *http.Response, error)
- func (a *UserApiService) UserGetQuoteValueRatio(ctx context.Context) (QuoteValueRatio, *http.Response, error)
- func (a *UserApiService) UserGetTradingVolume(ctx context.Context) (TradingVolume, *http.Response, error)
- func (a *UserApiService) UserGetWallet(ctx context.Context, localVarOptionals *UserApiUserGetWalletOpts) (Wallet, *http.Response, error)
- func (a *UserApiService) UserGetWalletHistory(ctx context.Context, localVarOptionals *UserApiUserGetWalletHistoryOpts) ([]Transaction, *http.Response, error)
- func (a *UserApiService) UserGetWalletSummary(ctx context.Context, localVarOptionals *UserApiUserGetWalletSummaryOpts) ([]Transaction, *http.Response, error)
- func (a *UserApiService) UserLogout(ctx context.Context) (*http.Response, error)
- func (a *UserApiService) UserMinWithdrawalFee(ctx context.Context, localVarOptionals *UserApiUserMinWithdrawalFeeOpts) (interface{}, *http.Response, error)
- func (a *UserApiService) UserRequestWithdrawal(ctx context.Context, currency string, amount float32, ...) (Transaction, *http.Response, error)
- func (a *UserApiService) UserSavePreferences(ctx context.Context, prefs string, ...) (User, *http.Response, error)
- type UserApiUserCheckReferralCodeOpts
- type UserApiUserGetAffiliateStatusOpts
- type UserApiUserGetDepositAddressOpts
- type UserApiUserGetMarginOpts
- type UserApiUserGetWalletHistoryOpts
- type UserApiUserGetWalletOpts
- type UserApiUserGetWalletSummaryOpts
- type UserApiUserMinWithdrawalFeeOpts
- type UserApiUserRequestWithdrawalOpts
- type UserApiUserSavePreferencesOpts
- type UserCommissionsBySymbol
- type UserEvent
- type UserEventApiService
- type UserEventApiUserEventGetOpts
- type UserPreferences
- type Wallet
- type XAny
Constants ¶
This section is empty.
Variables ¶
var ( // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") )
Functions ¶
func CacheExpires ¶
CacheExpires helper function to determine remaining time before repeating a request.
func CalSignature ¶
func DebugHttpRequest ¶
Save a copy of this request for debugging.
func SetAuthHeader ¶
Types ¶
type APIClient ¶
type APIClient struct { APIKeyApi *APIKeyApiService AnnouncementApi *AnnouncementApiService ChatApi *ChatApiService ExecutionApi *ExecutionApiService FundingApi *FundingApiService GlobalNotificationApi *GlobalNotificationApiService InstrumentApi *InstrumentApiService InsuranceApi *InsuranceApiService LeaderboardApi *LeaderboardApiService LiquidationApi *LiquidationApiService OrderApi *OrderApiService OrderBookApi *OrderBookApiService PositionApi *PositionApiService QuoteApi *QuoteApiService SchemaApi *SchemaApiService SettlementApi *SettlementApiService StatsApi *StatsApiService TradeApi *TradeApiService UserApi *UserApiService UserEventApi *UserEventApiService // contains filtered or unexported fields }
APIClient manages communication with the BitMEX API API v1.0.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 APIKeyApiAPIKeyGetOpts ¶
type APIKeyApiService ¶
type APIKeyApiService service
func (*APIKeyApiService) APIKeyGet ¶
func (a *APIKeyApiService) APIKeyGet(ctx context.Context, localVarOptionals *APIKeyApiAPIKeyGetOpts) ([]ApiKey, *http.Response, error)
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 Announcement ¶
type Announcement struct { Id float32 `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 *AnnouncementApiAnnouncementGetOpts) ([]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 ApiKey ¶
type ApiKey struct { Id string `json:"id"` Secret string `json:"secret"` Name string `json:"name"` Nonce float32 `json:"nonce"` Cidr string `json:"cidr,omitempty"` Permissions []XAny `json:"permissions,omitempty"` Enabled bool `json:"enabled,omitempty"` UserId float32 `json:"userId"` Created time.Time `json:"created,omitempty"` }
Persistent API Keys for Developers
type BasicAuth ¶
type BasicAuth struct { UserName string `json:"userName,omitempty"` Password string `json:"password,omitempty"` }
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type Chat ¶
type Chat struct { Id float32 `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 float64 `json:"channelID,omitempty"` }
Trollbox Data
type ChatApiChatGetOpts ¶
type ChatApiChatNewOpts ¶
type ChatApiService ¶
type ChatApiService service
func (*ChatApiService) ChatGet ¶
func (a *ChatApiService) ChatGet(ctx context.Context, localVarOptionals *ChatApiChatGetOpts) ([]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 CommunicationToken ¶
type CommunicationToken struct { Id string `json:"id"` UserId float32 `json:"userId"` DeviceToken string `json:"deviceToken"` Channel string `json:"channel"` }
User communication SNS token
type Configuration ¶
type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` Scheme string `json:"scheme,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` HTTPClient *http.Client ExpireTime int64 }
func NewConfiguration ¶
func NewConfiguration() *Configuration
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
type ConnectedUsers ¶
type ErrorError ¶
type Execution ¶
type Execution struct { ExecID string `json:"execID,omitempty"` OrderID string `json:"orderID,omitempty"` ClOrdID string `json:"clOrdID,omitempty"` ClOrdLinkID string `json:"clOrdLinkID,omitempty"` Account float32 `json:"account,omitempty"` Symbol string `json:"symbol"` Side string `json:"side,omitempty"` LastQty float32 `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 float32 `json:"orderQty,omitempty"` Price float64 `json:"price,omitempty"` DisplayQty float32 `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 float32 `json:"leavesQty,omitempty"` SimpleCumQty float64 `json:"simpleCumQty,omitempty"` CumQty float32 `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 float32 `json:"execCost,omitempty"` ExecComm float32 `json:"execComm,omitempty"` HomeNotional float64 `json:"homeNotional,omitempty"` ForeignNotional float64 `json:"foreignNotional,omitempty"` TransactTime time.Time `json:"transactTime,omitempty"` Timestamp time.Time `json:"timestamp"` }
Raw Order and Balance Data
type ExecutionApiService ¶
type ExecutionApiService service
func (*ExecutionApiService) ExecutionGet ¶
func (a *ExecutionApiService) ExecutionGet(ctx context.Context, localVarOptionals *ExecutionApiExecutionGetOpts) ([]Execution, *http.Response, error)
func (*ExecutionApiService) ExecutionGetTradeHistory ¶
func (a *ExecutionApiService) ExecutionGetTradeHistory(ctx context.Context, localVarOptionals *ExecutionApiExecutionGetTradeHistoryOpts) ([]Execution, *http.Response, error)
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 *FundingApiFundingGetOpts) ([]Funding, *http.Response, error)
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 GlobalNotification ¶
type GlobalNotification struct { Id float32 `json:"id,omitempty"` Date time.Time `json:"date"` Title string `json:"title"` Body string `json:"body"` Ttl float32 `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 GlobalNotificationApiService ¶
type GlobalNotificationApiService service
func (*GlobalNotificationApiService) GlobalNotificationGet ¶
func (a *GlobalNotificationApiService) GlobalNotificationGet(ctx context.Context) ([]GlobalNotification, *http.Response, error)
GlobalNotificationApiService Get your current GlobalNotifications. 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 []GlobalNotification
type IndexComposite ¶
type IndexComposite struct { Timestamp time.Time `json:"timestamp"` Symbol string `json:"symbol,omitempty"` IndexSymbol string `json:"indexSymbol,omitempty"` IndexMultiplier float64 `json:"indexMultiplier,omitempty"` Reference string `json:"reference,omitempty"` LastPrice float64 `json:"lastPrice,omitempty"` SourcePrice float64 `json:"sourcePrice,omitempty"` ConversionIndex string `json:"conversionIndex,omitempty"` ConversionIndexPrice float64 `json:"conversionIndexPrice,omitempty"` Weight float64 `json:"weight,omitempty"` Logged time.Time `json:"logged,omitempty"` }
type InlineResponse200 ¶
type InlineResponse200 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"` ListedSettle time.Time `json:"listedSettle,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 float32 `json:"maxOrderQty,omitempty"` MaxPrice float64 `json:"maxPrice,omitempty"` LotSize float32 `json:"lotSize,omitempty"` TickSize float64 `json:"tickSize,omitempty"` Multiplier float32 `json:"multiplier,omitempty"` SettlCurrency string `json:"settlCurrency,omitempty"` UnderlyingToPositionMultiplier float32 `json:"underlyingToPositionMultiplier,omitempty"` UnderlyingToSettleMultiplier float32 `json:"underlyingToSettleMultiplier,omitempty"` QuoteToSettleMultiplier float32 `json:"quoteToSettleMultiplier,omitempty"` IsQuanto bool `json:"isQuanto,omitempty"` IsInverse bool `json:"isInverse,omitempty"` InitMargin float64 `json:"initMargin,omitempty"` MaintMargin float64 `json:"maintMargin,omitempty"` RiskLimit float32 `json:"riskLimit,omitempty"` RiskStep float32 `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 float32 `json:"prevTotalVolume,omitempty"` TotalVolume float32 `json:"totalVolume,omitempty"` Volume float32 `json:"volume,omitempty"` Volume24h float32 `json:"volume24h,omitempty"` PrevTotalTurnover float32 `json:"prevTotalTurnover,omitempty"` TotalTurnover float32 `json:"totalTurnover,omitempty"` Turnover float32 `json:"turnover,omitempty"` Turnover24h float32 `json:"turnover24h,omitempty"` HomeNotional24h float64 `json:"homeNotional24h,omitempty"` ForeignNotional24h float64 `json:"foreignNotional24h,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 float32 `json:"openInterest,omitempty"` OpenValue float32 `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"` SettledPriceAdjustmentRate float64 `json:"settledPriceAdjustmentRate,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 *InstrumentApiInstrumentGetOpts) ([]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:quarterly\", \"XBT:biquarterly\", \"ETH:quarterly\", ...]`. 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 *InstrumentApiInstrumentGetCompositeIndexOpts) ([]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
func (*InstrumentApiService) InstrumentGetUsdVolume ¶
func (a *InstrumentApiService) InstrumentGetUsdVolume(ctx context.Context, localVarOptionals *InstrumentApiInstrumentGetUsdVolumeOpts) ([]StatsUsdBySymbol, *http.Response, error)
type InstrumentInterval ¶
type Insurance ¶
type Insurance struct { Currency string `json:"currency"` Timestamp time.Time `json:"timestamp"` WalletBalance float32 `json:"walletBalance,omitempty"` }
Insurance Fund Data
type InsuranceApiService ¶
type InsuranceApiService service
func (*InsuranceApiService) InsuranceGet ¶
func (a *InsuranceApiService) InsuranceGet(ctx context.Context, localVarOptionals *InsuranceApiInsuranceGetOpts) ([]Insurance, *http.Response, error)
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 *LeaderboardApiLeaderboardGetOpts) ([]Leaderboard, *http.Response, error)
func (*LeaderboardApiService) LeaderboardGetName ¶
func (a *LeaderboardApiService) LeaderboardGetName(ctx context.Context) (InlineResponse200, *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 InlineResponse200
type LiquidationApiService ¶
type LiquidationApiService service
func (*LiquidationApiService) LiquidationGet ¶
func (a *LiquidationApiService) LiquidationGet(ctx context.Context, localVarOptionals *LiquidationApiLiquidationGetOpts) ([]Liquidation, *http.Response, error)
type Margin ¶
type Margin struct { Account float32 `json:"account"` Currency string `json:"currency"` RiskLimit float32 `json:"riskLimit,omitempty"` PrevState string `json:"prevState,omitempty"` State string `json:"state,omitempty"` Action string `json:"action,omitempty"` Amount float32 `json:"amount,omitempty"` PendingCredit float32 `json:"pendingCredit,omitempty"` PendingDebit float32 `json:"pendingDebit,omitempty"` ConfirmedDebit float32 `json:"confirmedDebit,omitempty"` PrevRealisedPnl float32 `json:"prevRealisedPnl,omitempty"` PrevUnrealisedPnl float32 `json:"prevUnrealisedPnl,omitempty"` GrossComm float32 `json:"grossComm,omitempty"` GrossOpenCost float32 `json:"grossOpenCost,omitempty"` GrossOpenPremium float32 `json:"grossOpenPremium,omitempty"` GrossExecCost float32 `json:"grossExecCost,omitempty"` GrossMarkValue float32 `json:"grossMarkValue,omitempty"` RiskValue float32 `json:"riskValue,omitempty"` TaxableMargin float32 `json:"taxableMargin,omitempty"` InitMargin float32 `json:"initMargin,omitempty"` MaintMargin float32 `json:"maintMargin,omitempty"` SessionMargin float32 `json:"sessionMargin,omitempty"` TargetExcessMargin float32 `json:"targetExcessMargin,omitempty"` VarMargin float32 `json:"varMargin,omitempty"` RealisedPnl float32 `json:"realisedPnl,omitempty"` UnrealisedPnl float32 `json:"unrealisedPnl,omitempty"` IndicativeTax float32 `json:"indicativeTax,omitempty"` UnrealisedProfit float32 `json:"unrealisedProfit,omitempty"` SyntheticMargin float32 `json:"syntheticMargin,omitempty"` WalletBalance float32 `json:"walletBalance,omitempty"` MarginBalance float32 `json:"marginBalance,omitempty"` MarginBalancePcnt float64 `json:"marginBalancePcnt,omitempty"` MarginLeverage float64 `json:"marginLeverage,omitempty"` MarginUsedPcnt float64 `json:"marginUsedPcnt,omitempty"` ExcessMargin float32 `json:"excessMargin,omitempty"` ExcessMarginPcnt float64 `json:"excessMarginPcnt,omitempty"` AvailableMargin float32 `json:"availableMargin,omitempty"` WithdrawableMargin float32 `json:"withdrawableMargin,omitempty"` GrossLastValue float32 `json:"grossLastValue,omitempty"` Commission float64 `json:"commission,omitempty"` MakerFeeDiscount float64 `json:"makerFeeDiscount,omitempty"` TakerFeeDiscount float64 `json:"takerFeeDiscount,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` }
type ModelError ¶
type ModelError struct {
Error_ *ErrorError `json:"error"`
}
type Order ¶
type Order struct { OrderID string `json:"orderID"` ClOrdID string `json:"clOrdID,omitempty"` ClOrdLinkID string `json:"clOrdLinkID,omitempty"` Account float32 `json:"account,omitempty"` Symbol string `json:"symbol,omitempty"` Side string `json:"side,omitempty"` SimpleOrderQty float64 `json:"simpleOrderQty,omitempty"` OrderQty float32 `json:"orderQty,omitempty"` Price float64 `json:"price,omitempty"` DisplayQty float32 `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 float32 `json:"leavesQty,omitempty"` SimpleCumQty float64 `json:"simpleCumQty,omitempty"` CumQty float32 `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 OrderApiOrderAmendOpts ¶
type OrderApiOrderAmendOpts struct { OrderID optional.String OrigClOrdID optional.String ClOrdID optional.String SimpleOrderQty optional.Float64 OrderQty optional.Float32 SimpleLeavesQty optional.Float64 LeavesQty optional.Float32 Price optional.Float64 StopPx optional.Float64 PegOffsetValue optional.Float64 Text optional.String }
type OrderApiOrderCancelOpts ¶
type OrderApiOrderNewOpts ¶
type OrderApiOrderNewOpts struct { Side optional.String SimpleOrderQty optional.Float64 OrderQty optional.Float32 Price optional.Float64 DisplayQty optional.Float32 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 OrderApiService ¶
type OrderApiService service
func (*OrderApiService) OrderAmend ¶
func (a *OrderApiService) OrderAmend(ctx context.Context, localVarOptionals *OrderApiOrderAmendOpts) (Order, *http.Response, error)
func (*OrderApiService) OrderCancel ¶
func (a *OrderApiService) OrderCancel(ctx context.Context, localVarOptionals *OrderApiOrderCancelOpts) ([]Order, *http.Response, error)
func (*OrderApiService) OrderCancelAll ¶
func (a *OrderApiService) OrderCancelAll(ctx context.Context, localVarOptionals *OrderApiOrderCancelAllOpts) ([]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 *OrderApiOrderClosePositionOpts) (Order, *http.Response, error)
func (*OrderApiService) OrderGetOrders ¶
func (a *OrderApiService) OrderGetOrders(ctx context.Context, localVarOptionals *OrderApiOrderGetOrdersOpts) ([]Order, *http.Response, error)
type OrderBookApiService ¶
type OrderBookApiService service
func (*OrderBookApiService) OrderBookGetL2 ¶
func (a *OrderBookApiService) OrderBookGetL2(ctx context.Context, symbol string, localVarOptionals *OrderBookApiOrderBookGetL2Opts) ([]OrderBookL2, *http.Response, error)
type OrderBookL2 ¶
type Position ¶
type Position struct { Account float32 `json:"account"` Symbol string `json:"symbol"` Currency string `json:"currency,omitempty"` 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 float32 `json:"riskLimit,omitempty"` Leverage float64 `json:"leverage,omitempty"` CrossMargin bool `json:"crossMargin,omitempty"` DeleveragePercentile float64 `json:"deleveragePercentile,omitempty"` RebalancedPnl float32 `json:"rebalancedPnl,omitempty"` PrevRealisedPnl float32 `json:"prevRealisedPnl,omitempty"` PrevUnrealisedPnl float32 `json:"prevUnrealisedPnl,omitempty"` PrevClosePrice float64 `json:"prevClosePrice,omitempty"` OpeningTimestamp time.Time `json:"openingTimestamp,omitempty"` OpeningQty float32 `json:"openingQty,omitempty"` OpeningCost float32 `json:"openingCost,omitempty"` OpeningComm float32 `json:"openingComm,omitempty"` OpenOrderBuyQty float32 `json:"openOrderBuyQty,omitempty"` OpenOrderBuyCost float32 `json:"openOrderBuyCost,omitempty"` OpenOrderBuyPremium float32 `json:"openOrderBuyPremium,omitempty"` OpenOrderSellQty float32 `json:"openOrderSellQty,omitempty"` OpenOrderSellCost float32 `json:"openOrderSellCost,omitempty"` OpenOrderSellPremium float32 `json:"openOrderSellPremium,omitempty"` ExecBuyQty float32 `json:"execBuyQty,omitempty"` ExecBuyCost float32 `json:"execBuyCost,omitempty"` ExecSellQty float32 `json:"execSellQty,omitempty"` ExecSellCost float32 `json:"execSellCost,omitempty"` ExecQty float32 `json:"execQty,omitempty"` ExecCost float32 `json:"execCost,omitempty"` ExecComm float32 `json:"execComm,omitempty"` CurrentTimestamp time.Time `json:"currentTimestamp,omitempty"` CurrentQty float32 `json:"currentQty,omitempty"` CurrentCost float32 `json:"currentCost,omitempty"` CurrentComm float32 `json:"currentComm,omitempty"` RealisedCost float32 `json:"realisedCost,omitempty"` UnrealisedCost float32 `json:"unrealisedCost,omitempty"` GrossOpenCost float32 `json:"grossOpenCost,omitempty"` GrossOpenPremium float32 `json:"grossOpenPremium,omitempty"` GrossExecCost float32 `json:"grossExecCost,omitempty"` IsOpen bool `json:"isOpen,omitempty"` MarkPrice float64 `json:"markPrice,omitempty"` MarkValue float32 `json:"markValue,omitempty"` RiskValue float32 `json:"riskValue,omitempty"` HomeNotional float64 `json:"homeNotional,omitempty"` ForeignNotional float64 `json:"foreignNotional,omitempty"` PosState string `json:"posState,omitempty"` PosCost float32 `json:"posCost,omitempty"` PosCost2 float32 `json:"posCost2,omitempty"` PosCross float32 `json:"posCross,omitempty"` PosInit float32 `json:"posInit,omitempty"` PosComm float32 `json:"posComm,omitempty"` PosLoss float32 `json:"posLoss,omitempty"` PosMargin float32 `json:"posMargin,omitempty"` PosMaint float32 `json:"posMaint,omitempty"` PosAllowance float32 `json:"posAllowance,omitempty"` TaxableMargin float32 `json:"taxableMargin,omitempty"` InitMargin float32 `json:"initMargin,omitempty"` MaintMargin float32 `json:"maintMargin,omitempty"` SessionMargin float32 `json:"sessionMargin,omitempty"` TargetExcessMargin float32 `json:"targetExcessMargin,omitempty"` VarMargin float32 `json:"varMargin,omitempty"` RealisedGrossPnl float32 `json:"realisedGrossPnl,omitempty"` RealisedTax float32 `json:"realisedTax,omitempty"` RealisedPnl float32 `json:"realisedPnl,omitempty"` UnrealisedGrossPnl float32 `json:"unrealisedGrossPnl,omitempty"` LongBankrupt float32 `json:"longBankrupt,omitempty"` ShortBankrupt float32 `json:"shortBankrupt,omitempty"` TaxBase float32 `json:"taxBase,omitempty"` IndicativeTaxRate float64 `json:"indicativeTaxRate,omitempty"` IndicativeTax float32 `json:"indicativeTax,omitempty"` UnrealisedTax float32 `json:"unrealisedTax,omitempty"` UnrealisedPnl float32 `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 float32 `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 *PositionApiPositionGetOpts) ([]Position, *http.Response, error)
func (*PositionApiService) PositionIsolateMargin ¶
func (a *PositionApiService) PositionIsolateMargin(ctx context.Context, symbol string, localVarOptionals *PositionApiPositionIsolateMarginOpts) (Position, *http.Response, error)
func (*PositionApiService) PositionTransferIsolatedMargin ¶
func (a *PositionApiService) PositionTransferIsolatedMargin(ctx context.Context, symbol string, amount float32) (Position, *http.Response, error)
PositionApiService Transfer equity in or out of a position. When margin is isolated on a position, use this function to add or remove margin from the position. Note that you cannot remove margin below the initial margin threshold.
- @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. Users can choose an isolated leverage. This will automatically enable isolated margin.
- @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 float32) (Position, *http.Response, error)
PositionApiService Update your risk limit. Risk Limits limit the size of positions you can trade at various margin levels. Larger positions require more margin. Please see the Risk Limit documentation for more details.
- @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 Quote ¶
type Quote struct { Timestamp time.Time `json:"timestamp"` Symbol string `json:"symbol"` BidSize float32 `json:"bidSize,omitempty"` BidPrice float64 `json:"bidPrice,omitempty"` AskPrice float64 `json:"askPrice,omitempty"` AskSize float32 `json:"askSize,omitempty"` }
Best Bid/Offer Snapshots & Historical Bins
type QuoteApiQuoteGetOpts ¶
type QuoteApiService ¶
type QuoteApiService service
func (*QuoteApiService) QuoteGet ¶
func (a *QuoteApiService) QuoteGet(ctx context.Context, localVarOptionals *QuoteApiQuoteGetOpts) ([]Quote, *http.Response, error)
func (*QuoteApiService) QuoteGetBucketed ¶
func (a *QuoteApiService) QuoteGetBucketed(ctx context.Context, localVarOptionals *QuoteApiQuoteGetBucketedOpts) ([]Quote, *http.Response, error)
type QuoteFillRatio ¶
type QuoteFillRatio struct { Date time.Time `json:"date"` Account float64 `json:"account,omitempty"` QuoteCount float64 `json:"quoteCount,omitempty"` DealtCount float64 `json:"dealtCount,omitempty"` QuotesMavg7 float64 `json:"quotesMavg7,omitempty"` DealtMavg7 float64 `json:"dealtMavg7,omitempty"` QuoteFillRatioMavg7 float64 `json:"quoteFillRatioMavg7,omitempty"` }
Daily Quote Fill Ratio Statistic
type QuoteValueRatio ¶
type QuoteValueRatio struct { Timestamp time.Time `json:"timestamp,omitempty"` Account float64 `json:"account,omitempty"` Symbol string `json:"symbol,omitempty"` QuoteCount float64 `json:"quoteCount,omitempty"` VolumeXBT float64 `json:"volumeXBT,omitempty"` QVR float64 `json:"QVR,omitempty"` Id float64 `json:"id,omitempty"` }
Hourly Quote Value Ratio Statistic
type SchemaApiSchemaGetOpts ¶
type SchemaApiService ¶
type SchemaApiService service
func (*SchemaApiService) SchemaGet ¶
func (a *SchemaApiService) SchemaGet(ctx context.Context, localVarOptionals *SchemaApiSchemaGetOpts) (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 Settlement ¶
type Settlement struct {
Id float64 `json:"id,omitempty"`
}
Historical Settlement Data
type SettlementApiService ¶
type SettlementApiService service
func (*SettlementApiService) SettlementGet ¶
func (a *SettlementApiService) SettlementGet(ctx context.Context, localVarOptionals *SettlementApiSettlementGetOpts) ([]Settlement, *http.Response, error)
type Stats ¶
type Stats struct { RootSymbol string `json:"rootSymbol"` Currency string `json:"currency,omitempty"` Volume24h float32 `json:"volume24h,omitempty"` Turnover24h float32 `json:"turnover24h,omitempty"` OpenInterest float32 `json:"openInterest,omitempty"` OpenValue float32 `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 StatsUsd ¶
type StatsUsd struct { RootSymbol string `json:"rootSymbol"` Currency string `json:"currency,omitempty"` Turnover24h float32 `json:"turnover24h,omitempty"` Turnover30d float32 `json:"turnover30d,omitempty"` Turnover365d float32 `json:"turnover365d,omitempty"` Turnover float32 `json:"turnover,omitempty"` }
type StatsUsdBySymbol ¶
type StatsUsdBySymbol struct { Symbol string `json:"symbol"` Currency string `json:"currency,omitempty"` Turnover24h float32 `json:"turnover24h,omitempty"` Turnover30d float32 `json:"turnover30d,omitempty"` Turnover365d float32 `json:"turnover365d,omitempty"` Turnover float32 `json:"turnover,omitempty"` }
type Trade ¶
type Trade struct { Timestamp time.Time `json:"timestamp"` Symbol string `json:"symbol"` Side string `json:"side,omitempty"` Size float32 `json:"size,omitempty"` Price float64 `json:"price,omitempty"` TickDirection string `json:"tickDirection,omitempty"` TrdMatchID string `json:"trdMatchID,omitempty"` GrossValue float32 `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 *TradeApiTradeGetOpts) ([]Trade, *http.Response, error)
func (*TradeApiService) TradeGetBucketed ¶
func (a *TradeApiService) TradeGetBucketed(ctx context.Context, localVarOptionals *TradeApiTradeGetBucketedOpts) ([]TradeBin, *http.Response, error)
type TradeApiTradeGetOpts ¶
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 float32 `json:"trades,omitempty"` Volume float32 `json:"volume,omitempty"` Vwap float64 `json:"vwap,omitempty"` LastSize float32 `json:"lastSize,omitempty"` Turnover float32 `json:"turnover,omitempty"` HomeNotional float64 `json:"homeNotional,omitempty"` ForeignNotional float64 `json:"foreignNotional,omitempty"` }
type TradingVolume ¶
type TradingVolume struct {
AdvUsd float64 `json:"advUsd"`
}
30 days USD average trading volume
type Transaction ¶
type Transaction struct { TransactID string `json:"transactID"` Account float32 `json:"account,omitempty"` Currency string `json:"currency,omitempty"` TransactType string `json:"transactType,omitempty"` Amount float32 `json:"amount,omitempty"` Fee float32 `json:"fee,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 float32 `json:"id,omitempty"` OwnerId float32 `json:"ownerId,omitempty"` Firstname string `json:"firstname,omitempty"` Lastname string `json:"lastname,omitempty"` Username string `json:"username"` Email string `json:"email,omitempty"` 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"` PgpPubKeyCreated time.Time `json:"pgpPubKeyCreated,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 *UserApiUserCheckReferralCodeOpts) (float64, *http.Response, error)
func (*UserApiService) UserCommunicationToken ¶
func (a *UserApiService) UserCommunicationToken(ctx context.Context, token string, platformAgent string) ([]CommunicationToken, *http.Response, error)
UserApiService Register your communication token for mobile clients
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param token
- @param platformAgent
@return []CommunicationToken
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) 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) 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, localVarOptionals *UserApiUserGetAffiliateStatusOpts) (Affiliate, *http.Response, error)
func (*UserApiService) UserGetCommission ¶
func (a *UserApiService) UserGetCommission(ctx context.Context) (UserCommissionsBySymbol, *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 UserCommissionsBySymbol
func (*UserApiService) UserGetDepositAddress ¶
func (a *UserApiService) UserGetDepositAddress(ctx context.Context, localVarOptionals *UserApiUserGetDepositAddressOpts) (string, *http.Response, error)
func (*UserApiService) UserGetExecutionHistory ¶
func (a *UserApiService) UserGetExecutionHistory(ctx context.Context, symbol string, timestamp time.Time) (interface{}, *http.Response, error)
UserApiService Get the execution history by day.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param symbol
- @param timestamp
@return interface{}
func (*UserApiService) UserGetMargin ¶
func (a *UserApiService) UserGetMargin(ctx context.Context, localVarOptionals *UserApiUserGetMarginOpts) (Margin, *http.Response, error)
func (*UserApiService) UserGetQuoteFillRatio ¶
func (a *UserApiService) UserGetQuoteFillRatio(ctx context.Context) (QuoteFillRatio, *http.Response, error)
UserApiService Get 7 days worth of Quote Fill Ratio statistics.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return QuoteFillRatio
func (*UserApiService) UserGetQuoteValueRatio ¶
func (a *UserApiService) UserGetQuoteValueRatio(ctx context.Context) (QuoteValueRatio, *http.Response, error)
UserApiService Get Quote Value Ratio statistics over the last 3 days
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return QuoteValueRatio
func (*UserApiService) UserGetTradingVolume ¶
func (a *UserApiService) UserGetTradingVolume(ctx context.Context) (TradingVolume, *http.Response, error)
UserApiService Get your 30 days USD average trading volume
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return TradingVolume
func (*UserApiService) UserGetWallet ¶
func (a *UserApiService) UserGetWallet(ctx context.Context, localVarOptionals *UserApiUserGetWalletOpts) (Wallet, *http.Response, error)
func (*UserApiService) UserGetWalletHistory ¶
func (a *UserApiService) UserGetWalletHistory(ctx context.Context, localVarOptionals *UserApiUserGetWalletHistoryOpts) ([]Transaction, *http.Response, error)
func (*UserApiService) UserGetWalletSummary ¶
func (a *UserApiService) UserGetWalletSummary(ctx context.Context, localVarOptionals *UserApiUserGetWalletSummaryOpts) ([]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) UserMinWithdrawalFee ¶
func (a *UserApiService) UserMinWithdrawalFee(ctx context.Context, localVarOptionals *UserApiUserMinWithdrawalFeeOpts) (interface{}, *http.Response, error)
func (*UserApiService) UserRequestWithdrawal ¶
func (a *UserApiService) UserRequestWithdrawal(ctx context.Context, currency string, amount float32, localVarOptionals *UserApiUserRequestWithdrawalOpts) (Transaction, *http.Response, error)
func (*UserApiService) UserSavePreferences ¶
func (a *UserApiService) UserSavePreferences(ctx context.Context, prefs string, localVarOptionals *UserApiUserSavePreferencesOpts) (User, *http.Response, error)
type UserCommissionsBySymbol ¶
type UserCommissionsBySymbol struct { }
type UserEvent ¶
type UserEvent struct { Id float64 `json:"id,omitempty"` Type_ string `json:"type"` Status string `json:"status"` UserId float64 `json:"userId"` CreatedById float64 `json:"createdById"` Ip string `json:"ip,omitempty"` GeoipCountry string `json:"geoipCountry,omitempty"` GeoipRegion string `json:"geoipRegion,omitempty"` GeoipSubRegion string `json:"geoipSubRegion,omitempty"` EventMeta interface{} `json:"eventMeta,omitempty"` Created time.Time `json:"created"` }
User Events for Auditing
type UserEventApiService ¶
type UserEventApiService service
func (*UserEventApiService) UserEventGet ¶
func (a *UserEventApiService) UserEventGet(ctx context.Context, localVarOptionals *UserEventApiUserEventGetOpts) ([]UserEvent, *http.Response, error)
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"` DisablePush []string `json:"disablePush,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"` HidePhoneConfirm bool `json:"hidePhoneConfirm,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 Wallet ¶
type Wallet struct { Account float32 `json:"account"` Currency string `json:"currency"` PrevDeposited float32 `json:"prevDeposited,omitempty"` PrevWithdrawn float32 `json:"prevWithdrawn,omitempty"` PrevTransferIn float32 `json:"prevTransferIn,omitempty"` PrevTransferOut float32 `json:"prevTransferOut,omitempty"` PrevAmount float32 `json:"prevAmount,omitempty"` PrevTimestamp time.Time `json:"prevTimestamp,omitempty"` DeltaDeposited float32 `json:"deltaDeposited,omitempty"` DeltaWithdrawn float32 `json:"deltaWithdrawn,omitempty"` DeltaTransferIn float32 `json:"deltaTransferIn,omitempty"` DeltaTransferOut float32 `json:"deltaTransferOut,omitempty"` DeltaAmount float32 `json:"deltaAmount,omitempty"` Deposited float32 `json:"deposited,omitempty"` Withdrawn float32 `json:"withdrawn,omitempty"` TransferIn float32 `json:"transferIn,omitempty"` TransferOut float32 `json:"transferOut,omitempty"` Amount float32 `json:"amount,omitempty"` PendingCredit float32 `json:"pendingCredit,omitempty"` PendingDebit float32 `json:"pendingDebit,omitempty"` ConfirmedDebit float32 `json:"confirmedDebit,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` }
Source Files
¶
- api_announcement.go
- api_api_key.go
- api_chat.go
- api_execution.go
- api_funding.go
- api_global_notification.go
- api_instrument.go
- api_insurance.go
- api_leaderboard.go
- api_liquidation.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
- api_user_event.go
- auth_util.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_communication_token.go
- model_connected_users.go
- model_error.go
- model_error_error.go
- model_execution.go
- model_funding.go
- model_global_notification.go
- model_index_composite.go
- model_inline_response_200.go
- model_instrument.go
- model_instrument_interval.go
- model_insurance.go
- model_leaderboard.go
- model_liquidation.go
- model_margin.go
- model_order.go
- model_order_book_l2.go
- model_position.go
- model_quote.go
- model_quote_fill_ratio.go
- model_quote_value_ratio.go
- model_settlement.go
- model_stats.go
- model_stats_history.go
- model_stats_usd.go
- model_stats_usd_by_symbol.go
- model_trade.go
- model_trade_bin.go
- model_trading_volume.go
- model_transaction.go
- model_user.go
- model_user_commissions_by_symbol.go
- model_user_event.go
- model_user_preferences.go
- model_wallet.go
- model_x_any.go
- response.go