NextBlock
SupportWebsiteDashboard
  • What is NextBlock?
  • Pricing & Rate Limits
  • Getting Started
    • Quickstart
      • GoLang Sample Code
      • Bundle Sending Sample
    • Contact
  • API
    • Basics
    • Authentication
    • Submit Transaction
    • Submit Batched Transactions
    • Examples
      • Golang
        • Connection
        • Keepalive
        • Tip floor stream
        • Submit single transactions
        • Submit batched transactions
      • Http
      • Rust
Powered by GitBook
On this page
Export as PDF
  1. API
  2. Examples
  3. Golang

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)
}
PreviousKeepaliveNextSubmit single transactions

Last updated 7 days ago