Tip floor stream

You can use the tip floor stream to stay on top of the current tip floor. Using the following snippet you will receive a tip floor updated every minute.

sub, err := nextblockApiClient.StreamTipFloor(context.TODO(), &api.TipFloorStreamRequest{
    UpdateFrequency: "1m",
})
if err != nil {
    fmt.Println(err)
    return
}

fmt.Println("Streaming tip floor data:")
for {
    tipfloor, err := sub.Recv()
    if err != nil {
       fmt.Printf("Stream error: %v\n", err)
       return
    }
    fmt.Println(tipfloor)
}

Last updated