bitstamp

package module
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: MIT Imports: 20 Imported by: 1

README

godoc Tests Golang-CI

Bitstamp

An extensive client implementation of the Bitstamp API using Go.

Examples

Please check the examples_test.go file for some basic usage examples.

Install

go get github.com/georlav/bitstamp@latest

API Support

HTTP API
  • Public data functions
    • Ticker
    • Hourly ticker
    • Order book
    • Transactions
    • Trading pairs info
    • OHLC data
    • EUR/USD conversion rate
  • Private functions
    • Account balance
    • User transactions
    • Crypto transactions
    • Orders
      • Open orders
      • Order status
      • Cancel order
      • Cancel all orders
      • Buy limit order
      • Buy market order
      • Buy instant order
      • Sell limit order
      • Sell market order
      • Sell instant order
    • Withdrawal requests
    • Crypto withdrawals
    • Crypto deposits
    • Transfer balance from Sub to Main Account
    • Transfer balance from Main to Sub Account
    • Open bank withdrawal
    • Bank withdrawal status
    • Cancel bank withdrawal
    • New liquidation address
    • Liquidation address info
    • WebSockets token
Websocket API v2
  • Public channels
    • Live ticker
    • Live orders
    • Live order book
    • Live detail order book
    • Live full order book
  • Private Channels
    • Live ticker
    • Live orders

New pairs are constantly added so if you notice that a pair is missing you can run the following command and open pr

go generate ./...

This fetches all supported pairs from bitstamp and generates new pair and channel enums.

Private functions and configuration

To be able to use private functions you need to generate an API key and a secret using your bitstamp account. To do that you need to visit.

Profile settings -> API access -> New API key

You can pass those to the client using the following functional options

c := bitstamp.NewHTTPAPI(
	bitstamp.APIKeyOption("yourkey"),
	bitstamp.APISecretOption("yoursecret"),
)

Or you can set them as environmental variables and client will automatically read them

export BITSTAMP_KEY="yourkey"
export BITSTAMP_SECRET="yoursecret"

IMPORTANT: Environmental variables override functional options.

Running tests

To run the integration tests for public functions use

go test ./... -v -race -short

To run all integration tests and cover also private functions you need to set your secret and key at your env and run test without -short

go test ./... -v -race

License

Distributed under the MIT License. See LICENSE for more information.

Contact

George Lavdanis - georlav@gmail.com

Project Link: https://github.com/georlav/bitstamp

Documentation

Overview

package bitstamp An extensive client implementation of the Bitstamp API using Go.

Code generated by generatechannels tool. DO NOT EDIT

package bitstamp

Code generated by generatepairs tool. DO NOT EDIT

Index

Examples

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadySubscribed        = errors.New("you can subscribe once per client instance")
	ErrUnableToParseMessage     = errors.New("failed to parse websocket message")
	ErrReceivedReconnectMessage = errors.New("Bitstamp requested to reconnect")
	ErrReadMessage              = errors.New("failed to read message")
	ErrWriteMessage             = errors.New("failed to write message")
)

Functions

func APIKeyOption

func APIKeyOption(val string) option

APIKeyOption set the api key

func APISecretOption

func APISecretOption(val string) option

APISecretOption set the api key

func BaseURLOption

func BaseURLOption(val string) option

BaseURLOption changes the default HTTP API base url

func ClientTimeoutOption

func ClientTimeoutOption(seconds int64) func(api *HTTPAPI)

ClientTimeoutOption change default http client timeout

func EnableDebugOption

func EnableDebugOption() option

EnableDebugOption enable debuging (disabled by default)

func SetWSAddressOption

func SetWSAddressOption(val string) wsOption

WSSetAddressOption changes the default websocket address

Types

type CancelAllOrdersResponse

type CancelAllOrdersResponse struct {
	Canceled []struct {
		ID           int64   `json:"id"`
		CurrencyPair string  `json:"currency_pair"`
		Type         int     `json:"type"`
		Amount       float64 `json:"amount"`
		Price        int     `json:"price"`
	} `json:"canceled"`
	Success bool `json:"success"`
}

CancelAllOrdersResponse used to map response of CancelAllOrders method

type CancelOrderRequest

type CancelOrderRequest struct {
	// Order ID.
	ID string `schema:"id,omitempty"`
}

CancelOrderRequest used by CancelOrder method to map outgoing request data

type CancelOrderResponse

type CancelOrderResponse struct {
	ID     int64   `json:"id"`
	Type   int     `json:"type"`
	Amount float64 `json:"amount"`
	Price  int     `json:"price"`
}

CancelOrderResponse used to map response of CancelOrder method

type Channel

