@raac/rpc 1.2.0-beta.10 → 1.2.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/dist/RPCLibrary.js +2 -0
  2. package/dist/artifacts/core/governance/gauges/BaseGauge.sol/BaseGauge.json +113 -20
  3. package/dist/artifacts/core/governance/gauges/GaugeController.sol/GaugeController.json +259 -31
  4. package/dist/artifacts/core/governance/gauges/GaugeRewardsDistributor.sol/GaugeRewardsDistributor.json +159 -31
  5. package/dist/artifacts/core/governance/gauges/RAACGauge.sol/RAACGauge.json +115 -22
  6. package/dist/artifacts/core/governance/gauges/RWAGauge.sol/RWAGauge.json +115 -22
  7. package/dist/configs/chains/1.json +22 -25
  8. package/dist/configs/chains/11155111.json +56 -71
  9. package/dist/configs/chains/17000.json +22 -25
  10. package/dist/configs/chains/18453.json +22 -25
  11. package/dist/configs/chains/8453.json +61 -31
  12. package/dist/contracts/findContract.js +11 -4
  13. package/dist/contracts/getContractAddress.js +0 -1
  14. package/dist/contracts/governance/distributor/claimAll.js +18 -11
  15. package/dist/contracts/governance/distributor/claimForGauge.js +18 -12
  16. package/dist/contracts/governance/distributor/deposit.js +17 -12
  17. package/dist/contracts/governance/distributor/getClaimableForGauge.js +10 -9
  18. package/dist/contracts/governance/distributor/getClaimedAtEpoch.js +11 -10
  19. package/dist/contracts/governance/distributor/getDepositedAtEpoch.js +8 -8
  20. package/dist/contracts/governance/distributor/getDustLastProcessedEpoch.js +28 -0
  21. package/dist/contracts/governance/distributor/getGaugeController.js +7 -7
  22. package/dist/contracts/governance/distributor/getLastClaimedEpoch.js +10 -9
  23. package/dist/contracts/governance/distributor/getMaxClaimBound.js +29 -0
  24. package/dist/contracts/governance/distributor/getPeriodDuration.js +7 -7
  25. package/dist/contracts/governance/distributor/getRewardToken.js +7 -7
  26. package/dist/contracts/governance/distributor/getRewardTokenInfo.js +7 -7
  27. package/dist/contracts/governance/distributor/getRewardTokenStats.js +7 -7
  28. package/dist/contracts/governance/distributor/index.js +5 -2
  29. package/dist/contracts/governance/distributor/setController.js +17 -12
  30. package/dist/contracts/governance/distributor/setLastClaimedEpoch.js +32 -0
  31. package/dist/contracts/governance/distributor/setMaxClaimBound.js +31 -0
  32. package/dist/contracts/governance/distributor/withdrawDust.js +31 -0
  33. package/dist/contracts/governance/distributor/withdrawRemovedGaugeRewards.js +19 -13
  34. package/dist/contracts/governance/gauge/_apy.js +122 -0
  35. package/dist/contracts/governance/gauge/_tokens.js +36 -0
  36. package/dist/contracts/governance/gauge/addRewardToken.js +2 -12
  37. package/dist/contracts/governance/gauge/approveGaugeToken.js +31 -0
  38. package/dist/contracts/governance/gauge/claimExtraReward.js +2 -12
  39. package/dist/contracts/governance/gauge/claimExtraRewards.js +2 -12
  40. package/dist/contracts/governance/gauge/claimOnBehalfOf.js +2 -12
  41. package/dist/contracts/governance/gauge/claimRewardToken.js +3 -13
  42. package/dist/contracts/governance/gauge/claimRewardsFor.js +2 -12
  43. package/dist/contracts/governance/gauge/depositRewardToken.js +2 -12
  44. package/dist/contracts/governance/gauge/getAllPendingExtraRewards.js +2 -9
  45. package/dist/contracts/governance/gauge/getApy.js +44 -0
  46. package/dist/contracts/governance/gauge/getBalanceOf.js +2 -15
  47. package/dist/contracts/governance/gauge/getControllerAddress.js +2 -9
  48. package/dist/contracts/governance/gauge/getDecimalAdjustment.js +2 -9
  49. package/dist/contracts/governance/gauge/getDepositRAACOnClaim.js +2 -9
  50. package/dist/contracts/governance/gauge/getDistributorData.js +2 -9
  51. package/dist/contracts/governance/gauge/getDistributors.js +2 -9
  52. package/dist/contracts/governance/gauge/getEarnedExtraReward.js +30 -0
  53. package/dist/contracts/governance/gauge/getEarnedReward.js +8 -14
  54. package/dist/contracts/governance/gauge/getExtraRewardTokens.js +2 -9
  55. package/dist/contracts/governance/gauge/getGaugeData.js +39 -0
  56. package/dist/contracts/governance/gauge/getGaugeRewardTokenData.js +2 -9
  57. package/dist/contracts/governance/gauge/getPauseStatus.js +31 -0
  58. package/dist/contracts/governance/gauge/getPendingExtraRewards.js +2 -9
  59. package/dist/contracts/governance/gauge/getPendingRewards.js +8 -14
  60. package/dist/contracts/governance/gauge/getPeriodBoundaries.js +2 -15
  61. package/dist/contracts/governance/gauge/getPeriodDuration.js +2 -15
  62. package/dist/contracts/governance/gauge/getRaacAutolockMin.js +2 -9
  63. package/dist/contracts/governance/gauge/getRawBalanceOf.js +2 -15
  64. package/dist/contracts/governance/gauge/getRawTotalSupply.js +2 -15
  65. package/dist/contracts/governance/gauge/getRewardTokens.js +28 -0
  66. package/dist/contracts/governance/gauge/getTotalSupply.js +2 -15
  67. package/dist/contracts/governance/gauge/getUserApy.js +71 -0
  68. package/dist/contracts/governance/gauge/getUserClaimableRewards.js +21 -73
  69. package/dist/contracts/governance/gauge/getUserGaugeState.js +44 -0
  70. package/dist/contracts/governance/gauge/getUserRewardTokenData.js +2 -9
  71. package/dist/contracts/governance/gauge/getUserWeight.js +2 -9
  72. package/dist/contracts/governance/gauge/index.js +11 -1
  73. package/dist/contracts/governance/gauge/isPaused.js +4 -11
  74. package/dist/contracts/governance/gauge/manageDistributor.js +2 -12
  75. package/dist/contracts/governance/gauge/pullRewardsFromDistributor.js +30 -0
  76. package/dist/contracts/governance/gauge/setController.js +2 -12
  77. package/dist/contracts/governance/gauge/setDepositRAACOnClaim.js +2 -12
  78. package/dist/contracts/governance/gauge/setEmergencyPaused.js +2 -12
  79. package/dist/contracts/governance/gauge/setGaugeRewardDistributor.js +2 -12
  80. package/dist/contracts/governance/gauge/setRaacAutolockMin.js +2 -12
  81. package/dist/contracts/governance/gauge/stake.js +2 -18
  82. package/dist/contracts/governance/gauge/unwrapStakingToken.js +28 -0
  83. package/dist/contracts/governance/gauge/updateUserRewards.js +2 -18
  84. package/dist/contracts/governance/gauge/withdraw.js +2 -18
  85. package/dist/contracts/governance/gauge/wrapStakingToken.js +28 -0
  86. package/dist/contracts/governance/gaugeController/addGauge.js +19 -11
  87. package/dist/contracts/governance/gaugeController/batchVote.js +20 -12
  88. package/dist/contracts/governance/gaugeController/calculateBoost.js +20 -23
  89. package/dist/contracts/governance/gaugeController/forceCompleteCheckpoint.js +19 -11
  90. package/dist/contracts/governance/gaugeController/getActiveGaugeCount.js +28 -0
  91. package/dist/contracts/governance/gaugeController/getActiveGauges.js +10 -13
  92. package/dist/contracts/governance/gaugeController/getConstants.js +10 -18
  93. package/dist/contracts/governance/gaugeController/getCurrentEpoch.js +8 -7
  94. package/dist/contracts/governance/gaugeController/getExpiredGaugeVotePower.js +30 -0
  95. package/dist/contracts/governance/gaugeController/getGauge.js +11 -9
  96. package/dist/contracts/governance/gaugeController/getGaugeDistributor.js +28 -0
  97. package/dist/contracts/governance/gaugeController/getGaugeEmissions.js +15 -9
  98. package/dist/contracts/governance/gaugeController/getGaugeRelativeWeight.js +19 -15
  99. package/dist/contracts/governance/gaugeController/getGaugeRelativeWeightView.js +12 -10
  100. package/dist/contracts/governance/gaugeController/getGaugeWeight.js +10 -8
  101. package/dist/contracts/governance/gaugeController/getLastVoteTime.js +11 -9
  102. package/dist/contracts/governance/gaugeController/getMaxVoteBuckets.js +28 -0
  103. package/dist/contracts/governance/gaugeController/getNextEpoch.js +8 -7
  104. package/dist/contracts/governance/gaugeController/getRegisteredGaugeList.js +28 -0
  105. package/dist/contracts/governance/gaugeController/getTotalWeight.js +8 -7
  106. package/dist/contracts/governance/gaugeController/getUserGaugeVotePower.js +11 -9
  107. package/dist/contracts/governance/gaugeController/getUserVotePowerRemaining.js +10 -9
  108. package/dist/contracts/governance/gaugeController/getVeToken.js +8 -7
  109. package/dist/contracts/governance/gaugeController/getVoteUserLocks.js +32 -0
  110. package/dist/contracts/governance/gaugeController/getVoteUserPower.js +8 -7
  111. package/dist/contracts/governance/gaugeController/getVoteUserSlope.js +12 -10
  112. package/dist/contracts/governance/gaugeController/index.js +10 -1
  113. package/dist/contracts/governance/gaugeController/isGaugeActive.js +11 -9
  114. package/dist/contracts/governance/gaugeController/isPaused.js +9 -8
  115. package/dist/contracts/governance/gaugeController/kick.js +17 -10
  116. package/dist/contracts/governance/gaugeController/removeGauge.js +20 -11
  117. package/dist/contracts/governance/gaugeController/removePowerFromGauge.js +19 -11
  118. package/dist/contracts/governance/gaugeController/setBoostAmplificationEnabled.js +20 -12
  119. package/dist/contracts/governance/gaugeController/setDistributor.js +31 -0
  120. package/dist/contracts/governance/gaugeController/setEmergencyGaugePause.js +20 -12
  121. package/dist/contracts/governance/gaugeController/setEmergencyGaugePauseBatch.js +33 -0
  122. package/dist/contracts/governance/gaugeController/setEmergencyPause.js +18 -11
  123. package/dist/contracts/governance/gaugeController/setMaxVoteBuckets.js +31 -0
  124. package/dist/contracts/governance/gaugeController/vote.js +15 -16
  125. package/dist/contracts/governance/gaugeSystems/_helpers.js +123 -0
  126. package/dist/contracts/governance/gaugeSystems/findGauge.js +14 -0
  127. package/dist/contracts/governance/gaugeSystems/getGaugeSystem.js +14 -0
  128. package/dist/contracts/governance/gaugeSystems/getGaugeSystems.js +13 -0
  129. package/dist/contracts/governance/gaugeSystems/getGauges.js +15 -0
  130. package/dist/contracts/governance/gaugeSystems/index.js +21 -0
  131. package/dist/types/RPCLibrary.d.ts +2 -0
  132. package/dist/types/configs/chains/index.d.ts +36 -46
  133. package/dist/types/configs/index.d.ts +18 -23
  134. package/dist/types/contracts/governance/distributor/claimAll.d.ts +7 -5
  135. package/dist/types/contracts/governance/distributor/claimForGauge.d.ts +7 -6
  136. package/dist/types/contracts/governance/distributor/deposit.d.ts +7 -6
  137. package/dist/types/contracts/governance/distributor/getClaimableForGauge.d.ts +6 -4
  138. package/dist/types/contracts/governance/distributor/getClaimedAtEpoch.d.ts +7 -5
  139. package/dist/types/contracts/governance/distributor/getDepositedAtEpoch.d.ts +6 -4
  140. package/dist/types/contracts/governance/distributor/getDustLastProcessedEpoch.d.ts +12 -0
  141. package/dist/types/contracts/governance/distributor/getGaugeController.d.ts +5 -3
  142. package/dist/types/contracts/governance/distributor/getLastClaimedEpoch.d.ts +6 -4
  143. package/dist/types/contracts/governance/distributor/getMaxClaimBound.d.ts +15 -0
  144. package/dist/types/contracts/governance/distributor/getPeriodDuration.d.ts +5 -3
  145. package/dist/types/contracts/governance/distributor/getRewardToken.d.ts +5 -3
  146. package/dist/types/contracts/governance/distributor/getRewardTokenInfo.d.ts +5 -3
  147. package/dist/types/contracts/governance/distributor/getRewardTokenStats.d.ts +5 -3
  148. package/dist/types/contracts/governance/distributor/index.d.ts +5 -2
  149. package/dist/types/contracts/governance/distributor/setController.d.ts +7 -6
  150. package/dist/types/contracts/governance/distributor/setLastClaimedEpoch.d.ts +13 -0
  151. package/dist/types/contracts/governance/distributor/setMaxClaimBound.d.ts +13 -0
  152. package/dist/types/contracts/governance/distributor/withdrawDust.d.ts +13 -0
  153. package/dist/types/contracts/governance/distributor/withdrawRemovedGaugeRewards.d.ts +8 -7
  154. package/dist/types/contracts/governance/gauge/_apy.d.ts +61 -0
  155. package/dist/types/contracts/governance/gauge/_tokens.d.ts +14 -0
  156. package/dist/types/contracts/governance/gauge/approveGaugeToken.d.ts +14 -0
  157. package/dist/types/contracts/governance/gauge/claimRewardToken.d.ts +1 -1
  158. package/dist/types/contracts/governance/gauge/getApy.d.ts +41 -0
  159. package/dist/types/contracts/governance/gauge/getEarnedExtraReward.d.ts +13 -0
  160. package/dist/types/contracts/governance/gauge/getEarnedReward.d.ts +3 -2
  161. package/dist/types/contracts/governance/gauge/getGaugeData.d.ts +23 -0
  162. package/dist/types/contracts/governance/gauge/getPauseStatus.d.ts +19 -0
  163. package/dist/types/contracts/governance/gauge/getPendingRewards.d.ts +3 -2
  164. package/dist/types/contracts/governance/gauge/getRewardTokens.d.ts +11 -0
  165. package/dist/types/contracts/governance/gauge/getUserApy.d.ts +44 -0
  166. package/dist/types/contracts/governance/gauge/getUserClaimableRewards.d.ts +14 -12
  167. package/dist/types/contracts/governance/gauge/getUserGaugeState.d.ts +31 -0
  168. package/dist/types/contracts/governance/gauge/index.d.ts +11 -1
  169. package/dist/types/contracts/governance/gauge/isPaused.d.ts +1 -1
  170. package/dist/types/contracts/governance/gauge/pullRewardsFromDistributor.d.ts +11 -0
  171. package/dist/types/contracts/governance/gauge/unwrapStakingToken.d.ts +12 -0
  172. package/dist/types/contracts/governance/gauge/wrapStakingToken.d.ts +13 -0
  173. package/dist/types/contracts/governance/gaugeController/addGauge.d.ts +8 -5
  174. package/dist/types/contracts/governance/gaugeController/batchVote.d.ts +9 -6
  175. package/dist/types/contracts/governance/gaugeController/calculateBoost.d.ts +10 -8
  176. package/dist/types/contracts/governance/gaugeController/forceCompleteCheckpoint.d.ts +8 -5
  177. package/dist/types/contracts/governance/gaugeController/getActiveGaugeCount.d.ts +12 -0
  178. package/dist/types/contracts/governance/gaugeController/getActiveGauges.d.ts +7 -3
  179. package/dist/types/contracts/governance/gaugeController/getConstants.d.ts +6 -4
  180. package/dist/types/contracts/governance/gaugeController/getCurrentEpoch.d.ts +6 -3
  181. package/dist/types/contracts/governance/gaugeController/getExpiredGaugeVotePower.d.ts +16 -0
  182. package/dist/types/contracts/governance/gaugeController/getGauge.d.ts +7 -4
  183. package/dist/types/contracts/governance/gaugeController/getGaugeDistributor.d.ts +12 -0
  184. package/dist/types/contracts/governance/gaugeController/getGaugeEmissions.d.ts +6 -3
  185. package/dist/types/contracts/governance/gaugeController/getGaugeRelativeWeight.d.ts +8 -9
  186. package/dist/types/contracts/governance/gaugeController/getGaugeRelativeWeightView.d.ts +8 -5
  187. package/dist/types/contracts/governance/gaugeController/getGaugeWeight.d.ts +6 -4
  188. package/dist/types/contracts/governance/gaugeController/getLastVoteTime.d.ts +7 -4
  189. package/dist/types/contracts/governance/gaugeController/getMaxVoteBuckets.d.ts +12 -0
  190. package/dist/types/contracts/governance/gaugeController/getNextEpoch.d.ts +6 -3
  191. package/dist/types/contracts/governance/gaugeController/getRegisteredGaugeList.d.ts +12 -0
  192. package/dist/types/contracts/governance/gaugeController/getTotalWeight.d.ts +5 -3
  193. package/dist/types/contracts/governance/gaugeController/getUserGaugeVotePower.d.ts +7 -4
  194. package/dist/types/contracts/governance/gaugeController/getUserVotePowerRemaining.d.ts +6 -4
  195. package/dist/types/contracts/governance/gaugeController/getVeToken.d.ts +6 -3
  196. package/dist/types/contracts/governance/gaugeController/getVoteUserLocks.d.ts +17 -0
  197. package/dist/types/contracts/governance/gaugeController/getVoteUserPower.d.ts +6 -3
  198. package/dist/types/contracts/governance/gaugeController/getVoteUserSlope.d.ts +8 -5
  199. package/dist/types/contracts/governance/gaugeController/index.d.ts +10 -1
  200. package/dist/types/contracts/governance/gaugeController/isGaugeActive.d.ts +6 -4
  201. package/dist/types/contracts/governance/gaugeController/isPaused.d.ts +6 -3
  202. package/dist/types/contracts/governance/gaugeController/kick.d.ts +7 -4
  203. package/dist/types/contracts/governance/gaugeController/removeGauge.d.ts +9 -5
  204. package/dist/types/contracts/governance/gaugeController/removePowerFromGauge.d.ts +8 -5
  205. package/dist/types/contracts/governance/gaugeController/setBoostAmplificationEnabled.d.ts +9 -6
  206. package/dist/types/contracts/governance/gaugeController/setDistributor.d.ts +13 -0
  207. package/dist/types/contracts/governance/gaugeController/setEmergencyGaugePause.d.ts +9 -6
  208. package/dist/types/contracts/governance/gaugeController/setEmergencyGaugePauseBatch.d.ts +14 -0
  209. package/dist/types/contracts/governance/gaugeController/setEmergencyPause.d.ts +8 -5
  210. package/dist/types/contracts/governance/gaugeController/setMaxVoteBuckets.d.ts +13 -0
  211. package/dist/types/contracts/governance/gaugeController/vote.d.ts +9 -7
  212. package/dist/types/contracts/governance/gaugeSystems/_helpers.d.ts +71 -0
  213. package/dist/types/contracts/governance/gaugeSystems/findGauge.d.ts +11 -0
  214. package/dist/types/contracts/governance/gaugeSystems/getGaugeSystem.d.ts +11 -0
  215. package/dist/types/contracts/governance/gaugeSystems/getGaugeSystems.d.ts +10 -0
  216. package/dist/types/contracts/governance/gaugeSystems/getGauges.d.ts +13 -0
  217. package/dist/types/contracts/governance/gaugeSystems/index.d.ts +5 -0
  218. package/dist/types/typechain-types/contracts/core/governance/gauges/BaseGauge.d.ts +176 -105
  219. package/dist/types/typechain-types/contracts/core/governance/gauges/GaugeController.d.ts +260 -213
  220. package/dist/types/typechain-types/contracts/core/governance/gauges/GaugeRewardsDistributor.d.ts +173 -212
  221. package/dist/types/typechain-types/contracts/core/governance/gauges/RAACGauge.d.ts +176 -105
  222. package/dist/types/typechain-types/contracts/core/governance/gauges/RWAGauge.d.ts +176 -105
  223. package/dist/types/typechain-types/contracts/interfaces/core/governance/gauges/IBaseGauge.d.ts +111 -108
  224. package/dist/types/typechain-types/contracts/interfaces/core/governance/gauges/IGaugeController.d.ts +210 -34
  225. package/dist/types/typechain-types/contracts/interfaces/core/governance/gauges/IGaugeRewardsDistributor.d.ts +112 -151
  226. package/dist/types/typechain-types/factories/contracts/core/governance/gauges/BaseGauge__factory.d.ts +174 -95
  227. package/dist/types/typechain-types/factories/contracts/core/governance/gauges/GaugeController__factory.d.ts +243 -227
  228. package/dist/types/typechain-types/factories/contracts/core/governance/gauges/GaugeRewardsDistributor__factory.d.ts +164 -232
  229. package/dist/types/typechain-types/factories/contracts/core/governance/gauges/RAACGauge__factory.d.ts +185 -98
  230. package/dist/types/typechain-types/factories/contracts/core/governance/gauges/RWAGauge__factory.d.ts +185 -98
  231. package/dist/types/typechain-types/factories/contracts/interfaces/core/governance/gauges/IBaseGauge__factory.d.ts +104 -95
  232. package/dist/types/typechain-types/factories/contracts/interfaces/core/governance/gauges/IGaugeController__factory.d.ts +241 -22
  233. package/dist/types/typechain-types/factories/contracts/interfaces/core/governance/gauges/IGaugeRewardsDistributor__factory.d.ts +72 -158
  234. package/dist/types/utils/artifacts.d.ts +40 -0
  235. package/dist/types/utils/contracts.d.ts +34 -44
  236. package/dist/utils/contracts.js +1 -1
  237. package/package.json +1 -1
  238. package/dist/contracts/governance/distributor/getStartEpoch.js +0 -28
  239. package/dist/contracts/governance/distributor/withdrawUnallocatedRewards.js +0 -26
  240. package/dist/contracts/governance/gauge/setDistributorApproval.js +0 -35
  241. package/dist/types/contracts/governance/distributor/getStartEpoch.d.ts +0 -10
  242. package/dist/types/contracts/governance/distributor/withdrawUnallocatedRewards.d.ts +0 -12
  243. package/dist/types/contracts/governance/gauge/setDistributorApproval.d.ts +0 -11
