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

capwallet package

Overview

Package capwallet issues narrow, bounded, revocable capabilities to agents — instead of handing an agent a wallet key and hoping its prompt stays safe.

The demo makes three ideas that are usually conflated stand apart:

  • identity — "this is agent Percy"
  • authorization — "Percy may call this function on this realm"
  • approval — "Percy may do it at most N times, for ≤ M coins, before block H, and I can revoke it at any moment"

A capability is the third thing: a least-privilege grant with a ceiling, an expiry, a use counter and a kill switch. Other realms consult Authorized() before honoring an agent action; the granter revokes with one call the instant something looks wrong.

Function

Authorized

func Authorized(id uint64, principal address, coins int64) bool

Authorized reports whether principal may exercise capability id for the given coin amount right now — the check a target realm runs before acting. It never mutates state or consumes a use.

Params

Command

gnokey query vm/qeval -remote "https://rpc.topaz.testnets.gno.land" -data "gno.land/r/g1manfred47kzduec920z88wfr64ylksmdcedlf5/agents/capwallet.Authorized(,,)"

Result