Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

Playground

gnomod.toml

module = "gno.land/p/g1y0n2geu0rmdrm9u30c5fmk3ykkl2enw9n9yr2k/agentid"
gno = "0.9"

[addpkg]
  creator = "g1y0n2geu0rmdrm9u30c5fmk3ykkl2enw9n9yr2k"
  height = 645865
  max_deposit = "10000000ugnot"

name.gno

// Package agentid is the Agent ID name standard.
//
// A registry realm stores which wallet owns a name. This package only
// decides which strings are names. The display suffix is not part of the
// on-chain key.
package agentid

const (
	// MinLen is the shortest claimable name.
	MinLen = 3
	// MaxLen is the longest claimable name.
	MaxLen = 15
	// Suffix is the label shown to people. Claim and Pay use the bare name.
	Suffix = ".agent"
)

// Valid reports whether name is 3–15 lowercase letters or digits.
func Valid(name string) bool {
	if len(name) < MinLen || len(name) > MaxLen {
		return false
	}
	for i := 0; i < len(name); i++ {
		c := name[i]
		if (c < 'a' || c > 'z') && (c < '0' || c > '9') {
			return false
		}
	}
	return true
}

// Reserved reports whether name is held back from claims.
func Reserved(name string) bool {
	switch name {
	case "gno", "admin", "root", "sys", "system", "ugnot":
		return true
	default:
		return false
	}
}