From cb4215af63f149e7dd5a4a8b34589b6cfa6f8f68 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Tue, 28 May 2024 16:58:26 -0400 Subject: polygon ticker type --- hived/polygonTicerResponseType.go | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 hived/polygonTicerResponseType.go diff --git a/hived/polygonTicerResponseType.go b/hived/polygonTicerResponseType.go new file mode 100644 index 0000000..6d8b323 --- /dev/null +++ b/hived/polygonTicerResponseType.go @@ -0,0 +1,54 @@ +package main + +type PolygonTickerDataLastTrade struct { + C []int `json:"c"` + I string `json:"i"` + P float64 `json:"p"` + S int `json:"s"` + T int64 `json:"t"` + X int `json:"x"` +} + +type PolygonTickerDataDay struct { + C float64 `json:"c"` + H float64 `json:"h"` + L float64 `json:"l"` + O float64 `json:"o"` + V float64 `json:"v"` + VW float64 `json:"vw"` +} + +type PolygonTickerDataPrevDay struct { + C float64 `json:"c"` + H float64 `json:"h"` + L float64 `json:"l"` + O float64 `json:"o"` + V float64 `json:"v"` + VW float64 `json:"vw"` +} + +type PolygonTickerDataMin struct { + C float64 `json:"c"` + H float64 `json:"h"` + L float64 `json:"l"` + N float64 `json:"n"` + O float64 `json:"o"` + T float64 `json:"t"` + V float64 `json:"v"` + VW float64 `json:"vw"` +} + +type PolygonTickerData struct { + Min PolygonTickerDataMin `json:"min"` + Day PolygonTickerDataDay `json:"day"` + PrevDay PolygonTickerDataPrevDay `json:"prevDay"` +} + +type PolygonTickerResponse struct { + RequestID string `json:"request_id"` + Status string `json:"status"` + TodaysChange float64 `json:"todaysChange"` + TodaysChangePerc float64 `json:"todaysChangePerc"` + Updated float64 `json:"updated"` + Ticker PolygonTickerData `json:"ticker"` +} -- cgit v1.2.3