Search Apps Documentation Source Content File Folder Download Copy Actions Download

staker package

Functions

CleanStakerDelegationSnapshotByAdmin

func CleanStakerDelegationSnapshotByAdmin(cur realm, threshold int64)

CleanStakerDelegationSnapshotByAdmin removes old delegation snapshots. Only callable by admin. Parameters: - threshold: timestamp threshold for cleanup

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/gov/staker" -func "CleanStakerDelegationSnapshotByAdmin" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/gov/staker" -func "CleanStakerDelegationSnapshotByAdmin" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

CollectReward

func CollectReward(cur realm)

CollectReward claims accumulated staking rewards.

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/gov/staker" -func "CollectReward" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/gov/staker" -func "CollectReward" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

CollectRewardFromLaunchPad

func CollectRewardFromLaunchPad(cur realm, to address)

CollectRewardFromLaunchPad claims rewards from launchpad projects. Parameters: - to: address to collect rewards for

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/gov/staker" -func "CollectRewardFromLaunchPad" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/gov/staker" -func "CollectRewardFromLaunchPad" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

CollectUndelegatedGns

func CollectUndelegatedGns(cur realm) int64

CollectUndelegatedGns collects GNS tokens after the undelegation lockup period. Returns: - int64: amount of GNS collected

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/gov/staker" -func "CollectUndelegatedGns" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/gov/staker" -func "CollectUndelegatedGns" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

DecodeInt64

func DecodeInt64(s string) int64

Param

Command

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

Result

DecodeUint

func DecodeUint(s string) uint64

DecodeUint converts a zero-padded string back into a uint64 number. Parameters: - s (string): The zero-padded string. Returns: - uint64: The decoded number. Panics: - If the string cannot be parsed into a uint64. Example: Input: "00000000000000012345" Output: 12345

Param

Command

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

Result

Delegate

func Delegate(cur realm, to address, amount int64, referrer string) int64

Delegate stakes GNS tokens to a delegatee address. Parameters: - to: address to delegate to - amount: amount of GNS to delegate - referrer: referrer address for reward tracking Returns: - int64: delegation ID

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/gov/staker" -func "Delegate" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/gov/staker" -func "Delegate" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

EncodeInt64

func EncodeInt64(num int64) string

Param

Command

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

Result

EncodeUint

func EncodeUint(num uint64) string

EncodeUint converts a uint64 number into a zero-padded 20-character string. Parameters: - num (uint64): The number to encode. Returns: - string: A zero-padded string representation of the number. Example: Input: 12345 Output: "00000000000000012345"

Param

Command

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

Result

ExistsDelegation

func ExistsDelegation(delegationID int64) bool

ExistsDelegation checks if a delegation exists.

Param

Command

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

Result

GetClaimableRewardByAddress

func GetClaimableRewardByAddress(addr address) (int64, map[string]int64, error)

GetClaimableRewardByAddress returns claimable rewards for an address. Returns: - int64: emission reward amount - map\[string]int64: protocol fee rewards by token path

Param

Command

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

Result

GetClaimableRewardByLaunchpad

func GetClaimableRewardByLaunchpad(addr address) (int64, map[string]int64, error)

GetClaimableRewardByLaunchpad returns claimable launchpad rewards for an address. Returns: - int64: emission reward amount - map\[string]int64: protocol fee rewards by token path

Param

Command

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

Result

GetClaimableRewardByRewardID

func GetClaimableRewardByRewardID(rewardID string) (int64, map[string]int64, error)

GetClaimableRewardByRewardID returns claimable reward details by reward ID. Returns: - int64: emission reward amount - map\[string]int64: protocol fee rewards by token path

Param

Command

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

Result

GetCollectableWithdrawAmount

func GetCollectableWithdrawAmount(delegationID int64) int64

GetCollectableWithdrawAmount returns the collectable withdraw amount for a specific delegation.

Param

Command

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

Result

GetDelegationCount

func GetDelegationCount() int

GetDelegationCount returns the total number of delegations.

Command

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

Result

GetDelegationIDs

func GetDelegationIDs(offset, count int) []int64

GetDelegationIDs returns a paginated list of delegation IDs.

Params

Command

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

Result

GetDelegationWithdrawCount

func GetDelegationWithdrawCount(delegationID int64) int

GetDelegationWithdrawCount returns the total number of delegation withdraws for a specific delegation.

Param

Command

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

Result

GetDelegatorDelegateeCount

func GetDelegatorDelegateeCount(delegator address) int

GetDelegatorDelegateeCount returns the number of delegatees for a specific delegator.

Param

Command

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

Result

GetEmissionAccumulatedTimestamp

func GetEmissionAccumulatedTimestamp() int64

GetEmissionAccumulatedTimestamp returns the accumulated timestamp for emission rewards.

Command

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

Result

GetEmissionAccumulatedX128PerStake

func GetEmissionAccumulatedX128PerStake() *u256.Uint

