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