-
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
a761f3a
commit 946e128
Showing
1 changed file
with
53 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package coinbase | ||
|
||
const ( | ||
URL = "wss://ws-feed.exchange.coinbase.com" | ||
) | ||
|
||
/* | ||
{ | ||
"type": "ticker", | ||
"sequence": 37475248783, | ||
"product_id": "ETH-USD", | ||
"price": "1285.22", | ||
"open_24h": "1310.79", | ||
"volume_24h": "245532.79269678", | ||
"low_24h": "1280.52", | ||
"high_24h": "1313.8", | ||
"volume_30d": "9788783.60117027", | ||
"best_bid": "1285.04", | ||
"best_bid_size": "0.46688654", | ||
"best_ask": "1285.27", | ||
"best_ask_size": "1.56637040", | ||
"side": "buy", | ||
"time": "2022-10-19T23:28:22.061769Z", | ||
"trade_id": 370843401, | ||
"last_size": "11.4396987" | ||
} | ||
*/ | ||
|
||
type Ticker struct { | ||
Type string `json:"type"` | ||
Sequence int64 `json:"sequence"` | ||
ProductID string `json:"product_id"` | ||
Price string `json:"price"` | ||
Open24h string `json:"open_24h"` | ||
Volume24h string `json:"volume_24h"` | ||
Low24h string `json:"low_24h"` | ||
High24h string `json:"high_24h"` | ||
Volume30d string `json:"volume_30d"` | ||
BestBid string `json:"best_bid"` | ||
BestBidSize string `json:"best_bid_size"` | ||
BestAsk string `json:"best_ask"` | ||
BestAskSize string `json:"best_ask_size"` | ||
Side string `json:"side"` | ||
Time string `json:"time"` | ||
TradeID int `json:"trade_id"` | ||
LastSize string `json:"last_size"` | ||
} | ||
|
||
type Subscription struct { | ||
Type string `json:"type"` | ||
ProductIds []string `json:"product_ids"` | ||
Channels []string `json:"channels"` | ||
} |