bitmex

package
v0.0.0-...-4c12c4a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2019 License: MIT Imports: 23 Imported by: 0

README

GoCryptoTrader package Bitmex

Build Status Software License GoDoc Coverage Status Go Report Card

This bitmex package is part of the GoCryptoTrader codebase.

This is still in active development

You can track ideas, planned features and what's in progresss on this Trello board: https://trello.com/b/ZAhMhpOy/gocryptotrader.

Join our slack to discuss all things related to GoCryptoTrader! GoCryptoTrader Slack

Bithumb Exchange

Current Features
  • REST Support
How to enable
  // Exchanges will be abstracted out in further updates and examples will be
  // supplied then
How to do REST public/private calls
  • If enabled via "configuration".json file the exchange will be added to the IBotExchange array in the go var bot Bot and you will only be able to use the wrapper interface functions for accessing exchange data. View routines.go for an example of integration usage with GoCryptoTrader. Rudimentary example below:

main.go

var b exchange.IBotExchange

for i := range bot.exchanges {
  if bot.exchanges[i].GetName() == "Bitmex" {
    b = bot.exchanges[i]
  }
}

// Public calls - wrapper functions

// Fetches current ticker information
tick, err := b.GetTickerPrice()
if err != nil {
  // Handle error
}

// Fetches current orderbook information
ob, err := b.GetOrderbookEx()
if err != nil {
  // Handle error
}

// Private calls - wrapper functions - make sure your APIKEY and APISECRET are
// set and AuthenticatedAPISupport is set to true

// Fetches current account information
accountInfo, err := b.GetAccountInfo()
if err != nil {
  // Handle error
}
  • If enabled via individually importing package, rudimentary example below:
// Public calls

// Fetches current ticker information
ticker, err := b.GetTicker()
if err != nil {
  // Handle error
}

// Fetches current orderbook information
ob, err := b.GetOrderBook()
if err != nil {
  // Handle error
}

// Private calls - make sure your APIKEY and APISECRET are set and
// AuthenticatedAPISupport is set to true

// GetUserInfo returns account info
accountInfo, err := b.GetUserInfo(...)
if err != nil {
  // Handle error
}

// Submits an order and the exchange and returns its tradeID
tradeID, err := b.Trade(...)
if err != nil {
  // Handle error
}
Please click GoDocs chevron above to view current GoDoc information for this package

Contribution

Please feel free to submit any pull requests or suggest any desired features to be added.

When submitting a PR, please abide by our coding guidelines:

  • Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
  • Code must be documented adhering to the official Go commentary guidelines.
  • Code must adhere to our coding style.
  • Pull requests need to be based on and opened against the master branch.

Donations

If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to:

1F5zVDgNjorJ51oGebSvNCrSAHpwGkUdDB

Documentation

Index

Constants

View Source
const (

	// ContractPerpetual perpetual contract type
	ContractPerpetual = iota
	// ContractFutures futures contract type
	ContractFutures
	// ContractDownsideProfit downside profit contract type
	ContractDownsideProfit
	// ContractUpsideProfit upside profit contract type
	ContractUpsideProfit
)

Variables

This section is empty.

Functions

func StructValsToURLVals

func StructValsToURLVals(v interface{}) (url.Values, error)

StructValsToURLVals converts a struct into url.values for easy encoding can set json tags for outgoing naming conventions.

Types

type APIKey

type APIKey struct {
	Cidr        string        `json:"cidr"`
	Created     string        `json:"created"`
	Enabled     bool          `json:"enabled"`
	ID          string        `json:"id"`
	Name        string        `json:"name"`
	Nonce       int64         `json:"nonce"`
	Permissions []interface{} `json:"permissions"`
	Secret      string        `json:"secret"`
	UserID      int32         `json:"userId"`
}

APIKey Persistent API Keys for Developers

type APIKeyParams

type APIKeyParams struct {
	// API Key ID (public component).
	APIKeyID string `json:"apiKeyID,omitempty"`
}

APIKeyParams contains all the parameters to send to the API endpoint

func (*APIKeyParams) IsNil

