Versions in this module Expand all Collapse all v1 v1.0.2 Jul 21, 2020 v1.0.1 Jul 21, 2020 v1.0.0 Jul 13, 2020 Changes in this version + const ACCOUNT_URI + const BINANCE_BASE_URL + const BITFLYER_BASE_URL + const HITBTC_BASE_URL + const HUOBI_BASE_URL + const KUCOIN_BASE_URL + const LBANK_BASE_URL + const OKEX_BASE_URL + const P2PB2B_BASE_URL + const POLONIEX_BASE_URL + const SERVER_TIME_URL + func FloorFloat64ToStr(num float64, dig int) string + func GetMd5HashSign(query string) (string, error) + func GetParamHmacSHA256Base64Sign(secret, params string) (string, error) + func NewHttpRequest(client *http.Client, reqType string, reqUrl string, postData string, ...) ([]byte, error) + type BinanceActiveOrderResponse struct + Settlement string + Trading string + type BinanceApi struct + ApiKeyFunc func() (string, error) + BaseURL string + HttpClient http.Client + RateCacheDuration time.Duration + SecretKeyFunc func() (string, error) + func NewBinanceApi(apikey func() (string, error), apisecret func() (string, error)) (*BinanceApi, error) + func (b *BinanceApi) TradeFeeRate(trading string, settlement string) (TradeFee, error) + func (h *BinanceApi) ActiveOrders() ([]*models.Order, error) + func (h *BinanceApi) Address(c string) (string, error) + func (h *BinanceApi) Balances() (map[string]float64, error) + func (h *BinanceApi) CancelOrder(trading string, settlement string, ordertype models.OrderType, ...) error + func (h *BinanceApi) CompleteBalance(coin string) (*models.Balance, error) + func (h *BinanceApi) CompleteBalances() (map[string]*models.Balance, error) + func (h *BinanceApi) CurrencyPairs() ([]models.CurrencyPair, error) + func (h *BinanceApi) IsOrderFilled(trading string, settlement string, orderNumber string) (bool, error) + func (h *BinanceApi) Order(trading string, settlement string, ordertype models.OrderType, price float64, ...) (string, error) + func (h *BinanceApi) TradeFeeRates() (map[string]map[string]TradeFee, error) + func (h *BinanceApi) Transfer(typ string, addr string, amount float64, additionalFee float64) error + func (h *BinanceApi) TransferFee() (map[string]float64, error) + type BinanceBalance struct + Balance float64 + T string + type BinanceTransferFeeResponse struct + Currency string + type BitflyerApi struct + ApiSecretFunc func() (string, error) + ApikeyFunc func() (string, error) + BaseURL string + HttpClient http.Client + Mode ClientMode + RateCacheDuration time.Duration + func NewBitflyerPrivateApi(apikey func() (string, error), apisecret func() (string, error)) (*BitflyerApi, error) + func (b *BitflyerApi) ActiveOrders() ([]*models.Order, error) + func (b *BitflyerApi) Address(c string) (string, error) + func (b *BitflyerApi) Balances() (map[string]float64, error) + func (b *BitflyerApi) CancelOrder(trading string, settlement string, ordertype models.OrderType, ...) error + func (b *BitflyerApi) CompleteBalance(coin string) (*models.Balance, error) + func (b *BitflyerApi) CompleteBalances() (map[string]*models.Balance, error) + func (b *BitflyerApi) IsOrderFilled(trading string, settlement string, orderNumber string) (bool, error) + func (b *BitflyerApi) Order(trading string, settlement string, ordertype models.OrderType, price float64, ...) (string, error) + func (b *BitflyerApi) PurchaseFeeRate() (float64, error) + func (b *BitflyerApi) TradeFeeRate(trading string, settlement string) (TradeFee, error) + func (b *BitflyerApi) TradeFeeRates() (map[string]map[string]TradeFee, error) + func (b *BitflyerApi) Transfer(typ string, addr string, amount float64, additionalFee float64) error + func (b *BitflyerApi) TransferFee() (map[string]float64, error) + type BitflyerApiConfig struct + type ClientMode int + const PROJECT + const TEST + type Currency struct + Delisted int + DepositAddress string + Disabled int + Frozen int + ID int + MinConf int + Name string + TxFee float64 + type HitbtcApi struct + ApiKeyFunc func() (string, error) + BaseURL string + HttpClient http.Client + RateCacheDuration time.Duration + SecretKeyFunc func() (string, error) + func NewHitbtcApi(apikey func() (string, error), apisecret func() (string, error)) (*HitbtcApi, error) + func (b *HitbtcApi) TradeFeeRate(trading string, settlement string) (TradeFee, error) + func (h *HitbtcApi) ActiveOrders() ([]*models.Order, error) + func (h *HitbtcApi) Address(c string) (string, error) + func (h *HitbtcApi) Balances() (map[string]float64, error) + func (h *HitbtcApi) CancelOrder(trading string, settlement string, ordertype models.OrderType, ...) error + func (h *HitbtcApi) CompleteBalance(coin string) (*models.Balance, error) + func (h *HitbtcApi) CompleteBalances() (map[string]*models.Balance, error) + func (h *HitbtcApi) IsOrderFilled(trading string, settlement string, orderNumber string) (bool, error) + func (h *HitbtcApi) Order(trading string, settlement string, ordertype models.OrderType, price float64, ...) (string, error) + func (h *HitbtcApi) TradeFeeRates() (map[string]map[string]TradeFee, error) + func (h *HitbtcApi) Transfer(typ string, addr string, amount float64, additionalFee float64) error + func (h *HitbtcApi) TransferFee() (map[string]float64, error) + type HuobiActiveOrderResponse struct + Settlement string + Trading string + type HuobiApi struct + ApiKeyFunc func() (string, error) + BaseURL string + HttpClient http.Client + RateCacheDuration time.Duration + SecretKeyFunc func() (string, error) + func NewHuobiApi(apikey func() (string, error), apisecret func() (string, error)) (*HuobiApi, error) + func (b *HuobiApi) TradeFeeRate(trading string, settlement string) (TradeFee, error) + func (h *HuobiApi) ActiveOrders() ([]*models.Order, error) + func (h *HuobiApi) Address(c string) (string, error) + func (h *HuobiApi) Balances() (map[string]float64, error) + func (h *HuobiApi) CancelOrder(trading string, settlement string, ordertype models.OrderType, ...) error + func (h *HuobiApi) CompleteBalance(coin string) (*models.Balance, error) + func (h *HuobiApi) CompleteBalances() (map[string]*models.Balance, error) + func (h *HuobiApi) IsOrderFilled(trading string, settlement string, orderNumber string) (bool, error) + func (h *HuobiApi) Order(trading string, settlement string, ordertype models.OrderType, price float64, ...) (string, error) + func (h *HuobiApi) TradeFeeRates() (map[string]map[string]TradeFee, error) + func (h *HuobiApi) Transfer(typ string, addr string, amount float64, additionalFee float64) error + func (h *HuobiApi) TransferFee() (map[string]float64, error) + type HuobiBalance struct + Balance float64 + T string + type HuobiTransferFeeResponse struct + Currency string + type KucoinActiveOrderResponse struct + Settlement string + Trading string + type KucoinApi struct + ApiKeyFunc func() (string, error) + BaseURL string + HttpClient http.Client + RateCacheDuration time.Duration + SecretKeyFunc func() (string, error) + func NewKucoinApi(apikey func() (string, error), apisecret func() (string, error)) (*KucoinApi, error) + func (b *KucoinApi) TradeFeeRate(trading string, settlement string) (TradeFee, error) + func (h *KucoinApi) ActiveOrders() ([]*models.Order, error) + func (h *KucoinApi) Address(c string) (string, error) + func (h *KucoinApi) Balances() (map[string]float64, error) + func (h *KucoinApi) CancelOrder(trading string, settlement string, ordertype models.OrderType, ...) error + func (h *KucoinApi) CompleteBalance(coin string) (*models.Balance, error) + func (h *KucoinApi) CompleteBalances() (map[string]*models.Balance, error) + func (h *KucoinApi) IsOrderFilled(trading string, settlement string, orderNumber string) (bool, error) + func (h *KucoinApi) Order(trading string, settlement string, ordertype models.OrderType, price float64, ...) (string, error) + func (h *KucoinApi) TradeFeeRates() (map[string]map[string]TradeFee, error) + func (h *KucoinApi) Transfer(typ string, addr string, amount float64, additionalFee float64) error + func (h *KucoinApi) TransferFee() (map[string]float64, error) + type KucoinBalance struct + Balance float64 + T string + type KucoinTransferFeeResponse struct + Currency string + type LbankActiveOrderResponse struct + Settlement string + Trading string + type LbankApi struct + ApiKeyFunc func() (string, error) + BaseURL string + HttpClient http.Client + RateCacheDuration time.Duration + SecretKeyFunc func() (string, error) + func NewLbankApi(apikey func() (string, error), apisecret func() (string, error)) (*LbankApi, error) + func (b *LbankApi) TradeFeeRate(trading string, settlement string) (TradeFee, error) + func (h *LbankApi) ActiveOrders() ([]*models.Order, error) + func (h *LbankApi) Address(c string) (string, error) + func (h *LbankApi) Balances() (map[string]float64, error) + func (h *LbankApi) CancelOrder(trading string, settlement string, ordertype models.OrderType, ...) error + func (h *LbankApi) CompleteBalance(coin string) (*models.Balance, error) + func (h *LbankApi) CompleteBalances() (map[string]*models.Balance, error) + func (h *LbankApi) IsOrderFilled(trading string, settlement string, orderNumber string) (bool, error) + func (h *LbankApi) Order(trading string, settlement string, ordertype models.OrderType, price float64, ...) (string, error) + func (h *LbankApi) TradeFeeRates() (map[string]map[string]TradeFee, error) + func (h *LbankApi) Transfer(typ string, addr string, amount float64, additionalFee float64) error + func (h *LbankApi) TransferFee() (map[string]float64, error) + type LbankBalance struct + Balance float64 + T string + type LbankTransferFeeResponse struct + Currency string + type MockPrivateClient struct + func (_m *MockPrivateClient) ActiveOrders() ([]*models.Order, error) + func (_m *MockPrivateClient) Address(c string) (string, error) + func (_m *MockPrivateClient) Balances() (map[string]float64, error) + func (_m *MockPrivateClient) CancelOrder(trading string, settlement string, ordertype models.OrderType, ...) error + func (_m *MockPrivateClient) CompleteBalance(coin string) (*models.Balance, error) + func (_m *MockPrivateClient) CompleteBalances() (map[string]*models.Balance, error) + func (_m *MockPrivateClient) IsOrderFilled(trading string, settlement string, orderNumber string) (bool, error) + func (_m *MockPrivateClient) Order(trading string, settlement string, ordertype models.OrderType, price float64, ...) (string, error) + func (_m *MockPrivateClient) TradeFeeRate(_a0 string, _a1 string) (TradeFee, error) + func (_m *MockPrivateClient) TradeFeeRates() (map[string]map[string]TradeFee, error) + func (_m *MockPrivateClient) Transfer(typ string, addr string, amount float64, additionalFee float64) error + func (_m *MockPrivateClient) TransferFee() (map[string]float64, error) + type OkexActiveOrderResponse struct + Settlement string + Trading string + type OkexApi struct + ApiKeyFunc func() (string, error) + BaseURL string + HttpClient http.Client + RateCacheDuration time.Duration + SecretKeyFunc func() (string, error) + func NewOkexApi(apikey func() (string, error), apisecret func() (string, error)) (*OkexApi, error) + func (o *OkexApi) ActiveOrders() ([]*models.Order, error) + func (o *OkexApi) Address(c string) (string, error) + func (o *OkexApi) Balances() (map[string]float64, error) + func (o *OkexApi) CancelOrder(trading string, settlement string, ordertype models.OrderType, ...) error + func (o *OkexApi) CompleteBalance(coin string) (*models.Balance, error) + func (o *OkexApi) CompleteBalances() (map[string]*models.Balance, error) + func (o *OkexApi) IsOrderFilled(trading string, settlement string, orderNumber string) (bool, error) + func (o *OkexApi) Order(trading string, settlement string, ordertype models.OrderType, price float64, ...) (string, error) + func (o *OkexApi) TradeFeeRate(trading string, settlement string) (TradeFee, error) + func (o *OkexApi) TradeFeeRates() (map[string]map[string]TradeFee, error) + func (o *OkexApi) Transfer(typ string, addr string, amount float64, additionalFee float64) error + func (o *OkexApi) TransferFee() (map[string]float64, error) + type OkexBalance struct + Balance float64 + T string + type OkexTransferFeeResponse struct + Currency string + type P2pb2bActiveOrderResponse struct + Settlement string + Trading string + type P2pb2bApi struct + ApiKeyFunc func() (string, error) + BaseURL string + HttpClient http.Client + RateCacheDuration time.Duration + SecretKeyFunc func() (string, error) + func NewP2pb2bApi(apikey func() (string, error), apisecret func() (string, error)) (*P2pb2bApi, error) + func (b *P2pb2bApi) TradeFeeRate(trading string, settlement string) (TradeFee, error) + func (h *P2pb2bApi) ActiveOrders() ([]*models.Order, error) + func (h *P2pb2bApi) Address(c string) (string, error) + func (h *P2pb2bApi) Balances() (map[string]float64, error) + func (h *P2pb2bApi) CancelOrder(trading string, settlement string, ordertype models.OrderType, ...) error + func (h *P2pb2bApi) CompleteBalance(coin string) (*models.Balance, error) + func (h *P2pb2bApi) CompleteBalances() (map[string]*models.Balance, error) + func (h *P2pb2bApi) IsOrderFilled(trading string, settlement string, orderNumber string) (bool, error) + func (h *P2pb2bApi) Order(trading string, settlement string, ordertype models.OrderType, price float64, ...) (string, error) + func (h *P2pb2bApi) TradeFeeRates() (map[string]map[string]TradeFee, error) + func (h *P2pb2bApi) Transfer(typ string, addr string, amount float64, additionalFee float64) error + func (h *P2pb2bApi) TransferFee() (map[string]float64, error) + type P2pb2bBalance struct + Balance float64 + T string + type P2pb2bTransferFeeResponse struct + Currency string + type PoloniexApi struct + ApiKeyFunc func() (string, error) + BaseURL string + HttpClient http.Client + RateCacheDuration time.Duration + SecretKeyFunc func() (string, error) + func NewPoloniexApi(apikey func() (string, error), apisecret func() (string, error)) (*PoloniexApi, error) + func (b *PoloniexApi) TradeFeeRate(trading string, settlement string) (TradeFee, error) + func (p *PoloniexApi) ActiveOrders() ([]*models.Order, error) + func (p *PoloniexApi) Address(c string) (string, error) + func (p *PoloniexApi) Balances() (map[string]float64, error) + func (p *PoloniexApi) CancelOrder(trading string, settlement string, ordertype models.OrderType, ...) error + func (p *PoloniexApi) CompleteBalance(coin string) (*models.Balance, error) + func (p *PoloniexApi) CompleteBalances() (map[string]*models.Balance, error) + func (p *PoloniexApi) IsOrderFilled(trading string, settlement string, orderNumber string) (bool, error) + func (p *PoloniexApi) Order(trading string, settlement string, ordertype models.OrderType, price float64, ...) (string, error) + func (p *PoloniexApi) TradeFeeRates() (map[string]map[string]TradeFee, error) + func (p *PoloniexApi) Transfer(typ string, addr string, amount float64, additionalFee float64) error + func (p *PoloniexApi) TransferFee() (map[string]float64, error) + type PrivateClient interface + ActiveOrders func() ([]*models.Order, error) + Address func(c string) (string, error) + Balances func() (map[string]float64, error) + CancelOrder func(trading string, settlement string, ordertype models.OrderType, ...) error + CompleteBalance func(coin string) (*models.Balance, error) + CompleteBalances func() (map[string]*models.Balance, error) + IsOrderFilled func(trading string, settlement string, orderNumber string) (bool, error) + Order func(trading string, settlement string, ordertype models.OrderType, price float64, ...) (string, error) + TradeFeeRate func(string, string) (TradeFee, error) + TradeFeeRates func() (map[string]map[string]TradeFee, error) + Transfer func(typ string, addr string, amount float64, additionalFee float64) error + TransferFee func() (map[string]float64, error) + func NewClient(mode ClientMode, exchangeName string, apikey func() (string, error), ...) (PrivateClient, error) + type TradeFee struct + MakerFee float64 + TakerFee float64