-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
400576b
commit 28f78c5
Showing
4 changed files
with
120 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,37 @@ | ||
package coinex | ||
|
||
const URL = "wss://socket.coinex.com/" | ||
const URL = "wss://socket.coinex.com/v2/spot" | ||
|
||
type SubscribeParams struct { | ||
MarketList []string `json:"market_list"` | ||
} | ||
|
||
type Subscription struct { | ||
Method string `json:"method"` | ||
Params []string `json:"params"` | ||
ID int `json:"id"` | ||
Method string `json:"method"` | ||
Params SubscribeParams `json:"params"` | ||
ID int `json:"id"` | ||
} | ||
|
||
type State struct { | ||
Market string `json:"market"` | ||
Last string `json:"last"` | ||
Open string `json:"open"` | ||
Close string `json:"close"` | ||
High string `json:"high"` | ||
Low string `json:"low"` | ||
Volume string `json:"volume"` | ||
VolumeSell string `json:"volume_sell"` | ||
VolumeBuy string `json:"volume_buy"` | ||
Value string `json:"value"` | ||
Period int `json:"period"` | ||
} | ||
|
||
type Ticker struct { | ||
Open string `json:"open"` | ||
Last string `json:"last"` | ||
High string `json:"high"` | ||
Low string `json:"low"` | ||
Deal string `json:"deal"` | ||
Volume string `json:"volume"` | ||
SellTotal string `json:"sell_total"` | ||
BuyTotal string `json:"buy_total"` | ||
Period int `json:"period"` | ||
type Data struct { | ||
StateList []State `json:"state_list"` | ||
} | ||
|
||
type Response struct { | ||
Method string `json:"method"` | ||
Params []map[string]Ticker `json:"params"` | ||
ID *int `json:"id"` | ||
Method string `json:"method"` | ||
Data Data `json:"data"` | ||
ID *int `json:"id"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters