Documentation ¶
Overview ¶
Package gemini exchange documentation can be found at https://docs.sandbox.gemini.com
Index ¶
- type Auction
- type AuctionHistory
- type Balance
- type DepositAddress
- type ErrorCapture
- type Event
- type Gemini
- func (g *Gemini) AuthenticateWebsocket() error
- func (g *Gemini) CancelAllOrders(_ *exchange.OrderCancellation) (exchange.CancelAllOrdersResponse, error)
- func (g *Gemini) CancelExistingOrder(orderID int64) (Order, error)
- func (g *Gemini) CancelExistingOrders(cancelBySession bool) (OrderResult, error)
- func (g *Gemini) CancelOrder(order *exchange.OrderCancellation) error
- func (g *Gemini) GetAccountInfo() (exchange.AccountInfo, error)
- func (g *Gemini) GetActiveOrders(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)
- func (g *Gemini) GetAuction(currencyPair string) (Auction, error)
- func (g *Gemini) GetAuctionHistory(currencyPair string, params url.Values) ([]AuctionHistory, error)
- func (g *Gemini) GetBalances() ([]Balance, error)
- func (g *Gemini) GetCryptoDepositAddress(depositAddlabel, currency string) (DepositAddress, error)
- func (g *Gemini) GetDepositAddress(cryptocurrency currency.Code, _ string) (string, error)
- func (g *Gemini) GetExchangeHistory(p currency.Pair, assetType string) ([]exchange.TradeHistory, error)
- func (g *Gemini) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)
- func (g *Gemini) GetFeeByType(feeBuilder *exchange.FeeBuilder) (float64, error)
- func (g *Gemini) GetFundingHistory() ([]exchange.FundHistory, error)
- func (g *Gemini) GetNotionalVolume() (NotionalVolume, error)
- func (g *Gemini) GetOrderHistory(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)
- func (g *Gemini) GetOrderInfo(orderID string) (exchange.OrderDetail, error)
- func (g *Gemini) GetOrderStatus(orderID int64) (Order, error)
- func (g *Gemini) GetOrderbook(currencyPair string, params url.Values) (Orderbook, error)
- func (g *Gemini) GetOrderbookEx(p currency.Pair, assetType string) (orderbook.Base, error)
- func (g *Gemini) GetOrders() ([]Order, error)
- func (g *Gemini) GetSubscriptions() ([]wshandler.WebsocketChannelSubscription, error)
- func (g *Gemini) GetSymbols() ([]string, error)
- func (g *Gemini) GetTicker(currencyPair string) (Ticker, error)
- func (g *Gemini) GetTickerPrice(p currency.Pair, assetType string) (ticker.Price, error)
- func (g *Gemini) GetTradeHistory(currencyPair string, timestamp int64) ([]TradeHistory, error)
- func (g *Gemini) GetTradeVolume() ([][]TradeVolume, error)
- func (g *Gemini) GetTrades(currencyPair string, params url.Values) ([]Trade, error)
- func (g *Gemini) GetWebsocket() (*wshandler.Websocket, error)
- func (g *Gemini) ModifyOrder(action *exchange.ModifyOrder) (string, error)
- func (g *Gemini) NewOrder(symbol string, amount, price float64, side, orderType string) (int64, error)
- func (g *Gemini) PostHeartbeat() (string, error)
- func (g *Gemini) Run()
- func (g *Gemini) SendAuthenticatedHTTPRequest(method, path string, params map[string]interface{}, result interface{}) (err error)
- func (g *Gemini) SendHTTPRequest(path string, result interface{}) error
- func (g *Gemini) SetDefaults()
- func (g *Gemini) Setup(exch *config.ExchangeConfig)
- func (g *Gemini) Start(wg *sync.WaitGroup)
- func (g *Gemini) SubmitOrder(p currency.Pair, side exchange.OrderSide, orderType exchange.OrderType, ...) (exchange.SubmitOrderResponse, error)
- func (g *Gemini) SubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error
- func (g *Gemini) UnsubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error
- func (g *Gemini) UpdateOrderbook(p currency.Pair, assetType string) (orderbook.Base, error)
- func (g *Gemini) UpdateTicker(p currency.Pair, assetType string) (ticker.Price, error)
- func (g *Gemini) WithdrawCrypto(address, currency string, amount float64) (WithdrawalAddress, error)
- func (g *Gemini) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)
- func (g *Gemini) WithdrawFiatFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)
- func (g *Gemini) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.WithdrawRequest) (string, error)
- func (g *Gemini) WsConnect() error
- func (g *Gemini) WsHandleData()
- func (g *Gemini) WsReadData(ws *wshandler.WebsocketConnection, c currency.Pair)
- func (g *Gemini) WsSecureSubscribe(dialer *websocket.Dialer, url string) error
- func (g *Gemini) WsSubscribe(dialer *websocket.Dialer) error
- type NotionalVolume
- type OneDayNotionalVolume
- type Order
- type OrderResult
- type Orderbook
- type OrderbookEntry
- type ReadData
- type Ticker
- type Trade
- type TradeHistory
- type TradeVolume
- type WithdrawalAddress
- type WsActiveOrdersResponse
- type WsHeartbeatResponse
- type WsMarketUpdateResponse
- type WsOrderBookedResponse
- type WsOrderCancellationRejectedResponse
- type WsOrderCancelledResponse
- type WsOrderClosedResponse
- type WsOrderFilledData
- type WsOrderFilledResponse
- type WsOrderRejectedResponse
- type WsRequestPayload
- type WsResponse
- type WsSubscriptionAcknowledgementResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auction ¶
type Auction struct { LastAuctionEID int64 `json:"last_auction_eid"` ClosedUntilMs int64 `json:"closed_until_ms"` LastAuctionPrice float64 `json:"last_auction_price,string"` LastAuctionQuantity float64 `json:"last_auction_quantity,string"` LastHighestBidPrice float64 `json:"last_highest_bid_price,string"` LastLowestAskPrice float64 `json:"last_lowest_ask_price,string"` NextAuctionMS int64 `json:"next_auction_ms"` NextUpdateMS int64 `json:"next_update_ms"` MostRecentIndicativePrice float64 `json:"most_recent_indicative_price,string"` MostRecentIndicativeQuantity float64 `json:"most_recent_indicative_quantity,string"` MostRecentHighestBidPrice float64 `json:"most_recent_highest_bid_price,string"` MostRecentLowestAskPrice float64 `json:"most_recent_lowest_ask_price,string"` }
Auction is generalized response type
type AuctionHistory ¶
type AuctionHistory struct { AuctionID int64 `json:"auction_id"` AuctionPrice float64 `json:"auction_price,string"` AuctionQuantity float64 `json:"auction_quantity,string"` EID int64 `json:"eid"` HighestBidPrice float64 `json:"highest_bid_price,string"` LowestAskPrice float64 `json:"lowest_ask_price,string"` AuctionResult string `json:"auction_result"` Timestamp int64 `json:"timestamp"` TimestampMS int64 `json:"timestampms"` EventType string `json:"event_type"` }
AuctionHistory holds auction history information
type Balance ¶
type Balance struct { Currency string `json:"currency"` Amount float64 `json:"amount,string"` Available float64 `json:"available,string"` }
Balance is a simple balance type
type DepositAddress ¶
type DepositAddress struct { Currency string `json:"currency"` Address string `json:"address"` Label string `json:"label"` Message string `json:"message"` }
DepositAddress holds assigned deposit address for a specific currency
type ErrorCapture ¶
type ErrorCapture struct { Result string `json:"result"` Reason string `json:"reason"` Message string `json:"message"` }
ErrorCapture is a generlized error response from the server
type Event ¶
type Event struct { Type string `json:"type"` Reason string `json:"reason"` Price float64 `json:"price,string"` Delta float64 `json:"delta,string"` Remaining float64 `json:"remaining,string"` Side string `json:"side"` MakerSide string `json:"makerSide"` Amount float64 `json:"amount,string"` }
Event defines orderbook and trade data
type Gemini ¶
type Gemini struct { AuthenticatedWebsocketConn *wshandler.WebsocketConnection exchange.Base Role string RequiresHeartBeat bool }
Gemini is the overarching type across the Gemini package, create multiple instances with differing APIkeys for segregation of roles for authenticated requests & sessions by appending new sessions to the Session map using AddSession, if sandbox test is needed append a new session with with the same API keys and change the IsSandbox variable to true.
func (*Gemini) AuthenticateWebsocket ¶
AuthenticateWebsocket sends an authentication message to the websocket
func (*Gemini) CancelAllOrders ¶
func (g *Gemini) CancelAllOrders(_ *exchange.OrderCancellation) (exchange.CancelAllOrdersResponse, error)
CancelAllOrders cancels all orders associated with a currency pair
func (*Gemini) CancelExistingOrder ¶
CancelExistingOrder will cancel an order. If the order is already canceled, the message will succeed but have no effect.
func (*Gemini) CancelExistingOrders ¶
func (g *Gemini) CancelExistingOrders(cancelBySession bool) (OrderResult, error)
CancelExistingOrders will cancel all outstanding orders created by all sessions owned by this account, including interactive orders placed through the UI. If sessions = true will only cancel the order that is called on this session asssociated with the APIKEY
func (*Gemini) CancelOrder ¶
func (g *Gemini) CancelOrder(order *exchange.OrderCancellation) error
CancelOrder cancels an order by its corresponding ID number
func (*Gemini) GetAccountInfo ¶
func (g *Gemini) GetAccountInfo() (exchange.AccountInfo, error)
GetAccountInfo Retrieves balances for all enabled currencies for the Gemini exchange
func (*Gemini) GetActiveOrders ¶
func (g *Gemini) GetActiveOrders(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)
GetActiveOrders retrieves any orders that are active/open
func (*Gemini) GetAuction ¶
GetAuction returns auction information
func (*Gemini) GetAuctionHistory ¶
func (g *Gemini) GetAuctionHistory(currencyPair string, params url.Values) ([]AuctionHistory, error)
GetAuctionHistory returns the auction events, optionally including publications of indicative prices, since the specific timestamp.
currencyPair - example "btcusd" params -- [optional]
since - [timestamp] Only returns auction events after the specified
timestamp.
limit_auction_results - [integer] The maximum number of auction
events to return.
include_indicative - [bool] Whether to include publication of
indicative prices and quantities.
func (*Gemini) GetBalances ¶
GetBalances returns available balances in the supported currencies
func (*Gemini) GetCryptoDepositAddress ¶
func (g *Gemini) GetCryptoDepositAddress(depositAddlabel, currency string) (DepositAddress, error)
GetCryptoDepositAddress returns a deposit address
func (*Gemini) GetDepositAddress ¶
GetDepositAddress returns a deposit address for a specified currency
func (*Gemini) GetExchangeHistory ¶
func (g *Gemini) GetExchangeHistory(p currency.Pair, assetType string) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data since exchange opening.
func (*Gemini) GetFee ¶
func (g *Gemini) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)
GetFee returns an estimate of fee based on type of transaction
func (*Gemini) GetFeeByType ¶
func (g *Gemini) GetFeeByType(feeBuilder *exchange.FeeBuilder) (float64, error)
GetFeeByType returns an estimate of fee based on type of transaction
func (*Gemini) GetFundingHistory ¶
func (g *Gemini) GetFundingHistory() ([]exchange.FundHistory, error)
GetFundingHistory returns funding history, deposits and withdrawals
func (*Gemini) GetNotionalVolume ¶
func (g *Gemini) GetNotionalVolume() (NotionalVolume, error)
GetNotionalVolume returns the volume in price currency that has been traded across all pairs over a period of 30 days
func (*Gemini) GetOrderHistory ¶
func (g *Gemini) GetOrderHistory(getOrdersRequest *exchange.GetOrdersRequest) ([]exchange.OrderDetail, error)
GetOrderHistory retrieves account order information Can Limit response to specific order status
func (*Gemini) GetOrderInfo ¶
func (g *Gemini) GetOrderInfo(orderID string) (exchange.OrderDetail, error)
GetOrderInfo returns information on a current open order
func (*Gemini) GetOrderStatus ¶
GetOrderStatus returns the status for an order
func (*Gemini) GetOrderbook ¶
GetOrderbook returns the current order book, as two arrays, one of bids, and one of asks
params - limit_bids or limit_asks [OPTIONAL] default 50, 0 returns all Values Type is an integer ie "params.Set("limit_asks", 30)"
func (*Gemini) GetOrderbookEx ¶
GetOrderbookEx returns orderbook base on the currency pair
func (*Gemini) GetSubscriptions ¶
func (g *Gemini) GetSubscriptions() ([]wshandler.WebsocketChannelSubscription, error)
GetSubscriptions returns a copied list of subscriptions
func (*Gemini) GetSymbols ¶
GetSymbols returns all available symbols for trading
func (*Gemini) GetTicker ¶
GetTicker returns information about recent trading activity for the symbol
func (*Gemini) GetTickerPrice ¶
GetTickerPrice returns the ticker for a currency pair
func (*Gemini) GetTradeHistory ¶
func (g *Gemini) GetTradeHistory(currencyPair string, timestamp int64) ([]TradeHistory, error)
GetTradeHistory returns an array of trades that have been on the exchange
currencyPair - example "btcusd" timestamp - [optional] Only return trades on or after this timestamp.
func (*Gemini) GetTradeVolume ¶
func (g *Gemini) GetTradeVolume() ([][]TradeVolume, error)
GetTradeVolume returns a multi-arrayed volume response
func (*Gemini) GetTrades ¶
GetTrades eturn the trades that have executed since the specified timestamp. Timestamps are either seconds or milliseconds since the epoch (1970-01-01).
currencyPair - example "btcusd" params -- since, timestamp [optional] limit_trades integer Optional. The maximum number of trades to return. include_breaks boolean Optional. Whether to display broken trades. False by default. Can be '1' or 'true' to activate
func (*Gemini) GetWebsocket ¶
GetWebsocket returns a pointer to the exchange websocket
func (*Gemini) ModifyOrder ¶
func (g *Gemini) ModifyOrder(action *exchange.ModifyOrder) (string, error)
ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (*Gemini) NewOrder ¶
func (g *Gemini) NewOrder(symbol string, amount, price float64, side, orderType string) (int64, error)
NewOrder Only limit orders are supported through the API at present. returns order ID if successful
func (*Gemini) PostHeartbeat ¶
PostHeartbeat sends a maintenance heartbeat to the exchange for all heartbeat maintaned sessions
func (*Gemini) SendAuthenticatedHTTPRequest ¶
func (g *Gemini) SendAuthenticatedHTTPRequest(method, path string, params map[string]interface{}, result interface{}) (err error)
SendAuthenticatedHTTPRequest sends an authenticated HTTP request to the exchange and returns an error
func (*Gemini) SendHTTPRequest ¶
SendHTTPRequest sends an unauthenticated request
func (*Gemini) SetDefaults ¶
func (g *Gemini) SetDefaults()
SetDefaults sets package defaults for gemini exchange
func (*Gemini) Setup ¶
func (g *Gemini) Setup(exch *config.ExchangeConfig)
Setup sets exchange configuration parameters
func (*Gemini) SubmitOrder ¶
func (g *Gemini) SubmitOrder(p currency.Pair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, _ string) (exchange.SubmitOrderResponse, error)
SubmitOrder submits a new order
func (*Gemini) SubscribeToWebsocketChannels ¶
func (g *Gemini) SubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error
SubscribeToWebsocketChannels appends to ChannelsToSubscribe which lets websocket.manageSubscriptions handle subscribing
func (*Gemini) UnsubscribeToWebsocketChannels ¶
func (g *Gemini) UnsubscribeToWebsocketChannels(channels []wshandler.WebsocketChannelSubscription) error
UnsubscribeToWebsocketChannels removes from ChannelsToSubscribe which lets websocket.manageSubscriptions handle unsubscribing
func (*Gemini) UpdateOrderbook ¶
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*Gemini) UpdateTicker ¶
UpdateTicker updates and returns the ticker for a currency pair
func (*Gemini) WithdrawCrypto ¶
func (g *Gemini) WithdrawCrypto(address, currency string, amount float64) (WithdrawalAddress, error)
WithdrawCrypto withdraws crypto currency to a whitelisted address
func (*Gemini) WithdrawCryptocurrencyFunds ¶
func (g *Gemini) WithdrawCryptocurrencyFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)
WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted
func (*Gemini) WithdrawFiatFunds ¶
func (g *Gemini) WithdrawFiatFunds(withdrawRequest *exchange.WithdrawRequest) (string, error)
WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted
func (*Gemini) WithdrawFiatFundsToInternationalBank ¶
func (g *Gemini) WithdrawFiatFundsToInternationalBank(withdrawRequest *exchange.WithdrawRequest) (string, error)
WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
func (*Gemini) WsHandleData ¶
func (g *Gemini) WsHandleData()
WsHandleData handles all the websocket data coming from the websocket connection
func (*Gemini) WsReadData ¶
func (g *Gemini) WsReadData(ws *wshandler.WebsocketConnection, c currency.Pair)
WsReadData reads from the websocket connection and returns the websocket response
func (*Gemini) WsSecureSubscribe ¶
WsSecureSubscribe will connect to Gemini's secure endpoint
type NotionalVolume ¶
type NotionalVolume struct { APIAuctionFeeBPS int64 `json:"api_auction_fee_bps"` APIMakerFeeBPS int64 `json:"api_maker_fee_bps"` APITakerFeeBPS int64 `json:"api_taker_fee_bps"` BlockMakerFeeBPS int64 `json:"block_maker_fee_bps"` BlockTakerFeeBPS int64 `json:"block_taker_fee_bps"` FixAuctionFeeBPS int64 `json:"fix_auction_fee_bps"` FixMakerFeeBPS int64 `json:"fix_maker_fee_bps"` FixTakerFeeBPS int64 `json:"fix_taker_fee_bps"` OneDayNotionalVolumes []OneDayNotionalVolume `json:"notional_1d_volume"` ThirtyDayVolume float64 `json:"notional_30d_volume"` WebAuctionFeeBPS int64 `json:"web_auction_fee_bps"` WebMakerFeeBPS int64 `json:"web_maker_fee_bps"` WebTakerFeeBPS int64 `json:"web_taker_fee_bps"` LastedUpdated int64 `json:"last_updated_ms"` Date string `json:"date"` }
NotionalVolume api call for fees, all return fee amounts are in basis points
type OneDayNotionalVolume ¶
type OneDayNotionalVolume struct { Date string `json:"date"` NotationalVolume float64 `json:"notional_volume"` }
OneDayNotionalVolume Contains the notioanl volume for a single day
type Order ¶
type Order struct { OrderID int64 `json:"order_id,string"` ID int64 `json:"id,string"` ClientOrderID string `json:"client_order_id"` Symbol string `json:"symbol"` Exchange string `json:"exchange"` Price float64 `json:"price,string"` AvgExecutionPrice float64 `json:"avg_execution_price,string"` Side string `json:"side"` Type string `json:"type"` Timestamp int64 `json:"timestamp,string"` TimestampMS int64 `json:"timestampms"` IsLive bool `json:"is_live"` IsCancelled bool `json:"is_cancelled"` IsHidden bool `json:"is_hidden"` Options []string `json:"options"` WasForced bool `json:"was_forced"` ExecutedAmount float64 `json:"executed_amount,string"` RemainingAmount float64 `json:"remaining_amount,string"` OriginalAmount float64 `json:"original_amount,string"` Message string `json:"message"` }
Order contains order information
type OrderResult ¶
type OrderResult struct { Result string `json:"result"` Details struct { CancelledOrders []string `json:"cancelledOrders"` CancelRejects []string `json:"cancelRejects"` } `json:"details"` Message string `json:"message"` }
OrderResult holds cancelled order information
type Orderbook ¶
type Orderbook struct { Bids []OrderbookEntry `json:"bids"` Asks []OrderbookEntry `json:"asks"` }
Orderbook contains orderbook information for both bid and ask side
type OrderbookEntry ¶
type OrderbookEntry struct { Price float64 `json:"price,string"` Amount float64 `json:"amount,string"` }
OrderbookEntry subtype of orderbook information
type Ticker ¶
type Ticker struct { Ask float64 `json:"ask,string"` Bid float64 `json:"bid,string"` Last float64 `json:"last,string"` Volume struct { Currency float64 USD float64 BTC float64 ETH float64 Timestamp int64 } }
Ticker holds returned ticker data from the exchange
type Trade ¶
type Trade struct { Timestamp int64 `json:"timestamp"` Timestampms int64 `json:"timestampms"` TID int64 `json:"tid"` Price float64 `json:"price,string"` Amount float64 `json:"amount,string"` Exchange string `json:"exchange"` Side string `json:"type"` }
Trade holds trade history for a specific currency pair
type TradeHistory ¶
type TradeHistory struct { Price float64 `json:"price,string"` Amount float64 `json:"amount,string"` Timestamp int64 `json:"timestamp"` TimestampMS int64 `json:"timestampms"` Type string `json:"type"` FeeCurrency string `json:"fee_currency"` FeeAmount float64 `json:"fee_amount,string"` TID int64 `json:"tid"` OrderID int64 `json:"order_id,string"` Exchange string `json:"exchange"` IsAuctionFilled bool `json:"is_auction_fill"` ClientOrderID string `json:"client_order_id"` // Used to store values BaseCurrency string QuoteCurrency string }
TradeHistory holds trade history information
type TradeVolume ¶
type TradeVolume struct { AccountID int64 `json:"account_id"` Symbol string `json:"symbol"` BaseCurrency string `json:"base_currency"` NotionalCurrency string `json:"notional_currency"` Date string `json:"date_date"` TotalVolumeBase float64 `json:"total_volume_base"` MakerBuySellRatio float64 `json:"maker_buy_sell_ratio"` BuyMakerBase float64 `json:"buy_maker_base"` BuyMakerNotional float64 `json:"buy_maker_notional"` BuyMakerCount float64 `json:"buy_maker_count"` SellMakerBase float64 `json:"sell_maker_base"` SellMakerNotional float64 `json:"sell_maker_notional"` SellMakerCount float64 `json:"sell_maker_count"` BuyTakerBase float64 `json:"buy_taker_base"` BuyTakerNotional float64 `json:"buy_taker_notional"` BuyTakerCount float64 `json:"buy_taker_count"` SellTakerBase float64 `json:"sell_taker_base"` SellTakerNotional float64 `json:"sell_taker_notional"` SellTakerCount float64 `json:"sell_taker_count"` }
TradeVolume holds Volume information
type WithdrawalAddress ¶
type WithdrawalAddress struct { Address string `json:"address"` Amount float64 `json:"amount"` TXHash string `json:"txHash"` Message string `json:"message"` Result string `json:"result"` Reason string `json:"reason"` }
WithdrawalAddress holds withdrawal information
type WsActiveOrdersResponse ¶
type WsActiveOrdersResponse struct { Type string `json:"type"` OrderID string `json:"order_id"` APISession string `json:"api_session"` Symbol currency.Pair `json:"symbol"` Side string `json:"side"` OrderType string `json:"order_type"` Timestamp string `json:"timestamp"` Timestampms int64 `json:"timestampms"` IsLive bool `json:"is_live"` IsCancelled bool `json:"is_cancelled"` IsHidden bool `json:"is_hidden"` AvgExecutionPrice float64 `json:"avg_execution_price,string"` ExecutedAmount float64 `json:"executed_amount,string"` RemainingAmount float64 `json:"remaining_amount,string"` OriginalAmount float64 `json:"original_amount,string"` Price float64 `json:"price,string"` SocketSequence int64 `json:"socket_sequence"` }
WsActiveOrdersResponse contains active orders
type WsHeartbeatResponse ¶
type WsHeartbeatResponse struct { Type string `json:"type"` Timestampms int64 `json:"timestampms"` Sequence int64 `json:"sequence"` TraceID string `json:"trace_id"` SocketSequence int64 `json:"socket_sequence"` }
WsHeartbeatResponse Gemini will send a heartbeat every five seconds so you'll know your WebSocket connection is active.
type WsMarketUpdateResponse ¶
type WsMarketUpdateResponse struct { Type string `json:"type"` EventID int64 `json:"eventId"` Timestamp int64 `json:"timestamp"` TimestampMS int64 `json:"timestampms"` SocketSequence int64 `json:"socket_sequence"` Events []Event `json:"events"` }
WsMarketUpdateResponse defines the main response type
type WsOrderBookedResponse ¶
type WsOrderBookedResponse struct { Type string `json:"type"` OrderID string `json:"order_id"` EventID string `json:"event_id"` APISession string `json:"api_session"` Symbol currency.Pair `json:"symbol"` Side string `json:"side"` OrderType string `json:"order_type"` Timestamp string `json:"timestamp"` Timestampms int64 `json:"timestampms"` IsLive bool `json:"is_live"` IsCancelled bool `json:"is_cancelled"` IsHidden bool `json:"is_hidden"` AvgExecutionPrice float64 `json:"avg_execution_price,string"` ExecutedAmount float64 `json:"executed_amount,string"` RemainingAmount float64 `json:"remaining_amount,string"` OriginalAmount float64 `json:"original_amount,string"` Price float64 `json:"price,string"` SocketSequence int64 `json:"socket_sequence"` }
WsOrderBookedResponse ws response
type WsOrderCancellationRejectedResponse ¶
type WsOrderCancellationRejectedResponse struct { Type string `json:"type"` OrderID string `json:"order_id"` EventID string `json:"event_id"` CancelCommandID string `json:"cancel_command_id"` Reason string `json:"reason"` APISession string `json:"api_session"` Symbol currency.Pair `json:"symbol"` Side string `json:"side"` OrderType string `json:"order_type"` Timestamp string `json:"timestamp"` Timestampms int64 `json:"timestampms"` IsLive bool `json:"is_live"` IsCancelled bool `json:"is_cancelled"` IsHidden bool `json:"is_hidden"` AvgExecutionPrice float64 `json:"avg_execution_price,string"` ExecutedAmount float64 `json:"executed_amount,string"` RemainingAmount float64 `json:"remaining_amount,string"` OriginalAmount float64 `json:"original_amount,string"` Price float64 `json:"price,string"` SocketSequence int64 `json:"socket_sequence"` }
WsOrderCancellationRejectedResponse ws response
type WsOrderCancelledResponse ¶
type WsOrderCancelledResponse struct { Type string `json:"type"` OrderID string `json:"order_id"` EventID string `json:"event_id"` CancelCommandID string `json:"cancel_command_id,omitempty"` Reason string `json:"reason"` APISession string `json:"api_session"` Symbol currency.Pair `json:"symbol"` Side string `json:"side"` OrderType string `json:"order_type"` Timestamp string `json:"timestamp"` Timestampms int64 `json:"timestampms"` IsLive bool `json:"is_live"` IsCancelled bool `json:"is_cancelled"` IsHidden bool `json:"is_hidden"` AvgExecutionPrice float64 `json:"avg_execution_price,string"` ExecutedAmount float64 `json:"executed_amount,string"` RemainingAmount float64 `json:"remaining_amount,string"` OriginalAmount float64 `json:"original_amount,string"` Price float64 `json:"price,string"` SocketSequence int64 `json:"socket_sequence"` }
WsOrderCancelledResponse ws response
type WsOrderClosedResponse ¶
type WsOrderClosedResponse struct { Type string `json:"type"` OrderID string `json:"order_id"` EventID string `json:"event_id"` APISession string `json:"api_session"` Symbol currency.Pair `json:"symbol"` Side string `json:"side"` OrderType string `json:"order_type"` Timestamp string `json:"timestamp"` Timestampms int64 `json:"timestampms"` IsLive bool `json:"is_live"` IsCancelled bool `json:"is_cancelled"` IsHidden bool `json:"is_hidden"` AvgExecutionPrice float64 `json:"avg_execution_price,string"` ExecutedAmount float64 `json:"executed_amount,string"` RemainingAmount float64 `json:"remaining_amount,string"` OriginalAmount float64 `json:"original_amount,string"` Price float64 `json:"price,string"` SocketSequence int64 `json:"socket_sequence"` }
WsOrderClosedResponse ws response
type WsOrderFilledData ¶
type WsOrderFilledData struct { TradeID string `json:"trade_id"` Liquidity string `json:"liquidity"` Price float64 `json:"price,string"` Amount float64 `json:"amount,string"` Fee float64 `json:"fee,string"` FeeCurrency string `json:"fee_currency"` }
WsOrderFilledData ws response data
type WsOrderFilledResponse ¶
type WsOrderFilledResponse struct { Type string `json:"type"` OrderID string `json:"order_id"` APISession string `json:"api_session"` Symbol currency.Pair `json:"symbol"` Side string `json:"side"` OrderType string `json:"order_type"` Timestamp string `json:"timestamp"` Timestampms int64 `json:"timestampms"` IsLive bool `json:"is_live"` IsCancelled bool `json:"is_cancelled"` IsHidden bool `json:"is_hidden"` AvgExecutionPrice float64 `json:"avg_execution_price,string"` ExecutedAmount float64 `json:"executed_amount,string"` RemainingAmount float64 `json:"remaining_amount,string"` OriginalAmount float64 `json:"original_amount,string"` Price float64 `json:"price,string"` Fill WsOrderFilledData `json:"fill"` SocketSequence int64 `json:"socket_sequence"` }
WsOrderFilledResponse ws response
type WsOrderRejectedResponse ¶
type WsOrderRejectedResponse struct { Type string `json:"type"` OrderID string `json:"order_id"` EventID string `json:"event_id"` Reason string `json:"reason"` APISession string `json:"api_session"` Symbol currency.Pair `json:"symbol"` Side string `json:"side"` OrderType string `json:"order_type"` Timestamp string `json:"timestamp"` Timestampms int64 `json:"timestampms"` IsLive bool `json:"is_live"` OriginalAmount float64 `json:"original_amount,string"` Price float64 `json:"price,string"` SocketSequence int64 `json:"socket_sequence"` }
WsOrderRejectedResponse ws response
type WsRequestPayload ¶
WsRequestPayload Request info to subscribe to a WS enpoint
type WsSubscriptionAcknowledgementResponse ¶
type WsSubscriptionAcknowledgementResponse struct { Type string `json:"type"` AccountID int64 `json:"accountId"` SubscriptionID string `json:"subscriptionId"` SymbolFilter []string `json:"symbolFilter"` APISessionFilter []string `json:"apiSessionFilter"` EventTypeFilter []string `json:"eventTypeFilter"` }
WsSubscriptionAcknowledgementResponse The first message you receive acknowledges your subscription