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

# README

GoCryptoTrader package Coinut

Build Status Software License GoDoc Coverage Status Go Report Card

This coinut 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

Coinut Exchange

Current Features

  • REST Support
  • Websocket 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 c exchange.IBotExchange

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

// Public calls - wrapper functions

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

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

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

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

// Submits an order and the exchange and returns its tradeID
tradeID, err := c.Trade(...)
if err != nil {
	// Handle error
}

How to do Websocket public/private calls

	// Exchanges will be abstracted out in further updates and examples will be
	// supplied then

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

# Structs

CancelOrders holds information about a cancelled order.
CancelOrdersResponse is response for a cancelled order.
COINUT is the overarching type across the coinut package.
Commission holds trade commission structure.
GenericResponse is the generic response you will get from coinut.
GetOpenOrdersResponse holds all order data from GetOpenOrders request.
IndexTicker holds indexed ticker information.
InstrumentBase holds information on base currency.
Instruments holds the full information on base currencies.
OpenPosition holds information on an open position.
Option holds options information.
OptionChainResponse is the response type for options.
OptionChainUpdate contains information on the chain update options.
Order holds order information.
Orderbook is the full order book.
OrderbookBase is a sub-type holding price and quantity.
OrderFilledResponse contains order filled response.
OrderRejectResponse holds information on a rejected order.
OrderResponse is a response for orders.
OrdersBase contains generic response and order responses.
OrdersResponse holds the full data range on orders.
PositionHistory holds the complete position history.
Ticker holds ticker information.
TradeBase is a sub-type holding information on trades.
TradeHistory holds trade history information.
Trades holds the full amount of trades associated with API keys.
UserBalance holds user balances on the exchange.
WsCancelOrderParameters ws request parameters.
WsCancelOrderRequest data required for cancelling an order.
WsCancelOrderResponse contains cancelled order data.
WsCancelOrdersRequest ws request.
WsCancelOrdersRequestEntry ws request entry.
WsCancelOrdersResponse contains all cancelled order data.
WsCancelOrdersResponseData individual cancellation response data.
WsGetAccountBalanceResponse contains values of each currency.
WsGetOpenOrdersRequest ws request.
WsInstrumentList defines instrument list.
WsLoginReq Login request message.
WsLoginResponse ws response data.
WsNewOrderResponse returns if new_order response fails.
WsOrderAcceptedResponse ws response.
WsOrderbookData defines singular orderbook data.
WsOrderbookSnapshot defines the resp for orderbook snapshot updates from the websocket connection.
WsOrderbookUpdate defines orderbook update response from the websocket connection.
WsOrderData ws response data.
WsOrderFilledCommissionData ws response data.
WsOrderFilledResponse ws response.
WsOrderRejectedResponse ws response.
WsRequest base request.
WsSubmitOrderParameters ws request parameters.
WsSubmitOrderRequest ws request.
WsSubmitOrdersRequest ws request.
WsSubmitOrdersRequestData ws request data.
WsSupportedCurrency defines supported currency on the exchange.
WsTicker defines the resp for ticker updates from the websocket connection.
WsTradeData defines market trade data.
WsTradeHistoryCommissionData ws response data.
WsTradeHistoryRequest ws request.
WsTradeHistoryResponse ws response.
WsTradeHistoryTradeData ws response data.
WsTradeSnapshot defines Market trade response from the websocket connection.
WsTradeUpdate defines trade update response from the websocket connection.
WsUserBalanceResponse ws response.
WsUserOpenOrdersResponse ws response.