GetEmissionAccumulatedX128PerStake returns the accumulated emission per stake (Q128).

Command

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

Result

GetEmissionDistributedAmount

func GetEmissionDistributedAmount() int64

GetEmissionDistributedAmount returns the total distributed emission amount.

Command

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

Result

GetEmissionRewardBalance

func GetEmissionRewardBalance() int64

GetEmissionRewardBalance returns the current emission reward balance.

Command

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

Result

GetImplementationPackagePath

func GetImplementationPackagePath() string

GetImplementationPackagePath returns the package path of the currently active implementation.

Command

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

Result

GetLaunchpadProjectDeposit

func GetLaunchpadProjectDeposit(projectAddr string) (int64, bool)

GetLaunchpadProjectDeposit returns the deposit amount for a launchpad project.

Param

Command

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

Result

GetLockedAmount

func GetLockedAmount() int64

GetLockedAmount returns the total locked GNS amount.

Command

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

Result

GetProtocolFeeAccumulatedTimestamp

func GetProtocolFeeAccumulatedTimestamp() int64

GetProtocolFeeAccumulatedTimestamp returns the accumulated timestamp for protocol fee rewards.

Command

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

Result

GetProtocolFeeAccumulatedX128PerStake

func GetProtocolFeeAccumulatedX128PerStake(tokenPath string) *u256.Uint

GetProtocolFeeAccumulatedX128PerStake returns the accumulated protocol fee per stake (Q128) for a token path.

Param

Command

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

Result

GetProtocolFeeAmount

func GetProtocolFeeAmount(tokenPath string) int64

GetProtocolFeeAmount returns the protocol fee amounts for a token path.

Param

Command

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

Result

GetTotalDelegated

func GetTotalDelegated() int64

GetTotalDelegated returns the total amount of GNS delegated.

Command

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

Result

GetTotalDelegationAmountAtSnapshot

func GetTotalDelegationAmountAtSnapshot(snapshotTime int64) (int64, bool)

GetTotalDelegationAmountAtSnapshot returns the total delegation amount at a specific snapshot time.

Param

Command

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

Result

GetTotalLockedAmount

func GetTotalLockedAmount() int64

GetTotalLockedAmount returns the total amount of GNS locked in undelegation.

Command

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

Result

GetTotalxGnsSupply

func GetTotalxGnsSupply() int64

GetTotalxGnsSupply returns the total supply of xGNS tokens.

Command

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

Result

GetUnDelegationLockupPeriod

func GetUnDelegationLockupPeriod() int64

GetUnDelegationLockupPeriod returns the undelegation lockup period in seconds.

Command

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

Result

GetUserDelegationAmountAtSnapshot

func GetUserDelegationAmountAtSnapshot(userAddr address, snapshotTime int64) (int64, bool)

GetUserDelegationAmountAtSnapshot returns the user delegation amount at a specific snapshot time.

Params

Command

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

Result

GetUserDelegationCount

func GetUserDelegationCount(delegator address, delegatee address) int

GetUserDelegationCount returns the number of delegations for a specific delegator-delegatee pair.

Params

Command

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

Result

GetUserDelegationIDs

func GetUserDelegationIDs(delegator address, delegatee address) []int64

GetUserDelegationIDs returns a list of delegation IDs for a specific delegator-delegatee pair.

Params

Command

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

Result

HasDelegationSnapshotsKey

func HasDelegationSnapshotsKey() bool

HasDelegationSnapshotsKey returns true if delegation history exists.

Command

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

Result

Redelegate

func Redelegate(cur realm, delegatee, newDelegatee address, amount int64) int64

Redelegate moves delegation from one delegatee to another. Parameters: - delegatee: current delegatee address - newDelegatee: new delegatee address - amount: amount to redelegate Returns: - int64: redelegation result code

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/gov/staker" -func "Redelegate" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/gov/staker" -func "Redelegate" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

RegisterInitializer

func RegisterInitializer(cur realm, initializer func(govStakerStore IGovStakerStore) IGovStaker)

RegisterInitializer registers an implementation This function is called by each implementation version during init

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/gov/staker" -func "RegisterInitializer" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/gov/staker" -func "RegisterInitializer" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

SetAmountByProjectWallet

func SetAmountByProjectWallet(cur realm, addr address, amount int64, add bool)

SetAmountByProjectWallet sets reward amount for a project wallet. Only callable by launchpad contract. Parameters: - addr: project wallet address - amount: reward amount - add: true to add, false to subtract

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/gov/staker" -func "SetAmountByProjectWallet" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/gov/staker" -func "SetAmountByProjectWallet" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

SetUnDelegationLockupPeriodByAdmin

func SetUnDelegationLockupPeriodByAdmin(cur realm, period int64)

