@dhedge/v2-sdk 1.5.2 → 1.5.4

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.
@@ -9,7 +9,7 @@ var axios = _interopDefault(require('axios'));
9
9
  var lodash = require('lodash');
10
10
  var address = require('@ethersproject/address');
11
11
  require('lodash/set');
12
- var abi$o = require('@ethersproject/abi');
12
+ var abi$q = require('@ethersproject/abi');
13
13
  var BigNumber = _interopDefault(require('bignumber.js'));
14
14
  var web3Utils = require('web3-utils');
15
15
  var ethereumjsUtil = require('ethereumjs-util');
@@ -3841,6 +3841,7 @@ var ManagerLogic = {
3841
3841
  Dapp["AAVEV3"] = "aavev3";
3842
3842
  Dapp["ARRAKIS"] = "arrakis";
3843
3843
  Dapp["TOROS"] = "toros";
3844
+ Dapp["VELODROME"] = "velodrome";
3844
3845
  })(exports.Dapp || (exports.Dapp = {}));
3845
3846
 
3846
3847
  (function (Transaction) {
@@ -3870,7 +3871,7 @@ var _factoryAddress, _Network$POLYGON, _Network$OPTIMISM, _routerAddress, _Netwo
3870
3871
  require("dotenv").config();
3871
3872
 
3872
3873
  var factoryAddress = (_factoryAddress = {}, _factoryAddress[exports.Network.POLYGON] = process.env.STAGING_CONTRACTS ? "0xDd87eCdB10cFF7004276AAbAbd30e7a08F69bb53" : "0xfdc7b8bFe0DD3513Cc669bB8d601Cb83e2F69cB0", _factoryAddress[exports.Network.OPTIMISM] = "0x5e61a079A178f0E5784107a4963baAe0c5a680c6", _factoryAddress);
3873
- var routerAddress = (_routerAddress = {}, _routerAddress[exports.Network.POLYGON] = (_Network$POLYGON = {}, _Network$POLYGON[exports.Dapp.SUSHISWAP] = "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506", _Network$POLYGON[exports.Dapp.AAVE] = "0x8dFf5E27EA6b7AC08EbFdf9eB090F32ee9a30fcf", _Network$POLYGON[exports.Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$POLYGON[exports.Dapp.ONEINCH] = "0x1111111254fb6c44bac0bed2854e76f90643097d", _Network$POLYGON[exports.Dapp.QUICKSWAP] = "0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff", _Network$POLYGON[exports.Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$POLYGON[exports.Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$POLYGON[exports.Dapp.ARRAKIS] = "0xbc91a120cCD8F80b819EAF32F0996daC3Fa76a6C", _Network$POLYGON[exports.Dapp.TOROS] = "0x42B1DDcFa1c43E06F483BA0Dd1b9cC923043677f", _Network$POLYGON), _routerAddress[exports.Network.OPTIMISM] = (_Network$OPTIMISM = {}, _Network$OPTIMISM[exports.Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$OPTIMISM[exports.Dapp.SYNTHETIX] = "0x8700dAec35aF8Ff88c16BdF0418774CB3D7599B4", _Network$OPTIMISM[exports.Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$OPTIMISM[exports.Dapp.ONEINCH] = "0x1111111254760F7ab3F16433eea9304126DCd199", _Network$OPTIMISM[exports.Dapp.TOROS] = "0xf8C62BD5f2fEf9E1a329c197F32E77AD6866B022", _Network$OPTIMISM), _routerAddress);
3874
+ var routerAddress = (_routerAddress = {}, _routerAddress[exports.Network.POLYGON] = (_Network$POLYGON = {}, _Network$POLYGON[exports.Dapp.SUSHISWAP] = "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506", _Network$POLYGON[exports.Dapp.AAVE] = "0x8dFf5E27EA6b7AC08EbFdf9eB090F32ee9a30fcf", _Network$POLYGON[exports.Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$POLYGON[exports.Dapp.ONEINCH] = "0x1111111254fb6c44bac0bed2854e76f90643097d", _Network$POLYGON[exports.Dapp.QUICKSWAP] = "0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff", _Network$POLYGON[exports.Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$POLYGON[exports.Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$POLYGON[exports.Dapp.ARRAKIS] = "0xbc91a120cCD8F80b819EAF32F0996daC3Fa76a6C", _Network$POLYGON[exports.Dapp.TOROS] = "0x42B1DDcFa1c43E06F483BA0Dd1b9cC923043677f", _Network$POLYGON), _routerAddress[exports.Network.OPTIMISM] = (_Network$OPTIMISM = {}, _Network$OPTIMISM[exports.Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$OPTIMISM[exports.Dapp.SYNTHETIX] = "0x8700dAec35aF8Ff88c16BdF0418774CB3D7599B4", _Network$OPTIMISM[exports.Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$OPTIMISM[exports.Dapp.ONEINCH] = "0x1111111254760F7ab3F16433eea9304126DCd199", _Network$OPTIMISM[exports.Dapp.TOROS] = "0xf8C62BD5f2fEf9E1a329c197F32E77AD6866B022", _Network$OPTIMISM[exports.Dapp.VELODROME] = "0x9c12939390052919aF3155f41Bf4160Fd3666A6f", _Network$OPTIMISM), _routerAddress);
3874
3875
  var dappFactoryAddress = (_dappFactoryAddress = {}, _dappFactoryAddress[exports.Network.POLYGON] = (_Network$POLYGON2 = {}, _Network$POLYGON2[exports.Dapp.SUSHISWAP] = "0xc35DADB65012eC5796536bD9864eD8773aBc74C4", _Network$POLYGON2[exports.Dapp.QUICKSWAP] = "0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32", _Network$POLYGON2), _dappFactoryAddress[exports.Network.OPTIMISM] = {}, _dappFactoryAddress);
3875
3876
  var stakingAddress = (_stakingAddress = {}, _stakingAddress[exports.Network.POLYGON] = (_Network$POLYGON3 = {}, _Network$POLYGON3[exports.Dapp.SUSHISWAP] = "0x0769fd68dFb93167989C6f7254cd0D766Fb2841F", _Network$POLYGON3[exports.Dapp.BALANCER] = "0x0F3e0c4218b7b0108a3643cFe9D3ec0d4F57c54e", _Network$POLYGON3[exports.Dapp.AAVE] = "0x357D51124f59836DeD84c8a1730D72B749d8BC23", _Network$POLYGON3[exports.Dapp.AAVEV3] = "0x929EC64c34a17401F460460D4B9390518E5B473e", _Network$POLYGON3), _stakingAddress[exports.Network.OPTIMISM] = (_Network$OPTIMISM2 = {}, _Network$OPTIMISM2[exports.Dapp.AAVEV3] = "0x929EC64c34a17401F460460D4B9390518E5B473e", _Network$OPTIMISM2), _stakingAddress);
3876
3877
  var aaveAddressProvider = (_aaveAddressProvider = {}, _aaveAddressProvider[exports.Network.POLYGON] = (_Network$POLYGON4 = {}, _Network$POLYGON4[exports.Dapp.AAVE] = "0xd05e3E715d945B59290df0ae8eF85c1BdB684744", _Network$POLYGON4[exports.Dapp.AAVEV3] = "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb", _Network$POLYGON4), _aaveAddressProvider[exports.Network.OPTIMISM] = (_Network$OPTIMISM3 = {}, _Network$OPTIMISM3[exports.Dapp.AAVEV3] = "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb", _Network$OPTIMISM3), _aaveAddressProvider);
@@ -8065,6 +8066,41 @@ var IBalancerRewardsGauge = {
8065
8066
  abi: abi$d
8066
8067
  };
8067
8068
 
8069
+ function call(_x, _x2, _x3, _x4) {
8070
+ return _call.apply(this, arguments);
8071
+ }
8072
+
8073
+ function _call() {
8074
+ _call = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(provider, abi, call, options) {
8075
+ var contract, params;
8076
+ return runtime_1.wrap(function _callee2$(_context2) {
8077
+ while (1) {
8078
+ switch (_context2.prev = _context2.next) {
8079
+ case 0:
8080
+ contract = new ethers.ethers.Contract(call[0], abi, provider);
8081
+ _context2.prev = 1;
8082
+ params = call[2] || [];
8083
+ _context2.next = 5;
8084
+ return contract[call[1]].apply(contract, params.concat([options || {}]));
8085
+
8086
+ case 5:
8087
+ return _context2.abrupt("return", _context2.sent);
8088
+
8089
+ case 8:
8090
+ _context2.prev = 8;
8091
+ _context2.t0 = _context2["catch"](1);
8092
+ return _context2.abrupt("return", Promise.reject(_context2.t0));
8093
+
8094
+ case 11:
8095
+ case "end":
8096
+ return _context2.stop();
8097
+ }
8098
+ }
8099
+ }, _callee2, null, [[1, 8]]);
8100
+ }));
8101
+ return _call.apply(this, arguments);
8102
+ }
8103
+
8068
8104
  function multicall(_x5, _x6, _x7, _x8, _x9, _x10) {
8069
8105
  return _multicall.apply(this, arguments);
8070
8106
  }
@@ -8085,7 +8121,7 @@ function _multicall() {
8085
8121
  }
8086
8122
 
8087
8123
  multi = new ethers.ethers.Contract(multiCallAddress[network], ["function tryAggregate(bool requireSuccess, tuple(address, bytes)[] memory calls) public view returns (tuple(bool, bytes)[] memory returnData)"], provider);
8088
- itf = new abi$o.Interface(abi);
8124
+ itf = new abi$q.Interface(abi);
8089
8125
  _context3.prev = 4;
8090
8126
  _context3.next = 7;
8091
8127
  return multi.tryAggregate( // if false, allows individual calls to fail without causing entire multicall to fail
@@ -13719,241 +13755,2320 @@ function _getAaveV3ClaimTxData() {
13719
13755
  return _getAaveV3ClaimTxData.apply(this, arguments);
13720
13756
  }
13721
13757
 
13722
- var Pool = /*#__PURE__*/function () {
13723
- function Pool(network, signer, poolLogic, mangerLogic, utils, factory) {
13724
- this.network = network;
13725
- this.poolLogic = poolLogic;
13726
- this.address = poolLogic.address;
13727
- this.managerLogic = mangerLogic;
13728
- this.signer = signer;
13729
- this.utils = utils;
13730
- this.factory = factory;
13731
- }
13732
- /**
13733
- * Return the assets with balances and deposit info of a pool
13734
- * @returns {Promise<FundComposition[]>} Composition of assets with balance, deposit info
13735
- */
13736
-
13737
-
13738
- var _proto = Pool.prototype;
13739
-
13740
- _proto.getComposition =
13741
- /*#__PURE__*/
13742
- function () {
13743
- var _getComposition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
13744
- var result, fundComposition;
13745
- return runtime_1.wrap(function _callee$(_context) {
13746
- while (1) {
13747
- switch (_context.prev = _context.next) {
13748
- case 0:
13749
- _context.next = 2;
13750
- return this.managerLogic.getFundComposition();
13751
-
13752
- case 2:
13753
- result = _context.sent;
13754
- fundComposition = result[0].map(function (item, index) {
13755
- var asset = item.asset,
13756
- isDeposit = item.isDeposit;
13757
- return {
13758
- asset: asset,
13759
- isDeposit: isDeposit,
13760
- balance: result[1][index],
13761
- rate: result[2][index]
13762
- };
13763
- });
13764
- return _context.abrupt("return", fundComposition);
13765
-
13766
- case 5:
13767
- case "end":
13768
- return _context.stop();
13769
- }
13770
- }
13771
- }, _callee, this);
13772
- }));
13773
-
13774
- function getComposition() {
13775
- return _getComposition.apply(this, arguments);
13776
- }
13777
-
13778
- return getComposition;
13779
- }() //Invest functions
13780
-
13781
- /**
13782
- * Approve the asset that can be deposited into a pool
13783
- * @param {string} nasset Address of deposit asset
13784
- * @param {BigNumber | string} amount Amount to be approved
13785
- * @param {any} options Transaction options
13786
- * @returns {Promise<any>} Transaction
13787
- */
13788
- ;
13789
-
13790
- _proto.approveDeposit =
13791
- /*#__PURE__*/
13792
- function () {
13793
- var _approveDeposit = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(asset, amount, options) {
13794
- var iERC20, tx;
13795
- return runtime_1.wrap(function _callee2$(_context2) {
13796
- while (1) {
13797
- switch (_context2.prev = _context2.next) {
13798
- case 0:
13799
- if (options === void 0) {
13800
- options = null;
13801
- }
13802
-
13803
- iERC20 = new ethers.ethers.Contract(asset, IERC20.abi, this.signer);
13804
- _context2.next = 4;
13805
- return iERC20.approve(this.address, amount, options);
13806
-
13807
- case 4:
13808
- tx = _context2.sent;
13809
- return _context2.abrupt("return", tx);
13810
-
13811
- case 6:
13812
- case "end":
13813
- return _context2.stop();
13814
- }
13815
- }
13816
- }, _callee2, this);
13817
- }));
13818
-
13819
- function approveDeposit(_x, _x2, _x3) {
13820
- return _approveDeposit.apply(this, arguments);
13821
- }
13822
-
13823
- return approveDeposit;
13824
- }()
13825
- /**
13826
- * Deposit asset into a pool
13827
- * @param {string} asset Address of asset
13828
- * @param {BigNumber | string} amount Amount to be deposited
13829
- * @param {any} options Transaction options
13830
- * @returns {Promise<any>} Transaction
13831
- */
13832
- ;
13833
-
13834
- _proto.deposit =
13835
- /*#__PURE__*/
13836
- function () {
13837
- var _deposit = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(asset, amount, options) {
13838
- var tx;
13839
- return runtime_1.wrap(function _callee3$(_context3) {
13840
- while (1) {
13841
- switch (_context3.prev = _context3.next) {
13842
- case 0:
13843
- if (options === void 0) {
13844
- options = null;
13845
- }
13846
-
13847
- _context3.next = 3;
13848
- return this.poolLogic.deposit(asset, amount, options);
13849
-
13850
- case 3:
13851
- tx = _context3.sent;
13852
- return _context3.abrupt("return", tx);
13853
-
13854
- case 5:
13855
- case "end":
13856
- return _context3.stop();
13857
- }
13858
- }
13859
- }, _callee3, this);
13860
- }));
13861
-
13862
- function deposit(_x4, _x5, _x6) {
13863
- return _deposit.apply(this, arguments);
13864
- }
13865
-
13866
- return deposit;
13867
- }()
13868
- /**
13869
- * Withdraw assets from a pool
13870
- * @param fundTokenAmount Amount of pool tokens to be withdrawn
13871
- * @param {any} options Transaction options
13872
- * @returns {Promise<any>} Transaction
13873
- */
13874
- ;
13875
-
13876
- _proto.withdraw =
13877
- /*#__PURE__*/
13878
- function () {
13879
- var _withdraw = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(fundTokenAmount, options) {
13880
- var tx;
13881
- return runtime_1.wrap(function _callee4$(_context4) {
13882
- while (1) {
13883
- switch (_context4.prev = _context4.next) {
13884
- case 0:
13885
- if (options === void 0) {
13886
- options = null;
13887
- }
13888
-
13889
- _context4.next = 3;
13890
- return this.poolLogic.withdraw(fundTokenAmount, options);
13891
-
13892
- case 3:
13893
- tx = _context4.sent;
13894
- return _context4.abrupt("return", tx);
13895
-
13896
- case 5:
13897
- case "end":
13898
- return _context4.stop();
13899
- }
13900
- }
13901
- }, _callee4, this);
13902
- }));
13903
-
13904
- function withdraw(_x7, _x8) {
13905
- return _withdraw.apply(this, arguments);
13906
- }
13907
-
13908
- return withdraw;
13909
- }() //Manager functions
13910
-
13911
- /**
13912
- * Approve the asset for trading and providing liquidity
13913
- * @param {Dapp} dapp Platform like Sushiswap or Uniswap
13914
- * @param {string} asset Address of asset
13915
- * @param @param {BigNumber | string} Amount to be approved
13916
- * @param {any} options Transaction options
13917
- * @returns {Promise<any>} Transaction
13918
- */
13919
- ;
13920
-
13921
- _proto.approve =
13922
- /*#__PURE__*/
13923
- function () {
13924
- var _approve = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(dapp, asset, amount, options) {
13925
- var iERC20, approveTxData, tx;
13926
- return runtime_1.wrap(function _callee5$(_context5) {
13927
- while (1) {
13928
- switch (_context5.prev = _context5.next) {
13929
- case 0:
13930
- if (options === void 0) {
13931
- options = null;
13932
- }
13933
-
13934
- iERC20 = new ethers.ethers.utils.Interface(IERC20.abi);
13935
- approveTxData = iERC20.encodeFunctionData("approve", [routerAddress[this.network][dapp], amount]);
13936
- _context5.next = 5;
13937
- return this.poolLogic.execTransaction(asset, approveTxData, options);
13938
-
13939
- case 5:
13940
- tx = _context5.sent;
13941
- return _context5.abrupt("return", tx);
13942
-
13943
- case 7:
13944
- case "end":
13945
- return _context5.stop();
13946
- }
13947
- }
13948
- }, _callee5, this);
13949
- }));
13950
-
13951
- function approve(_x9, _x10, _x11, _x12) {
13952
- return _approve.apply(this, arguments);
13953
- }
13954
-
13955
- return approve;
13956
- }()
13758
+ var abi$l = [
13759
+ {
13760
+ inputs: [
13761
+ {
13762
+ internalType: "address",
13763
+ name: "_factory",
13764
+ type: "address"
13765
+ },
13766
+ {
13767
+ internalType: "address",
13768
+ name: "_weth",
13769
+ type: "address"
13770
+ }
13771
+ ],
13772
+ stateMutability: "nonpayable",
13773
+ type: "constructor"
13774
+ },
13775
+ {
13776
+ inputs: [
13777
+ {
13778
+ internalType: "uint256[]",
13779
+ name: "amounts",
13780
+ type: "uint256[]"
13781
+ },
13782
+ {
13783
+ components: [
13784
+ {
13785
+ internalType: "address",
13786
+ name: "from",
13787
+ type: "address"
13788
+ },
13789
+ {
13790
+ internalType: "address",
13791
+ name: "to",
13792
+ type: "address"
13793
+ },
13794
+ {
13795
+ internalType: "bool",
13796
+ name: "stable",
13797
+ type: "bool"
13798
+ }
13799
+ ],
13800
+ internalType: "struct Router.route[]",
13801
+ name: "routes",
13802
+ type: "tuple[]"
13803
+ },
13804
+ {
13805
+ internalType: "address",
13806
+ name: "to",
13807
+ type: "address"
13808
+ },
13809
+ {
13810
+ internalType: "uint256",
13811
+ name: "deadline",
13812
+ type: "uint256"
13813
+ }
13814
+ ],
13815
+ name: "UNSAFE_swapExactTokensForTokens",
13816
+ outputs: [
13817
+ {
13818
+ internalType: "uint256[]",
13819
+ name: "",
13820
+ type: "uint256[]"
13821
+ }
13822
+ ],
13823
+ stateMutability: "nonpayable",
13824
+ type: "function"
13825
+ },
13826
+ {
13827
+ inputs: [
13828
+ {
13829
+ internalType: "address",
13830
+ name: "tokenA",
13831
+ type: "address"
13832
+ },
13833
+ {
13834
+ internalType: "address",
13835
+ name: "tokenB",
13836
+ type: "address"
13837
+ },
13838
+ {
13839
+ internalType: "bool",
13840
+ name: "stable",
13841
+ type: "bool"
13842
+ },
13843
+ {
13844
+ internalType: "uint256",
13845
+ name: "amountADesired",
13846
+ type: "uint256"
13847
+ },
13848
+ {
13849
+ internalType: "uint256",
13850
+ name: "amountBDesired",
13851
+ type: "uint256"
13852
+ },
13853
+ {
13854
+ internalType: "uint256",
13855
+ name: "amountAMin",
13856
+ type: "uint256"
13857
+ },
13858
+ {
13859
+ internalType: "uint256",
13860
+ name: "amountBMin",
13861
+ type: "uint256"
13862
+ },
13863
+ {
13864
+ internalType: "address",
13865
+ name: "to",
13866
+ type: "address"
13867
+ },
13868
+ {
13869
+ internalType: "uint256",
13870
+ name: "deadline",
13871
+ type: "uint256"
13872
+ }
13873
+ ],
13874
+ name: "addLiquidity",
13875
+ outputs: [
13876
+ {
13877
+ internalType: "uint256",
13878
+ name: "amountA",
13879
+ type: "uint256"
13880
+ },
13881
+ {
13882
+ internalType: "uint256",
13883
+ name: "amountB",
13884
+ type: "uint256"
13885
+ },
13886
+ {
13887
+ internalType: "uint256",
13888
+ name: "liquidity",
13889
+ type: "uint256"
13890
+ }
13891
+ ],
13892
+ stateMutability: "nonpayable",
13893
+ type: "function"
13894
+ },
13895
+ {
13896
+ inputs: [
13897
+ {
13898
+ internalType: "address",
13899
+ name: "token",
13900
+ type: "address"
13901
+ },
13902
+ {
13903
+ internalType: "bool",
13904
+ name: "stable",
13905
+ type: "bool"
13906
+ },
13907
+ {
13908
+ internalType: "uint256",
13909
+ name: "amountTokenDesired",
13910
+ type: "uint256"
13911
+ },
13912
+ {
13913
+ internalType: "uint256",
13914
+ name: "amountTokenMin",
13915
+ type: "uint256"
13916
+ },
13917
+ {
13918
+ internalType: "uint256",
13919
+ name: "amountETHMin",
13920
+ type: "uint256"
13921
+ },
13922
+ {
13923
+ internalType: "address",
13924
+ name: "to",
13925
+ type: "address"
13926
+ },
13927
+ {
13928
+ internalType: "uint256",
13929
+ name: "deadline",
13930
+ type: "uint256"
13931
+ }
13932
+ ],
13933
+ name: "addLiquidityETH",
13934
+ outputs: [
13935
+ {
13936
+ internalType: "uint256",
13937
+ name: "amountToken",
13938
+ type: "uint256"
13939
+ },
13940
+ {
13941
+ internalType: "uint256",
13942
+ name: "amountETH",
13943
+ type: "uint256"
13944
+ },
13945
+ {
13946
+ internalType: "uint256",
13947
+ name: "liquidity",
13948
+ type: "uint256"
13949
+ }
13950
+ ],
13951
+ stateMutability: "payable",
13952
+ type: "function"
13953
+ },
13954
+ {
13955
+ inputs: [
13956
+ ],
13957
+ name: "factory",
13958
+ outputs: [
13959
+ {
13960
+ internalType: "address",
13961
+ name: "",
13962
+ type: "address"
13963
+ }
13964
+ ],
13965
+ stateMutability: "view",
13966
+ type: "function"
13967
+ },
13968
+ {
13969
+ inputs: [
13970
+ {
13971
+ internalType: "uint256",
13972
+ name: "amountIn",
13973
+ type: "uint256"
13974
+ },
13975
+ {
13976
+ internalType: "address",
13977
+ name: "tokenIn",
13978
+ type: "address"
13979
+ },
13980
+ {
13981
+ internalType: "address",
13982
+ name: "tokenOut",
13983
+ type: "address"
13984
+ }
13985
+ ],
13986
+ name: "getAmountOut",
13987
+ outputs: [
13988
+ {
13989
+ internalType: "uint256",
13990
+ name: "amount",
13991
+ type: "uint256"
13992
+ },
13993
+ {
13994
+ internalType: "bool",
13995
+ name: "stable",
13996
+ type: "bool"
13997
+ }
13998
+ ],
13999
+ stateMutability: "view",
14000
+ type: "function"
14001
+ },
14002
+ {
14003
+ inputs: [
14004
+ {
14005
+ internalType: "uint256",
14006
+ name: "amountIn",
14007
+ type: "uint256"
14008
+ },
14009
+ {
14010
+ components: [
14011
+ {
14012
+ internalType: "address",
14013
+ name: "from",
14014
+ type: "address"
14015
+ },
14016
+ {
14017
+ internalType: "address",
14018
+ name: "to",
14019
+ type: "address"
14020
+ },
14021
+ {
14022
+ internalType: "bool",
14023
+ name: "stable",
14024
+ type: "bool"
14025
+ }
14026
+ ],
14027
+ internalType: "struct Router.route[]",
14028
+ name: "routes",
14029
+ type: "tuple[]"
14030
+ }
14031
+ ],
14032
+ name: "getAmountsOut",
14033
+ outputs: [
14034
+ {
14035
+ internalType: "uint256[]",
14036
+ name: "amounts",
14037
+ type: "uint256[]"
14038
+ }
14039
+ ],
14040
+ stateMutability: "view",
14041
+ type: "function"
14042
+ },
14043
+ {
14044
+ inputs: [
14045
+ {
14046
+ internalType: "address",
14047
+ name: "tokenA",
14048
+ type: "address"
14049
+ },
14050
+ {
14051
+ internalType: "address",
14052
+ name: "tokenB",
14053
+ type: "address"
14054
+ },
14055
+ {
14056
+ internalType: "bool",
14057
+ name: "stable",
14058
+ type: "bool"
14059
+ }
14060
+ ],
14061
+ name: "getReserves",
14062
+ outputs: [
14063
+ {
14064
+ internalType: "uint256",
14065
+ name: "reserveA",
14066
+ type: "uint256"
14067
+ },
14068
+ {
14069
+ internalType: "uint256",
14070
+ name: "reserveB",
14071
+ type: "uint256"
14072
+ }
14073
+ ],
14074
+ stateMutability: "view",
14075
+ type: "function"
14076
+ },
14077
+ {
14078
+ inputs: [
14079
+ {
14080
+ internalType: "address",
14081
+ name: "pair",
14082
+ type: "address"
14083
+ }
14084
+ ],
14085
+ name: "isPair",
14086
+ outputs: [
14087
+ {
14088
+ internalType: "bool",
14089
+ name: "",
14090
+ type: "bool"
14091
+ }
14092
+ ],
14093
+ stateMutability: "view",
14094
+ type: "function"
14095
+ },
14096
+ {
14097
+ inputs: [
14098
+ {
14099
+ internalType: "address",
14100
+ name: "tokenA",
14101
+ type: "address"
14102
+ },
14103
+ {
14104
+ internalType: "address",
14105
+ name: "tokenB",
14106
+ type: "address"
14107
+ },
14108
+ {
14109
+ internalType: "bool",
14110
+ name: "stable",
14111
+ type: "bool"
14112
+ }
14113
+ ],
14114
+ name: "pairFor",
14115
+ outputs: [
14116
+ {
14117
+ internalType: "address",
14118
+ name: "pair",
14119
+ type: "address"
14120
+ }
14121
+ ],
14122
+ stateMutability: "view",
14123
+ type: "function"
14124
+ },
14125
+ {
14126
+ inputs: [
14127
+ {
14128
+ internalType: "address",
14129
+ name: "tokenA",
14130
+ type: "address"
14131
+ },
14132
+ {
14133
+ internalType: "address",
14134
+ name: "tokenB",
14135
+ type: "address"
14136
+ },
14137
+ {
14138
+ internalType: "bool",
14139
+ name: "stable",
14140
+ type: "bool"
14141
+ },
14142
+ {
14143
+ internalType: "uint256",
14144
+ name: "amountADesired",
14145
+ type: "uint256"
14146
+ },
14147
+ {
14148
+ internalType: "uint256",
14149
+ name: "amountBDesired",
14150
+ type: "uint256"
14151
+ }
14152
+ ],
14153
+ name: "quoteAddLiquidity",
14154
+ outputs: [
14155
+ {
14156
+ internalType: "uint256",
14157
+ name: "amountA",
14158
+ type: "uint256"
14159
+ },
14160
+ {
14161
+ internalType: "uint256",
14162
+ name: "amountB",
14163
+ type: "uint256"
14164
+ },
14165
+ {
14166
+ internalType: "uint256",
14167
+ name: "liquidity",
14168
+ type: "uint256"
14169
+ }
14170
+ ],
14171
+ stateMutability: "view",
14172
+ type: "function"
14173
+ },
14174
+ {
14175
+ inputs: [
14176
+ {
14177
+ internalType: "address",
14178
+ name: "tokenA",
14179
+ type: "address"
14180
+ },
14181
+ {
14182
+ internalType: "address",
14183
+ name: "tokenB",
14184
+ type: "address"
14185
+ },
14186
+ {
14187
+ internalType: "bool",
14188
+ name: "stable",
14189
+ type: "bool"
14190
+ },
14191
+ {
14192
+ internalType: "uint256",
14193
+ name: "liquidity",
14194
+ type: "uint256"
14195
+ }
14196
+ ],
14197
+ name: "quoteRemoveLiquidity",
14198
+ outputs: [
14199
+ {
14200
+ internalType: "uint256",
14201
+ name: "amountA",
14202
+ type: "uint256"
14203
+ },
14204
+ {
14205
+ internalType: "uint256",
14206
+ name: "amountB",
14207
+ type: "uint256"
14208
+ }
14209
+ ],
14210
+ stateMutability: "view",
14211
+ type: "function"
14212
+ },
14213
+ {
14214
+ inputs: [
14215
+ {
14216
+ internalType: "address",
14217
+ name: "tokenA",
14218
+ type: "address"
14219
+ },
14220
+ {
14221
+ internalType: "address",
14222
+ name: "tokenB",
14223
+ type: "address"
14224
+ },
14225
+ {
14226
+ internalType: "bool",
14227
+ name: "stable",
14228
+ type: "bool"
14229
+ },
14230
+ {
14231
+ internalType: "uint256",
14232
+ name: "liquidity",
14233
+ type: "uint256"
14234
+ },
14235
+ {
14236
+ internalType: "uint256",
14237
+ name: "amountAMin",
14238
+ type: "uint256"
14239
+ },
14240
+ {
14241
+ internalType: "uint256",
14242
+ name: "amountBMin",
14243
+ type: "uint256"
14244
+ },
14245
+ {
14246
+ internalType: "address",
14247
+ name: "to",
14248
+ type: "address"
14249
+ },
14250
+ {
14251
+ internalType: "uint256",
14252
+ name: "deadline",
14253
+ type: "uint256"
14254
+ }
14255
+ ],
14256
+ name: "removeLiquidity",
14257
+ outputs: [
14258
+ {
14259
+ internalType: "uint256",
14260
+ name: "amountA",
14261
+ type: "uint256"
14262
+ },
14263
+ {
14264
+ internalType: "uint256",
14265
+ name: "amountB",
14266
+ type: "uint256"
14267
+ }
14268
+ ],
14269
+ stateMutability: "nonpayable",
14270
+ type: "function"
14271
+ },
14272
+ {
14273
+ inputs: [
14274
+ {
14275
+ internalType: "address",
14276
+ name: "token",
14277
+ type: "address"
14278
+ },
14279
+ {
14280
+ internalType: "bool",
14281
+ name: "stable",
14282
+ type: "bool"
14283
+ },
14284
+ {
14285
+ internalType: "uint256",
14286
+ name: "liquidity",
14287
+ type: "uint256"
14288
+ },
14289
+ {
14290
+ internalType: "uint256",
14291
+ name: "amountTokenMin",
14292
+ type: "uint256"
14293
+ },
14294
+ {
14295
+ internalType: "uint256",
14296
+ name: "amountETHMin",
14297
+ type: "uint256"
14298
+ },
14299
+ {
14300
+ internalType: "address",
14301
+ name: "to",
14302
+ type: "address"
14303
+ },
14304
+ {
14305
+ internalType: "uint256",
14306
+ name: "deadline",
14307
+ type: "uint256"
14308
+ }
14309
+ ],
14310
+ name: "removeLiquidityETH",
14311
+ outputs: [
14312
+ {
14313
+ internalType: "uint256",
14314
+ name: "amountToken",
14315
+ type: "uint256"
14316
+ },
14317
+ {
14318
+ internalType: "uint256",
14319
+ name: "amountETH",
14320
+ type: "uint256"
14321
+ }
14322
+ ],
14323
+ stateMutability: "nonpayable",
14324
+ type: "function"
14325
+ },
14326
+ {
14327
+ inputs: [
14328
+ {
14329
+ internalType: "address",
14330
+ name: "token",
14331
+ type: "address"
14332
+ },
14333
+ {
14334
+ internalType: "bool",
14335
+ name: "stable",
14336
+ type: "bool"
14337
+ },
14338
+ {
14339
+ internalType: "uint256",
14340
+ name: "liquidity",
14341
+ type: "uint256"
14342
+ },
14343
+ {
14344
+ internalType: "uint256",
14345
+ name: "amountTokenMin",
14346
+ type: "uint256"
14347
+ },
14348
+ {
14349
+ internalType: "uint256",
14350
+ name: "amountETHMin",
14351
+ type: "uint256"
14352
+ },
14353
+ {
14354
+ internalType: "address",
14355
+ name: "to",
14356
+ type: "address"
14357
+ },
14358
+ {
14359
+ internalType: "uint256",
14360
+ name: "deadline",
14361
+ type: "uint256"
14362
+ },
14363
+ {
14364
+ internalType: "bool",
14365
+ name: "approveMax",
14366
+ type: "bool"
14367
+ },
14368
+ {
14369
+ internalType: "uint8",
14370
+ name: "v",
14371
+ type: "uint8"
14372
+ },
14373
+ {
14374
+ internalType: "bytes32",
14375
+ name: "r",
14376
+ type: "bytes32"
14377
+ },
14378
+ {
14379
+ internalType: "bytes32",
14380
+ name: "s",
14381
+ type: "bytes32"
14382
+ }
14383
+ ],
14384
+ name: "removeLiquidityETHWithPermit",
14385
+ outputs: [
14386
+ {
14387
+ internalType: "uint256",
14388
+ name: "amountToken",
14389
+ type: "uint256"
14390
+ },
14391
+ {
14392
+ internalType: "uint256",
14393
+ name: "amountETH",
14394
+ type: "uint256"
14395
+ }
14396
+ ],
14397
+ stateMutability: "nonpayable",
14398
+ type: "function"
14399
+ },
14400
+ {
14401
+ inputs: [
14402
+ {
14403
+ internalType: "address",
14404
+ name: "tokenA",
14405
+ type: "address"
14406
+ },
14407
+ {
14408
+ internalType: "address",
14409
+ name: "tokenB",
14410
+ type: "address"
14411
+ },
14412
+ {
14413
+ internalType: "bool",
14414
+ name: "stable",
14415
+ type: "bool"
14416
+ },
14417
+ {
14418
+ internalType: "uint256",
14419
+ name: "liquidity",
14420
+ type: "uint256"
14421
+ },
14422
+ {
14423
+ internalType: "uint256",
14424
+ name: "amountAMin",
14425
+ type: "uint256"
14426
+ },
14427
+ {
14428
+ internalType: "uint256",
14429
+ name: "amountBMin",
14430
+ type: "uint256"
14431
+ },
14432
+ {
14433
+ internalType: "address",
14434
+ name: "to",
14435
+ type: "address"
14436
+ },
14437
+ {
14438
+ internalType: "uint256",
14439
+ name: "deadline",
14440
+ type: "uint256"
14441
+ },
14442
+ {
14443
+ internalType: "bool",
14444
+ name: "approveMax",
14445
+ type: "bool"
14446
+ },
14447
+ {
14448
+ internalType: "uint8",
14449
+ name: "v",
14450
+ type: "uint8"
14451
+ },
14452
+ {
14453
+ internalType: "bytes32",
14454
+ name: "r",
14455
+ type: "bytes32"
14456
+ },
14457
+ {
14458
+ internalType: "bytes32",
14459
+ name: "s",
14460
+ type: "bytes32"
14461
+ }
14462
+ ],
14463
+ name: "removeLiquidityWithPermit",
14464
+ outputs: [
14465
+ {
14466
+ internalType: "uint256",
14467
+ name: "amountA",
14468
+ type: "uint256"
14469
+ },
14470
+ {
14471
+ internalType: "uint256",
14472
+ name: "amountB",
14473
+ type: "uint256"
14474
+ }
14475
+ ],
14476
+ stateMutability: "nonpayable",
14477
+ type: "function"
14478
+ },
14479
+ {
14480
+ inputs: [
14481
+ {
14482
+ internalType: "address",
14483
+ name: "tokenA",
14484
+ type: "address"
14485
+ },
14486
+ {
14487
+ internalType: "address",
14488
+ name: "tokenB",
14489
+ type: "address"
14490
+ }
14491
+ ],
14492
+ name: "sortTokens",
14493
+ outputs: [
14494
+ {
14495
+ internalType: "address",
14496
+ name: "token0",
14497
+ type: "address"
14498
+ },
14499
+ {
14500
+ internalType: "address",
14501
+ name: "token1",
14502
+ type: "address"
14503
+ }
14504
+ ],
14505
+ stateMutability: "pure",
14506
+ type: "function"
14507
+ },
14508
+ {
14509
+ inputs: [
14510
+ {
14511
+ internalType: "uint256",
14512
+ name: "amountOutMin",
14513
+ type: "uint256"
14514
+ },
14515
+ {
14516
+ components: [
14517
+ {
14518
+ internalType: "address",
14519
+ name: "from",
14520
+ type: "address"
14521
+ },
14522
+ {
14523
+ internalType: "address",
14524
+ name: "to",
14525
+ type: "address"
14526
+ },
14527
+ {
14528
+ internalType: "bool",
14529
+ name: "stable",
14530
+ type: "bool"
14531
+ }
14532
+ ],
14533
+ internalType: "struct Router.route[]",
14534
+ name: "routes",
14535
+ type: "tuple[]"
14536
+ },
14537
+ {
14538
+ internalType: "address",
14539
+ name: "to",
14540
+ type: "address"
14541
+ },
14542
+ {
14543
+ internalType: "uint256",
14544
+ name: "deadline",
14545
+ type: "uint256"
14546
+ }
14547
+ ],
14548
+ name: "swapExactETHForTokens",
14549
+ outputs: [
14550
+ {
14551
+ internalType: "uint256[]",
14552
+ name: "amounts",
14553
+ type: "uint256[]"
14554
+ }
14555
+ ],
14556
+ stateMutability: "payable",
14557
+ type: "function"
14558
+ },
14559
+ {
14560
+ inputs: [
14561
+ {
14562
+ internalType: "uint256",
14563
+ name: "amountIn",
14564
+ type: "uint256"
14565
+ },
14566
+ {
14567
+ internalType: "uint256",
14568
+ name: "amountOutMin",
14569
+ type: "uint256"
14570
+ },
14571
+ {
14572
+ components: [
14573
+ {
14574
+ internalType: "address",
14575
+ name: "from",
14576
+ type: "address"
14577
+ },
14578
+ {
14579
+ internalType: "address",
14580
+ name: "to",
14581
+ type: "address"
14582
+ },
14583
+ {
14584
+ internalType: "bool",
14585
+ name: "stable",
14586
+ type: "bool"
14587
+ }
14588
+ ],
14589
+ internalType: "struct Router.route[]",
14590
+ name: "routes",
14591
+ type: "tuple[]"
14592
+ },
14593
+ {
14594
+ internalType: "address",
14595
+ name: "to",
14596
+ type: "address"
14597
+ },
14598
+ {
14599
+ internalType: "uint256",
14600
+ name: "deadline",
14601
+ type: "uint256"
14602
+ }
14603
+ ],
14604
+ name: "swapExactTokensForETH",
14605
+ outputs: [
14606
+ {
14607
+ internalType: "uint256[]",
14608
+ name: "amounts",
14609
+ type: "uint256[]"
14610
+ }
14611
+ ],
14612
+ stateMutability: "nonpayable",
14613
+ type: "function"
14614
+ },
14615
+ {
14616
+ inputs: [
14617
+ {
14618
+ internalType: "uint256",
14619
+ name: "amountIn",
14620
+ type: "uint256"
14621
+ },
14622
+ {
14623
+ internalType: "uint256",
14624
+ name: "amountOutMin",
14625
+ type: "uint256"
14626
+ },
14627
+ {
14628
+ components: [
14629
+ {
14630
+ internalType: "address",
14631
+ name: "from",
14632
+ type: "address"
14633
+ },
14634
+ {
14635
+ internalType: "address",
14636
+ name: "to",
14637
+ type: "address"
14638
+ },
14639
+ {
14640
+ internalType: "bool",
14641
+ name: "stable",
14642
+ type: "bool"
14643
+ }
14644
+ ],
14645
+ internalType: "struct Router.route[]",
14646
+ name: "routes",
14647
+ type: "tuple[]"
14648
+ },
14649
+ {
14650
+ internalType: "address",
14651
+ name: "to",
14652
+ type: "address"
14653
+ },
14654
+ {
14655
+ internalType: "uint256",
14656
+ name: "deadline",
14657
+ type: "uint256"
14658
+ }
14659
+ ],
14660
+ name: "swapExactTokensForTokens",
14661
+ outputs: [
14662
+ {
14663
+ internalType: "uint256[]",
14664
+ name: "amounts",
14665
+ type: "uint256[]"
14666
+ }
14667
+ ],
14668
+ stateMutability: "nonpayable",
14669
+ type: "function"
14670
+ },
14671
+ {
14672
+ inputs: [
14673
+ {
14674
+ internalType: "uint256",
14675
+ name: "amountIn",
14676
+ type: "uint256"
14677
+ },
14678
+ {
14679
+ internalType: "uint256",
14680
+ name: "amountOutMin",
14681
+ type: "uint256"
14682
+ },
14683
+ {
14684
+ internalType: "address",
14685
+ name: "tokenFrom",
14686
+ type: "address"
14687
+ },
14688
+ {
14689
+ internalType: "address",
14690
+ name: "tokenTo",
14691
+ type: "address"
14692
+ },
14693
+ {
14694
+ internalType: "bool",
14695
+ name: "stable",
14696
+ type: "bool"
14697
+ },
14698
+ {
14699
+ internalType: "address",
14700
+ name: "to",
14701
+ type: "address"
14702
+ },
14703
+ {
14704
+ internalType: "uint256",
14705
+ name: "deadline",
14706
+ type: "uint256"
14707
+ }
14708
+ ],
14709
+ name: "swapExactTokensForTokensSimple",
14710
+ outputs: [
14711
+ {
14712
+ internalType: "uint256[]",
14713
+ name: "amounts",
14714
+ type: "uint256[]"
14715
+ }
14716
+ ],
14717
+ stateMutability: "nonpayable",
14718
+ type: "function"
14719
+ },
14720
+ {
14721
+ inputs: [
14722
+ ],
14723
+ name: "weth",
14724
+ outputs: [
14725
+ {
14726
+ internalType: "contract IWETH",
14727
+ name: "",
14728
+ type: "address"
14729
+ }
14730
+ ],
14731
+ stateMutability: "view",
14732
+ type: "function"
14733
+ },
14734
+ {
14735
+ stateMutability: "payable",
14736
+ type: "receive"
14737
+ }
14738
+ ];
14739
+ var IVelodromeRouter = {
14740
+ abi: abi$l
14741
+ };
14742
+
14743
+ /* eslint-disable @typescript-eslint/no-explicit-any */
14744
+ function getVelodromeAddLiquidityTxData(pool, assetA, assetB, amountA, amountB, isStable) {
14745
+ var iVelodromeRouter = new ethers.ethers.utils.Interface(IVelodromeRouter.abi);
14746
+ return iVelodromeRouter.encodeFunctionData(exports.Transaction.ADD_LIQUIDITY, [assetA, assetB, isStable, amountA, amountB, "0", "0", pool.address, deadline]);
14747
+ }
14748
+ function getVelodromeRemoveLiquidityTxData(pool, assetA, assetB, amount, isStable) {
14749
+ var iVelodromeRouter = new ethers.ethers.utils.Interface(IVelodromeRouter.abi);
14750
+ return iVelodromeRouter.encodeFunctionData(exports.Transaction.REMOVE_LIQUIDITY, [assetA, assetB, isStable, amount, "0", "0", pool.address, deadline]);
14751
+ }
14752
+
14753
+ var abi$m = [
14754
+ {
14755
+ inputs: [
14756
+ {
14757
+ internalType: "address",
14758
+ name: "_stake",
14759
+ type: "address"
14760
+ },
14761
+ {
14762
+ internalType: "address",
14763
+ name: "_internal_bribe",
14764
+ type: "address"
14765
+ },
14766
+ {
14767
+ internalType: "address",
14768
+ name: "_external_bribe",
14769
+ type: "address"
14770
+ },
14771
+ {
14772
+ internalType: "address",
14773
+ name: "__ve",
14774
+ type: "address"
14775
+ },
14776
+ {
14777
+ internalType: "address",
14778
+ name: "_voter",
14779
+ type: "address"
14780
+ },
14781
+ {
14782
+ internalType: "bool",
14783
+ name: "_forPair",
14784
+ type: "bool"
14785
+ },
14786
+ {
14787
+ internalType: "address[]",
14788
+ name: "_allowedRewardTokens",
14789
+ type: "address[]"
14790
+ }
14791
+ ],
14792
+ stateMutability: "nonpayable",
14793
+ type: "constructor"
14794
+ },
14795
+ {
14796
+ anonymous: false,
14797
+ inputs: [
14798
+ {
14799
+ indexed: true,
14800
+ internalType: "address",
14801
+ name: "from",
14802
+ type: "address"
14803
+ },
14804
+ {
14805
+ indexed: false,
14806
+ internalType: "uint256",
14807
+ name: "claimed0",
14808
+ type: "uint256"
14809
+ },
14810
+ {
14811
+ indexed: false,
14812
+ internalType: "uint256",
14813
+ name: "claimed1",
14814
+ type: "uint256"
14815
+ }
14816
+ ],
14817
+ name: "ClaimFees",
14818
+ type: "event"
14819
+ },
14820
+ {
14821
+ anonymous: false,
14822
+ inputs: [
14823
+ {
14824
+ indexed: true,
14825
+ internalType: "address",
14826
+ name: "from",
14827
+ type: "address"
14828
+ },
14829
+ {
14830
+ indexed: true,
14831
+ internalType: "address",
14832
+ name: "reward",
14833
+ type: "address"
14834
+ },
14835
+ {
14836
+ indexed: false,
14837
+ internalType: "uint256",
14838
+ name: "amount",
14839
+ type: "uint256"
14840
+ }
14841
+ ],
14842
+ name: "ClaimRewards",
14843
+ type: "event"
14844
+ },
14845
+ {
14846
+ anonymous: false,
14847
+ inputs: [
14848
+ {
14849
+ indexed: true,
14850
+ internalType: "address",
14851
+ name: "from",
14852
+ type: "address"
14853
+ },
14854
+ {
14855
+ indexed: false,
14856
+ internalType: "uint256",
14857
+ name: "tokenId",
14858
+ type: "uint256"
14859
+ },
14860
+ {
14861
+ indexed: false,
14862
+ internalType: "uint256",
14863
+ name: "amount",
14864
+ type: "uint256"
14865
+ }
14866
+ ],
14867
+ name: "Deposit",
14868
+ type: "event"
14869
+ },
14870
+ {
14871
+ anonymous: false,
14872
+ inputs: [
14873
+ {
14874
+ indexed: true,
14875
+ internalType: "address",
14876
+ name: "from",
14877
+ type: "address"
14878
+ },
14879
+ {
14880
+ indexed: true,
14881
+ internalType: "address",
14882
+ name: "reward",
14883
+ type: "address"
14884
+ },
14885
+ {
14886
+ indexed: false,
14887
+ internalType: "uint256",
14888
+ name: "amount",
14889
+ type: "uint256"
14890
+ }
14891
+ ],
14892
+ name: "NotifyReward",
14893
+ type: "event"
14894
+ },
14895
+ {
14896
+ anonymous: false,
14897
+ inputs: [
14898
+ {
14899
+ indexed: true,
14900
+ internalType: "address",
14901
+ name: "from",
14902
+ type: "address"
14903
+ },
14904
+ {
14905
+ indexed: false,
14906
+ internalType: "uint256",
14907
+ name: "tokenId",
14908
+ type: "uint256"
14909
+ },
14910
+ {
14911
+ indexed: false,
14912
+ internalType: "uint256",
14913
+ name: "amount",
14914
+ type: "uint256"
14915
+ }
14916
+ ],
14917
+ name: "Withdraw",
14918
+ type: "event"
14919
+ },
14920
+ {
14921
+ inputs: [
14922
+ ],
14923
+ name: "_ve",
14924
+ outputs: [
14925
+ {
14926
+ internalType: "address",
14927
+ name: "",
14928
+ type: "address"
14929
+ }
14930
+ ],
14931
+ stateMutability: "view",
14932
+ type: "function"
14933
+ },
14934
+ {
14935
+ inputs: [
14936
+ {
14937
+ internalType: "address",
14938
+ name: "",
14939
+ type: "address"
14940
+ }
14941
+ ],
14942
+ name: "balanceOf",
14943
+ outputs: [
14944
+ {
14945
+ internalType: "uint256",
14946
+ name: "",
14947
+ type: "uint256"
14948
+ }
14949
+ ],
14950
+ stateMutability: "view",
14951
+ type: "function"
14952
+ },
14953
+ {
14954
+ inputs: [
14955
+ {
14956
+ internalType: "address",
14957
+ name: "token",
14958
+ type: "address"
14959
+ },
14960
+ {
14961
+ internalType: "uint256",
14962
+ name: "maxRuns",
14963
+ type: "uint256"
14964
+ }
14965
+ ],
14966
+ name: "batchRewardPerToken",
14967
+ outputs: [
14968
+ ],
14969
+ stateMutability: "nonpayable",
14970
+ type: "function"
14971
+ },
14972
+ {
14973
+ inputs: [
14974
+ {
14975
+ internalType: "address",
14976
+ name: "token",
14977
+ type: "address"
14978
+ },
14979
+ {
14980
+ internalType: "uint256",
14981
+ name: "maxRuns",
14982
+ type: "uint256"
14983
+ }
14984
+ ],
14985
+ name: "batchUpdateRewardPerToken",
14986
+ outputs: [
14987
+ ],
14988
+ stateMutability: "nonpayable",
14989
+ type: "function"
14990
+ },
14991
+ {
14992
+ inputs: [
14993
+ {
14994
+ internalType: "address",
14995
+ name: "",
14996
+ type: "address"
14997
+ },
14998
+ {
14999
+ internalType: "uint256",
15000
+ name: "",
15001
+ type: "uint256"
15002
+ }
15003
+ ],
15004
+ name: "checkpoints",
15005
+ outputs: [
15006
+ {
15007
+ internalType: "uint256",
15008
+ name: "timestamp",
15009
+ type: "uint256"
15010
+ },
15011
+ {
15012
+ internalType: "uint256",
15013
+ name: "balanceOf",
15014
+ type: "uint256"
15015
+ }
15016
+ ],
15017
+ stateMutability: "view",
15018
+ type: "function"
15019
+ },
15020
+ {
15021
+ inputs: [
15022
+ ],
15023
+ name: "claimFees",
15024
+ outputs: [
15025
+ {
15026
+ internalType: "uint256",
15027
+ name: "claimed0",
15028
+ type: "uint256"
15029
+ },
15030
+ {
15031
+ internalType: "uint256",
15032
+ name: "claimed1",
15033
+ type: "uint256"
15034
+ }
15035
+ ],
15036
+ stateMutability: "nonpayable",
15037
+ type: "function"
15038
+ },
15039
+ {
15040
+ inputs: [
15041
+ {
15042
+ internalType: "uint256",
15043
+ name: "amount",
15044
+ type: "uint256"
15045
+ },
15046
+ {
15047
+ internalType: "uint256",
15048
+ name: "tokenId",
15049
+ type: "uint256"
15050
+ }
15051
+ ],
15052
+ name: "deposit",
15053
+ outputs: [
15054
+ ],
15055
+ stateMutability: "nonpayable",
15056
+ type: "function"
15057
+ },
15058
+ {
15059
+ inputs: [
15060
+ {
15061
+ internalType: "uint256",
15062
+ name: "tokenId",
15063
+ type: "uint256"
15064
+ }
15065
+ ],
15066
+ name: "depositAll",
15067
+ outputs: [
15068
+ ],
15069
+ stateMutability: "nonpayable",
15070
+ type: "function"
15071
+ },
15072
+ {
15073
+ inputs: [
15074
+ {
15075
+ internalType: "address",
15076
+ name: "account",
15077
+ type: "address"
15078
+ }
15079
+ ],
15080
+ name: "derivedBalance",
15081
+ outputs: [
15082
+ {
15083
+ internalType: "uint256",
15084
+ name: "",
15085
+ type: "uint256"
15086
+ }
15087
+ ],
15088
+ stateMutability: "view",
15089
+ type: "function"
15090
+ },
15091
+ {
15092
+ inputs: [
15093
+ {
15094
+ internalType: "address",
15095
+ name: "",
15096
+ type: "address"
15097
+ }
15098
+ ],
15099
+ name: "derivedBalances",
15100
+ outputs: [
15101
+ {
15102
+ internalType: "uint256",
15103
+ name: "",
15104
+ type: "uint256"
15105
+ }
15106
+ ],
15107
+ stateMutability: "view",
15108
+ type: "function"
15109
+ },
15110
+ {
15111
+ inputs: [
15112
+ ],
15113
+ name: "derivedSupply",
15114
+ outputs: [
15115
+ {
15116
+ internalType: "uint256",
15117
+ name: "",
15118
+ type: "uint256"
15119
+ }
15120
+ ],
15121
+ stateMutability: "view",
15122
+ type: "function"
15123
+ },
15124
+ {
15125
+ inputs: [
15126
+ {
15127
+ internalType: "address",
15128
+ name: "token",
15129
+ type: "address"
15130
+ },
15131
+ {
15132
+ internalType: "address",
15133
+ name: "account",
15134
+ type: "address"
15135
+ }
15136
+ ],
15137
+ name: "earned",
15138
+ outputs: [
15139
+ {
15140
+ internalType: "uint256",
15141
+ name: "",
15142
+ type: "uint256"
15143
+ }
15144
+ ],
15145
+ stateMutability: "view",
15146
+ type: "function"
15147
+ },
15148
+ {
15149
+ inputs: [
15150
+ ],
15151
+ name: "external_bribe",
15152
+ outputs: [
15153
+ {
15154
+ internalType: "address",
15155
+ name: "",
15156
+ type: "address"
15157
+ }
15158
+ ],
15159
+ stateMutability: "view",
15160
+ type: "function"
15161
+ },
15162
+ {
15163
+ inputs: [
15164
+ ],
15165
+ name: "fees0",
15166
+ outputs: [
15167
+ {
15168
+ internalType: "uint256",
15169
+ name: "",
15170
+ type: "uint256"
15171
+ }
15172
+ ],
15173
+ stateMutability: "view",
15174
+ type: "function"
15175
+ },
15176
+ {
15177
+ inputs: [
15178
+ ],
15179
+ name: "fees1",
15180
+ outputs: [
15181
+ {
15182
+ internalType: "uint256",
15183
+ name: "",
15184
+ type: "uint256"
15185
+ }
15186
+ ],
15187
+ stateMutability: "view",
15188
+ type: "function"
15189
+ },
15190
+ {
15191
+ inputs: [
15192
+ {
15193
+ internalType: "address",
15194
+ name: "account",
15195
+ type: "address"
15196
+ },
15197
+ {
15198
+ internalType: "uint256",
15199
+ name: "timestamp",
15200
+ type: "uint256"
15201
+ }
15202
+ ],
15203
+ name: "getPriorBalanceIndex",
15204
+ outputs: [
15205
+ {
15206
+ internalType: "uint256",
15207
+ name: "",
15208
+ type: "uint256"
15209
+ }
15210
+ ],
15211
+ stateMutability: "view",
15212
+ type: "function"
15213
+ },
15214
+ {
15215
+ inputs: [
15216
+ {
15217
+ internalType: "address",
15218
+ name: "token",
15219
+ type: "address"
15220
+ },
15221
+ {
15222
+ internalType: "uint256",
15223
+ name: "timestamp",
15224
+ type: "uint256"
15225
+ }
15226
+ ],
15227
+ name: "getPriorRewardPerToken",
15228
+ outputs: [
15229
+ {
15230
+ internalType: "uint256",
15231
+ name: "",
15232
+ type: "uint256"
15233
+ },
15234
+ {
15235
+ internalType: "uint256",
15236
+ name: "",
15237
+ type: "uint256"
15238
+ }
15239
+ ],
15240
+ stateMutability: "view",
15241
+ type: "function"
15242
+ },
15243
+ {
15244
+ inputs: [
15245
+ {
15246
+ internalType: "uint256",
15247
+ name: "timestamp",
15248
+ type: "uint256"
15249
+ }
15250
+ ],
15251
+ name: "getPriorSupplyIndex",
15252
+ outputs: [
15253
+ {
15254
+ internalType: "uint256",
15255
+ name: "",
15256
+ type: "uint256"
15257
+ }
15258
+ ],
15259
+ stateMutability: "view",
15260
+ type: "function"
15261
+ },
15262
+ {
15263
+ inputs: [
15264
+ {
15265
+ internalType: "address",
15266
+ name: "account",
15267
+ type: "address"
15268
+ },
15269
+ {
15270
+ internalType: "address[]",
15271
+ name: "tokens",
15272
+ type: "address[]"
15273
+ }
15274
+ ],
15275
+ name: "getReward",
15276
+ outputs: [
15277
+ ],
15278
+ stateMutability: "nonpayable",
15279
+ type: "function"
15280
+ },
15281
+ {
15282
+ inputs: [
15283
+ ],
15284
+ name: "internal_bribe",
15285
+ outputs: [
15286
+ {
15287
+ internalType: "address",
15288
+ name: "",
15289
+ type: "address"
15290
+ }
15291
+ ],
15292
+ stateMutability: "view",
15293
+ type: "function"
15294
+ },
15295
+ {
15296
+ inputs: [
15297
+ ],
15298
+ name: "isForPair",
15299
+ outputs: [
15300
+ {
15301
+ internalType: "bool",
15302
+ name: "",
15303
+ type: "bool"
15304
+ }
15305
+ ],
15306
+ stateMutability: "view",
15307
+ type: "function"
15308
+ },
15309
+ {
15310
+ inputs: [
15311
+ {
15312
+ internalType: "address",
15313
+ name: "",
15314
+ type: "address"
15315
+ }
15316
+ ],
15317
+ name: "isReward",
15318
+ outputs: [
15319
+ {
15320
+ internalType: "bool",
15321
+ name: "",
15322
+ type: "bool"
15323
+ }
15324
+ ],
15325
+ stateMutability: "view",
15326
+ type: "function"
15327
+ },
15328
+ {
15329
+ inputs: [
15330
+ {
15331
+ internalType: "address",
15332
+ name: "",
15333
+ type: "address"
15334
+ },
15335
+ {
15336
+ internalType: "address",
15337
+ name: "",
15338
+ type: "address"
15339
+ }
15340
+ ],
15341
+ name: "lastEarn",
15342
+ outputs: [
15343
+ {
15344
+ internalType: "uint256",
15345
+ name: "",
15346
+ type: "uint256"
15347
+ }
15348
+ ],
15349
+ stateMutability: "view",
15350
+ type: "function"
15351
+ },
15352
+ {
15353
+ inputs: [
15354
+ {
15355
+ internalType: "address",
15356
+ name: "token",
15357
+ type: "address"
15358
+ }
15359
+ ],
15360
+ name: "lastTimeRewardApplicable",
15361
+ outputs: [
15362
+ {
15363
+ internalType: "uint256",
15364
+ name: "",
15365
+ type: "uint256"
15366
+ }
15367
+ ],
15368
+ stateMutability: "view",
15369
+ type: "function"
15370
+ },
15371
+ {
15372
+ inputs: [
15373
+ {
15374
+ internalType: "address",
15375
+ name: "",
15376
+ type: "address"
15377
+ }
15378
+ ],
15379
+ name: "lastUpdateTime",
15380
+ outputs: [
15381
+ {
15382
+ internalType: "uint256",
15383
+ name: "",
15384
+ type: "uint256"
15385
+ }
15386
+ ],
15387
+ stateMutability: "view",
15388
+ type: "function"
15389
+ },
15390
+ {
15391
+ inputs: [
15392
+ {
15393
+ internalType: "address",
15394
+ name: "token",
15395
+ type: "address"
15396
+ }
15397
+ ],
15398
+ name: "left",
15399
+ outputs: [
15400
+ {
15401
+ internalType: "uint256",
15402
+ name: "",
15403
+ type: "uint256"
15404
+ }
15405
+ ],
15406
+ stateMutability: "view",
15407
+ type: "function"
15408
+ },
15409
+ {
15410
+ inputs: [
15411
+ {
15412
+ internalType: "address",
15413
+ name: "token",
15414
+ type: "address"
15415
+ },
15416
+ {
15417
+ internalType: "uint256",
15418
+ name: "amount",
15419
+ type: "uint256"
15420
+ }
15421
+ ],
15422
+ name: "notifyRewardAmount",
15423
+ outputs: [
15424
+ ],
15425
+ stateMutability: "nonpayable",
15426
+ type: "function"
15427
+ },
15428
+ {
15429
+ inputs: [
15430
+ {
15431
+ internalType: "address",
15432
+ name: "",
15433
+ type: "address"
15434
+ }
15435
+ ],
15436
+ name: "numCheckpoints",
15437
+ outputs: [
15438
+ {
15439
+ internalType: "uint256",
15440
+ name: "",
15441
+ type: "uint256"
15442
+ }
15443
+ ],
15444
+ stateMutability: "view",
15445
+ type: "function"
15446
+ },
15447
+ {
15448
+ inputs: [
15449
+ {
15450
+ internalType: "address",
15451
+ name: "",
15452
+ type: "address"
15453
+ }
15454
+ ],
15455
+ name: "periodFinish",
15456
+ outputs: [
15457
+ {
15458
+ internalType: "uint256",
15459
+ name: "",
15460
+ type: "uint256"
15461
+ }
15462
+ ],
15463
+ stateMutability: "view",
15464
+ type: "function"
15465
+ },
15466
+ {
15467
+ inputs: [
15468
+ {
15469
+ internalType: "address",
15470
+ name: "token",
15471
+ type: "address"
15472
+ }
15473
+ ],
15474
+ name: "rewardPerToken",
15475
+ outputs: [
15476
+ {
15477
+ internalType: "uint256",
15478
+ name: "",
15479
+ type: "uint256"
15480
+ }
15481
+ ],
15482
+ stateMutability: "view",
15483
+ type: "function"
15484
+ },
15485
+ {
15486
+ inputs: [
15487
+ {
15488
+ internalType: "address",
15489
+ name: "",
15490
+ type: "address"
15491
+ },
15492
+ {
15493
+ internalType: "uint256",
15494
+ name: "",
15495
+ type: "uint256"
15496
+ }
15497
+ ],
15498
+ name: "rewardPerTokenCheckpoints",
15499
+ outputs: [
15500
+ {
15501
+ internalType: "uint256",
15502
+ name: "timestamp",
15503
+ type: "uint256"
15504
+ },
15505
+ {
15506
+ internalType: "uint256",
15507
+ name: "rewardPerToken",
15508
+ type: "uint256"
15509
+ }
15510
+ ],
15511
+ stateMutability: "view",
15512
+ type: "function"
15513
+ },
15514
+ {
15515
+ inputs: [
15516
+ {
15517
+ internalType: "address",
15518
+ name: "",
15519
+ type: "address"
15520
+ }
15521
+ ],
15522
+ name: "rewardPerTokenNumCheckpoints",
15523
+ outputs: [
15524
+ {
15525
+ internalType: "uint256",
15526
+ name: "",
15527
+ type: "uint256"
15528
+ }
15529
+ ],
15530
+ stateMutability: "view",
15531
+ type: "function"
15532
+ },
15533
+ {
15534
+ inputs: [
15535
+ {
15536
+ internalType: "address",
15537
+ name: "",
15538
+ type: "address"
15539
+ }
15540
+ ],
15541
+ name: "rewardPerTokenStored",
15542
+ outputs: [
15543
+ {
15544
+ internalType: "uint256",
15545
+ name: "",
15546
+ type: "uint256"
15547
+ }
15548
+ ],
15549
+ stateMutability: "view",
15550
+ type: "function"
15551
+ },
15552
+ {
15553
+ inputs: [
15554
+ {
15555
+ internalType: "address",
15556
+ name: "",
15557
+ type: "address"
15558
+ }
15559
+ ],
15560
+ name: "rewardRate",
15561
+ outputs: [
15562
+ {
15563
+ internalType: "uint256",
15564
+ name: "",
15565
+ type: "uint256"
15566
+ }
15567
+ ],
15568
+ stateMutability: "view",
15569
+ type: "function"
15570
+ },
15571
+ {
15572
+ inputs: [
15573
+ {
15574
+ internalType: "uint256",
15575
+ name: "",
15576
+ type: "uint256"
15577
+ }
15578
+ ],
15579
+ name: "rewards",
15580
+ outputs: [
15581
+ {
15582
+ internalType: "address",
15583
+ name: "",
15584
+ type: "address"
15585
+ }
15586
+ ],
15587
+ stateMutability: "view",
15588
+ type: "function"
15589
+ },
15590
+ {
15591
+ inputs: [
15592
+ ],
15593
+ name: "rewardsListLength",
15594
+ outputs: [
15595
+ {
15596
+ internalType: "uint256",
15597
+ name: "",
15598
+ type: "uint256"
15599
+ }
15600
+ ],
15601
+ stateMutability: "view",
15602
+ type: "function"
15603
+ },
15604
+ {
15605
+ inputs: [
15606
+ ],
15607
+ name: "stake",
15608
+ outputs: [
15609
+ {
15610
+ internalType: "address",
15611
+ name: "",
15612
+ type: "address"
15613
+ }
15614
+ ],
15615
+ stateMutability: "view",
15616
+ type: "function"
15617
+ },
15618
+ {
15619
+ inputs: [
15620
+ {
15621
+ internalType: "uint256",
15622
+ name: "",
15623
+ type: "uint256"
15624
+ }
15625
+ ],
15626
+ name: "supplyCheckpoints",
15627
+ outputs: [
15628
+ {
15629
+ internalType: "uint256",
15630
+ name: "timestamp",
15631
+ type: "uint256"
15632
+ },
15633
+ {
15634
+ internalType: "uint256",
15635
+ name: "supply",
15636
+ type: "uint256"
15637
+ }
15638
+ ],
15639
+ stateMutability: "view",
15640
+ type: "function"
15641
+ },
15642
+ {
15643
+ inputs: [
15644
+ ],
15645
+ name: "supplyNumCheckpoints",
15646
+ outputs: [
15647
+ {
15648
+ internalType: "uint256",
15649
+ name: "",
15650
+ type: "uint256"
15651
+ }
15652
+ ],
15653
+ stateMutability: "view",
15654
+ type: "function"
15655
+ },
15656
+ {
15657
+ inputs: [
15658
+ {
15659
+ internalType: "uint256",
15660
+ name: "i",
15661
+ type: "uint256"
15662
+ },
15663
+ {
15664
+ internalType: "address",
15665
+ name: "oldToken",
15666
+ type: "address"
15667
+ },
15668
+ {
15669
+ internalType: "address",
15670
+ name: "newToken",
15671
+ type: "address"
15672
+ }
15673
+ ],
15674
+ name: "swapOutRewardToken",
15675
+ outputs: [
15676
+ ],
15677
+ stateMutability: "nonpayable",
15678
+ type: "function"
15679
+ },
15680
+ {
15681
+ inputs: [
15682
+ {
15683
+ internalType: "address",
15684
+ name: "",
15685
+ type: "address"
15686
+ }
15687
+ ],
15688
+ name: "tokenIds",
15689
+ outputs: [
15690
+ {
15691
+ internalType: "uint256",
15692
+ name: "",
15693
+ type: "uint256"
15694
+ }
15695
+ ],
15696
+ stateMutability: "view",
15697
+ type: "function"
15698
+ },
15699
+ {
15700
+ inputs: [
15701
+ ],
15702
+ name: "totalSupply",
15703
+ outputs: [
15704
+ {
15705
+ internalType: "uint256",
15706
+ name: "",
15707
+ type: "uint256"
15708
+ }
15709
+ ],
15710
+ stateMutability: "view",
15711
+ type: "function"
15712
+ },
15713
+ {
15714
+ inputs: [
15715
+ {
15716
+ internalType: "address",
15717
+ name: "",
15718
+ type: "address"
15719
+ },
15720
+ {
15721
+ internalType: "address",
15722
+ name: "",
15723
+ type: "address"
15724
+ }
15725
+ ],
15726
+ name: "userRewardPerTokenStored",
15727
+ outputs: [
15728
+ {
15729
+ internalType: "uint256",
15730
+ name: "",
15731
+ type: "uint256"
15732
+ }
15733
+ ],
15734
+ stateMutability: "view",
15735
+ type: "function"
15736
+ },
15737
+ {
15738
+ inputs: [
15739
+ ],
15740
+ name: "voter",
15741
+ outputs: [
15742
+ {
15743
+ internalType: "address",
15744
+ name: "",
15745
+ type: "address"
15746
+ }
15747
+ ],
15748
+ stateMutability: "view",
15749
+ type: "function"
15750
+ },
15751
+ {
15752
+ inputs: [
15753
+ {
15754
+ internalType: "uint256",
15755
+ name: "amount",
15756
+ type: "uint256"
15757
+ }
15758
+ ],
15759
+ name: "withdraw",
15760
+ outputs: [
15761
+ ],
15762
+ stateMutability: "nonpayable",
15763
+ type: "function"
15764
+ },
15765
+ {
15766
+ inputs: [
15767
+ ],
15768
+ name: "withdrawAll",
15769
+ outputs: [
15770
+ ],
15771
+ stateMutability: "nonpayable",
15772
+ type: "function"
15773
+ },
15774
+ {
15775
+ inputs: [
15776
+ {
15777
+ internalType: "uint256",
15778
+ name: "amount",
15779
+ type: "uint256"
15780
+ },
15781
+ {
15782
+ internalType: "uint256",
15783
+ name: "tokenId",
15784
+ type: "uint256"
15785
+ }
15786
+ ],
15787
+ name: "withdrawToken",
15788
+ outputs: [
15789
+ ],
15790
+ stateMutability: "nonpayable",
15791
+ type: "function"
15792
+ }
15793
+ ];
15794
+ var IVelodromeGauge = {
15795
+ abi: abi$m
15796
+ };
15797
+
15798
+ var iVelodromeGauge = /*#__PURE__*/new ethers.ethers.utils.Interface(IVelodromeGauge.abi);
15799
+ function getVelodromeStakeTxData(amount) {
15800
+ return iVelodromeGauge.encodeFunctionData(exports.Transaction.DEPOSIT, [amount, "0"]);
15801
+ }
15802
+ function getVelodromeClaimTxData(_x, _x2) {
15803
+ return _getVelodromeClaimTxData.apply(this, arguments);
15804
+ }
15805
+
15806
+ function _getVelodromeClaimTxData() {
15807
+ _getVelodromeClaimTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool, gauge) {
15808
+ var rewardAssetCount, rewardAssets;
15809
+ return runtime_1.wrap(function _callee$(_context) {
15810
+ while (1) {
15811
+ switch (_context.prev = _context.next) {
15812
+ case 0:
15813
+ _context.next = 2;
15814
+ return call(pool.signer, IVelodromeGauge.abi, [gauge, "rewardsListLength", []]);
15815
+
15816
+ case 2:
15817
+ rewardAssetCount = _context.sent;
15818
+ _context.next = 5;
15819
+ return Promise.all(Array.from(Array(rewardAssetCount.toNumber()).keys()).map(function (e) {
15820
+ return call(pool.signer, IVelodromeGauge.abi, [gauge, "rewards", [e]]);
15821
+ }));
15822
+
15823
+ case 5:
15824
+ rewardAssets = _context.sent;
15825
+ return _context.abrupt("return", iVelodromeGauge.encodeFunctionData("getReward", [pool.address, rewardAssets]));
15826
+
15827
+ case 7:
15828
+ case "end":
15829
+ return _context.stop();
15830
+ }
15831
+ }
15832
+ }, _callee);
15833
+ }));
15834
+ return _getVelodromeClaimTxData.apply(this, arguments);
15835
+ }
15836
+
15837
+ var Pool = /*#__PURE__*/function () {
15838
+ function Pool(network, signer, poolLogic, mangerLogic, utils, factory) {
15839
+ this.network = network;
15840
+ this.poolLogic = poolLogic;
15841
+ this.address = poolLogic.address;
15842
+ this.managerLogic = mangerLogic;
15843
+ this.signer = signer;
15844
+ this.utils = utils;
15845
+ this.factory = factory;
15846
+ }
15847
+ /**
15848
+ * Return the assets with balances and deposit info of a pool
15849
+ * @returns {Promise<FundComposition[]>} Composition of assets with balance, deposit info
15850
+ */
15851
+
15852
+
15853
+ var _proto = Pool.prototype;
15854
+
15855
+ _proto.getComposition =
15856
+ /*#__PURE__*/
15857
+ function () {
15858
+ var _getComposition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
15859
+ var result, fundComposition;
15860
+ return runtime_1.wrap(function _callee$(_context) {
15861
+ while (1) {
15862
+ switch (_context.prev = _context.next) {
15863
+ case 0:
15864
+ _context.next = 2;
15865
+ return this.managerLogic.getFundComposition();
15866
+
15867
+ case 2:
15868
+ result = _context.sent;
15869
+ fundComposition = result[0].map(function (item, index) {
15870
+ var asset = item.asset,
15871
+ isDeposit = item.isDeposit;
15872
+ return {
15873
+ asset: asset,
15874
+ isDeposit: isDeposit,
15875
+ balance: result[1][index],
15876
+ rate: result[2][index]
15877
+ };
15878
+ });
15879
+ return _context.abrupt("return", fundComposition);
15880
+
15881
+ case 5:
15882
+ case "end":
15883
+ return _context.stop();
15884
+ }
15885
+ }
15886
+ }, _callee, this);
15887
+ }));
15888
+
15889
+ function getComposition() {
15890
+ return _getComposition.apply(this, arguments);
15891
+ }
15892
+
15893
+ return getComposition;
15894
+ }() //Invest functions
15895
+
15896
+ /**
15897
+ * Approve the asset that can be deposited into a pool
15898
+ * @param {string} nasset Address of deposit asset
15899
+ * @param {BigNumber | string} amount Amount to be approved
15900
+ * @param {any} options Transaction options
15901
+ * @returns {Promise<any>} Transaction
15902
+ */
15903
+ ;
15904
+
15905
+ _proto.approveDeposit =
15906
+ /*#__PURE__*/
15907
+ function () {
15908
+ var _approveDeposit = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(asset, amount, options) {
15909
+ var iERC20, tx;
15910
+ return runtime_1.wrap(function _callee2$(_context2) {
15911
+ while (1) {
15912
+ switch (_context2.prev = _context2.next) {
15913
+ case 0:
15914
+ if (options === void 0) {
15915
+ options = null;
15916
+ }
15917
+
15918
+ iERC20 = new ethers.ethers.Contract(asset, IERC20.abi, this.signer);
15919
+ _context2.next = 4;
15920
+ return iERC20.approve(this.address, amount, options);
15921
+
15922
+ case 4:
15923
+ tx = _context2.sent;
15924
+ return _context2.abrupt("return", tx);
15925
+
15926
+ case 6:
15927
+ case "end":
15928
+ return _context2.stop();
15929
+ }
15930
+ }
15931
+ }, _callee2, this);
15932
+ }));
15933
+
15934
+ function approveDeposit(_x, _x2, _x3) {
15935
+ return _approveDeposit.apply(this, arguments);
15936
+ }
15937
+
15938
+ return approveDeposit;
15939
+ }()
15940
+ /**
15941
+ * Deposit asset into a pool
15942
+ * @param {string} asset Address of asset
15943
+ * @param {BigNumber | string} amount Amount to be deposited
15944
+ * @param {any} options Transaction options
15945
+ * @returns {Promise<any>} Transaction
15946
+ */
15947
+ ;
15948
+
15949
+ _proto.deposit =
15950
+ /*#__PURE__*/
15951
+ function () {
15952
+ var _deposit = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(asset, amount, options) {
15953
+ var tx;
15954
+ return runtime_1.wrap(function _callee3$(_context3) {
15955
+ while (1) {
15956
+ switch (_context3.prev = _context3.next) {
15957
+ case 0:
15958
+ if (options === void 0) {
15959
+ options = null;
15960
+ }
15961
+
15962
+ _context3.next = 3;
15963
+ return this.poolLogic.deposit(asset, amount, options);
15964
+
15965
+ case 3:
15966
+ tx = _context3.sent;
15967
+ return _context3.abrupt("return", tx);
15968
+
15969
+ case 5:
15970
+ case "end":
15971
+ return _context3.stop();
15972
+ }
15973
+ }
15974
+ }, _callee3, this);
15975
+ }));
15976
+
15977
+ function deposit(_x4, _x5, _x6) {
15978
+ return _deposit.apply(this, arguments);
15979
+ }
15980
+
15981
+ return deposit;
15982
+ }()
15983
+ /**
15984
+ * Withdraw assets from a pool
15985
+ * @param fundTokenAmount Amount of pool tokens to be withdrawn
15986
+ * @param {any} options Transaction options
15987
+ * @returns {Promise<any>} Transaction
15988
+ */
15989
+ ;
15990
+
15991
+ _proto.withdraw =
15992
+ /*#__PURE__*/
15993
+ function () {
15994
+ var _withdraw = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(fundTokenAmount, options) {
15995
+ var tx;
15996
+ return runtime_1.wrap(function _callee4$(_context4) {
15997
+ while (1) {
15998
+ switch (_context4.prev = _context4.next) {
15999
+ case 0:
16000
+ if (options === void 0) {
16001
+ options = null;
16002
+ }
16003
+
16004
+ _context4.next = 3;
16005
+ return this.poolLogic.withdraw(fundTokenAmount, options);
16006
+
16007
+ case 3:
16008
+ tx = _context4.sent;
16009
+ return _context4.abrupt("return", tx);
16010
+
16011
+ case 5:
16012
+ case "end":
16013
+ return _context4.stop();
16014
+ }
16015
+ }
16016
+ }, _callee4, this);
16017
+ }));
16018
+
16019
+ function withdraw(_x7, _x8) {
16020
+ return _withdraw.apply(this, arguments);
16021
+ }
16022
+
16023
+ return withdraw;
16024
+ }() //Manager functions
16025
+
16026
+ /**
16027
+ * Approve the asset for trading and providing liquidity
16028
+ * @param {Dapp} dapp Platform like Sushiswap or Uniswap
16029
+ * @param {string} asset Address of asset
16030
+ * @param @param {BigNumber | string} Amount to be approved
16031
+ * @param {any} options Transaction options
16032
+ * @returns {Promise<any>} Transaction
16033
+ */
16034
+ ;
16035
+
16036
+ _proto.approve =
16037
+ /*#__PURE__*/
16038
+ function () {
16039
+ var _approve = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(dapp, asset, amount, options) {
16040
+ var iERC20, approveTxData, tx;
16041
+ return runtime_1.wrap(function _callee5$(_context5) {
16042
+ while (1) {
16043
+ switch (_context5.prev = _context5.next) {
16044
+ case 0:
16045
+ if (options === void 0) {
16046
+ options = null;
16047
+ }
16048
+
16049
+ iERC20 = new ethers.ethers.utils.Interface(IERC20.abi);
16050
+ approveTxData = iERC20.encodeFunctionData("approve", [routerAddress[this.network][dapp], amount]);
16051
+ _context5.next = 5;
16052
+ return this.poolLogic.execTransaction(asset, approveTxData, options);
16053
+
16054
+ case 5:
16055
+ tx = _context5.sent;
16056
+ return _context5.abrupt("return", tx);
16057
+
16058
+ case 7:
16059
+ case "end":
16060
+ return _context5.stop();
16061
+ }
16062
+ }
16063
+ }, _callee5, this);
16064
+ }));
16065
+
16066
+ function approve(_x9, _x10, _x11, _x12) {
16067
+ return _approve.apply(this, arguments);
16068
+ }
16069
+
16070
+ return approve;
16071
+ }()
13957
16072
  /**
13958
16073
  * Approve the liquidity pool token for staking
13959
16074
  * @param {Dapp} dapp Platform like Sushiswap or Uniswap
@@ -14349,6 +16464,7 @@ var Pool = /*#__PURE__*/function () {
14349
16464
  }()
