Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

streaks/v0 package

Overview

Package streaks is an on-chain habit-streak tracker. Call CheckIn() again within graceBlocks of your last check-in and the streak keeps growing; let the gap run past that and it resets to zero on your next check-in. Gno has no wall clock, so "again soon enough" is measured in blocks rather than calendar days — graceBlocks is the tunable stand-in for "before tomorrow".

Function

LongestStreak

func LongestStreak(addr string) int64

LongestStreak returns addr's best streak ever, 0 if it has never checked in.

Param

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/moul/x/daily/streaks/v0.LongestStreak()"

Result