Package mygnoscan builds links into a mygnoscan block explorer.
A realm knows things a reader cannot see from its Render output: which chain it is on, what its address is, which block it was last written at. Turning any of those into a link means knowing the explorer's route table, and a route table hand-written into thirty realms is thirty places to fix when it moves. This package is the one place.
The routes are measured, not guessed
Every path below was read out of the explorer's own router (its single-page frontend, `route()`), not inferred from the UI, on 2026-09-22. Two of them are retired and deliberately absent: `?tab=graph` (folded into `deps`, still redirected) and `?tab=inert` (folded into the default tab, silently dropped).
An unknown path renders the home page
The explorer's router falls through to `home` rather than to a 404, so a misspelled route is not visible as an error: the link works, it just goes somewhere else. That is why the page names here are constants and why Page is the only door to them.
The network is per instance, not per chain
The explorer takes `?network=<id>`, and the ids are chosen by whoever runs the instance: moul's names mainnet `mainnet`, while the upstream default config names the same chain `gnoland1`. NetworkFor maps a chain-id to the ids DefaultBase serves. Point Scanner at another instance and you very likely also want WithNetwork.
Omitting the parameter is not the same as asking for mainnet: the explorer then blends every chain it indexes, which looks plausible and is wrong. A Scanner whose network is empty emits no parameter, so New on a chain nobody indexes produces a link to the blend. Set it explicitly when it matters.
Usage
The whole point is a realm footer that stays right when the chain changes:
Example
1func Render(path string) string {
2 return body + "\n\n---\n\n" + mygnoscan.Default().CurrentRealmFooter()
3}
and, for a realm that wants to hand out sharper links:
Example
1s := mygnoscan.Default()
2s.Address(someAddr) // an account
3s.Block(runtime.ChainHeight()) // the block we are at
4s.Realm("gno.land/r/moul/home", mygnoscan.TabSource)
5s.RealmFunc("gno.land/r/moul/config", "Set") // straight at one function
Nothing here reads chain state except ChainDomain, ChainID and ChainHeight, and nothing here writes. Building a link is free.