@@ -1,11 +1,13 @@
1
1
  import { Provider } from "ethers";
2
2
  import { ChainId } from "../../../configs/chains";
3
+ import { GaugeSystemRef } from "../gaugeSystems/_helpers";
3
4
  /**
4
- * Gets the amount of rewards currently claimable for a gauge.
5
+ * Estimates the rewards a gauge can still pull from the distributor.
5
6
  *
6
7
  * @param chainId - The chain/network to use.
7
- * @param gauge - Address of the gauge.
8
+ * @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
9
+ * @param gaugeAddressOrId - Address or config id of the gauge.
8
10
  * @param provider - Optional ethers.js Provider instance.
9
- * @returns Claimable reward amount (bigint).
11
+ * @returns The claimable amount, base units.
10
12
  */
11
- export declare const getClaimableForGauge: (chainId: ChainId, gauge: string, provider?: Provider) => Promise<bigint>;
13
+ export declare const getClaimableForGauge: (chainId: ChainId, gaugeSystem: GaugeSystemRef, gaugeAddressOrId: string, provider?: Provider) => Promise<bigint>;
@@ -1,12 +1,14 @@
1
1
  import { Provider } from "ethers";
2
2
  import { ChainId } from "../../../configs/chains";
3
+ import { GaugeSystemRef } from "../gaugeSystems/_helpers";
3
4
  /**
4
- * Gets the amount claimed by a gauge at a specific epoch.
5
+ * Returns how much a gauge has already pulled for an epoch.
5
6
  *
6
7
  * @param chainId - The chain/network to use.
7
- * @param gauge - Address of the gauge.
8
- * @param epoch - The epoch to query.
8
+ * @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
9
+ * @param gaugeAddressOrId - Address or config id of the gauge.
10
+ * @param epoch - Epoch start timestamp, seconds.
9
11
  * @param provider - Optional ethers.js Provider instance.
10
- * @returns Amount claimed at the epoch (bigint).
12
+ * @returns The claimed amount, base units.
11
13
  */
