For the complete documentation index, see llms.txt. This page is also available as Markdown.

getters.gno

ExistsDelegation

func ExistsDelegation(
	delegationID int64
) bool

ExistsDelegation checks if a delegation exists.

Parameters

Name
Type
Description

delegationID

int64

Numeric identifier of the delegation to look up.

Return Values

Name
Type
Description

bool

bool

true when a delegation with delegationID exists, false otherwise.

source

GetClaimableRewardByAddress

GetClaimableRewardByAddress returns claimable rewards for an address.

Parameters

Name
Type
Description

addr

address

Address whose emission and protocol-fee rewards are queried.

Return Values

Name
Type
Description

int64

int64

emission reward amount available to addr.

map[string]int64

map[string]int64

protocol-fee reward amounts keyed by token path.

error

error

nil on success; non-nil when reward state cannot be resolved for addr.

source

GetClaimableRewardByLaunchpad

GetClaimableRewardByLaunchpad returns claimable launchpad rewards for an address.

Parameters

Name
Type
Description

addr

address

Address whose launchpad and protocol-fee rewards are queried.

Return Values

Name
Type
Description

int64

int64

emission reward amount available to addr.

map[string]int64

map[string]int64

protocol-fee reward amounts keyed by token path.

error

error

nil on success; non-nil when reward state cannot be resolved for addr.

source

GetClaimableRewardByRewardID

GetClaimableRewardByRewardID returns claimable reward details by reward ID.

Parameters

Name
Type
Description

rewardID

string

Reward-state identifier whose claimable rewards are queried.

Return Values

Name
Type
Description

int64

int64

emission reward amount associated with rewardID.

map[string]int64

map[string]int64

protocol-fee reward amounts keyed by token path.

error

error

nil on success; non-nil when rewardID cannot be resolved.

source

GetCollectableWithdrawAmount

GetCollectableWithdrawAmount returns the collectable withdraw amount for a specific delegation.

Parameters

Name
Type
Description

delegationID

int64

Identifier of the delegation whose collectable amount is queried.

Return Values

Name
Type
Description

int64

int64

amount currently available to collect from delegationID.

source

GetDelegationWithdrawCount

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

Parameters

Name
Type
Description

delegationID

int64

Identifier of the delegation whose withdrawals are counted.

Return Values

Name
Type
Description

int

int

number of withdrawal records associated with delegationID.

source

GetDelegations

GetDelegations returns a read-only view of every delegation, keyed by the decimal string form of the delegation ID. Callers paginate it themselves through IterateByOffset. Reading an entry yields a clone, so the view cannot mutate realm state.

Return Values

Name
Type
Description

*rotree.ReadOnlyTree

*rotree.ReadOnlyTree

read-only delegation view keyed by decimal delegation ID; entry reads return clones.

source

GetDelegatorDelegations

GetDelegatorDelegations returns a read-only view of a delegator's delegations, keyed by delegatee address with that pair's delegation IDs as the value. Reading an entry yields a copy of the ID slice, so the view cannot mutate realm state. nil is returned when the delegator has no delegations.

Parameters

Name
Type
Description

delegator

address

Address whose delegations should be listed.

Return Values

Name
Type
Description

*rotree.ReadOnlyTree

*rotree.ReadOnlyTree

read-only view keyed by delegatee address, or nil when delegator has no delegations.

source

GetEmissionAccumulatedTimestamp

GetEmissionAccumulatedTimestamp returns the accumulated timestamp for emission rewards.

Return Values

Name
Type
Description

int64

int64

Unix timestamp at which emission accumulation was last updated.

source

GetEmissionAccumulatedX128PerStake

GetEmissionAccumulatedX128PerStake returns the accumulated emission per stake (Q128).

Return Values

Name
Type
Description

*u256.Uint

*u256.Uint

accumulated emission reward per unit stake in Q128 fixed-point form.

source

GetEmissionDistributedAmount

GetEmissionDistributedAmount returns the total distributed emission amount.

