bittrex

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MIT Imports: 17 Imported by: 40

README

go-bittrex GoDoc

go-bittrex is an implementation of the Bittrex API (public and private) in Golang.

This version implement V1.1 Bittrex API and the new HMAC authentification.

Import

import "github.com/toorop/go-bittrex"

Usage

In order to use the client with go's default http client settings you can do:

package main

import (
	"fmt"
	"github.com/toorop/go-bittrex"
)

const (
	API_KEY    = "YOUR_API_KEY"
	API_SECRET = "YOUR_API_SECRET"
)

func main() {
	// Bittrex client
	bittrex := bittrex.New(API_KEY, API_SECRET)

	// Get markets
	markets, err := bittrex.GetMarkets()
	fmt.Println(err, markets)
}

In order to use custom settings for the http client do:

package main

import (
	"fmt"
	"net/http"
	"time"
	"github.com/toorop/go-bittrex"
)

const (
	API_KEY    = "YOUR_API_KEY"
	API_SECRET = "YOUR_API_SECRET"
)

func main() {
	httpClient := &http.Client{
		Timeout: time.Second * 10,
	}

	// Bittrex client
	bittrex := bittrex.NewWithCustomHttpClient(API_KEY, API_SECRET, httpClient)

	// Get markets
	markets, err := bittrex.GetMarkets()
	fmt.Println(err, markets)
}

See "Examples" folder for more... examples

Documentation

GoDoc

Stay tuned

Follow me on Twitter

Donate

toorop Original Maintainer
Donation QR

1HgpsmxV52eAjDcoNpVGpYEhGfgN7mM1JB

PrettyBoyHelios REST API V3 Upgrade

BTC: 3HygqTcCGq7uT8FL5UguvFkeqV2CSto3eE

Documentation

Overview

Package Bittrex is an implementation of the Biitrex API in Golang.

Index

Constants

View Source
const (
	API_BASE    = "https://api.bittrex.com/" // Bittrex API endpoint
	API_VERSION = "v3"
	WS_BASE     = "socket.bittrex.com" // Bittrex WS API endpoint
	WS_HUB      = "CoreHub"            // SignalR main hub
)
View Source
const TIME_FORMAT = "2006-01-02T15:04:05"

Variables

View Source
var (
	ERR_ORDER_MISSING_PARAMETERS      = errors.New("missing parameters. make sure (type, market_symbol, direction, time_in_force) are set")
	ERR_WITHDRAWAL_MISSING_PARAMETERS = errors.New("missing parameters. make sure (address, currency, quantity) are set")
)
View Source
var CANDLE_INTERVALS = map[string]bool{
	"oneMin":    true,
	"fiveMin":   true,
	"thirtyMin": true,
	"hour":      true,
	"day":       true,
}

Functions

func NewClient

func NewClient(apiKey, apiSecret string) (c *client)

NewClient return a new Bittrex HTTP client

func NewClientWithCustomHttpConfig

func NewClientWithCustomHttpConfig(apiKey, apiSecret string, httpClient *http.Client) (c *client)

NewClientWithCustomHttpConfig returns a new Bittrex HTTP client using the predefined http client

func NewClientWithCustomTimeout

func NewClientWithCustomTimeout(apiKey, apiSecret string, timeout time.Duration) (c *client)

NewClientWithCustomTimeout returns a new Bittrex HTTP client with custom timeout

Types

type Address

type Address struct {
	Currency string `json:"Currency"`
	Address  string `json:"Address"`
}

type AddressParams

type AddressParams struct {
	CurrencySymbol string `json:"currencySymbol"`
}

type AddressV3

type AddressV3 struct {
	Status           string `json:"status"`
	CurrencySymbol   string `json:"currencySymbol"`
	CryptoAddress    string `json:"cryptoAddress"`
	CryptoAddressTag string `json:"cryptoAddressTag"`
}

type Balance

