Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed May 29, 2024
1 parent a761f3a commit 946e128
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions node/pkg/wfetcher/coinbase/type.go
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"`
}

0 comments on commit 946e128

Please sign in to comment.