getters.gno
ExistsDelegation
func ExistsDelegation(
delegationID int64
) boolExistsDelegation checks if a delegation exists.
Parameters
delegationID
int64
Numeric identifier of the delegation to look up.
Return Values
bool
bool
true when a delegation with delegationID exists, false otherwise.
GetClaimableRewardByAddress
GetClaimableRewardByAddress returns claimable rewards for an address.
Parameters
addr
address
Address whose emission and protocol-fee rewards are queried.
Return Values
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.
GetClaimableRewardByLaunchpad
GetClaimableRewardByLaunchpad returns claimable launchpad rewards for an address.
Parameters
addr
address
Address whose launchpad and protocol-fee rewards are queried.
Return Values
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.
GetClaimableRewardByRewardID
GetClaimableRewardByRewardID returns claimable reward details by reward ID.
Parameters
rewardID
string
Reward-state identifier whose claimable rewards are queried.
Return Values
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.
GetCollectableWithdrawAmount
GetCollectableWithdrawAmount returns the collectable withdraw amount for a specific delegation.
Parameters
delegationID
int64
Identifier of the delegation whose collectable amount is queried.
Return Values
int64
int64
amount currently available to collect from delegationID.
GetDelegationWithdrawCount
GetDelegationWithdrawCount returns the total number of delegation withdraws for a specific delegation.
Parameters
delegationID
int64
Identifier of the delegation whose withdrawals are counted.
Return Values
int
int
number of withdrawal records associated with delegationID.
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
*rotree.ReadOnlyTree
*rotree.ReadOnlyTree
read-only delegation view keyed by decimal delegation ID; entry reads return clones.
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
delegator
address
Address whose delegations should be listed.
Return Values
*rotree.ReadOnlyTree
*rotree.ReadOnlyTree
read-only view keyed by delegatee address, or nil when delegator has no delegations.
GetEmissionAccumulatedTimestamp
GetEmissionAccumulatedTimestamp returns the accumulated timestamp for emission rewards.
Return Values
int64
int64
Unix timestamp at which emission accumulation was last updated.
GetEmissionAccumulatedX128PerStake
GetEmissionAccumulatedX128PerStake returns the accumulated emission per stake (Q128).
Return Values
*u256.Uint
*u256.Uint
accumulated emission reward per unit stake in Q128 fixed-point form.
GetEmissionDistributedAmount
GetEmissionDistributedAmount returns the total distributed emission amount.
Return Values
int64
int64
total emission amount distributed to stakers.
GetLaunchpadProjectDeposit
GetLaunchpadProjectDeposit returns the deposit amount for a launchpad project.
Parameters
projectAddr
string
Launchpad project address whose deposited amount is queried.
Return Values
int64
int64
recorded launchpad project deposit amount.
bool
bool
true when a deposit record exists for projectAddr; false otherwise.
GetProtocolFeeAccumulatedTimestamp
GetProtocolFeeAccumulatedTimestamp returns the accumulated timestamp for protocol fee rewards.
Return Values
int64
int64
Unix timestamp at which protocol-fee accumulation was last updated.
GetProtocolFeeAccumulatedX128PerStake
GetProtocolFeeAccumulatedX128PerStake returns the accumulated protocol fee per stake (Q128) for a token path.
Parameters
tokenPath
string
Registered token path whose protocol-fee accumulator is queried.
Return Values
*u256.Uint
*u256.Uint
accumulated protocol-fee amount per unit stake in Q128 fixed-point form.
GetProtocolFeeAmount
GetProtocolFeeAmount returns the protocol fee amounts for a token path.
Parameters
tokenPath
string
Registered token path whose protocol fees are queried.
Return Values
int64
int64
accumulated protocol-fee amount for tokenPath in token base units.
GetTotalDelegated
GetTotalDelegated returns the total amount of GNS delegated.
Return Values
int64
int64
total GNS amount delegated across all delegators.
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
snapshotTime
int64
Unix timestamp at or before which to select the latest aggregate delegation history entry.
Return Values
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.
GetTotalLockedAmount
GetTotalLockedAmount returns the total amount of GNS locked in undelegation.
Return Values
int64
int64
total GNS amount currently locked in undelegation withdrawals.
GetTotalxGnsSupply
GetTotalxGnsSupply returns total xGNS supply, including launchpad-held xGNS.
Return Values
int64
int64
total xGNS supply, including xGNS held by launchpad projects.
GetUnDelegationLockupPeriod
GetUnDelegationLockupPeriod returns the undelegation lockup period in seconds.
Return Values
int64
int64
configured undelegation lockup duration in seconds.
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
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
int64
int64
user's delegated amount recorded at or before snapshotTime.
bool
bool
true when a qualifying user-history entry exists; false otherwise.
GetUserDelegationIDs
GetUserDelegationIDs returns a list of delegation IDs for a specific delegator-delegatee pair.
Parameters
delegator
address
Address that supplied the delegation.
delegatee
address
Address receiving that delegation.
Return Values
[]int64
[]int64
delegation IDs for the delegator-delegatee pair; the returned slice is independent of realm state.
HasDelegationSnapshotsKey
HasDelegationSnapshotsKey returns true if delegation history exists.
Return Values
bool
bool
true when delegation history has been initialized in storage.
Last updated