pet
typepet is the persisted record for one owner's tamagotchi.
Value
v0.pet
pets
v0.Tree// owner address string -> \*pet
- OID
- 0c6c91…7cf4:4
pets details
clamp
func(v int, lo int, hi int) int- OID
- 0c6c91…7cf4:5
clamp details
get
func(owner .uverse.address) (*v0.pet, bool)- OID
- 0c6c91…7cf4:7
get details
project
func(p *v0.pet, height int64) (hunger int, happiness int, energy int, alive bool)project computes display stats as of height without mutating the pet, so Render can show a live-looking view without writing state on a query.
- OID
- 0c6c91…7cf4:8
project details
ageStageName
func(born int64, height int64) string- OID
- 0c6c91…7cf4:9
ageStageName details
requireLivingPet
func(owner .uverse.address, height int64) *v0.petrequireLivingPet ticks and fetches the caller's pet, panicking with a friendly message if there is none or it has died.
- OID
- 0c6c91…7cf4:10
requireLivingPet details
hatch
func(owner .uverse.address, name string, height int64) stringhatch is the non-crossing core of Hatch, kept separate so unit tests can exercise its panics directly without going through a realm-crossing call.
- OID
- 0c6c91…7cf4:11
hatch details
Hatch
func(name string) stringHatch creates a new pet for the caller. Lifetime feeds/plays/deaths carry over from any previous pet so the leaderboard tracks long-term care.
- OID
- 0c6c91…7cf4:12
Hatch details
feed
func(owner .uverse.address, height int64) stringfeed is the non-crossing core of Feed.
- OID
- 0c6c91…7cf4:13
feed details
Feed
func() stringFeed reduces hunger and gives a small energy boost.
- OID
- 0c6c91…7cf4:14
Feed details
play
func(owner .uverse.address, height int64) stringplay is the non-crossing core of Play.
- OID
- 0c6c91…7cf4:15
play details
Play
func() stringPlay boosts happiness at the cost of energy and a bit of hunger. Refuses to run a tired pet into the ground — rest first.
- OID
- 0c6c91…7cf4:16
Play details
sleep
func(owner .uverse.address, height int64) stringsleep is the non-crossing core of Sleep.
- OID
- 0c6c91…7cf4:17
sleep details
Sleep
func() stringSleep restores energy at the cost of a little hunger.
- OID
- 0c6c91…7cf4:18
Sleep details
byAliveThenOwner
typebyAliveThenOwner ranks living pets before dead ones, then orders each group by owner address so the leaderboard is fully deterministic.
Value
v0.byAliveThenOwner
bar
func(v int) string- OID
- 0c6c91…7cf4:19
bar details
shortAddr
func(a .uverse.address) string- OID
- 0c6c91…7cf4:20
shortAddr details
renderCard
func(p *v0.pet, height int64) string- OID
- 0c6c91…7cf4:21
renderCard details
Render
func(path string) stringRender shows either every pet ever hatched (path == "") or a single pet's detail card when path is a bech32 owner address.
- OID
- 0c6c91…7cf4:22