14350
16465
  /**
14351
16466
  * Stake liquidity pool tokens in gauge contract
16467
+ * @param {Dapp} dapp Platform like Balancer or Velodrome
14352
16468
  * @param {string} gauge Gauge contract address
14353
16469
  * @param {BigNumber | string} amount Amount of liquidity pool tokens
14354
16470
  * @param {any} options Transaction options
@@ -14359,8 +16475,8 @@ var Pool = /*#__PURE__*/function () {
14359
16475
  _proto.stakeInGauge =
14360
16476
  /*#__PURE__*/
14361
16477
  function () {
14362
- var _stakeInGauge = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(gauge, amount, options) {
14363
- var rewardsGauge, stakeTxData, tx;
16478
+ var _stakeInGauge = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(dapp, gauge, amount, options) {
16479
+ var stakeTxData, rewardsGauge, tx;
14364
16480
  return runtime_1.wrap(function _callee13$(_context13) {
14365
16481
  while (1) {
14366
16482
  switch (_context13.prev = _context13.next) {
@@ -14369,16 +16485,31 @@ var Pool = /*#__PURE__*/function () {
14369
16485
  options = null;
14370
16486
  }
14371
16487
 
16488
+ _context13.t0 = dapp;
16489
+ _context13.next = _context13.t0 === exports.Dapp.BALANCER ? 4 : _context13.t0 === exports.Dapp.VELODROME ? 7 : 9;
16490
+ break;
16491
+
16492
+ case 4:
14372
16493
  rewardsGauge = new ethers.ethers.utils.Interface(IBalancerRewardsGauge.abi);
14373
16494
  stakeTxData = rewardsGauge.encodeFunctionData("deposit(uint256)", [amount]);
14374
- _context13.next = 5;
16495
+ return _context13.abrupt("break", 10);
16496
+
16497
+ case 7:
16498
+ stakeTxData = getVelodromeStakeTxData(amount);
16499
+ return _context13.abrupt("break", 10);
16500
+
16501
+ case 9:
16502
+ throw new Error("dapp not supported");
16503
+
16504
+ case 10:
16505
+ _context13.next = 12;
14375
16506
  return this.poolLogic.execTransaction(gauge, stakeTxData, options);
14376
16507
 
14377
- case 5:
16508
+ case 12:
14378
16509
  tx = _context13.sent;
14379
16510
  return _context13.abrupt("return", tx);
14380
16511
 
14381
- case 7:
16512
+ case 14:
14382
16513
  case "end":
14383
16514
  return _context13.stop();
14384
16515
  }
@@ -14386,7 +16517,7 @@ var Pool = /*#__PURE__*/function () {
14386
16517
  }, _callee13, this);
14387
16518
  }));
14388
16519
 
14389
- function stakeInGauge(_x45, _x46, _x47) {
16520
+ function stakeInGauge(_x45, _x46, _x47, _x48) {
14390
16521
  return _stakeInGauge.apply(this, arguments);
14391
16522
  }
14392
16523
 
@@ -14437,7 +16568,7 @@ var Pool = /*#__PURE__*/function () {
14437
16568
  }, _callee14, this);
14438
16569
  }));