type Balance struct {
	Currency      string          `json:"Currency"`
	Balance       decimal.Decimal `json:"Balance"`
	Available     decimal.Decimal `json:"Available"`
	Pending       decimal.Decimal `json:"Pending"`
	CryptoAddress string          `json:"CryptoAddress"`
	Requested     bool            `json:"Requested"`
	Uuid          string          `json:"Uuid"`
}

type BalanceD

type BalanceD struct {
	BalanceD decimal.Decimal `json:"Balance"`
}

type BalanceV3

type BalanceV3 struct {
	CurrencySymbol string          `json:"currencySymbol"`
	Total          decimal.Decimal `json:"total"`
	Available      decimal.Decimal `json:"available"`
	UpdatedAt      time.Time       `json:"updatedAt"`
}

type Bittrex

type Bittrex struct {
	// contains filtered or unexported fields
}

bittrex represent a bittrex client

func New

func New(apiKey, apiSecret string) *Bittrex

New returns an instantiated bittrex struct

func NewWithCustomHttpClient

func NewWithCustomHttpClient(apiKey, apiSecret string, httpClient *http.Client) *Bittrex

NewWithCustomHttpClient returns an instantiated bittrex struct with custom http client

func NewWithCustomTimeout

func NewWithCustomTimeout(apiKey, apiSecret string, timeout time.Duration) *Bittrex

NewWithCustomTimeout returns an instantiated bittrex struct with custom timeout

func (*Bittrex) BuyLimit

func (b *Bittrex) BuyLimit(market string, quantity, rate decimal.Decimal) (uuid string, err error)

BuyLimit is used to place a limited buy order in a specific market.

func (*Bittrex) CancelOrder

func (b *Bittrex) CancelOrder(orderID string) (order OrderV3, err error)

CancelOrder is used to cancel a buy or sell order.

func (*Bittrex) CreateOrder

func (b *Bittrex) CreateOrder(params CreateOrderParams) (order OrderV3, err error)

CreateOrder is used to create any type of supported order.

func (*Bittrex) GetBalance

func (b *Bittrex) GetBalance(currency string) (balance Balance, err error)

Getbalance is used to retrieve the balance from your account for a specific currency. currency: a string literal for the currency (ex: LTC)

func (*Bittrex) GetBalances

func (b *Bittrex) GetBalances() (balances []BalanceV3, err error)

GetBalances is used to retrieve all balances from your account

func (*Bittrex) GetClosedDepositHistory added in v0.0.4

func (b *Bittrex) GetClosedDepositHistory(currency string, status DepositStatus) (deposits []DepositV3, err error)

GetClosedDepositHistory is used to retrieve your closed deposit history currency string a string literal for the currency (ie. BTC). If set to "all", will return for all currencies

func (*Bittrex) GetClosedOrders added in v0.0.2

func (b *Bittrex) GetClosedOrders(market string) (closedOrders []OrderV3, err error)

GetClosedOrders returns orders that you currently have opened. If market is set to "all", GetClosedOrders return all orders If market is set to a specific order, GetClosedOrders return orders for this market

func (*Bittrex) GetClosedWithdrawals

func (b *Bittrex) GetClosedWithdrawals(currency string, status WithdrawalStatus) (withdrawals []WithdrawalV3, err error)

GetClosedWithdrawals is used to retrieve your closed withdrawal history currency string a string literal for the currency (ie. BTC). If set to "all", will return for all currencies TODO Add more parameters according to https://bittrex.github.io/api/v3#operation--withdrawals-closed-get

func (*Bittrex) GetCurrencies

func (b *Bittrex) GetCurrencies() (currencies []CurrencyV3, err error)

GetCurrencies is used to get all supported currencies at Bittrex along with other meta data.

func (*Bittrex) GetCurrency

func (b *Bittrex) GetCurrency(symbol string) (currencies CurrencyV3, err error)

GetCurrency is used to get information of a single currency at Bittrex along with other meta data.

func (*Bittrex) GetDepositAddress

func (b *Bittrex) GetDepositAddress(currency string) (address AddressV3, err error)

GetDepositAddress is sed to generate or retrieve an address for a specific currency. currency a string literal for the currency (ie. BTC)

func (*Bittrex) GetDistribution

