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.

moves/v2 package

Overview

Package moves is the book of move recipes for the Code Arena brawler.

A recipe is a special move written as data, like "Blink Thief/84/D82S11": a name, a cooldown and up to three effects (see recipe.gno in the brawl package for the format and the budget). Anyone can publish one; the browser lets you equip any published move for practice, and the chain's rules run it exactly like the browser does.

Built to be cheap: a recipe is stored as one short string, "author recipe", and bucketSize recipes share one tree node, so most publishes only pay for their own few dozen bytes. Each author also has one string listing their ids.

Functions

Author

func Author(id int) string
Ask AI Claude ChatGPT

Author returns who published a move.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/moves/v2.Author()"

Result

ByAuthor

func ByAuthor(addr string) string
Ask AI Claude ChatGPT

ByAuthor returns an author's moves as a JSON array, oldest first.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/moves/v2.ByAuthor()"

Result

Check

func Check(recipe string) string
Ask AI Claude ChatGPT

Check reports whether a recipe is valid and what cooldown it needs, without storing anything: "ok <cost>" or the reason it is refused.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/moves/v2.Check()"

Result

Count

func Count() int
Ask AI Claude ChatGPT

Count is how many moves have been published.

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/moves/v2.Count()"

Result

List

func List(skip, n int) string
Ask AI Claude ChatGPT

List returns up to n moves as a JSON array, newest first, skipping the newest skip.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/moves/v2.List(,)"

Result

MoveJSON

func MoveJSON(id int) string
Ask AI Claude ChatGPT

MoveJSON describes one move as JSON.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/moves/v2.MoveJSON()"

Result

Publish

func Publish(cur realm, recipe string) int
Ask AI Claude ChatGPT

Publish checks a recipe and stores it under the caller's address. It returns the move's id. An author can publish MaxPerAuthor moves.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/moves/v2" -func "Publish" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/moves/v2" -func "Publish" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Recipe

func Recipe(id int) string
Ask AI Claude ChatGPT

Recipe returns a move's recipe string.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/moves/v2.Recipe()"

Result

Render

func Render(path string) string
Ask AI Claude ChatGPT

Render shows the newest moves, one move at "move/<id>", or an author's moves at "by/<address>".

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/moves/v2.Render()"

Result

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/moves/v2, for example a function call with arguments.