@curvefi/api 2.46.5 → 2.46.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.
@@ -0,0 +1 @@
1
+ [{ "name": "Minted", "inputs": [{ "type": "address", "name": "recipient", "indexed": true }, { "type": "address", "name": "gauge", "indexed": false }, { "type": "uint256", "name": "minted", "indexed": false }], "anonymous": false, "type": "event" }, { "outputs": [], "inputs": [{ "type": "address", "name": "_token" }, { "type": "address", "name": "_controller" }], "stateMutability": "nonpayable", "type": "constructor" }, { "name": "mint", "outputs": [], "inputs": [{ "type": "address", "name": "gauge_addr" }], "stateMutability": "nonpayable", "type": "function", "gas": 100038 }, { "name": "mint_many", "outputs": [], "inputs": [{ "type": "address[8]", "name": "gauge_addrs" }], "stateMutability": "nonpayable", "type": "function", "gas": 408502 }, { "name": "mint_for", "outputs": [], "inputs": [{ "type": "address", "name": "gauge_addr" }, { "type": "address", "name": "_for" }], "stateMutability": "nonpayable", "type": "function", "gas": 101219 }, { "name": "toggle_approve_mint", "outputs": [], "inputs": [{ "type": "address", "name": "minting_user" }], "stateMutability": "nonpayable", "type": "function", "gas": 36726 }, { "name": "token", "outputs": [{ "type": "address", "name": "" }], "inputs": [], "stateMutability": "view", "type": "function", "gas": 1301 }, { "name": "controller", "outputs": [{ "type": "address", "name": "" }], "inputs": [], "stateMutability": "view", "type": "function", "gas": 1331 }, { "name": "minted", "outputs": [{ "type": "uint256", "name": "" }], "inputs": [{ "type": "address", "name": "arg0" }, { "type": "address", "name": "arg1" }], "stateMutability": "view", "type": "function", "gas": 1669 }, { "name": "allowed_to_mint_for", "outputs": [{ "type": "bool", "name": "" }], "inputs": [{ "type": "address", "name": "arg0" }, { "type": "address", "name": "arg1" }], "stateMutability": "view", "type": "function", "gas": 1699 }]
@@ -1,6 +1,7 @@
1
1
  import { lowerCaseValues } from "./utils.js";
2
2
  export var ALIASES_ETHEREUM = lowerCaseValues({
3
3
  "crv": "0xD533a949740bb3306d119CC777fa900bA034cd52",
4
+ "minter": '0xd061D61a4d941c39E5453435B6345Dc261C2fcE0',
4
5
  "gauge_factory": "0xabC000d88f23Bb45525E447528DBF656A9D55bf5",
5
6
  "voting_escrow": "0x5f3b5DfEb7B28CDbD7FAba78963EE202a494e2A2",
6
7
  "fee_distributor": "0xA464e6DCda8AC41e03616F95f4BC98a13b8922Dc",
package/lib/curve.js CHANGED
@@ -65,6 +65,7 @@ import cERC20Abi from './constants/abis/cERC20.json' assert { type: 'json' };
65
65
  import yERC20Abi from './constants/abis/yERC20.json' assert { type: 'json' };
66
66
  import gaugeFactoryABI from './constants/abis/gauge_factory_mainnet.json' assert { type: 'json' };
67
67
  import gaugeFactorySidechainABI from './constants/abis/gauge_factory_sidechain.json' assert { type: 'json' };
68
+ import minterMainnetABI from './constants/abis/minter_mainnet.json' assert { type: 'json' };
68
69
  import votingEscrowABI from './constants/abis/votingescrow.json' assert { type: 'json' };
69
70
  import anycallABI from './constants/abis/anycall.json' assert { type: 'json' };
70
71
  import votingEscrowOracleABI from './constants/abis/voting_escrow_oracle.json' assert { type: 'json' };
@@ -893,6 +894,9 @@ var Curve = /** @class */ (function () {
893
894
  this.constants.DECIMALS[this.constants.ALIASES.crv] = 18;
894
895
  _gaugeFactoryABI = this.chainId === 1 ? gaugeFactoryABI : gaugeFactorySidechainABI;
895
896
  this.setContract(this.constants.ALIASES.gauge_factory, _gaugeFactoryABI);
897
+ if (this.chainId === 1) {
898
+ this.setContract(this.constants.ALIASES.minter, minterMainnetABI);
899
+ }
896
900
  this.setContract(this.constants.ALIASES.voting_escrow, votingEscrowABI);
897
901
  this.setContract(this.constants.ALIASES.fee_distributor, feeDistributorABI);
898
902
  this.setContract(this.constants.ALIASES.address_provider, addressProviderABI);
@@ -1738,15 +1738,20 @@ var PoolTemplate = /** @class */ (function () {
1738
1738
  };
1739
1739
  PoolTemplate.prototype.claimCrvEstimateGas = function () {
1740
1740
  return __awaiter(this, void 0, void 0, function () {
1741
- var _c;
1742
- return __generator(this, function (_d) {
1743
- switch (_d.label) {
1741
+ var _c, _d;
1742
+ return __generator(this, function (_e) {
1743
+ switch (_e.label) {
1744
1744
  case 0:
1745
1745
  if (this.rewardsOnly())
1746
1746
  throw Error("".concat(this.name, " has Rewards-Only Gauge. Use claimRewards instead"));
1747
+ if (!(curve.chainId === 1)) return [3 /*break*/, 2];
1747
1748
  _c = Number;
1749
+ return [4 /*yield*/, curve.contracts[curve.constants.ALIASES.minter].contract.mint.estimateGas(this.gauge, curve.constantOptions)];
1750
+ case 1: return [2 /*return*/, _c.apply(void 0, [_e.sent()])];
1751
+ case 2:
1752
+ _d = Number;
1748
1753
  return [4 /*yield*/, curve.contracts[curve.constants.ALIASES.gauge_factory].contract.mint.estimateGas(this.gauge, curve.constantOptions)];
1749
- case 1: return [2 /*return*/, _c.apply(void 0, [_d.sent()])];
1754
+ case 3: return [2 /*return*/, _d.apply(void 0, [_e.sent()])];
1750
1755
  }
1751
1756
  });
1752
1757
  });
@@ -1759,7 +1764,7 @@ var PoolTemplate = /** @class */ (function () {
1759
1764
  case 0:
1760
1765
  if (this.rewardsOnly())
1761
1766
  throw Error("".concat(this.name, " has Rewards-Only Gauge. Use claimRewards instead"));
1762
- contract = curve.contracts[curve.constants.ALIASES.gauge_factory].contract;
1767
+ contract = curve.chainId === 1 ? curve.contracts[curve.constants.ALIASES.minter].contract : curve.contracts[curve.constants.ALIASES.gauge_factory].contract;
1763
1768
  _c = mulBy1_3;
1764
1769
  return [4 /*yield*/, contract.mint.estimateGas(this.gauge, curve.constantOptions)];
1765
1770
  case 1:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.46.5",
3
+ "version": "2.46.6",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",