func (b *Bittrex) GetDistribution(market string) (distribution Distribution, err error)

GetDistribution is used to get the distribution.

func (*Bittrex) GetLatestTick

func (b *Bittrex) GetLatestTick(market string, interval string) ([]Candle, error)

GetLatestTick returns array with a single element latest candle object

func (*Bittrex) GetMarketHistory

func (b *Bittrex) GetMarketHistory(market string) (trades []TradeV3, err error)

GetMarketHistory is used to retrieve the latest trades that have occured for a specific market. market a string literal for the market (ex: BTC-LTC)

func (*Bittrex) GetMarketSummaries

func (b *Bittrex) GetMarketSummaries() (marketSummaries []MarketSummaryV3, err error)

GetMarketSummaries is used to get the last 24 hour summary of all active exchanges

func (*Bittrex) GetMarketSummary

func (b *Bittrex) GetMarketSummary(market string) (marketSummary MarketSummaryV3, err error)

GetMarketSummary is used to get the last 24 hour summary for a given market

func (*Bittrex) GetMarkets

func (b *Bittrex) GetMarkets() (markets []MarketV3, err error)

GetMarkets is used to get the open and available trading markets at Bittrex along with other meta data.

func (*Bittrex) GetOpenDepositHistory added in v0.0.4

func (b *Bittrex) GetOpenDepositHistory(currency string, status DepositStatus) (deposits []DepositV3, err error)

GetOpenDepositHistory is used to retrieve your open deposit history currency string a string literal for the currency (ie. BTC). If set to "all", will return for all currencies

func (*Bittrex) GetOpenOrders

func (b *Bittrex) GetOpenOrders(market string) (openOrders []OrderV3, err error)

GetOpenOrders returns orders that you currently have opened. If market is set to "all", GetOpenOrders return all orders If market is set to a specific order, GetOpenOrders return orders for this market

func (*Bittrex) GetOpenWithdrawals

func (b *Bittrex) GetOpenWithdrawals(currency string, status WithdrawalStatus) (withdrawals []WithdrawalV3, err error)

GetOpenWithdrawals is used to retrieve your open withdrawal history currency string a string literal for the currency (ie. BTC). If set to "", will return for all currencies

func (*Bittrex) GetOrder

func (b *Bittrex) GetOrder(order_uuid string) (order Order2, err error)

func (*Bittrex) GetOrderBook

func (b *Bittrex) GetOrderBook(market string, depth int32, cat string) (orderBook OrderBookV3, err error)

GetOrderBook is used to get retrieve the orderbook for a given market market: a string literal for the market (ex: BTC-LTC) cat: buy, sell or both to identify the type of orderbook to return.

func (*Bittrex) GetOrderBookBuySell

func (b *Bittrex) GetOrderBookBuySell(market string, depth int32, cat string) (orderb []OrderbV3, err error)

GetOrderBookBuySell is used to get retrieve the buy or sell side of an orderbook for a given market market: a string literal for the market (ex: BTC-LTC) cat: buy or sell to identify the type of orderbook to return.

func (*Bittrex) GetTicker

func (b *Bittrex) GetTicker(market string) (ticker []TickerV3, err error)

GetTicker is used to get the current ticker values for a market, if none is specified, returns info for all.

func (*Bittrex) GetTicks

func (b *Bittrex) GetTicks(market string, interval string) ([]Candle, error)

GetTicks is used to get ticks history values for a market. Interval can be -> ["oneMin", "fiveMin", "thirtyMin", "hour", "day"]

func (*Bittrex) GetWithdrawalByTxId

func (b *Bittrex) GetWithdrawalByTxId(txid string) (withdrawal WithdrawalV3, err error)

GetWithdrawalByTxId is used to retrieve information of a withdrawal by txid. txid string a string literal for the on chain transaction id.

func (*Bittrex) SetDebug

func (c *Bittrex) SetDebug(enable bool)

set enable/disable http request/response dump

func (*Bittrex) SubscribeExchangeUpdate

func (b *Bittrex) SubscribeExchangeUpdate(market string, dataCh chan<- ExchangeState, stop <-chan bool) error

