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

staker/v1 package

Overview

Package v1 manages GNS delegation and xGNS accounting. It maintains timestamped delegation history, distributes GNS emission and protocol-fee rewards, and enforces a configurable undelegation lockup (7 days by default; xGNS is burned when undelegated GNS is collected).

Functions

NewDelegation

func NewDelegation( id int64, delegateFrom, delegateTo address, delegateAmount, createdHeight, createdAt int64, ) *staker.Delegation
Ask AI Claude ChatGPT

NewDelegation creates a new delegation. This is a convenience wrapper around staker.NewDelegation.

Parameters:

  • id: delegation ID
  • delegateFrom: delegator's address
  • delegateTo: delegatee's address
  • delegateAmount: amount to delegate
  • createdHeight: creation block height
  • createdAt: creation timestamp

Returns:

  • *staker.Delegation: new delegation instance

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/gov/staker/v1.NewDelegation(,,,,,)"

Result

NewDelegationWithdraw

func NewDelegationWithdraw( delegationID, unDelegateAmount, createdHeight, createdAt, unDelegationLockupPeriod int64, ) staker.DelegationWithdraw
Ask AI Claude ChatGPT

NewDelegationWithdraw creates a new delegation withdrawal with lockup period. This is a convenience wrapper around staker.NewDelegationWithdraw.

Parameters:

  • delegationID: unique identifier of the associated delegation
  • unDelegateAmount: amount being withdrawn
  • createdHeight: height when the withdrawal was created
  • createdAt: timestamp when the withdrawal was created
  • unDelegationLockupPeriod: duration of the lockup period in seconds

Returns:

  • staker.DelegationWithdraw: new withdrawal instance with lockup

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/gov/staker/v1.NewDelegationWithdraw(,,,,)"

Result

NewDelegationWithdrawWithoutLockup

func NewDelegationWithdrawWithoutLockup( delegationID, unDelegateAmount, createdHeight, createdAt int64, ) staker.DelegationWithdraw
Ask AI Claude ChatGPT

NewDelegationWithdrawWithoutLockup creates a new delegation withdrawal that is immediately collectable. This is a convenience wrapper around staker.NewDelegationWithdrawWithoutLockup.

Parameters:

  • delegationID: unique identifier of the associated delegation
  • unDelegateAmount: amount being withdrawn
  • createdHeight: height when the withdrawal was created
  • createdAt: timestamp when the withdrawal was created

Returns:

  • staker.DelegationWithdraw: new withdrawal instance that is immediately collectable

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/gov/staker/v1.NewDelegationWithdrawWithoutLockup(,,,)"

Result

NewGovStakerV1

func NewGovStakerV1(store staker.IGovStakerStore) staker.IGovStaker
Ask AI Claude ChatGPT

NewGovStakerV1 creates the governance staker v1 implementation backed by store.

Parameters:

  • store: governance-staker storage interface used by the implementation.

Returns:

  • staker.IGovStaker: governance staker API backed by store.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/gov/staker/v1.NewGovStakerV1()"

Result

NewDelegationManagerResolver

func NewDelegationManagerResolver(delegationManager *staker.DelegationManager) *DelegationManagerResolver
Ask AI Claude ChatGPT

NewDelegationManagerResolver creates a resolver over an existing delegation manager.

Parameters:

  • delegationManager: manager whose domain-owned delegation trees will be queried or updated.

Returns:

  • *DelegationManagerResolver: resolver exposing address-typed delegation operations.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/gov/staker/v1.NewDelegationManagerResolver()"

Result

NewDelegationResolver

func NewDelegationResolver(delegation *staker.Delegation) *DelegationResolver
Ask AI Claude ChatGPT

NewDelegationResolver wraps a delegation in a resolver for derived amounts and withdrawals.

Parameters:

  • delegation: delegation state to resolve

Returns:

  • *DelegationResolver: resolver backed by delegation

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/gov/staker/v1.NewDelegationResolver()"

Result

NewDelegationWithdrawResolver

func NewDelegationWithdrawResolver(withdraw *staker.DelegationWithdraw) *DelegationWithdrawResolver
Ask AI Claude ChatGPT

NewDelegationWithdrawResolver wraps a delegation withdrawal for collection state and lockup calculations.

Parameters:

  • withdraw: delegation withdrawal state to resolve

Returns:

  • *DelegationWithdrawResolver: resolver retaining the supplied withdrawal pointer

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/gov/staker/v1.NewDelegationWithdrawResolver()"

Result

NewEmissionRewardManagerResolver

func NewEmissionRewardManagerResolver(emissionRewardManager *staker.EmissionRewardManager) *EmissionRewardManagerResolver
Ask AI Claude ChatGPT

NewEmissionRewardManagerResolver wraps an emission reward manager with reward calculation and stake-accounting helpers.

Parameters:

  • emissionRewardManager: manager state to resolve and mutate.

Returns:

  • *EmissionRewardManagerResolver: resolver backed by emissionRewardManager.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/gov/staker/v1.NewEmissionRewardManagerResolver()"

Result

NewEmissionRewardStateResolver

func NewEmissionRewardStateResolver(emissionRewardState *staker.EmissionRewardState) *EmissionRewardStateResolver
Ask AI Claude ChatGPT

NewEmissionRewardStateResolver wraps an on-chain emission reward state for reward calculation and stake/claim updates.

Parameters:

  • emissionRewardState: persisted reward state to expose through the resolver

Returns:

  • *EmissionRewardStateResolver: resolver backed by emissionRewardState

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/gov/staker/v1.NewEmissionRewardStateResolver()"

Result

NewLaunchpadProjectDepositsResolver

func NewLaunchpadProjectDepositsResolver(launchpadProjectDeposits *staker.LaunchpadProjectDeposits) *LaunchpadProjectDepositsResolver
Ask AI Claude ChatGPT

NewLaunchpadProjectDepositsResolver wraps launchpad project deposit state.

Parameters:

  • launchpadProjectDeposits: project deposit state to resolve and mutate

Returns:

  • *LaunchpadProjectDepositsResolver: resolver retaining the supplied deposit state pointer

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/gov/staker/v1.NewLaunchpadProjectDepositsResolver()"

Result

NewProtocolFeeRewardManagerResolver

func NewProtocolFeeRewardManagerResolver(manager *staker.ProtocolFeeRewardManager) *ProtocolFeeRewardManagerResolver
Ask AI Claude ChatGPT

NewProtocolFeeRewardManagerResolver wraps the shared protocol-fee reward manager.

Parameters:

  • manager: Protocol-fee reward state to resolve and mutate.

Returns:

  • *ProtocolFeeRewardManagerResolver: resolver operating on manager's accounting state.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/gov/staker/v1.NewProtocolFeeRewardManagerResolver()"

Result

NewProtocolFeeRewardStateResolver

func NewProtocolFeeRewardStateResolver(protocolFeeRewardState *staker.ProtocolFeeRewardState) *ProtocolFeeRewardStateResolver
Ask AI Claude ChatGPT

NewProtocolFeeRewardStateResolver wraps one staker's protocol fee reward state with settlement operations.

Parameters:

  • protocolFeeRewardState: staker reward state to resolve and mutate.

Returns:

  • *ProtocolFeeRewardStateResolver: resolver backed by protocolFeeRewardState.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/gnoswap/gov/staker/v1.NewProtocolFeeRewardStateResolver()"

Result

Gno Expression Evaluator

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