@raac/rpc 1.2.0-beta.5 → 1.2.0-beta.6
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 +38 -97
- package/dist/artifacts/core/collectors/FeeCollector.sol/FeeCollector.json +2 -2
- package/dist/artifacts/core/governance/gauges/BaseGauge.sol/BaseGauge.json +155 -144
- package/dist/artifacts/core/governance/gauges/GaugeController.sol/GaugeController.json +119 -335
- package/dist/artifacts/core/governance/gauges/GaugeRewardsDistributor.sol/GaugeRewardsDistributor.json +104 -325
- package/dist/artifacts/core/governance/gauges/RAACGauge.sol/RAACGauge.json +167 -146
- package/dist/artifacts/core/governance/gauges/RWAGauge.sol/RWAGauge.json +167 -146
- package/dist/artifacts/core/governance/proposals/Governance.sol/Governance.json +2 -2
- package/dist/artifacts/core/lockers/RAACLiquidLocker.sol/RAACLiquidLocker.json +2 -2
- package/dist/artifacts/core/tokens/veRAACToken.sol/veRAACToken.json +66 -32
- package/dist/configs/chains/11155111.json +72 -16
- package/dist/configs/chains/8453.json +6 -6
- package/dist/contracts/getContractAddress.js +1 -0
- package/dist/contracts/governance/distributor/claimAll.js +25 -0
- package/dist/contracts/governance/distributor/claimForGauge.js +26 -0
- package/dist/contracts/governance/distributor/deposit.js +12 -21
- package/dist/contracts/governance/distributor/getClaimableForGauge.js +29 -0
- package/dist/contracts/governance/distributor/getClaimedAtEpoch.js +30 -0
- package/dist/contracts/governance/distributor/getDepositedAtEpoch.js +30 -0
- package/dist/contracts/governance/distributor/getGaugeController.js +28 -0
- package/dist/contracts/governance/distributor/getLastClaimedEpoch.js +29 -0
- package/dist/contracts/governance/distributor/getPeriodDuration.js +28 -0
- package/dist/contracts/governance/distributor/{getRewardTokens.js → getRewardToken.js} +10 -9
- package/dist/contracts/governance/distributor/getRewardTokenInfo.js +9 -19
- package/dist/contracts/governance/distributor/getRewardTokenStats.js +30 -0
- package/dist/contracts/governance/{gaugeController/isGauge.js → distributor/getStartEpoch.js} +10 -10
- package/dist/contracts/governance/distributor/index.js +31 -17
- package/dist/contracts/governance/distributor/setController.js +26 -0
- package/dist/contracts/governance/distributor/withdrawRemovedGaugeRewards.js +27 -0
- package/dist/contracts/governance/distributor/withdrawUnallocatedRewards.js +26 -0
- package/dist/contracts/governance/gauge/addRewardToken.js +34 -0
- package/dist/contracts/governance/gauge/claimExtraReward.js +34 -0
- package/dist/contracts/governance/gauge/claimExtraRewards.js +33 -0
- package/dist/contracts/governance/gauge/claimOnBehalfOf.js +36 -0
- package/dist/contracts/governance/gauge/claimRewardToken.js +3 -4
- package/dist/contracts/governance/gauge/claimRewardsFor.js +34 -0
- package/dist/contracts/governance/gauge/depositRewardToken.js +35 -0
- package/dist/contracts/governance/gauge/getAllPendingExtraRewards.js +36 -0
- package/dist/contracts/governance/gauge/getControllerAddress.js +34 -0
- package/dist/contracts/governance/gauge/getDecimalAdjustment.js +35 -0
- package/dist/contracts/governance/gauge/getDepositRAACOnClaim.js +34 -0
- package/dist/contracts/governance/gauge/getDistributorData.js +36 -0
- package/dist/contracts/governance/gauge/getDistributors.js +34 -0
- package/dist/contracts/governance/gauge/getEarnedReward.js +11 -19
- package/dist/contracts/governance/gauge/getExtraRewardTokens.js +34 -0
- package/dist/contracts/governance/gauge/getGaugeRewardTokenData.js +44 -0
- package/dist/contracts/governance/gauge/getPendingExtraRewards.js +36 -0
- package/dist/contracts/governance/gauge/getPendingRewards.js +11 -19
- package/dist/contracts/governance/gauge/getRaacAutolockMin.js +34 -0
- package/dist/contracts/governance/gauge/getUserRewardTokenData.js +37 -0
- package/dist/contracts/governance/gauge/getUserWeight.js +35 -0
- package/dist/contracts/governance/gauge/index.js +53 -35
- package/dist/contracts/governance/gauge/isPaused.js +34 -0
- package/dist/contracts/governance/gauge/manageDistributor.js +35 -0
- package/dist/contracts/governance/gauge/setController.js +34 -0
- package/dist/contracts/governance/gauge/setDepositRAACOnClaim.js +34 -0
- package/dist/contracts/governance/gauge/setDistributorApproval.js +35 -0
- package/dist/contracts/governance/gauge/setEmergencyPaused.js +34 -0
- package/dist/contracts/governance/gauge/setGaugeRewardDistributor.js +34 -0
- package/dist/contracts/governance/gauge/setRaacAutolockMin.js +34 -0
- package/dist/contracts/governance/gauge/updateUserRewards.js +3 -2
- package/dist/contracts/governance/gaugeController/addGauge.js +24 -0
- package/dist/contracts/governance/gaugeController/batchVote.js +25 -0
- package/dist/contracts/governance/gaugeController/forceCompleteCheckpoint.js +24 -0
- package/dist/contracts/governance/gaugeController/getConstants.js +45 -0
- package/dist/contracts/governance/gaugeController/getCurrentEpoch.js +27 -0
- package/dist/contracts/governance/gaugeController/getGauge.js +29 -0
- package/dist/contracts/governance/gaugeController/getGaugeRelativeWeight.js +29 -0
- package/dist/contracts/governance/gaugeController/getGaugeRelativeWeightView.js +30 -0
- package/dist/contracts/governance/gaugeController/getLastVoteTime.js +29 -0
- package/dist/contracts/governance/gaugeController/getNextEpoch.js +27 -0
- package/dist/contracts/governance/gaugeController/getUserGaugeVotePower.js +29 -0
- package/dist/contracts/governance/gaugeController/getVeToken.js +27 -0
- package/dist/contracts/governance/gaugeController/getVoteUserPower.js +28 -0
- package/dist/contracts/governance/gaugeController/getVoteUserSlope.js +30 -0
- package/dist/contracts/governance/gaugeController/index.js +43 -23
- package/dist/contracts/governance/gaugeController/isPaused.js +27 -0
- package/dist/contracts/governance/gaugeController/kick.js +24 -0
- package/dist/contracts/governance/gaugeController/removeGauge.js +24 -0
- package/dist/contracts/governance/gaugeController/removePowerFromGauge.js +24 -0
- package/dist/contracts/governance/gaugeController/setBoostAmplificationEnabled.js +25 -0
- package/dist/contracts/governance/gaugeController/setEmergencyGaugePause.js +25 -0
- package/dist/contracts/governance/gaugeController/setEmergencyPause.js +24 -0
- package/dist/contracts/lockers/botLocker/unlock.js +4 -1
- package/dist/contracts/lockers/maturityVault/harvest.js +3 -2
- package/dist/types/RPCLibrary.d.ts +6 -64
- package/dist/types/contracts/governance/distributor/claimAll.d.ts +11 -0
- package/dist/types/contracts/governance/distributor/claimForGauge.d.ts +12 -0
- package/dist/types/contracts/governance/distributor/deposit.d.ts +6 -7
- package/dist/types/contracts/governance/distributor/getClaimableForGauge.d.ts +11 -0
- package/dist/types/contracts/governance/distributor/getClaimedAtEpoch.d.ts +12 -0
- package/dist/types/contracts/governance/distributor/getDepositedAtEpoch.d.ts +12 -0
- package/dist/types/contracts/governance/distributor/getGaugeController.d.ts +10 -0
- package/dist/types/contracts/governance/distributor/getLastClaimedEpoch.d.ts +11 -0
- package/dist/types/contracts/governance/distributor/getPeriodDuration.d.ts +10 -0
- package/dist/types/contracts/governance/distributor/{getRewardTokens.d.ts → getRewardToken.d.ts} +3 -3
- package/dist/types/contracts/governance/distributor/getRewardTokenInfo.d.ts +8 -10
- package/dist/types/contracts/governance/distributor/getRewardTokenStats.d.ts +15 -0
- package/dist/types/contracts/governance/distributor/getStartEpoch.d.ts +10 -0
- package/dist/types/contracts/governance/distributor/index.d.ts +16 -8
- package/dist/types/contracts/governance/distributor/setController.d.ts +12 -0
- package/dist/types/contracts/governance/distributor/withdrawRemovedGaugeRewards.d.ts +13 -0
- package/dist/types/contracts/governance/distributor/withdrawUnallocatedRewards.d.ts +12 -0
- package/dist/types/contracts/governance/gauge/addRewardToken.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/claimExtraReward.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/claimExtraRewards.d.ts +9 -0
- package/dist/types/contracts/governance/gauge/claimOnBehalfOf.d.ts +12 -0
- package/dist/types/contracts/governance/gauge/claimRewardToken.d.ts +1 -2
- package/dist/types/contracts/governance/gauge/claimRewardsFor.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/depositRewardToken.d.ts +11 -0
- package/dist/types/contracts/governance/gauge/getAllPendingExtraRewards.d.ts +13 -0
- package/dist/types/contracts/governance/gauge/getControllerAddress.d.ts +9 -0
- package/dist/types/contracts/governance/gauge/getDecimalAdjustment.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/getDepositRAACOnClaim.d.ts +9 -0
- package/dist/types/contracts/governance/gauge/getDistributorData.d.ts +13 -0
- package/dist/types/contracts/governance/gauge/{getRewardTokens.d.ts → getDistributors.d.ts} +3 -5
- package/dist/types/contracts/governance/gauge/getEarnedReward.d.ts +4 -5
- package/dist/types/contracts/governance/gauge/getExtraRewardTokens.d.ts +9 -0
- package/dist/types/contracts/governance/gauge/getGaugeRewardTokenData.d.ts +18 -0
- package/dist/types/contracts/governance/gauge/getPendingExtraRewards.d.ts +11 -0
- package/dist/types/contracts/governance/gauge/getPendingRewards.d.ts +4 -5
- package/dist/types/contracts/governance/gauge/getRaacAutolockMin.d.ts +9 -0
- package/dist/types/contracts/governance/gauge/getUserRewardTokenData.d.ts +17 -0
- package/dist/types/contracts/governance/gauge/getUserWeight.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/index.d.ts +38 -17
- package/dist/types/contracts/governance/gauge/isPaused.d.ts +9 -0
- package/dist/types/contracts/governance/gauge/manageDistributor.d.ts +11 -0
- package/dist/types/contracts/governance/gauge/setController.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/setDepositRAACOnClaim.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/setDistributorApproval.d.ts +11 -0
- package/dist/types/contracts/governance/gauge/setEmergencyPaused.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/setGaugeRewardDistributor.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/setRaacAutolockMin.d.ts +10 -0
- package/dist/types/contracts/governance/gauge/updateUserRewards.d.ts +2 -1
- package/dist/types/contracts/governance/gaugeController/addGauge.d.ts +10 -0
- package/dist/types/contracts/governance/gaugeController/batchVote.d.ts +11 -0
- package/dist/types/contracts/governance/gaugeController/forceCompleteCheckpoint.d.ts +10 -0
- package/dist/types/contracts/governance/gaugeController/getConstants.d.ts +18 -0
- package/dist/types/contracts/governance/gaugeController/getCurrentEpoch.d.ts +9 -0
- package/dist/types/contracts/governance/gaugeController/getGauge.d.ts +15 -0
- package/dist/types/contracts/governance/gaugeController/getGaugeRelativeWeight.d.ts +15 -0
- package/dist/types/contracts/governance/gaugeController/getGaugeRelativeWeightView.d.ts +14 -0
- package/dist/types/contracts/governance/gaugeController/getLastVoteTime.d.ts +11 -0
- package/dist/types/contracts/governance/gaugeController/getNextEpoch.d.ts +9 -0
- package/dist/types/contracts/governance/gaugeController/getUserGaugeVotePower.d.ts +11 -0
- package/dist/types/contracts/governance/gaugeController/getVeToken.d.ts +9 -0
- package/dist/types/contracts/governance/gaugeController/getVoteUserPower.d.ts +10 -0
- package/dist/types/contracts/governance/gaugeController/getVoteUserSlope.d.ts +15 -0
- package/dist/types/contracts/governance/gaugeController/index.d.ts +28 -11
- package/dist/types/contracts/governance/gaugeController/isPaused.d.ts +9 -0
- package/dist/types/contracts/governance/gaugeController/kick.d.ts +10 -0
- package/dist/types/contracts/governance/gaugeController/removeGauge.d.ts +10 -0
- package/dist/types/contracts/governance/gaugeController/removePowerFromGauge.d.ts +10 -0
- package/dist/types/contracts/governance/gaugeController/setBoostAmplificationEnabled.d.ts +11 -0
- package/dist/types/contracts/governance/gaugeController/setEmergencyGaugePause.d.ts +11 -0
- package/dist/types/contracts/governance/gaugeController/setEmergencyPause.d.ts +10 -0
- package/dist/types/contracts/lockers/botLocker/unlock.d.ts +3 -0
- package/dist/types/contracts/lockers/maturityVault/harvest.d.ts +1 -1
- package/dist/utils/contracts.js +1 -1
- package/package.json +1 -1
- package/dist/contracts/governance/distributor/getAvailableBalance.js +0 -29
- package/dist/contracts/governance/distributor/getGaugeRewardTokens.js +0 -28
- package/dist/contracts/governance/distributor/getTransferableBalance.js +0 -30
- package/dist/contracts/governance/distributor/isRewardTokenApproved.js +0 -29
- package/dist/contracts/governance/distributor/isTokenApproved.js +0 -29
- package/dist/contracts/governance/gauge/claimReward.js +0 -44
- package/dist/contracts/governance/gauge/getAllEarnedRewards.js +0 -51
- package/dist/contracts/governance/gauge/getAllPendingRewards.js +0 -41
- package/dist/contracts/governance/gauge/getRewardTokens.js +0 -41
- package/dist/contracts/governance/gauge/getUserGaugeVoteWeight.js +0 -42
- package/dist/contracts/governance/gauge/getWorkingBalance.js +0 -43
- package/dist/contracts/governance/gauge/syncRewardTokens.js +0 -51
- package/dist/contracts/governance/gaugeController/checkpoint.js +0 -33
- package/dist/contracts/governance/gaugeController/checkpointGauge.js +0 -34
- package/dist/contracts/governance/gaugeController/getUserGaugeVoteWeight.js +0 -30
- package/dist/tests/liquidLocker.test.js +0 -262
- package/dist/tests/test.js +0 -32
- package/dist/types/contracts/governance/distributor/getAvailableBalance.d.ts +0 -11
- package/dist/types/contracts/governance/distributor/getGaugeRewardTokens.d.ts +0 -11
- package/dist/types/contracts/governance/distributor/getTransferableBalance.d.ts +0 -12
- package/dist/types/contracts/governance/distributor/isRewardTokenApproved.d.ts +0 -12
- package/dist/types/contracts/governance/distributor/isTokenApproved.d.ts +0 -11
- package/dist/types/contracts/governance/gauge/claimReward.d.ts +0 -11
- package/dist/types/contracts/governance/gauge/getAllEarnedRewards.d.ts +0 -17
- package/dist/types/contracts/governance/gauge/getAllPendingRewards.d.ts +0 -19
- package/dist/types/contracts/governance/gauge/getUserGaugeVoteWeight.d.ts +0 -14
- package/dist/types/contracts/governance/gauge/getWorkingBalance.d.ts +0 -12
- package/dist/types/contracts/governance/gauge/syncRewardTokens.d.ts +0 -13
- package/dist/types/contracts/governance/gaugeController/checkpoint.d.ts +0 -11
- package/dist/types/contracts/governance/gaugeController/checkpointGauge.d.ts +0 -12
- package/dist/types/contracts/governance/gaugeController/getUserGaugeVoteWeight.d.ts +0 -12
- package/dist/types/contracts/governance/gaugeController/isGauge.d.ts +0 -11
- package/dist/types/tests/liquidLocker.test.d.ts +0 -18
- package/dist/types/tests/test.d.ts +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeGauge = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
5
|
+
const getContractAddress_1 = require("../../getContractAddress");
|
|
6
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
7
|
+
/**
|
|
8
|
+
* Removes a gauge from the GaugeController. Requires the GAUGE_ADMIN role.
|
|
9
|
+
* @param chainId - The chain/network to use.
|
|
10
|
+
* @param gauge - Address of the gauge to remove.
|
|
11
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
12
|
+
* @returns The transaction response.
|
|
13
|
+
*/
|
|
14
|
+
const removeGauge = async (chainId, gauge, signer) => {
|
|
15
|
+
if (!signer)
|
|
16
|
+
throw new Error("Signer is required");
|
|
17
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugecontroller");
|
|
18
|
+
const abi = (0, artifacts_1.getABI)("gaugecontroller");
|
|
19
|
+
const contract = new ethers_1.ethers.Contract(address, abi, signer);
|
|
20
|
+
const tx = await contract.removeGauge(gauge);
|
|
21
|
+
await tx.wait();
|
|
22
|
+
return tx;
|
|
23
|
+
};
|
|
24
|
+
exports.removeGauge = removeGauge;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removePowerFromGauge = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
5
|
+
const getContractAddress_1 = require("../../getContractAddress");
|
|
6
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
7
|
+
/**
|
|
8
|
+
* Removes the caller's allocated vote power from a gauge.
|
|
9
|
+
* @param chainId - The chain/network to use.
|
|
10
|
+
* @param gauge - Address of the gauge to remove power from.
|
|
11
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
12
|
+
* @returns The transaction response.
|
|
13
|
+
*/
|
|
14
|
+
const removePowerFromGauge = async (chainId, gauge, signer) => {
|
|
15
|
+
if (!signer)
|
|
16
|
+
throw new Error("Signer is required");
|
|
17
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugecontroller");
|
|
18
|
+
const abi = (0, artifacts_1.getABI)("gaugecontroller");
|
|
19
|
+
const contract = new ethers_1.ethers.Contract(address, abi, signer);
|
|
20
|
+
const tx = await contract.removePowerFromGauge(gauge);
|
|
21
|
+
await tx.wait();
|
|
22
|
+
return tx;
|
|
23
|
+
};
|
|
24
|
+
exports.removePowerFromGauge = removePowerFromGauge;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setBoostAmplificationEnabled = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
5
|
+
const getContractAddress_1 = require("../../getContractAddress");
|
|
6
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
7
|
+
/**
|
|
8
|
+
* Enables or disables boost amplification for a gauge. Requires the GAUGE_ADMIN role.
|
|
9
|
+
* @param chainId - The chain/network to use.
|
|
10
|
+
* @param gauge - Address of the gauge.
|
|
11
|
+
* @param enabled - Whether boost amplification should be enabled.
|
|
12
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
13
|
+
* @returns The transaction response.
|
|
14
|
+
*/
|
|
15
|
+
const setBoostAmplificationEnabled = async (chainId, gauge, enabled, signer) => {
|
|
16
|
+
if (!signer)
|
|
17
|
+
throw new Error("Signer is required");
|
|
18
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugecontroller");
|
|
19
|
+
const abi = (0, artifacts_1.getABI)("gaugecontroller");
|
|
20
|
+
const contract = new ethers_1.ethers.Contract(address, abi, signer);
|
|
21
|
+
const tx = await contract.setBoostAmplificationEnabled(gauge, enabled);
|
|
22
|
+
await tx.wait();
|
|
23
|
+
return tx;
|
|
24
|
+
};
|
|
25
|
+
exports.setBoostAmplificationEnabled = setBoostAmplificationEnabled;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setEmergencyGaugePause = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
5
|
+
const getContractAddress_1 = require("../../getContractAddress");
|
|
6
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
7
|
+
/**
|
|
8
|
+
* Emergency-pauses or unpauses a single gauge. Requires the EMERGENCY_ADMIN role.
|
|
9
|
+
* @param chainId - The chain/network to use.
|
|
10
|
+
* @param gauge - Address of the gauge.
|
|
11
|
+
* @param paused - Whether the gauge should be paused.
|
|
12
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
13
|
+
* @returns The transaction response.
|
|
14
|
+
*/
|
|
15
|
+
const setEmergencyGaugePause = async (chainId, gauge, paused, signer) => {
|
|
16
|
+
if (!signer)
|
|
17
|
+
throw new Error("Signer is required");
|
|
18
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugecontroller");
|
|
19
|
+
const abi = (0, artifacts_1.getABI)("gaugecontroller");
|
|
20
|
+
const contract = new ethers_1.ethers.Contract(address, abi, signer);
|
|
21
|
+
const tx = await contract.setEmergencyGaugePause(gauge, paused);
|
|
22
|
+
await tx.wait();
|
|
23
|
+
return tx;
|
|
24
|
+
};
|
|
25
|
+
exports.setEmergencyGaugePause = setEmergencyGaugePause;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setEmergencyPause = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
5
|
+
const getContractAddress_1 = require("../../getContractAddress");
|
|
6
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
7
|
+
/**
|
|
8
|
+
* Emergency-pauses or unpauses the entire GaugeController. Requires the EMERGENCY_ADMIN role.
|
|
9
|
+
* @param chainId - The chain/network to use.
|
|
10
|
+
* @param paused - Whether the contract should be paused.
|
|
11
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
12
|
+
* @returns The transaction response.
|
|
13
|
+
*/
|
|
14
|
+
const setEmergencyPause = async (chainId, paused, signer) => {
|
|
15
|
+
if (!signer)
|
|
16
|
+
throw new Error("Signer is required");
|
|
17
|
+
const address = (0, getContractAddress_1.getContractAddress)(chainId, "gaugecontroller");
|
|
18
|
+
const abi = (0, artifacts_1.getABI)("gaugecontroller");
|
|
19
|
+
const contract = new ethers_1.ethers.Contract(address, abi, signer);
|
|
20
|
+
const tx = await contract.setEmergencyPause(paused);
|
|
21
|
+
await tx.wait();
|
|
22
|
+
return tx;
|
|
23
|
+
};
|
|
24
|
+
exports.setEmergencyPause = setEmergencyPause;
|
|
@@ -5,12 +5,15 @@ const _helpers_1 = require("./_helpers");
|
|
|
5
5
|
/**
|
|
6
6
|
* Unlock NFTs from the bot-locker. Each tokenId must satisfy the unlock-window check
|
|
7
7
|
* (locked duration is a non-zero multiple of LOCK_DURATION_IN_EPOCH * EPOCH_DURATION).
|
|
8
|
+
*
|
|
9
|
+
* The contract no longer has a standalone unlock — it was merged into
|
|
10
|
+
* unlockAndClaim, which unlocks and claims accrued rewards atomically.
|
|
8
11
|
*/
|
|
9
12
|
const unlock = async (chainId, tokenIds, signer) => {
|
|
10
13
|
if (!signer)
|
|
11
14
|
throw new Error("Signer is required");
|
|
12
15
|
const contract = await (0, _helpers_1.getBotLockerContract)(chainId, signer);
|
|
13
|
-
const tx = await contract.
|
|
16
|
+
const tx = await contract.unlockAndClaim(tokenIds);
|
|
14
17
|
await tx.wait();
|
|
15
18
|
return tx;
|
|
16
19
|
};
|
|
@@ -5,11 +5,12 @@ const _helpers_1 = require("./_helpers");
|
|
|
5
5
|
/**
|
|
6
6
|
* Harvest free RAAC in the vault and distribute. Whitelisted callers only.
|
|
7
7
|
*/
|
|
8
|
-
const harvest = async (chainId, recipient,
|
|
8
|
+
const harvest = async (chainId, recipient, signer) => {
|
|
9
9
|
if (!signer)
|
|
10
10
|
throw new Error("Signer is required");
|
|
11
11
|
const contract = await (0, _helpers_1.getMaturityVaultContract)(chainId, signer);
|
|
12
|
-
|
|
12
|
+
// @ts-ignore stale typechain-types declare harvest(address,uint256); the deployed ABI is harvest(address)
|
|
13
|
+
const tx = await contract.harvest(recipient);
|
|
13
14
|
await tx.wait();
|
|
14
15
|
return tx;
|
|
15
16
|
};
|
|
@@ -106,35 +106,9 @@ import { getWithdrawRequestInfo as getStabilityPoolWithdrawRequestInfo } from ".
|
|
|
106
106
|
import { requestWithdraw as requestStabilityPoolWithdraw } from "./pools/stabilityPool/requestWithdraw";
|
|
107
107
|
import { getABI } from "./utils/artifacts";
|
|
108
108
|
import { decodeErrorName, getErrorInfo, attachDecodedError, decodeErrorMessage, attachDecodedErrorMessage } from "./utils/errorDecoder";
|
|
109
|
-
import
|
|
110
|
-
import
|
|
111
|
-
import
|
|
112
|
-
import { getRewardTokenInfo as getRewardTokenInfoDistributor } from "./contracts/governance/distributor/getRewardTokenInfo";
|
|
113
|
-
import { getRewardTokens as getRewardTokensDistributor } from "./contracts/governance/distributor/getRewardTokens";
|
|
114
|
-
import { isRewardTokenApproved as isRewardTokenApprovedDistributor } from "./contracts/governance/distributor/isRewardTokenApproved";
|
|
115
|
-
import { isTokenApproved as isTokenApprovedDistributor } from "./contracts/governance/distributor/isTokenApproved";
|
|
116
|
-
import { getGaugeRewardTokens as getGaugeRewardTokensDistributor } from "./contracts/governance/distributor/getGaugeRewardTokens";
|
|
117
|
-
import { claimReward as claimRewardGauge } from "./contracts/governance/gauge/claimReward";
|
|
118
|
-
import { claimRewardToken as claimRewardTokenGauge } from "./contracts/governance/gauge/claimRewardToken";
|
|
119
|
-
import { getAllEarnedRewards as getAllEarnedRewardsGauge } from "./contracts/governance/gauge/getAllEarnedRewards";
|
|
120
|
-
import { getAllPendingRewards as getAllPendingRewardsGauge } from "./contracts/governance/gauge/getAllPendingRewards";
|
|
121
|
-
import { getBalanceOf as getBalanceOfGauge } from "./contracts/governance/gauge/getBalanceOf";
|
|
122
|
-
import { getRawBalanceOf as getRawBalanceOfGauge } from "./contracts/governance/gauge/getRawBalanceOf";
|
|
123
|
-
import { getRawTotalSupply as getRawTotalSupplyGauge } from "./contracts/governance/gauge/getRawTotalSupply";
|
|
124
|
-
import { getTotalSupply as getTotalSupplyGauge } from "./contracts/governance/gauge/getTotalSupply";
|
|
125
|
-
import { syncRewardTokens as syncRewardTokensGauge } from "./contracts/governance/gauge/syncRewardTokens";
|
|
126
|
-
import { stake as stakeGauge } from "./contracts/governance/gauge/stake";
|
|
127
|
-
import { withdraw as withdrawGauge } from "./contracts/governance/gauge/withdraw";
|
|
128
|
-
import { getPeriodDuration as getPeriodDurationGauge } from "./contracts/governance/gauge/getPeriodDuration";
|
|
129
|
-
import { getPeriodBoundaries as getPeriodBoundariesGauge } from "./contracts/governance/gauge/getPeriodBoundaries";
|
|
130
|
-
import { calculateBoost as calculateBoostGaugeController } from "./contracts/governance/gaugeController/calculateBoost";
|
|
131
|
-
import { getGaugeWeight as getGaugeWeightGaugeController } from "./contracts/governance/gaugeController/getGaugeWeight";
|
|
132
|
-
import { getTotalWeight as getTotalWeightGaugeController } from "./contracts/governance/gaugeController/getTotalWeight";
|
|
133
|
-
import { isGauge as isGaugeGaugeController } from "./contracts/governance/gaugeController/isGauge";
|
|
134
|
-
import { checkpointGauge as checkpointGaugeGaugeController } from "./contracts/governance/gaugeController/checkpointGauge";
|
|
135
|
-
import { getUserGaugeVoteWeight as getUserGaugeVoteWeightGaugeController } from "./contracts/governance/gaugeController/getUserGaugeVoteWeight";
|
|
136
|
-
import { getUserVotePowerRemaining as getUserVotePowerRemainingGaugeController } from "./contracts/governance/gaugeController/getUserVotePowerRemaining";
|
|
137
|
-
import { vote as voteGaugeController } from "./contracts/governance/gaugeController/vote";
|
|
109
|
+
import * as distributorMethods from "./contracts/governance/distributor";
|
|
110
|
+
import * as gaugeMethods from "./contracts/governance/gauge";
|
|
111
|
+
import * as controllerMethods from "./contracts/governance/gaugeController";
|
|
138
112
|
import { cancel as cancelProposals } from "./contracts/governance/proposals/cancel";
|
|
139
113
|
import { getProposalData as getProposalDataProposals } from "./contracts/governance/proposals/getProposalData";
|
|
140
114
|
import { getQuorumNumerator as getQuorumNumeratorProposals } from "./contracts/governance/proposals/getQuorumNumerator";
|
|
@@ -372,41 +346,9 @@ declare class RPCLibrary {
|
|
|
372
346
|
};
|
|
373
347
|
};
|
|
374
348
|
governance: {
|
|
375
|
-
distributor:
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
getTransferableBalance: typeof getTransferableBalanceDistributor;
|
|
379
|
-
getRewardTokenInfo: typeof getRewardTokenInfoDistributor;
|
|
380
|
-
getRewardTokens: typeof getRewardTokensDistributor;
|
|
381
|
-
isRewardTokenApproved: typeof isRewardTokenApprovedDistributor;
|
|
382
|
-
isTokenApproved: typeof isTokenApprovedDistributor;
|
|
383
|
-
getGaugeRewardTokens: typeof getGaugeRewardTokensDistributor;
|
|
384
|
-
};
|
|
385
|
-
gauge: {
|
|
386
|
-
getBalanceOf: typeof getBalanceOfGauge;
|
|
387
|
-
getRawBalanceOf: typeof getRawBalanceOfGauge;
|
|
388
|
-
getRawTotalSupply: typeof getRawTotalSupplyGauge;
|
|
389
|
-
getTotalSupply: typeof getTotalSupplyGauge;
|
|
390
|
-
syncRewardTokens: typeof syncRewardTokensGauge;
|
|
391
|
-
stake: typeof stakeGauge;
|
|
392
|
-
withdraw: typeof withdrawGauge;
|
|
393
|
-
claimReward: typeof claimRewardGauge;
|
|
394
|
-
claimRewardToken: typeof claimRewardTokenGauge;
|
|
395
|
-
getAllEarnedRewards: typeof getAllEarnedRewardsGauge;
|
|
396
|
-
getAllPendingRewards: typeof getAllPendingRewardsGauge;
|
|
397
|
-
getPeriodDuration: typeof getPeriodDurationGauge;
|
|
398
|
-
getPeriodBoundaries: typeof getPeriodBoundariesGauge;
|
|
399
|
-
};
|
|
400
|
-
controller: {
|
|
401
|
-
calculateBoost: typeof calculateBoostGaugeController;
|
|
402
|
-
getGaugeWeight: typeof getGaugeWeightGaugeController;
|
|
403
|
-
getTotalWeight: typeof getTotalWeightGaugeController;
|
|
404
|
-
isGauge: typeof isGaugeGaugeController;
|
|
405
|
-
checkpointGauge: typeof checkpointGaugeGaugeController;
|
|
406
|
-
getUserGaugeVoteWeight: typeof getUserGaugeVoteWeightGaugeController;
|
|
407
|
-
getUserVotePowerRemaining: typeof getUserVotePowerRemainingGaugeController;
|
|
408
|
-
vote: typeof voteGaugeController;
|
|
409
|
-
};
|
|
349
|
+
distributor: typeof distributorMethods;
|
|
350
|
+
gauge: typeof gaugeMethods;
|
|
351
|
+
controller: typeof controllerMethods;
|
|
410
352
|
proposals: {
|
|
411
353
|
cancel: typeof cancelProposals;
|
|
412
354
|
getProposalData: typeof getProposalDataProposals;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Claims accrued rewards for multiple gauges in a single transaction.
|
|
5
|
+
*
|
|
6
|
+
* @param chainId - The chain/network to use.
|
|
7
|
+
* @param gauges - Array of gauge addresses.
|
|
8
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
9
|
+
* @returns Transaction after it has been mined.
|
|
10
|
+
*/
|
|
11
|
+
export declare const claimAll: (chainId: ChainId, gauges: string[], signer: Signer) => Promise<any>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Claims accrued rewards for a gauge.
|
|
5
|
+
* Note: only callable by the gauge contract itself (msg.sender must == gauge).
|
|
6
|
+
*
|
|
7
|
+
* @param chainId - The chain/network to use.
|
|
8
|
+
* @param gauge - Address of the gauge.
|
|
9
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
10
|
+
* @returns Transaction after it has been mined.
|
|
11
|
+
*/
|
|
12
|
+
export declare const claimForGauge: (chainId: ChainId, gauge: string, signer: Signer) => Promise<any>;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { Signer } from "ethers";
|
|
2
|
-
import
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
3
|
/**
|
|
4
4
|
* Deposits reward tokens into the distributor.
|
|
5
|
-
*
|
|
6
|
-
* Rewards are distributed to gauges based on their weights.
|
|
5
|
+
* The reward token must be pre-approved by the caller before calling.
|
|
7
6
|
*
|
|
8
7
|
* @param chainId - The chain/network to use.
|
|
9
|
-
* @param
|
|
8
|
+
* @param token - Address of the reward token.
|
|
10
9
|
* @param amount - Amount of reward tokens to deposit.
|
|
11
|
-
* @param signer - An ethers.js Signer instance (
|
|
12
|
-
* @returns Transaction
|
|
10
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
11
|
+
* @returns Transaction after it has been mined.
|
|
13
12
|
*/
|
|
14
|
-
export declare const deposit: (chainId:
|
|
13
|
+
export declare const deposit: (chainId: ChainId, token: string, amount: string | number | bigint, signer: Signer) => Promise<any>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Gets the amount of rewards currently claimable for a gauge.
|
|
5
|
+
*
|
|
6
|
+
* @param chainId - The chain/network to use.
|
|
7
|
+
* @param gauge - Address of the gauge.
|
|
8
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
9
|
+
* @returns Claimable reward amount (bigint).
|
|
10
|
+
*/
|
|
11
|
+
export declare const getClaimableForGauge: (chainId: ChainId, gauge: string, provider?: Provider) => Promise<bigint>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Gets the amount claimed by a gauge at a specific epoch.
|
|
5
|
+
*
|
|
6
|
+
* @param chainId - The chain/network to use.
|
|
7
|
+
* @param gauge - Address of the gauge.
|
|
8
|
+
* @param epoch - The epoch to query.
|
|
9
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
10
|
+
* @returns Amount claimed at the epoch (bigint).
|
|
11
|
+
*/
|
|
12
|
+
export declare const getClaimedAtEpoch: (chainId: ChainId, gauge: 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
|
+
/**
|
|
4
|
+
* Gets the amount of a token deposited at a specific epoch.
|
|
5
|
+
*
|
|
6
|
+
* @param chainId - The chain/network to use.
|
|
7
|
+
* @param token - Address of the reward token.
|
|
8
|
+
* @param epoch - The epoch to query.
|
|
9
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
10
|
+
* @returns Amount deposited at the epoch (bigint).
|
|
11
|
+
*/
|
|
12
|
+
export declare const getDepositedAtEpoch: (chainId: ChainId, token: string, epoch: string | number | bigint, provider?: Provider) => Promise<bigint>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Gets the gauge controller address used by the distributor.
|
|
5
|
+
*
|
|
6
|
+
* @param chainId - The chain/network to use.
|
|
7
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
8
|
+
* @returns Gauge controller address (string).
|
|
9
|
+
*/
|
|
10
|
+
export declare const getGaugeController: (chainId: ChainId, provider?: Provider) => Promise<string>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Gets the last epoch claimed for a gauge.
|
|
5
|
+
*
|
|
6
|
+
* @param chainId - The chain/network to use.
|
|
7
|
+
* @param gauge - Address of the gauge.
|
|
8
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
9
|
+
* @returns Last claimed epoch (bigint).
|
|
10
|
+
*/
|
|
11
|
+
export declare const getLastClaimedEpoch: (chainId: ChainId, gauge: string, provider?: Provider) => Promise<bigint>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Gets the distributor's period (epoch) duration in seconds.
|
|
5
|
+
*
|
|
6
|
+
* @param chainId - The chain/network to use.
|
|
7
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
8
|
+
* @returns Period duration in seconds (bigint).
|
|
9
|
+
*/
|
|
10
|
+
export declare const getPeriodDuration: (chainId: ChainId, provider?: Provider) => Promise<bigint>;
|
package/dist/types/contracts/governance/distributor/{getRewardTokens.d.ts → getRewardToken.d.ts}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Provider } from "ethers";
|
|
2
2
|
import { ChainId } from "../../../configs/chains";
|
|
3
3
|
/**
|
|
4
|
-
* Gets
|
|
4
|
+
* Gets the reward token address used by the distributor.
|
|
5
5
|
*
|
|
6
6
|
* @param chainId - The chain/network to use.
|
|
7
7
|
* @param provider - Optional ethers.js Provider instance.
|
|
8
|
-
* @returns
|
|
8
|
+
* @returns Reward token address (string).
|
|
9
9
|
*/
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const getRewardToken: (chainId: ChainId, provider?: Provider) => Promise<string>;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { Provider } from "ethers";
|
|
2
2
|
import { ChainId } from "../../../configs/chains";
|
|
3
|
-
export interface RewardTokenInfo {
|
|
4
|
-
totalDeposited: string;
|
|
5
|
-
totalDistributed: string;
|
|
6
|
-
totalClaimable: string;
|
|
7
|
-
balance: string;
|
|
8
|
-
}
|
|
9
3
|
/**
|
|
10
|
-
* Gets
|
|
4
|
+
* Gets aggregate statistics for the distributor's reward token.
|
|
11
5
|
*
|
|
12
6
|
* @param chainId - The chain/network to use.
|
|
13
|
-
* @param tokenAddress - Address of the reward token.
|
|
14
7
|
* @param provider - Optional ethers.js Provider instance.
|
|
15
|
-
* @returns
|
|
8
|
+
* @returns Object with totalDeposited, totalDistributed, totalClaimable and balance (all bigint).
|
|
16
9
|
*/
|
|
17
|
-
export declare const getRewardTokenInfo: (chainId: ChainId,
|
|
10
|
+
export declare const getRewardTokenInfo: (chainId: ChainId, provider?: Provider) => Promise<{
|
|
11
|
+
totalDeposited: bigint;
|
|
12
|
+
totalDistributed: bigint;
|
|
13
|
+
totalClaimable: bigint;
|
|
14
|
+
balance: bigint;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Reads the rewardTokenInfo mapping entry for a given token.
|
|
5
|
+
*
|
|
6
|
+
* @param chainId - The chain/network to use.
|
|
7
|
+
* @param token - Address of the reward token.
|
|
8
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
9
|
+
* @returns Object with totalDeposited, totalDistributed and totalClaimable (all bigint).
|
|
10
|
+
*/
|
|
11
|
+
export declare const getRewardTokenStats: (chainId: ChainId, token: string, provider?: Provider) => Promise<{
|
|
12
|
+
totalDeposited: bigint;
|
|
13
|
+
totalDistributed: bigint;
|
|
14
|
+
totalClaimable: bigint;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Gets the distributor's start epoch timestamp.
|
|
5
|
+
*
|
|
6
|
+
* @param chainId - The chain/network to use.
|
|
7
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
8
|
+
* @returns Start epoch (bigint).
|
|
9
|
+
*/
|
|
10
|
+
export declare const getStartEpoch: (chainId: ChainId, provider?: Provider) => Promise<bigint>;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
1
|
+
export * from "./claimAll";
|
|
2
|
+
export * from "./claimForGauge";
|
|
3
|
+
export * from "./deposit";
|
|
4
|
+
export * from "./getClaimableForGauge";
|
|
5
|
+
export * from "./getClaimedAtEpoch";
|
|
6
|
+
export * from "./getDepositedAtEpoch";
|
|
7
|
+
export * from "./getGaugeController";
|
|
8
|
+
export * from "./getLastClaimedEpoch";
|
|
9
|
+
export * from "./getPeriodDuration";
|
|
10
|
+
export * from "./getRewardToken";
|
|
11
|
+
export * from "./getRewardTokenInfo";
|
|
12
|
+
export * from "./getRewardTokenStats";
|
|
13
|
+
export * from "./getStartEpoch";
|
|
14
|
+
export * from "./setController";
|
|
15
|
+
export * from "./withdrawRemovedGaugeRewards";
|
|
16
|
+
export * from "./withdrawUnallocatedRewards";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Sets the gauge controller for the distributor.
|
|
5
|
+
* Requires DEFAULT_ADMIN_ROLE.
|
|
6
|
+
*
|
|
7
|
+
* @param chainId - The chain/network to use.
|
|
8
|
+
* @param controller - Address of the new gauge controller.
|
|
9
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
10
|
+
* @returns Transaction after it has been mined.
|
|
11
|
+
*/
|
|
12
|
+
export declare const setController: (chainId: ChainId, controller: string, signer: Signer) => Promise<any>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Withdraws rewards belonging to a removed gauge to a recipient.
|
|
5
|
+
* Requires DEFAULT_ADMIN_ROLE.
|
|
6
|
+
*
|
|
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.
|
|
10
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
11
|
+
* @returns Transaction after it has been mined.
|
|
12
|
+
*/
|
|
13
|
+
export declare const withdrawRemovedGaugeRewards: (chainId: ChainId, gauge: string, recipient: string, signer: Signer) => Promise<any>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Withdraws unallocated rewards to a recipient.
|
|
5
|
+
* Requires DEFAULT_ADMIN_ROLE.
|
|
6
|
+
*
|
|
7
|
+
* @param chainId - The chain/network to use.
|
|
8
|
+
* @param recipient - Address to receive the withdrawn rewards.
|
|
9
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
10
|
+
* @returns Transaction after it has been mined.
|
|
11
|
+
*/
|
|
12
|
+
export declare const withdrawUnallocatedRewards: (chainId: ChainId, recipient: string, signer: Signer) => Promise<any>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Registers a new reward token on the gauge (requires GAUGE_ADMIN).
|
|
5
|
+
* @param chainId - The chain/network to use.
|
|
6
|
+
* @param gaugeAddressOrId - Address of the gauge contract or its config ID.
|
|
7
|
+
* @param token - Address of the reward token to add.
|
|
8
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
9
|
+
*/
|
|
10
|
+
export declare const addRewardToken: (chainId: ChainId, gaugeAddressOrId: string, token: string, signer: Signer) => Promise<any>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Claims a single extra reward token for the caller on the given gauge.
|
|
5
|
+
* @param chainId - The chain/network to use.
|
|
6
|
+
* @param gaugeAddressOrId - Address of the gauge contract or its config ID.
|
|
7
|
+
* @param token - Address of the extra reward token to claim.
|
|
8
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
9
|
+
*/
|
|
10
|
+
export declare const claimExtraReward: (chainId: ChainId, gaugeAddressOrId: string, token: string, signer: Signer) => Promise<any>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Claims all extra reward tokens for the caller on the given gauge.
|
|
5
|
+
* @param chainId - The chain/network to use.
|
|
6
|
+
* @param gaugeAddressOrId - Address of the gauge contract or its config ID.
|
|
7
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
8
|
+
*/
|
|
9
|
+
export declare const claimExtraRewards: (chainId: ChainId, gaugeAddressOrId: string, signer: Signer) => Promise<any>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Claims a specific token amount on behalf of a user (requires CLAIM_FOR_ROLE).
|
|
5
|
+
* @param chainId - The chain/network to use.
|
|
6
|
+
* @param gaugeAddressOrId - Address of the gauge contract or its config ID.
|
|
7
|
+
* @param token - Address of the reward token.
|
|
8
|
+
* @param amount - The amount to claim.
|
|
9
|
+
* @param user - Address of the user on whose behalf the claim is made.
|
|
10
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
11
|
+
*/
|
|
12
|
+
export declare const claimOnBehalfOf: (chainId: ChainId, gaugeAddressOrId: string, token: string, amount: string | number | bigint, user: string, signer: Signer) => Promise<any>;
|
|
@@ -5,8 +5,7 @@ import configs from "../../../configs/chains";
|
|
|
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.
|
|
8
|
-
* @param tokenAddress - Address of the reward token to claim.
|
|
9
8
|
* @param signer - An ethers.js Signer instance (must be connected to wallet).
|
|
10
9
|
* @returns Transaction receipt after the claim is made.
|
|
11
10
|
*/
|
|
12
|
-
export declare const claimRewardToken: (chainId: keyof typeof configs, gaugeAddressOrId: string,
|
|
11
|
+
export declare const claimRewardToken: (chainId: keyof typeof configs, gaugeAddressOrId: string, signer: Signer) => Promise<any>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Claims rewards on behalf of a user (requires DISTRIBUTOR_ROLE).
|
|
5
|
+
* @param chainId - The chain/network to use.
|
|
6
|
+
* @param gaugeAddressOrId - Address of the gauge contract or its config ID.
|
|
7
|
+
* @param user - Address of the user whose rewards are claimed.
|
|
8
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
9
|
+
*/
|
|
10
|
+
export declare const claimRewardsFor: (chainId: ChainId, gaugeAddressOrId: string, user: string, signer: Signer) => Promise<any>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Deposits an amount of a reward token into the gauge for distribution.
|
|
5
|
+
* @param chainId - The chain/network to use.
|
|
6
|
+
* @param gaugeAddressOrId - Address of the gauge contract or its config ID.
|
|
7
|
+
* @param token - Address of the reward token to deposit.
|
|
8
|
+
* @param amount - The amount to deposit.
|
|
9
|
+
* @param signer - An ethers.js Signer instance (required).
|
|
10
|
+
*/
|
|
11
|
+
export declare const depositRewardToken: (chainId: ChainId, gaugeAddressOrId: string, token: string, amount: string | number | bigint, signer: Signer) => Promise<any>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Gets all pending extra rewards for a user across all extra reward tokens.
|
|
5
|
+
* @param chainId - The chain/network to use.
|
|
6
|
+
* @param gaugeAddressOrId - Address of the gauge contract or its config ID.
|
|
7
|
+
* @param user - Address of the user.
|
|
8
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getAllPendingExtraRewards: (chainId: ChainId, gaugeAddressOrId: string, user: string, provider?: Provider) => Promise<{
|
|
11
|
+
tokens: string[];
|
|
12
|
+
amounts: bigint[];
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../configs/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Gets the gauge controller address registered on the gauge.
|
|
5
|
+
* @param chainId - The chain/network to use.
|
|
6
|
+
* @param gaugeAddressOrId - Address of the gauge contract or its config ID.
|
|
7
|
+
* @param provider - Optional ethers.js Provider instance.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getControllerAddress: (chainId: ChainId, gaugeAddressOrId: string, provider?: Provider) => Promise<string>;
|