type Channel uint32
const (
	LiveTradesAAVEBTCChannel Channel = iota
	LiveOrdersAAVEBTCChannel
	OrderBookAAVEBTCChannel
	DetailOrderBookAAVEBTCChannel
	DiffOrderBookAAVEBTCChannel
	LiveTradesAAVEEURChannel
	LiveOrdersAAVEEURChannel
	OrderBookAAVEEURChannel
	DetailOrderBookAAVEEURChannel
	DiffOrderBookAAVEEURChannel
	LiveTradesAAVEUSDChannel
	LiveOrdersAAVEUSDChannel
	OrderBookAAVEUSDChannel
	DetailOrderBookAAVEUSDChannel
	DiffOrderBookAAVEUSDChannel
	LiveTradesADABTCChannel
	LiveOrdersADABTCChannel
	OrderBookADABTCChannel
	DetailOrderBookADABTCChannel
	DiffOrderBookADABTCChannel
	LiveTradesADAEURChannel
	LiveOrdersADAEURChannel
	OrderBookADAEURChannel
	DetailOrderBookADAEURChannel
	DiffOrderBookADAEURChannel
	LiveTradesADAUSDChannel
	LiveOrdersADAUSDChannel
	OrderBookADAUSDChannel
	DetailOrderBookADAUSDChannel
	DiffOrderBookADAUSDChannel
	LiveTradesALGOBTCChannel
	LiveOrdersALGOBTCChannel
	OrderBookALGOBTCChannel
	DetailOrderBookALGOBTCChannel
	DiffOrderBookALGOBTCChannel
	LiveTradesALGOEURChannel
	LiveOrdersALGOEURChannel
	OrderBookALGOEURChannel
	DetailOrderBookALGOEURChannel
	DiffOrderBookALGOEURChannel
	LiveTradesALGOUSDChannel
	LiveOrdersALGOUSDChannel
	OrderBookALGOUSDChannel
	DetailOrderBookALGOUSDChannel
	DiffOrderBookALGOUSDChannel
	LiveTradesALPHAEURChannel
	LiveOrdersALPHAEURChannel
	OrderBookALPHAEURChannel
	DetailOrderBookALPHAEURChannel
	DiffOrderBookALPHAEURChannel
	LiveTradesALPHAUSDChannel
	LiveOrdersALPHAUSDChannel
	OrderBookALPHAUSDChannel
	DetailOrderBookALPHAUSDChannel
	DiffOrderBookALPHAUSDChannel
	LiveTradesAMPEURChannel
	LiveOrdersAMPEURChannel
	OrderBookAMPEURChannel
	DetailOrderBookAMPEURChannel
	DiffOrderBookAMPEURChannel
	LiveTradesAMPUSDChannel
	LiveOrdersAMPUSDChannel
	OrderBookAMPUSDChannel
	DetailOrderBookAMPUSDChannel
	DiffOrderBookAMPUSDChannel
	LiveTradesANTEURChannel
	LiveOrdersANTEURChannel
	OrderBookANTEURChannel
	DetailOrderBookANTEURChannel
	DiffOrderBookANTEURChannel
	LiveTradesANTUSDChannel
	LiveOrdersANTUSDChannel
	OrderBookANTUSDChannel
	DetailOrderBookANTUSDChannel
	DiffOrderBookANTUSDChannel
	LiveTradesAUDIOBTCChannel
	LiveOrdersAUDIOBTCChannel
	OrderBookAUDIOBTCChannel
	DetailOrderBookAUDIOBTCChannel
	DiffOrderBookAUDIOBTCChannel
	LiveTradesAUDIOEURChannel
	LiveOrdersAUDIOEURChannel
	OrderBookAUDIOEURChannel
	DetailOrderBookAUDIOEURChannel
	DiffOrderBookAUDIOEURChannel
	LiveTradesAUDIOUSDChannel
	LiveOrdersAUDIOUSDChannel
	OrderBookAUDIOUSDChannel
	DetailOrderBookAUDIOUSDChannel
	DiffOrderBookAUDIOUSDChannel
	LiveTradesAVAXEURChannel
	LiveOrdersAVAXEURChannel
	OrderBookAVAXEURChannel
	DetailOrderBookAVAXEURChannel
	DiffOrderBookAVAXEURChannel
	LiveTradesAVAXUSDChannel
	LiveOrdersAVAXUSDChannel
	OrderBookAVAXUSDChannel
	DetailOrderBookAVAXUSDChannel
	DiffOrderBookAVAXUSDChannel
	LiveTradesAXSEURChannel
	LiveOrdersAXSEURChannel
	OrderBookAXSEURChannel
	DetailOrderBookAXSEURChannel
	DiffOrderBookAXSEURChannel
	LiveTradesAXSUSDChannel
	LiveOrdersAXSUSDChannel
	OrderBookAXSUSDChannel
	DetailOrderBookAXSUSDChannel
	DiffOrderBookAXSUSDChannel
	LiveTradesBANDEURChannel
	LiveOrdersBANDEURChannel
	OrderBookBANDEURChannel
	DetailOrderBookBANDEURChannel
	DiffOrderBookBANDEURChannel
	LiveTradesBANDUSDChannel
	LiveOrdersBANDUSDChannel
	OrderBookBANDUSDChannel
	DetailOrderBookBANDUSDChannel
	DiffOrderBookBANDUSDChannel
	LiveTradesBATBTCChannel
	LiveOrdersBATBTCChannel
	OrderBookBATBTCChannel
	DetailOrderBookBATBTCChannel
	DiffOrderBookBATBTCChannel
	LiveTradesBATEURChannel
	LiveOrdersBATEURChannel
	OrderBookBATEURChannel
	DetailOrderBookBATEURChannel
	DiffOrderBookBATEURChannel
	LiveTradesBATUSDChannel
	LiveOrdersBATUSDChannel
	OrderBookBATUSDChannel
	DetailOrderBookBATUSDChannel
	DiffOrderBookBATUSDChannel
	LiveTradesBCHBTCChannel
	LiveOrdersBCHBTCChannel
	OrderBookBCHBTCChannel
	DetailOrderBookBCHBTCChannel
	DiffOrderBookBCHBTCChannel
	LiveTradesBCHEURChannel
	LiveOrdersBCHEURChannel
	OrderBookBCHEURChannel
	DetailOrderBookBCHEURChannel
	DiffOrderBookBCHEURChannel
	LiveTradesBCHGBPChannel
	LiveOrdersBCHGBPChannel
	OrderBookBCHGBPChannel
	DetailOrderBookBCHGBPChannel
	DiffOrderBookBCHGBPChannel
	LiveTradesBCHUSDChannel
	LiveOrdersBCHUSDChannel
	OrderBookBCHUSDChannel
	DetailOrderBookBCHUSDChannel
	DiffOrderBookBCHUSDChannel
	LiveTradesBTCEURChannel
	LiveOrdersBTCEURChannel
	OrderBookBTCEURChannel
	DetailOrderBookBTCEURChannel
	DiffOrderBookBTCEURChannel
	LiveTradesBTCGBPChannel
	LiveOrdersBTCGBPChannel
	OrderBookBTCGBPChannel
	DetailOrderBookBTCGBPChannel
	DiffOrderBookBTCGBPChannel
	LiveTradesBTCPAXChannel
	LiveOrdersBTCPAXChannel
	OrderBookBTCPAXChannel
	DetailOrderBookBTCPAXChannel
	DiffOrderBookBTCPAXChannel
	LiveTradesBTCUSDChannel
	LiveOrdersBTCUSDChannel
	OrderBookBTCUSDChannel
	DetailOrderBookBTCUSDChannel
	DiffOrderBookBTCUSDChannel
	LiveTradesBTCUSDCChannel
	LiveOrdersBTCUSDCChannel
	OrderBookBTCUSDCChannel
	DetailOrderBookBTCUSDCChannel
	DiffOrderBookBTCUSDCChannel
	LiveTradesBTCUSDTChannel
	LiveOrdersBTCUSDTChannel
	OrderBookBTCUSDTChannel
	DetailOrderBookBTCUSDTChannel
	DiffOrderBookBTCUSDTChannel
	LiveTradesCELEURChannel
	LiveOrdersCELEURChannel
	OrderBookCELEURChannel
	DetailOrderBookCELEURChannel
	DiffOrderBookCELEURChannel
	LiveTradesCELUSDChannel
	LiveOrdersCELUSDChannel
	OrderBookCELUSDChannel
	DetailOrderBookCELUSDChannel
	DiffOrderBookCELUSDChannel
	LiveTradesCHZEURChannel
	LiveOrdersCHZEURChannel
	OrderBookCHZEURChannel
	DetailOrderBookCHZEURChannel
	DiffOrderBookCHZEURChannel
	LiveTradesCHZUSDChannel
	LiveOrdersCHZUSDChannel
	OrderBookCHZUSDChannel
	DetailOrderBookCHZUSDChannel
	DiffOrderBookCHZUSDChannel
	LiveTradesCOMPBTCChannel
	LiveOrdersCOMPBTCChannel
	OrderBookCOMPBTCChannel
	DetailOrderBookCOMPBTCChannel
	DiffOrderBookCOMPBTCChannel
	LiveTradesCOMPEURChannel
	LiveOrdersCOMPEURChannel
	OrderBookCOMPEURChannel
	DetailOrderBookCOMPEURChannel
	DiffOrderBookCOMPEURChannel
	LiveTradesCOMPUSDChannel
	LiveOrdersCOMPUSDChannel
	OrderBookCOMPUSDChannel
	DetailOrderBookCOMPUSDChannel
	DiffOrderBookCOMPUSDChannel
	LiveTradesCRVBTCChannel
	LiveOrdersCRVBTCChannel
	OrderBookCRVBTCChannel
	DetailOrderBookCRVBTCChannel
	DiffOrderBookCRVBTCChannel
	LiveTradesCRVEURChannel
	LiveOrdersCRVEURChannel
	OrderBookCRVEURChannel
	DetailOrderBookCRVEURChannel
	DiffOrderBookCRVEURChannel
	LiveTradesCRVUSDChannel
	LiveOrdersCRVUSDChannel
	OrderBookCRVUSDChannel
	DetailOrderBookCRVUSDChannel
	DiffOrderBookCRVUSDChannel
	LiveTradesCTSIEURChannel
	LiveOrdersCTSIEURChannel
	OrderBookCTSIEURChannel
	DetailOrderBookCTSIEURChannel
	DiffOrderBookCTSIEURChannel
	LiveTradesCTSIUSDChannel
	LiveOrdersCTSIUSDChannel
	OrderBookCTSIUSDChannel
	DetailOrderBookCTSIUSDChannel
	DiffOrderBookCTSIUSDChannel
	LiveTradesCVXEURChannel
	LiveOrdersCVXEURChannel
	OrderBookCVXEURChannel
	DetailOrderBookCVXEURChannel
	DiffOrderBookCVXEURChannel
	LiveTradesCVXUSDChannel
	LiveOrdersCVXUSDChannel
	OrderBookCVXUSDChannel
	DetailOrderBookCVXUSDChannel
	DiffOrderBookCVXUSDChannel
	LiveTradesDAIUSDChannel
	LiveOrdersDAIUSDChannel
	OrderBookDAIUSDChannel
	DetailOrderBookDAIUSDChannel
	DiffOrderBookDAIUSDChannel
	LiveTradesDYDXEURChannel
	LiveOrdersDYDXEURChannel
	OrderBookDYDXEURChannel
	DetailOrderBookDYDXEURChannel
	DiffOrderBookDYDXEURChannel
	LiveTradesDYDXUSDChannel
	LiveOrdersDYDXUSDChannel
	OrderBookDYDXUSDChannel
	DetailOrderBookDYDXUSDChannel
	DiffOrderBookDYDXUSDChannel
	LiveTradesENJEURChannel
	LiveOrdersENJEURChannel
	OrderBookENJEURChannel
	DetailOrderBookENJEURChannel
	DiffOrderBookENJEURChannel
	LiveTradesENJUSDChannel
	LiveOrdersENJUSDChannel
	OrderBookENJUSDChannel
	DetailOrderBookENJUSDChannel
	DiffOrderBookENJUSDChannel
	LiveTradesETH2ETHChannel
	LiveOrdersETH2ETHChannel
	OrderBookETH2ETHChannel
	DetailOrderBookETH2ETHChannel
	DiffOrderBookETH2ETHChannel
	LiveTradesETHBTCChannel
	LiveOrdersETHBTCChannel
	OrderBookETHBTCChannel
	DetailOrderBookETHBTCChannel
	DiffOrderBookETHBTCChannel
	LiveTradesETHEURChannel
	LiveOrdersETHEURChannel
	OrderBookETHEURChannel
	DetailOrderBookETHEURChannel
	DiffOrderBookETHEURChannel
	LiveTradesETHGBPChannel
	LiveOrdersETHGBPChannel
	OrderBookETHGBPChannel
	DetailOrderBookETHGBPChannel
	DiffOrderBookETHGBPChannel
	LiveTradesETHPAXChannel
	LiveOrdersETHPAXChannel
	OrderBookETHPAXChannel
	DetailOrderBookETHPAXChannel
	DiffOrderBookETHPAXChannel
	LiveTradesETHUSDChannel
	LiveOrdersETHUSDChannel
	OrderBookETHUSDChannel
	DetailOrderBookETHUSDChannel
	DiffOrderBookETHUSDChannel
	LiveTradesETHUSDCChannel
	LiveOrdersETHUSDCChannel
	OrderBookETHUSDCChannel
	DetailOrderBookETHUSDCChannel
	DiffOrderBookETHUSDCChannel
	LiveTradesETHUSDTChannel
	LiveOrdersETHUSDTChannel
	OrderBookETHUSDTChannel
	DetailOrderBookETHUSDTChannel
	DiffOrderBookETHUSDTChannel
	LiveTradesEURTEURChannel
	LiveOrdersEURTEURChannel
	OrderBookEURTEURChannel
	DetailOrderBookEURTEURChannel
	DiffOrderBookEURTEURChannel
	LiveTradesEURTUSDChannel
	LiveOrdersEURTUSDChannel
	OrderBookEURTUSDChannel
	DetailOrderBookEURTUSDChannel
	DiffOrderBookEURTUSDChannel
	LiveTradesEURUSDChannel
	LiveOrdersEURUSDChannel
	OrderBookEURUSDChannel
	DetailOrderBookEURUSDChannel
	DiffOrderBookEURUSDChannel
	LiveTradesFETEURChannel
	LiveOrdersFETEURChannel
	OrderBookFETEURChannel
	DetailOrderBookFETEURChannel
	DiffOrderBookFETEURChannel
	LiveTradesFETUSDChannel
	LiveOrdersFETUSDChannel
	OrderBookFETUSDChannel
	DetailOrderBookFETUSDChannel
	DiffOrderBookFETUSDChannel
	LiveTradesFTMEURChannel
	LiveOrdersFTMEURChannel
	OrderBookFTMEURChannel
	DetailOrderBookFTMEURChannel
	DiffOrderBookFTMEURChannel
	LiveTradesFTMUSDChannel
	LiveOrdersFTMUSDChannel
	OrderBookFTMUSDChannel
	DetailOrderBookFTMUSDChannel
	DiffOrderBookFTMUSDChannel
	LiveTradesFTTEURChannel
	LiveOrdersFTTEURChannel
	OrderBookFTTEURChannel
	DetailOrderBookFTTEURChannel
	DiffOrderBookFTTEURChannel
	LiveTradesFTTUSDChannel
	LiveOrdersFTTUSDChannel
	OrderBookFTTUSDChannel
	DetailOrderBookFTTUSDChannel
	DiffOrderBookFTTUSDChannel
	LiveTradesGALAEURChannel
	LiveOrdersGALAEURChannel
	OrderBookGALAEURChannel
	DetailOrderBookGALAEURChannel
	DiffOrderBookGALAEURChannel
	LiveTradesGALAUSDChannel
	LiveOrdersGALAUSDChannel
	OrderBookGALAUSDChannel
	DetailOrderBookGALAUSDChannel
	DiffOrderBookGALAUSDChannel
	LiveTradesGBPEURChannel
	LiveOrdersGBPEURChannel
	OrderBookGBPEURChannel
	DetailOrderBookGBPEURChannel
	DiffOrderBookGBPEURChannel
	LiveTradesGBPUSDChannel
	LiveOrdersGBPUSDChannel
	OrderBookGBPUSDChannel
	DetailOrderBookGBPUSDChannel
	DiffOrderBookGBPUSDChannel
	LiveTradesGODSEURChannel
	LiveOrdersGODSEURChannel
	OrderBookGODSEURChannel
	DetailOrderBookGODSEURChannel
	DiffOrderBookGODSEURChannel
	LiveTradesGODSUSDChannel
	LiveOrdersGODSUSDChannel
	OrderBookGODSUSDChannel
	DetailOrderBookGODSUSDChannel
	DiffOrderBookGODSUSDChannel
	LiveTradesGRTEURChannel
	LiveOrdersGRTEURChannel
	OrderBookGRTEURChannel
	DetailOrderBookGRTEURChannel
	DiffOrderBookGRTEURChannel
	LiveTradesGRTUSDChannel
	LiveOrdersGRTUSDChannel
	OrderBookGRTUSDChannel
	DetailOrderBookGRTUSDChannel
	DiffOrderBookGRTUSDChannel
	LiveTradesGUSDUSDChannel
	LiveOrdersGUSDUSDChannel
	OrderBookGUSDUSDChannel
	DetailOrderBookGUSDUSDChannel
	DiffOrderBookGUSDUSDChannel
	LiveTradesHBAREURChannel
	LiveOrdersHBAREURChannel
	OrderBookHBAREURChannel
	DetailOrderBookHBAREURChannel
	DiffOrderBookHBAREURChannel
	LiveTradesHBARUSDChannel
	LiveOrdersHBARUSDChannel
	OrderBookHBARUSDChannel
	DetailOrderBookHBARUSDChannel
	DiffOrderBookHBARUSDChannel
	LiveTradesIMXEURChannel
	LiveOrdersIMXEURChannel
	OrderBookIMXEURChannel
	DetailOrderBookIMXEURChannel
	DiffOrderBookIMXEURChannel
	LiveTradesIMXUSDChannel
	LiveOrdersIMXUSDChannel
	OrderBookIMXUSDChannel
	DetailOrderBookIMXUSDChannel
	DiffOrderBookIMXUSDChannel
	LiveTradesINJEURChannel
	LiveOrdersINJEURChannel
	OrderBookINJEURChannel
	DetailOrderBookINJEURChannel
	DiffOrderBookINJEURChannel
	LiveTradesINJUSDChannel
	LiveOrdersINJUSDChannel
	OrderBookINJUSDChannel
	DetailOrderBookINJUSDChannel
	DiffOrderBookINJUSDChannel
	LiveTradesKNCBTCChannel
	LiveOrdersKNCBTCChannel
	OrderBookKNCBTCChannel
	DetailOrderBookKNCBTCChannel
	DiffOrderBookKNCBTCChannel
	LiveTradesKNCEURChannel
	LiveOrdersKNCEURChannel
	OrderBookKNCEURChannel
	DetailOrderBookKNCEURChannel
	DiffOrderBookKNCEURChannel
	LiveTradesKNCUSDChannel
	LiveOrdersKNCUSDChannel
	OrderBookKNCUSDChannel
	DetailOrderBookKNCUSDChannel
	DiffOrderBookKNCUSDChannel
	LiveTradesLINKBTCChannel
	LiveOrdersLINKBTCChannel
	OrderBookLINKBTCChannel
	DetailOrderBookLINKBTCChannel
	DiffOrderBookLINKBTCChannel
	LiveTradesLINKETHChannel
	LiveOrdersLINKETHChannel
	OrderBookLINKETHChannel
	DetailOrderBookLINKETHChannel
	DiffOrderBookLINKETHChannel
	LiveTradesLINKEURChannel
	LiveOrdersLINKEURChannel
	OrderBookLINKEURChannel
	DetailOrderBookLINKEURChannel
	DiffOrderBookLINKEURChannel
	LiveTradesLINKGBPChannel
	LiveOrdersLINKGBPChannel
	OrderBookLINKGBPChannel
	DetailOrderBookLINKGBPChannel
	DiffOrderBookLINKGBPChannel
	LiveTradesLINKUSDChannel
	LiveOrdersLINKUSDChannel
	OrderBookLINKUSDChannel
	DetailOrderBookLINKUSDChannel
	DiffOrderBookLINKUSDChannel
	LiveTradesLTCBTCChannel
	LiveOrdersLTCBTCChannel
	OrderBookLTCBTCChannel
	DetailOrderBookLTCBTCChannel
	DiffOrderBookLTCBTCChannel
	LiveTradesLTCEURChannel
	LiveOrdersLTCEURChannel
	OrderBookLTCEURChannel
	DetailOrderBookLTCEURChannel
	DiffOrderBookLTCEURChannel
	LiveTradesLTCGBPChannel
	LiveOrdersLTCGBPChannel
	OrderBookLTCGBPChannel
	DetailOrderBookLTCGBPChannel
	DiffOrderBookLTCGBPChannel
	LiveTradesLTCUSDChannel
	LiveOrdersLTCUSDChannel
	OrderBookLTCUSDChannel
	DetailOrderBookLTCUSDChannel
	DiffOrderBookLTCUSDChannel
	LiveTradesMATICEURChannel
	LiveOrdersMATICEURChannel
	OrderBookMATICEURChannel
	DetailOrderBookMATICEURChannel
	DiffOrderBookMATICEURChannel
	LiveTradesMATICUSDChannel
	LiveOrdersMATICUSDChannel
	OrderBookMATICUSDChannel
	DetailOrderBookMATICUSDChannel
	DiffOrderBookMATICUSDChannel
	LiveTradesMKRBTCChannel
	LiveOrdersMKRBTCChannel
	OrderBookMKRBTCChannel
	DetailOrderBookMKRBTCChannel
	DiffOrderBookMKRBTCChannel
	LiveTradesMKREURChannel
	LiveOrdersMKREURChannel
	OrderBookMKREURChannel
	DetailOrderBookMKREURChannel
	DiffOrderBookMKREURChannel
	LiveTradesMKRUSDChannel
	LiveOrdersMKRUSDChannel
	OrderBookMKRUSDChannel
	DetailOrderBookMKRUSDChannel
	DiffOrderBookMKRUSDChannel
	LiveTradesNEXOEURChannel
	LiveOrdersNEXOEURChannel
	OrderBookNEXOEURChannel
	DetailOrderBookNEXOEURChannel
	DiffOrderBookNEXOEURChannel
	LiveTradesNEXOUSDChannel
	LiveOrdersNEXOUSDChannel
	OrderBookNEXOUSDChannel
	DetailOrderBookNEXOUSDChannel
	DiffOrderBookNEXOUSDChannel
	LiveTradesOMGBTCChannel
	LiveOrdersOMGBTCChannel
	OrderBookOMGBTCChannel
	DetailOrderBookOMGBTCChannel
	DiffOrderBookOMGBTCChannel
	LiveTradesOMGEURChannel
	LiveOrdersOMGEURChannel
	OrderBookOMGEURChannel
	DetailOrderBookOMGEURChannel
	DiffOrderBookOMGEURChannel
	LiveTradesOMGGBPChannel
	LiveOrdersOMGGBPChannel
	OrderBookOMGGBPChannel
	DetailOrderBookOMGGBPChannel
	DiffOrderBookOMGGBPChannel
	LiveTradesOMGUSDChannel
	LiveOrdersOMGUSDChannel
	OrderBookOMGUSDChannel
	DetailOrderBookOMGUSDChannel
	DiffOrderBookOMGUSDChannel
	LiveTradesPAXEURChannel
	LiveOrdersPAXEURChannel
	OrderBookPAXEURChannel
	DetailOrderBookPAXEURChannel
	DiffOrderBookPAXEURChannel
	LiveTradesPAXGBPChannel
	LiveOrdersPAXGBPChannel
	OrderBookPAXGBPChannel
	DetailOrderBookPAXGBPChannel
	DiffOrderBookPAXGBPChannel
	LiveTradesPAXUSDChannel
	LiveOrdersPAXUSDChannel
	OrderBookPAXUSDChannel
	DetailOrderBookPAXUSDChannel
	DiffOrderBookPAXUSDChannel
	LiveTradesPERPEURChannel
	LiveOrdersPERPEURChannel
	OrderBookPERPEURChannel
	DetailOrderBookPERPEURChannel
	DiffOrderBookPERPEURChannel
	LiveTradesPERPUSDChannel
	LiveOrdersPERPUSDChannel
	OrderBookPERPUSDChannel
	DetailOrderBookPERPUSDChannel
	DiffOrderBookPERPUSDChannel
	LiveTradesRADEURChannel
	LiveOrdersRADEURChannel
	OrderBookRADEURChannel
	DetailOrderBookRADEURChannel
	DiffOrderBookRADEURChannel
	LiveTradesRADUSDChannel
	LiveOrdersRADUSDChannel
	OrderBookRADUSDChannel
	DetailOrderBookRADUSDChannel
	DiffOrderBookRADUSDChannel
	LiveTradesRGTEURChannel
	LiveOrdersRGTEURChannel
	OrderBookRGTEURChannel
	DetailOrderBookRGTEURChannel
	DiffOrderBookRGTEURChannel
	LiveTradesRGTUSDChannel
	LiveOrdersRGTUSDChannel
	OrderBookRGTUSDChannel
	DetailOrderBookRGTUSDChannel
	DiffOrderBookRGTUSDChannel
	LiveTradesRLYEURChannel
	LiveOrdersRLYEURChannel
	OrderBookRLYEURChannel
	DetailOrderBookRLYEURChannel
	DiffOrderBookRLYEURChannel
	LiveTradesRLYUSDChannel
	LiveOrdersRLYUSDChannel
	OrderBookRLYUSDChannel
	DetailOrderBookRLYUSDChannel
	DiffOrderBookRLYUSDChannel
	LiveTradesRNDREURChannel
	LiveOrdersRNDREURChannel
	OrderBookRNDREURChannel
	DetailOrderBookRNDREURChannel
	DiffOrderBookRNDREURChannel
	LiveTradesRNDRUSDChannel
	LiveOrdersRNDRUSDChannel
	OrderBookRNDRUSDChannel
	DetailOrderBookRNDRUSDChannel
	DiffOrderBookRNDRUSDChannel
	LiveTradesSANDEURChannel
	LiveOrdersSANDEURChannel
	OrderBookSANDEURChannel
	DetailOrderBookSANDEURChannel
	DiffOrderBookSANDEURChannel
	LiveTradesSANDUSDChannel
	LiveOrdersSANDUSDChannel
	OrderBookSANDUSDChannel
	DetailOrderBookSANDUSDChannel
	DiffOrderBookSANDUSDChannel
	LiveTradesSGBEURChannel
	LiveOrdersSGBEURChannel
	OrderBookSGBEURChannel
	DetailOrderBookSGBEURChannel
	DiffOrderBookSGBEURChannel
	LiveTradesSGBUSDChannel
	LiveOrdersSGBUSDChannel
	OrderBookSGBUSDChannel
	DetailOrderBookSGBUSDChannel
	DiffOrderBookSGBUSDChannel
	LiveTradesSKLEURChannel
	LiveOrdersSKLEURChannel
	OrderBookSKLEURChannel
	DetailOrderBookSKLEURChannel
	DiffOrderBookSKLEURChannel
	LiveTradesSKLUSDChannel
	LiveOrdersSKLUSDChannel
	OrderBookSKLUSDChannel
	DetailOrderBookSKLUSDChannel
	DiffOrderBookSKLUSDChannel
	LiveTradesSLPEURChannel
	LiveOrdersSLPEURChannel
	OrderBookSLPEURChannel
	DetailOrderBookSLPEURChannel
	DiffOrderBookSLPEURChannel
	LiveTradesSLPUSDChannel
	LiveOrdersSLPUSDChannel
	OrderBookSLPUSDChannel
	DetailOrderBookSLPUSDChannel
	DiffOrderBookSLPUSDChannel
	LiveTradesSNXBTCChannel
	LiveOrdersSNXBTCChannel
	OrderBookSNXBTCChannel
	DetailOrderBookSNXBTCChannel
	DiffOrderBookSNXBTCChannel
	LiveTradesSNXEURChannel
	LiveOrdersSNXEURChannel
	OrderBookSNXEURChannel
	DetailOrderBookSNXEURChannel
	DiffOrderBookSNXEURChannel
	LiveTradesSNXUSDChannel
	LiveOrdersSNXUSDChannel
	OrderBookSNXUSDChannel
	DetailOrderBookSNXUSDChannel
	DiffOrderBookSNXUSDChannel
	LiveTradesSTORJEURChannel
	LiveOrdersSTORJEURChannel
	OrderBookSTORJEURChannel
	DetailOrderBookSTORJEURChannel
	DiffOrderBookSTORJEURChannel
	LiveTradesSTORJUSDChannel
	LiveOrdersSTORJUSDChannel
	OrderBookSTORJUSDChannel
	DetailOrderBookSTORJUSDChannel
	DiffOrderBookSTORJUSDChannel
	LiveTradesSUSHIEURChannel
	LiveOrdersSUSHIEURChannel
	OrderBookSUSHIEURChannel
	DetailOrderBookSUSHIEURChannel
	DiffOrderBookSUSHIEURChannel
	LiveTradesSUSHIUSDChannel
	LiveOrdersSUSHIUSDChannel
	OrderBookSUSHIUSDChannel
	DetailOrderBookSUSHIUSDChannel
	DiffOrderBookSUSHIUSDChannel
	LiveTradesSXPEURChannel
	LiveOrdersSXPEURChannel
	OrderBookSXPEURChannel
	DetailOrderBookSXPEURChannel
	DiffOrderBookSXPEURChannel
	LiveTradesSXPUSDChannel
	LiveOrdersSXPUSDChannel
	OrderBookSXPUSDChannel
	DetailOrderBookSXPUSDChannel
	DiffOrderBookSXPUSDChannel
	LiveTradesUMABTCChannel
	LiveOrdersUMABTCChannel
	OrderBookUMABTCChannel
	DetailOrderBookUMABTCChannel
	DiffOrderBookUMABTCChannel
	LiveTradesUMAEURChannel
	LiveOrdersUMAEURChannel
	OrderBookUMAEURChannel
	DetailOrderBookUMAEURChannel
	DiffOrderBookUMAEURChannel
	LiveTradesUMAUSDChannel
	LiveOrdersUMAUSDChannel
	OrderBookUMAUSDChannel
	DetailOrderBookUMAUSDChannel
	DiffOrderBookUMAUSDChannel
	LiveTradesUNIBTCChannel
	LiveOrdersUNIBTCChannel
	OrderBookUNIBTCChannel
	DetailOrderBookUNIBTCChannel
	DiffOrderBookUNIBTCChannel
	LiveTradesUNIEURChannel
	LiveOrdersUNIEURChannel
	OrderBookUNIEURChannel
	DetailOrderBookUNIEURChannel
	DiffOrderBookUNIEURChannel
	LiveTradesUNIUSDChannel
	LiveOrdersUNIUSDChannel
	OrderBookUNIUSDChannel
	DetailOrderBookUNIUSDChannel
	DiffOrderBookUNIUSDChannel
	LiveTradesUSDCEURChannel
	LiveOrdersUSDCEURChannel
	OrderBookUSDCEURChannel
	DetailOrderBookUSDCEURChannel
	DiffOrderBookUSDCEURChannel
	LiveTradesUSDCUSDChannel
	LiveOrdersUSDCUSDChannel
	OrderBookUSDCUSDChannel
	DetailOrderBookUSDCUSDChannel
	DiffOrderBookUSDCUSDChannel
	LiveTradesUSDCUSDTChannel
	LiveOrdersUSDCUSDTChannel
	OrderBookUSDCUSDTChannel
	DetailOrderBookUSDCUSDTChannel
	DiffOrderBookUSDCUSDTChannel
	LiveTradesUSDTEURChannel
	LiveOrdersUSDTEURChannel
	OrderBookUSDTEURChannel
	DetailOrderBookUSDTEURChannel
	DiffOrderBookUSDTEURChannel
	LiveTradesUSDTUSDChannel
	LiveOrdersUSDTUSDChannel
	OrderBookUSDTUSDChannel
	DetailOrderBookUSDTUSDChannel
	DiffOrderBookUSDTUSDChannel
	LiveTradesUSTEURChannel
	LiveOrdersUSTEURChannel
	OrderBookUSTEURChannel
	DetailOrderBookUSTEURChannel
	DiffOrderBookUSTEURChannel
	LiveTradesUSTUSDChannel
	LiveOrdersUSTUSDChannel
	OrderBookUSTUSDChannel
	DetailOrderBookUSTUSDChannel
	DiffOrderBookUSTUSDChannel
	LiveTradesVEGAEURChannel
	LiveOrdersVEGAEURChannel
	OrderBookVEGAEURChannel
	DetailOrderBookVEGAEURChannel
	DiffOrderBookVEGAEURChannel
	LiveTradesVEGAUSDChannel
	LiveOrdersVEGAUSDChannel
	OrderBookVEGAUSDChannel
	DetailOrderBookVEGAUSDChannel
	DiffOrderBookVEGAUSDChannel
	LiveTradesWBTCBTCChannel
	LiveOrdersWBTCBTCChannel
	OrderBookWBTCBTCChannel
	DetailOrderBookWBTCBTCChannel
	DiffOrderBookWBTCBTCChannel
	LiveTradesXLMBTCChannel
	LiveOrdersXLMBTCChannel
	OrderBookXLMBTCChannel
	DetailOrderBookXLMBTCChannel
	DiffOrderBookXLMBTCChannel
	LiveTradesXLMEURChannel
	LiveOrdersXLMEURChannel
	OrderBookXLMEURChannel
	DetailOrderBookXLMEURChannel
	DiffOrderBookXLMEURChannel
	LiveTradesXLMGBPChannel
	LiveOrdersXLMGBPChannel
	OrderBookXLMGBPChannel
	DetailOrderBookXLMGBPChannel
	DiffOrderBookXLMGBPChannel
	LiveTradesXLMUSDChannel
	LiveOrdersXLMUSDChannel
	OrderBookXLMUSDChannel
	DetailOrderBookXLMUSDChannel
	DiffOrderBookXLMUSDChannel
	LiveTradesXRPBTCChannel
	LiveOrdersXRPBTCChannel
	OrderBookXRPBTCChannel
	DetailOrderBookXRPBTCChannel
	DiffOrderBookXRPBTCChannel
	LiveTradesXRPEURChannel
	LiveOrdersXRPEURChannel
	OrderBookXRPEURChannel
	DetailOrderBookXRPEURChannel
	DiffOrderBookXRPEURChannel
	LiveTradesXRPGBPChannel
	LiveOrdersXRPGBPChannel
	OrderBookXRPGBPChannel
	DetailOrderBookXRPGBPChannel
	DiffOrderBookXRPGBPChannel
	LiveTradesXRPPAXChannel
	LiveOrdersXRPPAXChannel
	OrderBookXRPPAXChannel
	DetailOrderBookXRPPAXChannel
	DiffOrderBookXRPPAXChannel
	LiveTradesXRPUSDChannel
	LiveOrdersXRPUSDChannel
	OrderBookXRPUSDChannel
	DetailOrderBookXRPUSDChannel
	DiffOrderBookXRPUSDChannel
	LiveTradesXRPUSDTChannel
	LiveOrdersXRPUSDTChannel
	OrderBookXRPUSDTChannel
	DetailOrderBookXRPUSDTChannel
	DiffOrderBookXRPUSDTChannel
	LiveTradesYFIBTCChannel
	LiveOrdersYFIBTCChannel
	OrderBookYFIBTCChannel
	DetailOrderBookYFIBTCChannel
	DiffOrderBookYFIBTCChannel
	LiveTradesYFIEURChannel
	LiveOrdersYFIEURChannel
	OrderBookYFIEURChannel
	DetailOrderBookYFIEURChannel
	DiffOrderBookYFIEURChannel
	LiveTradesYFIUSDChannel
	LiveOrdersYFIUSDChannel
	OrderBookYFIUSDChannel
	DetailOrderBookYFIUSDChannel
	DiffOrderBookYFIUSDChannel
	LiveTradesZRXBTCChannel
	LiveOrdersZRXBTCChannel
	OrderBookZRXBTCChannel
	DetailOrderBookZRXBTCChannel
	DiffOrderBookZRXBTCChannel
	LiveTradesZRXEURChannel
	LiveOrdersZRXEURChannel
	OrderBookZRXEURChannel
	DetailOrderBookZRXEURChannel
	DiffOrderBookZRXEURChannel
	LiveTradesZRXUSDChannel
	LiveOrdersZRXUSDChannel
	OrderBookZRXUSDChannel
	DetailOrderBookZRXUSDChannel
	DiffOrderBookZRXUSDChannel
)

