proxy.gno
4.13 Kb · 126 lines
1package staker
2
3// StakeToken stakes a position NFT to earn rewards.
4//
5// Parameters:
6// - positionId: ID of the position to stake
7// - referrer: referrer address for reward tracking
8//
9// Returns:
10// - string: deposit ID
11func StakeToken(cur realm, positionId uint64, referrer string) string {
12 return getImplementation().StakeToken(0, cur, positionId, referrer)
13}
14
15// UnStakeToken unstakes a position NFT and collects rewards.
16//
17// Parameters:
18// - positionId: ID of the position to unstake
19//
20// Returns:
21// - string: collected reward details
22func UnStakeToken(cur realm, positionId uint64) string {
23 return getImplementation().UnStakeToken(0, cur, positionId)
24}
25
26// CollectReward collects accumulated rewards from a staked position.
27//
28// Parameters:
29// - positionId: ID of the staked position
30//
31// Returns:
32// - string: pool path
33// - string: staking details
34// - map[string]int64: internal rewards
35// - map[string]int64: external rewards
36func CollectReward(cur realm, positionId uint64) (string, string, map[string]int64, map[string]int64) {
37 poolPath, stakingDetails, internalRewards, externalRewards := getImplementation().CollectReward(0, cur, positionId)
38 return poolPath, stakingDetails, cloneStringInt64Map(internalRewards), cloneStringInt64Map(externalRewards)
39}
40
41// SetPoolTier sets the reward tier for a pool.
42func SetPoolTier(cur realm, poolPath string, tier uint64) {
43 getImplementation().SetPoolTier(0, cur, poolPath, tier)
44}
45
46// ChangePoolTier changes the reward tier of a pool.
47func ChangePoolTier(cur realm, poolPath string, tier uint64) {
48 getImplementation().ChangePoolTier(0, cur, poolPath, tier)
49}
50
51// RemovePoolTier removes a pool from the tier system.
52func RemovePoolTier(cur realm, poolPath string) {
53 getImplementation().RemovePoolTier(0, cur, poolPath)
54}
55
56// CreateExternalIncentive creates an external reward incentive for a pool.
57//
58// Parameters:
59// - targetPoolPath: pool to incentivize
60// - rewardToken: token to use as reward
61// - rewardAmount: total reward amount
62// - startTimestamp: incentive start time
63// - endTimestamp: incentive end time
64func CreateExternalIncentive(
65 cur realm,
66 targetPoolPath string,
67 rewardToken string,
68 rewardAmount int64,
69 startTimestamp int64,
70 endTimestamp int64,
71) {
72 getImplementation().CreateExternalIncentive(
73 0,
74 cur,
75 targetPoolPath,
76 rewardToken,
77 rewardAmount,
78 startTimestamp,
79 endTimestamp,
80 )
81}
82
83// EndExternalIncentive terminates an external incentive early.
84func EndExternalIncentive(cur realm, targetPoolPath, incentiveId string, refundAddress address) {
85 getImplementation().EndExternalIncentive(0, cur, targetPoolPath, incentiveId, refundAddress)
86}
87
88// CollectExternalIncentivePenalty collects accumulated warmup penalties for an ended incentive.
89func CollectExternalIncentivePenalty(cur realm, targetPoolPath, incentiveId string, refundAddress address) int64 {
90 return getImplementation().CollectExternalIncentivePenalty(0, cur, targetPoolPath, incentiveId, refundAddress)
91}
92
93// AddToken adds a token to the reward token whitelist.
94func AddToken(cur realm, tokenPath string) {
95 getImplementation().AddToken(0, cur, tokenPath)
96}
97
98// RemoveToken removes a token from the reward token whitelist.
99func RemoveToken(cur realm, tokenPath string) {
100 getImplementation().RemoveToken(0, cur, tokenPath)
101}
102
103// SetWarmUp sets the warm-up period parameters for staking.
104func SetWarmUp(cur realm, pct, timeDuration int64) {
105 getImplementation().SetWarmUp(0, cur, pct, timeDuration)
106}
107
108// SetDepositGnsAmount sets the required GNS deposit amount for staking.
109func SetDepositGnsAmount(cur realm, amount int64) {
110 getImplementation().SetDepositGnsAmount(0, cur, amount)
111}
112
113// SetMinimumRewardAmount sets the minimum reward amount to distribute.
114func SetMinimumRewardAmount(cur realm, amount int64) {
115 getImplementation().SetMinimumRewardAmount(0, cur, amount)
116}
117
118// SetTokenMinimumRewardAmount sets minimum reward amounts per token.
119func SetTokenMinimumRewardAmount(cur realm, paramsStr string) {
120 getImplementation().SetTokenMinimumRewardAmount(0, cur, paramsStr)
121}
122
123// SetUnStakingFee sets the unstaking fee percentage.
124func SetUnStakingFee(cur realm, fee uint64) {
125 getImplementation().SetUnStakingFee(0, cur, fee)
126}