12
- export declare const getClaimedAtEpoch: (chainId: ChainId, gauge: string, epoch: string | number | bigint, provider?: Provider) => Promise<bigint>;
14
+ export declare const getClaimedAtEpoch: (chainId: ChainId, gaugeSystem: GaugeSystemRef, gaugeAddressOrId: string, epoch: string | number | bigint, provider?: Provider) => Promise<bigint>;
@@ -1,12 +1,14 @@
1
1
  import { Provider } from "ethers";
2
2
  import { ChainId } from "../../../configs/chains";
3
+ import { GaugeSystemRef } from "../gaugeSystems/_helpers";
3
4
  /**
4
- * Gets the amount of a token deposited at a specific epoch.
5
+ * Returns the rewards deposited into the distributor for an epoch.
5
6
  *
6
7
  * @param chainId - The chain/network to use.
8
+ * @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
7
9
  * @param token - Address of the reward token.
8
- * @param epoch - The epoch to query.
10
+ * @param epoch - Epoch start timestamp, seconds.
9
11
  * @param provider - Optional ethers.js Provider instance.
10
- * @returns Amount deposited at the epoch (bigint).
12
+ * @returns The deposited amount, base units.
11
13
  */
12
- export declare const getDepositedAtEpoch: (chainId: ChainId, token: string, epoch: string | number | bigint, provider?: Provider) => Promise<bigint>;
14
+ export declare const getDepositedAtEpoch: (chainId: ChainId, gaugeSystem: GaugeSystemRef, token: string, epoch: string | number | bigint, provider?: Provider) => Promise<bigint>;
@@ -0,0 +1,12 @@
1
+ import { Provider } from "ethers";
2
+ import { ChainId } from "../../../configs/chains";
3
+ import { GaugeSystemRef } from "../gaugeSystems/_helpers";
4
+ /**
5
+ * Returns the cursor of the last epoch swept by `withdrawDust`.
6
+ *
7
+ * @param chainId - The chain/network to use.
8
+ * @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
9
+ * @param provider - Optional ethers.js Provider instance.
10
+ * @returns The epoch timestamp, seconds.
11
+ */
12
+ export declare const getDustLastProcessedEpoch: (chainId: ChainId, gaugeSystem: GaugeSystemRef, provider?: Provider) => Promise<bigint>;
@@ -1,10 +1,12 @@
1
1
  import { Provider } from "ethers";
