Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
nntaoli committed Dec 7, 2020
2 parents 5569283 + 71f0e1d commit 50b8d06
Show file tree
Hide file tree
Showing 17 changed files with 1,735 additions and 150 deletions.
72 changes: 38 additions & 34 deletions Const.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,42 +119,45 @@ var (
QUARTER_CONTRACT = "quarter" //季度合约
BI_QUARTER_CONTRACT = "bi_quarter" // NEXT QUARTER
SWAP_CONTRACT = "swap" //永续合约
SWAP_USDT_CONTRACT = "swap-usdt"
)

//exchanges const
const (
KUCOIN = "kucoin.com"
OKCOIN_COM = "okcoin.com"
OKEX = "okex.com"
OKEX_V3 = "okex.com_v3"
OKEX_FUTURE = "okex.com_future"
OKEX_SWAP = "okex.com_swap"
HUOBI = "huobi.com"
HUOBI_PRO = "huobi.pro"
BITSTAMP = "bitstamp.net"
KRAKEN = "kraken.com"
ZB = "zb.com"
BITFINEX = "bitfinex.com"
BINANCE = "binance.com"
BINANCE_SWAP = "binance.com_swap"
POLONIEX = "poloniex.com"
COINEX = "coinex.com"
BITHUMB = "bithumb.com"
GATEIO = "gate.io"
BITTREX = "bittrex.com"
GDAX = "gdax.com"
BIGONE = "big.one"
FCOIN = "fcoin.com"
FCOIN_MARGIN = "fcoin.com_margin"
FMEX = "fmex.com"
HITBTC = "hitbtc.com"
BITMEX = "bitmex.com"
BITMEX_TEST = "testnet.bitmex.com"
CRYPTOPIA = "cryptopia.co.nz"
HBDM = "hbdm.com"
COINBENE = "coinbene.com"
ATOP = "a.top"
BITGET_SWAP = "bitget_swap"
KUCOIN = "kucoin.com"
OKCOIN_COM = "okcoin.com"
OKEX = "okex.com"
OKEX_V3 = "okex.com_v3"
OKEX_FUTURE = "okex.com_future"
OKEX_SWAP = "okex.com_swap"
HUOBI = "huobi.com"
HUOBI_PRO = "huobi.pro"
BITSTAMP = "bitstamp.net"
KRAKEN = "kraken.com"
ZB = "zb.com"
BITFINEX = "bitfinex.com"
BINANCE = "binance.com"
BINANCE_SWAP = "binance.com_swap"
BINANCE_FUTURES = "binance.com_futures"
POLONIEX = "poloniex.com"
COINEX = "coinex.com"
BITHUMB = "bithumb.com"
GATEIO = "gate.io"
BITTREX = "bittrex.com"
GDAX = "gdax.com"
BIGONE = "big.one"
FCOIN = "fcoin.com"
FCOIN_MARGIN = "fcoin.com_margin"
FMEX = "fmex.com"
HITBTC = "hitbtc.com"
BITMEX = "bitmex.com"
BITMEX_TEST = "testnet.bitmex.com"
CRYPTOPIA = "cryptopia.co.nz"
HBDM = "hbdm.com"
HBDM_SWAP = "hbdm.com_swap"
COINBENE = "coinbene.com"
ATOP = "a.top"
BITGET_SWAP = "bitget_swap"
)

const (
Expand All @@ -166,8 +169,9 @@ const (
SPOT_MARGIN //币币杠杆交易
WALLET // 资金账户
_
TIPS //余币宝
SWAP //永续合约
TIPS //余币宝
SWAP //永续合约
SWAP_USDT //usdt本位永续合约
)

type LimitOrderOptionalParameter int
Expand Down
Binary file modified IMG_1177.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ ETH:0x98573ddb33cdddce480c3bc1f9279ccd88ca1e93

### 欢迎为作者付一碗面钱

<img src="https://raw.githubusercontent.com/nntaoli-project/goex/dev/wx_pay.JPG" width="250" alt="一碗面钱">&nbsp;&nbsp;&nbsp;<img src="https://raw.githubusercontent.com/nntaoli-project/goex/dev/IMG_1177.jpg" width="250" alt="一碗面钱">
![微信](wx_pay.JPG) ![支付宝](IMG_1177.jpg)
4 changes: 3 additions & 1 deletion binance/Binance.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
. "github.com/nntaoli-project/goex"
"net/http"
"net/url"
"sort"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -305,6 +306,8 @@ func (bn *Binance) GetDepth(size int, currencyPair CurrencyPair) (*Depth, error)
}
}

sort.Sort(sort.Reverse(depth.AskList))

return depth, nil
}

Expand Down Expand Up @@ -492,7 +495,6 @@ func (bn *Binance) GetOneOrder(orderId string, currencyPair CurrencyPair) (*Orde
ord.Amount = ToFloat64(respmap["origQty"].(string))
ord.Price = ToFloat64(respmap["price"].(string))
ord.DealAmount = ToFloat64(respmap["executedQty"])
ord.AvgPrice = ord.Price // response no avg price , fill price
ord.OrderTime = ToInt(respmap["time"])

cummulativeQuoteQty := ToFloat64(respmap["cummulativeQuoteQty"])
Expand Down
Loading

0 comments on commit 50b8d06

Please sign in to comment.