14439
16570
 
14440
- function unStake(_x48, _x49, _x50, _x51) {
16571
+ function unStake(_x49, _x50, _x51, _x52) {
14441
16572
  return _unStake.apply(this, arguments);
14442
16573
  }
14443
16574
 
@@ -14482,7 +16613,7 @@ var Pool = /*#__PURE__*/function () {
14482
16613
  }, _callee15, this);
14483
16614
  }));
14484
16615
 
14485
- function unstakeFromGauge(_x52, _x53, _x54) {
16616
+ function unstakeFromGauge(_x53, _x54, _x55) {
14486
16617
  return _unstakeFromGauge.apply(this, arguments);
14487
16618
  }
14488
16619
 
@@ -14533,7 +16664,7 @@ var Pool = /*#__PURE__*/function () {
14533
16664
  }, _callee16, this);
14534
16665
  }));
14535
16666
 
14536
- function lend(_x55, _x56, _x57, _x58, _x59) {
16667
+ function lend(_x56, _x57, _x58, _x59, _x60) {
14537
16668
  return _lend.apply(this, arguments);
14538
16669
  }
14539
16670
 
@@ -14579,7 +16710,7 @@ var Pool = /*#__PURE__*/function () {
14579
16710
  }, _callee17, this);
14580
16711
  }));
