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

CurrentStreak

func CurrentStreak(addr string) int64

CurrentStreak returns addr's live current streak, 0 if it has lapsed or addr has never checked in.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/daily/streaks/v0.CurrentStreak()"

Result