@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.
- package/dist/RPCLibrary.js +2 -0
- package/dist/artifacts/core/governance/gauges/BaseGauge.sol/BaseGauge.json +113 -20
- package/dist/artifacts/core/governance/gauges/GaugeController.sol/GaugeController.json +259 -31
- package/dist/artifacts/core/governance/gauges/GaugeRewardsDistributor.sol/GaugeRewardsDistributor.json +159 -31
- package/dist/artifacts/core/governance/gauges/RAACGauge.sol/RAACGauge.json +115 -22
- package/dist/artifacts/core/governance/gauges/RWAGauge.sol/RWAGauge.json +115 -22
- package/dist/configs/chains/1.json +22 -25
- package/dist/configs/chains/11155111.json +56 -71
- package/dist/configs/chains/17000.json +22 -25
- package/dist/configs/chains/18453.json +22 -25
- package/dist/configs/chains/8453.json +61 -31
- package/dist/contracts/findContract.js +11 -4
- package/dist/contracts/getContractAddress.js +0 -1
- package/dist/contracts/governance/distributor/claimAll.js +18 -11
- package/dist/contracts/governance/distributor/claimForGauge.js +18 -12
- package/dist/contracts/governance/distributor/deposit.js +17 -12
- package/dist/contracts/governance/distributor/getClaimableForGauge.js +10 -9
- package/dist/contracts/governance/distributor/getClaimedAtEpoch.js +11 -10
- package/dist/contracts/governance/distributor/getDepositedAtEpoch.js +8 -8
- package/dist/contracts/governance/distributor/getDustLastProcessedEpoch.js +28 -0
- package/dist/contracts/governance/distributor/getGaugeController.js +7 -7
- package/dist/contracts/governance/distributor/getLastClaimedEpoch.js +10 -9
- package/dist/contracts/governance/distributor/getMaxClaimBound.js +29 -0
- package/dist/contracts/governance/distributor/getPeriodDuration.js +7 -7
- package/dist/contracts/governance/distributor/getRewardToken.js +7 -7
- package/dist/contracts/governance/distributor/getRewardTokenInfo.js +7 -7
- package/dist/contracts/governance/distributor/getRewardTokenStats.js +7 -7
- package/dist/contracts/governance/distributor/index.js +5 -2
- package/dist/contracts/governance/distributor/setController.js +17 -12
- package/dist/contracts/governance/distributor/setLastClaimedEpoch.js +32 -0
- package/dist/contracts/governance/distributor/setMaxClaimBound.js +31 -0
- package/dist/contracts/governance/distributor/withdrawDust.js +31 -0
- package/dist/contracts/governance/distributor/withdrawRemovedGaugeRewards.js +19 -13
- package/dist/contracts/governance/gauge/_apy.js +122 -0
- package/dist/contracts/governance/gauge/_tokens.js +36 -0
- package/dist/contracts/governance/gauge/addRewardToken.js +2 -12
- package/dist/contracts/governance/gauge/approveGaugeToken.js +31 -0
- package/dist/contracts/governance/gauge/claimExtraReward.js +2 -12
- package/dist/contracts/governance/gauge/claimExtraRewards.js +2 -12
- package/dist/contracts/governance/gauge/claimOnBehalfOf.js +2 -12
- package/dist/contracts/governance/gauge/claimRewardToken.js +3 -13
- package/dist/contracts/governance/gauge/claimRewardsFor.js +2 -12
- package/dist/contracts/governance/gauge/depositRewardToken.js +2 -12
- package/dist/contracts/governance/gauge/getAllPendingExtraRewards.js +2 -9
- package/dist/contracts/governance/gauge/getApy.js +44 -0
- package/dist/contracts/governance/gauge/getBalanceOf.js +2 -15
- package/dist/contracts/governance/gauge/getControllerAddress.js +2 -9
- package/dist/contracts/governance/gauge/getDecimalAdjustment.js +2 -9
- package/dist/contracts/governance/gauge/getDepositRAACOnClaim.js +2 -9
- package/dist/contracts/governance/gauge/getDistributorData.js +2 -9
- package/dist/contracts/governance/gauge/getDistributors.js +2 -9
- package/dist/contracts/governance/gauge/getEarnedExtraReward.js +30 -0
- package/dist/contracts/governance/gauge/getEarnedReward.js +8 -14
- package/dist/contracts/governance/gauge/getExtraRewardTokens.js +2 -9
- package/dist/contracts/governance/gauge/getGaugeData.js +39 -0
- package/dist/contracts/governance/gauge/getGaugeRewardTokenData.js +2 -9
- package/dist/contracts/governance/gauge/getPauseStatus.js +31 -0
- package/dist/contracts/governance/gauge/getPendingExtraRewards.js +2 -9
- package/dist/contracts/governance/gauge/getPendingRewards.js +8 -14
- package/dist/contracts/governance/gauge/getPeriodBoundaries.js +2 -15
- package/dist/contracts/governance/gauge/getPeriodDuration.js +2 -15
- package/dist/contracts/governance/gauge/getRaacAutolockMin.js +2 -9
- package/dist/contracts/governance/gauge/getRawBalanceOf.js +2 -15
- package/dist/contracts/governance/gauge/getRawTotalSupply.js +2 -15
- package/dist/contracts/governance/gauge/getRewardTokens.js +28 -0
- package/dist/contracts/governance/gauge/getTotalSupply.js +2 -15
- package/dist/contracts/governance/gauge/getUserApy.js +71 -0
- package/dist/contracts/governance/gauge/getUserClaimableRewards.js +21 -73
- package/dist/contracts/governance/gauge/getUserGaugeState.js +44 -0
- package/dist/contracts/governance/gauge/getUserRewardTokenData.js +2 -9
- package/dist/contracts/governance/gauge/getUserWeight.js +2 -9
- package/dist/contracts/governance/gauge/index.js +11 -1
- package/dist/contracts/governance/gauge/isPaused.js +4 -11
- package/dist/contracts/governance/gauge/manageDistributor.js +2 -12
- package/dist/contracts/governance/gauge/pullRewardsFromDistributor.js +30 -0
- package/dist/contracts/governance/gauge/setController.js +2 -12
- package/dist/contracts/governance/gauge/setDepositRAACOnClaim.js +2 -12
- package/dist/contracts/governance/gauge/setEmergencyPaused.js +2 -12
- package/dist/contracts/governance/gauge/setGaugeRewardDistributor.js +2 -12
- package/dist/contracts/governance/gauge/setRaacAutolockMin.js +2 -12
- package/dist/contracts/governance/gauge/stake.js +2 -18
- package/dist/contracts/governance/gauge/unwrapStakingToken.js +28 -0
- package/dist/contracts/governance/gauge/updateUserRewards.js +2 -18
- package/dist/contracts/governance/gauge/withdraw.js +2 -18
- package/dist/contracts/governance/gauge/wrapStakingToken.js +28 -0
- package/dist/contracts/governance/gaugeController/addGauge.js +19 -11
- package/dist/contracts/governance/gaugeController/batchVote.js +20 -12
- package/dist/contracts/governance/gaugeController/calculateBoost.js +20 -23
- package/dist/contracts/governance/gaugeController/forceCompleteCheckpoint.js +19 -11
- package/dist/contracts/governance/gaugeController/getActiveGaugeCount.js +28 -0
- package/dist/contracts/governance/gaugeController/getActiveGauges.js +10 -13
- package/dist/contracts/governance/gaugeController/getConstants.js +10 -18
- package/dist/contracts/governance/gaugeController/getCurrentEpoch.js +8 -7
- package/dist/contracts/governance/gaugeController/getExpiredGaugeVotePower.js +30 -0
- package/dist/contracts/governance/gaugeController/getGauge.js +11 -9
- package/dist/contracts/governance/gaugeController/getGaugeDistributor.js +28 -0
- package/dist/contracts/governance/gaugeController/getGaugeEmissions.js +15 -9
- package/dist/contracts/governance/gaugeController/getGaugeRelativeWeight.js +19 -15
- package/dist/contracts/governance/gaugeController/getGaugeRelativeWeightView.js +12 -10
- package/dist/contracts/governance/gaugeController/getGaugeWeight.js +10 -8
- package/dist/contracts/governance/gaugeController/getLastVoteTime.js +11 -9
- package/dist/contracts/governance/gaugeController/getMaxVoteBuckets.js +28 -0
- package/dist/contracts/governance/gaugeController/getNextEpoch.js +8 -7
- package/dist/contracts/governance/gaugeController/getRegisteredGaugeList.js +28 -0
- package/dist/contracts/governance/gaugeController/getTotalWeight.js +8 -7
- package/dist/contracts/governance/gaugeController/getUserGaugeVotePower.js +11 -9
- package/dist/contracts/governance/gaugeController/getUserVotePowerRemaining.js +10 -9
- package/dist/contracts/governance/gaugeController/getVeToken.js +8 -7
- package/dist/contracts/governance/gaugeController/getVoteUserLocks.js +32 -0
- package/dist/contracts/governance/gaugeController/getVoteUserPower.js +8 -7
- package/dist/contracts/governance/gaugeController/getVoteUserSlope.js +12 -10
- package/dist/contracts/governance/gaugeController/index.js +10 -1
- package/dist/contracts/governance/gaugeController/isGaugeActive.js +11 -9
- package/dist/contracts/governance/gaugeController/isPaused.js +9 -8
- package/dist/contracts/governance/gaugeController/kick.js +17 -10
- package/dist/contracts/governance/gaugeController/removeGauge.js +20 -11
- package/dist/contracts/governance/gaugeController/removePowerFromGauge.js +19 -11
- package/dist/contracts/governance/gaugeController/setBoostAmplificationEnabled.js +20 -12
- package/dist/contracts/governance/gaugeController/setDistributor.js +31 -0
- package/dist/contracts/governance/gaugeController/setEmergencyGaugePause.js +20 -12
- package/dist/contracts/governance/gaugeController/setEmergencyGaugePauseBatch.js +33 -0
- package/dist/contracts/governance/gaugeController/setEmergencyPause.js +18 -11
- package/dist/contracts/governance/gaugeController/setMaxVoteBuckets.js +31 -0
- package/dist/contracts/governance/gaugeController/vote.js +15 -16
- package/dist/contracts/governance/gaugeSystems/_helpers.js +123 -0
- package/dist/contracts/governance/gaugeSystems/findGauge.js +14 -0
- package/dist/contracts/governance/gaugeSystems/getGaugeSystem.js +14 -0
- package/dist/contracts/governance/gaugeSystems/getGaugeSystems.js +13 -0
- package/dist/contracts/governance/gaugeSystems/getGauges.js +15 -0
- package/dist/contracts/governance/gaugeSystems/index.js +21 -0
- package/dist/types/RPCLibrary.d.ts +2 -0
- package/dist/types/configs/chains/index.d.ts +36 -46
- package/dist/types/configs/index.d.ts +18 -23
- package/dist/types/contracts/governance/distributor/claimAll.d.ts +7 -5
- package/dist/types/contracts/governance/distributor/claimForGauge.d.ts +7 -6
- package/dist/types/contracts/governance/distributor/deposit.d.ts +7 -6
- package/dist/types/contracts/governance/distributor/getClaimableForGauge.d.ts +6 -4
- package/dist/types/contracts/governance/distributor/getClaimedAtEpoch.d.ts +7 -5
- package/dist/types/contracts/governance/distributor/getDepositedAtEpoch.d.ts +6 -4
- package/dist/types/contracts/governance/distributor/getDustLastProcessedEpoch.d.ts +12 -0
- package/dist/types/contracts/governance/distributor/getGaugeController.d.ts +5 -3
- package/dist/types/contracts/governance/distributor/getLastClaimedEpoch.d.ts +6 -4
- package/dist/types/contracts/governance/distributor/getMaxClaimBound.d.ts +15 -0
- package/dist/types/contracts/governance/distributor/getPeriodDuration.d.ts +5 -3
- package/dist/types/contracts/governance/distributor/getRewardToken.d.ts +5 -3
- package/dist/types/contracts/governance/distributor/getRewardTokenInfo.d.ts +5 -3
- package/dist/types/contracts/governance/distributor/getRewardTokenStats.d.ts +5 -3
- package/dist/types/contracts/governance/distributor/index.d.ts +5 -2
- package/dist/types/contracts/governance/distributor/setController.d.ts +7 -6
- package/dist/types/contracts/governance/distributor/setLastClaimedEpoch.d.ts +13 -0
- package/dist/types/contracts/governance/distributor/setMaxClaimBound.d.ts +13 -0
- package/dist/types/contracts/governance/distributor/withdrawDust.d.ts +13 -0
- package/dist/types/contracts/governance/distributor/withdrawRemovedGaugeRewards.d.ts +8 -7
- package/dist/types/contracts/governance/gauge/_apy.d.ts +61 -0
- package/dist/types/contracts/governance/gauge/_tokens.d.ts +14 -0
- package/dist/types/contracts/governance/gauge/approveGaugeToken.d.ts +14 -0
- package/dist/types/contracts/governance/gauge/claimRewardToken.d.ts +1 -1
- package/dist/types/contracts/governance/gauge/getApy.d.ts +41 -0
- package/dist/types/contracts/governance/gauge/getEarnedExtraReward.d.ts +13 -0
- package/dist/types/contracts/governance/gauge/getEarnedReward.d.ts +3 -2
- package/dist/types/contracts/governance/gauge/getGaugeData.d.ts +23 -0
- package/dist/types/contracts/governance/gauge/getPauseStatus.d.ts +19 -0
- package/dist/types/contracts/governance/gauge/getPendingRewards.d.ts +3 -2
- package/dist/types/contracts/governance/gauge/getRewardTokens.d.ts +11 -0
- package/dist/types/contracts/governance/gauge/getUserApy.d.ts +44 -0
- package/dist/types/contracts/governance/gauge/getUserClaimableRewards.d.ts +14 -12
- package/dist/types/contracts/governance/gauge/getUserGaugeState.d.ts +31 -0
- package/dist/types/contracts/governance/gauge/index.d.ts +11 -1
- package/dist/types/contracts/governance/gauge/isPaused.d.ts +1 -1
- package/dist/types/contracts/governance/gauge/pullRewardsFromDistributor.d.ts +11 -0
- package/dist/types/contracts/governance/gauge/unwrapStakingToken.d.ts +12 -0
- package/dist/types/contracts/governance/gauge/wrapStakingToken.d.ts +13 -0
- package/dist/types/contracts/governance/gaugeController/addGauge.d.ts +8 -5
- package/dist/types/contracts/governance/gaugeController/batchVote.d.ts +9 -6
- package/dist/types/contracts/governance/gaugeController/calculateBoost.d.ts +10 -8
- package/dist/types/contracts/governance/gaugeController/forceCompleteCheckpoint.d.ts +8 -5
- package/dist/types/contracts/governance/gaugeController/getActiveGaugeCount.d.ts +12 -0
- package/dist/types/contracts/governance/gaugeController/getActiveGauges.d.ts +7 -3
- package/dist/types/contracts/governance/gaugeController/getConstants.d.ts +6 -4
- package/dist/types/contracts/governance/gaugeController/getCurrentEpoch.d.ts +6 -3
- package/dist/types/contracts/governance/gaugeController/getExpiredGaugeVotePower.d.ts +16 -0
- package/dist/types/contracts/governance/gaugeController/getGauge.d.ts +7 -4
- package/dist/types/contracts/governance/gaugeController/getGaugeDistributor.d.ts +12 -0
- package/dist/types/contracts/governance/gaugeController/getGaugeEmissions.d.ts +6 -3
- package/dist/types/contracts/governance/gaugeController/getGaugeRelativeWeight.d.ts +8 -9
- package/dist/types/contracts/governance/gaugeController/getGaugeRelativeWeightView.d.ts +8 -5
- package/dist/types/contracts/governance/gaugeController/getGaugeWeight.d.ts +6 -4
- package/dist/types/contracts/governance/gaugeController/getLastVoteTime.d.ts +7 -4
- package/dist/types/contracts/governance/gaugeController/getMaxVoteBuckets.d.ts +12 -0
- package/dist/types/contracts/governance/gaugeController/getNextEpoch.d.ts +6 -3
- package/dist/types/contracts/governance/gaugeController/getRegisteredGaugeList.d.ts +12 -0
- package/dist/types/contracts/governance/gaugeController/getTotalWeight.d.ts +5 -3
- package/dist/types/contracts/governance/gaugeController/getUserGaugeVotePower.d.ts +7 -4
- package/dist/types/contracts/governance/gaugeController/getUserVotePowerRemaining.d.ts +6 -4
- package/dist/types/contracts/governance/gaugeController/getVeToken.d.ts +6 -3
- package/dist/types/contracts/governance/gaugeController/getVoteUserLocks.d.ts +17 -0
- package/dist/types/contracts/governance/gaugeController/getVoteUserPower.d.ts +6 -3
- package/dist/types/contracts/governance/gaugeController/getVoteUserSlope.d.ts +8 -5
- package/dist/types/contracts/governance/gaugeController/index.d.ts +10 -1
- package/dist/types/contracts/governance/gaugeController/isGaugeActive.d.ts +6 -4
- package/dist/types/contracts/governance/gaugeController/isPaused.d.ts +6 -3
- package/dist/types/contracts/governance/gaugeController/kick.d.ts +7 -4
- package/dist/types/contracts/governance/gaugeController/removeGauge.d.ts +9 -5
- package/dist/types/contracts/governance/gaugeController/removePowerFromGauge.d.ts +8 -5
- package/dist/types/contracts/governance/gaugeController/setBoostAmplificationEnabled.d.ts +9 -6
- package/dist/types/contracts/governance/gaugeController/setDistributor.d.ts +13 -0
- package/dist/types/contracts/governance/gaugeController/setEmergencyGaugePause.d.ts +9 -6
- package/dist/types/contracts/governance/gaugeController/setEmergencyGaugePauseBatch.d.ts +14 -0
- package/dist/types/contracts/governance/gaugeController/setEmergencyPause.d.ts +8 -5
- package/dist/types/contracts/governance/gaugeController/setMaxVoteBuckets.d.ts +13 -0
- package/dist/types/contracts/governance/gaugeController/vote.d.ts +9 -7
- package/dist/types/contracts/governance/gaugeSystems/_helpers.d.ts +71 -0
- package/dist/types/contracts/governance/gaugeSystems/findGauge.d.ts +11 -0
- package/dist/types/contracts/governance/gaugeSystems/getGaugeSystem.d.ts +11 -0
- package/dist/types/contracts/governance/gaugeSystems/getGaugeSystems.d.ts +10 -0
- package/dist/types/contracts/governance/gaugeSystems/getGauges.d.ts +13 -0
- package/dist/types/contracts/governance/gaugeSystems/index.d.ts +5 -0
- package/dist/types/typechain-types/contracts/core/governance/gauges/BaseGauge.d.ts +176 -105
- package/dist/types/typechain-types/contracts/core/governance/gauges/GaugeController.d.ts +260 -213
- package/dist/types/typechain-types/contracts/core/governance/gauges/GaugeRewardsDistributor.d.ts +173 -212
- package/dist/types/typechain-types/contracts/core/governance/gauges/RAACGauge.d.ts +176 -105
- package/dist/types/typechain-types/contracts/core/governance/gauges/RWAGauge.d.ts +176 -105
- package/dist/types/typechain-types/contracts/interfaces/core/governance/gauges/IBaseGauge.d.ts +111 -108
- package/dist/types/typechain-types/contracts/interfaces/core/governance/gauges/IGaugeController.d.ts +210 -34
- package/dist/types/typechain-types/contracts/interfaces/core/governance/gauges/IGaugeRewardsDistributor.d.ts +112 -151
- package/dist/types/typechain-types/factories/contracts/core/governance/gauges/BaseGauge__factory.d.ts +174 -95
- package/dist/types/typechain-types/factories/contracts/core/governance/gauges/GaugeController__factory.d.ts +243 -227
- package/dist/types/typechain-types/factories/contracts/core/governance/gauges/GaugeRewardsDistributor__factory.d.ts +164 -232
- package/dist/types/typechain-types/factories/contracts/core/governance/gauges/RAACGauge__factory.d.ts +185 -98
- package/dist/types/typechain-types/factories/contracts/core/governance/gauges/RWAGauge__factory.d.ts +185 -98
- package/dist/types/typechain-types/factories/contracts/interfaces/core/governance/gauges/IBaseGauge__factory.d.ts +104 -95
- package/dist/types/typechain-types/factories/contracts/interfaces/core/governance/gauges/IGaugeController__factory.d.ts +241 -22
- package/dist/types/typechain-types/factories/contracts/interfaces/core/governance/gauges/IGaugeRewardsDistributor__factory.d.ts +72 -158
- package/dist/types/utils/artifacts.d.ts +40 -0
- package/dist/types/utils/contracts.d.ts +34 -44
- package/dist/utils/contracts.js +1 -1
- package/package.json +1 -1
- package/dist/contracts/governance/distributor/getStartEpoch.js +0 -28
- package/dist/contracts/governance/distributor/withdrawUnallocatedRewards.js +0 -26
- package/dist/contracts/governance/gauge/setDistributorApproval.js +0 -35
- package/dist/types/contracts/governance/distributor/getStartEpoch.d.ts +0 -10
- package/dist/types/contracts/governance/distributor/withdrawUnallocatedRewards.d.ts +0 -12
- package/dist/types/contracts/governance/gauge/setDistributorApproval.d.ts +0 -11
|
@@ -11,26 +11,28 @@ export interface ClaimableExtraReward {
|
|
|
11
11
|
}
|
|
12
12
|
export interface UserClaimableRewards {
|
|
13
13
|
gauge: string;
|
|
14
|
-
/**
|
|
14
|
+
/** The gauge's main reward token. */
|
|
15
|
+
rewardToken: string;
|
|
16
|
+
/** The distributor the gauge pulls its main reward from, read from the gauge. */
|
|
17
|
+
distributor: string;
|
|
18
|
+
/** Main reward already accrued to the user inside the gauge (gauge.pendingRewards), base units. */
|
|
15
19
|
inGauge: bigint;
|
|
16
|
-
/**
|
|
17
|
-
* (deposited but not yet pulled in via a claim). */
|
|
18
|
-
inDistributor: bigint;
|
|
19
|
-
/** Total claimable RAAC = inGauge + inDistributor, base units. */
|
|
20
|
+
/** Main reward the user can claim right now, base units. Same as `inGauge`. */
|
|
20
21
|
raac: bigint;
|
|
21
|
-
/**
|
|
22
|
+
/** `raac` formatted to the reward token's decimals. */
|
|
22
23
|
raacFormatted: string;
|
|
23
24
|
/** Extra reward tokens claimable by the user. */
|
|
24
25
|
extras: ClaimableExtraReward[];
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
27
|
-
*
|
|
28
|
+
* What a user can claim from a gauge right now: the main reward already accrued to them inside the gauge, plus any
|
|
29
|
+
* extra reward tokens.
|
|
28
30
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
31
|
+
* Rewards still held by the GaugeRewardsDistributor are not included. They are not the user's yet: a pull
|
|
32
|
+
* (`pullRewardsFromDistributor`, or the pull every claim makes first) streams them to everyone staked over the rest of
|
|
33
|
+
* the reward period, so any per-user share of them would change with every stake, unstake and pull. Read the gauge's
|
|
34
|
+
* total still in the distributor with `governance.distributor.getClaimableForGauge` when it is needed.
|
|
35
|
+
* The distributor is read from the gauge itself, so RAAC and RWA gauges both resolve to their own system's distributor.
|
|
34
36
|
*
|
|
35
37
|
* @param chainId - The chain/network to use.
|
|
36
38
|
* @param gaugeAddressOrId - Address of the gauge contract or its config ID.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
export interface UserGaugeTokenState {
|
|
4
|
+
address: string;
|
|
5
|
+
symbol: string;
|
|
6
|
+
decimals: number;
|
|
7
|
+
/** Wallet balance, base units. */
|
|
8
|
+
balance: bigint;
|
|
9
|
+
/** Allowance to `spender`, base units. */
|
|
10
|
+
allowance: bigint;
|
|
11
|
+
/** The contract that pulls the token: the gauge for the staking token, the wrapper for the underlying. */
|
|
12
|
+
spender: string;
|
|
13
|
+
}
|
|
14
|
+
export interface UserGaugeState {
|
|
15
|
+
gauge: string;
|
|
16
|
+
/** Staking token staked in the gauge, base units, without boost. */
|
|
17
|
+
staked: bigint;
|
|
18
|
+
stakingToken: UserGaugeTokenState;
|
|
19
|
+
/** The token to wrap before staking; null when the gauge takes its token directly. */
|
|
20
|
+
underlying: UserGaugeTokenState | null;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* What a wallet needs to stake in, wrap for, or unstake from a gauge: its stake, its balance of the staking token and its
|
|
24
|
+
* allowance to the gauge, and for a wrapped gauge its balance of the underlying and allowance to the wrapper.
|
|
25
|
+
*
|
|
26
|
+
* @param chainId - The chain/network to use.
|
|
27
|
+
* @param gaugeAddressOrId - Address of the gauge contract or its config ID.
|
|
28
|
+
* @param user - The wallet.
|
|
29
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
30
|
+
*/
|
|
31
|
+
export declare const getUserGaugeState: (chainId: ChainId, gaugeAddressOrId: string, user: string, provider?: Provider) => Promise<UserGaugeState>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./addRewardToken";
|
|
2
|
+
export * from "./approveGaugeToken";
|
|
2
3
|
export * from "./claimExtraReward";
|
|
3
4
|
export * from "./claimExtraRewards";
|
|
4
5
|
export * from "./claimOnBehalfOf";
|
|
@@ -6,15 +7,19 @@ export * from "./claimRewardsFor";
|
|
|
6
7
|
export * from "./claimRewardToken";
|
|
7
8
|
export * from "./depositRewardToken";
|
|
8
9
|
export * from "./getAllPendingExtraRewards";
|
|
10
|
+
export * from "./getApy";
|
|
9
11
|
export * from "./getBalanceOf";
|
|
10
12
|
export * from "./getControllerAddress";
|
|
11
13
|
export * from "./getDecimalAdjustment";
|
|
12
14
|
export * from "./getDepositRAACOnClaim";
|
|
13
15
|
export * from "./getDistributorData";
|
|
14
16
|
export * from "./getDistributors";
|
|
17
|
+
export * from "./getEarnedExtraReward";
|
|
15
18
|
export * from "./getEarnedReward";
|
|
16
19
|
export * from "./getExtraRewardTokens";
|
|
20
|
+
export * from "./getGaugeData";
|
|
17
21
|
export * from "./getGaugeRewardTokenData";
|
|
22
|
+
export * from "./getPauseStatus";
|
|
18
23
|
export * from "./getPendingExtraRewards";
|
|
19
24
|
export * from "./getPendingRewards";
|
|
20
25
|
export * from "./getPeriodBoundaries";
|
|
@@ -22,18 +27,23 @@ export * from "./getPeriodDuration";
|
|
|
22
27
|
export * from "./getRaacAutolockMin";
|
|
23
28
|
export * from "./getRawBalanceOf";
|
|
24
29
|
export * from "./getRawTotalSupply";
|
|
30
|
+
export * from "./getRewardTokens";
|
|
25
31
|
export * from "./getTotalSupply";
|
|
32
|
+
export * from "./getUserApy";
|
|
26
33
|
export * from "./getUserClaimableRewards";
|
|
34
|
+
export * from "./getUserGaugeState";
|
|
27
35
|
export * from "./getUserRewardTokenData";
|
|
28
36
|
export * from "./getUserWeight";
|
|
29
37
|
export * from "./isPaused";
|
|
30
38
|
export * from "./manageDistributor";
|
|
39
|
+
export * from "./pullRewardsFromDistributor";
|
|
31
40
|
export * from "./setController";
|
|
32
41
|
export * from "./setDepositRAACOnClaim";
|
|
33
|
-
export * from "./setDistributorApproval";
|
|
34
42
|
export * from "./setEmergencyPaused";
|
|
35
43
|
export * from "./setGaugeRewardDistributor";
|
|
36
44
|
export * from "./setRaacAutolockMin";
|
|
37
45
|
export * from "./stake";
|
|
46
|
+
export * from "./unwrapStakingToken";
|
|
38
47
|
export * from "./updateUserRewards";
|
|
39
48
|
export * from "./withdraw";
|
|
49
|
+
export * from "./wrapStakingToken";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Provider } from "ethers";
|
|
2
2
|
import { ChainId } from "../../../configs/chains";
|
|
3
3
|
/**
|
|
4
|
-
* Returns
|
|
4
|
+
* Returns the gauge's own emergency pause switch. Does not reflect the controller's global pause; use `getPauseStatus` for both.
|
|
5
5
|
* @param chainId - The chain/network to use.
|
|
6
6
|
* @param gaugeAddressOrId - Address of the gauge contract or its config ID.
|
|
7
7
|
* @param provider - Optional ethers.js Provider instance.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ethers, Signer } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Pulls a gauge's accrued share from its rewards distributor into the gauge's reward rate. Callable by anyone. Reverts while the gauge or its controller is paused; the share stays in the distributor and the first pull after the pause walks every missed epoch.
|
|
5
|
+
*
|
|
6
|
+
* @param chainId - The chain/network to use.
|
|
7
|
+
* @param gaugeAddressOrId - Address of the gauge contract or its config ID.
|
|
8
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
9
|
+
* @returns The transaction after it has been mined.
|
|
10
|
+
*/
|
|
11
|
+
export declare const pullRewardsFromDistributor: (chainId: ChainId, gaugeAddressOrId: string, signer: Signer) => Promise<ethers.ContractTransactionResponse>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Unwraps a wrapped gauge's staking token back into its underlying (ERC4626 `redeem`), sending it to the signer.
|
|
5
|
+
*
|
|
6
|
+
* @param chainId - The chain/network to use.
|
|
7
|
+
* @param gaugeAddressOrId - Address of the gauge contract or its config ID.
|
|
8
|
+
* @param shares - Staking token to unwrap, base units.
|
|
9
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
10
|
+
* @returns The mined transaction.
|
|
11
|
+
*/
|
|
12
|
+
export declare const unwrapStakingToken: (chainId: ChainId, gaugeAddressOrId: string, shares: bigint, signer: Signer) => Promise<any>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Wraps the underlying of a wrapped gauge into its staking token (ERC4626 `deposit`), minting the shares to the signer.
|
|
5
|
+
* The underlying must be approved to the wrapper first, see `approveGaugeToken`.
|
|
6
|
+
*
|
|
7
|
+
* @param chainId - The chain/network to use.
|
|
8
|
+
* @param gaugeAddressOrId - Address of the gauge contract or its config ID.
|
|
9
|
+
* @param assets - Underlying to wrap, base units.
|
|
10
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
11
|
+
* @returns The mined transaction.
|
|
12
|
+
*/
|
|
13
|
+
export declare const wrapStakingToken: (chainId: ChainId, gaugeAddressOrId: string, assets: bigint, signer: Signer) => Promise<any>;
|
|
@@ -1,10 +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
|
-
*
|
|
5
|
+
* Registers a gauge on the controller. Requires GAUGE_ADMIN. The gauge must belong to this system (RAACGauge on the RAAC controller, RWAGauge on the RWA controller).
|
|
6
|
+
*
|
|
5
7
|
* @param chainId - The chain/network to use.
|
|
6
|
-
* @param
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
9
|
+
* @param gaugeAddressOrId - Address or config id of the gauge.
|
|
7
10
|
* @param signer - An ethers.js Signer instance (required).
|
|
8
|
-
* @returns The transaction
|
|
11
|
+
* @returns The transaction after it has been mined.
|
|
9
12
|
*/
|
|
10
|
-
export declare const addGauge: (chainId: ChainId,
|
|
13
|
+
export declare const addGauge: (chainId: ChainId, gaugeSystem: GaugeSystemRef, gaugeAddressOrId: string, signer: Signer) => Promise<ethers.ContractTransactionResponse>;
|
|
@@ -1,11 +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
|
-
*
|
|
5
|
+
* Votes on several gauges in one transaction.
|
|
6
|
+
*
|
|
5
7
|
* @param chainId - The chain/network to use.
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
9
|
+
* @param gaugeAddressesOrIds - Addresses or config ids of the gauges.
|
|
10
|
+
* @param voteWeights - Vote weight per gauge in basis points, index-aligned with the gauges.
|
|
8
11
|
* @param signer - An ethers.js Signer instance (required).
|
|
9
|
-
* @returns The transaction
|
|
12
|
+
* @returns The transaction after it has been mined.
|
|
10
13
|
*/
|
|
11
|
-
export declare const batchVote: (chainId: ChainId,
|
|
14
|
+
export declare const batchVote: (chainId: ChainId, gaugeSystem: GaugeSystemRef, gaugeAddressesOrIds: string[], voteWeights: (string | number | bigint)[], signer: Signer) => Promise<ethers.ContractTransactionResponse>;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { Provider } from "ethers";
|
|
2
|
-
import
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
import { GaugeSystemRef } from "../gaugeSystems/_helpers";
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Calculates the reward boost a user would get on a gauge for a staked amount.
|
|
5
6
|
*
|
|
6
7
|
* @param chainId - The chain/network to use.
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
9
|
+
* @param user - Address of the user.
|
|
10
|
+
* @param gaugeAddressOrId - Address or config id of the gauge.
|
|
11
|
+
* @param amount - Staked amount, base units.
|
|
12
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
13
|
+
* @returns The boost in basis points and the boosted amount.
|
|
12
14
|
*/
|
|
13
|
-
export declare const calculateBoost: (chainId:
|
|
15
|
+
export declare const calculateBoost: (chainId: ChainId, gaugeSystem: GaugeSystemRef, user: string, gaugeAddressOrId: string, amount: string | number | bigint, provider?: Provider) => Promise<{
|
|
14
16
|
boostBasisPoints: bigint;
|
|
15
17
|
boostedAmount: bigint;
|
|
16
18
|
}>;
|
|
@@ -1,10 +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
|
-
*
|
|
5
|
+
* Completes a gauge's pending weight checkpoint.
|
|
6
|
+
*
|
|
5
7
|
* @param chainId - The chain/network to use.
|
|
6
|
-
* @param
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
9
|
+
* @param gaugeAddressOrId - Address or config id of the gauge.
|
|
7
10
|
* @param signer - An ethers.js Signer instance (required).
|
|
8
|
-
* @returns The transaction
|
|
11
|
+
* @returns The transaction after it has been mined.
|
|
9
12
|
*/
|
|
10
|
-
export declare const forceCompleteCheckpoint: (chainId: ChainId,
|
|
13
|
+
export declare const forceCompleteCheckpoint: (chainId: ChainId, gaugeSystem: GaugeSystemRef, gaugeAddressOrId: string, signer: Signer) => Promise<ethers.ContractTransactionResponse>;
|
|
@@ -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 number of registered gauges on the controller. Emergency-paused gauges are counted.
|
|
6
|
+
*
|
|
7
|
+
* @param chainId - The chain/network to use.
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
9
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
10
|
+
* @returns The registered gauge count.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getActiveGaugeCount: (chainId: ChainId, gaugeSystem: GaugeSystemRef, provider?: Provider) => Promise<bigint>;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { Provider } from "ethers";
|
|
2
2
|
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
import { GaugeSystemRef } from "../gaugeSystems/_helpers";
|
|
3
4
|
export interface ActiveGaugesInfo {
|
|
4
5
|
gauges: string[];
|
|
6
|
+
/** Weight per gauge at the current epoch, formatted in ether units, index-aligned with `gauges`. */
|
|
5
7
|
weights: string[];
|
|
8
|
+
/** Sum of all gauge weights, formatted in ether units. */
|
|
6
9
|
totalWeight: string;
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
9
|
-
* Gets the active gauges and their weights.
|
|
12
|
+
* Gets the active gauges on a controller and their weights at the current epoch.
|
|
10
13
|
*
|
|
11
14
|
* @param chainId - The chain/network to use.
|
|
15
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
12
16
|
* @param provider - Optional ethers.js Provider instance.
|
|
13
|
-
* @returns Active gauges, their weights
|
|
17
|
+
* @returns Active gauges, their weights and the total weight.
|
|
14
18
|
*/
|
|
15
|
-
export declare const getActiveGauges: (chainId: ChainId, provider?: Provider) => Promise<ActiveGaugesInfo>;
|
|
19
|
+
export declare const getActiveGauges: (chainId: ChainId, gaugeSystem: GaugeSystemRef, provider?: Provider) => Promise<ActiveGaugesInfo>;
|
|
@@ -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
|
-
* Reads the
|
|
5
|
+
* Reads the constant configuration values from a GaugeController.
|
|
6
|
+
*
|
|
5
7
|
* @param chainId - The chain/network to use.
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
6
9
|
* @param provider - Optional ethers.js Provider instance.
|
|
7
|
-
* @returns
|
|
8
|
-
* minVoteWeight and maxVoteWeight, all bigint.
|
|
10
|
+
* @returns maxBoost, minBoost, weightPrecision, week, weightVoteDelay, minVoteWeight and maxVoteWeight.
|
|
9
11
|
*/
|
|
10
|
-
export declare const getConstants: (chainId: ChainId, provider?: Provider) => Promise<{
|
|
12
|
+
export declare const getConstants: (chainId: ChainId, gaugeSystem: GaugeSystemRef, provider?: Provider) => Promise<{
|
|
11
13
|
maxBoost: bigint;
|
|
12
14
|
minBoost: bigint;
|
|
13
15
|
weightPrecision: bigint;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Provider } from "ethers";
|
|
2
2
|
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
import { GaugeSystemRef } from "../gaugeSystems/_helpers";
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Returns the start timestamp of the controller's current epoch.
|
|
6
|
+
*
|
|
5
7
|
* @param chainId - The chain/network to use.
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
6
9
|
* @param provider - Optional ethers.js Provider instance.
|
|
7
|
-
* @returns
|
|
10
|
+
* @returns The current epoch timestamp, seconds.
|
|
8
11
|
*/
|
|
9
|
-
export declare const getCurrentEpoch: (chainId: ChainId, provider?: Provider) => Promise<bigint>;
|
|
12
|
+
export declare const getCurrentEpoch: (chainId: ChainId, gaugeSystem: GaugeSystemRef, provider?: Provider) => Promise<bigint>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
import { GaugeSystemRef } from "../gaugeSystems/_helpers";
|
|
4
|
+
/**
|
|
5
|
+
* Returns the vote power a user still has assigned to gauges whose votes no longer count, because every lock backing the vote has decayed out by the next epoch. Free it by re-voting those gauges.
|
|
6
|
+
*
|
|
7
|
+
* @param chainId - The chain/network to use.
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
9
|
+
* @param user - Address of the voter.
|
|
10
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
11
|
+
* @returns The stale vote weight in basis points and the gauges it sits on.
|
|
12
|
+
*/
|
|
13
|
+
export declare const getExpiredGaugeVotePower: (chainId: ChainId, gaugeSystem: GaugeSystemRef, user: string, provider?: Provider) => Promise<{
|
|
14
|
+
expiredGaugePower: bigint;
|
|
15
|
+
gauges: string[];
|
|
16
|
+
}>;
|
|
@@ -1,13 +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
|
|
5
|
+
* Reads a gauge's entry from the controller's public `gauges` mapping.
|
|
6
|
+
*
|
|
5
7
|
* @param chainId - The chain/network to use.
|
|
6
|
-
* @param
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
9
|
+
* @param gaugeAddressOrId - Address or config id of the gauge.
|
|
7
10
|
* @param provider - Optional ethers.js Provider instance.
|
|
8
|
-
* @returns
|
|
11
|
+
* @returns isActive and isBoostAmplificationEnabled flags, weight and lastUpdateTime.
|
|
9
12
|
*/
|
|
10
|
-
export declare const getGauge: (chainId: ChainId,
|
|
13
|
+
export declare const getGauge: (chainId: ChainId, gaugeSystem: GaugeSystemRef, gaugeAddressOrId: string, provider?: Provider) => Promise<{
|
|
11
14
|
isActive: boolean;
|
|
12
15
|
isBoostAmplificationEnabled: boolean;
|
|
13
16
|
weight: 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 GaugeRewardsDistributor wired to the controller.
|
|
6
|
+
*
|
|
7
|
+
* @param chainId - The chain/network to use.
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
9
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
10
|
+
* @returns The distributor address.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getGaugeDistributor: (chainId: ChainId, gaugeSystem: GaugeSystemRef, provider?: Provider) => Promise<string>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Provider } from "ethers";
|
|
2
2
|
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
import { GaugeSystemId } from "../../../configs/chains/chain";
|
|
3
4
|
export interface GaugeEpochEmission {
|
|
4
5
|
/** Epoch (Unix-week) start timestamp, seconds. */
|
|
5
6
|
epoch: number;
|
|
@@ -57,8 +58,10 @@ export interface GaugeEmissionsResult {
|
|
|
57
58
|
* where scheduledWeekEmission = minter.calculateScheduledMintableAmount(week) × distributorShare.
|
|
58
59
|
*
|
|
59
60
|
* @param chainId - The chain/network to use.
|
|
60
|
-
* @param
|
|
61
|
-
* @param
|
|
61
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges").
|
|
62
|
+
* @param gaugeAddressOrId - Address or config id of the gauge.
|
|
63
|
+
* @param numEpochs - How many epochs to include, ending at the current one (default 8), clamped to the gauge's start.
|
|
64
|
+
* @param includeUpcoming - Whether to append a projection for the next epoch (default true).
|
|
62
65
|
* @param provider - Optional ethers.js Provider instance.
|
|
63
66
|
*/
|
|
64
|
-
export declare const getGaugeEmissions: (chainId: ChainId,
|
|
67
|
+
export declare const getGaugeEmissions: (chainId: ChainId, gaugeSystem: GaugeSystemId, gaugeAddressOrId: string, numEpochs?: number, includeUpcoming?: boolean, provider?: Provider) => Promise<GaugeEmissionsResult>;
|
|
@@ -1,15 +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
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* This is a state-modifying call (it writes checkpoints), so it requires a Signer.
|
|
7
|
-
* For a pure read with no state changes, use getGaugeRelativeWeightView instead.
|
|
5
|
+
* Checkpoints a gauge and computes its relative weight at an epoch. State-changing; use `getGaugeRelativeWeightView` to read without a transaction. Reverts during a global pause.
|
|
8
6
|
*
|
|
9
7
|
* @param chainId - The chain/network to use.
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
9
|
+
* @param gaugeAddressOrId - Address or config id of the gauge.
|
|
10
|
+
* @param epoch - Epoch start timestamp, seconds.
|
|
12
11
|
* @param signer - An ethers.js Signer instance (required).
|
|
13
|
-
* @returns The transaction
|
|
12
|
+
* @returns The transaction after it has been mined.
|
|
14
13
|
*/
|
|
15
|
-
export declare const getGaugeRelativeWeight: (chainId: ChainId,
|
|
14
|
+
export declare const getGaugeRelativeWeight: (chainId: ChainId, gaugeSystem: GaugeSystemRef, gaugeAddressOrId: string, epoch: string | number | bigint, signer: Signer) => Promise<ethers.ContractTransactionResponse>;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { Provider } from "ethers";
|
|
2
2
|
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
import { GaugeSystemRef } from "../gaugeSystems/_helpers";
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Returns a gauge's relative weight at an epoch without checkpointing.
|
|
6
|
+
*
|
|
5
7
|
* @param chainId - The chain/network to use.
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
9
|
+
* @param gaugeAddressOrId - Address or config id of the gauge.
|
|
10
|
+
* @param epoch - Epoch start timestamp, seconds.
|
|
8
11
|
* @param provider - Optional ethers.js Provider instance.
|
|
9
|
-
* @returns
|
|
12
|
+
* @returns relativeWeight (1e18 = 100%) and the total weight at that epoch.
|
|
10
13
|
*/
|
|
11
|
-
export declare const getGaugeRelativeWeightView: (chainId: ChainId,
|
|
14
|
+
export declare const getGaugeRelativeWeightView: (chainId: ChainId, gaugeSystem: GaugeSystemRef, gaugeAddressOrId: string, epoch: string | number | bigint, provider?: Provider) => Promise<{
|
|
12
15
|
relativeWeight: bigint;
|
|
13
16
|
totalWeight: bigint;
|
|
14
17
|
}>;
|
|
@@ -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
|
-
*
|
|
5
|
+
* Returns a gauge's weight at the current epoch.
|
|
5
6
|
*
|
|
6
7
|
* @param chainId - The chain/network to use.
|
|
7
|
-
* @param
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
9
|
+
* @param gaugeAddressOrId - Address or config id of the gauge.
|
|
8
10
|
* @param provider - Optional ethers.js Provider instance.
|
|
9
|
-
* @returns
|
|
11
|
+
* @returns The weight formatted in ether units.
|
|
10
12
|
*/
|
|
11
|
-
export declare const getGaugeWeight: (chainId: ChainId,
|
|
13
|
+
export declare const getGaugeWeight: (chainId: ChainId, gaugeSystem: GaugeSystemRef, gaugeAddressOrId: string, provider?: Provider) => Promise<string>;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { Provider } from "ethers";
|
|
2
2
|
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
import { GaugeSystemRef } from "../gaugeSystems/_helpers";
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Returns when a user last voted on a gauge.
|
|
6
|
+
*
|
|
5
7
|
* @param chainId - The chain/network to use.
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
6
9
|
* @param user - Address of the user.
|
|
7
|
-
* @param
|
|
10
|
+
* @param gaugeAddressOrId - Address or config id of the gauge.
|
|
8
11
|
* @param provider - Optional ethers.js Provider instance.
|
|
9
|
-
* @returns The last vote timestamp
|
|
12
|
+
* @returns The last vote timestamp, seconds.
|
|
10
13
|
*/
|
|
11
|
-
export declare const getLastVoteTime: (chainId: ChainId, user: string,
|
|
14
|
+
export declare const getLastVoteTime: (chainId: ChainId, gaugeSystem: GaugeSystemRef, user: string, gaugeAddressOrId: string, 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 per-vote decay-bucket cap. 0 means exact (one entry per lock).
|
|
6
|
+
*
|
|
7
|
+
* @param chainId - The chain/network to use.
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
9
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
10
|
+
* @returns The bucket cap.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getMaxVoteBuckets: (chainId: ChainId, gaugeSystem: GaugeSystemRef, provider?: Provider) => Promise<bigint>;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Provider } from "ethers";
|
|
2
2
|
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
import { GaugeSystemRef } from "../gaugeSystems/_helpers";
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Returns the start timestamp of the controller's next epoch. Votes cast now take effect at this epoch.
|
|
6
|
+
*
|
|
5
7
|
* @param chainId - The chain/network to use.
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
6
9
|
* @param provider - Optional ethers.js Provider instance.
|
|
7
|
-
* @returns
|
|
10
|
+
* @returns The next epoch timestamp, seconds.
|
|
8
11
|
*/
|
|
9
|
-
export declare const getNextEpoch: (chainId: ChainId, provider?: Provider) => Promise<bigint>;
|
|
12
|
+
export declare const getNextEpoch: (chainId: ChainId, gaugeSystem: GaugeSystemRef, 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 every gauge registered on the controller, from `addGauge` until `removeGauge`, emergency-paused ones included.
|
|
6
|
+
*
|
|
7
|
+
* @param chainId - The chain/network to use.
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
9
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
10
|
+
* @returns The registered gauge addresses.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getRegisteredGaugeList: (chainId: ChainId, gaugeSystem: GaugeSystemRef, provider?: Provider) => Promise<string[]>;
|
|
@@ -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
|
-
*
|
|
5
|
+
* Returns the sum of all gauge weights at the current epoch.
|
|
5
6
|
*
|
|
6
7
|
* @param chainId - The chain/network to use.
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
7
9
|
* @param provider - Optional ethers.js Provider instance.
|
|
8
|
-
* @returns
|
|
10
|
+
* @returns The total weight formatted in ether units.
|
|
9
11
|
*/
|
|
10
|
-
export declare const getTotalWeight: (chainId: ChainId, provider?: Provider) => Promise<string>;
|
|
12
|
+
export declare const getTotalWeight: (chainId: ChainId, gaugeSystem: GaugeSystemRef, provider?: Provider) => Promise<string>;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { Provider } from "ethers";
|
|
2
2
|
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
import { GaugeSystemRef } from "../gaugeSystems/_helpers";
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Returns the vote power a user has allocated to a gauge.
|
|
6
|
+
*
|
|
5
7
|
* @param chainId - The chain/network to use.
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
6
9
|
* @param user - Address of the user.
|
|
7
|
-
* @param
|
|
10
|
+
* @param gaugeAddressOrId - Address or config id of the gauge.
|
|
8
11
|
* @param provider - Optional ethers.js Provider instance.
|
|
9
|
-
* @returns
|
|
12
|
+
* @returns The allocated vote power.
|
|
10
13
|
*/
|
|
11
|
-
export declare const getUserGaugeVotePower: (chainId: ChainId, user: string,
|
|
14
|
+
export declare const getUserGaugeVotePower: (chainId: ChainId, gaugeSystem: GaugeSystemRef, user: string, gaugeAddressOrId: string, provider?: Provider) => Promise<bigint>;
|
|
@@ -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
|
-
*
|
|
5
|
+
* Returns the vote weight a user has not yet allocated, in basis points.
|
|
5
6
|
*
|
|
6
7
|
* @param chainId - The chain/network to use.
|
|
7
|
-
* @param
|
|
8
|
+
* @param gaugeSystem - Gauge system id ("raacgauges" or "rwagauges") or a GaugeController address.
|
|
9
|
+
* @param user - Address of the user.
|
|
8
10
|
* @param provider - Optional ethers.js Provider instance.
|
|
9
|
-
* @returns
|
|
11
|
+
* @returns The remaining vote weight.
|
|
10
12
|
*/
|
|
11
|
-
export declare const getUserVotePowerRemaining: (chainId: ChainId,
|
|
13
|
+
export declare const getUserVotePowerRemaining: (chainId: ChainId, gaugeSystem: GaugeSystemRef, user: string, provider?: Provider) => Promise<number>;
|