Skip to content Search Apps Documentation Source Content 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.

agentwallet source realm

Package agentwallet is a spend-limited wallet bound to an Agent ID.

Overview

Package agentwallet is a spend-limited wallet bound to an Agent ID.

The owner funds it and sets the policy. A different address, the agent, is the only caller that can move those funds. Swap, exchange, liquidity, and stake stay inside this realm. They are not a public exchange.

Functions 8

func Act

crossing Action
1func Act(cur realm, action string, dest string, amount int64)
source

Act moves funds already inside the agent wallet. The caller must be the bound agent address, not the owner.

func Arm

crossing Action
1func Arm(cur realm)
source

Arm lets the agent address submit actions.

func Disarm

crossing Action
1func Disarm(cur realm)
source

Disarm stops the agent address until the owner arms it again.

func Free

Action
1func Free(owner address) int64
source

Free returns the spendable ugnot inside the owner's agent wallet.

func Fund

crossing Action
1func Fund(cur realm)
source

Fund adds the ugnot attached to this call to the owner's agent wallet.

func Open

crossing Action
1func Open(cur realm, agent address)
source

Open binds a fresh agent address to the caller's Agent ID. The agent address must be a different key from the owner.

func Recover

crossing Action
1func Recover(cur realm)
source

Recover returns the owner's agent funds to the owner and disarms the agent.

func SetPolicy

crossing Action
1func SetPolicy(cur realm, txCap int64, allowance int64, actions string, names string)
source

SetPolicy replaces the per-action cap, the remaining allowance, and the allowlists. actions and names are comma-separated. The owner calls this.

Dependencies

Source Files 2