14581
16712
 
14582
- function withdrawDeposit(_x60, _x61, _x62, _x63) {
16713
+ function withdrawDeposit(_x61, _x62, _x63, _x64) {
14583
16714
  return _withdrawDeposit.apply(this, arguments);
14584
16715
  }
14585
16716
 
@@ -14630,7 +16761,7 @@ var Pool = /*#__PURE__*/function () {
14630
16761
  }, _callee18, this);
14631
16762
  }));
14632
16763
 
14633
- function borrow(_x64, _x65, _x66, _x67, _x68) {
16764
+ function borrow(_x65, _x66, _x67, _x68, _x69) {
14634
16765
  return _borrow.apply(this, arguments);
14635
16766
  }
14636
16767
 
@@ -14676,7 +16807,7 @@ var Pool = /*#__PURE__*/function () {
14676
16807
  }, _callee19, this);
14677
16808
  }));
14678
16809
 
14679
- function repay(_x69, _x70, _x71, _x72) {
16810
+ function repay(_x70, _x71, _x72, _x73) {
14680
16811
  return _repay.apply(this, arguments);
14681
16812
  }
14682
16813
 
@@ -14726,7 +16857,7 @@ var Pool = /*#__PURE__*/function () {
14726
16857
  }, _callee20, this);
14727
16858
  }));