Return Values

Name
Type
Description

int64

int64

total emission amount distributed to stakers.

source

GetLaunchpadProjectDeposit

GetLaunchpadProjectDeposit returns the deposit amount for a launchpad project.

Parameters

Name
Type
Description

projectAddr

string

Launchpad project address whose deposited amount is queried.

Return Values

Name
Type
Description

int64

int64

recorded launchpad project deposit amount.

bool

bool

true when a deposit record exists for projectAddr; false otherwise.

source

GetProtocolFeeAccumulatedTimestamp

GetProtocolFeeAccumulatedTimestamp returns the accumulated timestamp for protocol fee rewards.

Return Values

Name
Type
Description

int64

int64

Unix timestamp at which protocol-fee accumulation was last updated.

source

GetProtocolFeeAccumulatedX128PerStake

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

Parameters

Name
Type
Description

tokenPath

string

Registered token path whose protocol-fee accumulator is queried.

Return Values

Name
Type
Description

*u256.Uint

*u256.Uint

accumulated protocol-fee amount per unit stake in Q128 fixed-point form.

source

GetProtocolFeeAmount

GetProtocolFeeAmount returns the protocol fee amounts for a token path.

Parameters

Name
Type
Description

tokenPath

string

Registered token path whose protocol fees are queried.

Return Values

Name
Type
Description

int64

int64

accumulated protocol-fee amount for tokenPath in token base units.

source

GetTotalDelegated

GetTotalDelegated returns the total amount of GNS delegated.

Return Values

Name
Type
Description

int64

int64

total GNS amount delegated across all delegators.

source

GetTotalDelegationAmountAtSnapshot

GetTotalDelegationAmountAtSnapshot returns total delegation at a Unix timestamp, using the latest history entry at or before that timestamp. The lookup is timestamp-based rather than a block-height snapshot.

Parameters

Name
Type
Description

snapshotTime

int64

Unix timestamp at or before which to select the latest aggregate delegation history entry.

Return Values

Name
Type
Description

int64

int64

aggregate delegated amount recorded at or before snapshotTime.

bool

bool

true when a qualifying history entry exists; false when no entry is available.

source

GetTotalLockedAmount

GetTotalLockedAmount returns the total amount of GNS locked in undelegation.

Return Values

Name
Type
Description

int64

int64

total GNS amount currently locked in undelegation withdrawals.

source

GetTotalxGnsSupply

GetTotalxGnsSupply returns total xGNS supply, including launchpad-held xGNS.

Return Values

Name
Type
Description

int64

int64

total xGNS supply, including xGNS held by launchpad projects.

source

GetUnDelegationLockupPeriod

GetUnDelegationLockupPeriod returns the undelegation lockup period in seconds.

Return Values

Name
Type
Description

int64

int64

configured undelegation lockup duration in seconds.

source

GetUserDelegationAmountAtSnapshot

GetUserDelegationAmountAtSnapshot returns one user's delegation at a Unix timestamp, using that user's latest history entry at or before the timestamp. The bool is false when no qualifying history entry exists.

Parameters

Name
Type
Description

userAddr

address

Delegator address whose historical delegation is queried.

snapshotTime

int64

Unix timestamp at or before which to select the user's latest history entry.

Return Values

Name
Type
Description

int64

int64

user's delegated amount recorded at or before snapshotTime.

bool

bool

true when a qualifying user-history entry exists; false otherwise.

source

GetUserDelegationIDs

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

Parameters

Name
Type
Description

delegator

address

Address that supplied the delegation.

delegatee

address

Address receiving that delegation.

Return Values

Name
Type
Description

[]int64

[]int64

delegation IDs for the delegator-delegatee pair; the returned slice is independent of realm state.

source

HasDelegationSnapshotsKey

HasDelegationSnapshotsKey returns true if delegation history exists.

Return Values

Name
Type
Description

bool

bool

true when delegation history has been initialized in storage.

source

Last updated