Skip to content

Commit 66f2abd

Browse files
committed
Merge branch 'dev'
2 parents 68fcdbf + 1238cca commit 66f2abd

32 files changed

+612
-2087
lines changed

.vscode/launch.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Launch",
9+
"type": "go",
10+
"request": "launch",
11+
"mode": "auto",
12+
"program": "${fileDirname}",
13+
"env": {},
14+
"args": []
15+
}
16+
]
17+
}

Models.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,21 @@ type HistoricalFunding struct {
191191
FundingTime time.Time `json:"funding_time"`
192192
}
193193

194+
type TickSize struct {
195+
InstrumentID string
196+
UnderlyingIndex string
197+
QuoteCurrency string
198+
PriceTickSize float64 //下单价格精度
199+
AmountTickSize float64 //数量精度
200+
}
201+
202+
type FuturesContractInfo struct {
203+
*TickSize
204+
ContractVal float64 //合约面值(美元)
205+
Delivery string //交割日期
206+
ContractType string // 本周 this_week 次周 next_week 季度 quarter
207+
}
208+
194209
//api parameter struct
195210

196211
type BorrowParameter struct {

Utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ func ValuesToJson(v url.Values) ([]byte, error) {
110110
return json.Marshal(parammap)
111111
}
112112

113-
func GzipUnCompress(data []byte) ([]byte, error) {
113+
func GzipDecompress(data []byte) ([]byte, error) {
114114
r, err := gzip.NewReader(bytes.NewReader(data))
115115
if err != nil {
116116
return nil, err
117117
}
118118
return ioutil.ReadAll(r)
119119
}
120120

121-
func FlateUnCompress(data []byte) ([]byte, error) {
121+
func FlateDecompress(data []byte) ([]byte, error) {
122122
return ioutil.ReadAll(flate.NewReader(bytes.NewReader(data)))
123123
}
124124

WsApi.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package goex
2+
3+
type FuturesWsApi interface {
4+
DepthCallback(func(depth *Depth))
5+
TickerCallback(func(ticker *FutureTicker))
6+
TradeCallback(func(trade *Trade, contract string))
7+
//OrderCallback(func(order *FutureOrder))
8+
//PositionCallback(func(position *FuturePosition))
9+
//AccountCallback(func(account *FutureAccount))
10+
11+
SubscribeDepth(pair CurrencyPair, contractType string) error
12+
SubscribeTicker(pair CurrencyPair, contractType string) error
13+
SubscribeTrade(pair CurrencyPair, contractType string) error
14+
15+
//Login() error
16+
//SubscribeOrder(pair CurrencyPair, contractType string) error
17+
//SubscribePosition(pair CurrencyPair, contractType string) error
18+
//SubscribeAccount(pair CurrencyPair) error
19+
}
20+
21+
type SpotWsApi interface {
22+
DepthCallback(func(depth *Depth))
23+
TickerCallback(func(ticker *Ticker))
24+
TradeCallback(func(trade *Trade))
25+
//OrderCallback(func(order *Order))
26+
//AccountCallback(func(account *Account))
27+
28+
SubscribeDepth(pair CurrencyPair) error
29+
SubscribeTicker(pair CurrencyPair) error
30+
SubscribeTrade(pair CurrencyPair) error
31+
32+
//Login() error
33+
//SubscribeOrder(pair CurrencyPair) error
34+
//SubscribeAccount(pair CurrencyPair) error
35+
}

0 commit comments

Comments
 (0)