go.charczuk.com@v0.0.0-20240327042549-bc490516bd1a/experiments/cb-feed/pkg/coinbase/types.go (about)

     1  package coinbase
     2  
     3  import "time"
     4  
     5  type BasicMessage struct {
     6  	Type      string `json:"type"`
     7  	ProductID string `json:"product_id"`
     8  }
     9  
    10  type Heartbeat struct {
    11  	Type        string    `json:"type"`
    12  	Sequence    uint64    `json:"sequence"`
    13  	LastTradeID uint64    `json:"last_trade_id"`
    14  	ProductID   string    `json:"product_id"`
    15  	Time        time.Time `json:"time"`
    16  }
    17  
    18  type Ticker struct {
    19  	Type        string    `json:"type"`
    20  	Sequence    uint64    `json:"sequence"`
    21  	ProductID   string    `json:"product_id"`
    22  	Price       string    `json:"price"`
    23  	Open24h     string    `json:"open_24h"`
    24  	Volume24h   string    `json:"volume_24h"`
    25  	Low24h      string    `json:"low_24h"`
    26  	High24h     string    `json:"high_24h"`
    27  	BestBid     string    `json:"best_bid"`
    28  	BestBidSize string    `json:"best_bid_size"`
    29  	BestAsk     string    `json:"best_ask"`
    30  	BestAskSize string    `json:"best_ask_size"`
    31  	Side        string    `json:"side"`
    32  	Time        time.Time `json:"time"`
    33  	TradeID     string    `json:"trade_id"`
    34  	LastSize    string    `json:"last_size"`
    35  }
    36  
    37  type Auction struct {
    38  	Type         string    `json:"type"`
    39  	ProductID    string    `json:"product_id"`
    40  	Sequence     int64     `json:"sequence"`
    41  	AuctionState string    `json:"auction_state"`
    42  	BestBidPrice string    `json:"best_bid_price"`
    43  	BestBidSize  string    `json:"best_bid_size"`
    44  	BestAskPrice string    `json:"best_ask_price"`
    45  	BestAskSize  string    `json:"best_ask_size"`
    46  	OpenPrice    string    `json:"open_price"`
    47  	OpenSize     string    `json:"open_size"`
    48  	CanOpen      string    `json:"can_open"`
    49  	Timestamp    time.Time `json:"timestamp"`
    50  }
    51  
    52  type Match struct {
    53  	Type         string    `json:"type"`
    54  	TradeID      uint64    `json:"trade_id"`
    55  	Sequence     uint64    `json:"sequence"`
    56  	MakerOrderID string    `json:"maker_order_id"`
    57  	TakerOrderID string    `json:"taker_order_id"`
    58  	Time         time.Time `json:"time"`
    59  	Size         string    `json:"size"`
    60  	Price        string    `json:"price"`
    61  	Side         string    `json:"side"`
    62  }