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

keeper package

Overview

Package keeper is the role-based access realm of the GnoSwap order realms.

It owns a manager.State (gno.land/p/gnoswap/order/access/manager/v0). Roles are granted to keeper accounts, and each order realm function (target package path and selector) is assigned the role allowed to call it, or PublicRole for anyone.

Administration is not a manager role: every management call is checked against the GnoSwap admin or governance (gno.land/r/gnoswap/access). manager.AdminRole is never granted here.

Roles registered at deployment:

  • DCAKeeperRole (1): DCA order keepers
  • LimitKeeperRole (2): limit order keepers
  • PoolManagerRole (3): DCA/Limit pool whitelist and DCA pool policy managers

DCA ExecuteGroup and ForceCancelOrder are assigned to DCAKeeperRole at deployment, so only granted keepers run DCA rounds and force-cancel orders that block them. The whitelist realm's AddWhitelistedPool and RemoveWhitelistedPool, and DCA's SetTokenMinAmountPerExecution and SetPairPriceLimit are assigned to PoolManagerRole, so only granted managers pick the pools and the price limits rounds trade with (admin and governance may call them too). This role intentionally manages both targets' whitelists and DCA's token minimums and pair price limits; target-specific manager roles are not required. It does not grant ExecuteGroup, ForceCancelOrder, or ExecuteOrder. Keeping the two roles on separate accounts means a single leaked key cannot both choose a round's pool or price and run it.

Admin or governance adds custom roles with AddRole.

Order realms check authorization with IsAuthorized(target, selector, caller), passing their own package path, or with the non-crossing AssertIsAuthorizedCaller(0, cur, selector), which derives the target from cur.

Functions

AddRole

func AddRole(cur realm, label string) manager.RoleId
Ask AI Claude ChatGPT

AddRole registers a custom role with label and returns its id. Admin or governance only.

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/gnoswap/order/keeper" -func "AddRole" -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/gnoswap/order/keeper" -func "AddRole" -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
  

AssertIsAuthorizedCaller

func AssertIsAuthorizedCaller(_ int, rlm realm, selector manager.Selector)
Ask AI Claude ChatGPT

AssertIsAuthorizedCaller panics unless the caller of rlm may call selector on the realm of rlm. Order realms call it with their own realm value, so a realm can only assert for itself.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/keeper.AssertIsAuthorizedCaller(,,)"

Result

GetRoleGrantDelay

func GetRoleGrantDelay(role manager.RoleId) uint32
Ask AI Claude ChatGPT

GetRoleGrantDelay returns the grant delay of role in effect now, in seconds.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/keeper.GetRoleGrantDelay()"

Result

GetRoleLabel

func GetRoleLabel(role manager.RoleId) string
Ask AI Claude ChatGPT

GetRoleLabel returns the label of a registered role, or "".

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/keeper.GetRoleLabel()"

Result

GetRoleMemberSince

func GetRoleMemberSince(role manager.RoleId, account address) int64
Ask AI Claude ChatGPT

GetRoleMemberSince returns when account's membership of role becomes active, or 0 if account is not a member.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/keeper.GetRoleMemberSince(,)"

Result

GetRolesJSON

func GetRolesJSON() string
Ask AI Claude ChatGPT

GetRolesJSON returns the registered roles as a JSON array of {"id", "label"} objects, ordered by id.

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/keeper.GetRolesJSON()"

Result

GetTargetFunctionRole

func GetTargetFunctionRole(target string, selector manager.Selector) manager.RoleId
Ask AI Claude ChatGPT

GetTargetFunctionRole returns the role assigned to selector on target. Unassigned selectors return manager.AdminRole, which no account holds.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/keeper.GetTargetFunctionRole(,)"

Result

GrantRole

func GrantRole(cur realm, role manager.RoleId, account address) bool
Ask AI Claude ChatGPT

GrantRole grants role to account and reports whether account is a new member. Membership starts after the role's grant delay. Admin or governance only.

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/gnoswap/order/keeper" -func "GrantRole" -args $'' -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/gnoswap/order/keeper" -func "GrantRole" -args $'' -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
  

HasRole

func HasRole(role manager.RoleId, account address) bool
Ask AI Claude ChatGPT

HasRole reports whether account is an active member of role.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/keeper.HasRole(,)"

Result

IsAuthorized

func IsAuthorized(target string, selector manager.Selector, caller address) bool
Ask AI Claude ChatGPT

IsAuthorized reports whether caller may call selector on target now.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/keeper.IsAuthorized(,,)"

Result

IsTargetClosed

func IsTargetClosed(target string) bool
Ask AI Claude ChatGPT

IsTargetClosed reports whether target rejects every call.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/keeper.IsTargetClosed()"

Result

RenounceRole

func RenounceRole(cur realm, role manager.RoleId, callerConfirmation address) bool
Ask AI Claude ChatGPT

RenounceRole revokes role from the caller. callerConfirmation must be the caller's address.

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/gnoswap/order/keeper" -func "RenounceRole" -args $'' -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/gnoswap/order/keeper" -func "RenounceRole" -args $'' -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
  

RevokeRole

func RevokeRole(cur realm, role manager.RoleId, account address) bool
Ask AI Claude ChatGPT

RevokeRole revokes role from account and reports whether it was a member. Admin or governance only.

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/gnoswap/order/keeper" -func "RevokeRole" -args $'' -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/gnoswap/order/keeper" -func "RevokeRole" -args $'' -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
  

SetRoleGrantDelay

func SetRoleGrantDelay(cur realm, role manager.RoleId, delay uint32)
Ask AI Claude ChatGPT

SetRoleGrantDelay schedules the delay, in seconds, before new members of role become active. The change itself waits manager.MinSetback. Admin or governance only.

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/gnoswap/order/keeper" -func "SetRoleGrantDelay" -args $'' -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/gnoswap/order/keeper" -func "SetRoleGrantDelay" -args $'' -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
  

SetRoleLabel

func SetRoleLabel(cur realm, role manager.RoleId, label string)
Ask AI Claude ChatGPT

SetRoleLabel renames a registered role. Admin or governance only.

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/gnoswap/order/keeper" -func "SetRoleLabel" -args $'' -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/gnoswap/order/keeper" -func "SetRoleLabel" -args $'' -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
  

SetTargetClosed

func SetTargetClosed(cur realm, target string, closed bool)
Ask AI Claude ChatGPT

SetTargetClosed closes or reopens target. A closed target rejects every call, whatever its selector roles. Admin or governance only.

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/gnoswap/order/keeper" -func "SetTargetClosed" -args $'' -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/gnoswap/order/keeper" -func "SetTargetClosed" -args $'' -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
  

SetTargetFunctionRole

func SetTargetFunctionRole(cur realm, target string, selector manager.Selector, role manager.RoleId)
Ask AI Claude ChatGPT

SetTargetFunctionRole assigns role, or manager.PublicRole for anyone, to selector on target (a realm package path). Admin or governance only.

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/gnoswap/order/keeper" -func "SetTargetFunctionRole" -args $'' -args $'' -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/gnoswap/order/keeper" -func "SetTargetFunctionRole" -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 "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

SetTargetFunctionRoles

func SetTargetFunctionRoles(cur realm, target string, selectors []manager.Selector, role manager.RoleId)
Ask AI Claude ChatGPT

SetTargetFunctionRoles assigns role to several selectors on target. Admin or governance only.

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/gnoswap/order/keeper" -func "SetTargetFunctionRoles" -args $'' -args $'' -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/gnoswap/order/keeper" -func "SetTargetFunctionRoles" -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 "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/gnoswap/order/keeper, for example a function call with arguments.