SubscribeExchangeUpdate subscribes for updates of the market. Updates will be sent to dataCh. To stop subscription, send to, or close 'stop'.

func (*Bittrex) Withdraw

func (b *Bittrex) Withdraw(address, currency string, quantity decimal.Decimal, tag string) (withdraw WithdrawalV3, err error)

Withdraw is used to withdraw funds from your account. address string the address where to send the funds. currency string literal for the currency (ie. BTC) quantity decimal.Decimal the quantity of coins to withdraw tag string an optional name for the withdrawal address

type Candle

type Candle struct {
	TimeStamp  CandleTime      `json:"T"`
	Open       decimal.Decimal `json:"O"`
	Close      decimal.Decimal `json:"C"`
	High       decimal.Decimal `json:"H"`
	Low        decimal.Decimal `json:"L"`
	Volume     decimal.Decimal `json:"V"`
	BaseVolume decimal.Decimal `json:"BV"`
}

type CandleTime

type CandleTime struct {
	time.Time
}

func (*CandleTime) UnmarshalJSON

func (t *CandleTime) UnmarshalJSON(b []byte) error

type CreateOrderParams

type CreateOrderParams struct {
	MarketSymbol string          `json:"marketSymbol"`
	Direction    OrderDirection  `json:"direction"`
	Type         OrderType       `json:"type"`
	Quantity     decimal.Decimal `json:"quantity"`
	TimeInForce  TimeInForce     `json:"timeInForce"`

	Ceiling       float64 `json:"ceiling,omitempty"`
	Limit         float64 `json:"limit,omitempty"`
	ClientOrderID string  `json:"clientOrderId,omitempty"`
	UseAwards     string  `json:"useAwards,omitempty"`
}

type Currency

type Currency struct {
	Currency        string          `json:"Currency"`
	CurrencyLong    string          `json:"CurrencyLong"`
	MinConfirmation int             `json:"MinConfirmation"`
	TxFee           decimal.Decimal `json:"TxFee"`
	IsActive        bool            `json:"IsActive"`
	CoinType        string          `json:"CoinType"`
	BaseAddress     string          `json:"BaseAddress"`
	Notice          string          `json:"Notice"`
}

type CurrencyV3

type CurrencyV3 struct {
	Symbol                   string          `json:"symbol"`
	Name                     string          `json:"name"`
	CoinType                 string          `json:"coinType"`
	Status                   string          `json:"status"`
	MinConfirmations         int             `json:"minConfirmations"`
	Notice                   string          `json:"notice"`
	TxFee                    decimal.Decimal `json:"txFee"`
	LogoURL                  string          `json:"logoUrl,omitempty"`
	ProhibitedIn             []interface{}   `json:"prohibitedIn"`
	BaseAddress              string          `json:"baseAddress,omitempty"`
	AssociatedTermsOfService []interface{}   `json:"associatedTermsOfService"`
	Tags                     []string        `json:"tags"`
}

type Deposit

type Deposit struct {
	Id            int64           `json:"Id"`
	Amount        decimal.Decimal `json:"Amount"`
	Currency      string          `json:"Currency"`
	Confirmations int             `json:"Confirmations"`
	LastUpdated   jTime           `json:"LastUpdated"`
	TxId          string          `json:"TxId"`
	CryptoAddress string          `json:"CryptoAddress"`
}

type DepositHistoryParams added in v0.0.4

type DepositHistoryParams struct {
	Status         string `url:"status,omitempty"`
	CurrencySymbol string `url:"currencySymbol,omitempty"`
}

type DepositStatus added in v0.0.4

type DepositStatus string
const (
	DEPOSIT_PENDING     DepositStatus = "PENDING"
	DEPOSIT_COMPLETED   DepositStatus = "COMPLETED"
	DEPOSIT_ORPHANED    DepositStatus = "ORPHANED"
	DEPOSIT_INVALIDATED DepositStatus = "INVALIDATED"
	DEPOSIT_ALL         DepositStatus = ""
)

type DepositV3