func (p *APIKeyParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (*APIKeyParams) ToURLVals

func (p *APIKeyParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (*APIKeyParams) VerifyData

func (p *APIKeyParams) VerifyData() error

VerifyData verifies outgoing data sets

type AffiliateStatus

type AffiliateStatus struct {
	Account         int64   `json:"account"`
	Currency        string  `json:"currency"`
	ExecComm        int64   `json:"execComm"`
	ExecTurnover    int64   `json:"execTurnover"`
	PayoutPcnt      float64 `json:"payoutPcnt"`
	PendingPayout   int64   `json:"pendingPayout"`
	PrevComm        int64   `json:"prevComm"`
	PrevPayout      int64   `json:"prevPayout"`
	PrevTimestamp   string  `json:"prevTimestamp"`
	PrevTurnover    int64   `json:"prevTurnover"`
	ReferrerAccount float64 `json:"referrerAccount"`
	Timestamp       string  `json:"timestamp"`
	TotalComm       int64   `json:"totalComm"`
	TotalReferrals  int64   `json:"totalReferrals"`
	TotalTurnover   int64   `json:"totalTurnover"`
}

AffiliateStatus affiliate Status details

type Alias

type Alias struct {
	Name string `json:"name"`
}

Alias Name refers to Trollbox client name

type Announcement

type Announcement struct {
	Content string `json:"content"`
	Date    string `json:"date"`
	ID      int32  `json:"id"`
	Link    string `json:"link"`
	Title   string `json:"title"`
}

Announcement General Announcements

type AnnouncementData

type AnnouncementData struct {
	Data   []Announcement `json:"data"`
	Action string         `json:"action"`
}

AnnouncementData contains announcement resp data with action to be taken

type Bitmex

type Bitmex struct {
	exchange.Base
	WebsocketConn *wshandler.WebsocketConnection
}

Bitmex is the overarching type across this package

func (*Bitmex) AmendBulkOrders

func (b *Bitmex) AmendBulkOrders(params OrderAmendBulkParams) ([]Order, error)

AmendBulkOrders amends multiple orders for the same symbol

func (*Bitmex) AmendOrder

func (b *Bitmex) AmendOrder(params *OrderAmendParams) (Order, error)

AmendOrder amends the quantity or price of an open order

func (*Bitmex) AuthenticateWebsocket

func (b *Bitmex) AuthenticateWebsocket() error

AuthenticateWebsocket sends an authentication message to the websocket

func (*Bitmex) CancelAllExistingOrders

func (b *Bitmex) CancelAllExistingOrders(params OrderCancelAllParams) ([]Order, error)

CancelAllExistingOrders cancels all open orders on the exchange

func (*Bitmex) CancelAllOrders

CancelAllOrders cancels all orders associated with a currency pair

func (*Bitmex) CancelAllOrdersAfterTime

func (b *Bitmex) CancelAllOrdersAfterTime(params OrderCancelAllAfterParams) ([]Order, error)

CancelAllOrdersAfterTime closes all positions after a certain time period

func (*Bitmex) CancelOrder

func (b *Bitmex) CancelOrder(order *exchange.OrderCancellation) error

CancelOrder cancels an order by its corresponding ID number

func (*Bitmex) CancelOrders

func (b *Bitmex) CancelOrders(params *OrderCancelParams) ([]Order, error)

CancelOrders cancels one or a batch of orders on the exchange and returns a cancelled order list

func (*Bitmex) CancelWithdraw

func (b *Bitmex) CancelWithdraw(token string) (TransactionInfo, error)

CancelWithdraw cancels a current withdrawal

func (*Bitmex) CaptureError

func (b *Bitmex) CaptureError(resp, reType interface{}) error

CaptureError little hack that captures an error

func (*Bitmex) CheckReferalCode

func (b *Bitmex) CheckReferalCode(referralCode string) (float64, error)

CheckReferalCode checks a code, will return a percentage eg 0.1 for 10% or if err a 404

func (*Bitmex) ClosePosition

func (b *Bitmex) ClosePosition(params OrderClosePositionParams) ([]Order, error)

ClosePosition closes a position WARNING deprecated use /order endpoint

func (*Bitmex) ConfirmEmail

func (b *Bitmex) ConfirmEmail(token string) (ConfirmEmail, error)

ConfirmEmail confirms email address with a token

func (*Bitmex) ConfirmTwoFactorAuth

func (b *Bitmex) ConfirmTwoFactorAuth(token, typ string) (bool, error)

ConfirmTwoFactorAuth confirms 2FA for this account.

func (*Bitmex) ConfirmWithdrawal

func (b *Bitmex) ConfirmWithdrawal(token string) (TransactionInfo, error)

ConfirmWithdrawal confirms a withdrawal

func (*Bitmex) CreateBulkOrders

func (b *Bitmex) CreateBulkOrders(params OrderNewBulkParams) ([]Order, error)

CreateBulkOrders creates multiple orders for the same symbol

func (*Bitmex) CreateOrder

func (b *Bitmex) CreateOrder(params *OrderNewParams) (Order, error)

CreateOrder creates a new order

func (*Bitmex) DisableAPIKey

func (b *Bitmex) DisableAPIKey(params APIKeyParams) (APIKey, error)

DisableAPIKey disables an Apikey from the bitmex trading engine

func (*Bitmex) DisableTFA

func (b *Bitmex) DisableTFA(token, typ string) (bool, error)

DisableTFA dsiables 2 factor authentication for your account

func (*Bitmex) EnableAPIKey

func (b *Bitmex) EnableAPIKey(params APIKeyParams) (APIKey, error)

EnableAPIKey enables an Apikey from the bitmex trading engine

func (*Bitmex) EnableTFA

func (b *Bitmex) EnableTFA(typ string) (bool, error)

EnableTFA enables 2 factor authentication

func (*Bitmex) GenerateAuthenticatedSubscriptions

func (b *Bitmex) GenerateAuthenticatedSubscriptions()

GenerateAuthenticatedSubscriptions Adds authenticated subscriptions to websocket to be handled by ManageSubscriptions()

func (*Bitmex) GenerateDefaultSubscriptions

func (b *Bitmex) GenerateDefaultSubscriptions()

GenerateDefaultSubscriptions Adds default subscriptions to websocket to be handled by ManageSubscriptions()

func (*Bitmex) GetAPIKeys

func (b *Bitmex) GetAPIKeys() ([]APIKey, error)

GetAPIKeys returns the APIkeys from bitmex

func (*Bitmex) GetAccountExecutionTradeHistory

func (b *Bitmex) GetAccountExecutionTradeHistory(params *GenericRequestParams) ([]Execution, error)

GetAccountExecutionTradeHistory returns all balance-affecting executions. This includes each trade, insurance charge, and settlement.

func (*Bitmex) GetAccountExecutions

func (b *Bitmex) GetAccountExecutions(params *GenericRequestParams) ([]Execution, error)

GetAccountExecutions returns all raw transactions, which includes order opening and cancelation, and order status changes. It can be quite noisy. More focused information is available at /execution/tradeHistory.

func (*Bitmex) GetAccountInfo

func (b *Bitmex) GetAccountInfo() (exchange.AccountInfo, error)

GetAccountInfo retrieves balances for all enabled currencies for the Bitmex exchange

func (*Bitmex) GetActiveAndIndexInstruments

func (b *Bitmex) GetActiveAndIndexInstruments() ([]Instrument, error)

GetActiveAndIndexInstruments returns all active instruments and all indices

func (*Bitmex) GetActiveInstruments

func (b *Bitmex) GetActiveInstruments(params *GenericRequestParams) ([]Instrument, error)

GetActiveInstruments returns active instruments

func (*Bitmex) GetActiveIntervals

func (b *Bitmex) GetActiveIntervals() (InstrumentInterval, error)

GetActiveIntervals returns funding history

func (*Bitmex) GetActiveOrders

func (b *Bitmex) GetActiveOrders(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)

GetActiveOrders retrieves any orders that are active/open This function is not concurrency safe due to orderSide/orderType maps

func (*Bitmex) GetAffiliateStatus

func (b *Bitmex) GetAffiliateStatus() (AffiliateStatus, error)

GetAffiliateStatus returns your affiliate status

func (*Bitmex) GetAliasOnLeaderboard

func (b *Bitmex) GetAliasOnLeaderboard() (Alias, error)

GetAliasOnLeaderboard returns your alias on the leaderboard

func (*Bitmex) GetAllUserMargin

func (b *Bitmex) GetAllUserMargin() ([]UserMargin, error)

GetAllUserMargin returns user margin information

func (*Bitmex) GetAnnouncement

func (b *Bitmex) GetAnnouncement() ([]Announcement, error)

GetAnnouncement returns the general announcements from Bitmex

func (*Bitmex) GetCompositeIndex

func (b *Bitmex) GetCompositeIndex(params *GenericRequestParams) ([]IndexComposite, error)

GetCompositeIndex returns composite index

func (*Bitmex) GetCryptoDepositAddress

func (b *Bitmex) GetCryptoDepositAddress(cryptoCurrency string) (string, error)

GetCryptoDepositAddress returns a deposit address for a cryptocurency

func (*Bitmex) GetCurrentNotifications

func (b *Bitmex) GetCurrentNotifications() ([]Notification, error)

GetCurrentNotifications returns your current notifications

func (*Bitmex) GetDepositAddress

func (b *Bitmex) GetDepositAddress(cryptocurrency currency.Code, _ string) (string, error)

GetDepositAddress returns a deposit address for a specified currency

func (*Bitmex) GetExchangeHistory

func (b *Bitmex) GetExchangeHistory(p currency.Pair, assetType string) ([]exchange.TradeHistory, error)

GetExchangeHistory returns historic trade data since exchange opening.

func (*Bitmex) GetFee

func (b *Bitmex) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)

GetFee returns an estimate of fee based on type of transaction

func (*Bitmex) GetFeeByType

func (b *Bitmex) GetFeeByType(feeBuilder *exchange.FeeBuilder) (float64, error)

GetFeeByType returns an estimate of fee based on type of transaction

func (*Bitmex) GetFullFundingHistory

func (b *Bitmex) GetFullFundingHistory() ([]Funding, error)

GetFullFundingHistory returns funding history

func (*Bitmex) GetFundingHistory

func (b *Bitmex) GetFundingHistory() ([]exchange.FundHistory, error)

GetFundingHistory returns funding history, deposits and withdrawals

func (*Bitmex) GetIndices

func (b *Bitmex) GetIndices() ([]Instrument, error)

GetIndices returns all price indices

func (*Bitmex) GetInstruments

func (b *Bitmex) GetInstruments(params *GenericRequestParams) ([]Instrument, error)

GetInstruments returns instrument data

func (*Bitmex) GetInsuranceFundHistory

func (b *Bitmex) GetInsuranceFundHistory(params *GenericRequestParams) ([]Insurance, error)

GetInsuranceFundHistory returns insurance fund history

func (*Bitmex) GetLeaderboard

func (b *Bitmex) GetLeaderboard(params LeaderboardGetParams) ([]Leaderboard, error)

GetLeaderboard returns leaderboard information

func (*Bitmex) GetLiquidationOrders

func (b *Bitmex) GetLiquidationOrders(params *GenericRequestParams) ([]Liquidation, error)

GetLiquidationOrders returns liquidation orders

func (*Bitmex) GetMinimumWithdrawalFee

func (b *Bitmex) GetMinimumWithdrawalFee(currency string) (MinWithdrawalFee, error)

GetMinimumWithdrawalFee returns minimum withdrawal fee information

func (*Bitmex) GetOrderHistory

func (b *Bitmex) GetOrderHistory(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)

GetOrderHistory retrieves account order information Can Limit response to specific order status This function is not concurrency safe due to orderSide/orderType maps

func (*Bitmex) GetOrderInfo

func (b *Bitmex) GetOrderInfo(orderID string) (exchange.OrderDetail, error)

GetOrderInfo returns information on a current open order

func (*Bitmex) GetOrderbook

func (b *Bitmex) GetOrderbook(params OrderBookGetL2Params) ([]OrderBookL2, error)

GetOrderbook returns layer two orderbook data

func (*Bitmex) GetOrderbookEx

func (b *Bitmex) GetOrderbookEx(currency currency.Pair, assetType string) (orderbook.Base, error)

GetOrderbookEx returns orderbook base on the currency pair

func (*Bitmex) GetOrders

func (b *Bitmex) GetOrders(params *OrdersRequest) ([]Order, error)

GetOrders returns all the orders, open and closed

func (*Bitmex) GetPositions

func (b *Bitmex) GetPositions(params PositionGetParams) ([]Position, error)

GetPositions returns positions

func (*Bitmex) GetPreviousTrades

func (b *Bitmex) GetPreviousTrades(params *TradeGetBucketedParams) ([]Trade, error)

GetPreviousTrades previous trade history in time buckets

func (*Bitmex) GetQuotes

func (b *Bitmex) GetQuotes(params *GenericRequestParams) ([]Quote, error)

GetQuotes returns quotations

func (*Bitmex) GetQuotesByBuckets

func (b *Bitmex) GetQuotesByBuckets(params *QuoteGetBucketedParams) ([]Quote, error)

GetQuotesByBuckets returns previous quotes in time buckets

func (*Bitmex) GetSettlementHistory

func (b *Bitmex) GetSettlementHistory(params *GenericRequestParams) ([]Settlement, error)

GetSettlementHistory returns settlement history

func (*Bitmex) GetStatSummary

func (b *Bitmex) GetStatSummary() ([]StatsUSD, error)

GetStatSummary returns the stats summary in USD terms

func (*Bitmex) GetStats

func (b *Bitmex) GetStats() ([]Stats, error)

GetStats returns exchange wide per series turnover and volume statistics

func (*Bitmex) GetStatsHistorical

func (b *Bitmex) GetStatsHistorical() ([]StatsHistory, error)

GetStatsHistorical historic stats

func (*Bitmex) GetSubscriptions

func (b *Bitmex) GetSubscriptions() ([]wshandler.WebsocketChannelSubscription, error)

GetSubscriptions returns a copied list of subscriptions

func (*Bitmex) GetTickerPrice

func (b *Bitmex) GetTickerPrice(p currency.Pair, assetType string) (ticker.Price, error)

GetTickerPrice returns the ticker for a currency pair

func (*Bitmex) GetTrade

func (b *Bitmex) GetTrade(params *GenericRequestParams) ([]Trade, error)

GetTrade returns executed trades on the desk

func (*Bitmex) GetTrollboxChannels

func (b *Bitmex) GetTrollboxChannels() ([]ChatChannel, error)

GetTrollboxChannels the channels from the the bitmex trollbox

func (*Bitmex) GetTrollboxConnectedUsers

func (b *Bitmex) GetTrollboxConnectedUsers() (ConnectedUsers, error)

GetTrollboxConnectedUsers the channels from the the bitmex trollbox

func (*Bitmex) GetTrollboxMessages

func (b *Bitmex) GetTrollboxMessages(params ChatGetParams) ([]Chat, error)

GetTrollboxMessages returns messages from the bitmex trollbox

func (*Bitmex) GetUrgentAnnouncement

func (b *Bitmex) GetUrgentAnnouncement() ([]Announcement, error)

GetUrgentAnnouncement returns an urgent announcement for your account

func (*Bitmex) GetUserCommision

func (b *Bitmex) GetUserCommision() (UserCommission, error)

GetUserCommision returns your account's commission status.

func (*Bitmex) GetUserInfo

func (b *Bitmex) GetUserInfo() (User, error)

GetUserInfo returns your user information

func (*Bitmex) GetUserMargin

func (b *Bitmex) GetUserMargin(currency string) (UserMargin, error)

GetUserMargin returns user margin information

func (*Bitmex) GetUserPreferences

func (b *Bitmex) GetUserPreferences(params UserPreferencesParams) (User, error)

GetUserPreferences returns user preferences

func (*Bitmex) GetWalletHistory

func (b *Bitmex) GetWalletHistory(currency string) ([]TransactionInfo, error)

GetWalletHistory returns user wallet history transaction data

func (*Bitmex) GetWalletInfo

func (b *Bitmex) GetWalletInfo(currency string) (WalletInfo, error)

GetWalletInfo returns user wallet information

func (*Bitmex) GetWalletSummary

func (b *Bitmex) GetWalletSummary(currency string) ([]TransactionInfo, error)

GetWalletSummary returns user wallet summary

func (*Bitmex) GetWebsocket

func (b *Bitmex) GetWebsocket() (*wshandler.Websocket, error)

GetWebsocket returns a pointer to the exchange websocket

func (*Bitmex) IsolatePosition

func (b *Bitmex) IsolatePosition(params PositionIsolateMarginParams) (Position, error)

IsolatePosition enables isolated margin or cross margin per-position

func (*Bitmex) LeveragePosition

func (b *Bitmex) LeveragePosition(params PositionUpdateLeverageParams) (Position, error)

LeveragePosition chooses leverage for a position

func (*Bitmex) ModifyOrder

func (b *Bitmex) ModifyOrder(action *exchange.ModifyOrder) (string, error)

ModifyOrder will allow of changing orderbook placement and limit to market conversion

func (*Bitmex) RemoveAPIKey

func (b *Bitmex) RemoveAPIKey(params APIKeyParams) (bool, error)

RemoveAPIKey removes an Apikey from the bitmex trading engine

func (*Bitmex) Run

func (b *Bitmex) Run()

Run implements the Bitmex wrapper

func (*Bitmex) SendAuthenticatedHTTPRequest

func (b *Bitmex) SendAuthenticatedHTTPRequest(verb, path string, params Parameter, result interface{}) error

SendAuthenticatedHTTPRequest sends an authenticated HTTP request to bitmex

func (*Bitmex) SendHTTPRequest

func (b *Bitmex) SendHTTPRequest(path string, params Parameter, result interface{}) error

SendHTTPRequest sends an unauthenticated HTTP request

func (*Bitmex) SendTrollboxMessage

func (b *Bitmex) SendTrollboxMessage(params ChatSendParams) ([]Chat, error)

SendTrollboxMessage sends a message to the bitmex trollbox

func (*Bitmex) SetDefaults

func (b *Bitmex) SetDefaults()

SetDefaults sets the basic defaults for Bitmex

func (*Bitmex) Setup

func (b *Bitmex) Setup(exch *config.ExchangeConfig)

Setup takes in the supplied exchange configuration details and sets params

func (*Bitmex) Start

func (b *Bitmex) Start(wg *sync.WaitGroup)

Start starts the Bitmex go routine

func (*Bitmex) SubmitOrder

func (b *Bitmex) SubmitOrder(p currency.Pair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, _ string) (exchange.SubmitOrderResponse, error)

SubmitOrder submits a new order

func (*Bitmex) Subscribe

func (b *Bitmex) Subscribe(channelToSubscribe wshandler.WebsocketChannelSubscription) error

Subscribe subscribes to a websocket channel

func (*Bitmex) SubscribeToWebsocketChannels

func (b *Bitmex) SubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error

SubscribeToWebsocketChannels appends to ChannelsToSubscribe which lets websocket.manageSubscriptions handle subscribing

func (*Bitmex) TransferMargin

func (b *Bitmex) TransferMargin(params PositionTransferIsolatedMarginParams) (Position, error)

TransferMargin transfers equity in or out of a position

func (*Bitmex) Unsubscribe

func (b *Bitmex) Unsubscribe(channelToSubscribe wshandler.WebsocketChannelSubscription) error

Unsubscribe sends a websocket message to stop receiving data from the channel

func (*Bitmex) UnsubscribeToWebsocketChannels

func (b *Bitmex) UnsubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error

UnsubscribeToWebsocketChannels removes from ChannelsToSubscribe which lets websocket.manageSubscriptions handle unsubscribing

func (*Bitmex) UpdateOrderbook

func (b *Bitmex) UpdateOrderbook(p currency.Pair, assetType string) (orderbook.Base, error)

UpdateOrderbook updates and returns the orderbook for a currency pair

func (*Bitmex) UpdateRiskLimit

func (b *Bitmex) UpdateRiskLimit(params PositionUpdateRiskLimitParams) (Position, error)

UpdateRiskLimit updates risk limit on a position

func (*Bitmex) UpdateTicker

func (b *Bitmex) UpdateTicker(p currency.Pair, assetType string) (ticker.Price, error)

UpdateTicker updates and returns the ticker for a currency pair

func (*Bitmex) UpdateUserInfo

func (b *Bitmex) UpdateUserInfo(params *UserUpdateParams) (User, error)

UpdateUserInfo updates user information

func (*Bitmex) UserLogOut

func (b *Bitmex) UserLogOut() error

UserLogOut logs you out of BitMEX

func (*Bitmex) UserLogOutAll

func (b *Bitmex) UserLogOutAll() (int64, error)

UserLogOutAll logs you out of all systems for BitMEX

func (*Bitmex) UserRequestWithdrawal

func (b *Bitmex) UserRequestWithdrawal(params UserRequestWithdrawalParams) (TransactionInfo, error)

UserRequestWithdrawal This will send a confirmation email to the email address on record, unless requested via an API Key with the withdraw permission.

func (*Bitmex) WithdrawCryptocurrencyFunds

func (b *Bitmex) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)

WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted

func (*Bitmex) WithdrawFiatFunds

func (b *Bitmex) WithdrawFiatFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)

WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted

func (*Bitmex) WithdrawFiatFundsToInternationalBank

func (b *Bitmex) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.WithdrawRequest) (string, error)

WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted

func (*Bitmex) WsConnector

func (b *Bitmex) WsConnector() error

WsConnector initiates a new websocket connection

type Chat

type Chat struct {
	ChannelID float64 `json:"channelID"`
	Date      string  `json:"date"`
	FromBot   bool    `json:"fromBot"`
	HTML      string  `json:"html"`
	ID        int32   `json:"id"`
	Message   string  `json:"message"`
	User      string  `json:"user"`
}

Chat Trollbox Data

type ChatChannel

type ChatChannel struct {
	ID   int32  `json:"id"`
	Name string `json:"name"`
}

ChatChannel chat channel

type ChatGetParams

type ChatGetParams struct {
	// ChannelID - [Optional] Leave blank for all.
	ChannelID float64 `json:"channelID,omitempty"`

	// Count - [Optional] Number of results to fetch.
	Count int32 `json:"count,omitempty"`

	// Reverse - [Optional] If true, will sort results newest first.
	Reverse bool `json:"reverse,omitempty"`

	// Start - [Optional] Starting ID for results.
	Start int32 `json:"start,omitempty"`
}

ChatGetParams contains all the parameters to send to the API endpoint

func (*ChatGetParams) IsNil