2
2
  import { ChainId } from "../../../configs/chains";
3
+ import { GaugeSystemRef } from "../gaugeSystems/_helpers";
3
4
  /**
4
- * Gets the gauge controller address used by the distributor.
5
+ * Returns the GaugeController the distributor reads weights from.
5
6
  *
6
7
  * @param chainId - The chain/network to use.
8
+ * @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
7
9
  * @param provider - Optional ethers.js Provider instance.
8
- * @returns Gauge controller address (string).
10
+ * @returns The controller address.
9
11
  */
10
- export declare const getGaugeController: (chainId: ChainId, provider?: Provider) => Promise<string>;
12
+ export declare const getGaugeController: (chainId: ChainId, gaugeSystem: GaugeSystemRef, provider?: Provider) => Promise<string>;
@@ -1,11 +1,13 @@
1
1
  import { Provider } from "ethers";
2
2
  import { ChainId } from "../../../configs/chains";
3
+ import { GaugeSystemRef } from "../gaugeSystems/_helpers";
3
4
  /**
4
- * Gets the last epoch claimed for a gauge.
5
+ * Returns the epoch a gauge's next claim starts walking from.
5
6
  *
6
7
  * @param chainId - The chain/network to use.
7
- * @param gauge - Address of the gauge.
8
+ * @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
9
+ * @param gaugeAddressOrId - Address or config id of the gauge.
8
10
  * @param provider - Optional ethers.js Provider instance.
9
- * @returns Last claimed epoch (bigint).
11
+ * @returns The epoch timestamp, seconds.
10
12
  */
