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

pixels package

Overview

Package pixels is the real, permanent GNO Pixels realm -- gno.land/r/pixelsandbox (this project's earlier scratch deployment, never redeployable in place once live) was always the deliberately generic placeholder name described in this project's own README, kept around exactly so the design could keep changing without colliding with whatever this real deployment ended up being called.

Expandable bounds instead of a fixed size, per-pixel provenance (who placed it, at what block), and an owner-gated import hook for migrating the scratch realm's already-placed pixels into this one.

Functions

BoardHeight

func BoardHeight() int64

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.BoardHeight()"

Result

BoardWidth

func BoardWidth() int64

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.BoardWidth()"

Result

Bounds

func Bounds() (int64, int64, int64, int64)

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.Bounds()"

Result

ClearOfficialTarget

func ClearOfficialTarget(cur realm)

ClearOfficialTarget wipes the entire free-to-place design -- owner- only. Split out from SetOfficialTarget now that registration is additive, so "start over from nothing" is still possible but isn't the default behavior of every registration call.

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/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "ClearOfficialTarget" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "sapphire-1" -remote "https://rpc.sapphire.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.sapphire.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "ClearOfficialTarget" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "sapphire-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.sapphire.testnets.gno.land" call.tx
  

CloseMigrationWindow

func CloseMigrationWindow(cur realm)

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/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "CloseMigrationWindow" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "sapphire-1" -remote "https://rpc.sapphire.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.sapphire.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "CloseMigrationWindow" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "sapphire-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.sapphire.testnets.gno.land" call.tx
  

CooldownRemaining

func CooldownRemaining(addr address) int64

Param

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.CooldownRemaining()"

Result

ExpansionsCount

func ExpansionsCount() int64

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.ExpansionsCount()"

Result

FeePerPixel

func FeePerPixel() int64

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.FeePerPixel()"

Result

ForceExpand

func ForceExpand(cur realm)

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/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "ForceExpand" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "sapphire-1" -remote "https://rpc.sapphire.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.sapphire.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "ForceExpand" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "sapphire-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.sapphire.testnets.gno.land" call.tx
  

GetCommunityDesign

func GetCommunityDesign(id string) string

GetCommunityDesign returns the raw "x,y,c;x,y,c;..." for one design, or "" if id doesn't exist.

Param

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.GetCommunityDesign()"

Result

GetPixel

func GetPixel(x, y int64) int64

Params

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.GetPixel(,)"

Result

ImportHistoricalPixel

func ImportHistoricalPixel(cur realm, x, y, colorIndex int64, originalPlacer address, originalHeight int64)

Params

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/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "ImportHistoricalPixel" -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "sapphire-1" -remote "https://rpc.sapphire.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.sapphire.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "ImportHistoricalPixel" -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "sapphire-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.sapphire.testnets.gno.land" call.tx
  

InOfficialTargetArea

func InOfficialTargetArea(x, y int64) bool

Params

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.InOfficialTargetArea(,)"

Result

IsOfficialTarget

func IsOfficialTarget(x, y, colorIndex int64) bool

Params

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.IsOfficialTarget(,,)"

Result

ListCommunityDesigns

func ListCommunityDesigns() string

ListCommunityDesigns returns "id,name,pixelCount;id,name,pixelCount;..." for every submitted design, in submission order.

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.ListCommunityDesigns()"

Result

MaxBulkPixelsPerTx

func MaxBulkPixelsPerTx() int64

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.MaxBulkPixelsPerTx()"

Result

MigrationOpen

func MigrationOpen() bool

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.MigrationOpen()"

Result

OccupiedCells

func OccupiedCells() int64

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.OccupiedCells()"

Result

PaletteCSV

func PaletteCSV() string

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.PaletteCSV()"

Result

RemoveCommunityDesign

func RemoveCommunityDesign(cur realm, id string)

RemoveCommunityDesign lets the owner delist a design (offensive name, spam, abuse of the free-submission path) -- owner-only moderation hook. Pixels already placed toward it stay exactly as painted (this only removes it from ListCommunityDesigns/GetCommunityDesign, it doesn't touch the grid), and the id is never reused.

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/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "RemoveCommunityDesign" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "sapphire-1" -remote "https://rpc.sapphire.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.sapphire.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "RemoveCommunityDesign" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "sapphire-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.sapphire.testnets.gno.land" call.tx
  

Render

func Render(path string) string

Param

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.Render()"

Result

SetOfficialTarget

func SetOfficialTarget(cur realm, encoded string)

SetOfficialTarget merges entries into the free-to-place design -- owner-only, additive rather than replacing. Registering the full ~800-cell logo costs real storage deposit (measured ~0.19 GNOT/cell on testnet), enough that doing it in one transaction risks needing the whole amount upfront in a single call; additive means it can be split across as many affordable calls as needed, called repeatedly over time. encoded is "x,y,c;x,y,c;...", matching the CSV-ish convention already used by TopPlacers. Calling this with a coordinate already in the target just overwrites that one entry's color, same as you'd expect.

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/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "SetOfficialTarget" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "sapphire-1" -remote "https://rpc.sapphire.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.sapphire.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "SetOfficialTarget" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "sapphire-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.sapphire.testnets.gno.land" call.tx
  

SetPixel

func SetPixel(cur realm, x, y, colorIndex int64)

Params

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/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "SetPixel" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "sapphire-1" -remote "https://rpc.sapphire.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.sapphire.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "SetPixel" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "sapphire-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.sapphire.testnets.gno.land" call.tx
  

SetPixels

func SetPixels(cur realm, encoded string)

SetPixels places up to MaxBulkPixels pixels in one transaction. encoded is "x,y,c;x,y,c;...". Cooldown is checked and updated once for the whole batch rather than per pixel -- SetPixel's own per-call cooldown would otherwise reject every entry after the first within the same block, since they all execute in the same transaction/ height. Fee is the sum of pixelFee(x, y, c) across every entry, collected as one payment.

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/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "SetPixels" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "sapphire-1" -remote "https://rpc.sapphire.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.sapphire.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "SetPixels" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "sapphire-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.sapphire.testnets.gno.land" call.tx
  

Snapshot

func Snapshot() string

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.Snapshot()"

Result

SubmitCommunityDesign

func SubmitCommunityDesign(cur realm, name string, encoded string) string

SubmitCommunityDesign registers a new community-submitted design -- anyone can call this, not just the owner. encoded is "x,y,c;x,y,c;...", already in absolute board coordinates (the submitter positions it client-side before submitting). Placing any of these cells still costs the normal FeePerPixelUgnot, same as any other free-form cell -- this just makes the design's shape and position visible on-chain so other visitors' browsers can render a progress bar for it and help fill it in, the same way everyone already helps finish the owner-curated logo.

Params

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/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "SubmitCommunityDesign" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "sapphire-1" -remote "https://rpc.sapphire.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.sapphire.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels" -func "SubmitCommunityDesign" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "sapphire-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.sapphire.testnets.gno.land" call.tx
  

TopPlacers

func TopPlacers(n int64) string

TopPlacers returns up to n "address,count" pairs, semicolon-separated, sorted by count descending -- the leaderboard. Iterated fresh on every call rather than kept pre-sorted, since contributor counts are small enough (real participants, not per-pixel) for a plain insertion sort to be cheap regardless of how large the canvas itself grows. Gno's "sort" package predates Go's generics-based sort.Slice, so this is hand-rolled rather than using sort.Interface for a one-off local type.

Param

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.TopPlacers()"

Result

TotalPlacements

func TotalPlacements() int64

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.TotalPlacements()"

Result

VandalismFeePerPixel

func VandalismFeePerPixel() int64

Command

gnokey query vm/qeval -remote "https://rpc.sapphire.testnets.gno.land" -data "gno.land/r/g188mapat33awn7r9uk08l0jc9my0n07fpmspxel/pixels.VandalismFeePerPixel()"

Result