14728
16859
 
14729
- function harvestRewards(_x73, _x74, _x75) {
16860
+ function harvestRewards(_x74, _x75, _x76) {
14730
16861
  return _harvestRewards.apply(this, arguments);
14731
16862
  }
14732
16863
 
@@ -14785,7 +16916,7 @@ var Pool = /*#__PURE__*/function () {
14785
16916
  }, _callee21, this);
14786
16917
  }));
14787
16918
 
14788
- function changeAssets(_x76, _x77) {
16919
+ function changeAssets(_x77, _x78) {
14789
16920
  return _changeAssets.apply(this, arguments);
14790
16921
  }
14791
16922
 
@@ -14827,7 +16958,7 @@ var Pool = /*#__PURE__*/function () {
14827
16958
  }, _callee22, this);
14828
16959
  }));
14829
16960
 
14830
- function setTrader(_x78, _x79) {
16961
+ function setTrader(_x79, _x80) {
14831
16962
  return _setTrader.apply(this, arguments);
14832
16963
  }
14833
16964
 
@@ -14872,7 +17003,7 @@ var Pool = /*#__PURE__*/function () {
14872
17003
  }, _callee23, this);
14873
17004
  }));
14874
17005
 
14875
- function joinBalancerPool(_x80, _x81, _x82, _x83) {
17006
+ function joinBalancerPool(_x81, _x82, _x83, _x84) {
14876
17007
  return _joinBalancerPool.apply(this, arguments);
14877
17008
  }
14878
17009
 
@@ -14922,7 +17053,7 @@ var Pool = /*#__PURE__*/function () {
14922
17053
  }, _callee24, this);
