feat: add watch streak miner status

This commit is contained in:
2026-04-30 17:45:39 +02:00
parent e2eb34498f
commit e30769653a
13 changed files with 1068 additions and 58 deletions
+10
View File
@@ -28,6 +28,8 @@ type Event struct {
Timestamp string
Balance int
ClaimID string
ReasonCode string
TotalPoints int
}
func (e Event) key() string {
@@ -291,6 +293,10 @@ func parseFrame(message []byte) (*frame, error) {
Balance int `json:"balance"`
ChannelID string `json:"channel_id"`
} `json:"balance"`
PointGain *struct {
ReasonCode string `json:"reason_code"`
TotalPoints int `json:"total_points"`
} `json:"point_gain"`
} `json:"data"`
}
if err := json.Unmarshal([]byte(envelope.Data.Message), &payload); err != nil {
@@ -320,6 +326,10 @@ func parseFrame(message []byte) (*frame, error) {
if payload.Data.Claim != nil {
result.Event.ClaimID = payload.Data.Claim.ID
}
if payload.Data.PointGain != nil {
result.Event.ReasonCode = payload.Data.PointGain.ReasonCode
result.Event.TotalPoints = payload.Data.PointGain.TotalPoints
}
return result, nil
}