type DepositV3 struct {
	ID               string          `json:"id"`
	CurrencySymbol   string          `json:"currencySymbol"`
	Quantity         decimal.Decimal `json:"quantity"`
	CryptoAddress    string          `json:"cryptoAddress"`
	CryptoAddressTag string          `json:"cryptoAddressTag"`
	TxID             string          `json:"txId"`
	Confirmations    int32           `json:"confirmations"`
	UpdatedAt        string          `json:"updatedAt"`
	CompletedAt      string          `json:"completedAt"`
	Status           string          `json:"status"`
	Source           string          `json:"source"`
}

type Distribution

type Distribution struct {
	Distribution   []BalanceD      `json:"Distribution"`
	Balances       decimal.Decimal `json:"Balances"`
	AverageBalance decimal.Decimal `json:"AverageBalance"`
}

type ExchangeState

type ExchangeState struct {
	MarketName string
	Nounce     int
	Buys       []OrderUpdate
	Sells      []OrderUpdate
	Fills      []Fill
	Initial    bool
}

ExchangeState contains fills and order book updates for a market.

type Fill

type Fill struct {
	Orderb
	OrderType string
	Timestamp jTime
}

type Market

type Market struct {
	MarketCurrency     string          `json:"MarketCurrency"`
	BaseCurrency       string          `json:"BaseCurrency"`
	MarketCurrencyLong string          `json:"MarketCurrencyLong"`
	BaseCurrencyLong   string          `json:"BaseCurrencyLong"`
	MinTradeSize       decimal.Decimal `json:"MinTradeSize"`
	MarketName         string          `json:"MarketName"`
	IsActive           bool            `json:"IsActive"`
	IsRestricted       bool            `json:"IsRestricted"`
	Notice             string          `json:"Notice"`
	IsSponsored        bool            `json:"IsSponsored"`
	LogoUrl            string          `json:"LogoUrl"`
	Created            string          `json:"Created"`
}

type MarketSummary

type MarketSummary struct {
	MarketName     string          `json:"MarketName"`
	High           decimal.Decimal `json:"High"`
	Low            decimal.Decimal `json:"Low"`
	Ask            decimal.Decimal `json:"Ask"`
	Bid            decimal.Decimal `json:"Bid"`
	OpenBuyOrders  int             `json:"OpenBuyOrders"`
	OpenSellOrders int             `json:"OpenSellOrders"`
	Volume         decimal.Decimal `json:"Volume"`
	Last           decimal.Decimal `json:"Last"`
	BaseVolume     decimal.Decimal `json:"BaseVolume"`
	PrevDay        decimal.Decimal `json:"PrevDay"`
	TimeStamp      string          `json:"TimeStamp"`
}

type MarketSummaryV3

type MarketSummaryV3 struct {
	Symbol        string          `json:"symbol"`
	High          decimal.Decimal `json:"high"`
	Low           decimal.Decimal `json:"low"`
	Volume        decimal.Decimal `json:"volume"`
	QuoteVolume   decimal.Decimal `json:"quoteVolume"`
	PercentChange decimal.Decimal `json:"percentChange"`
	UpdatedAt     time.Time       `json:"updatedAt"`
}

type MarketV3

type MarketV3 struct {
	Symbol                   string          `json:"symbol"`
	BaseCurrencySymbol       string          `json:"baseCurrencySymbol"`
	QuoteCurrencySymbol      string          `json:"quoteCurrencySymbol"`
	MinTradeSize             decimal.Decimal `json:"minTradeSize"`
	Precision                int32           `json:"precision"`
	Status                   string          `json:"status"`
	CreatedAt                time.Time       `json:"createdAt"`
	Notice                   string          `json:"notice"`
	ProhibitedIn             []string        `json:"prohibitedIn"`
	AssociatedTermsOfService []string        `json:"associatedTermsOfService"`
	Tags                     []string        `json:"tags"`
}

type NewCandles

type NewCandles struct {
	Ticks []Candle `json:"ticks"`
}

type Order