14923
17054
  }));
14924
17055
 
14925
- function exitBalancerPool(_x84, _x85, _x86, _x87, _x88) {
17056
+ function exitBalancerPool(_x85, _x86, _x87, _x88, _x89) {
14926
17057
  return _exitBalancerPool.apply(this, arguments);
14927
17058
  }
14928
17059
 
@@ -14980,7 +17111,7 @@ var Pool = /*#__PURE__*/function () {
14980
17111
  }, _callee25, this);
14981
17112
  }));
14982
17113
 
14983
- function harvestBalancerRewards(_x89) {
17114
+ function harvestBalancerRewards(_x90) {
14984
17115
  return _harvestBalancerRewards.apply(this, arguments);
14985
17116
  }
14986
17117
 
@@ -15031,7 +17162,7 @@ var Pool = /*#__PURE__*/function () {
15031
17162
  }, _callee26, this);
15032
17163
  }));
15033
17164
 
15034
- function harvestAaveRewards(_x90, _x91) {
17165
+ function harvestAaveRewards(_x91, _x92) {
15035
17166
  return _harvestAaveRewards.apply(this, arguments);
15036
17167
  }
15037
17168
 
@@ -15079,7 +17210,7 @@ var Pool = /*#__PURE__*/function () {
15079
17210
  }, _callee27, this);