func GetAllChannels

func GetAllChannels() []Channel

func GetBTCChannels

func GetBTCChannels() []Channel

func GetDetailOrderBookChannel added in v0.1.2

func GetDetailOrderBookChannel(p Pair) Channel

GetDetailOrderBookChannel get detail order book for a pair (detail_order_book_[currency_pair])

func GetDetailOrderBookChannels

func GetDetailOrderBookChannels() []Channel

GetDetailOrderBookChannels get all detail order book channels (detail_order_book_[*])

func GetDiffOrderBookChannel added in v0.1.2

func GetDiffOrderBookChannel(p Pair) Channel

GetDiffOrderBookChannel get diff order book channel for a pair (diff_order_book_[currency_pair])

func GetDiffOrderBookChannels

func GetDiffOrderBookChannels() []Channel

GetDiffOrderBookChannels get all diff order book channels (diff_order_book_[*])

func GetEuroChannels

func GetEuroChannels() []Channel

func GetGBPChannels

func GetGBPChannels() []Channel

func GetLiveOrderChannel added in v0.1.2

func GetLiveOrderChannel(p Pair) Channel

GetLiveTradeChannel get live orders channel for a pair. (live_orders_[currency_pair])

func GetLiveOrderChannels

func GetLiveOrderChannels() []Channel

