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

halt package

Overview

Package halt holds the halt switches shared by the GnoSwap order realms (gno.land/r/gnoswap/order/...).

Each target (an order type such as "dca" or "limit") has a switch per operation. Admin or governance turns a switch on for one target, or for every target with TargetAll, and can add targets for new order realms. Order realms check IsHalted with their own target, which reports the operation halted when either switch is on, and decide which entry points each operation guards.

Operations:

  • OperationExecute: creating or executing orders
  • OperationWithdraw: executing orders, paying out or refunding funds

The switches are independent of the GnoSwap protocol halt levels.

Functions

AddTarget

func AddTarget(cur realm, target string)
Ask AI Claude ChatGPT

AddTarget registers a target, e.g. for a new order realm. Admin or governance only.

A target is 1 to 32 characters of lowercase letters, digits, '_', or '-', and cannot be TargetAll.

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/halt" -func "AddTarget" -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/halt" -func "AddTarget" -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
  

GetHaltedJSON

func GetHaltedJSON(target string) string
Ask AI Claude ChatGPT

GetHaltedJSON returns, as JSON, whether each operation is halted for target, including the TargetAll switches.

Param

Command

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

Result

GetOperations

func GetOperations() []string
Ask AI Claude ChatGPT

GetOperations returns the operations that can be halted.

Command

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

Result

GetTargets

func GetTargets() []string
Ask AI Claude ChatGPT

GetTargets returns the registered targets, in registration order.

Command

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

Result

IsHalted

func IsHalted(target string, operation string) bool
Ask AI Claude ChatGPT

IsHalted reports whether operation is halted for target, by its own switch or by the TargetAll switch. It panics on an unknown target or operation.

Params

Command

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

Result

SetHalted

func SetHalted(cur realm, target string, operation string, isHalted bool)
Ask AI Claude ChatGPT

SetHalted halts or resumes operation for target. Admin or governance only.

Parameters:

  • target: a registered target, or TargetAll for every target.
  • operation: OperationExecute or OperationWithdraw.

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/halt" -func "SetHalted" -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/halt" -func "SetHalted" -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/halt, for example a function call with arguments.