15080
17211
  }));
15081
17212
 
15082
- function harvestAaveV3Rewards(_x92, _x93, _x94) {
17213
+ function harvestAaveV3Rewards(_x93, _x94, _x95) {
15083
17214
  return _harvestAaveV3Rewards.apply(this, arguments);
15084
17215
  }
15085
17216
 
@@ -15144,7 +17275,7 @@ var Pool = /*#__PURE__*/function () {
15144
17275
  }, _callee28, this);
15145
17276
  }));
15146
17277
 
15147
- function addLiquidityUniswapV3(_x95, _x96, _x97, _x98, _x99, _x100, _x101, _x102, _x103, _x104) {
17278
+ function addLiquidityUniswapV3(_x96, _x97, _x98, _x99, _x100, _x101, _x102, _x103, _x104, _x105) {
15148
17279
  return _addLiquidityUniswapV.apply(this, arguments);
15149
17280
  }
15150
17281
 
@@ -15239,7 +17370,7 @@ var Pool = /*#__PURE__*/function () {
15239
17370
  }, _callee29, this);
15240
17371
  }));
15241
17372
 
15242
- function decreaseLiquidity(_x105, _x106, _x107, _x108) {
17373
+ function decreaseLiquidity(_x106, _x107, _x108, _x109) {
15243
17374
  return _decreaseLiquidity.apply(this, arguments);
15244
17375
  }
15245
17376
 
@@ -15312,7 +17443,7 @@ var Pool = /*#__PURE__*/function () {
15312
17443
  }, _callee30, this);
15313
17444
  }));
15314
17445
 
15315
- function increaseLiquidity(_x109, _x110, _x111, _x112, _x113) {
17446
+ function increaseLiquidity(_x110, _x111, _x112, _x113, _x114) {
15316
17447
  return _increaseLiquidity.apply(this, arguments);
15317
17448
  }
15318
17449
 
@@ -15340,41 +17471,39 @@ var Pool = /*#__PURE__*/function () {
15340
17471
  options = null;
15341
17472
  }
15342
17473
 
15343
- if (!(dapp === exports.Dapp.UNISWAPV3)) {
15344
- _context31.next = 7;
15345
- break;
15346
- }
17474
+ _context31.t0 = dapp;
17475
+ _context31.next = _context31.t0 === exports.Dapp.UNISWAPV3 ? 4 : _context31.t0 === exports.Dapp.ARRAKIS ? 8 : _context31.t0 === exports.Dapp.BALANCER ? 8 : _context31.t0 === exports.Dapp.VELODROME ? 12 : 15;
17476
+ break;
15347
17477
 
17478
+ case 4:
15348
17479
  contractAddress = nonfungiblePositionManagerAddress[this.network];
15349
17480
  iNonfungiblePositionManager = new ethers.ethers.utils.Interface(INonfungiblePositionManager.abi);
15350
17481
  txData = iNonfungiblePositionManager.encodeFunctionData(exports.Transaction.COLLECT, [[tokenId, this.address, MaxUint128, MaxUint128]]);
15351
- _context31.next = 14;
15352
- break;
15353
-
15354
- case 7:
15355
- if (!(dapp === exports.Dapp.ARRAKIS || dapp === exports.Dapp.BALANCER)) {
15356
- _context31.next = 13;
15357
- break;
15358
- }
17482
+ return _context31.abrupt("break", 16);
15359
17483
 
17484
+ case 8:
15360
17485
  contractAddress = tokenId;
15361
17486
  abi = new ethers.ethers.utils.Interface(ILiquidityGaugeV4.abi);
15362
17487
  txData = abi.encodeFunctionData("claim_rewards()", []);
15363
- _context31.next = 14;
15364
- break;
17488
+ return _context31.abrupt("break", 16);
15365
17489
 
15366
- case 13:
17490
+ case 12:
17491
+ contractAddress = tokenId;
17492
+ txData = getVelodromeClaimTxData(this, tokenId);
17493
+ return _context31.abrupt("break", 16);
17494
+
17495
+ case 15:
15367
17496
  throw new Error("dapp not supported");
15368
17497
 
15369
- case 14:
15370
- _context31.next = 16;
17498
+ case 16:
17499
+ _context31.next = 18;
15371
17500
  return this.poolLogic.execTransaction(contractAddress, txData, options);
15372
17501
 
15373
- case 16:
17502
+ case 18:
15374
17503
  tx = _context31.sent;
15375
17504
  return _context31.abrupt("return", tx);
15376
17505
 
15377
- case 18:
17506
+ case 20:
15378
17507
  case "end":
15379
17508
  return _context31.stop();
15380
17509
  }
@@ -15382,7 +17511,7 @@ var Pool = /*#__PURE__*/function () {
15382
17511
  }, _callee31, this);
15383
17512
  }));
15384
17513
 
15385
- function claimFees(_x114, _x115, _x116) {
17514
+ function claimFees(_x115, _x116, _x117) {
15386
17515
  return _claimFees.apply(this, arguments);
15387
17516
  }
15388
17517
 
@@ -15438,17 +17567,108 @@ var Pool = /*#__PURE__*/function () {
15438
17567
  }, _callee32, this);
15439
17568
  }));
15440
17569
 
15441
- function tradeUniswapV3(_x117, _x118, _x119, _x120, _x121, _x122) {
17570
+ function tradeUniswapV3(_x118, _x119, _x120, _x121, _x122, _x123) {
15442
17571
  return _tradeUniswapV.apply(this, arguments);
15443
17572
  }
15444
17573
 
15445
17574
  return tradeUniswapV3;
17575
+ }()
17576
+ /**
17577
+ * Add liquidity to Velodrome pool
17578
+ * @param {string} assetA First asset
17579
+ * @param {string} assetB Second asset
17580
+ * @param {BigNumber | string} amountA Amount first asset
17581
+ * @param {BigNumber | string} amountB Amount second asset
17582
+ * @param { boolean } isStable Is stable pool
17583
+ * @param {any} options Transaction options
17584
+ * @returns {Promise<any>} Transaction
17585
+ */
17586
+ ;
17587
+
17588
+ _proto.addLiquidityVelodrome =
17589
+ /*#__PURE__*/
17590
+ function () {
17591
+ var _addLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee33(assetA, assetB, amountA, amountB, isStable, options) {
17592
+ var tx;
17593
+ return runtime_1.wrap(function _callee33$(_context33) {
17594
+ while (1) {
17595
+ switch (_context33.prev = _context33.next) {
17596
+ case 0:
17597
+ if (options === void 0) {
17598
+ options = null;
17599
+ }
17600
+
17601
+ _context33.next = 3;
17602
+ return this.poolLogic.execTransaction(routerAddress[this.network][exports.Dapp.VELODROME], getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable), options);
17603
+
17604
+ case 3:
17605
+ tx = _context33.sent;
17606
+ return _context33.abrupt("return", tx);
17607
+
17608
+ case 5:
17609
+ case "end":
17610
+ return _context33.stop();
17611
+ }
17612
+ }
17613
+ }, _callee33, this);
17614
+ }));
17615
+
17616
+ function addLiquidityVelodrome(_x124, _x125, _x126, _x127, _x128, _x129) {
17617
+ return _addLiquidityVelodrome.apply(this, arguments);
17618
+ }
17619
+
17620
+ return addLiquidityVelodrome;
17621
+ }()
17622
+ /**
17623
+ * Remove liquidity from Velodrome pool
17624
+ * @param {string} assetA First asset
17625
+ * @param {string} assetB Second asset
17626
+ * @param {BigNumber | string} amount Amount of LP tokens
17627
+ * @param { boolean } isStable Is stable pool
17628
+ * @param {any} options Transaction options
17629
+ * @returns {Promise<any>} Transaction
17630
+ */
17631
+ ;
17632
+
17633
+ _proto.removeLiquidityVelodrome =
17634
+ /*#__PURE__*/
17635
+ function () {
17636
+ var _removeLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee34(assetA, assetB, amount, isStable, options) {
17637
+ var tx;
17638
+ return runtime_1.wrap(function _callee34$(_context34) {
17639
+ while (1) {
17640
+ switch (_context34.prev = _context34.next) {
17641
+ case 0:
17642
+ if (options === void 0) {
17643
+ options = null;
17644
+ }
17645
+
17646
+ _context34.next = 3;
17647
+ return this.poolLogic.execTransaction(routerAddress[this.network][exports.Dapp.VELODROME], getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable), options);
17648
+
17649
+ case 3:
17650
+ tx = _context34.sent;
17651
+ return _context34.abrupt("return", tx);
17652
+
17653
+ case 5:
17654
+ case "end":
17655
+ return _context34.stop();
17656
+ }
17657
+ }
17658
+ }, _callee34, this);
17659
+ }));
17660
+
17661
+ function removeLiquidityVelodrome(_x130, _x131, _x132, _x133, _x134) {
17662
+ return _removeLiquidityVelodrome.apply(this, arguments);
17663
+ }
17664
+
17665
+ return removeLiquidityVelodrome;
15446
17666
  }();
15447
17667
 
15448
17668
  return Pool;
15449
17669
  }();
15450
17670
 
15451
- var abi$l = [
17671
+ var abi$n = [
15452
17672
  {
15453
17673
  inputs: [
15454
17674
  {
@@ -15672,10 +17892,10 @@ var abi$l = [
15672
17892
  }
15673
17893
  ];
15674
17894
  var UniswapV2Factory = {
15675
- abi: abi$l
17895
+ abi: abi$n
15676
17896
  };
15677
17897
 
15678
- var abi$m = [
17898
+ var abi$o = [
15679
17899
  {
15680
17900
  anonymous: false,
15681
17901
  inputs: [
@@ -16419,7 +18639,7 @@ var evm = {
16419
18639
  }
16420
18640
  };
16421
18641
  var UniswapV2Pair = {
16422
- abi: abi$m,
18642
+ abi: abi$o,
16423
18643
  evm: evm,
16424
18644
  "interface": [
16425
18645
  {
@@ -17150,7 +19370,7 @@ var UniswapV2Pair = {
17150
19370
  ]
17151
19371
  };
17152
19372
 
17153
- var abi$n = [
19373
+ var abi$p = [
17154
19374
  {
17155
19375
  inputs: [
17156
19376
  {
@@ -18345,7 +20565,7 @@ var abi$n = [
18345
20565
  }
18346
20566
  ];
18347
20567
  var IBalancerV2Vault = {
18348
- abi: abi$n
20568
+ abi: abi$p
18349
20569
  };
18350
20570
 
18351
20571
  var Utils = /*#__PURE__*/function () {
@@ -18702,17 +20922,23 @@ var Utils = /*#__PURE__*/function () {
18702
20922
  _proto.getBalancerJoinPoolTx = /*#__PURE__*/function () {
18703
20923
  var _getBalancerJoinPoolTx = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(pool, balancerPoolId, assets, amountsIn // eslint-disable-next-line @typescript-eslint/no-explicit-any
18704
20924
  ) {
18705
- var iBalancerV2Vault, txData, joinPoolTx;
20925
+ var iBalancerV2Vault, bptAddress, bptIndex, poolAssetsAmounts, txData, joinPoolTx;
18706
20926
  return runtime_1.wrap(function _callee7$(_context7) {
18707
20927
  while (1) {
18708
20928
  switch (_context7.prev = _context7.next) {
18709
20929
  case 0:
18710
20930
  iBalancerV2Vault = new ethers.ethers.utils.Interface(IBalancerV2Vault.abi);
18711
- txData = [balancerPoolId, pool.address, pool.address, [assets, amountsIn, ethers.ethers.utils.defaultAbiCoder.encode(["uint256", "uint256[]", "uint256"], [1, amountsIn, 0]), false]];
20931
+ bptAddress = ethers.ethers.utils.getAddress(balancerPoolId.slice(0, 42));
20932
+ bptIndex = assets.findIndex(function (e) {
20933
+ return e.toLowerCase() === bptAddress.toLocaleLowerCase();
20934
+ });
20935
+ poolAssetsAmounts = amountsIn.slice();
20936
+ if (bptIndex >= 0) poolAssetsAmounts.splice(bptIndex, 1);
20937
+ txData = [balancerPoolId, pool.address, pool.address, [assets, amountsIn, ethers.ethers.utils.defaultAbiCoder.encode(["uint256", "uint256[]", "uint256"], [1, poolAssetsAmounts, 0]), false]];
18712
20938
  joinPoolTx = iBalancerV2Vault.encodeFunctionData("joinPool", txData);
18713
20939
  return _context7.abrupt("return", joinPoolTx);
18714
20940
 
18715
- case 4:
20941
+ case 8:
18716
20942
  case "end":
18717
20943
  return _context7.stop();
18718
20944
  }