GetLiveOrderChannels get all live order channels. (live_orders_[*])

func GetLiveTradeChannel added in v0.1.2

func GetLiveTradeChannel(p Pair) Channel

GetLiveTradeChannel get live trades channel for a pair. (live_trades_[currency_pair])

func GetLiveTradeChannels

func GetLiveTradeChannels() []Channel

GetLiveTradeChannel get all live trade channels. (live_trades_[*])

func GetOrderBookChannel added in v0.1.2

func GetOrderBookChannel(p Pair) Channel

GetOrderBookChannel get order book channel for a pair (order_book_[currency_pair])

func GetOrderBookChannels

func GetOrderBookChannels() []Channel

GetOrderBookChannel get all order book channels order_book_[*]

func GetUSDChannels

func GetUSDChannels() []Channel

func (Channel) String

func (p Channel) String() string

type CreateBuyInstantOrderRequest added in v0.1.1

type CreateBuyInstantOrderRequest struct {
	// Amount in counter currency (Example: For BTC/USD pair, amount is quoted in USD)
	Amount string `schema:"amount"`
}

CreateBuyInstantOrderRequest used by CreateBuyInstantOrder method to map outgoing request data

type CreateBuyLimitOrderRequest added in v0.0.3

type CreateBuyLimitOrderRequest struct {
	Amount string `schema:"amount,omitempty"`
	Price  string `schema:"price,omitempty"`
	// if the order gets executed, a new sell order will be placed, with "limit_price" as its price.
	LimitPrice string `schema:"limit_price,omitempty"`
	// Opens buy limit order which will be canceled at 0:00 UTC unless it already has been executed. Possible value: True
	DailyOrder bool `schema:"daily_order,omitempty"`
	// An Immediate-Or-Cancel (IOC) order is an order that must be executed immediately.
	// Any portion of an IOC order that cannot be filled immediately will be cancelled. Possible value: True
	IOCOrder bool `schema:"ioc_order,omitempty"`
	// A Fill-Or-Kill (FOK) order is an order that must be executed immediately in its entirety.
	// If the order cannot be immediately executed in its entirety, it will be cancelled.
	//Possible value: True
	FOCOrder bool `schema:"foc_order,omitempty"`
	// Unique client order id set by client. Client order id needs to be unique string. Client order id value can only be used once.
	ClientOrderID string `schema:"client_order_id,omitempty"`
}

CreateBuyLimitOrderRequest used by CreateBuyLimitOrder method to map outgoing request data

type CreateBuyMarketOrderRequest added in v0.1.1

type CreateBuyMarketOrderRequest struct {
	// Amount in base currency (Example: For BTC/USD pair, amount is quoted in BTC)
	Amount string `schema:"amount"`
}

CreateBuyMarketOrderRequest used by CreateBuyMarketOrder method to map outgoing request data

type CreateOrderResponse added in v0.1.1

type CreateOrderResponse struct {
	ID       string `json:"id"`
	Type     string `json:"type"`
	Price    string `json:"price"`
	Amount   string `json:"amount"`
	Datetime string `json:"datetime"`
}

CreateOrderResponse used to map responses of the following metthods CreateBuyLimitOrder, CreateSellLimitOrder CreateBuyMarketOrder, CreateSellMarketOrder CreateBuyInstantOrder, CreateSellInstantOrder

type CreateSellInstantOrderRequest added in v0.1.1

type CreateSellInstantOrderRequest struct {
	// Amount in base currency (Example: For BTC/USD pair, amount is quoted in BTC)
	Amount string `schema:"amount"`
	// Instant sell orders allow you to sell an amount of the base currency determined by the value
	// of it in the counter-currency. Amount_in_counter sets the amount parameter to refer to the counter
	// currency instead of the base currency of the selected trading pair. Possible value: True
	AmountInCounter bool `schema:"amount_in_counter,omitempty"`
	// Unique client order id set by client. Client order id needs to be unique string. Client order id value can only be used once.
	ClientOrderID string `schema:"client_order_id,omitempty"`
}

CreateSellInstantOrderRequest used by CreateSellInstantOrder method to map outgoing request data

type CreateSellLimitOrderRequest added in v0.0.2

type CreateSellLimitOrderRequest struct {
	Amount string `schema:"amount,omitempty"`
	Price  string `schema:"price,omitempty"`
	// If the order gets executed, a new buy order will be placed, with "limit_price" as its price.
	LimitPrice string `schema:"limit_price,omitempty"`
	// Opens sell limit order which will be canceled at 0:00 UTC unless it already has been executed. Possible value: True
	DailyOrder bool `schema:"daily_order,omitempty"`
	// An Immediate-Or-Cancel (IOC) order is an order that must be executed immediately.
	// Any portion of an IOC order that cannot be filled immediately will be cancelled. Possible value: True
	IOCOrder bool `schema:"ioc_order,omitempty"`
	// A Fill-Or-Kill (FOK) order is an order that must be executed immediately in its entirety.
	// If the order cannot be immediately executed in its entirety, it will be cancelled.
	//Possible value: True
	FOCOrder bool `schema:"foc_order,omitempty"`
	// Unique client order id set by client. Client order id needs to be unique string. Client order id value can only be used once.
	ClientOrderID string `schema:"client_order_id,omitempty"`
}

CreateSellLimitOrderRequest used by CreateSellLimitOrder method to map outgoing request data

type Error

type Error struct {
	Message    string
	StatusCode int
}

func (Error) Error

func (e Error) Error() string

type GenericErrorResponse

type GenericErrorResponse struct {
	Error  string          `json:"error"`
	Errors json.RawMessage `json:"errors"`
	Reason json.RawMessage `json:"reason"`
	Status string          `json:"status"`
	Code   string          `json:"code"`
}

GenericErrorResponse errors are not using a unified format trying to map them all kind of error responses at a generic object

type GetAccountBalancesResponse