func (p *ChatGetParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (*ChatGetParams) ToURLVals

func (p *ChatGetParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (*ChatGetParams) VerifyData

func (p *ChatGetParams) VerifyData() error

VerifyData verifies outgoing data sets

type ChatSendParams

type ChatSendParams struct {
	// ChannelID - Channel to post to. Default 1 (English).
	ChannelID float64 `json:"channelID,omitempty"`

	// Message to send
	Message string `json:"message,omitempty"`
}

ChatSendParams contains all the parameters to send to the API endpoint

func (*ChatSendParams) IsNil

func (p *ChatSendParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (ChatSendParams) ToURLVals

func (p ChatSendParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (ChatSendParams) VerifyData

func (p ChatSendParams) VerifyData() error

VerifyData verifies outgoing data sets

type ConfirmEmail

type ConfirmEmail struct {
	ID      string `json:"id"`
	TTL     int64  `json:"ttl"`
	Created string `json:"created"`
	UserID  int64  `json:"userId"`
}

ConfirmEmail confirmatin email endpoint data

type ConnectedUsers

type ConnectedUsers struct {
	Bots  int32 `json:"bots"`
	Users int32 `json:"users"`
}

ConnectedUsers connected users

type Execution

type Execution struct {
	Account               int64   `json:"account"`
	AvgPx                 float64 `json:"avgPx"`
	ClOrdID               string  `json:"clOrdID"`
	ClOrdLinkID           string  `json:"clOrdLinkID"`
	Commission            float64 `json:"commission"`
	ContingencyType       string  `json:"contingencyType"`
	CumQty                int64   `json:"cumQty"`
	Currency              string  `json:"currency"`
	DisplayQty            int64   `json:"displayQty"`
	ExDestination         string  `json:"exDestination"`
	ExecComm              int64   `json:"execComm"`
	ExecCost              int64   `json:"execCost"`
	ExecID                string  `json:"execID"`
	ExecInst              string  `json:"execInst"`
	ExecType              string  `json:"execType"`
	ForeignNotional       float64 `json:"foreignNotional"`
	HomeNotional          float64 `json:"homeNotional"`
	LastLiquidityInd      string  `json:"lastLiquidityInd"`
	LastMkt               string  `json:"lastMkt"`
	LastPx                float64 `json:"lastPx"`
	LastQty               int64   `json:"lastQty"`
	LeavesQty             int64   `json:"leavesQty"`
	MultiLegReportingType string  `json:"multiLegReportingType"`
	OrdRejReason          string  `json:"ordRejReason"`
	OrdStatus             string  `json:"ordStatus"`
	OrdType               string  `json:"ordType"`
	OrderID               string  `json:"orderID"`
	OrderQty              int64   `json:"orderQty"`
	PegOffsetValue        float64 `json:"pegOffsetValue"`
	PegPriceType          string  `json:"pegPriceType"`
	Price                 float64 `json:"price"`
	SettlCurrency         string  `json:"settlCurrency"`
	Side                  string  `json:"side"`
	SimpleCumQty          float64 `json:"simpleCumQty"`
	SimpleLeavesQty       float64 `json:"simpleLeavesQty"`
	SimpleOrderQty        float64 `json:"simpleOrderQty"`
	StopPx                float64 `json:"stopPx"`
	Symbol                string  `json:"symbol"`
	Text                  string  `json:"text"`
	TimeInForce           string  `json:"timeInForce"`
	Timestamp             string  `json:"timestamp"`
	TradePublishIndicator string  `json:"tradePublishIndicator"`
	TransactTime          string  `json:"transactTime"`
	TrdMatchID            string  `json:"trdMatchID"`
	Triggered             string  `json:"triggered"`
	UnderlyingLastPx      float64 `json:"underlyingLastPx"`
	WorkingIndicator      bool    `json:"workingIndicator"`
}

Execution Raw Order and Balance Data

type Funding

type Funding struct {
	FundingInterval  string  `json:"fundingInterval"`
	FundingRate      float64 `json:"fundingRate"`
	FundingRateDaily float64 `json:"fundingRateDaily"`
	Symbol           string  `json:"symbol"`
	Timestamp        string  `json:"timestamp"`
}

Funding Swap Funding History

type GenericRequestParams

type GenericRequestParams struct {
	// Columns - [Optional] Array of column names to fetch. If omitted, will
	// return all columns.
	// NOTE that this method will always return item keys, even when not
	// specified, so you may receive more columns that you expect.
	Columns string `json:"columns,omitempty"`

	// Count - Number of results to fetch.
	Count int32 `json:"count,omitempty"`

	// EndTime - Ending date filter for results.
	EndTime string `json:"endTime,omitempty"`

	// Filter - Generic table filter. Send JSON key/value pairs, such as
	// `{"key": "value"}`. You can key on individual fields, and do more advanced
	// querying on timestamps. See the
	// [Timestamp Docs](https://testnet.bitmex.com/app/restAPI#Timestamp-Filters)
	// for more details.
	Filter string `json:"filter,omitempty"`

	// Reverse - If true, will sort results newest first.
	Reverse bool `json:"reverse,omitempty"`

	// Start - Starting point for results.
	Start int32 `json:"start,omitempty"`

	// StartTime - Starting date filter for results.
	StartTime string `json:"startTime,omitempty"`

	// Symbol - Instrument symbol. Send a bare series (e.g. XBU) to get data for
	// the nearest expiring contract in that series.
	// You can also send a timeframe, e.g. `XBU:monthly`. Timeframes are `daily`,
	// `weekly`, `monthly`, `quarterly`, and `biquarterly`.
	Symbol string `json:"symbol,omitempty"`
}

GenericRequestParams contains all the parameters for some general functions

func (*GenericRequestParams) IsNil

func (p *GenericRequestParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (*GenericRequestParams) ToURLVals

func (p *GenericRequestParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (*GenericRequestParams) VerifyData

func (p *GenericRequestParams) VerifyData() error

VerifyData verifies outgoing data sets

type IndexComposite

type IndexComposite struct {
	IndexSymbol string  `json:"indexSymbol"`
	LastPrice   float64 `json:"lastPrice"`
	Logged      string  `json:"logged"`
	Reference   string  `json:"reference"`
	Symbol      string  `json:"symbol"`
	Timestamp   string  `json:"timestamp"`
	Weight      float64 `json:"weight"`
}

IndexComposite index composite

type Instrument

type Instrument struct {
	AskPrice                       float64 `json:"askPrice"`
	BankruptLimitDownPrice         float64 `json:"bankruptLimitDownPrice"`
	BankruptLimitUpPrice           float64 `json:"bankruptLimitUpPrice"`
	BidPrice                       float64 `json:"bidPrice"`
	BuyLeg                         string  `json:"buyLeg"`
	CalcInterval                   string  `json:"calcInterval"`
	Capped                         bool    `json:"capped"`
	ClosingTimestamp               string  `json:"closingTimestamp"`
	Deleverage                     bool    `json:"deleverage"`
	Expiry                         string  `json:"expiry"`
	FairBasis                      float64 `json:"fairBasis"`
	FairBasisRate                  float64 `json:"fairBasisRate"`
	FairMethod                     string  `json:"fairMethod"`
	FairPrice                      float64 `json:"fairPrice"`
	Front                          string  `json:"front"`
	FundingBaseSymbol              string  `json:"fundingBaseSymbol"`
	FundingInterval                string  `json:"fundingInterval"`
	FundingPremiumSymbol           string  `json:"fundingPremiumSymbol"`
	FundingQuoteSymbol             string  `json:"fundingQuoteSymbol"`
	FundingRate                    float64 `json:"fundingRate"`
	FundingTimestamp               string  `json:"fundingTimestamp"`
	HasLiquidity                   bool    `json:"hasLiquidity"`
	HighPrice                      float64 `json:"highPrice"`
	ImpactAskPrice                 float64 `json:"impactAskPrice"`
	ImpactBidPrice                 float64 `json:"impactBidPrice"`
	ImpactMidPrice                 float64 `json:"impactMidPrice"`
	IndicativeFundingRate          float64 `json:"indicativeFundingRate"`
	IndicativeSettlePrice          float64 `json:"indicativeSettlePrice"`
	IndicativeTaxRate              float64 `json:"indicativeTaxRate"`
	InitMargin                     float64 `json:"initMargin"`
	InsuranceFee                   float64 `json:"insuranceFee"`
	InverseLeg                     string  `json:"inverseLeg"`
	IsInverse                      bool    `json:"isInverse"`
	IsQuanto                       bool    `json:"isQuanto"`
	LastChangePcnt                 float64 `json:"lastChangePcnt"`
	LastPrice                      float64 `json:"lastPrice"`
	LastPriceProtected             float64 `json:"lastPriceProtected"`
	LastTickDirection              string  `json:"lastTickDirection"`
	Limit                          float64 `json:"limit"`
	LimitDownPrice                 float64 `json:"limitDownPrice"`
	LimitUpPrice                   float64 `json:"limitUpPrice"`
	Listing                        string  `json:"listing"`
	LotSize                        int64   `json:"lotSize"`
	LowPrice                       float64 `json:"lowPrice"`
	MaintMargin                    float64 `json:"maintMargin"`
	MakerFee                       float64 `json:"makerFee"`
	MarkMethod                     string  `json:"markMethod"`
	MarkPrice                      float64 `json:"markPrice"`
	MaxOrderQty                    int64   `json:"maxOrderQty"`
	MaxPrice                       float64 `json:"maxPrice"`
	MidPrice                       float64 `json:"midPrice"`
	Multiplier                     int64   `json:"multiplier"`
	OpenInterest                   int64   `json:"openInterest"`
	OpenValue                      int64   `json:"openValue"`
	OpeningTimestamp               string  `json:"openingTimestamp"`
	OptionMultiplier               float64 `json:"optionMultiplier"`
	OptionStrikePcnt               float64 `json:"optionStrikePcnt"`
	OptionStrikePrice              float64 `json:"optionStrikePrice"`
	OptionStrikeRound              float64 `json:"optionStrikeRound"`
	OptionUnderlyingPrice          float64 `json:"optionUnderlyingPrice"`
	PositionCurrency               string  `json:"positionCurrency"`
	PrevClosePrice                 float64 `json:"prevClosePrice"`
	PrevPrice24h                   float64 `json:"prevPrice24h"`
	PrevTotalTurnover              int64   `json:"prevTotalTurnover"`
	PrevTotalVolume                int64   `json:"prevTotalVolume"`
	PublishInterval                string  `json:"publishInterval"`
	PublishTime                    string  `json:"publishTime"`
	QuoteCurrency                  string  `json:"quoteCurrency"`
	QuoteToSettleMultiplier        int64   `json:"quoteToSettleMultiplier"`
	RebalanceInterval              string  `json:"rebalanceInterval"`
	RebalanceTimestamp             string  `json:"rebalanceTimestamp"`
	Reference                      string  `json:"reference"`
	ReferenceSymbol                string  `json:"referenceSymbol"`
	RelistInterval                 string  `json:"relistInterval"`
	RiskLimit                      int64   `json:"riskLimit"`
	RiskStep                       int64   `json:"riskStep"`
	RootSymbol                     string  `json:"rootSymbol"`
	SellLeg                        string  `json:"sellLeg"`
	SessionInterval                string  `json:"sessionInterval"`
	SettlCurrency                  string  `json:"settlCurrency"`
	Settle                         string  `json:"settle"`
	SettledPrice                   float64 `json:"settledPrice"`
	SettlementFee                  float64 `json:"settlementFee"`
	State                          string  `json:"state"`
	Symbol                         string  `json:"symbol"`
	TakerFee                       float64 `json:"takerFee"`
	Taxed                          bool    `json:"taxed"`
	TickSize                       float64 `json:"tickSize"`
	Timestamp                      string  `json:"timestamp"`
	TotalTurnover                  int64   `json:"totalTurnover"`
	TotalVolume                    int64   `json:"totalVolume"`
	Turnover                       int64   `json:"turnover"`
	Turnover24h                    int64   `json:"turnover24h"`
	Typ                            string  `json:"typ"`
	Underlying                     string  `json:"underlying"`
	UnderlyingSymbol               string  `json:"underlyingSymbol"`
	UnderlyingToPositionMultiplier int64   `json:"underlyingToPositionMultiplier"`
	UnderlyingToSettleMultiplier   int64   `json:"underlyingToSettleMultiplier"`
	Volume                         int64   `json:"volume"`
	Volume24h                      int64   `json:"volume24h"`
	Vwap                           float64 `json:"vwap"`
}

Instrument Tradeable Contracts, Indices, and History

type InstrumentInterval

type InstrumentInterval struct {
	Intervals []string `json:"intervals"`
	Symbols   []string `json:"symbols"`
}

InstrumentInterval instrument interval

type Insurance

type Insurance struct {
	Currency      string `json:"currency"`
	Timestamp     string `json:"timestamp"`
	WalletBalance int64  `json:"walletBalance"`
}

Insurance Insurance Fund Data

type Leaderboard

type Leaderboard struct {
	IsRealName bool    `json:"isRealName"`
	Name       string  `json:"name"`
	Profit     float64 `json:"profit"`
}

Leaderboard Information on Top Users

type LeaderboardGetParams

type LeaderboardGetParams struct {
	// MethodRanking - [Optional] type. Options: "notional", "ROE"
	Method string `json:"method,omitempty"`
}

LeaderboardGetParams contains all the parameters to send to the API endpoint

func (LeaderboardGetParams) IsNil

func (p LeaderboardGetParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (LeaderboardGetParams) ToURLVals

func (p LeaderboardGetParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (LeaderboardGetParams) VerifyData

func (p LeaderboardGetParams) VerifyData() error

VerifyData verifies outgoing data sets

type Liquidation

type Liquidation struct {
	LeavesQty int64   `json:"leavesQty"`
	OrderID   string  `json:"orderID"`
	Price     float64 `json:"price"`
	Side      string  `json:"side"`
	Symbol    string  `json:"symbol"`
}

Liquidation Active Liquidations

type MinWithdrawalFee

type MinWithdrawalFee struct {
	Currency string `json:"currency"`
	Fee      int64  `json:"fee"`
	MinFee   int64  `json:"minFee"`
}

MinWithdrawalFee minimum withdrawal fee information

type Notification

type Notification struct {
	Body              string `json:"body"`
	Closable          bool   `json:"closable"`
	Date              string `json:"date"`
	ID                int32  `json:"id"`
	Persist           bool   `json:"persist"`
	Sound             string `json:"sound"`
	Title             string `json:"title"`
	TTL               int32  `json:"ttl"`
	Type              string `json:"type"`
	WaitForVisibility bool   `json:"waitForVisibility"`
}

Notification Account Notifications

type Order

type Order struct {
	Account               int64   `json:"account"`
	AvgPx                 float64 `json:"avgPx"`
	ClOrdID               string  `json:"clOrdID"`
	ClOrdLinkID           string  `json:"clOrdLinkID"`
	ContingencyType       string  `json:"contingencyType"`
	CumQty                int64   `json:"cumQty"`
	Currency              string  `json:"currency"`
	DisplayQty            int64   `json:"displayQty"`
	ExDestination         string  `json:"exDestination"`
	ExecInst              string  `json:"execInst"`
	LeavesQty             int64   `json:"leavesQty"`
	MultiLegReportingType string  `json:"multiLegReportingType"`
	OrdRejReason          string  `json:"ordRejReason"`
	OrdStatus             string  `json:"ordStatus"`
	OrdType               int64   `json:"ordType,string"`
	OrderID               string  `json:"orderID"`
	OrderQty              int64   `json:"orderQty"`
	PegOffsetValue        float64 `json:"pegOffsetValue"`
	PegPriceType          string  `json:"pegPriceType"`
	Price                 float64 `json:"price"`
	SettlCurrency         string  `json:"settlCurrency"`
	Side                  int64   `json:"side,string"`
	SimpleCumQty          float64 `json:"simpleCumQty"`
	SimpleLeavesQty       float64 `json:"simpleLeavesQty"`
	SimpleOrderQty        float64 `json:"simpleOrderQty"`
	StopPx                float64 `json:"stopPx"`
	Symbol                string  `json:"symbol"`
	Text                  string  `json:"text"`
	TimeInForce           string  `json:"timeInForce"`
	Timestamp             string  `json:"timestamp"`
	TransactTime          string  `json:"transactTime"`
	Triggered             string  `json:"triggered"`
	WorkingIndicator      bool    `json:"workingIndicator"`
}

Order Placement, Cancellation, Amending, and History

type OrderAmendBulkParams

type OrderAmendBulkParams struct {
	// Orders - An array of orders.
	Orders []OrderAmendParams `json:"orders,omitempty"`
}

OrderAmendBulkParams contains all the parameters to send to the API endpoint

func (OrderAmendBulkParams) IsNil

func (p OrderAmendBulkParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (OrderAmendBulkParams) ToURLVals

func (p OrderAmendBulkParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (OrderAmendBulkParams) VerifyData

func (p OrderAmendBulkParams) VerifyData() error

VerifyData verifies outgoing data sets

type OrderAmendParams

type OrderAmendParams struct {
	// ClOrdID - [Optional] new Client Order ID, requires `origClOrdID`.
	ClOrdID string `json:"clOrdID,omitempty"`

	// LeavesQty - [Optional] leaves quantity in units of the instrument
	// (i.e. contracts). Useful for amending partially filled orders.
	LeavesQty int32 `json:"leavesQty,omitempty"`

	OrderID string `json:"orderID,omitempty"`

	// OrderQty - [Optional] order quantity in units of the instrument
	// (i.e. contracts).
	OrderQty int32 `json:"orderQty,omitempty"`

	// OrigClOrdID - Client Order ID. See POST /order.
	OrigClOrdID string `json:"origClOrdID,omitempty"`

	// PegOffsetValue - [Optional] trailing offset from the current price for
	// 'Stop', 'StopLimit', 'MarketIfTouched', and 'LimitIfTouched' orders; use a
	// negative offset for stop-sell orders and buy-if-touched orders. [Optional]
	// offset from the peg price for 'Pegged' orders.
	PegOffsetValue float64 `json:"pegOffsetValue,omitempty"`

	// Price - [Optional] limit price for 'Limit', 'StopLimit', and
	// 'LimitIfTouched' orders.
	Price float64 `json:"price,omitempty"`

	// SimpleLeavesQty - [Optional] leaves quantity in units of the underlying
	// instrument (i.e. Bitcoin). Useful for amending partially filled orders.
	SimpleLeavesQty float64 `json:"simpleLeavesQty,omitempty"`

	// SimpleOrderQty - [Optional] order quantity in units of the underlying
	// instrument (i.e. Bitcoin).
	SimpleOrderQty float64 `json:"simpleOrderQty,omitempty"`

	// StopPx - [Optional] trigger price for 'Stop', 'StopLimit',
	// 'MarketIfTouched', and 'LimitIfTouched' orders. Use a price below the
	// current price for stop-sell orders and buy-if-touched orders.
	StopPx float64 `json:"stopPx,omitempty"`

	// Text - [Optional] amend annotation. e.g. 'Adjust skew'.
	Text string `json:"text,omitempty"`
}

OrderAmendParams contains all the parameters to send to the API endpoint for the order amend operation

func (*OrderAmendParams) IsNil

func (p *OrderAmendParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (*OrderAmendParams) ToURLVals

func (p *OrderAmendParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (*OrderAmendParams) VerifyData

func (p *OrderAmendParams) VerifyData() error

VerifyData verifies outgoing data sets

type OrderBookData

type OrderBookData struct {
	Data   []OrderBookL2 `json:"data"`
	Action string        `json:"action"`
}

OrderBookData contains orderbook resp data with action to be taken

type OrderBookGetL2Params

type OrderBookGetL2Params struct {
	// Depth - Orderbook depth per side. Send 0 for full depth.
	Depth int32 `json:"depth,omitempty"`

	// Symbol -Instrument symbol. Send a series (e.g. XBT) to get data for the
	// nearest contract in that series.
	Symbol string `json:"symbol,omitempty"`
}

OrderBookGetL2Params contains all the parameters to send to the API endpoint

func (OrderBookGetL2Params) IsNil

func (p OrderBookGetL2Params) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (OrderBookGetL2Params) ToURLVals

func (p OrderBookGetL2Params) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (OrderBookGetL2Params) VerifyData

func (p OrderBookGetL2Params) VerifyData() error

VerifyData verifies outgoing data sets

type OrderBookL2

type OrderBookL2 struct {
	ID     int64   `json:"id"`
	Price  float64 `json:"price"`
	Side   string  `json:"side"`
	Size   int64   `json:"size"`
	Symbol string  `json:"symbol"`
}

OrderBookL2 contains order book l2

type OrderCancelAllAfterParams

type OrderCancelAllAfterParams struct {
	// Timeout in ms. Set to 0 to cancel this timer.
	Timeout float64 `json:"timeout,omitempty"`
}

OrderCancelAllAfterParams contains all the parameters to send to the API endpoint

func (OrderCancelAllAfterParams) IsNil

func (p OrderCancelAllAfterParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (OrderCancelAllAfterParams) ToURLVals

func (p OrderCancelAllAfterParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (OrderCancelAllAfterParams) VerifyData

func (p OrderCancelAllAfterParams) VerifyData() error

VerifyData verifies outgoing data sets

type OrderCancelAllParams

type OrderCancelAllParams struct {
	// Filter - [Optional] filter for cancellation. Use to only cancel some
	// orders, e.g. `{"side": "Buy"}`.
	Filter string `json:"filter,omitempty"`

	// Symbol - [Optional] symbol. If provided, only cancels orders for that
	// symbol.
	Symbol string `json:"symbol,omitempty"`

	// Text - [Optional] cancellation annotation. e.g. 'Spread Exceeded'
	Text string `json:"text,omitempty"`
}

OrderCancelAllParams contains all the parameters to send to the API endpoint for cancelling all your orders

func (OrderCancelAllParams) IsNil

func (p OrderCancelAllParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (OrderCancelAllParams) ToURLVals

func (p OrderCancelAllParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (OrderCancelAllParams) VerifyData

func (p OrderCancelAllParams) VerifyData() error

VerifyData verifies outgoing data sets

type OrderCancelParams

type OrderCancelParams struct {
	// ClOrdID - Client Order ID(s). See POST /order.
	ClOrdID string `json:"clOrdID,omitempty"`

	// OrderID - Order ID(s).
	OrderID string `json:"orderID,omitempty"`

	// Text - [Optional] cancellation annotation. e.g. 'Spread Exceeded'.
	Text string `json:"text,omitempty"`
}

OrderCancelParams contains all the parameters to send to the API endpoint

func (OrderCancelParams) IsNil

func (p OrderCancelParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (OrderCancelParams) ToURLVals

func (p OrderCancelParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (OrderCancelParams) VerifyData

func (p OrderCancelParams) VerifyData() error

VerifyData verifies outgoing data sets

type OrderClosePositionParams

type OrderClosePositionParams struct {
	// Price - [Optional] limit price.
	Price float64 `json:"price,omitempty"`

	// Symbol of position to close.
	Symbol string `json:"symbol,omitempty"`
}

OrderClosePositionParams contains all the parameters to send to the API endpoint

func (OrderClosePositionParams) IsNil

func (p OrderClosePositionParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (OrderClosePositionParams) ToURLVals

func (p OrderClosePositionParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (OrderClosePositionParams) VerifyData

func (p OrderClosePositionParams) VerifyData() error

VerifyData verifies outgoing data sets

type OrderNewBulkParams

type OrderNewBulkParams struct {
	// Orders - An array of orders.
	Orders []OrderNewParams `json:"orders,omitempty"`
}

OrderNewBulkParams contains all the parameters to send to the API endpoint

func (OrderNewBulkParams) IsNil

func (p OrderNewBulkParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (OrderNewBulkParams) ToURLVals

func (p OrderNewBulkParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (OrderNewBulkParams) VerifyData

func (p OrderNewBulkParams) VerifyData() error

VerifyData verifies outgoing data sets

type OrderNewParams

type OrderNewParams struct {
	// ClOrdID - [Optional] Client Order ID. This clOrdID will come back on the
	// order and any related executions.
	ClOrdID string `json:"clOrdID,omitempty"`

	// ClOrdLinkID - [Optional] Client Order Link ID for contingent orders.
	ClOrdLinkID string `json:"clOrdLinkID,omitempty"`

	// ContingencyType - [Optional] contingency type for use with `clOrdLinkID`.
	// Valid options: OneCancelsTheOther, OneTriggersTheOther,
	// OneUpdatesTheOtherAbsolute, OneUpdatesTheOtherProportional.
	ContingencyType string `json:"contingencyType,omitempty"`

	// DisplayQty - [Optional] quantity to display in the book. Use 0 for a fully
	// hidden order.
	DisplayQty float64 `json:"displayQty,omitempty"`

	// ExecInst - [Optional] execution instructions. Valid options:
	// ParticipateDoNotInitiate, AllOrNone, MarkPrice, IndexPrice, LastPrice,
	// Close, ReduceOnly, Fixed. 'AllOrNone' instruction requires `displayQty`
	// to be 0. 'MarkPrice', 'IndexPrice' or 'LastPrice' instruction valid for
	// 'Stop', 'StopLimit', 'MarketIfTouched', and 'LimitIfTouched' orders.
	ExecInst string `json:"execInst,omitempty"`

	// OrdType - Order type. Valid options: Market, Limit, Stop, StopLimit,
	// MarketIfTouched, LimitIfTouched, MarketWithLeftOverAsLimit, Pegged.
	// Defaults to 'Limit' when `price` is specified. Defaults to 'Stop' when
	// `stopPx` is specified. Defaults to 'StopLimit' when `price` and `stopPx`
	// are specified.
	OrdType string `json:"ordType,omitempty"`

	// OrderQty Order quantity in units of the instrument (i.e. contracts).
	OrderQty float64 `json:"orderQty,omitempty"`

	// PegOffsetValue - [Optional] trailing offset from the current price for
	// 'Stop', 'StopLimit', 'MarketIfTouched', and 'LimitIfTouched' orders; use a
	// negative offset for stop-sell orders and buy-if-touched orders. [Optional]
	// offset from the peg price for 'Pegged' orders.
	PegOffsetValue float64 `json:"pegOffsetValue,omitempty"`

	// PegPriceType - [Optional] peg price type. Valid options: LastPeg,
	// MidPricePeg, MarketPeg, PrimaryPeg, TrailingStopPeg.
	PegPriceType string `json:"pegPriceType,omitempty"`

	// Price - [Optional] limit price for 'Limit', 'StopLimit', and
	// 'LimitIfTouched' orders.
	Price float64 `json:"price,omitempty"`

	// Side - Order side. Valid options: Buy, Sell. Defaults to 'Buy' unless
	// `orderQty` or `simpleOrderQty` is negative.
	Side string `json:"side,omitempty"`

	// SimpleOrderQty - Order quantity in units of the underlying instrument
	// (i.e. Bitcoin).
	SimpleOrderQty float64 `json:"simpleOrderQty,omitempty"`

	// StopPx - [Optional] trigger price for 'Stop', 'StopLimit',
	// 'MarketIfTouched', and 'LimitIfTouched' orders. Use a price below the
	// current price for stop-sell orders and buy-if-touched orders. Use
	// `execInst` of 'MarkPrice' or 'LastPrice' to define the current price used
	// for triggering.
	StopPx float64 `json:"stopPx,omitempty"`

	// Symbol - Instrument symbol. e.g. 'XBTUSD'.
	Symbol string `json:"symbol,omitempty"`

	// Text - [Optional] order annotation. e.g. 'Take profit'.
	Text string `json:"text,omitempty"`

	// TimeInForce - Valid options: Day, GoodTillCancel, ImmediateOrCancel,
	// FillOrKill. Defaults to 'GoodTillCancel' for 'Limit', 'StopLimit',
	// 'LimitIfTouched', and 'MarketWithLeftOverAsLimit' orders.
	TimeInForce string `json:"timeInForce,omitempty"`
}

OrderNewParams contains all the parameters to send to the API endpoint

func (*OrderNewParams) IsNil

func (p *OrderNewParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (*OrderNewParams) ToURLVals

func (p *OrderNewParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (*OrderNewParams) VerifyData

func (p *OrderNewParams) VerifyData() error

VerifyData verifies outgoing data sets

type OrdersRequest

type OrdersRequest struct {
	Symbol    string  `json:"symbol,omitempty"`
	Filter    string  `json:"filter,omitempty"`
	Columns   string  `json:"columns,omitempty"`
	Count     float64 `json:"count,omitempty"`
	Start     float64 `json:"start,omitempty"`
	Reverse   bool    `json:"reverse,omitempty"`
	StartTime string  `json:"startTime,omitempty"`
	EndTime   string  `json:"endTime,omitempty"`
}

OrdersRequest used for GetOrderHistory

func (*OrdersRequest) IsNil

func (p *OrdersRequest) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (*OrdersRequest) ToURLVals

func (p *OrdersRequest) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (*OrdersRequest) VerifyData

func (p *OrdersRequest) VerifyData() error

VerifyData verifies parameter data during SendAuthenticatedHTTPRequest

type Parameter

type Parameter interface {
	VerifyData() error
	ToURLVals(path string) (string, error)
	IsNil() bool
}

Parameter just enforces a check on all outgoing data

type Position

type Position struct {
	Account              int64   `json:"account"`
	AvgCostPrice         float64 `json:"avgCostPrice"`
	AvgEntryPrice        float64 `json:"avgEntryPrice"`
	BankruptPrice        float64 `json:"bankruptPrice"`
	BreakEvenPrice       float64 `json:"breakEvenPrice"`
	Commission           float64 `json:"commission"`
	CrossMargin          bool    `json:"crossMargin"`
	Currency             string  `json:"currency"`
	CurrentComm          int64   `json:"currentComm"`
	CurrentCost          int64   `json:"currentCost"`
	CurrentQty           int64   `json:"currentQty"`
	CurrentTimestamp     string  `json:"currentTimestamp"`
	DeleveragePercentile float64 `json:"deleveragePercentile"`
	ExecBuyCost          int64   `json:"execBuyCost"`
	ExecBuyQty           int64   `json:"execBuyQty"`
	ExecComm             int64   `json:"execComm"`
	ExecCost             int64   `json:"execCost"`
	ExecQty              int64   `json:"execQty"`
	ExecSellCost         int64   `json:"execSellCost"`
	ExecSellQty          int64   `json:"execSellQty"`
	ForeignNotional      float64 `json:"foreignNotional"`
	GrossExecCost        int64   `json:"grossExecCost"`
	GrossOpenCost        int64   `json:"grossOpenCost"`
	GrossOpenPremium     int64   `json:"grossOpenPremium"`
	HomeNotional         float64 `json:"homeNotional"`
	IndicativeTax        int64   `json:"indicativeTax"`
	IndicativeTaxRate    float64 `json:"indicativeTaxRate"`
	InitMargin           int64   `json:"initMargin"`
	InitMarginReq        float64 `json:"initMarginReq"`
	IsOpen               bool    `json:"isOpen"`
	LastPrice            float64 `json:"lastPrice"`
	LastValue            int64   `json:"lastValue"`
	Leverage             float64 `json:"leverage"`
	LiquidationPrice     float64 `json:"liquidationPrice"`
	LongBankrupt         int64   `json:"longBankrupt"`
	MaintMargin          int64   `json:"maintMargin"`
	MaintMarginReq       float64 `json:"maintMarginReq"`
	MarginCallPrice      float64 `json:"marginCallPrice"`
	MarkPrice            float64 `json:"markPrice"`
	MarkValue            int64   `json:"markValue"`
	OpenOrderBuyCost     int64   `json:"openOrderBuyCost"`
	OpenOrderBuyPremium  int64   `json:"openOrderBuyPremium"`
	OpenOrderBuyQty      int64   `json:"openOrderBuyQty"`
	OpenOrderSellCost    int64   `json:"openOrderSellCost"`
	OpenOrderSellPremium int64   `json:"openOrderSellPremium"`
	OpenOrderSellQty     int64   `json:"openOrderSellQty"`
	OpeningComm          int64   `json:"openingComm"`
	OpeningCost          int64   `json:"openingCost"`
	OpeningQty           int64   `json:"openingQty"`
	OpeningTimestamp     string  `json:"openingTimestamp"`
	PosAllowance         int64   `json:"posAllowance"`
	PosComm              int64   `json:"posComm"`
	PosCost              int64   `json:"posCost"`
	PosCost2             int64   `json:"posCost2"`
	PosCross             int64   `json:"posCross"`
	PosInit              int64   `json:"posInit"`
	PosLoss              int64   `json:"posLoss"`
	PosMaint             int64   `json:"posMaint"`
	PosMargin            int64   `json:"posMargin"`
	PosState             string  `json:"posState"`
	PrevClosePrice       float64 `json:"prevClosePrice"`
	PrevRealisedPnl      int64   `json:"prevRealisedPnl"`
	PrevUnrealisedPnl    int64   `json:"prevUnrealisedPnl"`
	QuoteCurrency        string  `json:"quoteCurrency"`
	RealisedCost         int64   `json:"realisedCost"`
	RealisedGrossPnl     int64   `json:"realisedGrossPnl"`
	RealisedPnl          int64   `json:"realisedPnl"`
	RealisedTax          int64   `json:"realisedTax"`
	RebalancedPnl        int64   `json:"rebalancedPnl"`
	RiskLimit            int64   `json:"riskLimit"`
	RiskValue            int64   `json:"riskValue"`
	SessionMargin        int64   `json:"sessionMargin"`
	ShortBankrupt        int64   `json:"shortBankrupt"`
	SimpleCost           float64 `json:"simpleCost"`
	SimplePnl            float64 `json:"simplePnl"`
	SimplePnlPcnt        float64 `json:"simplePnlPcnt"`
	SimpleQty            float64 `json:"simpleQty"`
	SimpleValue          float64 `json:"simpleValue"`
	Symbol               string  `json:"symbol"`
	TargetExcessMargin   int64   `json:"targetExcessMargin"`
	TaxBase              int64   `json:"taxBase"`
	TaxableMargin        int64   `json:"taxableMargin"`
	Timestamp            string  `json:"timestamp"`
	Underlying           string  `json:"underlying"`
	UnrealisedCost       int64   `json:"unrealisedCost"`
	UnrealisedGrossPnl   int64   `json:"unrealisedGrossPnl"`
	UnrealisedPnl        int64   `json:"unrealisedPnl"`
	UnrealisedPnlPcnt    float64 `json:"unrealisedPnlPcnt"`
	UnrealisedRoePcnt    float64 `json:"unrealisedRoePcnt"`
	UnrealisedTax        int64   `json:"unrealisedTax"`
	VarMargin            int64   `json:"varMargin"`
}

Position Summary of Open and Closed Positions

type PositionGetParams

type PositionGetParams struct {

	// Columns - Which columns to fetch. For example, send ["columnName"].
	Columns string `json:"columns,omitempty"`

	// Count - Number of rows to fetch.
	Count int32 `json:"count,omitempty"`

	// Filter - Table filter. For example, send {"symbol": "XBTUSD"}.
	Filter string `json:"filter,omitempty"`
}

PositionGetParams contains all the parameters to send to the API endpoint

func (PositionGetParams) IsNil

func (p PositionGetParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (PositionGetParams) ToURLVals

func (p PositionGetParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (PositionGetParams) VerifyData

func (p PositionGetParams) VerifyData() error

VerifyData verifies outgoing data sets

type PositionIsolateMarginParams

type PositionIsolateMarginParams struct {
	// Enabled - True for isolated margin, false for cross margin.
	Enabled bool `json:"enabled,omitempty"`

	// Symbol - Position symbol to isolate.
	Symbol string `json:"symbol,omitempty"`
}

PositionIsolateMarginParams contains all the parameters to send to the API endpoint

func (PositionIsolateMarginParams) IsNil

IsNil checks to see if any values has been set for the paramater

func (PositionIsolateMarginParams) ToURLVals

func (p PositionIsolateMarginParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (PositionIsolateMarginParams) VerifyData

func (p PositionIsolateMarginParams) VerifyData() error

VerifyData verifies outgoing data sets

type PositionTransferIsolatedMarginParams

type PositionTransferIsolatedMarginParams struct {
	// Amount - Amount to transfer, in Satoshis. May be negative.
	Amount int64 `json:"amount,omitempty"`

	// Symbol - Symbol of position to isolate.
	Symbol string `json:"symbol,omitempty"`
}

PositionTransferIsolatedMarginParams contains all the parameters to send to the API endpoint

func (PositionTransferIsolatedMarginParams) IsNil

IsNil checks to see if any values has been set for the paramater

func (PositionTransferIsolatedMarginParams) ToURLVals

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (PositionTransferIsolatedMarginParams) VerifyData

VerifyData verifies outgoing data sets

type PositionUpdateLeverageParams

type PositionUpdateLeverageParams struct {
	// 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.
	Leverage float64 `json:"leverage,omitempty"`

	// Symbol - Symbol of position to adjust.
	Symbol string `json:"symbol,omitempty"`
}

PositionUpdateLeverageParams contains all the parameters to send to the API endpoint

func (PositionUpdateLeverageParams) IsNil

IsNil checks to see if any values has been set for the paramater

func (PositionUpdateLeverageParams) ToURLVals

func (p PositionUpdateLeverageParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (PositionUpdateLeverageParams) VerifyData

func (p PositionUpdateLeverageParams) VerifyData() error

VerifyData verifies outgoing data sets

type PositionUpdateRiskLimitParams

type PositionUpdateRiskLimitParams struct {
	// RiskLimit - New Risk Limit, in Satoshis.
	RiskLimit int64 `json:"riskLimit,omitempty"`

	// Symbol - Symbol of position to update risk limit on.
	Symbol string `json:"symbol,omitempty"`
}

PositionUpdateRiskLimitParams contains all the parameters to send to the API endpoint

func (PositionUpdateRiskLimitParams) IsNil

IsNil checks to see if any values has been set for the paramater

func (PositionUpdateRiskLimitParams) ToURLVals

func (p PositionUpdateRiskLimitParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (PositionUpdateRiskLimitParams) VerifyData

func (p PositionUpdateRiskLimitParams) VerifyData() error

VerifyData verifies outgoing data sets

type Quote

type Quote struct {
	AskPrice  float64 `json:"askPrice"`
	AskSize   int64   `json:"askSize"`
	BidPrice  float64 `json:"bidPrice"`
	BidSize   int64   `json:"bidSize"`
	Symbol    string  `json:"symbol"`
	Timestamp string  `json:"timestamp"`
}

Quote Best Bid/Offer Snapshots & Historical Bins

type QuoteGetBucketedParams

type QuoteGetBucketedParams struct {
	// BinSize - Time interval to bucket by. Available options: [1m,5m,1h,1d].
	BinSize string `json:"binSize,omitempty"`

	// Columns - Array of column names to fetch. If omitted, will return all
	// columns. NOTE that this method will always return item keys, even when not
	// specified, so you may receive more columns that you expect.
	Columns string `json:"columns,omitempty"`

	// Count - Number of results to fetch.
	Count int32 `json:"count,omitempty"`

	// EndTime - Ending date filter for results.
	EndTime string `json:"endTime,omitempty"`

	// Filter - Generic table filter. Send JSON key/value pairs, such as
	// `{"key": "value"}`. You can key on individual fields, and do more advanced
	// querying on timestamps. See the
	// [Timestamp Docs](https://testnet.bitmex.com/app/restAPI#Timestamp-Filters)
	// for more details.
	Filter string `json:"filter,omitempty"`

	// Partial - If true, will send in-progress (incomplete) bins for the current
	// time period.
	Partial bool `json:"partial,omitempty"`

	// Reverse - If true, will sort results newest first.
	Reverse bool `json:"reverse,omitempty"`

	// Start - Starting point for results.
	Start int32 `json:"start,omitempty"`

	// StartTime - Starting date filter for results.
	StartTime string `json:"startTime,omitempty"`

	// Symbol - Instrument symbol. Send a bare series (e.g. XBU) to get data for
	// the nearest expiring contract in that series.You can also send a timeframe,
	// e.g. `XBU:monthly`. Timeframes are `daily`, `weekly`, `monthly`,
	// `quarterly`, and `biquarterly`.
	Symbol string `json:"symbol,omitempty"`
}

QuoteGetBucketedParams contains all the parameters to send to the API endpoint

func (*QuoteGetBucketedParams) IsNil

func (p *QuoteGetBucketedParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (*QuoteGetBucketedParams) ToURLVals

func (p *QuoteGetBucketedParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (*QuoteGetBucketedParams) VerifyData

func (p *QuoteGetBucketedParams) VerifyData() error

VerifyData verifies outgoing data sets

type RequestError

type RequestError struct {
	Error struct {
		Message string `json:"message"`
		Name    string `json:"name"`
	} `json:"error"`
}

RequestError allows for a general error capture from requests

type Settlement

type Settlement struct {
	Bankrupt              int64   `json:"bankrupt"`
	OptionStrikePrice     float64 `json:"optionStrikePrice"`
	OptionUnderlyingPrice float64 `json:"optionUnderlyingPrice"`
	SettledPrice          float64 `json:"settledPrice"`
	SettlementType        string  `json:"settlementType"`
	Symbol                string  `json:"symbol"`
	TaxBase               int64   `json:"taxBase"`
	TaxRate               float64 `json:"taxRate"`
	Timestamp             string  `json:"timestamp"`
}

Settlement Historical Settlement Data

type Stats

type Stats struct {
	Currency     string `json:"currency"`
	OpenInterest int64  `json:"openInterest"`
	OpenValue    int64  `json:"openValue"`
	RootSymbol   string `json:"rootSymbol"`
	Turnover24h  int64  `json:"turnover24h"`
	Volume24h    int64  `json:"volume24h"`
}

Stats Exchange Statistics

type StatsHistory

type StatsHistory struct {
	Currency   string `json:"currency"`
	Date       string `json:"date"`
	RootSymbol string `json:"rootSymbol"`
	Turnover   int64  `json:"turnover"`
	Volume     int64  `json:"volume"`
}

StatsHistory stats history

type StatsUSD

type StatsUSD struct {
	Currency     string `json:"currency"`
	RootSymbol   string `json:"rootSymbol"`
	Turnover     int64  `json:"turnover"`
	Turnover24h  int64  `json:"turnover24h"`
	Turnover30d  int64  `json:"turnover30d"`
	Turnover365d int64  `json:"turnover365d"`
}

StatsUSD contains summary of exchange stats

type Trade

type Trade struct {
	ForeignNotional float64 `json:"foreignNotional"`
	GrossValue      int64   `json:"grossValue"`
	HomeNotional    float64 `json:"homeNotional"`
	Price           float64 `json:"price"`
	Side            string  `json:"side"`
	Size            int64   `json:"size"`
	Symbol          string  `json:"symbol"`
	TickDirection   string  `json:"tickDirection"`
	Timestamp       string  `json:"timestamp"`
	TrdMatchID      string  `json:"trdMatchID"`
}

Trade Individual & Bucketed Trades

type TradeData

type TradeData struct {
	Data   []Trade `json:"data"`
	Action string  `json:"action"`
}

TradeData contains trade resp data with action to be taken

type TradeGetBucketedParams

type TradeGetBucketedParams struct {
	// BinSize - Time interval to bucket by. Available options: [1m,5m,1h,1d].
	BinSize string `json:"binSize,omitempty"`

	// Columns - Array of column names to fetch. If omitted, will return all
	// columns.
	// Note that this method will always return item keys, even when not
	// specified, so you may receive more columns that you expect.
	Columns string `json:"columns,omitempty"`

	// Count - Number of results to fetch.
	Count int32 `json:"count,omitempty"`

	// EndTime - Ending date filter for results.
	EndTime string `json:"endTime,omitempty"`

	// Filter - Generic table filter. Send JSON key/value pairs, such as
	// `{"key": "value"}`. You can key on individual fields, and do more advanced
	// querying on timestamps. See the
	// [Timestamp Docs](https://testnet.bitmex.com/app/restAPI#Timestamp-Filters)
	// for more details.
	Filter string `json:"filter,omitempty"`

	// Partial - If true, will send in-progress (incomplete) bins for the current
	// time period.
	Partial bool `json:"partial,omitempty"`

	// Reverse - If true, will sort results newest first.
	Reverse bool `json:"reverse,omitempty"`

	// Start - Starting point for results.
	Start int32 `json:"start,omitempty"`

	// StartTime - Starting date filter for results.
	StartTime string `json:"startTime,omitempty"`

	// Symbol - Instrument symbol. Send a bare series (e.g. XBU) to get data for
	// the nearest expiring contract in that series.You can also send a timeframe,
	// e.g. `XBU:monthly`. Timeframes are `daily`, `weekly`, `monthly`,
	// `quarterly`, and `biquarterly`.
	Symbol string `json:"symbol,omitempty"`
}

TradeGetBucketedParams contains all the parameters to send to the API endpoint

func (*TradeGetBucketedParams) IsNil

func (p *TradeGetBucketedParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (*TradeGetBucketedParams) ToURLVals

func (p *TradeGetBucketedParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (*TradeGetBucketedParams) VerifyData

func (p *TradeGetBucketedParams) VerifyData() error

VerifyData verifies outgoing data sets

type TransactionInfo

type TransactionInfo struct {
	Account        int64  `json:"account"`
	Address        string `json:"address"`
	Amount         int64  `json:"amount"`
	Currency       string `json:"currency"`
	Fee            int64  `json:"fee"`
	Text           string `json:"text"`
	Timestamp      string `json:"timestamp"`
	TransactID     string `json:"transactID"`
	TransactStatus string `json:"transactStatus"`
	TransactTime   string `json:"transactTime"`
	TransactType   string `json:"transactType"`
	Tx             string `json:"tx"`
}

TransactionInfo Information

type User

type User struct {
	TFAEnabled   string          `json:"TFAEnabled"`
	AffiliateID  string          `json:"affiliateID"`
	Country      string          `json:"country"`
	Created      string          `json:"created"`
	Email        string          `json:"email"`
	Firstname    string          `json:"firstname"`
	GeoipCountry string          `json:"geoipCountry"`
	GeoipRegion  string          `json:"geoipRegion"`
	ID           int32           `json:"id"`
	LastUpdated  string          `json:"lastUpdated"`
	Lastname     string          `json:"lastname"`
	OwnerID      int32           `json:"ownerId"`
	PgpPubKey    string          `json:"pgpPubKey"`
	Phone        string          `json:"phone"`
	Preferences  UserPreferences `json:"preferences"`
	Typ          string          `json:"typ"`
	Username     string          `json:"username"`
}

User Account Operations

type UserCheckReferralCodeParams

type UserCheckReferralCodeParams struct {
	ReferralCode string `json:"referralCode,omitempty"`
}

UserCheckReferralCodeParams contains all the parameters to send to the API endpoint

func (UserCheckReferralCodeParams) IsNil

IsNil checks to see if any values has been set for the paramater

func (UserCheckReferralCodeParams) ToURLVals

func (p UserCheckReferralCodeParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (UserCheckReferralCodeParams) VerifyData

func (p UserCheckReferralCodeParams) VerifyData() error

VerifyData verifies outgoing data sets

type UserCommission

type UserCommission struct {
	MakerFee      float64 `json:"makerFee"`
	MaxFee        float64 `json:"maxFee"`
	SettlementFee float64 `json:"settlementFee"`
	TakerFee      float64 `json:"takerFee"`
}

UserCommission user commission

type UserConfirmTFAParams

type UserConfirmTFAParams struct {
	// Token - Token from your selected TFA type.
	Token string `json:"token,omitempty"`

	// Type - Two-factor auth type. Supported types: 'GA' (Google Authenticator),
	// 'Yubikey'
	Type string `json:"type,omitempty"`
}

UserConfirmTFAParams contains all the parameters to send to the API endpoint

func (UserConfirmTFAParams) IsNil

func (p UserConfirmTFAParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (UserConfirmTFAParams) ToURLVals

func (p UserConfirmTFAParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (UserConfirmTFAParams) VerifyData

func (p UserConfirmTFAParams) VerifyData() error

VerifyData verifies outgoing data sets

type UserCurrencyParams

type UserCurrencyParams struct {
	Currency string `json:"currency,omitempty"`
}

UserCurrencyParams contains all the parameters to send to the API endpoint

func (UserCurrencyParams) IsNil

func (p UserCurrencyParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (UserCurrencyParams) ToURLVals

func (p UserCurrencyParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (UserCurrencyParams) VerifyData

func (p UserCurrencyParams) VerifyData() error

VerifyData verifies outgoing data sets

type UserMargin

type UserMargin struct {
	Account            int64   `json:"account"`
	Action             string  `json:"action"`
	Amount             int64   `json:"amount"`
	AvailableMargin    int64   `json:"availableMargin"`
	Commission         float64 `json:"commission"`
	ConfirmedDebit     int64   `json:"confirmedDebit"`
	Currency           string  `json:"currency"`
	ExcessMargin       int64   `json:"excessMargin"`
	ExcessMarginPcnt   float64 `json:"excessMarginPcnt"`
	GrossComm          int64   `json:"grossComm"`
	GrossExecCost      int64   `json:"grossExecCost"`
	GrossLastValue     int64   `json:"grossLastValue"`
	GrossMarkValue     int64   `json:"grossMarkValue"`
	GrossOpenCost      int64   `json:"grossOpenCost"`
	GrossOpenPremium   int64   `json:"grossOpenPremium"`
	IndicativeTax      int64   `json:"indicativeTax"`
	InitMargin         int64   `json:"initMargin"`
	MaintMargin        int64   `json:"maintMargin"`
	MarginBalance      int64   `json:"marginBalance"`
	MarginBalancePcnt  float64 `json:"marginBalancePcnt"`
	MarginLeverage     float64 `json:"marginLeverage"`
	MarginUsedPcnt     float64 `json:"marginUsedPcnt"`
	PendingCredit      int64   `json:"pendingCredit"`
	PendingDebit       int64   `json:"pendingDebit"`
	PrevRealisedPnl    int64   `json:"prevRealisedPnl"`
	PrevState          string  `json:"prevState"`
	PrevUnrealisedPnl  int64   `json:"prevUnrealisedPnl"`
	RealisedPnl        int64   `json:"realisedPnl"`
	RiskLimit          int64   `json:"riskLimit"`
	RiskValue          int64   `json:"riskValue"`
	SessionMargin      int64   `json:"sessionMargin"`
	State              string  `json:"state"`
	SyntheticMargin    int64   `json:"syntheticMargin"`
	TargetExcessMargin int64   `json:"targetExcessMargin"`
	TaxableMargin      int64   `json:"taxableMargin"`
	Timestamp          string  `json:"timestamp"`
	UnrealisedPnl      int64   `json:"unrealisedPnl"`
	UnrealisedProfit   int64   `json:"unrealisedProfit"`
	VarMargin          int64   `json:"varMargin"`
	WalletBalance      int64   `json:"walletBalance"`
	WithdrawableMargin int64   `json:"withdrawableMargin"`
}

UserMargin margin information

type UserPreferences

type UserPreferences struct {
	AlertOnLiquidations     bool        `json:"alertOnLiquidations"`
	AnimationsEnabled       bool        `json:"animationsEnabled"`
	AnnouncementsLastSeen   string      `json:"announcementsLastSeen"`
	ChatChannelID           float64     `json:"chatChannelID"`
	ColorTheme              string      `json:"colorTheme"`
	Currency                string      `json:"currency"`
	Debug                   bool        `json:"debug"`
	DisableEmails           []string    `json:"disableEmails"`
	HideConfirmDialogs      []string    `json:"hideConfirmDialogs"`
	HideConnectionModal     bool        `json:"hideConnectionModal"`
	HideFromLeaderboard     bool        `json:"hideFromLeaderboard"`
	HideNameFromLeaderboard bool        `json:"hideNameFromLeaderboard"`
	HideNotifications       []string    `json:"hideNotifications"`
	Locale                  string      `json:"locale"`
	MsgsSeen                []string    `json:"msgsSeen"`
	OrderBookBinning        interface{} `json:"orderBookBinning"`
	OrderBookType           string      `json:"orderBookType"`
	OrderClearImmediate     bool        `json:"orderClearImmediate"`
	OrderControlsPlusMinus  bool        `json:"orderControlsPlusMinus"`
	ShowLocaleNumbers       bool        `json:"showLocaleNumbers"`
	Sounds                  []string    `json:"sounds"`
	StrictIPCheck           bool        `json:"strictIPCheck"`
	StrictTimeout           bool        `json:"strictTimeout"`
	TickerGroup             string      `json:"tickerGroup"`
	TickerPinned            bool        `json:"tickerPinned"`
	TradeLayout             string      `json:"tradeLayout"`
}

UserPreferences user preferences

type UserPreferencesParams

type UserPreferencesParams struct {
	// Overwrite - If true, will overwrite all existing preferences.
	Overwrite bool `json:"overwrite,omitempty"`
	// Prefs - preferences
	Prefs string `json:"prefs,omitempty"`
}

UserPreferencesParams contains all the parameters to send to the API endpoint

func (UserPreferencesParams) IsNil

func (p UserPreferencesParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (UserPreferencesParams) ToURLVals

func (p UserPreferencesParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (UserPreferencesParams) VerifyData

func (p UserPreferencesParams) VerifyData() error

VerifyData verifies outgoing data sets

type UserRequestWithdrawalParams

type UserRequestWithdrawalParams struct {
	// Address - Destination Address.
	Address string `json:"address,omitempty"`

	// Amount - Amount of withdrawal currency.
	Amount float64 `json:"amount,omitempty"`

	// Currency - Currency you're withdrawing. Options: `XBt`
	Currency string `json:"currency,omitempty"`

	// Fee - Network fee for Bitcoin withdrawals. If not specified, a default
	// value will be calculated based on Bitcoin network conditions. You will have
	// a chance to confirm this via email.
	Fee float64 `json:"fee,omitempty"`

	// OtpToken - 2FA token. Required if 2FA is enabled on your account.
	OtpToken int64 `json:"otpToken,omitempty"`
}

UserRequestWithdrawalParams contains all the parameters to send to the API endpoint

func (UserRequestWithdrawalParams) IsNil

IsNil checks to see if any values has been set for the paramater

func (UserRequestWithdrawalParams) ToURLVals

func (p UserRequestWithdrawalParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (UserRequestWithdrawalParams) VerifyData

func (p UserRequestWithdrawalParams) VerifyData() error

VerifyData verifies outgoing data sets

type UserTokenParams

type UserTokenParams struct {
	Token string `json:"token,omitempty"`
}

UserTokenParams contains all the parameters to send to the API endpoint

func (UserTokenParams) IsNil

func (p UserTokenParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (UserTokenParams) ToURLVals

func (p UserTokenParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (UserTokenParams) VerifyData

func (p UserTokenParams) VerifyData() error

VerifyData verifies outgoing data sets

type UserUpdateParams

type UserUpdateParams struct {
	// Country - Country of residence.
	Country string `json:"country,omitempty"`

	// New Password string
	NewPassword string `json:"newPassword,omitempty"`

	// Confirmation string - must match
	NewPasswordConfirm string `json:"newPasswordConfirm,omitempty"`

	// old password string
	OldPassword string `json:"oldPassword,omitempty"`

	// PGP Public Key. If specified, automated emails will be sent with this key.
	PgpPubKey string `json:"pgpPubKey,omitempty"`

	// Username can only be set once. To reset, email support.
	Username string `json:"username,omitempty"`
}

UserUpdateParams contains all the parameters to send to the API endpoint

func (*UserUpdateParams) IsNil

func (p *UserUpdateParams) IsNil() bool

IsNil checks to see if any values has been set for the paramater

func (*UserUpdateParams) ToURLVals

func (p *UserUpdateParams) ToURLVals(path string) (string, error)

ToURLVals converts struct values to url.values and encodes it on the supplied path

func (*UserUpdateParams) VerifyData

func (p *UserUpdateParams) VerifyData() error

VerifyData verifies outgoing data sets

type WalletInfo

type WalletInfo struct {
	Account          int64    `json:"account"`
	Addr             string   `json:"addr"`
	Amount           int64    `json:"amount"`
	ConfirmedDebit   int64    `json:"confirmedDebit"`
	Currency         string   `json:"currency"`
	DeltaAmount      int64    `json:"deltaAmount"`
	DeltaDeposited   int64    `json:"deltaDeposited"`
	DeltaTransferIn  int64    `json:"deltaTransferIn"`
	DeltaTransferOut int64    `json:"deltaTransferOut"`
	DeltaWithdrawn   int64    `json:"deltaWithdrawn"`
	Deposited        int64    `json:"deposited"`
	PendingCredit    int64    `json:"pendingCredit"`
	PendingDebit     int64    `json:"pendingDebit"`
	PrevAmount       int64    `json:"prevAmount"`
	PrevDeposited    int64    `json:"prevDeposited"`
	PrevTimestamp    string   `json:"prevTimestamp"`
	PrevTransferIn   int64    `json:"prevTransferIn"`
	PrevTransferOut  int64    `json:"prevTransferOut"`
	PrevWithdrawn    int64    `json:"prevWithdrawn"`
	Script           string   `json:"script"`
	Timestamp        string   `json:"timestamp"`
	TransferIn       int64    `json:"transferIn"`
	TransferOut      int64    `json:"transferOut"`
	WithdrawalLock   []string `json:"withdrawalLock"`
	Withdrawn        int64    `json:"withdrawn"`
}

WalletInfo wallet information

type WebsocketErrorResponse

type WebsocketErrorResponse struct {
	Status  int              `json:"status"`
	Error   string           `json:"error"`
	Meta    interface{}      `json:"meta"`
	Request WebsocketRequest `json:"request"`
}

WebsocketErrorResponse main error response

type WebsocketMainResponse

type WebsocketMainResponse struct {
	Table string   `json:"table"`
	Keys  []string `json:"keys"`
	Types struct {
		ID     string `json:"id"`
		Price  string `json:"price"`
		Side   string `json:"side"`
		Size   string `json:"size"`
		Symbol string `json:"symbol"`
	} `json:"types"`
	ForeignKeys struct {
		Side   string `json:"side"`
		Symbol string `json:"symbol"`
	} `json:"foreignKeys"`
	Attributes struct {
		ID     string `json:"id"`
		Symbol string `json:"symbol"`
	} `json:"Attributes"`
}

WebsocketMainResponse main table defined response

type WebsocketRequest

type WebsocketRequest struct {
	Command   string        `json:"op"`
	Arguments []interface{} `json:"args"`
}

WebsocketRequest is the main request type

type WebsocketSubscribeResp

type WebsocketSubscribeResp struct {
	Success   bool             `json:"success"`
	Subscribe string           `json:"subscribe"`
	Request   WebsocketRequest `json:"request"`
}

WebsocketSubscribeResp is a response that occurs after a subscription

type WebsocketWelcome

type WebsocketWelcome struct {
	Info      string `json:"info"`
	Version   string `json:"version"`
	Timestamp string `json:"timestamp"`
	Docs      string `json:"docs"`
	Limit     struct {
		Remaining int64 `json:"remaining"`
	} `json:"limit"`
}

WebsocketWelcome initial welcome type

type WsAffiliateResponse

type WsAffiliateResponse struct {
	WsDataResponse
	ForeignKeys interface{}                   `json:"foreignKeys"`
	Attributes  WsAffiliateResponseAttributes `json:"attributes"`
	Filter      WsAffiliateResponseFilter     `json:"filter"`
	Data        []interface{}                 `json:"data"`
}

WsAffiliateResponse private api response

type WsAffiliateResponseAttributes

type WsAffiliateResponseAttributes struct {
	Account  string `json:"account"`
	Currency string `json:"currency"`
}

WsAffiliateResponseAttributes private api data

type WsAffiliateResponseFilter

type WsAffiliateResponseFilter struct {
	Account int64 `json:"account"`
}

WsAffiliateResponseFilter private api data

type WsDataResponse

type WsDataResponse struct {
	Table  string            `json:"table"`
	Action string            `json:"action"`
	Keys   []string          `json:"keys"`
	Types  map[string]string `json:"types"`
}

WsDataResponse contains common elements

type WsExecutionResponse

type WsExecutionResponse struct {
	WsDataResponse
	ForeignKeys WsExecutionResponseForeignKeys `json:"foreignKeys"`
	Attributes  WsExecutionResponseAttributes  `json:"attributes"`
	Filter      WsExecutionResponseFilter      `json:"filter"`
	Data        []interface{}                  `json:"data"`
}

WsExecutionResponse private api response

type WsExecutionResponseAttributes

type WsExecutionResponseAttributes struct {
	ExecID       string `json:"execID"`
	Account      string `json:"account"`
	ExecType     string `json:"execType"`
	TransactTime string `json:"transactTime"`
}

WsExecutionResponseAttributes private api data

type WsExecutionResponseFilter

type WsExecutionResponseFilter struct {
	Account int64  `json:"account"`
	Symbol  string `json:"symbol"`
}

WsExecutionResponseFilter private api data

type WsExecutionResponseForeignKeys

type WsExecutionResponseForeignKeys struct {
	Symbol    string `json:"symbol"`
	Side      string `json:"side"`
	OrdStatus string `json:"ordStatus"`
}

WsExecutionResponseForeignKeys private api data

type WsMarginResponse

type WsMarginResponse struct {
	WsDataResponse
	ForeignKeys interface{}                `json:"foreignKeys"`
	Attributes  WsMarginResponseAttributes `json:"attributes"`
	Filter      WsMarginResponseFilter     `json:"filter"`
	Data        []WsMarginResponseData     `json:"data"`
}

WsMarginResponse private api response

type WsMarginResponseAttributes

type WsMarginResponseAttributes struct {
	Account  string `json:"account"`
	Currency string `json:"currency"`
}

WsMarginResponseAttributes private api data

type WsMarginResponseData

type WsMarginResponseData struct {
	Account            int64       `json:"account"`
	Currency           string      `json:"currency"`
	RiskLimit          float64     `json:"riskLimit"`
	PrevState          string      `json:"prevState"`
	State              string      `json:"state"`
	Action             string      `json:"action"`
	Amount             float64     `json:"amount"`
	PendingCredit      float64     `json:"pendingCredit"`
	PendingDebit       float64     `json:"pendingDebit"`
	ConfirmedDebit     float64     `json:"confirmedDebit"`
	PrevRealisedPnl    float64     `json:"prevRealisedPnl"`
	PrevUnrealisedPnl  float64     `json:"prevUnrealisedPnl"`
	GrossComm          float64     `json:"grossComm"`
	GrossOpenCost      float64     `json:"grossOpenCost"`
	GrossOpenPremium   float64     `json:"grossOpenPremium"`
	GrossExecCost      float64     `json:"grossExecCost"`
	GrossMarkValue     float64     `json:"grossMarkValue"`
	RiskValue          float64     `json:"riskValue"`
	TaxableMargin      float64     `json:"taxableMargin"`
	InitMargin         float64     `json:"initMargin"`
	MaintMargin        float64     `json:"maintMargin"`
	SessionMargin      float64     `json:"sessionMargin"`
	TargetExcessMargin float64     `json:"targetExcessMargin"`
	VarMargin          float64     `json:"varMargin"`
	RealisedPnl        float64     `json:"realisedPnl"`
	UnrealisedPnl      float64     `json:"unrealisedPnl"`
	IndicativeTax      float64     `json:"indicativeTax"`
	UnrealisedProfit   float64     `json:"unrealisedProfit"`
	SyntheticMargin    interface{} `json:"syntheticMargin"`
	WalletBalance      float64     `json:"walletBalance"`
	MarginBalance      float64     `json:"marginBalance"`
	MarginBalancePcnt  float64     `json:"marginBalancePcnt"`
	MarginLeverage     float64     `json:"marginLeverage"`
	MarginUsedPcnt     float64     `json:"marginUsedPcnt"`
	ExcessMargin       float64     `json:"excessMargin"`
	ExcessMarginPcnt   float64     `json:"excessMarginPcnt"`
	AvailableMargin    float64     `json:"availableMargin"`
	WithdrawableMargin float64     `json:"withdrawableMargin"`
	Timestamp          string      `json:"timestamp"`
	GrossLastValue     float64     `json:"grossLastValue"`
	Commission         interface{} `json:"commission"`
}

WsMarginResponseData private api data

type WsMarginResponseFilter

type WsMarginResponseFilter struct {
	Account int64 `json:"account"`
}

WsMarginResponseFilter private api data

type WsOrderResponse

type WsOrderResponse struct {
	WsDataResponse
	ForeignKeys WsOrderResponseForeignKeys `json:"foreignKeys"`
	Attributes  WsOrderResponseAttributes  `json:"attributes"`
	Filter      WsOrderResponseFilter      `json:"filter"`
	Data        []interface{}              `json:"data"`
}

WsOrderResponse private api response

type WsOrderResponseAttributes

type WsOrderResponseAttributes struct {
	OrderID          string `json:"orderID"`
	Account          string `json:"account"`
	OrdStatus        string `json:"ordStatus"`
	WorkingIndicator string `json:"workingIndicator"`
}

WsOrderResponseAttributes private api data

type WsOrderResponseFilter

type WsOrderResponseFilter struct {
	Account int64 `json:"account"`
}

WsOrderResponseFilter private api data

type WsOrderResponseForeignKeys

type WsOrderResponseForeignKeys struct {
	Symbol    string `json:"symbol"`
	Side      string `json:"side"`
	OrdStatus string `json:"ordStatus"`
}

WsOrderResponseForeignKeys private api data

type WsPositionResponse

type WsPositionResponse struct {
	WsDataResponse
	ForeignKeys WsPositionResponseForeignKeys `json:"foreignKeys"`
	Attributes  WsPositionResponseAttributes  `json:"attributes"`
	Filter      WsPositionResponseFilter      `json:"filter"`
	Data        []interface{}                 `json:"data"`
}

WsPositionResponse private api response

type WsPositionResponseAttributes

type WsPositionResponseAttributes struct {
	Account       string `json:"account"`
	Symbol        string `json:"symbol"`
	Currency      string `json:"currency"`
	Underlying    string `json:"underlying"`
	QuoteCurrency string `json:"quoteCurrency"`
}

WsPositionResponseAttributes private api data

type WsPositionResponseFilter

type WsPositionResponseFilter struct {
	Account int64  `json:"account"`
	Symbol  string `json:"symbol"`
}

WsPositionResponseFilter private api data

type WsPositionResponseForeignKeys

type WsPositionResponseForeignKeys struct {
	Symbol string `json:"symbol"`
}

WsPositionResponseForeignKeys private api data

type WsPrivateNotificationsResponse

type WsPrivateNotificationsResponse struct {
	Table  string        `json:"table"`
	Action string        `json:"action"`
	Data   []interface{} `json:"data"`
}

WsPrivateNotificationsResponse private api response

type WsTransactResponse

type WsTransactResponse struct {
	WsDataResponse
	ForeignKeys interface{}                  `json:"foreignKeys"`
	Attributes  WsTransactResponseAttributes `json:"attributes"`
	Filter      WsTransactResponseFilter     `json:"filter"`
	Data        []interface{}                `json:"data"`
}

WsTransactResponse private api response

type WsTransactResponseAttributes

type WsTransactResponseAttributes struct {
	TransactID   string `json:"transactID"`
	TransactTime string `json:"transactTime"`
}

WsTransactResponseAttributes private api data

type WsTransactResponseFilter

type WsTransactResponseFilter struct {
	Account int64 `json:"account"`
}

WsTransactResponseFilter private api data

type WsWalletResponse

type WsWalletResponse struct {
	WsDataResponse
	ForeignKeys interface{}                `json:"foreignKeys"`
	Attributes  WsWalletResponseAttributes `json:"attributes"`
	Filter      WsWalletResponseFilter     `json:"filter"`
	Data        []WsWalletResponseData     `json:"data"`
}

WsWalletResponse private api response

type WsWalletResponseAttributes

type WsWalletResponseAttributes struct {
	Account  string `json:"account"`
	Currency string `json:"currency"`
}

WsWalletResponseAttributes private api data

type WsWalletResponseData

type WsWalletResponseData struct {
	Account          int64         `json:"account"`
	Currency         string        `json:"currency"`
	PrevDeposited    float64       `json:"prevDeposited"`
	PrevWithdrawn    float64       `json:"prevWithdrawn"`
	PrevTransferIn   float64       `json:"prevTransferIn"`
	PrevTransferOut  float64       `json:"prevTransferOut"`
	PrevAmount       float64       `json:"prevAmount"`
	PrevTimestamp    string        `json:"prevTimestamp"`
	DeltaDeposited   float64       `json:"deltaDeposited"`
	DeltaWithdrawn   float64       `json:"deltaWithdrawn"`
	DeltaTransferIn  float64       `json:"deltaTransferIn"`
	DeltaTransferOut float64       `json:"deltaTransferOut"`
	DeltaAmount      float64       `json:"deltaAmount"`
	Deposited        float64       `json:"deposited"`
	Withdrawn        float64       `json:"withdrawn"`
	TransferIn       float64       `json:"transferIn"`
	TransferOut      float64       `json:"transferOut"`
	Amount           float64       `json:"amount"`
	PendingCredit    float64       `json:"pendingCredit"`
	PendingDebit     float64       `json:"pendingDebit"`
	ConfirmedDebit   int64         `json:"confirmedDebit"`
	Timestamp        string        `json:"timestamp"`
	Addr             string        `json:"addr"`
	Script           string        `json:"script"`
	WithdrawalLock   []interface{} `json:"withdrawalLock"`
}

WsWalletResponseData private api data

type WsWalletResponseFilter

type WsWalletResponseFilter struct {
	Account int64 `json:"account"`
}

WsWalletResponseFilter private api data

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL