package
0.0.0-20250311023717-5c21e974eed8
Repository: https://github.com/thrasher-corp/gocryptotrader.git
Documentation: pkg.go.dev

# README

GoCryptoTrader package Kraken

Build Status Software License GoDoc Coverage Status Go Report Card

This kraken package is part of the GoCryptoTrader codebase.

This is still in active development

You can track ideas, planned features and what's in progress on our GoCryptoTrader Kanban board.

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

Kraken 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 k exchange.IBotExchange

for i := range bot.Exchanges {
	if bot.Exchanges[i].GetName() == "Kraken" {
		k = bot.Exchanges[i]
	}
}

// Public calls - wrapper functions

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

// Fetches current orderbook information
ob, err := k.UpdateOrderbook(...)
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 := k.GetAccountInfo()
if err != nil {
	// Handle error
}
  • If enabled via individually importing package, rudimentary example below:
// Public calls

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

// Fetches current orderbook information
ob, err := k.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 := k.GetUserInfo(...)
if err != nil {
	// Handle error
}

// Submits an order and the exchange and returns its tradeID
tradeID, err := k.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:

bc1qk0jareu4jytc0cfrhr5wgshsq8282awpavfahc

# Constants

ChannelCandlesTimeframeKey configures the candle bar timeframe in stream.ChannelSubscription.Params.
ChannelOrderbookDepthKey configures the orderbook depth in stream.ChannelSubscription.Params.

# Variables

DepositFees the large list of predefined deposit fees Prone to change.
RequestParamsTimeGTC GTC.
RequestParamsTimeIOC IOC.
WithdrawalFees the large list of predefined withdrawal fees Prone to change.

# Structs

AccountsData stores data of an account.
AddOrderOptions represents the AddOrder options.
AddOrderResponse type.
Asset holds asset information.
AssetPairs holds asset pair information.
Balance represents account asset balances.
BatchOrderData stores batch order data.
CancelAllOrdersData stores order data for all cancelled orders.
CancelOrderResponse type.
CancelOrdersAfterData stores data of all orders after a certain time that are cancelled.
ClosedOrders type.
DepositAddress defines a deposit address.
DepositMethods Used to check deposit fees.
ExecutionData stores execution data.
FOpenOrdersData stores open orders data for futures.
FuturesAccountsData stores account data.
FuturesCancelOrderData stores cancel order data for futures.
FuturesCandle is an individual candle.
FuturesCandles is the response when requesting futures candles.
FuturesEditedOrderData stores an edited order's data.
FuturesFillsData stores fills data.
FuturesInstrumentData stores info for futures market.
FuturesNotificationData stores notification data.
FuturesOpenOrdersData stores open orders data for futures.
FuturesOpenPositions stores open positions data for futures.
FuturesOrderbookData stores orderbook data for futures.
FuturesOrderData stores order data.
FuturesPublicTrades returns public trade data a terrible type for parsing data.
FuturesRecentOrdersData stores recent orders data.
FuturesSendOrderData stores send order data.
FuturesTicker holds futures ticker data.
FuturesTickerData stores info for futures ticker.
FuturesTickersData stores info for futures tickers.
FuturesTradeHistoryData stores trade history data for futures.
FuturesTradeOrderData holds additional order details for a futures trade order.
FuturesTransferData stores transfer data.
FutureTradeOrder holds details about the order for a futures trade.
GenericResponse stores general response data for functions that only return success.
GetClosedOrdersOptions type.
GetLedgersOptions type.
GetTradesHistoryOptions type.
Kraken is the overarching type across the kraken package.
LedgerInfo type.
Ledgers type.
OpenHighLowClose contains ticker event information.
OpenOrders type.
Orderbook stores the bids and asks orderbook data.
OrderbookBase stores the orderbook price and amount data.
OrderDescription represents an orders description.
OrderInfo type.
OrderInfoOptions type.
OrderVars stores side, status and type for any order/trade.
PlaceBatchOrderData stores data required to place a batch order.
Position holds the opened position.
RecentOrderData stores order data of a recent order.
RecentTrades holds recent trade data.
Spread holds the spread between trades.
Ticker is a standard ticker type.
TickerResponse holds ticker information before its put into the Ticker struct.
TimeResponse type.
TradeBalanceInfo type.
TradeBalanceOptions type.
TradeInfo type.
TradesHistory type.
TradeVolumeFee type.
TradeVolumeResponse type.
WebsocketErrorResponse defines a websocket error response.
WebsocketEventResponse holds all data response types.
WebsocketSubRequest contains request data for Subscribe/Unsubscribe to channels.
WebsocketSubscriptionData contains details on WS channel.
WebsocketSubscriptionEventResponse defines a websocket socket event response.
WebsocketSubscriptionResponseData defines a websocket subscription response.
WithdrawInformation Used to check withdrawal fees.
WithdrawStatusResponse defines a withdrawal status response.
WsAccountBalancesAndMargin stores account balances and margin data for futures websocket.
WsAddOrderRequest request type for ws adding order.
WsAddOrderResponse response data for ws order.
WsCancelOrderRequest request for ws cancel order.
WsCancelOrderResponse response data for ws cancel order and ws cancel all orders.
WsFuturesAccountLog stores account log data for futures websocket.
WsFuturesFillsData stores fills data for futures websocket.
WsFuturesNotifications stores notifications data for futures websocket.
WsFuturesOB stores orderbook data for futures websocket.
WsFuturesOpenOrders stores open orders data for futures websocket.
WSFuturesTickerData stores ws ticker data for futures websocket.
WsFuturesTickerLite stores ticker lite data for futures websocket.
WsFuturesTradeData stores public trade data for futures websocket.
WsOpenOrder contains all open order data from ws feed.
WsOpenOrderDescription additional data for WsOpenOrders.
WsOpenOrders ws auth open order data.
WsOpenPositions stores open positions data for futures websocket.
WsOwnTrade ws auth owntrade data.
WsTokenResponse holds the WS auth token.
WsVerboseOpenOrders stores verbose open orders data for futures websocket.

# Type aliases

RequestParamsTimeForceType Time in force.
Tickers stores a map of tickers.