type GetAccountBalancesResponse struct {
	AaveAvailable      string `json:"aave_available,omitempty"`
	AaveBalance        string `json:"aave_balance,omitempty"`
	AaveReserved       string `json:"aave_reserved,omitempty"`
	AaveWithdrawalFee  string `json:"aave_withdrawal_fee,omitempty"`
	AavebtcFee         string `json:"aavebtc_fee,omitempty"`
	AaveeurFee         string `json:"aaveeur_fee,omitempty"`
	AaveusdFee         string `json:"aaveusd_fee,omitempty"`
	AlgoAvailable      string `json:"algo_available,omitempty"`
	AlgoBalance        string `json:"algo_balance,omitempty"`
	AlgoReserved       string `json:"algo_reserved,omitempty"`
	AlgoWithdrawalFee  string `json:"algo_withdrawal_fee,omitempty"`
	AlgobtcFee         string `json:"algobtc_fee,omitempty"`
	AlgoeurFee         string `json:"algoeur_fee,omitempty"`
	AlgousdFee         string `json:"algousd_fee,omitempty"`
	AlphaAvailable     string `json:"alpha_available,omitempty"`
	AlphaBalance       string `json:"alpha_balance,omitempty"`
	AlphaReserved      string `json:"alpha_reserved,omitempty"`
	AlphaWithdrawalFee string `json:"alpha_withdrawal_fee,omitempty"`
	AlphaeurFee        string `json:"alphaeur_fee,omitempty"`
	AlphausdFee        string `json:"alphausd_fee,omitempty"`
	AudioAvailable     string `json:"audio_available,omitempty"`
	AudioBalance       string `json:"audio_balance,omitempty"`
	AudioReserved      string `json:"audio_reserved,omitempty"`
	AudioWithdrawalFee string `json:"audio_withdrawal_fee,omitempty"`
	AudiobtcFee        string `json:"audiobtc_fee,omitempty"`
	AudioeurFee        string `json:"audioeur_fee,omitempty"`
	AudiousdFee        string `json:"audiousd_fee,omitempty"`
	AxsAvailable       string `json:"axs_available,omitempty"`
	AxsBalance         string `json:"axs_balance,omitempty"`
	AxsReserved        string `json:"axs_reserved,omitempty"`
	AxsWithdrawalFee   string `json:"axs_withdrawal_fee,omitempty"`
	AxseurFee          string `json:"axseur_fee,omitempty"`
	AxsusdFee          string `json:"axsusd_fee,omitempty"`
	BatAvailable       string `json:"bat_available,omitempty"`
	BatBalance         string `json:"bat_balance,omitempty"`
	BatReserved        string `json:"bat_reserved,omitempty"`
	BatWithdrawalFee   string `json:"bat_withdrawal_fee,omitempty"`
	BatbtcFee          string `json:"batbtc_fee,omitempty"`
	BateurFee          string `json:"bateur_fee,omitempty"`
	BatusdFee          string `json:"batusd_fee,omitempty"`
	BchAvailable       string `json:"bch_available,omitempty"`
	BchBalance         string `json:"bch_balance,omitempty"`
	BchReserved        string `json:"bch_reserved,omitempty"`
	BchWithdrawalFee   string `json:"bch_withdrawal_fee,omitempty"`
	BchbtcFee          string `json:"bchbtc_fee,omitempty"`
	BcheurFee          string `json:"bcheur_fee,omitempty"`
	BchgbpFee          string `json:"bchgbp_fee,omitempty"`
	BchusdFee          string `json:"bchusd_fee,omitempty"`
	BtcAvailable       string `json:"btc_available,omitempty"`
	BtcBalance         string `json:"btc_balance,omitempty"`
	BtcReserved        string `json:"btc_reserved,omitempty"`
	BtcWithdrawalFee   string `json:"btc_withdrawal_fee,omitempty"`
	BtceurFee          string `json:"btceur_fee,omitempty"`
	BtcgbpFee          string `json:"btcgbp_fee,omitempty"`
	BtcpaxFee          string `json:"btcpax_fee,omitempty"`
	BtcusdFee          string `json:"btcusd_fee,omitempty"`
	BtcusdcFee         string `json:"btcusdc_fee,omitempty"`
	BtcusdtFee         string `json:"btcusdt_fee,omitempty"`
	CelAvailable       string `json:"cel_available,omitempty"`
	CelBalance         string `json:"cel_balance,omitempty"`
	CelReserved        string `json:"cel_reserved,omitempty"`
	CelWithdrawalFee   string `json:"cel_withdrawal_fee,omitempty"`
	CeleurFee          string `json:"celeur_fee,omitempty"`
	CelusdFee          string `json:"celusd_fee,omitempty"`
	ChzAvailable       string `json:"chz_available,omitempty"`
	ChzBalance         string `json:"chz_balance,omitempty"`
	ChzReserved        string `json:"chz_reserved,omitempty"`
	ChzWithdrawalFee   string `json:"chz_withdrawal_fee,omitempty"`
	ChzeurFee          string `json:"chzeur_fee,omitempty"`
	ChzusdFee          string `json:"chzusd_fee,omitempty"`
	CompAvailable      string `json:"comp_available,omitempty"`
	CompBalance        string `json:"comp_balance,omitempty"`
	CompReserved       string `json:"comp_reserved,omitempty"`
	CompWithdrawalFee  string `json:"comp_withdrawal_fee,omitempty"`
	CompbtcFee         string `json:"compbtc_fee,omitempty"`
	CompeurFee         string `json:"compeur_fee,omitempty"`
	CompusdFee         string `json:"compusd_fee,omitempty"`
	CrvAvailable       string `json:"crv_available,omitempty"`
	CrvBalance         string `json:"crv_balance,omitempty"`
	CrvReserved        string `json:"crv_reserved,omitempty"`
	CrvWithdrawalFee   string `json:"crv_withdrawal_fee,omitempty"`
	CrvbtcFee          string `json:"crvbtc_fee,omitempty"`
	CrveurFee          string `json:"crveur_fee,omitempty"`
	CrvusdFee          string `json:"crvusd_fee,omitempty"`
	DaiAvailable       string `json:"dai_available,omitempty"`
	DaiBalance         string `json:"dai_balance,omitempty"`
	DaiReserved        string `json:"dai_reserved,omitempty"`
	DaiWithdrawalFee   string `json:"dai_withdrawal_fee,omitempty"`
	DaiusdFee          string `json:"daiusd_fee,omitempty"`
	EnjAvailable       string `json:"enj_available,omitempty"`
	EnjBalance         string `json:"enj_balance,omitempty"`
	EnjReserved        string `json:"enj_reserved,omitempty"`
	EnjWithdrawalFee   string `json:"enj_withdrawal_fee,omitempty"`
	EnjeurFee          string `json:"enjeur_fee,omitempty"`
	EnjusdFee          string `json:"enjusd_fee,omitempty"`
	Eth2Available      string `json:"eth2_available,omitempty"`
	Eth2Balance        string `json:"eth2_balance,omitempty"`
	Eth2Reserved       string `json:"eth2_reserved,omitempty"`
	Eth2EthFee         string `json:"eth2eth_fee,omitempty"`
	Eth2RAvailable     string `json:"eth2r_available,omitempty"`
	Eth2RBalance       string `json:"eth2r_balance,omitempty"`
	Eth2RReserved      string `json:"eth2r_reserved,omitempty"`
	EthAvailable       string `json:"eth_available,omitempty"`
	EthBalance         string `json:"eth_balance,omitempty"`
	EthReserved        string `json:"eth_reserved,omitempty"`
	EthWithdrawalFee   string `json:"eth_withdrawal_fee,omitempty"`
	EthbtcFee          string `json:"ethbtc_fee,omitempty"`
	EtheurFee          string `json:"etheur_fee,omitempty"`
	EthgbpFee          string `json:"ethgbp_fee,omitempty"`
	EthpaxFee          string `json:"ethpax_fee,omitempty"`
	EthusdFee          string `json:"ethusd_fee,omitempty"`
	EthusdcFee         string `json:"ethusdc_fee,omitempty"`
	EthusdtFee         string `json:"ethusdt_fee,omitempty"`
	EurAvailable       string `json:"eur_available,omitempty"`
	EurBalance         string `json:"eur_balance,omitempty"`
	EurReserved        string `json:"eur_reserved,omitempty"`
	EurtAvailable      string `json:"eurt_available,omitempty"`
	EurtBalance        string `json:"eurt_balance,omitempty"`
	EurtReserved       string `json:"eurt_reserved,omitempty"`
	EurtWithdrawalFee  string `json:"eurt_withdrawal_fee,omitempty"`
	EurteurFee         string `json:"eurteur_fee,omitempty"`
	EurtusdFee         string `json:"eurtusd_fee,omitempty"`
	EurusdFee          string `json:"eurusd_fee,omitempty"`
	FetAvailable       string `json:"fet_available,omitempty"`
	FetBalance         string `json:"fet_balance,omitempty"`
	FetReserved        string `json:"fet_reserved,omitempty"`
	FetWithdrawalFee   string `json:"fet_withdrawal_fee,omitempty"`
	FeteurFee          string `json:"feteur_fee,omitempty"`
	FetusdFee          string `json:"fetusd_fee,omitempty"`
	FttAvailable       string `json:"ftt_available,omitempty"`
	FttBalance         string `json:"ftt_balance,omitempty"`
	FttReserved        string `json:"ftt_reserved,omitempty"`
	FttWithdrawalFee   string `json:"ftt_withdrawal_fee,omitempty"`
	FtteurFee          string `json:"ftteur_fee,omitempty"`
	FttusdFee          string `json:"fttusd_fee,omitempty"`
	GbpAvailable       string `json:"gbp_available,omitempty"`
	GbpBalance         string `json:"gbp_balance,omitempty"`
	GbpReserved        string `json:"gbp_reserved,omitempty"`
	GbpeurFee          string `json:"gbpeur_fee,omitempty"`
	GbpusdFee          string `json:"gbpusd_fee,omitempty"`
	GrtAvailable       string `json:"grt_available,omitempty"`
	GrtBalance         string `json:"grt_balance,omitempty"`
	GrtReserved        string `json:"grt_reserved,omitempty"`
	GrtWithdrawalFee   string `json:"grt_withdrawal_fee,omitempty"`
	GrteurFee          string `json:"grteur_fee,omitempty"`
	GrtusdFee          string `json:"grtusd_fee,omitempty"`
	GusdAvailable      string `json:"gusd_available,omitempty"`
	GusdBalance        string `json:"gusd_balance,omitempty"`
	GusdReserved       string `json:"gusd_reserved,omitempty"`
	GusdWithdrawalFee  string `json:"gusd_withdrawal_fee,omitempty"`
	GusdusdFee         string `json:"gusdusd_fee,omitempty"`
	HbarAvailable      string `json:"hbar_available,omitempty"`
	HbarBalance        string `json:"hbar_balance,omitempty"`
	HbarReserved       string `json:"hbar_reserved,omitempty"`
	HbarWithdrawalFee  string `json:"hbar_withdrawal_fee,omitempty"`
	HbareurFee         string `json:"hbareur_fee,omitempty"`
	HbarusdFee         string `json:"hbarusd_fee,omitempty"`
	KncAvailable       string `json:"knc_available,omitempty"`
	KncBalance         string `json:"knc_balance,omitempty"`
	KncReserved        string `json:"knc_reserved,omitempty"`
	KncWithdrawalFee   string `json:"knc_withdrawal_fee,omitempty"`
	KncbtcFee          string `json:"kncbtc_fee,omitempty"`
	KnceurFee          string `json:"knceur_fee,omitempty"`
	KncusdFee          string `json:"kncusd_fee,omitempty"`
	LinkAvailable      string `json:"link_available,omitempty"`
	LinkBalance        string `json:"link_balance,omitempty"`
	LinkReserved       string `json:"link_reserved,omitempty"`
	LinkWithdrawalFee  string `json:"link_withdrawal_fee,omitempty"`
	LinkbtcFee         string `json:"linkbtc_fee,omitempty"`
	LinkethFee         string `json:"linketh_fee,omitempty"`
	LinkeurFee         string `json:"linkeur_fee,omitempty"`
	LinkgbpFee         string `json:"linkgbp_fee,omitempty"`
	LinkusdFee         string `json:"linkusd_fee,omitempty"`
	LtcAvailable       string `json:"ltc_available,omitempty"`
	LtcBalance         string `json:"ltc_balance,omitempty"`
	LtcReserved        string `json:"ltc_reserved,omitempty"`
	LtcWithdrawalFee   string `json:"ltc_withdrawal_fee,omitempty"`
	LtcbtcFee          string `json:"ltcbtc_fee,omitempty"`
	LtceurFee          string `json:"ltceur_fee,omitempty"`
	LtcgbpFee          string `json:"ltcgbp_fee,omitempty"`
	LtcusdFee          string `json:"ltcusd_fee,omitempty"`
	MaticAvailable     string `json:"matic_available,omitempty"`
	MaticBalance       string `json:"matic_balance,omitempty"`
	MaticReserved      string `json:"matic_reserved,omitempty"`
	MaticWithdrawalFee string `json:"matic_withdrawal_fee,omitempty"`
	MaticeurFee        string `json:"maticeur_fee,omitempty"`
	MaticusdFee        string `json:"maticusd_fee,omitempty"`
	MkrAvailable       string `json:"mkr_available,omitempty"`
	MkrBalance         string `json:"mkr_balance,omitempty"`
	MkrReserved        string `json:"mkr_reserved,omitempty"`
	MkrWithdrawalFee   string `json:"mkr_withdrawal_fee,omitempty"`
	MkrbtcFee          string `json:"mkrbtc_fee,omitempty"`
	MkreurFee          string `json:"mkreur_fee,omitempty"`
	MkrusdFee          string `json:"mkrusd_fee,omitempty"`
	OmgAvailable       string `json:"omg_available,omitempty"`
	OmgBalance         string `json:"omg_balance,omitempty"`
	OmgReserved        string `json:"omg_reserved,omitempty"`
	OmgWithdrawalFee   string `json:"omg_withdrawal_fee,omitempty"`
	OmgbtcFee          string `json:"omgbtc_fee,omitempty"`
	OmgeurFee          string `json:"omgeur_fee,omitempty"`
	OmggbpFee          string `json:"omggbp_fee,omitempty"`
	OmgusdFee          string `json:"omgusd_fee,omitempty"`
	PaxAvailable       string `json:"pax_available,omitempty"`
	PaxBalance         string `json:"pax_balance,omitempty"`
	PaxReserved        string `json:"pax_reserved,omitempty"`
	PaxWithdrawalFee   string `json:"pax_withdrawal_fee,omitempty"`
	PaxeurFee          string `json:"paxeur_fee,omitempty"`
	PaxgbpFee          string `json:"paxgbp_fee,omitempty"`
	PaxusdFee          string `json:"paxusd_fee,omitempty"`
	RgtAvailable       string `json:"rgt_available,omitempty"`
	RgtBalance         string `json:"rgt_balance,omitempty"`
	RgtReserved        string `json:"rgt_reserved,omitempty"`
	RgtWithdrawalFee   string `json:"rgt_withdrawal_fee,omitempty"`
	RgteurFee          string `json:"rgteur_fee,omitempty"`
	RgtusdFee          string `json:"rgtusd_fee,omitempty"`
	SandAvailable      string `json:"sand_available,omitempty"`
	SandBalance        string `json:"sand_balance,omitempty"`
	SandReserved       string `json:"sand_reserved,omitempty"`
	SandWithdrawalFee  string `json:"sand_withdrawal_fee,omitempty"`
	SandeurFee         string `json:"sandeur_fee,omitempty"`
	SandusdFee         string `json:"sandusd_fee,omitempty"`
	SklAvailable       string `json:"skl_available,omitempty"`
	SklBalance         string `json:"skl_balance,omitempty"`
	SklReserved        string `json:"skl_reserved,omitempty"`
	SklWithdrawalFee   string `json:"skl_withdrawal_fee,omitempty"`
	SkleurFee          string `json:"skleur_fee,omitempty"`
	SklusdFee          string `json:"sklusd_fee,omitempty"`
	SnxAvailable       string `json:"snx_available,omitempty"`
	SnxBalance         string `json:"snx_balance,omitempty"`
	SnxReserved        string `json:"snx_reserved,omitempty"`
	SnxWithdrawalFee   string `json:"snx_withdrawal_fee,omitempty"`
	SnxbtcFee          string `json:"snxbtc_fee,omitempty"`
	SnxeurFee          string `json:"snxeur_fee,omitempty"`
	SnxusdFee          string `json:"snxusd_fee,omitempty"`
	StorjAvailable     string `json:"storj_available,omitempty"`
	StorjBalance       string `json:"storj_balance,omitempty"`
	StorjReserved      string `json:"storj_reserved,omitempty"`
	StorjWithdrawalFee string `json:"storj_withdrawal_fee,omitempty"`
	StorjeurFee        string `json:"storjeur_fee,omitempty"`
	StorjusdFee        string `json:"storjusd_fee,omitempty"`
	SushiAvailable     string `json:"sushi_available,omitempty"`
	SushiBalance       string `json:"sushi_balance,omitempty"`
	SushiReserved      string `json:"sushi_reserved,omitempty"`
	SushiWithdrawalFee string `json:"sushi_withdrawal_fee,omitempty"`
	SushieurFee        string `json:"sushieur_fee,omitempty"`
	SushiusdFee        string `json:"sushiusd_fee,omitempty"`
	SxpAvailable       string `json:"sxp_available,omitempty"`
	SxpBalance         string `json:"sxp_balance,omitempty"`
	SxpReserved        string `json:"sxp_reserved,omitempty"`
	SxpWithdrawalFee   string `json:"sxp_withdrawal_fee,omitempty"`
	SxpeurFee          string `json:"sxpeur_fee,omitempty"`
	SxpusdFee          string `json:"sxpusd_fee,omitempty"`
	UmaAvailable       string `json:"uma_available,omitempty"`
	UmaBalance         string `json:"uma_balance,omitempty"`
	UmaReserved        string `json:"uma_reserved,omitempty"`
	UmaWithdrawalFee   string `json:"uma_withdrawal_fee,omitempty"`
	UmabtcFee          string `json:"umabtc_fee,omitempty"`
	UmaeurFee          string `json:"umaeur_fee,omitempty"`
	UmausdFee          string `json:"umausd_fee,omitempty"`
	UniAvailable       string `json:"uni_available,omitempty"`
	UniBalance         string `json:"uni_balance,omitempty"`
	UniReserved        string `json:"uni_reserved,omitempty"`
	UniWithdrawalFee   string `json:"uni_withdrawal_fee,omitempty"`
	UnibtcFee          string `json:"unibtc_fee,omitempty"`
	UnieurFee          string `json:"unieur_fee,omitempty"`
	UniusdFee          string `json:"uniusd_fee,omitempty"`
	UsdAvailable       string `json:"usd_available,omitempty"`
	UsdBalance         string `json:"usd_balance,omitempty"`
	UsdReserved        string `json:"usd_reserved,omitempty"`
	UsdcAvailable      string `json:"usdc_available,omitempty"`
	UsdcBalance        string `json:"usdc_balance,omitempty"`
	UsdcReserved       string `json:"usdc_reserved,omitempty"`
	UsdcWithdrawalFee  string `json:"usdc_withdrawal_fee,omitempty"`
	UsdceurFee         string `json:"usdceur_fee,omitempty"`
	UsdcusdFee         string `json:"usdcusd_fee,omitempty"`
	UsdcusdtFee        string `json:"usdcusdt_fee,omitempty"`
	UsdtAvailable      string `json:"usdt_available,omitempty"`
	UsdtBalance        string `json:"usdt_balance,omitempty"`
	UsdtReserved       string `json:"usdt_reserved,omitempty"`
	UsdtWithdrawalFee  string `json:"usdt_withdrawal_fee,omitempty"`
	UsdteurFee         string `json:"usdteur_fee,omitempty"`
	UsdtusdFee         string `json:"usdtusd_fee,omitempty"`
	XlmAvailable       string `json:"xlm_available,omitempty"`
	XlmBalance         string `json:"xlm_balance,omitempty"`
	XlmReserved        string `json:"xlm_reserved,omitempty"`
	XlmWithdrawalFee   string `json:"xlm_withdrawal_fee,omitempty"`
	XlmbtcFee          string `json:"xlmbtc_fee,omitempty"`
	XlmeurFee          string `json:"xlmeur_fee,omitempty"`
	XlmgbpFee          string `json:"xlmgbp_fee,omitempty"`
	XlmusdFee          string `json:"xlmusd_fee,omitempty"`
	XrpAvailable       string `json:"xrp_available,omitempty"`
	XrpBalance         string `json:"xrp_balance,omitempty"`
	XrpReserved        string `json:"xrp_reserved,omitempty"`
	XrpWithdrawalFee   string `json:"xrp_withdrawal_fee,omitempty"`
	XrpbtcFee          string `json:"xrpbtc_fee,omitempty"`
	XrpeurFee          string `json:"xrpeur_fee,omitempty"`
	XrpgbpFee          string `json:"xrpgbp_fee,omitempty"`
	XrppaxFee          string `json:"xrppax_fee,omitempty"`
	XrpusdFee          string `json:"xrpusd_fee,omitempty"`
	XrpusdtFee         string `json:"xrpusdt_fee,omitempty"`
	YfiAvailable       string `json:"yfi_available,omitempty"`
	YfiBalance         string `json:"yfi_balance,omitempty"`
	YfiReserved        string `json:"yfi_reserved,omitempty"`
	YfiWithdrawalFee   string `json:"yfi_withdrawal_fee,omitempty"`
	YfibtcFee          string `json:"yfibtc_fee,omitempty"`
	YfieurFee          string `json:"yfieur_fee,omitempty"`
	YfiusdFee          string `json:"yfiusd_fee,omitempty"`
	ZrxAvailable       string `json:"zrx_available,omitempty"`
	ZrxBalance         string `json:"zrx_balance,omitempty"`
	ZrxReserved        string `json:"zrx_reserved,omitempty"`
	ZrxWithdrawalFee   string `json:"zrx_withdrawal_fee,omitempty"`
	ZrxbtcFee          string `json:"zrxbtc_fee,omitempty"`
	ZrxeurFee          string `json:"zrxeur_fee,omitempty"`
	ZrxusdFee          string `json:"zrxusd_fee,omitempty"`
}

GetAccountBalancesResponse used to map result of GetAccountBalances method

type GetCryptoTransactionsRequest

type GetCryptoTransactionsRequest struct {
	// Limit result to that many transactions (default: 100; minimum: 1; maximum: 1000).
	Limit int64 `schema:"limit,omitempty"`
	// Skip that many transactions before returning results (default: 0, maximum: 200000).
	Offset int64 `schema:"offset,omitempty"`
	// True - shows also ripple IOU transactions.
	IncludeIOUS bool `schema:"include_ious ,omitempty"`
}

GetCryptoTransactionsRequest used by GetCryptoTransactions method to map outgoing request data

type GetCryptoTransactionsResponse

type GetCryptoTransactionsResponse struct {
	Deposits []struct {
		Currency           string `json:"currency,"`
		DestinationAddress string `json:"destination_address,"`
		TXID               string `json:"txid,"`
		Amount             string `json:"amount,"`
		Datetime           string `json:"datetime,"`
	} `json:"deposits"`
	Withdrawals []struct {
		Currency           string `json:"currency,"`
		DestinationAddress string `json:"destination_address,"`
		TXID               string `json:"txid,"`
		Amount             string `json:"amount,"`
		Datetime           string `json:"datetime,"`
	} `json:"withdrawals"`
}

GetCryptoTransactionsResponse used to map response of GetCryptoTransactions method

type GetEURUSDConversionRateResult

type GetEURUSDConversionRateResult struct {
	Sell string `json:"sell"`
	Buy  string `json:"buy"`
}

GetEURUSDConversionRate used to map result of GetEURUSDConversionRate method

type GetOHLCDataRequest

type GetOHLCDataRequest struct {
	// Unix timestamp from when OHLC data will be started. (optional)
	Start int64 `schema:"start,omitempty"`
	// Unix timestamp to when OHLC data will be shown. (optional)
	End int64 `schema:"end,omitempty"`
	// Timeframe in seconds. Possible options are 60, 180, 300, 900, 1800, 3600, 7200, 14400, 21600, 43200, 86400, 259200
	Step int64 `schema:"step,required"`
	// Limit OHLC results (minimum: 1; maximum: 1000)
	Limit int64 `schema:"limit,required"`
}

GetOHLCDataRequest used by GetOHLCData method to map result

type GetOHLCDataResponse

type GetOHLCDataResponse struct {
	Data struct {
		Pair string `json:"pair"`
		Ohlc []struct {
			High      string `json:"high"`
			Timestamp string `json:"timestamp"`
			Volume    string `json:"volume"`
			Low       string `json:"low"`
			Close     string `json:"close"`
			Open      string `json:"open"`
		} `json:"ohlc"`
	} `json:"data"`
}

GetOHLCDataResponse used to map result of GetOHLCData method

type GetOpenOrderResponse

type GetOpenOrderResponse struct {
	ID           string `json:"id"`
	Type         string `json:"type"`
	Price        string `json:"price"`
	CurrencyPair string `json:"currency_pair"`
	Datetime     string `json:"datetime"`
	Amount       string `json:"amount"`
}

GetOpenOrderResponse used to map response of GetOpenOrders method

type GetOrderBookResponse

