Skip to content

Commit 5569283

Browse files
committed
fix v1.2.3 bug
2 parents 4ba3726 + 8886579 commit 5569283

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

hitbtc/Hitbtc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const (
3333
var (
3434
YCC = goex.Currency{"YCC", "Yuan Chain New"}
3535
BTC = goex.Currency{"BTC", "Bitcoin"}
36-
YCC_BTC = goex.CurrencyPair{YCC, BTC}
36+
YCC_BTC = goex.CurrencyPair{CurrencyA: YCC, CurrencyB: BTC}
3737
)
3838

3939
type Hitbtc struct {
@@ -587,7 +587,7 @@ func parseStatus(s string) goex.TradeStatus {
587587
}
588588

589589
func (hitbtc *Hitbtc) adaptCurrencyPair(pair goex.CurrencyPair) goex.CurrencyPair {
590-
return pair.AdaptUsdtToUsd().AdaptBccToBch()
590+
return pair.AdaptUsdtToUsd()
591591
}
592592

593593
func (hitbtc *Hitbtc) adaptSymbolToCurrencyPair(pair string) goex.CurrencyPair {

hitbtc/Hitbtc_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func TestHitbtc_adaptSymbolToCurrencyPair(t *testing.T) {
3131
}
3232

3333
func TestGetTicker(t *testing.T) {
34-
res, err := htb.GetTicker(goex.BCC_USD)
34+
res, err := htb.GetTicker(goex.BCH_USD)
3535
require := require.New(t)
3636
require.Nil(err)
3737
t.Log(res)

zb/Zb.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (zb *Zb) GetExchangeName() string {
4343
}
4444

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

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

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

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

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

332332
func (zb *Zb) GetUnfinishOrders(currency CurrencyPair) ([]Order, error) {
333333
params := url.Values{}
334-
symbol := currency.AdaptBchToBcc().AdaptUsdToUsdt().ToSymbol("_")
334+
symbol := currency.ToSymbol("_")
335335
params.Set("method", "getUnfinishedOrdersIgnoreTradeType")
336336
params.Set("currency", symbol)
337337
params.Set("pageIndex", "1")

0 commit comments

Comments
 (0)