Skip to content

Commit

Permalink
fix v1.2.3 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nntaoli committed Nov 13, 2020
2 parents 4ba3726 + 8886579 commit 5569283
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions hitbtc/Hitbtc.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const (
var (
YCC = goex.Currency{"YCC", "Yuan Chain New"}
BTC = goex.Currency{"BTC", "Bitcoin"}
YCC_BTC = goex.CurrencyPair{YCC, BTC}
YCC_BTC = goex.CurrencyPair{CurrencyA: YCC, CurrencyB: BTC}
)

type Hitbtc struct {
Expand Down Expand Up @@ -587,7 +587,7 @@ func parseStatus(s string) goex.TradeStatus {
}

func (hitbtc *Hitbtc) adaptCurrencyPair(pair goex.CurrencyPair) goex.CurrencyPair {
return pair.AdaptUsdtToUsd().AdaptBccToBch()
return pair.AdaptUsdtToUsd()
}

func (hitbtc *Hitbtc) adaptSymbolToCurrencyPair(pair string) goex.CurrencyPair {
Expand Down
2 changes: 1 addition & 1 deletion hitbtc/Hitbtc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestHitbtc_adaptSymbolToCurrencyPair(t *testing.T) {
}

func TestGetTicker(t *testing.T) {
res, err := htb.GetTicker(goex.BCC_USD)
res, err := htb.GetTicker(goex.BCH_USD)
require := require.New(t)
require.Nil(err)
t.Log(res)
Expand Down
12 changes: 6 additions & 6 deletions zb/Zb.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (zb *Zb) GetExchangeName() string {
}

func (zb *Zb) GetTicker(currency CurrencyPair) (*Ticker, error) {
symbol := currency.AdaptBchToBcc().AdaptUsdToUsdt().ToSymbol("_")
symbol := currency.ToSymbol("_")
resp, err := HttpGet(zb.httpClient, MARKET_URL+fmt.Sprintf(TICKER_API, symbol))
if err != nil {
return nil, err
Expand All @@ -65,7 +65,7 @@ func (zb *Zb) GetTicker(currency CurrencyPair) (*Ticker, error) {
}

func (zb *Zb) GetDepth(size int, currency CurrencyPair) (*Depth, error) {
symbol := currency.AdaptBchToBcc().AdaptUsdToUsdt().ToSymbol("_")
symbol := currency.ToSymbol("_")
resp, err := HttpGet(zb.httpClient, MARKET_URL+fmt.Sprintf(DEPTH_API, symbol, size))
if err != nil {
return nil, err
Expand Down Expand Up @@ -170,7 +170,7 @@ func (zb *Zb) GetAccount() (*Account, error) {
}

func (zb *Zb) placeOrder(amount, price string, currency CurrencyPair, tradeType int) (*Order, error) {
symbol := currency.AdaptBchToBcc().AdaptUsdToUsdt().ToSymbol("_")
symbol := currency.ToSymbol("_")
params := url.Values{}
params.Set("method", "order")
params.Set("price", price)
Expand Down Expand Up @@ -229,7 +229,7 @@ func (zb *Zb) LimitSell(amount, price string, currency CurrencyPair, opt ...Limi
}

func (zb *Zb) CancelOrder(orderId string, currency CurrencyPair) (bool, error) {
symbol := currency.AdaptBchToBcc().AdaptUsdToUsdt().ToSymbol("_")
symbol := currency.ToSymbol("-")
params := url.Values{}
params.Set("method", "cancelOrder")
params.Set("id", orderId)
Expand Down Expand Up @@ -301,7 +301,7 @@ func parseOrder(order *Order, ordermap map[string]interface{}) {
}

func (zb *Zb) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error) {
symbol := currency.AdaptBchToBcc().AdaptUsdToUsdt().ToSymbol("_")
symbol := currency.ToSymbol("_")
params := url.Values{}
params.Set("method", "getOrder")
params.Set("id", orderId)
Expand Down Expand Up @@ -331,7 +331,7 @@ func (zb *Zb) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error)

func (zb *Zb) GetUnfinishOrders(currency CurrencyPair) ([]Order, error) {
params := url.Values{}
symbol := currency.AdaptBchToBcc().AdaptUsdToUsdt().ToSymbol("_")
symbol := currency.ToSymbol("_")
params.Set("method", "getUnfinishedOrdersIgnoreTradeType")
params.Set("currency", symbol)
params.Set("pageIndex", "1")
Expand Down

0 comments on commit 5569283

Please sign in to comment.