type GetOrderBookResponse struct {
	Timestamp      string     `json:"timestamp"`
	Microtimestamp string     `json:"microtimestamp"`
	Bids           [][]string `json:"bids"`
	Asks           [][]string `json:"asks"`
}

OrderBookResponse used to map results of GetOrderBook methods

type GetOrderStatusRequest

type GetOrderStatusRequest struct {
	// Order ID.
	ID string `schema:"id,omitempty"`
	// Client order id. (Can only be used if order was placed with client order id parameter.)
	ClientOrderID string `schema:"client_order_id,omitempty"`
}

GetOrderStatusRequest used by GetOrderStatus method to map outgoing request data

type GetOrderStatusResponse

type GetOrderStatusResponse struct {
	ID           int64  `json:"id"`
	Status       string `json:"status"`
	Transactions []struct {
		TID      string `json:"tid"`
		USD      string `json:"usd"`
		Price    string `json:"price"`
		Fee      string `json:"fee"`
		Btc      string `json:"btc"`
		Datetime string `json:"datetime"`
		// (0 - deposit; 1 - withdrawal; 2 - market trade).
		Type string `json:"type"`
	} `json:"transactions"`
	AmountRemaining string `json:"amount_remaining"`
	// Client order id. (Only returned if order was placed with client order id parameter.)
	ClientOrderID *string `json:"client_order_id"`
}

GetOpenOrderResponse used to map response of GetOpenOrders method

type GetTickerResponse

type GetTickerResponse struct {
	High      string `json:"high"`
	Last      string `json:"last"`
	Timestamp string `json:"timestamp"`
	Bid       string `json:"bid"`
	Vwap      string `json:"vwap"`
	Volume    string `json:"volume"`
	Low       string `json:"low"`
	Ask       string `json:"ask"`
	Open      string `json:"open"`
}

TickerResponse used to map results of GetTicker, GetTickerHourly methods

type GetTradingPairInfoResult

type GetTradingPairInfoResult struct {
	Trading                string `json:"trading"`
	BaseDecimals           int    `json:"base_decimals"`
	URLSymbol              string `json:"url_symbol"`
	Name                   string `json:"name"`
	InstantAndMarketOrders string `json:"instant_and_market_orders"`
	MinimumOrder           string `json:"minimum_order"`
	CounterDecimals        int    `json:"counter_decimals"`
	Description            string `json:"description"`
}

GetTradingPairInfoResult used to map result of GetTradingPairsInfo method

type GetTransactionResponse

type GetTransactionResponse struct {
	TID    string `json:"tid"`
	Type   string `json:"type"`
	Amount string `json:"amount"`
	Price  string `json:"price"`
	Date   string `json:"date"`
}

GetTransactionsResponse used by GetTransactions to map response

type GetTransactionsRequest

type GetTransactionsRequest struct {
	// The time interval from which we want the transactions to be returned. Possible values are minute, hour (default) or day.
	Time string `schema:"time,omitempty"`
}

GetTransactionsRequest used by GetTransactions method to map outgoing request data

type GetUserTransactionResponse

type GetUserTransactionResponse struct {
	ID       int     `json:"id"`
	OrderID  int     `json:"order_id"`
	Type     string  `json:"type"`
	Fee      string  `json:"fee"`
	Datetime string  `json:"datetime,omitempty"`
	BtcUsd   string  `json:"btc_usd,omitempty"`
	Usd      float64 `json:"usd,omitempty"`
	Btc      float64 `json:"btc,omitempty"`
	Eur      string  `json:"eur,omitempty"`
	XrpEur   float64 `json:"xrp_eur,omitempty"`
	XrpUsd   float64 `json:"xrp_usd,omitempty"`
	Xrp      string  `json:"xrp,omitempty"`
	Eth      string  `json:"eth,omitempty"`
	EthEur   float64 `json:"eth_eur,omitempty"`
	EthUsd   float64 `json:"eth_usd,omitempty"`
	Xlm      string  `json:"xlm,omitempty"`
	XlmEur   float64 `json:"xlm_eur,omitempty"`
	XlmUsd   float64 `json:"xlm_usd,omitempty"`
	Omg      string  `json:"omg,omitempty"`
	OmgEur   float64 `json:"omg_eur,omitempty"`
	OmgUsd   float64 `json:"omg_usd,omitempty"`
	ZrxEur   float64 `json:"zrx_eur,omitempty"`
	ZrxUsd   float64 `json:"zrx_usd,omitempty"`
	Zrx      string  `json:"zrx,omitempty"`
}

GetUserTransactionResponse used to map response of GetUserTransactions method

type GetUserTransactionsRequest

type GetUserTransactionsRequest struct {
	// Skip that many transactions before returning results (default: 0, maximum: 200000).
	// If you need to export older history contact support OR use combination of limit and since_id parameters
	Offset int64 `schema:"offset,required"`
	// Limit result to that many transactions (default: 100; maximum: 1000).
	Limit int64 `schema:"limit,required"`
	// Sorting by date and time: asc - ascending; desc - descending (default: desc).
	Sort Sort `schema:"sort,required"`
	// Show only transactions from unix timestamp (for max 30 days old). (optional)
	SinceTimestamp int64 `schema:"since_timestamp,omitempty"`
	// Show only transactions from specified transaction id. If since_id parameter is used, limit parameter is set to 1000. (optional)
	SinceID int64 `schema:"since_id,omitempty"`
}

GetUserTransactionsRequest used by GetUserTransactions method to map outgoing request data

type GetWebsocketTokenResponse

type GetWebsocketTokenResponse struct {
	Token        string `json:"token"`
	ValidSeconds string `json:"valid_sec"`
}

GetWebsocketTokenResponse use to map response of GetWebsocketToken method

type HTTPAPI

type HTTPAPI struct {
	// contains filtered or unexported fields
}
Example
package main

import (
	"context"
	"log"

	"github.com/georlav/bitstamp"
)

func main() {
	c := bitstamp.NewHTTPAPI(
		bitstamp.EnableDebugOption(),                       // Show requests and responses for debugging purposes
		bitstamp.BaseURLOption("https://www.bitstamp.net"), // Change default API URL
		bitstamp.APIKeyOption("xxx"),                       // Can also be set via env variable BITSTAMP_KEY
		bitstamp.APISecretOption("xxx"),                    // Can also be set via env variable BITSTAMP_SECRET
		bitstamp.ClientTimeoutOption(15),                   // Change default client timeout
	)

	resp, err := c.GetTicker(context.Background(), bitstamp.BTCEUR)
	if err != nil {
		log.Fatalf("Failed to retrieve data, %s", err)
	}

	log.Println(resp.Ask, resp.Bid)
}
Output:

func NewHTTPAPI

func NewHTTPAPI(options ...option) *HTTPAPI

NewHTTPAPI create a new client instance

REQUEST LIMITS Do not do more than 8000 requests per 10 minutes or your IP address will be banned. For real time data use websocket API.

func (*HTTPAPI) CancelAllOrders

func (h *HTTPAPI) CancelAllOrders(ctx context.Context, p *Pair) (*CancelAllOrdersResponse, error)

CancelAllOrders if a pair is nil cancels all orders on an account, else cancels all orders for the specified pair Docs https://www.bitstamp.net/api/#cancel-all-orders

func (*HTTPAPI) CancelOrder

CancelOrder cancels an order by id Docs https://www.bitstamp.net/api/#cancel-order

func (*HTTPAPI) CreateBuyInstantOrder added in v0.1.1

func (h *HTTPAPI) CreateBuyInstantOrder(ctx context.Context, p Pair, r CreateBuyInstantOrderRequest) (*CreateOrderResponse, error)

CreateBuyInstantOrder creates a new buy instant order Docs https://www.bitstamp.net/api/#buy-instant-order

func (*HTTPAPI) CreateBuyLimitOrder added in v0.0.3

func (h *HTTPAPI) CreateBuyLimitOrder(ctx context.Context, p Pair, r CreateBuyLimitOrderRequest) (*CreateOrderResponse, error)

CreateBuyLimitOrder creates a buy limit order Docs https://www.bitstamp.net/api/#buy-order

func (*HTTPAPI) CreateSellInstantOrder added in v0.1.1

func (h *HTTPAPI) CreateSellInstantOrder(ctx context.Context, p Pair, r CreateSellInstantOrderRequest) (*CreateOrderResponse, error)

CreateSellInstantOrder creates a sell instant order Docs https://www.bitstamp.net/api/#sell-instant-order

func (*HTTPAPI) CreateSellLimitOrder added in v0.0.2

func (h *HTTPAPI) CreateSellLimitOrder(ctx context.Context, p Pair, r CreateSellLimitOrderRequest) (*CreateOrderResponse, error)

CreateSellLimitOrder creates a sell limit order Docs https://www.bitstamp.net/api/#sell-order

func (*HTTPAPI) GetAccountBalance

func (h *HTTPAPI) GetAccountBalance(ctx context.Context, p *Pair) (*GetAccountBalancesResponse, error)

GetAccountBalance retrieves balances of given pair, if pair is nil returns all account balances Docs https://www.bitstamp.net/api/#account-balance

func (*HTTPAPI) GetCryptoTransactions

GetCryptoTransactions retrieves data for all cryptocurrency deposits and withdrawals. Docs https://www.bitstamp.net/api/#crypto-transactions

func (*HTTPAPI) GetEURUSDConversionRate

func (h *HTTPAPI) GetEURUSDConversionRate(ctx context.Context) (*GetEURUSDConversionRateResult, error)

GetEURUSDConversionRate retrieves EUR/USD convension rate Docs https://www.bitstamp.net/api/#conversion-rate

func (*HTTPAPI) GetOHLCData

func (h *HTTPAPI) GetOHLCData(ctx context.Context, p Pair, r GetOHLCDataRequest) (*GetOHLCDataResponse, error)

GetOHLCData retrieve information about open,high,low,close values Docs https://www.bitstamp.net/api/#ohlc_data

func (*HTTPAPI) GetOpenOrders

func (h *HTTPAPI) GetOpenOrders(ctx context.Context) ([]GetOpenOrderResponse, error)

GetOpenOrders retrieves open orders, after call data is cached for 10 seconds Docs https://www.bitstamp.net/api/#open-orders

func (*HTTPAPI) GetOrderBook

func (h *HTTPAPI) GetOrderBook(ctx context.Context, p Pair) (*GetOrderBookResponse, error)

GetOrderBook retrieve information for all supported trading pairs Docs https://www.bitstamp.net/api/#order-book

func (*HTTPAPI) GetOrderStatus

GetOrderStatus retrieves order status Docs https://www.bitstamp.net/api/#order-status

func (*HTTPAPI) GetTicker

func (h *HTTPAPI) GetTicker(ctx context.Context, p Pair) (*GetTickerResponse, error)

Ticker retrieves information for a pair Docs https://www.bitstamp.net/api/#ticker

func (*HTTPAPI) GetTickerHourly

func (h *HTTPAPI) GetTickerHourly(ctx context.Context, p Pair) (*GetTickerResponse, error)

GetTickerHourly retrieves information for a pair Docs https://www.bitstamp.net/api/#ticker-hour

func (*HTTPAPI) GetTradingPairsInfo

func (h *HTTPAPI) GetTradingPairsInfo(ctx context.Context) ([]GetTradingPairInfoResult, error)

GetTradingPairsInfo retrieve information for all supported trading pairs Docs https://www.bitstamp.net/api/#trading-pairs-info

func (*HTTPAPI) GetTransactions

func (h *HTTPAPI) GetTransactions(ctx context.Context, p Pair, r GetTransactionsRequest) ([]GetTransactionResponse, error)

GetTransactions retrieve transactions Docs https://www.bitstamp.net/api/#transactions

func (*HTTPAPI) GetUserTransactions

func (h *HTTPAPI) GetUserTransactions(ctx context.Context, p *Pair, r GetUserTransactionsRequest) ([]GetUserTransactionResponse, error)

GetUserTransactions retrieves current account transactions, if pair is nil returns all user transactions Docs https://www.bitstamp.net/api/#user-transactions

func (*HTTPAPI) GetWebsocketsToken

func (h *HTTPAPI) GetWebsocketsToken(ctx context.Context) (*GetWebsocketTokenResponse, error)

GetWebsocketsToken retrieves a token that can be used for subscribing to private WebSocket channels. Docs https://www.bitstamp.net/api/#websockets-token For private Websocket access, you need to contact support.

type LiveDetailOrderBookChannel