type Order struct {
	Uuid              *string
	OrderUuid         string          `json:"OrderUuid"`
	Exchange          string          `json:"Exchange"`
	OrderType         string          `json:"OrderType"`
	Limit             decimal.Decimal `json:"Limit"`
	Quantity          decimal.Decimal `json:"Quantity"`
	QuantityRemaining decimal.Decimal `json:"QuantityRemaining"`
	Price             decimal.Decimal `json:"Price"`
	PricePerUnit      decimal.Decimal `json:"PricePerUnit"`
	CommissionPaid    decimal.Decimal
	Opened            jTime
	Closed            *jTime
	CancelInitiated   bool
	ImmediateOrCancel bool
	IsConditional     bool
	Condition         string
	ConditionTarget   decimal.Decimal
}

type Order2

type Order2 struct {
	AccountId                  string
	OrderUuid                  string `json:"OrderUuid"`
	Exchange                   string `json:"Exchange"`
	Type                       string
	Quantity                   decimal.Decimal `json:"Quantity"`
	QuantityRemaining          decimal.Decimal `json:"QuantityRemaining"`
	Limit                      decimal.Decimal `json:"Limit"`
	Reserved                   decimal.Decimal
	ReserveRemaining           decimal.Decimal
	CommissionReserved         decimal.Decimal
	CommissionReserveRemaining decimal.Decimal
	CommissionPaid             decimal.Decimal
	Price                      decimal.Decimal `json:"Price"`
	PricePerUnit               decimal.Decimal `json:"PricePerUnit"`
	Opened                     jTime
	Closed                     *jTime
	IsOpen                     bool
	Sentinel                   string
	CancelInitiated            bool
	ImmediateOrCancel          bool
	IsConditional              bool
	Condition                  string
	ConditionTarget            decimal.Decimal
}

For getorder

type OrderBook

type OrderBook struct {
	Buy  []Orderb `json:"buy"`
	Sell []Orderb `json:"sell"`
}

type OrderBookV3

type OrderBookV3 struct {
	Bid []OrderbV3 `json:"bid"`
	Ask []OrderbV3 `json:"ask"`
}

type OrderData

type OrderData struct {
	Type string `json:"type"`
	ID   string `json:"id"`
}

type OrderDirection

type OrderDirection string
const (
	BUY  OrderDirection = "BUY"
	SELL OrderDirection = "SELL"
)

type OrderType

type OrderType string
const (
	MARKET         OrderType = "MARKET"
	LIMIT          OrderType = "LIMIT"
	CEILING_LIMIT  OrderType = "CEILING_LIMIT"
	CEILING_MARKET OrderType = "CEILING_MARKET"
)

type OrderUpdate

type OrderUpdate struct {
	Orderb
	Type int
}

type OrderV3

type OrderV3 struct {
	ID            string          `json:"id"`
	MarketSymbol  string          `json:"marketSymbol"`
	Direction     string          `json:"direction"`
	Type          string          `json:"type"`
	Quantity      decimal.Decimal `json:"quantity"`
	Limit         decimal.Decimal `json:"limit"`
	Ceiling       decimal.Decimal `json:"ceiling"`
	TimeInForce   string          `json:"timeInForce"`
	ClientOrderID string          `json:"clientOrderId"`
	FillQuantity  decimal.Decimal `json:"fillQuantity"`
	Commission    decimal.Decimal `json:"commission"`
	Proceeds      decimal.Decimal `json:"proceeds"`
	Status        string          `json:"status"`
	CreatedAt     time.Time       `json:"createdAt"`
	UpdatedAt     time.Time       `json:"updatedAt"`
	ClosedAt      time.Time       `json:"closedAt"`
	OrderToCancel OrderData       `json:"orderToCancel"`
}

type Orderb

type Orderb struct {
	Quantity decimal.Decimal `json:"Quantity"`
	Rate     decimal.Decimal `json:"Rate"`
}

type OrderbV3

type OrderbV3 struct {
	Quantity decimal.Decimal `json:"quantity"`
	Rate     decimal.Decimal `json:"rate"`
}

type Ticker