11
- export declare const getLastClaimedEpoch: (chainId: ChainId, gauge: string, provider?: Provider) => Promise<bigint>;
13
+ export declare const getLastClaimedEpoch: (chainId: ChainId, gaugeSystem: GaugeSystemRef, gaugeAddressOrId: string, provider?: Provider) => Promise<bigint>;
@@ -0,0 +1,15 @@
1
+ import { Provider } from "ethers";
2
+ import { ChainId } from "../../../configs/chains";
3
+ import { GaugeSystemRef } from "../gaugeSystems/_helpers";
4
+ /**
5
+ * Reads whether claim walks are capped and the cap in epochs.
6
+ *
7
+ * @param chainId - The chain/network to use.
8
+ * @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
9
+ * @param provider - Optional ethers.js Provider instance.
10
+ * @returns enabled flag and maxEpochs.
11
+ */
12
+ export declare const getMaxClaimBound: (chainId: ChainId, gaugeSystem: GaugeSystemRef, provider?: Provider) => Promise<{
13
+ enabled: boolean;
14
+ maxEpochs: bigint;
15
+ }>;
@@ -1,10 +1,12 @@
1
1
  import { Provider } from "ethers";
2
2
  import { ChainId } from "../../../configs/chains";
3
+ import { GaugeSystemRef } from "../gaugeSystems/_helpers";
3
4
  /**
4
- * Gets the distributor's period (epoch) duration in seconds.
5
+ * Returns the distributor's period duration.
5
6
  *
6
7
  * @param chainId - The chain/network to use.
8
+ * @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
7
9
  * @param provider - Optional ethers.js Provider instance.
8
- * @returns Period duration in seconds (bigint).
10
+ * @returns The period duration, seconds.
9
11
  */
10
- export declare const getPeriodDuration: (chainId: ChainId, provider?: Provider) => Promise<bigint>;
12
+ export declare const getPeriodDuration: (chainId: ChainId, gaugeSystem: GaugeSystemRef, provider?: Provider) => Promise<bigint>;
@@ -1,10 +1,12 @@
1
1
  import { Provider } from "ethers";
2
2
  import { ChainId } from "../../../configs/chains";
3
+ import { GaugeSystemRef } from "../gaugeSystems/_helpers";
3
4
  /**
4
- * Gets the reward token address used by the distributor.
5
+ * Returns the single reward token the distributor pays out.
5
6
  *
6
7
  * @param chainId - The chain/network to use.
8
+ * @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
7
9
  * @param provider - Optional ethers.js Provider instance.
8
- * @returns Reward token address (string).
10
+ * @returns The reward token address.
9
11
  */
10
- export declare const getRewardToken: (chainId: ChainId, provider?: Provider) => Promise<string>;
12
+ export declare const getRewardToken: (chainId: ChainId, gaugeSystem: GaugeSystemRef, provider?: Provider) => Promise<string>;
@@ -1,13 +1,15 @@
1
1
  import { Provider } from "ethers";
2
2
  import { ChainId } from "../../../configs/chains";
3
+ import { GaugeSystemRef } from "../gaugeSystems/_helpers";
3
4
  /**
4
- * Gets aggregate statistics for the distributor's reward token.
5
+ * Reads the reward token totals and the distributor's current token balance.
5
6
  *
6
7
  * @param chainId - The chain/network to use.
8
+ * @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
7
9
  * @param provider - Optional ethers.js Provider instance.
8
- * @returns Object with totalDeposited, totalDistributed, totalClaimable and balance (all bigint).
10
+ * @returns totalDeposited, totalDistributed, totalClaimable and balance, base units.
9
11
  */