type LiveDetailOrderBookChannel struct {
	Data struct {
		Timestamp      string `json:"timestamp"`
		Microtimestamp string `json:"microtimestamp"`
		// List of top 100 bids [price, amount, order id].
		Bids [][]string `json:"bids"`
		// List of top 100 asks [price, amount, order id].
		Asks [][]string `json:"asks"`
	} `json:"data"`
	Channel string `json:"channel"`
	Event   string `json:"event"`
}

LiveDetailOrderBookChannel object to map messages from detail_order_book_[currency_pair] channel

type LiveFullOrderBook

type LiveFullOrderBook struct {
	Data struct {
		Timestamp      string `json:"timestamp"`
		Microtimestamp string `json:"microtimestamp"`
		// List of changed bids since last broadcast.
		Bids [][]string `json:"bids"`
		// List of changed asks since last broadcast.
		Asks [][]string `json:"asks"`
	} `json:"data"`
	Channel string `json:"channel"`
	Event   string `json:"event"`
}

LiveFullOrderBook object to map messages from diff_order_book_[currency_pair] channel

type LiveOrderBookChannel

type LiveOrderBookChannel struct {
	Data struct {
		Timestamp      string `json:"timestamp"`
		Microtimestamp string `json:"microtimestamp"`
		// List of top 100 bids
		Bids [][]string `json:"bids"`
		// List of top 100 asks
		Asks [][]string `json:"asks"`
	} `json:"data"`
	Channel string `json:"channel"`
	Event   string `json:"event"`
}

LiveOrderBookChannel object to map messages from order_book_[currency_pair] channel

type LiveOrdersChannel

type LiveOrdersChannel struct {
	Data struct {
		ID             int64   `json:"id"`
		IDStr          string  `json:"id_str"`
		OrderType      int     `json:"order_type"`
		Datetime       string  `json:"datetime"`
		Microtimestamp string  `json:"microtimestamp"`
		Amount         float64 `json:"amount"`
		AmountStr      string  `json:"amount_str"`
		Price          float64 `json:"price"`
		PriceStr       string  `json:"price_str"`
	} `json:"data"`
	Channel string `json:"channel"`
	Event   string `json:"event"`
}

LiveOrdersChannel object to map messages from live_orders_[currency_pair] channel

type LiveTickerChannel

type LiveTickerChannel struct {
	Data struct {
		ID             int     `json:"id"`
		Timestamp      string  `json:"timestamp"`
		Amount         float64 `json:"amount"`
		AmountStr      string  `json:"amount_str"`
		Price          float64 `json:"price"`
		PriceStr       string  `json:"price_str"`
		Type           int     `json:"type"`
		Microtimestamp string  `json:"microtimestamp"`
		BuyOrderID     int64   `json:"buy_order_id"`
		SellOrderID    int64   `json:"sell_order_id"`
	} `json:"data"`
	Channel string `json:"channel"`
	Event   string `json:"event"`
}

LiveTickerChannel object to map messages from live_trades_[currency_pair] channel

type Pair

type Pair uint32
const (
	AAVEBTC Pair = iota
	AAVEEUR
	AAVEUSD
	ADABTC
	ADAEUR
	ADAUSD
	ALGOBTC
	ALGOEUR
	ALGOUSD
	ALPHAEUR
	ALPHAUSD
	AMPEUR
	AMPUSD
	ANTEUR
	ANTUSD
	AUDIOBTC
	AUDIOEUR
	AUDIOUSD
	AVAXEUR
	AVAXUSD
	AXSEUR
	AXSUSD
	BANDEUR
	BANDUSD
	BATBTC
	BATEUR
	BATUSD
	BCHBTC
	BCHEUR
	BCHGBP
	BCHUSD
	BTCEUR
	BTCGBP
	BTCPAX
	BTCUSD
	BTCUSDC
	BTCUSDT
	CELEUR
	CELUSD
	CHZEUR
	CHZUSD
	COMPBTC
	COMPEUR
	COMPUSD
	CRVBTC
	CRVEUR
	CRVUSD
	CTSIEUR
	CTSIUSD
	CVXEUR
	CVXUSD
	DAIUSD
	DYDXEUR
	DYDXUSD
	ENJEUR
	ENJUSD
	ETH2ETH
	ETHBTC
	ETHEUR
	ETHGBP
	ETHPAX
	ETHUSD
	ETHUSDC
	ETHUSDT
	EURTEUR
	EURTUSD
	EURUSD
	FETEUR
	FETUSD
	FTMEUR
	FTMUSD
	FTTEUR
	FTTUSD
	GALAEUR
	GALAUSD
	GBPEUR
	GBPUSD
	GODSEUR
	GODSUSD
	GRTEUR
	GRTUSD
	GUSDUSD
	HBAREUR
	HBARUSD
	IMXEUR
	IMXUSD
	INJEUR
	INJUSD
	KNCBTC
	KNCEUR
	KNCUSD
	LINKBTC
	LINKETH
	LINKEUR
	LINKGBP
	LINKUSD
	LTCBTC
	LTCEUR
	LTCGBP
	LTCUSD
	MATICEUR
	MATICUSD
	MKRBTC
	MKREUR
	MKRUSD
	NEXOEUR
	NEXOUSD
	OMGBTC
	OMGEUR
	OMGGBP
	OMGUSD
	PAXEUR
	PAXGBP
	PAXUSD
	PERPEUR
	PERPUSD
	RADEUR
	RADUSD
	RGTEUR
	RGTUSD
	RLYEUR
	RLYUSD
	RNDREUR
	RNDRUSD
	SANDEUR
	SANDUSD
	SGBEUR
	SGBUSD
	SKLEUR
	SKLUSD
	SLPEUR
	SLPUSD
	SNXBTC
	SNXEUR
	SNXUSD
	STORJEUR
	STORJUSD
	SUSHIEUR
	SUSHIUSD
	SXPEUR
	SXPUSD
	UMABTC
	UMAEUR
	UMAUSD
	UNIBTC
	UNIEUR
	UNIUSD
	USDCEUR
	USDCUSD
	USDCUSDT
	USDTEUR
	USDTUSD
	USTEUR
	USTUSD
	VEGAEUR
	VEGAUSD
	WBTCBTC
	XLMBTC
	XLMEUR
	XLMGBP
	XLMUSD
	XRPBTC
	XRPEUR
	XRPGBP
	XRPPAX
	XRPUSD
	XRPUSDT
	YFIBTC
	YFIEUR
	YFIUSD
	ZRXBTC
	ZRXEUR
	ZRXUSD
	NILNIL
)

func GetAllPairs

func GetAllPairs() []Pair

func GetBTCPairs

func GetBTCPairs() []Pair

func GetEuroPairs

func GetEuroPairs() []Pair

func GetGBPPairs

func GetGBPPairs() []Pair

func GetUSDPairs

func GetUSDPairs() []Pair

func (Pair) String

func (p Pair) String() string

type Sort

type Sort string
const (
	SortASC  Sort = "asc"
	SortDESC Sort = "desc"
)

type WebSocketMessage

type WebSocketMessage struct {
	Event   string      `json:"event"`
	Channel string      `json:"channel"`
	Data    interface{} `json:"data"`
}

WebSocketMessage object to map any message

type WebsocketAPI

type WebsocketAPI struct {
	// contains filtered or unexported fields
}
Example
package main

import (
	"context"
	"errors"
	"fmt"
	"log"
	"time"

	"github.com/georlav/bitstamp"
)

func main() {
	// initialize client
	ws, err := bitstamp.NewWebsocketAPI()
	if err != nil {
		log.Fatalf("failed to initialize websocket client, %s", err)
	}

	ctx, cancel := context.WithTimeout(context.Background(), 8*time.Hour)
	defer cancel()

	// subscribe to channels and start consuming messages
	// consume should be called once per instance
	msgCH, err := ws.Consume(ctx,
		// You can add your needed channels
		bitstamp.LiveTradesBTCEURChannel,
		bitstamp.LiveTradesETHEURChannel,
		bitstamp.LiveTradesZRXEURChannel,
		// There are also some helpers that can be used to retrieve group of channels to batch subscribe to them
		//
		// bitstamp.GetAllChannels()...
		// bitstamp.GetAllChannels()...
		// bitstamp.GetUSDChannels()...,
		// bitstamp.GetBTCChannels()...,
		// bitstamp.GetGBPChannels()...,
		// bitstamp.GetLiveTradeChannels()...,
		// bitstamp.GetLiveOrderChannels()...,
		// bitstamp.GetDetailOrderBookChannels()...,
		// bitstamp.GetDiffOrderBookChannels()...,
	)
	if err != nil {
		log.Fatalf("failed to subscribe to channels, %s", err)
	}

	// Consume messages
	for msg := range msgCH {
		if msg.Error != nil {
			if errors.Is(err, bitstamp.ErrReceivedReconnectMessage) {
				log.Fatal("websocket server is to go under maintenance, you need to reconnect.")
			}

			log.Fatal(msg.Error)
		}

		// you can work with raw messages
		fmt.Println("Raw Message: ", string(msg.RawMessage))

		// you can work with objects
		switch v := msg.Message.(type) {
		case bitstamp.LiveTickerChannel:
			fmt.Println("Message: ", v.Channel, v.Event, v.Data, v.Data.Amount)

		case bitstamp.LiveOrdersChannel:
			fmt.Println("Message: ", v.Channel, v.Event, v.Data, v.Data.ID)

		case bitstamp.LiveOrderBookChannel:
			fmt.Println("Message: ", v.Channel, v.Event, v.Data)

		case bitstamp.LiveDetailOrderBookChannel:
			fmt.Println("Message: ", v.Channel, v.Event, v.Data)

		case bitstamp.LiveFullOrderBook:
			fmt.Println("Message: ", v.Channel, v.Event, v.Data)

		case bitstamp.WebSocketMessage:
			fmt.Println("Event Message: ", v.Channel, v.Event, v.Data)

		default:
			fmt.Println("Unknown message: ", msg.RawMessage)
		}

	}

	// subscribe to more channels
	if err := ws.SubscribeToChannels(context.Background(), bitstamp.LiveTradesXLMEURChannel); err != nil {
		log.Fatalf("Failed to unsubscribe, %s", err)
	}

	// unsubscribe from channels
	if err := ws.UnSubscribeFromChannels(context.Background(), bitstamp.LiveTradesXLMEURChannel); err != nil {
		log.Fatalf("Failed to unsubscribe, %s", err)
	}

	// Get active subscriptions
	fmt.Println("Active subscriptions", ws.GetSubscriptions())
}
Output:

func NewWebsocketAPI

func NewWebsocketAPI(opts ...wsOption) (*WebsocketAPI, error)

func (*WebsocketAPI) Close

func (w *WebsocketAPI) Close() error

Close connection

func (*WebsocketAPI) Consume

func (w *WebsocketAPI) Consume(ctx context.Context, channels ...Channel) (<-chan WebsocketMessage, error)

Consume subscribe to channel(s) and start consuming messages do not call this on same instance twice

func (*WebsocketAPI) GetSubscriptions

func (w *WebsocketAPI) GetSubscriptions() []Channel

GetSubscriptions returns a list of tracked subscriptions

func (*WebsocketAPI) SubscribeToChannels

func (w *WebsocketAPI) SubscribeToChannels(ctx context.Context, channels ...Channel) error

SubscribeToChannels use this method to subscribe to channel(s)

func (*WebsocketAPI) UnSubscribeFromAllChannels added in v0.2.1

func (w *WebsocketAPI) UnSubscribeFromAllChannels(ctx context.Context) error

UnSubscribeFromAllChannels use this method to unsubscribe from all channels you are subscribed

func (*WebsocketAPI) UnSubscribeFromChannels

func (w *WebsocketAPI) UnSubscribeFromChannels(ctx context.Context, channels ...Channel) error

UnSubscribeFromChannels use this method to unsubscribe from channel(s)

type WebsocketMessage

type WebsocketMessage struct {
	Message    interface{}
	RawMessage []byte
	Error      error
}

Directories

Path Synopsis
tools
generatechannels
Just a simple tool that retrieves all available pairs from bitstamp and generates a fresh channel enums file (channel.go)
Just a simple tool that retrieves all available pairs from bitstamp and generates a fresh channel enums file (channel.go)
generatepairs
Just a simple tool that retrieves all available pairs from bitstamp and generates a fresh pair enums file (pair.go)
Just a simple tool that retrieves all available pairs from bitstamp and generates a fresh pair enums file (pair.go)

Jump to

Keyboard shortcuts

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