type Ticker struct {
	Bid  decimal.Decimal `json:"Bid"`
	Ask  decimal.Decimal `json:"Ask"`
	Last decimal.Decimal `json:"Last"`
}

type TickerV3

type TickerV3 struct {
	Symbol        string          `json:"symbol"`
	LastTradeRate decimal.Decimal `json:"lastTradeRate"`
	BidRate       decimal.Decimal `json:"bidRate"`
	AskRate       decimal.Decimal `json:"askRate"`
}

type TimeInForce

type TimeInForce string
const (
	GOOD_TIL_CANCELLED           TimeInForce = "GOOD_TIL_CANCELLED"
	IMMEDIATE_OR_CANCEL          TimeInForce = "IMMEDIATE_OR_CANCEL"
	FILL_OR_KILL                 TimeInForce = "FILL_OR_KILL"
	POST_ONLY_GOOD_TIL_CANCELLED TimeInForce = "POST_ONLY_GOOD_TIL_CANCELLED"
	BUY_NOW                      TimeInForce = "BUY_NOW"
)

type Trade

type Trade struct {
	OrderUuid int64           `json:"Id"`
	Timestamp jTime           `json:"TimeStamp"`
	Quantity  decimal.Decimal `json:"Quantity"`
	Price     decimal.Decimal `json:"Price"`
	Total     decimal.Decimal `json:"Total"`
	FillType  string          `json:"FillType"`
	OrderType string          `json:"OrderType"`
}

Used in getmarkethistory

type TradeV3

type TradeV3 struct {
	ID         string    `json:"id"`
	ExecutedAt time.Time `json:"executedAt"`
	Quantity   string    `json:"quantity"`
	Rate       string    `json:"rate"`
	TakerSide  string    `json:"takerSide"`
}

type Uuid

type Uuid struct {
	Id string `json:"uuid"`
}

type Withdrawal

type Withdrawal struct {
	PaymentUuid    string          `json:"PaymentUuid"`
	Currency       string          `json:"Currency"`
	Amount         decimal.Decimal `json:"Amount"`
	Address        string          `json:"Address"`
	Opened         jTime           `json:"Opened"`
	Authorized     bool            `json:"Authorized"`
	PendingPayment bool            `json:"PendingPayment"`
	TxCost         decimal.Decimal `json:"TxCost"`
	TxId           string          `json:"TxId"`
	Canceled       bool            `json:"Canceled"`
}

type WithdrawalHistoryParams

type WithdrawalHistoryParams struct {
	Status         string `url:"status,omitempty"`
	CurrencySymbol string `url:"currencySymbol,omitempty"`
}

type WithdrawalParams

type WithdrawalParams struct {
	CurrencySymbol   string `json:"currencySymbol"`
	Quantity         string `json:"quantity"`
	CryptoAddress    string `json:"cryptoAddress"`
	CryptoAddressTag string `json:"cryptoAddressTag"`
}

type WithdrawalStatus

type WithdrawalStatus string
const (
	REQUESTED             WithdrawalStatus = "REQUESTED"
	AUTHORIZED            WithdrawalStatus = "AUTHORIZED"
	PENDING               WithdrawalStatus = "PENDING"
	COMPLETED             WithdrawalStatus = "COMPLETED"
	CANCELLED             WithdrawalStatus = "CANCELLED"
	ERROR_INVALID_ADDRESS WithdrawalStatus = "ERROR_INVALID_ADDRESS"
	ALL                   WithdrawalStatus = ""
)

type WithdrawalV3

type WithdrawalV3 struct {
	ID               string           `json:"id"`
	CurrencySymbol   string           `json:"currencySymbol"`
	Quantity         decimal.Decimal  `json:"quantity"`
	CryptoAddress    string           `json:"cryptoAddress"`
	CryptoAddressTag string           `json:"cryptoAddressTag"`
	TxCost           decimal.Decimal  `json:"txCost"`
	TxID             string           `json:"txId"`
	Status           WithdrawalStatus `json:"status"`
	CreatedAt        time.Time        `json:"createdAt"`
	CompletedAt      time.Time        `json:"completedAt"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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