SetUnDelegationLockupPeriodByAdmin sets the undelegation lockup period. Only callable by admin. Parameters: - period: lockup period in seconds

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/gov/staker" -func "SetUnDelegationLockupPeriodByAdmin" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/gov/staker" -func "SetUnDelegationLockupPeriodByAdmin" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

Undelegate

func Undelegate(cur realm, from address, amount int64) int64

Undelegate initiates the undelegation process for staked GNS. Parameters: - from: delegatee address to undelegate from - amount: amount of GNS to undelegate Returns: - int64: undelegation result code

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/gov/staker" -func "Undelegate" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/gov/staker" -func "Undelegate" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

UpgradeImpl

func UpgradeImpl(cur realm, packagePath string)

UpgradeImpl upgrades the implementation to a new version Only admin or governance can call this function

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/gov/staker" -func "UpgradeImpl" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/gov/staker" -func "UpgradeImpl" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

NewCounter

func NewCounter() *Counter

Command

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

Result

GetDelegation

func GetDelegation(delegationID int64) (*Delegation, error)

GetDelegation returns the delegation for the given ID.

Param

Command

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

Result

NewDelegation

func NewDelegation( id int64, delegateFrom, delegateTo address, delegateAmount, createdHeight, createdAt int64, ) *Delegation

NewDelegation creates a new delegation

Params

Command

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

Result

NewDelegationManager

func NewDelegationManager() *DelegationManager

NewDelegationManager creates a new instance of DelegationManager. This factory function initializes the AVL tree structure for tracking user delegations.

Command

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

Result

GetDelegationWithdraws

func GetDelegationWithdraws(delegationID int64, offset, count int) ([]*DelegationWithdraw, error)

GetDelegationWithdraws returns a paginated list of delegation withdraws for a specific delegation.

Params

Command

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

Result

NewDelegationWithdraw

func NewDelegationWithdraw( delegationID, unDelegateAmount, createdHeight, createdAt, unDelegationLockupPeriod int64, ) *DelegationWithdraw

NewDelegationWithdraw creates a new delegation withdrawal with lockup period. The withdrawal will be collectable after the lockup period expires. Parameters: - delegationID: unique identifier of the associated delegation - unDelegateAmount: amount being withdrawn - createdAt: timestamp when the withdrawal was created - unDelegationLockupPeriod: duration of the lockup period in seconds Returns: - \*DelegationWithdraw: new withdrawal instance with lockup

Params

Command

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

Result

NewDelegationWithdrawWithoutLockup

func NewDelegationWithdrawWithoutLockup( delegationID, unDelegateAmount, createdHeight, createdAt int64, ) *DelegationWithdraw

NewDelegationWithdrawWithoutLockup creates a new delegation withdrawal that is immediately collectable. This is used for special cases like redelegation where no lockup period is required. Parameters: - delegationID: unique identifier of the associated delegation - unDelegateAmount: amount being withdrawn - createdAt: timestamp when the withdrawal was created Returns: - \*DelegationWithdraw: new withdrawal instance that is immediately collected

Params

Command

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

Result

NewEmissionRewardManager

func NewEmissionRewardManager() *EmissionRewardManager

NewEmissionRewardManager creates a new instance of EmissionRewardManager. This factory function initializes all tracking structures for emission reward management. NewEmissionRewardManager creates new emission reward manager instance.

Command

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

Result

NewEmissionRewardState

func NewEmissionRewardState(accumulatedRewardX128PerStake *u256.Uint) *EmissionRewardState

NewEmissionRewardState creates a new emission reward state for a staker. This factory function initializes the state with the current system reward debt. Parameters: - accumulatedRewardX128PerStake: current system-wide accumulated reward per stake Returns: - \*EmissionRewardState: new emission reward state instance

Param

Command

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

Result

NewGovStakerStore

func NewGovStakerStore(kvStore store.KVStore) IGovStakerStore

NewGovStakerStore creates a new governance staker store instance

Param

Command

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

Result

NewLaunchpadProjectDeposits

func NewLaunchpadProjectDeposits() *LaunchpadProjectDeposits

NewLaunchpadProjectDeposits creates a new instance of LaunchpadProjectDeposits.

Command

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

Result

NewProtocolFeeRewardManager

func NewProtocolFeeRewardManager() *ProtocolFeeRewardManager

NewProtocolFeeRewardManager creates a new instance of ProtocolFeeRewardManager. This factory function initializes all tracking structures for multi-token protocol fee reward management. Returns: - \*ProtocolFeeRewardManager: new protocol fee reward manager instance

Command

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

Result

NewProtocolFeeRewardState

func NewProtocolFeeRewardState(accumulatedProtocolFeeX128PerStake map[string]*u256.Uint) *ProtocolFeeRewardState

NewProtocolFeeRewardState creates a new protocol fee reward state for a staker. This factory function initializes the state with the current system reward debt for all tokens.

Param

Command

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

Result

NewUintTree

func NewUintTree() *UintTree

NewUintTree creates a new UintTree instance.

Command

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

Result