10
- export declare const getRewardTokenInfo: (chainId: ChainId, provider?: Provider) => Promise<{
12
+ export declare const getRewardTokenInfo: (chainId: ChainId, gaugeSystem: GaugeSystemRef, provider?: Provider) => Promise<{
11
13
  totalDeposited: bigint;
12
14
  totalDistributed: bigint;
13
15
  totalClaimable: bigint;
@@ -1,14 +1,16 @@
1
1
  import { Provider } from "ethers";
2
2
  import { ChainId } from "../../../configs/chains";
3
+ import { GaugeSystemRef } from "../gaugeSystems/_helpers";
3
4
  /**
4
- * Reads the rewardTokenInfo mapping entry for a given token.
5
+ * Reads the `rewardTokenInfo` mapping entry for a token.
5
6
  *
6
7
  * @param chainId - The chain/network to use.
8
+ * @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
7
9
  * @param token - Address of the reward token.
8
10
  * @param provider - Optional ethers.js Provider instance.
9
- * @returns Object with totalDeposited, totalDistributed and totalClaimable (all bigint).
11
+ * @returns totalDeposited, totalDistributed and totalClaimable, base units.
10
12
  */
11
- export declare const getRewardTokenStats: (chainId: ChainId, token: string, provider?: Provider) => Promise<{
13
+ export declare const getRewardTokenStats: (chainId: ChainId, gaugeSystem: GaugeSystemRef, token: string, provider?: Provider) => Promise<{
12
14
  totalDeposited: bigint;
13
15
  totalDistributed: bigint;
14
16
  totalClaimable: bigint;
@@ -4,13 +4,16 @@ export * from "./deposit";
4
4
  export * from "./getClaimableForGauge";
5
5
  export * from "./getClaimedAtEpoch";
6
6
  export * from "./getDepositedAtEpoch";
7
+ export * from "./getDustLastProcessedEpoch";
7
8
  export * from "./getGaugeController";
8
9
  export * from "./getLastClaimedEpoch";
10
+ export * from "./getMaxClaimBound";
9
11
  export * from "./getPeriodDuration";
10
12
  export * from "./getRewardToken";
11
13
  export * from "./getRewardTokenInfo";
12
14
  export * from "./getRewardTokenStats";
13
- export * from "./getStartEpoch";
14
15
  export * from "./setController";
16
+ export * from "./setLastClaimedEpoch";
17
+ export * from "./setMaxClaimBound";
18
+ export * from "./withdrawDust";
15
19
  export * from "./withdrawRemovedGaugeRewards";
16
- export * from "./withdrawUnallocatedRewards";
@@ -1,12 +1,13 @@
1
- import { Signer } from "ethers";
1
+ import { ethers, Signer } from "ethers";
2
2
  import { ChainId } from "../../../configs/chains";
3
+ import { GaugeSystemRef } from "../gaugeSystems/_helpers";
3
4
  /**
4
- * Sets the gauge controller for the distributor.
5
- * Requires DEFAULT_ADMIN_ROLE.
5
+ * Points the distributor at a different GaugeController. Requires DEFAULT_ADMIN_ROLE.
6
6
  *
7
7
  * @param chainId - The chain/network to use.
8
- * @param controller - Address of the new gauge controller.
8
+ * @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
9
+ * @param controller - Address of the new controller.
9
10
  * @param signer - An ethers.js Signer instance (required).
10
- * @returns Transaction after it has been mined.
11
+ * @returns The transaction after it has been mined.
11
12
  */
12
- export declare const setController: (chainId: ChainId, controller: string, signer: Signer) => Promise<any>;
13
+ export declare const setController: (chainId: ChainId, gaugeSystem: GaugeSystemRef, controller: string, signer: Signer) => Promise<ethers.ContractTransactionResponse>;
@@ -0,0 +1,13 @@
1
+ import { ethers, Signer } from "ethers";
2
+ import { ChainId } from "../../../configs/chains";
3
+ import { GaugeSystemRef } from "../gaugeSystems/_helpers";
4
+ /**
5
+ * Bootstraps a new gauge's claim checkpoint. Requires CONTROLLER_ROLE; the controller calls it from `addGauge`.
6
+ *
7
+ * @param chainId - The chain/network to use.
8
+ * @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
9
+ * @param gaugeAddressOrId - Address or config id of the gauge.
10
+ * @param signer - An ethers.js Signer instance (required).
11
+ * @returns The transaction after it has been mined.
12
+ */
13
+ export declare const setLastClaimedEpoch: (chainId: ChainId, gaugeSystem: GaugeSystemRef, gaugeAddressOrId: string, signer: Signer) => Promise<ethers.ContractTransactionResponse>;
@@ -0,0 +1,13 @@
1
+ import { ethers, Signer } from "ethers";
2
+ import { ChainId } from "../../../configs/chains";
3
+ import { GaugeSystemRef } from "../gaugeSystems/_helpers";
4
+ /**
5
+ * Caps how many epochs a claim walks per call (MAX_EPOCHS). Requires DISTRIBUTOR_ADMIN.
6
+ *
7
+ * @param chainId - The chain/network to use.
8
+ * @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
9
+ * @param enabled - True to cap claim walks.
10
+ * @param signer - An ethers.js Signer instance (required).
11
+ * @returns The transaction after it has been mined.
12
+ */
13
+ export declare const setMaxClaimBound: (chainId: ChainId, gaugeSystem: GaugeSystemRef, enabled: boolean, signer: Signer) => Promise<ethers.ContractTransactionResponse>;
@@ -0,0 +1,13 @@
1
+ import { ethers, Signer } from "ethers";
2
+ import { ChainId } from "../../../configs/chains";
3
+ import { GaugeSystemRef } from "../gaugeSystems/_helpers";
4
+ /**
5
+ * Sweeps leftover rewards from fully settled epochs to a recipient. Requires DEFAULT_ADMIN_ROLE. Reverts when there is nothing new to sweep.
6
+ *
7
+ * @param chainId - The chain/network to use.
8
+ * @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
9
+ * @param recipient - Address that receives the dust.
10
+ * @param signer - An ethers.js Signer instance (required).
11
+ * @returns The transaction after it has been mined.
12
+ */
13
+ export declare const withdrawDust: (chainId: ChainId, gaugeSystem: GaugeSystemRef, recipient: string, signer: Signer) => Promise<ethers.ContractTransactionResponse>;
@@ -1,13 +1,14 @@
1
- import { Signer } from "ethers";
1
+ import { ethers, Signer } from "ethers";
2
2
  import { ChainId } from "../../../configs/chains";
3
+ import { GaugeSystemRef } from "../gaugeSystems/_helpers";
3
4
  /**
4
- * Withdraws rewards belonging to a removed gauge to a recipient.
5
- * Requires DEFAULT_ADMIN_ROLE.
5
+ * Redirects a removed gauge's unclaimed entitlement to a recipient. Requires CONTROLLER_ROLE: the controller calls it from `removeGauge`, so admins normally use `governance.controller.removeGauge`.
6
6
  *
7
7
  * @param chainId - The chain/network to use.
8
- * @param gauge - Address of the removed gauge.
9
- * @param recipient - Address to receive the withdrawn rewards.
8
+ * @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeRewardsDistributor address.
9
+ * @param gaugeAddressOrId - Address or config id of the gauge.
10
+ * @param recipient - Address that receives the redirected rewards.
10
11
  * @param signer - An ethers.js Signer instance (required).
11
- * @returns Transaction after it has been mined.
12
+ * @returns The transaction after it has been mined.
12
13
  */
13
- export declare const withdrawRemovedGaugeRewards: (chainId: ChainId, gauge: string, recipient: string, signer: Signer) => Promise<any>;
14
+ export declare const withdrawRemovedGaugeRewards: (chainId: ChainId, gaugeSystem: GaugeSystemRef, gaugeAddressOrId: string, recipient: string, signer: Signer) => Promise<ethers.ContractTransactionResponse>;
@@ -0,0 +1,61 @@
1
+ import { Provider } from "ethers";
2
+ import { ChainId } from "../../../configs/chains";
3
+ import { BaseGauge, GaugeController } from "../../../typechain-types";
4
+ export declare const SECONDS_PER_YEAR: bigint;
5
+ /** Where the main reward token's yearly emission is read from. */
6
+ export type GaugeRewardSource = "stream" | "epoch";
7
+ export interface GaugeApyPrices {
8
+ /** USD price of one staking token. */
9
+ stakingTokenPriceUSD: number;
10
+ /** USD price of one reward token, keyed by token address in any case. Reward tokens without a price are reported but left out of every APY. */
11
+ rewardTokenPricesUSD: Record<string, number>;
12
+ }
13
+ export interface GaugeApyOptions {
14
+ /** "epoch" (default) annualizes the gauge's share of the last completed distributor epoch: what the gauge is entitled to per week, lagging one epoch. "stream" annualizes the rate the gauge is paying right now, which spikes when a pull lands late in a period or after a pause, and reads 0 once the period has ended without a new pull. Extra reward tokens always use their stream. */
15
+ rewardSource?: GaugeRewardSource;
16
+ }
17
+ export interface RewardTokenApy {
18
+ token: string;
19
+ /** "main" rewards are shared by working balance (boosted); "extra" rewards by raw balance (unboosted). */
20
+ kind: "main" | "extra";
21
+ /** Reward tokens paid per year at the current rate, formatted. */
22
+ yearlyRewards: string;
23
+ priceUSD: number | null;
24
+ yearlyRewardsUSD: number | null;
25
+ /** False when the stream has ended (period over) or, for "epoch", the last epoch paid nothing. */
26
+ active: boolean;
27
+ }
28
+ /** On-chain state shared by the gauge and user APY calculations. */
29
+ export interface GaugeApyState {
30
+ gauge: string;
31
+ gaugeContract: BaseGauge;
32
+ controller: GaugeController;
33
+ stakingToken: string;
34
+ stakingDecimals: number;
35
+ totalSupply: bigint;
36
+ workingSupply: bigint;
37
+ minBoost: bigint;
38
+ maxBoost: bigint;
39
+ rewardSource: GaugeRewardSource;
40
+ rewards: RewardTokenApy[];
41
+ /** Sum of priced main-token rewards per year, USD. */
42
+ mainYearlyUSD: number;
43
+ /** Sum of priced extra-token rewards per year, USD. */
44
+ extraYearlyUSD: number;
45
+ }
46
+ /** Annualized percentage: yearly USD over staked USD, or null when nothing is staked or the staking token has no price. */
47
+ export declare const toApyPct: (yearlyUSD: number, stakedUnits: number, stakingTokenPriceUSD: number) => number | null;
48
+ /**
49
+ * Loads the gauge state an APY calculation needs: supplies, boost bounds and each reward token's yearly emission.
50
+ *
51
+ * @param chainId - The chain/network to use.
52
+ * @param gaugeAddressOrId - Address of the gauge contract or its config ID.
53
+ * @param prices - USD prices for the staking token and reward tokens.
54
+ * @param options - Reward source selection.
55
+ * @param provider - Optional ethers.js Provider instance.
56
+ * @returns The loaded state.
57
+ */
58
+ export declare const loadGaugeApyState: (chainId: ChainId, gaugeAddressOrId: string, prices: GaugeApyPrices, options?: GaugeApyOptions, provider?: Provider) => Promise<GaugeApyState & {
59
+ provider: Provider;
60
+ now: bigint;
61
+ }>;
@@ -0,0 +1,14 @@
1
+ import { Provider, Signer } from "ethers";
2
+ export declare const ERC20_ABI: string[];
3
+ export declare const ERC4626_ABI: string[];
4
+ export interface GaugeTokens {
5
+ /** The token the gauge takes. For a wrapped gauge this is the ERC4626 wrapper, which is also the contract that wraps. */
6
+ stakingToken: string;
7
+ /** The token the wrapper wraps; null when the gauge takes its token directly. */
8
+ underlying: string | null;
9
+ }
10
+ /**
11
+ * Reads a gauge's staking token from the gauge and whether it wraps another token. A staking token counts as a wrapper
12
+ * when it exposes a non-zero `asset()` and a working `totalAssets()`, the same test the subgraph uses for its `wrapped` flag.
13
+ */
14
+ export declare const getGaugeTokens: (gaugeAddress: string, runner: Provider | Signer) => Promise<GaugeTokens>;
@@ -0,0 +1,14 @@
1
+ import { Signer } from "ethers";
2
+ import { ChainId } from "../../../configs/chains";
3
+ /**
4
+ * Approves the contract that pulls a gauge token: the staking token to the gauge, or for a wrapped gauge the underlying
5
+ * to the wrapper.
6
+ *
7
+ * @param chainId - The chain/network to use.
8
+ * @param gaugeAddressOrId - Address of the gauge contract or its config ID.
9
+ * @param token - "staking" to stake, "underlying" to wrap.
10
+ * @param amount - Allowance to set, base units.
11
+ * @param signer - An ethers.js Signer instance (required).
12
+ * @returns The mined transaction.
13
+ */
14
+ export declare const approveGaugeToken: (chainId: ChainId, gaugeAddressOrId: string, token: "staking" | "underlying", amount: bigint, signer: Signer) => Promise<any>;
@@ -1,7 +1,7 @@
1
1
  import { Signer } from "ethers";
2
2
  import configs from "../../../configs/chains";
3
3
  /**
4
- * Claims a specific reward token from a gauge.
4
+ * Claims the caller's main reward token from a gauge, pulling the gauge's share from its distributor first. Reverts while the gauge or its controller is paused.
5
5
  *
6
6
  * @param chainId - The chain/network to use.
7
7
  * @param gaugeAddressOrId - Address of the gauge contract or ID of the gauge.
@@ -0,0 +1,41 @@
1
+ import { Provider } from "ethers";
2
+ import { ChainId } from "../../../configs/chains";
3
+ import { GaugeApyOptions, GaugeApyPrices, GaugeRewardSource, RewardTokenApy } from "./_apy";
4
+ export type { GaugeApyOptions, GaugeApyPrices, GaugeRewardSource, RewardTokenApy } from "./_apy";
5
+ export interface GaugeApy {
6
+ gauge: string;
7
+ stakingToken: string;
8
+ rewardSource: GaugeRewardSource;
9
+ /** Raw staked tokens, formatted. */
10
+ totalStaked: string;
11
+ /** Sum of boosted working balances, formatted. Main rewards are shared over this. */
12
+ workingSupply: string;
13
+ tvlUSD: number;
14
+ /** Boost multiplier bounds, e.g. 1 and 2.5. */
15
+ minBoost: number;
16
+ maxBoost: number;
17
+ /** Main reward APY for a staker with no veRAAC boost, percent. */
18
+ minApy: number | null;
19
+ /** Main reward APY for a staker at max boost, percent. */
20
+ maxApy: number | null;
21
+ /** Extra reward APY, percent. Unboosted, so the same for every staker. */
22
+ extraApy: number | null;
23
+ /** minApy + extraApy. */
24
+ totalMinApy: number | null;
25
+ /** maxApy + extraApy. */
26
+ totalMaxApy: number | null;
27
+ rewards: RewardTokenApy[];
28
+ }
29
+ /**
30
+ * Calculates a gauge's minimum (no boost) and maximum (full boost) APY. Figures are simple annualized rates in percent, not compounded.
31
+ *
32
+ * Main rewards are shared by working balance, where a staker counts for `balance × boost / MAX_BOOST` (capped at balance). A fully boosted staker's working balance equals their stake, so maxApy = yearly main rewards USD / (workingSupply × staking price), and minApy = maxApy × MIN_BOOST / MAX_BOOST. Extra rewards are shared by raw balance over totalSupply. The figures hold workingSupply fixed, so a large new deposit, or other stakers boosting, lowers them. The "stream" source jumps whenever a pull compresses rewards into the rest of a period, e.g. after a pause.
33
+ *
34
+ * @param chainId - The chain/network to use.
35
+ * @param gaugeAddressOrId - Address of the gauge contract or its config ID.
36
+ * @param prices - USD price of the staking token and of each reward token (see `getRewardTokens`).
37
+ * @param options - Optional reward source: "epoch" (default) or "stream".
38
+ * @param provider - Optional ethers.js Provider instance.
39
+ * @returns Min, max and extra APY with the supplies and per-token yearly rewards behind them. An APY is null when nothing is staked.
40
+ */
41
+ export declare const getApy: (chainId: ChainId, gaugeAddressOrId: string, prices: GaugeApyPrices, options?: GaugeApyOptions, provider?: Provider) => Promise<GaugeApy>;
@@ -0,0 +1,13 @@
1
+ import { Provider } from "ethers";
2
+ import { ChainId } from "../../../configs/chains";
3
+ /**
4
+ * Gets the total amount of an extra reward token a user has already claimed from a gauge.
5
+ *
6
+ * @param chainId - The chain/network to use.
7
+ * @param gaugeAddressOrId - Address of the gauge contract or its config ID.
8
+ * @param token - Address of a registered extra reward token (see `getExtraRewardTokens`).
9
+ * @param userAddress - Address of the user.
10
+ * @param provider - Optional ethers.js Provider instance.
11
+ * @returns The claimed extra reward amount (raw, base units).
12
+ */
13
+ export declare const getEarnedExtraReward: (chainId: ChainId, gaugeAddressOrId: string, token: string, userAddress: string, provider?: Provider) => Promise<bigint>;
@@ -1,12 +1,13 @@
1
1
  import { Provider } from "ethers";
2
2
  import { ChainId } from "../../../configs/chains";
3
3
  /**
4
- * Gets the total amount of main-reward-token a user has already claimed from a gauge.
4
+ * Gets the total amount of a reward token a user has already claimed from a gauge.
5
5
  *
6
6
  * @param chainId - The chain/network to use.
7
7
  * @param gaugeAddressOrId - Address of the gauge contract or its config ID.
8
+ * @param token - Reward token address (see `getRewardTokens`).
8
9
  * @param userAddress - Address of the user.
9
10
  * @param provider - Optional ethers.js Provider instance.
10
11
  * @returns The claimed reward amount (raw, base units).
11
12
  */
12
- export declare const getEarnedReward: (chainId: ChainId, gaugeAddressOrId: string, userAddress: string, provider?: Provider) => Promise<bigint>;
13
+ export declare const getEarnedReward: (chainId: ChainId, gaugeAddressOrId: string, token: string, userAddress: string, provider?: Provider) => Promise<bigint>;
@@ -0,0 +1,23 @@
1
+ import { Provider } from "ethers";
2
+ import { ChainId } from "../../../configs/chains";
3
+ export interface GaugeData {
4
+ gaugeInitialStartTime: bigint;
5
+ /** Reward period length, seconds: 7 days for RAAC gauges, 28 days for RWA gauges. */
6
+ periodDuration: bigint;
7
+ periodIndex: bigint;
8
+ stakingToken: string;
9
+ totalSupply: bigint;
10
+ workingSupply: bigint;
11
+ rewardDistributor: string;
12
+ rewardToken: string;
13
+ lastUpdateTime: bigint;
14
+ }
15
+ /**
16
+ * Reads a gauge's `gaugeData` struct: its staking and reward tokens, distributor, supplies and period state.
17
+ *
18
+ * @param chainId - The chain/network to use.
19
+ * @param gaugeAddressOrId - Address of the gauge contract or its config ID.
20
+ * @param provider - Optional ethers.js Provider instance.
21
+ * @returns The gauge data.
22
+ */
23
+ export declare const getGaugeData: (chainId: ChainId, gaugeAddressOrId: string, provider?: Provider) => Promise<GaugeData>;
@@ -0,0 +1,19 @@
1
+ import { Provider } from "ethers";
2
+ import { ChainId } from "../../../configs/chains";
3
+ export interface GaugePauseStatus {
4
+ /** The gauge's own emergency pause switch. */
5
+ gaugePaused: boolean;
6
+ /** The global emergency pause of the controller the gauge reports to. */
7
+ controllerPaused: boolean;
8
+ /** True when neither pause is on, i.e. stake, claims and reward pulls are open. Withdraw is open either way. */
9
+ live: boolean;
10
+ }
11
+ /**
12
+ * Reads both pause switches that gate a gauge, mirroring the contract's `whenGaugeLive` check.
13
+ *
14
+ * @param chainId - The chain/network to use.
15
+ * @param gaugeAddressOrId - Address of the gauge contract or its config ID.
16
+ * @param provider - Optional ethers.js Provider instance.
17
+ * @returns The gauge's and its controller's pause flags, and whether the gauge is live.
18
+ */
19
+ export declare const getPauseStatus: (chainId: ChainId, gaugeAddressOrId: string, provider?: Provider) => Promise<GaugePauseStatus>;
@@ -1,12 +1,13 @@
1
1
  import { Provider } from "ethers";
2
2
  import { ChainId } from "../../../configs/chains";
3
3
  /**
4
- * Gets the pending (unclaimed) main-reward-token amount for a user on a gauge.
4
+ * Gets the rewards a user can claim from a gauge for one reward token. Only counts rewards already pulled into the gauge, which is everything a user can claim right now; `getUserClaimableRewards` adds the extra reward tokens.
5
5
  *
6
6
  * @param chainId - The chain/network to use.
7
7
  * @param gaugeAddressOrId - Address of the gauge contract or its config ID.
8
+ * @param token - The gauge's main reward token (`getGaugeData().rewardToken`). Any other token reverts with NotSupportedToken; use `getPendingExtraRewards` for extra reward tokens.
8
9
  * @param accountAddress - Address of the user.
9
10
  * @param provider - Optional ethers.js Provider instance.
10
11
  * @returns The pending reward amount (raw, base units).
11
12
  */
12
- export declare const getPendingRewards: (chainId: ChainId, gaugeAddressOrId: string, accountAddress: string, provider?: Provider) => Promise<bigint>;
13
+ export declare const getPendingRewards: (chainId: ChainId, gaugeAddressOrId: string, token: string, accountAddress: string, provider?: Provider) => Promise<bigint>;
@@ -0,0 +1,11 @@
1
+ import { Provider } from "ethers";
2
+ import { ChainId } from "../../../configs/chains";
3
+ /**
4
+ * Gets every reward token of a gauge: the main reward token first, then the extra reward tokens.
5
+ *
6
+ * @param chainId - The chain/network to use.
7
+ * @param gaugeAddressOrId - Address of the gauge contract or its config ID.
8
+ * @param provider - Optional ethers.js Provider instance.
9
+ * @returns The reward token addresses.
10
+ */
11
+ export declare const getRewardTokens: (chainId: ChainId, gaugeAddressOrId: string, provider?: Provider) => Promise<string[]>;
@@ -0,0 +1,44 @@
1
+ import { Provider } from "ethers";
2
+ import { ChainId } from "../../../configs/chains";
3
+ import { GaugeApyOptions, GaugeApyPrices } from "./_apy";
4
+ export interface UserApyPosition {
5
+ /** Raw stake, formatted. */
6
+ balance: string;
7
+ /** Boosted working balance, formatted. */
8
+ workingBalance: string;
9
+ /** Effective boost multiplier, between the controller's min and max (e.g. 1 to 2.5). Null with no stake. */
10
+ boost: number | null;
11
+ /** Main reward APY, percent. */
12
+ mainApy: number | null;
13
+ /** Extra reward APY, percent. */
14
+ extraApy: number | null;
15
+ /** mainApy + extraApy, percent. */
16
+ apy: number | null;
17
+ }
18
+ export interface UserGaugeApy {
19
+ gauge: string;
20
+ user: string;
21
+ /** What the user earns now, from the working balance stored at their last checkpoint. */
22
+ current: UserApyPosition;
23
+ /** What the user would earn once their working balance is re-checkpointed (stake, withdraw, claim or `updateUserRewards`) with their current veRAAC, after adding `additionalStake`. */
24
+ projected: UserApyPosition;
25
+ /** The gauge's min and max main reward APY for comparison, percent. */
26
+ gaugeMinApy: number | null;
27
+ gaugeMaxApy: number | null;
28
+ }
29
+ /**
30
+ * Calculates a user's APY on a gauge: what they earn now, and what they would earn after their boost is re-checkpointed, optionally with extra stake. Figures are simple annualized rates in percent, not compounded.
31
+ *
32
+ * The user's share of main rewards is workingBalance / workingSupply; extra rewards are shared by raw balance. The stored working balance only changes when the user's position is checkpointed, so `current` can lag their veRAAC: `projected` recomputes it with the controller's `calculateBoost` and adjusts workingSupply and totalSupply for the change, holding every other staker fixed.
33
+ *
34
+ * @param chainId - The chain/network to use.
35
+ * @param gaugeAddressOrId - Address of the gauge contract or its config ID.
36
+ * @param user - Address of the user.
37
+ * @param prices - USD price of the staking token and of each reward token (see `getRewardTokens`).
38
+ * @param options - Optional reward source ("epoch" default, or "stream") and `additionalStake`, a staking token amount in base units to add in the projection.
39
+ * @param provider - Optional ethers.js Provider instance.
40
+ * @returns The user's current and projected position and APY, with the gauge's min and max APY. An APY is null when the position has no stake.
41
+ */
42
+ export declare const getUserApy: (chainId: ChainId, gaugeAddressOrId: string, user: string, prices: GaugeApyPrices, options?: GaugeApyOptions & {
43
+ additionalStake?: string | number | bigint;
44
+ }, provider?: Provider) => Promise<UserGaugeApy>;