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

render.gno

0.37 Kb · 19 lines
 1package abt
 2
 3import (
 4	"strconv"
 5	"strings"
 6)
 7
 8func Render(path string) string {
 9	if path == "" {
10		return token.RenderHome() + "* **Frozen**: " + strconv.FormatBool(frozen) + "\n"
11	}
12	if strings.HasPrefix(path, "balance/") {
13		owner := address(strings.TrimPrefix(path, "balance/"))
14		if owner.IsValid() {
15			return strconv.FormatInt(BalanceOf(owner), 10)
16		}
17	}
18	return "404"
19}