@dhedge/v2-sdk 1.10.5 → 1.10.7

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.
@@ -5,9 +5,9 @@ import { Token, Price } from '@uniswap/sdk-core';
5
5
  import { nearestUsableTick, TICK_SPACINGS, encodeSqrtRatioX96, TickMath, priceToClosestTick } from '@uniswap/v3-sdk';
6
6
  import JSBI from 'jsbi';
7
7
  import BigNumber from 'bignumber.js';
8
+ import axios from 'axios';
8
9
  import 'lodash-es/set';
9
10
  import '@ethersproject/abi';
10
- import axios from 'axios';
11
11
  import { Token as Token$1, Pair, TokenAmount, Route, Trade, TradeType, Percent } from '@sushiswap/sdk';
12
12
  import { SwapTypes, SOR } from '@balancer-labs/sor';
13
13
 
@@ -146,6 +146,44 @@ function _assertThisInitialized(self) {
146
146
  return self;
147
147
  }
148
148
 
149
+ function _unsupportedIterableToArray(o, minLen) {
150
+ if (!o) return;
151
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
152
+ var n = Object.prototype.toString.call(o).slice(8, -1);
153
+ if (n === "Object" && o.constructor) n = o.constructor.name;
154
+ if (n === "Map" || n === "Set") return Array.from(o);
155
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
156
+ }
157
+
158
+ function _arrayLikeToArray(arr, len) {
159
+ if (len == null || len > arr.length) len = arr.length;
160
+
161
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
162
+
163
+ return arr2;
164
+ }
165
+
166
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
167
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
168
+ if (it) return (it = it.call(o)).next.bind(it);
169
+
170
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
171
+ if (it) o = it;
172
+ var i = 0;
173
+ return function () {
174
+ if (i >= o.length) return {
175
+ done: true
176
+ };
177
+ return {
178
+ done: false,
179
+ value: o[i++]
180
+ };
181
+ };
182
+ }
183
+
184
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
185
+ }
186
+
149
187
  function createCommonjsModule(fn, module) {
150
188
  return module = { exports: {} }, fn(module, module.exports), module.exports;
151
189
  }
@@ -4218,6 +4256,7 @@ var Dapp;
4218
4256
  Dapp["AERODROME"] = "aerodrome";
4219
4257
  Dapp["AERODROMECL"] = "aerodromeCL";
4220
4258
  Dapp["RAMSESCL"] = "ramsesCL";
4259
+ Dapp["COMPOUNDV3"] = "compoundV3";
4221
4260
  })(Dapp || (Dapp = {}));
4222
4261
 
4223
4262
  var Transaction;
@@ -4244,16 +4283,16 @@ var Transaction;
4244
4283
  Transaction["REMOVE_LIQUIDITY_UNSTAKE"] = "removeLiquidityAndUnstake";
4245
4284
  })(Transaction || (Transaction = {}));
4246
4285
 
4247
- var _factoryAddress, _Network$POLYGON, _Network$OPTIMISM, _Network$ARBITRUM, _Network$BASE, _routerAddress, _Network$POLYGON2, _dappFactoryAddress, _Network$POLYGON3, _Network$OPTIMISM2, _stakingAddress, _Network$POLYGON4, _Network$OPTIMISM3, _Network$ARBITRUM2, _Network$BASE2, _aaveAddressProvider, _Network$POLYGON5, _Network$OPTIMISM4, _Network$ARBITRUM3, _Network$BASE3, _nonfungiblePositionM, _networkChainIdMap, _balancerSubgraph, _multiCallAddress, _lyraNetworkMap, _flatMoneyContractAdd;
4286
+ var _factoryAddress, _Network$POLYGON, _Network$OPTIMISM, _Network$ARBITRUM, _Network$BASE, _routerAddress, _Network$POLYGON2, _dappFactoryAddress, _Network$POLYGON3, _Network$OPTIMISM2, _Network$ARBITRUM2, _stakingAddress, _Network$POLYGON4, _Network$OPTIMISM3, _Network$ARBITRUM3, _Network$BASE2, _aaveAddressProvider, _Network$POLYGON5, _Network$OPTIMISM4, _Network$ARBITRUM4, _Network$BASE3, _nonfungiblePositionM, _networkChainIdMap, _balancerSubgraph, _multiCallAddress, _lyraNetworkMap, _flatMoneyContractAdd;
4248
4287
 
4249
4288
  require("dotenv").config();
4250
4289
 
4251
4290
  var factoryAddress = (_factoryAddress = {}, _factoryAddress[Network.POLYGON] = process.env.STAGING_CONTRACTS ? "0xDd87eCdB10cFF7004276AAbAbd30e7a08F69bb53" : "0xfdc7b8bFe0DD3513Cc669bB8d601Cb83e2F69cB0", _factoryAddress[Network.OPTIMISM] = "0x5e61a079A178f0E5784107a4963baAe0c5a680c6", _factoryAddress[Network.ARBITRUM] = "0xfffb5fb14606eb3a548c113026355020ddf27535", _factoryAddress[Network.BASE] = "0x49Afe3abCf66CF09Fab86cb1139D8811C8afe56F", _factoryAddress);
4252
- 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] = "0x111111125421ca6dc452d289314280a0f8842a65", _Network$POLYGON[Dapp.QUICKSWAP] = "0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff", _Network$POLYGON[Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$POLYGON[Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$POLYGON[Dapp.ARRAKIS] = "0xc73fb100a995b33f9fa181d420f4c8d74506df66", _Network$POLYGON[Dapp.TOROS] = "0xB2F1498983bf9c9442c35F772e6C1AdE66a8DeDE", _Network$POLYGON[Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _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] = "0x111111125421ca6dc452d289314280a0f8842a65", _Network$OPTIMISM[Dapp.TOROS] = "0x3988513793bCE39f0167064A9F7fC3617FaF35AB", _Network$OPTIMISM[Dapp.VELODROME] = "0x9c12939390052919aF3155f41Bf4160Fd3666A6f", _Network$OPTIMISM[Dapp.VELODROMEV2] = "0xa062ae8a9c5e11aaa026fc2670b0d65ccc8b2858", _Network$OPTIMISM[Dapp.LYRA] = "0xCCE7819d65f348c64B7Beb205BA367b3fE33763B", _Network$OPTIMISM[Dapp.ARRAKIS] = "0x9ce88a56d120300061593eF7AD074A1B710094d5", _Network$OPTIMISM[Dapp.ZEROEX] = "0xdef1abe32c034e558cdd535791643c58a13acc10", _Network$OPTIMISM), _routerAddress[Network.ARBITRUM] = (_Network$ARBITRUM = {}, _Network$ARBITRUM[Dapp.ONEINCH] = "0x111111125421ca6dc452d289314280a0f8842a65", _Network$ARBITRUM[Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$ARBITRUM[Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$ARBITRUM[Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$ARBITRUM[Dapp.RAMSES] = "0xaaa87963efeb6f7e0a2711f397663105acb1805e", _Network$ARBITRUM[Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _Network$ARBITRUM), _routerAddress[Network.BASE] = (_Network$BASE = {}, _Network$BASE[Dapp.ONEINCH] = "0x111111125421ca6dc452d289314280a0f8842a65", _Network$BASE[Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _Network$BASE[Dapp.AERODROME] = "0xcF77a3Ba9A5CA399B7c97c74d54e5b1Beb874E43", _Network$BASE[Dapp.AAVEV3] = "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5", _Network$BASE), _routerAddress);
4291
+ 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] = "0x111111125421ca6dc452d289314280a0f8842a65", _Network$POLYGON[Dapp.QUICKSWAP] = "0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff", _Network$POLYGON[Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$POLYGON[Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$POLYGON[Dapp.ARRAKIS] = "0xc73fb100a995b33f9fa181d420f4c8d74506df66", _Network$POLYGON[Dapp.TOROS] = "0x45b90480D6F643dE2f128db091A357C3c90399f2", _Network$POLYGON[Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _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] = "0x111111125421ca6dc452d289314280a0f8842a65", _Network$OPTIMISM[Dapp.TOROS] = "0x2Ed1bd7f66e47113672f3870308b5E867C5bb743", _Network$OPTIMISM[Dapp.VELODROME] = "0x9c12939390052919aF3155f41Bf4160Fd3666A6f", _Network$OPTIMISM[Dapp.VELODROMEV2] = "0xa062ae8a9c5e11aaa026fc2670b0d65ccc8b2858", _Network$OPTIMISM[Dapp.LYRA] = "0xCCE7819d65f348c64B7Beb205BA367b3fE33763B", _Network$OPTIMISM[Dapp.ARRAKIS] = "0x9ce88a56d120300061593eF7AD074A1B710094d5", _Network$OPTIMISM[Dapp.ZEROEX] = "0xdef1abe32c034e558cdd535791643c58a13acc10", _Network$OPTIMISM), _routerAddress[Network.ARBITRUM] = (_Network$ARBITRUM = {}, _Network$ARBITRUM[Dapp.ONEINCH] = "0x111111125421ca6dc452d289314280a0f8842a65", _Network$ARBITRUM[Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$ARBITRUM[Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$ARBITRUM[Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$ARBITRUM[Dapp.RAMSES] = "0xaaa87963efeb6f7e0a2711f397663105acb1805e", _Network$ARBITRUM[Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _Network$ARBITRUM[Dapp.TOROS] = "0xA5679C4272A056Bb83f039961fae7D99C48529F5", _Network$ARBITRUM), _routerAddress[Network.BASE] = (_Network$BASE = {}, _Network$BASE[Dapp.ONEINCH] = "0x111111125421ca6dc452d289314280a0f8842a65", _Network$BASE[Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _Network$BASE[Dapp.AERODROME] = "0xcF77a3Ba9A5CA399B7c97c74d54e5b1Beb874E43", _Network$BASE[Dapp.AAVEV3] = "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5", _Network$BASE[Dapp.TOROS] = "0xf067575Eb60c7587C11e867907AA7284833704d1", _Network$BASE), _routerAddress);
4253
4292
  var dappFactoryAddress = (_dappFactoryAddress = {}, _dappFactoryAddress[Network.POLYGON] = (_Network$POLYGON2 = {}, _Network$POLYGON2[Dapp.SUSHISWAP] = "0xc35DADB65012eC5796536bD9864eD8773aBc74C4", _Network$POLYGON2[Dapp.QUICKSWAP] = "0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32", _Network$POLYGON2), _dappFactoryAddress[Network.OPTIMISM] = {}, _dappFactoryAddress[Network.ARBITRUM] = {}, _dappFactoryAddress[Network.BASE] = {}, _dappFactoryAddress);
4254
- 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[Network.ARBITRUM] = {}, _stakingAddress[Network.BASE] = {}, _stakingAddress);
4255
- 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[Network.ARBITRUM] = (_Network$ARBITRUM2 = {}, _Network$ARBITRUM2[Dapp.AAVEV3] = "0xa97684ead0e402dc232d5a977953df7ecbab3cdb", _Network$ARBITRUM2), _aaveAddressProvider[Network.BASE] = (_Network$BASE2 = {}, _Network$BASE2[Dapp.AAVEV3] = "0xe20fCBdBfFC4Dd138cE8b2E6FBb6CB49777ad64D", _Network$BASE2), _aaveAddressProvider);
4256
- var nonfungiblePositionManagerAddress = (_nonfungiblePositionM = {}, _nonfungiblePositionM[Network.POLYGON] = (_Network$POLYGON5 = {}, _Network$POLYGON5[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$POLYGON5), _nonfungiblePositionM[Network.OPTIMISM] = (_Network$OPTIMISM4 = {}, _Network$OPTIMISM4[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$OPTIMISM4[Dapp.VELODROMECL] = "0x416b433906b1B72FA758e166e239c43d68dC6F29", _Network$OPTIMISM4), _nonfungiblePositionM[Network.ARBITRUM] = (_Network$ARBITRUM3 = {}, _Network$ARBITRUM3[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$ARBITRUM3[Dapp.RAMSESCL] = "0xAA277CB7914b7e5514946Da92cb9De332Ce610EF", _Network$ARBITRUM3), _nonfungiblePositionM[Network.BASE] = (_Network$BASE3 = {}, _Network$BASE3[Dapp.UNISWAPV3] = "0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1", _Network$BASE3[Dapp.AERODROMECL] = "0x827922686190790b37229fd06084350e74485b72", _Network$BASE3), _nonfungiblePositionM);
4293
+ 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[Dapp.COMPOUNDV3] = "0x443ea0340cb75a160f31a440722dec7b5bc3c2e9", _Network$OPTIMISM2), _stakingAddress[Network.ARBITRUM] = (_Network$ARBITRUM2 = {}, _Network$ARBITRUM2[Dapp.COMPOUNDV3] = "0x88730d254a2f7e6ac8388c3198afd694ba9f7fae", _Network$ARBITRUM2), _stakingAddress[Network.BASE] = {}, _stakingAddress);
4294
+ 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[Network.ARBITRUM] = (_Network$ARBITRUM3 = {}, _Network$ARBITRUM3[Dapp.AAVEV3] = "0xa97684ead0e402dc232d5a977953df7ecbab3cdb", _Network$ARBITRUM3), _aaveAddressProvider[Network.BASE] = (_Network$BASE2 = {}, _Network$BASE2[Dapp.AAVEV3] = "0xe20fCBdBfFC4Dd138cE8b2E6FBb6CB49777ad64D", _Network$BASE2), _aaveAddressProvider);
4295
+ var nonfungiblePositionManagerAddress = (_nonfungiblePositionM = {}, _nonfungiblePositionM[Network.POLYGON] = (_Network$POLYGON5 = {}, _Network$POLYGON5[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$POLYGON5), _nonfungiblePositionM[Network.OPTIMISM] = (_Network$OPTIMISM4 = {}, _Network$OPTIMISM4[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$OPTIMISM4[Dapp.VELODROMECL] = "0x416b433906b1B72FA758e166e239c43d68dC6F29", _Network$OPTIMISM4), _nonfungiblePositionM[Network.ARBITRUM] = (_Network$ARBITRUM4 = {}, _Network$ARBITRUM4[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$ARBITRUM4[Dapp.RAMSESCL] = "0xAA277CB7914b7e5514946Da92cb9De332Ce610EF", _Network$ARBITRUM4), _nonfungiblePositionM[Network.BASE] = (_Network$BASE3 = {}, _Network$BASE3[Dapp.UNISWAPV3] = "0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1", _Network$BASE3[Dapp.AERODROMECL] = "0x827922686190790b37229fd06084350e74485b72", _Network$BASE3), _nonfungiblePositionM);
4257
4296
  var networkChainIdMap = (_networkChainIdMap = {}, _networkChainIdMap[Network.POLYGON] = 137, _networkChainIdMap[Network.OPTIMISM] = 10, _networkChainIdMap[Network.ARBITRUM] = 42161, _networkChainIdMap[Network.BASE] = 8453, _networkChainIdMap);
4258
4297
  var balancerSubgraph = (_balancerSubgraph = {}, _balancerSubgraph[Network.POLYGON] = "https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-polygon-v2", _balancerSubgraph[Network.OPTIMISM] = "", _balancerSubgraph[Network.ARBITRUM] = "", _balancerSubgraph[Network.BASE] = "", _balancerSubgraph);
4259
4298
  var multiCallAddress = (_multiCallAddress = {}, _multiCallAddress[Network.POLYGON] = "0x275617327c958bD06b5D6b871E7f491D76113dd8", _multiCallAddress[Network.OPTIMISM] = "", _multiCallAddress[Network.ARBITRUM] = "", _multiCallAddress[Network.BASE] = "", _multiCallAddress);
@@ -10011,100 +10050,75 @@ function _getUniswapV3SwapTxData() {
10011
10050
  return _getUniswapV3SwapTxData.apply(this, arguments);
10012
10051
  }
10013
10052
 
10014
- var abi$h = [
10015
- {
10016
- inputs: [
10017
- {
10018
- internalType: "address",
10019
- name: "",
10020
- type: "address"
10021
- }
10022
- ],
10023
- name: "allowedPools",
10024
- outputs: [
10025
- {
10026
- internalType: "bool",
10027
- name: "",
10028
- type: "bool"
10029
- }
10030
- ],
10031
- stateMutability: "view",
10032
- type: "function"
10033
- },
10034
- {
10035
- inputs: [
10036
- {
10037
- internalType: "address",
10038
- name: "pool",
10039
- type: "address"
10040
- },
10041
- {
10042
- internalType: "contract IERC20Extended",
10043
- name: "depositAsset",
10044
- type: "address"
10045
- },
10046
- {
10047
- internalType: "uint256",
10048
- name: "amount",
10049
- type: "uint256"
10050
- },
10051
- {
10052
- internalType: "contract IERC20Extended",
10053
- name: "poolDepositAsset",
10054
- type: "address"
10055
- },
10056
- {
10057
- internalType: "uint256",
10058
- name: "expectedLiquidityMinted",
10059
- type: "uint256"
10060
- }
10061
- ],
10062
- name: "deposit",
10063
- outputs: [
10064
- {
10065
- internalType: "uint256",
10066
- name: "liquidityMinted",
10067
- type: "uint256"
10068
- }
10069
- ],
10070
- stateMutability: "nonpayable",
10071
- type: "function"
10072
- },
10053
+ var IDhedgeEasySwapper = [
10073
10054
  {
10074
10055
  inputs: [
10075
10056
  {
10076
- internalType: "address",
10077
- name: "pool",
10078
- type: "address"
10079
- },
10080
- {
10081
- internalType: "contract IERC20Extended",
10082
- name: "depositAsset",
10083
- type: "address"
10084
- },
10085
- {
10086
- internalType: "uint256",
10087
- name: "amount",
10088
- type: "uint256"
10089
- },
10090
- {
10091
- internalType: "contract IERC20Extended",
10092
- name: "poolDepositAsset",
10093
- type: "address"
10057
+ components: [
10058
+ {
10059
+ components: [
10060
+ {
10061
+ internalType: "contract IERC20",
10062
+ name: "token",
10063
+ type: "address"
10064
+ },
10065
+ {
10066
+ internalType: "uint256",
10067
+ name: "amount",
10068
+ type: "uint256"
10069
+ },
10070
+ {
10071
+ components: [
10072
+ {
10073
+ internalType: "bytes32",
10074
+ name: "routerKey",
10075
+ type: "bytes32"
10076
+ },
10077
+ {
10078
+ internalType: "bytes",
10079
+ name: "swapData",
10080
+ type: "bytes"
10081
+ }
10082
+ ],
10083
+ internalType: "struct ISwapper.AggregatorData",
10084
+ name: "aggregatorData",
10085
+ type: "tuple"
10086
+ }
10087
+ ],
10088
+ internalType: "struct ISwapper.SrcTokenSwapDetails[]",
10089
+ name: "srcData",
10090
+ type: "tuple[]"
10091
+ },
10092
+ {
10093
+ components: [
10094
+ {
10095
+ internalType: "contract IERC20",
10096
+ name: "destToken",
10097
+ type: "address"
10098
+ },
10099
+ {
10100
+ internalType: "uint256",
10101
+ name: "minDestAmount",
10102
+ type: "uint256"
10103
+ }
10104
+ ],
10105
+ internalType: "struct ISwapper.DestData",
10106
+ name: "destData",
10107
+ type: "tuple"
10108
+ }
10109
+ ],
10110
+ internalType: "struct IWithdrawalVault.MultiInSingleOutData",
10111
+ name: "_swapData",
10112
+ type: "tuple"
10094
10113
  },
10095
10114
  {
10096
10115
  internalType: "uint256",
10097
- name: "expectedLiquidityMinted",
10116
+ name: "_expectedDestTokenAmount",
10098
10117
  type: "uint256"
10099
10118
  }
10100
10119
  ],
10101
- name: "depositWithCustomCooldown",
10120
+ name: "completeWithdrawal",
10102
10121
  outputs: [
10103
- {
10104
- internalType: "uint256",
10105
- name: "liquidityMinted",
10106
- type: "uint256"
10107
- }
10108
10122
  ],
10109
10123
  stateMutability: "nonpayable",
10110
10124
  type: "function"
@@ -10113,1095 +10127,116 @@ var abi$h = [
10113
10127
  inputs: [
10114
10128
  {
10115
10129
  internalType: "address",
10116
- name: "pool",
10130
+ name: "_dHedgeVault",
10117
10131
  type: "address"
10118
10132
  },
10119
- {
10120
- internalType: "contract IERC20Extended",
10121
- name: "poolDepositAsset",
10122
- type: "address"
10123
- },
10124
- {
10125
- internalType: "uint256",
10126
- name: "expectedLiquidityMinted",
10127
- type: "uint256"
10128
- }
10129
- ],
10130
- name: "depositNative",
10131
- outputs: [
10132
- {
10133
- internalType: "uint256",
10134
- name: "liquidityMinted",
10135
- type: "uint256"
10136
- }
10137
- ],
10138
- stateMutability: "payable",
10139
- type: "function"
10140
- },
10141
- {
10142
- inputs: [
10143
10133
  {
10144
10134
  internalType: "address",
10145
- name: "pool",
10146
- type: "address"
10147
- },
10148
- {
10149
- internalType: "contract IERC20Extended",
10150
- name: "poolDepositAsset",
10135
+ name: "_vaultDepositToken",
10151
10136
  type: "address"
10152
10137
  },
10153
10138
  {
10154
10139
  internalType: "uint256",
10155
- name: "expectedLiquidityMinted",
10140
+ name: "_depositAmount",
10156
10141
  type: "uint256"
10157
10142
  }
10158
10143
  ],
10159
- name: "depositNativeWithCustomCooldown",
10144
+ name: "depositQuote",
10160
10145
  outputs: [
10161
10146
  {
10162
10147
  internalType: "uint256",
10163
- name: "liquidityMinted",
10148
+ name: "expectedAmountReceived",
10164
10149
  type: "uint256"
10165
10150
  }
10166
10151
  ],
10167
- stateMutability: "payable",
10152
+ stateMutability: "view",
10168
10153
  type: "function"
10169
10154
  },
10170
10155
  {
10171
10156
  inputs: [
10172
10157
  {
10173
10158
  internalType: "address",
10174
- name: "pool",
10159
+ name: "_dHedgeVault",
10175
10160
  type: "address"
10176
10161
  },
10177
10162
  {
10178
- internalType: "contract IERC20Extended",
10179
- name: "depositAsset",
10163
+ internalType: "contract IERC20",
10164
+ name: "_vaultDepositToken",
10180
10165
  type: "address"
10181
10166
  },
10182
10167
  {
10183
10168
  internalType: "uint256",
10184
- name: "amount",
10169
+ name: "_depositAmount",
10185
10170
  type: "uint256"
10186
10171
  },
10187
- {
10188
- internalType: "contract IERC20Extended",
10189
- name: "poolDepositAsset",
10190
- type: "address"
10191
- },
10192
- {
10193
- internalType: "bool",
10194
- name: "customCooldown",
10195
- type: "bool"
10196
- }
10197
- ],
10198
- name: "depositQuote",
10199
- outputs: [
10200
- {
10201
- internalType: "uint256",
10202
- name: "expectedLiquidityMinted",
10203
- type: "uint256"
10204
- }
10205
- ],
10206
- stateMutability: "view",
10207
- type: "function"
10208
- },
10209
- {
10210
- inputs: [
10211
- ],
10212
- name: "feeDenominator",
10213
- outputs: [
10214
10172
  {
10215
10173
  internalType: "uint256",
10216
- name: "",
10174
+ name: "_expectedAmountReceived",
10217
10175
  type: "uint256"
10218
10176
  }
10219
10177
  ],
10220
- stateMutability: "view",
10221
- type: "function"
10222
- },
10223
- {
10224
- inputs: [
10225
- ],
10226
- name: "feeNumerator",
10178
+ name: "depositWithCustomCooldown",
10227
10179
  outputs: [
10228
- {
10229
- internalType: "uint256",
10230
- name: "",
10231
- type: "uint256"
10232
- }
10233
10180
  ],
10234
- stateMutability: "view",
10181
+ stateMutability: "nonpayable",
10235
10182
  type: "function"
10236
10183
  },
10237
10184
  {
10238
10185
  inputs: [
10239
10186
  {
10240
10187
  internalType: "address",
10241
- name: "pool",
10242
- type: "address"
10243
- },
10244
- {
10245
- internalType: "uint256",
10246
- name: "fundTokenAmount",
10247
- type: "uint256"
10248
- },
10249
- {
10250
- internalType: "contract IERC20Extended",
10251
- name: "withdrawalAsset",
10188
+ name: "_depositor",
10252
10189
  type: "address"
10253
- },
10254
- {
10255
- internalType: "uint256",
10256
- name: "expectedAmountOut",
10257
- type: "uint256"
10258
10190
  }
10259
10191
  ],
10260
- name: "withdraw",
10192
+ name: "getTrackedAssets",
10261
10193
  outputs: [
10262
- ],
10263
- stateMutability: "nonpayable",
10264
- type: "function"
10265
- },
10266
- {
10267
- inputs: [
10268
- {
10269
- internalType: "address",
10270
- name: "pool",
10271
- type: "address"
10272
- },
10273
- {
10274
- internalType: "uint256",
10275
- name: "fundTokenAmount",
10276
- type: "uint256"
10277
- },
10278
10194
  {
10279
- internalType: "uint256",
10280
- name: "expectedAmountOut",
10281
- type: "uint256"
10195
+ components: [
10196
+ {
10197
+ internalType: "address",
10198
+ name: "token",
10199
+ type: "address"
10200
+ },
10201
+ {
10202
+ internalType: "uint256",
10203
+ name: "balance",
10204
+ type: "uint256"
10205
+ }
10206
+ ],
10207
+ internalType: "struct IWithdrawalVault.TrackedAsset[]",
10208
+ name: "trackedAssets_",
10209
+ type: "tuple[]"
10282
10210
  }
10283
10211
  ],
10284
- name: "withdrawNative",
10285
- outputs: [
10286
- ],
10287
- stateMutability: "nonpayable",
10212
+ stateMutability: "view",
10288
10213
  type: "function"
10289
10214
  },
10290
10215
  {
10291
10216
  inputs: [
10292
10217
  {
10293
10218
  internalType: "address",
10294
- name: "pool",
10219
+ name: "_dHedgeVault",
10295
10220
  type: "address"
10296
10221
  },
10297
10222
  {
10298
10223
  internalType: "uint256",
10299
- name: "fundTokenAmount",
10224
+ name: "_amountIn",
10300
10225
  type: "uint256"
10301
10226
  },
10302
- {
10303
- internalType: "contract IERC20Extended",
10304
- name: "intermediateAsset",
10305
- type: "address"
10306
- },
10307
10227
  {
10308
10228
  internalType: "uint256",
10309
- name: "expectedAmountSUSD",
10229
+ name: "_slippageTolerance",
10310
10230
  type: "uint256"
10311
10231
  }
10312
10232
  ],
10313
- name: "withdrawSUSD",
10233
+ name: "initWithdrawal",
10314
10234
  outputs: [
10315
10235
  ],
10316
10236
  stateMutability: "nonpayable",
10317
10237
  type: "function"
10318
10238
  }
10319
10239
  ];
10320
- var IDhedgeEasySwapper = {
10321
- abi: abi$h
10322
- };
10323
-
10324
- var abi$i = [
10325
- {
10326
- inputs: [
10327
- {
10328
- internalType: "string",
10329
- name: "marketId",
10330
- type: "string"
10331
- },
10332
- {
10333
- internalType: "address",
10334
- name: "owner",
10335
- type: "address"
10336
- }
10337
- ],
10338
- stateMutability: "nonpayable",
10339
- type: "constructor"
10340
- },
10341
- {
10342
- anonymous: false,
10343
- inputs: [
10344
- {
10345
- indexed: true,
10346
- internalType: "address",
10347
- name: "oldAddress",
10348
- type: "address"
10349
- },
10350
- {
10351
- indexed: true,
10352
- internalType: "address",
10353
- name: "newAddress",
10354
- type: "address"
10355
- }
10356
- ],
10357
- name: "ACLAdminUpdated",
10358
- type: "event"
10359
- },
10360
- {
10361
- anonymous: false,
10362
- inputs: [
10363
- {
10364
- indexed: true,
10365
- internalType: "address",
10366
- name: "oldAddress",
10367
- type: "address"
10368
- },
10369
- {
10370
- indexed: true,
10371
- internalType: "address",
10372
- name: "newAddress",
10373
- type: "address"
10374
- }
10375
- ],
10376
- name: "ACLManagerUpdated",
10377
- type: "event"
10378
- },
10379
- {
10380
- anonymous: false,
10381
- inputs: [
10382
- {
10383
- indexed: true,
10384
- internalType: "bytes32",
10385
- name: "id",
10386
- type: "bytes32"
10387
- },
10388
- {
10389
- indexed: true,
10390
- internalType: "address",
10391
- name: "oldAddress",
10392
- type: "address"
10393
- },
10394
- {
10395
- indexed: true,
10396
- internalType: "address",
10397
- name: "newAddress",
10398
- type: "address"
10399
- }
10400
- ],
10401
- name: "AddressSet",
10402
- type: "event"
10403
- },
10404
- {
10405
- anonymous: false,
10406
- inputs: [
10407
- {
10408
- indexed: true,
10409
- internalType: "bytes32",
10410
- name: "id",
10411
- type: "bytes32"
10412
- },
10413
- {
10414
- indexed: true,
10415
- internalType: "address",
10416
- name: "proxyAddress",
10417
- type: "address"
10418
- },
10419
- {
10420
- indexed: false,
10421
- internalType: "address",
10422
- name: "oldImplementationAddress",
10423
- type: "address"
10424
- },
10425
- {
10426
- indexed: true,
10427
- internalType: "address",
10428
- name: "newImplementationAddress",
10429
- type: "address"
10430
- }
10431
- ],
10432
- name: "AddressSetAsProxy",
10433
- type: "event"
10434
- },
10435
- {
10436
- anonymous: false,
10437
- inputs: [
10438
- {
10439
- indexed: true,
10440
- internalType: "string",
10441
- name: "oldMarketId",
10442
- type: "string"
10443
- },
10444
- {
10445
- indexed: true,
10446
- internalType: "string",
10447
- name: "newMarketId",
10448
- type: "string"
10449
- }
10450
- ],
10451
- name: "MarketIdSet",
10452
- type: "event"
10453
- },
10454
- {
10455
- anonymous: false,
10456
- inputs: [
10457
- {
10458
- indexed: true,
10459
- internalType: "address",
10460
- name: "previousOwner",
10461
- type: "address"
10462
- },
10463
- {
10464
- indexed: true,
10465
- internalType: "address",
10466
- name: "newOwner",
10467
- type: "address"
10468
- }
10469
- ],
10470
- name: "OwnershipTransferred",
10471
- type: "event"
10472
- },
10473
- {
10474
- anonymous: false,
10475
- inputs: [
10476
- {
10477
- indexed: true,
10478
- internalType: "address",
10479
- name: "oldAddress",
10480
- type: "address"
10481
- },
10482
- {
10483
- indexed: true,
10484
- internalType: "address",
10485
- name: "newAddress",
10486
- type: "address"
10487
- }
10488
- ],
10489
- name: "PoolConfiguratorUpdated",
10490
- type: "event"
10491
- },
10492
- {
10493
- anonymous: false,
10494
- inputs: [
10495
- {
10496
- indexed: true,
10497
- internalType: "address",
10498
- name: "oldAddress",
10499
- type: "address"
10500
- },
10501
- {
10502
- indexed: true,
10503
- internalType: "address",
10504
- name: "newAddress",
10505
- type: "address"
10506
- }
10507
- ],
10508
- name: "PoolDataProviderUpdated",
10509
- type: "event"
10510
- },
10511
- {
10512
- anonymous: false,
10513
- inputs: [
10514
- {
10515
- indexed: true,
10516
- internalType: "address",
10517
- name: "oldAddress",
10518
- type: "address"
10519
- },
10520
- {
10521
- indexed: true,
10522
- internalType: "address",
10523
- name: "newAddress",
10524
- type: "address"
10525
- }
10526
- ],
10527
- name: "PoolUpdated",
10528
- type: "event"
10529
- },
10530
- {
10531
- anonymous: false,
10532
- inputs: [
10533
- {
10534
- indexed: true,
10535
- internalType: "address",
10536
- name: "oldAddress",
10537
- type: "address"
10538
- },
10539
- {
10540
- indexed: true,
10541
- internalType: "address",
10542
- name: "newAddress",
10543
- type: "address"
10544
- }
10545
- ],
10546
- name: "PriceOracleSentinelUpdated",
10547
- type: "event"
10548
- },
10549
- {
10550
- anonymous: false,
10551
- inputs: [
10552
- {
10553
- indexed: true,
10554
- internalType: "address",
10555
- name: "oldAddress",
10556
- type: "address"
10557
- },
10558
- {
10559
- indexed: true,
10560
- internalType: "address",
10561
- name: "newAddress",
10562
- type: "address"
10563
- }
10564
- ],
10565
- name: "PriceOracleUpdated",
10566
- type: "event"
10567
- },
10568
- {
10569
- anonymous: false,
10570
- inputs: [
10571
- {
10572
- indexed: true,
10573
- internalType: "bytes32",
10574
- name: "id",
10575
- type: "bytes32"
10576
- },
10577
- {
10578
- indexed: true,
10579
- internalType: "address",
10580
- name: "proxyAddress",
10581
- type: "address"
10582
- },
10583
- {
10584
- indexed: true,
10585
- internalType: "address",
10586
- name: "implementationAddress",
10587
- type: "address"
10588
- }
10589
- ],
10590
- name: "ProxyCreated",
10591
- type: "event"
10592
- },
10593
- {
10594
- inputs: [
10595
- ],
10596
- name: "getACLAdmin",
10597
- outputs: [
10598
- {
10599
- internalType: "address",
10600
- name: "",
10601
- type: "address"
10602
- }
10603
- ],
10604
- stateMutability: "view",
10605
- type: "function"
10606
- },
10607
- {
10608
- inputs: [
10609
- ],
10610
- name: "getACLManager",
10611
- outputs: [
10612
- {
10613
- internalType: "address",
10614
- name: "",
10615
- type: "address"
10616
- }
10617
- ],
10618
- stateMutability: "view",
10619
- type: "function"
10620
- },
10621
- {
10622
- inputs: [
10623
- {
10624
- internalType: "bytes32",
10625
- name: "id",
10626
- type: "bytes32"
10627
- }
10628
- ],
10629
- name: "getAddress",
10630
- outputs: [
10631
- {
10632
- internalType: "address",
10633
- name: "",
10634
- type: "address"
10635
- }
10636
- ],
10637
- stateMutability: "view",
10638
- type: "function"
10639
- },
10640
- {
10641
- inputs: [
10642
- ],
10643
- name: "getMarketId",
10644
- outputs: [
10645
- {
10646
- internalType: "string",
10647
- name: "",
10648
- type: "string"
10649
- }
10650
- ],
10651
- stateMutability: "view",
10652
- type: "function"
10653
- },
10654
- {
10655
- inputs: [
10656
- ],
10657
- name: "getPool",
10658
- outputs: [
10659
- {
10660
- internalType: "address",
10661
- name: "",
10662
- type: "address"
10663
- }
10664
- ],
10665
- stateMutability: "view",
10666
- type: "function"
10667
- },
10668
- {
10669
- inputs: [
10670
- ],
10671
- name: "getPoolConfigurator",
10672
- outputs: [
10673
- {
10674
- internalType: "address",
10675
- name: "",
10676
- type: "address"
10677
- }
10678
- ],
10679
- stateMutability: "view",
10680
- type: "function"
10681
- },
10682
- {
10683
- inputs: [
10684
- ],
10685
- name: "getPoolDataProvider",
10686
- outputs: [
10687
- {
10688
- internalType: "address",
10689
- name: "",
10690
- type: "address"
10691
- }
10692
- ],
10693
- stateMutability: "view",
10694
- type: "function"
10695
- },
10696
- {
10697
- inputs: [
10698
- ],
10699
- name: "getPriceOracle",
10700
- outputs: [
10701
- {
10702
- internalType: "address",
10703
- name: "",
10704
- type: "address"
10705
- }
10706
- ],
10707
- stateMutability: "view",
10708
- type: "function"
10709
- },
10710
- {
10711
- inputs: [
10712
- ],
10713
- name: "getPriceOracleSentinel",
10714
- outputs: [
10715
- {
10716
- internalType: "address",
10717
- name: "",
10718
- type: "address"
10719
- }
10720
- ],
10721
- stateMutability: "view",
10722
- type: "function"
10723
- },
10724
- {
10725
- inputs: [
10726
- ],
10727
- name: "owner",
10728
- outputs: [
10729
- {
10730
- internalType: "address",
10731
- name: "",
10732
- type: "address"
10733
- }
10734
- ],
10735
- stateMutability: "view",
10736
- type: "function"
10737
- },
10738
- {
10739
- inputs: [
10740
- ],
10741
- name: "renounceOwnership",
10742
- outputs: [
10743
- ],
10744
- stateMutability: "nonpayable",
10745
- type: "function"
10746
- },
10747
- {
10748
- inputs: [
10749
- {
10750
- internalType: "address",
10751
- name: "newAclAdmin",
10752
- type: "address"
10753
- }
10754
- ],
10755
- name: "setACLAdmin",
10756
- outputs: [
10757
- ],
10758
- stateMutability: "nonpayable",
10759
- type: "function"
10760
- },
10761
- {
10762
- inputs: [
10763
- {
10764
- internalType: "address",
10765
- name: "newAclManager",
10766
- type: "address"
10767
- }
10768
- ],
10769
- name: "setACLManager",
10770
- outputs: [
10771
- ],
10772
- stateMutability: "nonpayable",
10773
- type: "function"
10774
- },
10775
- {
10776
- inputs: [
10777
- {
10778
- internalType: "bytes32",
10779
- name: "id",
10780
- type: "bytes32"
10781
- },
10782
- {
10783
- internalType: "address",
10784
- name: "newAddress",
10785
- type: "address"
10786
- }
10787
- ],
10788
- name: "setAddress",
10789
- outputs: [
10790
- ],
10791
- stateMutability: "nonpayable",
10792
- type: "function"
10793
- },
10794
- {
10795
- inputs: [
10796
- {
10797
- internalType: "bytes32",
10798
- name: "id",
10799
- type: "bytes32"
10800
- },
10801
- {
10802
- internalType: "address",
10803
- name: "newImplementationAddress",
10804
- type: "address"
10805
- }
10806
- ],
10807
- name: "setAddressAsProxy",
10808
- outputs: [
10809
- ],
10810
- stateMutability: "nonpayable",
10811
- type: "function"
10812
- },
10813
- {
10814
- inputs: [
10815
- {
10816
- internalType: "string",
10817
- name: "newMarketId",
10818
- type: "string"
10819
- }
10820
- ],
10821
- name: "setMarketId",
10822
- outputs: [
10823
- ],
10824
- stateMutability: "nonpayable",
10825
- type: "function"
10826
- },
10827
- {
10828
- inputs: [
10829
- {
10830
- internalType: "address",
10831
- name: "newPoolConfiguratorImpl",
10832
- type: "address"
10833
- }
10834
- ],
10835
- name: "setPoolConfiguratorImpl",
10836
- outputs: [
10837
- ],
10838
- stateMutability: "nonpayable",
10839
- type: "function"
10840
- },
10841
- {
10842
- inputs: [
10843
- {
10844
- internalType: "address",
10845
- name: "newDataProvider",
10846
- type: "address"
10847
- }
10848
- ],
10849
- name: "setPoolDataProvider",
10850
- outputs: [
10851
- ],
10852
- stateMutability: "nonpayable",
10853
- type: "function"
10854
- },
10855
- {
10856
- inputs: [
10857
- {
10858
- internalType: "address",
10859
- name: "newPoolImpl",
10860
- type: "address"
10861
- }
10862
- ],
10863
- name: "setPoolImpl",
10864
- outputs: [
10865
- ],
10866
- stateMutability: "nonpayable",
10867
- type: "function"
10868
- },
10869
- {
10870
- inputs: [
10871
- {
10872
- internalType: "address",
10873
- name: "newPriceOracle",
10874
- type: "address"
10875
- }
10876
- ],
10877
- name: "setPriceOracle",
10878
- outputs: [
10879
- ],
10880
- stateMutability: "nonpayable",
10881
- type: "function"
10882
- },
10883
- {
10884
- inputs: [
10885
- {
10886
- internalType: "address",
10887
- name: "newPriceOracleSentinel",
10888
- type: "address"
10889
- }
10890
- ],
10891
- name: "setPriceOracleSentinel",
10892
- outputs: [
10893
- ],
10894
- stateMutability: "nonpayable",
10895
- type: "function"
10896
- },
10897
- {
10898
- inputs: [
10899
- {
10900
- internalType: "address",
10901
- name: "newOwner",
10902
- type: "address"
10903
- }
10904
- ],
10905
- name: "transferOwnership",
10906
- outputs: [
10907
- ],
10908
- stateMutability: "nonpayable",
10909
- type: "function"
10910
- }
10911
- ];
10912
- var IAaveV3PoolAddressProvider = {
10913
- abi: abi$i
10914
- };
10915
-
10916
- var abi$j = [
10917
- {
10918
- inputs: [
10919
- {
10920
- internalType: "address[]",
10921
- name: "_assets",
10922
- type: "address[]"
10923
- },
10924
- {
10925
- internalType: "address[]",
10926
- name: "_sources",
10927
- type: "address[]"
10928
- },
10929
- {
10930
- internalType: "address",
10931
- name: "_fallbackOracle",
10932
- type: "address"
10933
- }
10934
- ],
10935
- payable: false,
10936
- stateMutability: "nonpayable",
10937
- type: "constructor"
10938
- },
10939
- {
10940
- anonymous: false,
10941
- inputs: [
10942
- {
10943
- indexed: true,
10944
- internalType: "address",
10945
- name: "asset",
10946
- type: "address"
10947
- },
10948
- {
10949
- indexed: true,
10950
- internalType: "address",
10951
- name: "source",
10952
- type: "address"
10953
- }
10954
- ],
10955
- name: "AssetSourceUpdated",
10956
- type: "event"
10957
- },
10958
- {
10959
- anonymous: false,
10960
- inputs: [
10961
- {
10962
- indexed: true,
10963
- internalType: "address",
10964
- name: "fallbackOracle",
10965
- type: "address"
10966
- }
10967
- ],
10968
- name: "FallbackOracleUpdated",
10969
- type: "event"
10970
- },
10971
- {
10972
- anonymous: false,
10973
- inputs: [
10974
- {
10975
- indexed: true,
10976
- internalType: "address",
10977
- name: "previousOwner",
10978
- type: "address"
10979
- },
10980
- {
10981
- indexed: true,
10982
- internalType: "address",
10983
- name: "newOwner",
10984
- type: "address"
10985
- }
10986
- ],
10987
- name: "OwnershipTransferred",
10988
- type: "event"
10989
- },
10990
- {
10991
- constant: true,
10992
- inputs: [
10993
- ],
10994
- name: "isOwner",
10995
- outputs: [
10996
- {
10997
- internalType: "bool",
10998
- name: "",
10999
- type: "bool"
11000
- }
11001
- ],
11002
- payable: false,
11003
- stateMutability: "view",
11004
- type: "function"
11005
- },
11006
- {
11007
- constant: true,
11008
- inputs: [
11009
- ],
11010
- name: "owner",
11011
- outputs: [
11012
- {
11013
- internalType: "address",
11014
- name: "",
11015
- type: "address"
11016
- }
11017
- ],
11018
- payable: false,
11019
- stateMutability: "view",
11020
- type: "function"
11021
- },
11022
- {
11023
- constant: false,
11024
- inputs: [
11025
- ],
11026
- name: "renounceOwnership",
11027
- outputs: [
11028
- ],
11029
- payable: false,
11030
- stateMutability: "nonpayable",
11031
- type: "function"
11032
- },
11033
- {
11034
- constant: false,
11035
- inputs: [
11036
- {
11037
- internalType: "address",
11038
- name: "newOwner",
11039
- type: "address"
11040
- }
11041
- ],
11042
- name: "transferOwnership",
11043
- outputs: [
11044
- ],
11045
- payable: false,
11046
- stateMutability: "nonpayable",
11047
- type: "function"
11048
- },
11049
- {
11050
- constant: false,
11051
- inputs: [
11052
- {
11053
- internalType: "address[]",
11054
- name: "_assets",
11055
- type: "address[]"
11056
- },
11057
- {
11058
- internalType: "address[]",
11059
- name: "_sources",
11060
- type: "address[]"
11061
- }
11062
- ],
11063
- name: "setAssetSources",
11064
- outputs: [
11065
- ],
11066
- payable: false,
11067
- stateMutability: "nonpayable",
11068
- type: "function"
11069
- },
11070
- {
11071
- constant: false,
11072
- inputs: [
11073
- {
11074
- internalType: "address",
11075
- name: "_fallbackOracle",
11076
- type: "address"
11077
- }
11078
- ],
11079
- name: "setFallbackOracle",
11080
- outputs: [
11081
- ],
11082
- payable: false,
11083
- stateMutability: "nonpayable",
11084
- type: "function"
11085
- },
11086
- {
11087
- constant: true,
11088
- inputs: [
11089
- {
11090
- internalType: "address",
11091
- name: "_asset",
11092
- type: "address"
11093
- }
11094
- ],
11095
- name: "getAssetPrice",
11096
- outputs: [
11097
- {
11098
- internalType: "uint256",
11099
- name: "",
11100
- type: "uint256"
11101
- }
11102
- ],
11103
- payable: false,
11104
- stateMutability: "view",
11105
- type: "function"
11106
- },
11107
- {
11108
- constant: true,
11109
- inputs: [
11110
- {
11111
- internalType: "address[]",
11112
- name: "_assets",
11113
- type: "address[]"
11114
- }
11115
- ],
11116
- name: "getAssetsPrices",
11117
- outputs: [
11118
- {
11119
- internalType: "uint256[]",
11120
- name: "",
11121
- type: "uint256[]"
11122
- }
11123
- ],
11124
- payable: false,
11125
- stateMutability: "view",
11126
- type: "function"
11127
- },
11128
- {
11129
- constant: true,
11130
- inputs: [
11131
- {
11132
- internalType: "address",
11133
- name: "_asset",
11134
- type: "address"
11135
- }
11136
- ],
11137
- name: "getSourceOfAsset",
11138
- outputs: [
11139
- {
11140
- internalType: "address",
11141
- name: "",
11142
- type: "address"
11143
- }
11144
- ],
11145
- payable: false,
11146
- stateMutability: "view",
11147
- type: "function"
11148
- },
11149
- {
11150
- constant: true,
11151
- inputs: [
11152
- ],
11153
- name: "getFallbackOracle",
11154
- outputs: [
11155
- {
11156
- internalType: "address",
11157
- name: "",
11158
- type: "address"
11159
- }
11160
- ],
11161
- payable: false,
11162
- stateMutability: "view",
11163
- type: "function"
11164
- }
11165
- ];
11166
- var IPriceOracle = {
11167
- abi: abi$j
11168
- };
11169
-
11170
- function getChainlinkPriceInUsd(_x, _x2) {
11171
- return _getChainlinkPriceInUsd.apply(this, arguments);
11172
- }
11173
-
11174
- function _getChainlinkPriceInUsd() {
11175
- _getChainlinkPriceInUsd = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool, asset) {
11176
- var lendingPoolAddressProvider, priceOracleAddress, priceOracle;
11177
- return runtime_1.wrap(function _callee$(_context) {
11178
- while (1) {
11179
- switch (_context.prev = _context.next) {
11180
- case 0:
11181
- //Workaround as Chainlink doesn't have feed registry on Polygon/Optimism
11182
- //Use oracle from Aave which uses Chainlink
11183
- lendingPoolAddressProvider = new ethers.Contract(aaveAddressProvider[pool.network][Dapp.AAVEV3], IAaveV3PoolAddressProvider.abi, pool.signer);
11184
- _context.next = 3;
11185
- return lendingPoolAddressProvider.getPriceOracle();
11186
-
11187
- case 3:
11188
- priceOracleAddress = _context.sent;
11189
- priceOracle = new ethers.Contract(priceOracleAddress, IPriceOracle.abi, pool.signer);
11190
- _context.next = 7;
11191
- return priceOracle.getAssetPrice(asset);
11192
-
11193
- case 7:
11194
- return _context.abrupt("return", _context.sent);
11195
-
11196
- case 8:
11197
- case "end":
11198
- return _context.stop();
11199
- }
11200
- }
11201
- }, _callee);
11202
- }));
11203
- return _getChainlinkPriceInUsd.apply(this, arguments);
11204
- }
11205
10240
 
11206
10241
  function loadPool(_x, _x2) {
11207
10242
  return _loadPool.apply(this, arguments);
@@ -11259,6 +10294,169 @@ function _isPool() {
11259
10294
  return _isPool.apply(this, arguments);
11260
10295
  }
11261
10296
 
10297
+ var oneInchBaseUrl = "https://api.1inch.dev/swap/v6.0/";
10298
+ function getOneInchSwapTxData(_x, _x2, _x3, _x4, _x5, _x6) {
10299
+ return _getOneInchSwapTxData.apply(this, arguments);
10300
+ }
10301
+
10302
+ function _getOneInchSwapTxData() {
10303
+ _getOneInchSwapTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool, assetFrom, assetTo, amountIn, slippage, forEasySwapper) {
10304
+ var chainId, apiUrl, params, response, swapTxData, dstAmount;
10305
+ return runtime_1.wrap(function _callee$(_context) {
10306
+ while (1) {
10307
+ switch (_context.prev = _context.next) {
10308
+ case 0:
10309
+ if (forEasySwapper === void 0) {
10310
+ forEasySwapper = false;
10311
+ }
10312
+
10313
+ if (process.env.ONEINCH_API_KEY) {
10314
+ _context.next = 3;
10315
+ break;
10316
+ }
10317
+
10318
+ throw new Error("ONEINCH_API_KEY not configured in .env file");
10319
+
10320
+ case 3:
10321
+ chainId = networkChainIdMap[pool.network];
10322
+ apiUrl = "" + oneInchBaseUrl + chainId + "/swap";
10323
+ params = {
10324
+ src: assetFrom,
10325
+ dst: assetTo,
10326
+ amount: amountIn.toString(),
10327
+ from: forEasySwapper ? routerAddress[pool.network].toros : pool.address,
10328
+ receiver: forEasySwapper ? routerAddress[pool.network].toros : pool.address,
10329
+ slippage: slippage,
10330
+ disableEstimate: true,
10331
+ usePermit2: false
10332
+ };
10333
+ _context.prev = 6;
10334
+ _context.next = 9;
10335
+ return axios.get(apiUrl, {
10336
+ headers: {
10337
+ Authorization: "Bearer " + process.env.ONEINCH_API_KEY
10338
+ },
10339
+ params: params
10340
+ });
10341
+
10342
+ case 9:
10343
+ response = _context.sent;
10344
+ swapTxData = response.data.tx.data;
10345
+ dstAmount = response.data.dstAmount;
10346
+ return _context.abrupt("return", {
10347
+ swapTxData: swapTxData,
10348
+ dstAmount: dstAmount
10349
+ });
10350
+
10351
+ case 15:
10352
+ _context.prev = 15;
10353
+ _context.t0 = _context["catch"](6);
10354
+ throw new ApiError("Swap api request of 1inch failed");
10355
+
10356
+ case 18:
10357
+ case "end":
10358
+ return _context.stop();
10359
+ }
10360
+ }
10361
+ }, _callee, null, [[6, 15]]);
10362
+ }));
10363
+ return _getOneInchSwapTxData.apply(this, arguments);
10364
+ }
10365
+
10366
+ var _networkPortMap;
10367
+
10368
+ require("dotenv").config();
10369
+
10370
+ var networkPortMap = (_networkPortMap = {}, _networkPortMap[Network.POLYGON] = 8542, _networkPortMap[Network.OPTIMISM] = 8544, _networkPortMap[Network.ARBITRUM] = 8540, _networkPortMap[Network.BASE] = 8546, _networkPortMap);
10371
+
10372
+ var _TEST_POOL, _CONTRACT_ADDRESS, _USDC_BALANCEOF_SLOT, _WETH_BALANCEOF_SLOT;
10373
+ var TEST_POOL = (_TEST_POOL = {}, _TEST_POOL[Network.POLYGON] = "0x699fd4d6eadb216704c7e355cfa0a12f51813163", _TEST_POOL[Network.OPTIMISM] = "0x12573bfdf764ab9d52aca20e2827497a66829716", _TEST_POOL[Network.ARBITRUM] = "0x0b5f6591c8eb23e5a68102d3d39ebbb464ee5c14", _TEST_POOL[Network.BASE] = "0x4842b42F68524383F609aa46eAfc18c1459cE3cD", _TEST_POOL);
10374
+ var CONTRACT_ADDRESS = (_CONTRACT_ADDRESS = {}, _CONTRACT_ADDRESS[Network.POLYGON] = {
10375
+ USDC: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
10376
+ USDT: "",
10377
+ SUSD: "",
10378
+ SWETH: "",
10379
+ WETH: "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
10380
+ WBTC: "0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",
10381
+ ARRAKIS_USDC_WETH_GAUGE: "0x33d1ad9Cd88A509397CD924C2d7613C285602C20",
10382
+ ARRAKIS_USDC_WETH_LP: "0xa173340f1e942c2845bcbce8ebd411022e18eb13",
10383
+ WMATIC: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
10384
+ uniswapV3: {
10385
+ nonfungiblePositionManager: "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"
10386
+ },
10387
+ VELODROME_CL_USDC_WETH_GAUGE: "",
10388
+ VELO: "",
10389
+ COMPOUNDV3_WETH: "",
10390
+ TOROS: ""
10391
+ }, _CONTRACT_ADDRESS[Network.OPTIMISM] = {
10392
+ USDC: "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
10393
+ USDT: "",
10394
+ SWETH: "",
10395
+ SUSD: "0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9",
10396
+ WETH: "0x4200000000000000000000000000000000000006",
10397
+ WBTC: "0x68f180fcCe6836688e9084f035309E29Bf0A2095",
10398
+ KWENTA_ETH_PERP_V2: "0x2b3bb4c683bfc5239b029131eef3b1d214478d93",
10399
+ uniswapV3: {
10400
+ nonfungiblePositionManager: "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"
10401
+ },
10402
+ WMATIC: "",
10403
+ //
10404
+ ARRAKIS_USDC_WETH_GAUGE: "",
10405
+ ARRAKIS_USDC_WETH_LP: "",
10406
+ VELODROME_CL_USDC_WETH_GAUGE: "0xa75127121d28a9BF848F3B70e7Eea26570aa7700",
10407
+ VELO: "0x9560e827aF36c94D2Ac33a39bCE1Fe78631088Db",
10408
+ COMPOUNDV3_WETH: "",
10409
+ TOROS: "0x49bf093277bf4dde49c48c6aa55a3bda3eedef68" //USDmny
10410
+
10411
+ }, _CONTRACT_ADDRESS[Network.ARBITRUM] = {
10412
+ USDC: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
10413
+ USDT: "",
10414
+ SUSD: "",
10415
+ SWETH: "0xbc011A12Da28e8F0f528d9eE5E7039E22F91cf18",
10416
+ WETH: "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
10417
+ WBTC: "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f",
10418
+ WSTETH: "0x5979d7b546e38e414f7e9822514be443a4800529",
10419
+ BALANCER_WSTETH_WETH_POOL: "0x36bf227d6bac96e2ab1ebb5492ecec69c691943f",
10420
+ BALANCER_WSTETH_WETH_GAUGE: "0x251e51b25afa40f2b6b9f05aaf1bc7eaa0551771",
10421
+ uniswapV3: {
10422
+ nonfungiblePositionManager: "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"
10423
+ },
10424
+ //
10425
+ ARRAKIS_USDC_WETH_GAUGE: "",
10426
+ ARRAKIS_USDC_WETH_LP: "",
10427
+ WMATIC: "",
10428
+ VELODROME_CL_USDC_WETH_GAUGE: "",
10429
+ VELO: "",
10430
+ COMPOUNDV3_WETH: "0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486",
10431
+ TOROS: ""
10432
+ }, _CONTRACT_ADDRESS[Network.BASE] = {
10433
+ USDC: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
10434
+ USDT: "0xfde4c96c8593536e31f229ea8f37b2ada2699bb2",
10435
+ SUSD: "",
10436
+ WETH: "0x4200000000000000000000000000000000000006",
10437
+ WBTC: "",
10438
+ SWETH: "",
10439
+ uniswapV3: {
10440
+ nonfungiblePositionManager: ""
10441
+ },
10442
+ //
10443
+ ARRAKIS_USDC_WETH_GAUGE: "",
10444
+ ARRAKIS_USDC_WETH_LP: "",
10445
+ WMATIC: "",
10446
+ VELODROME_CL_USDC_WETH_GAUGE: "0xF33a96b5932D9E9B9A0eDA447AbD8C9d48d2e0c8",
10447
+ VELO: "0x940181a94A35A4569E4529A3CDfB74e38FD98631",
10448
+ COMPOUNDV3_WETH: "",
10449
+ TOROS: ""
10450
+ }, _CONTRACT_ADDRESS);
10451
+ var USDC_BALANCEOF_SLOT = (_USDC_BALANCEOF_SLOT = {}, _USDC_BALANCEOF_SLOT[Network.OPTIMISM] = 9, _USDC_BALANCEOF_SLOT[Network.ARBITRUM] = 9, _USDC_BALANCEOF_SLOT[Network.POLYGON] = 0, _USDC_BALANCEOF_SLOT[Network.BASE] = 9, _USDC_BALANCEOF_SLOT);
10452
+ var WETH_BALANCEOF_SLOT = (_WETH_BALANCEOF_SLOT = {}, _WETH_BALANCEOF_SLOT[Network.OPTIMISM] = 3, _WETH_BALANCEOF_SLOT[Network.ARBITRUM] = 51, _WETH_BALANCEOF_SLOT[Network.POLYGON] = 0, _WETH_BALANCEOF_SLOT[Network.BASE] = 0, _WETH_BALANCEOF_SLOT);
10453
+
10454
+ var wait = function wait(seconds) {
10455
+ return new Promise(function (resolve) {
10456
+ return setTimeout(resolve, seconds * 1000);
10457
+ });
10458
+ };
10459
+
11262
10460
  function getPoolDepositAsset(_x, _x2, _x3) {
11263
10461
  return _getPoolDepositAsset.apply(this, arguments);
11264
10462
  }
@@ -11307,52 +10505,20 @@ function _getPoolDepositAsset() {
11307
10505
  return _getPoolDepositAsset.apply(this, arguments);
11308
10506
  }
11309
10507
 
11310
- function getTorosPoolTokenPrice(_x4, _x5) {
11311
- return _getTorosPoolTokenPrice.apply(this, arguments);
11312
- }
11313
-
11314
- function _getTorosPoolTokenPrice() {
11315
- _getTorosPoolTokenPrice = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(pool, poolAddress) {
11316
- var torosPool;
11317
- return runtime_1.wrap(function _callee2$(_context2) {
11318
- while (1) {
11319
- switch (_context2.prev = _context2.next) {
11320
- case 0:
11321
- _context2.next = 2;
11322
- return loadPool(pool, poolAddress);
11323
-
11324
- case 2:
11325
- torosPool = _context2.sent;
11326
- _context2.next = 5;
11327
- return torosPool.poolLogic.tokenPrice();
11328
-
11329
- case 5:
11330
- return _context2.abrupt("return", _context2.sent);
11331
-
11332
- case 6:
11333
- case "end":
11334
- return _context2.stop();
11335
- }
11336
- }
11337
- }, _callee2);
11338
- }));
11339
- return _getTorosPoolTokenPrice.apply(this, arguments);
11340
- }
11341
-
11342
- function getEasySwapperDepositQuote(_x6, _x7, _x8, _x9, _x10) {
10508
+ function getEasySwapperDepositQuote(_x6, _x7, _x8, _x9) {
11343
10509
  return _getEasySwapperDepositQuote.apply(this, arguments);
11344
10510
  }
11345
10511
 
11346
10512
  function _getEasySwapperDepositQuote() {
11347
- _getEasySwapperDepositQuote = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(pool, torosAsset, investAsset, depositAsset, amountIn) {
10513
+ _getEasySwapperDepositQuote = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(pool, torosAsset, investAsset, amountIn) {
11348
10514
  var easySwapper;
11349
10515
  return runtime_1.wrap(function _callee3$(_context3) {
11350
10516
  while (1) {
11351
10517
  switch (_context3.prev = _context3.next) {
11352
10518
  case 0:
11353
- easySwapper = new ethers.Contract(routerAddress[pool.network][Dapp.TOROS], IDhedgeEasySwapper.abi, pool.signer);
10519
+ easySwapper = new ethers.Contract(routerAddress[pool.network][Dapp.TOROS], IDhedgeEasySwapper, pool.signer);
11354
10520
  _context3.next = 3;
11355
- return easySwapper.depositQuote(torosAsset, investAsset, amountIn, depositAsset, true);
10521
+ return easySwapper.depositQuote(torosAsset, investAsset, amountIn);
11356
10522
 
11357
10523
  case 3:
11358
10524
  return _context3.abrupt("return", _context3.sent);
@@ -11367,104 +10533,151 @@ function _getEasySwapperDepositQuote() {
11367
10533
  return _getEasySwapperDepositQuote.apply(this, arguments);
11368
10534
  }
11369
10535
 
11370
- function getEasySwapperWithdrawalQuote(_x11, _x12, _x13, _x14) {
11371
- return _getEasySwapperWithdrawalQuote.apply(this, arguments);
10536
+ function getEasySwapperTxData(_x14, _x15, _x16, _x17, _x18) {
10537
+ return _getEasySwapperTxData.apply(this, arguments);
11372
10538
  }
11373
10539
 
11374
- function _getEasySwapperWithdrawalQuote() {
11375
- _getEasySwapperWithdrawalQuote = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(pool, torosAsset, investAsset, amountIn) {
11376
- var _yield$Promise$all, torosTokenPrice, assetPrice, assetDecimals;
10540
+ function _getEasySwapperTxData() {
10541
+ _getEasySwapperTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(pool, assetFrom, assetTo, amountIn, slippage // eslint-disable-next-line @typescript-eslint/no-explicit-any
10542
+ ) {
10543
+ var isWithdrawal, _ref, torosAsset, investAsset, iDhedgeEasySwapper, depositAsset, minAmountOut;
11377
10544
 
11378
- return runtime_1.wrap(function _callee4$(_context4) {
10545
+ return runtime_1.wrap(function _callee5$(_context5) {
11379
10546
  while (1) {
11380
- switch (_context4.prev = _context4.next) {
10547
+ switch (_context5.prev = _context5.next) {
11381
10548
  case 0:
11382
- _context4.next = 2;
11383
- return Promise.all([getTorosPoolTokenPrice(pool, torosAsset), getChainlinkPriceInUsd(pool, investAsset), pool.utils.getDecimals(investAsset)]);
10549
+ _context5.next = 2;
10550
+ return isPool(pool, assetFrom);
11384
10551
 
11385
10552
  case 2:
11386
- _yield$Promise$all = _context4.sent;
11387
- torosTokenPrice = _yield$Promise$all[0];
11388
- assetPrice = _yield$Promise$all[1];
11389
- assetDecimals = _yield$Promise$all[2];
11390
- return _context4.abrupt("return", amountIn.mul(torosTokenPrice).div(assetPrice).div(1e10).div(Math.pow(10, 18 - assetDecimals)));
10553
+ isWithdrawal = _context5.sent;
10554
+ _ref = isWithdrawal ? [assetFrom, assetTo] : [assetTo, assetFrom], torosAsset = _ref[0], investAsset = _ref[1];
10555
+ iDhedgeEasySwapper = new ethers.utils.Interface(IDhedgeEasySwapper);
10556
+
10557
+ if (!isWithdrawal) {
10558
+ _context5.next = 9;
10559
+ break;
10560
+ }
10561
+
10562
+ return _context5.abrupt("return", iDhedgeEasySwapper.encodeFunctionData("initWithdrawal", [torosAsset, amountIn, slippage * 100]));
10563
+
10564
+ case 9:
10565
+ _context5.next = 11;
10566
+ return getPoolDepositAsset(pool, torosAsset, investAsset);
10567
+
10568
+ case 11:
10569
+ depositAsset = _context5.sent;
10570
+
10571
+ if (depositAsset) {
10572
+ _context5.next = 14;
10573
+ break;
10574
+ }
10575
+
10576
+ throw new Error("no deposit assets");
10577
+
10578
+ case 14:
10579
+ if (!(depositAsset.toLowerCase() !== investAsset.toLowerCase())) {
10580
+ _context5.next = 16;
10581
+ break;
10582
+ }
10583
+
10584
+ throw new Error("can only trade deposit asset");
10585
+
10586
+ case 16:
10587
+ _context5.next = 18;
10588
+ return getEasySwapperDepositQuote(pool, torosAsset, investAsset, amountIn);
10589
+
10590
+ case 18:
10591
+ minAmountOut = _context5.sent;
10592
+ return _context5.abrupt("return", iDhedgeEasySwapper.encodeFunctionData("depositWithCustomCooldown", [torosAsset, depositAsset, amountIn, minAmountOut.mul(10000 - slippage * 100).div(10000)]));
11391
10593
 
11392
- case 7:
10594
+ case 20:
11393
10595
  case "end":
11394
- return _context4.stop();
10596
+ return _context5.stop();
11395
10597
  }
11396
10598
  }
11397
- }, _callee4);
10599
+ }, _callee5);
11398
10600
  }));
11399
- return _getEasySwapperWithdrawalQuote.apply(this, arguments);
10601
+ return _getEasySwapperTxData.apply(this, arguments);
11400
10602
  }
11401
10603
 
11402
- function getEasySwapperTxData(_x15, _x16, _x17, _x18, _x19) {
11403
- return _getEasySwapperTxData.apply(this, arguments);
10604
+ function getCompleteWithdrawalTxData(_x19, _x20, _x21) {
10605
+ return _getCompleteWithdrawalTxData.apply(this, arguments);
11404
10606
  }
11405
10607
 
11406
- function _getEasySwapperTxData() {
11407
- _getEasySwapperTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(pool, assetFrom, assetTo, amountIn, slippage // eslint-disable-next-line @typescript-eslint/no-explicit-any
10608
+ function _getCompleteWithdrawalTxData() {
10609
+ _getCompleteWithdrawalTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(pool, destToken, slippage // eslint-disable-next-line @typescript-eslint/no-explicit-any
11408
10610
  ) {
11409
- var isWithdrawal, _ref, torosAsset, investAsset, iDhedgeEasySwapper, minAmountOut, depositAsset, _minAmountOut;
10611
+ var easySwapper, trackedAssets, trackedAssetsExcludingDestToken, srcData, minDestAmount, _iterator, _step, _step$value, token, balance, _yield$getOneInchSwap, swapTxData, dstAmount;
11410
10612
 
11411
- return runtime_1.wrap(function _callee5$(_context5) {
10613
+ return runtime_1.wrap(function _callee6$(_context6) {
11412
10614
  while (1) {
11413
- switch (_context5.prev = _context5.next) {
10615
+ switch (_context6.prev = _context6.next) {
11414
10616
  case 0:
11415
- _context5.next = 2;
11416
- return isPool(pool, assetFrom);
11417
-
11418
- case 2:
11419
- isWithdrawal = _context5.sent;
11420
- _ref = isWithdrawal ? [assetFrom, assetTo] : [assetTo, assetFrom], torosAsset = _ref[0], investAsset = _ref[1];
11421
- iDhedgeEasySwapper = new ethers.utils.Interface(IDhedgeEasySwapper.abi);
11422
-
11423
- if (!isWithdrawal) {
11424
- _context5.next = 12;
11425
- break;
11426
- }
10617
+ easySwapper = new ethers.Contract(routerAddress[pool.network][Dapp.TOROS], IDhedgeEasySwapper, pool.signer);
10618
+ _context6.next = 3;
10619
+ return easySwapper.getTrackedAssets(pool.address);
11427
10620
 
11428
- _context5.next = 8;
11429
- return getEasySwapperWithdrawalQuote(pool, torosAsset, investAsset, amountIn);
10621
+ case 3:
10622
+ trackedAssets = _context6.sent;
10623
+ trackedAssetsExcludingDestToken = trackedAssets.filter(function (_ref2) {
10624
+ var token = _ref2.token;
10625
+ return token.toLowerCase() !== destToken.toLowerCase();
10626
+ });
10627
+ srcData = [];
10628
+ minDestAmount = ethers.BigNumber.from(0);
10629
+ _iterator = _createForOfIteratorHelperLoose(trackedAssetsExcludingDestToken);
11430
10630
 
11431
10631
  case 8:
11432
- minAmountOut = _context5.sent;
11433
- return _context5.abrupt("return", iDhedgeEasySwapper.encodeFunctionData("withdraw", [torosAsset, amountIn, investAsset, minAmountOut.mul(10000 - slippage * 100).div(10000)]));
11434
-
11435
- case 12:
11436
- _context5.next = 14;
11437
- return getPoolDepositAsset(pool, torosAsset, investAsset);
11438
-
11439
- case 14:
11440
- depositAsset = _context5.sent;
11441
-
11442
- if (depositAsset) {
11443
- _context5.next = 17;
10632
+ if ((_step = _iterator()).done) {
10633
+ _context6.next = 21;
11444
10634
  break;
11445
10635
  }
11446
10636
 
11447
- throw new Error("no deposit assets");
10637
+ _step$value = _step.value, token = _step$value.token, balance = _step$value.balance;
10638
+ _context6.next = 12;
10639
+ return getOneInchSwapTxData(pool, token, destToken, balance, slippage, true);
11448
10640
 
11449
- case 17:
11450
- _context5.next = 19;
11451
- return getEasySwapperDepositQuote(pool, torosAsset, investAsset, depositAsset, amountIn);
10641
+ case 12:
10642
+ _yield$getOneInchSwap = _context6.sent;
10643
+ swapTxData = _yield$getOneInchSwap.swapTxData;
10644
+ dstAmount = _yield$getOneInchSwap.dstAmount;
10645
+ srcData.push({
10646
+ token: token,
10647
+ amount: balance,
10648
+ aggregatorData: {
10649
+ routerKey: ethers.utils.formatBytes32String("ONE_INCH"),
10650
+ swapData: swapTxData
10651
+ }
10652
+ });
10653
+ minDestAmount = minDestAmount.add(dstAmount);
10654
+ _context6.next = 19;
10655
+ return wait(2);
11452
10656
 
11453
10657
  case 19:
11454
- _minAmountOut = _context5.sent;
11455
- return _context5.abrupt("return", iDhedgeEasySwapper.encodeFunctionData("depositWithCustomCooldown", [torosAsset, investAsset, amountIn, depositAsset, _minAmountOut.mul(10000 - slippage * 100).div(10000)]));
10658
+ _context6.next = 8;
10659
+ break;
11456
10660
 
11457
10661
  case 21:
10662
+ return _context6.abrupt("return", easySwapper["interface"].encodeFunctionData("completeWithdrawal", [{
10663
+ srcData: srcData,
10664
+ destData: {
10665
+ destToken: destToken,
10666
+ minDestAmount: minDestAmount
10667
+ }
10668
+ }, minDestAmount.mul(10000 - slippage * 100).div(10000)]));
10669
+
10670
+ case 22:
11458
10671
  case "end":
11459
- return _context5.stop();
10672
+ return _context6.stop();
11460
10673
  }
11461
10674
  }
11462
- }, _callee5);
10675
+ }, _callee6);
11463
10676
  }));
11464
- return _getEasySwapperTxData.apply(this, arguments);
10677
+ return _getCompleteWithdrawalTxData.apply(this, arguments);
11465
10678
  }
11466
10679
 
11467
- var abi$k = [
10680
+ var abi$h = [
11468
10681
  {
11469
10682
  inputs: [
11470
10683
  {
@@ -12391,10 +11604,10 @@ var abi$k = [
12391
11604
  }
12392
11605
  ];
12393
11606
  var IAaveV3Incentives = {
12394
- abi: abi$k
11607
+ abi: abi$h
12395
11608
  };
12396
11609
 
12397
- var abi$l = [
11610
+ var abi$i = [
12398
11611
  {
12399
11612
  inputs: [
12400
11613
  {
@@ -14143,7 +13356,7 @@ var abi$l = [
14143
13356
  }
14144
13357
  ];
14145
13358
  var ILendingPoolV3 = {
14146
- abi: abi$l
13359
+ abi: abi$i
14147
13360
  };
14148
13361
 
14149
13362
  function getAaveAssetsForUnderlying(_x, _x2, _x3) {
@@ -14214,7 +13427,7 @@ function _getAaveV3ClaimTxData() {
14214
13427
  return _getAaveV3ClaimTxData.apply(this, arguments);
14215
13428
  }
14216
13429
 
14217
- var abi$m = [
13430
+ var abi$j = [
14218
13431
  {
14219
13432
  inputs: [
14220
13433
  {
@@ -15196,7 +14409,7 @@ var abi$m = [
15196
14409
  }
15197
14410
  ];
15198
14411
  var IVelodromeRouter = {
15199
- abi: abi$m
14412
+ abi: abi$j
15200
14413
  };
15201
14414
 
15202
14415
  function getVelodromeAddLiquidityTxData(_x, _x2, _x3, _x4, _x5, _x6) {
@@ -15303,7 +14516,7 @@ function _getVelodromeClOwner() {
15303
14516
  return _getVelodromeClOwner.apply(this, arguments);
15304
14517
  }
15305
14518
 
15306
- var abi$n = [
14519
+ var abi$k = [
15307
14520
  {
15308
14521
  inputs: [
15309
14522
  {
@@ -16345,10 +15558,10 @@ var abi$n = [
16345
15558
  }
16346
15559
  ];
16347
15560
  var IVelodromeGaugeV1 = {
16348
- abi: abi$n
15561
+ abi: abi$k
16349
15562
  };
16350
15563
 
16351
- var abi$o = [
15564
+ var abi$l = [
16352
15565
  {
16353
15566
  inputs: [
16354
15567
  {
@@ -16548,10 +15761,10 @@ var abi$o = [
16548
15761
  }
16549
15762
  ];
16550
15763
  var IVelodromeGaugeV2 = {
16551
- abi: abi$o
15764
+ abi: abi$l
16552
15765
  };
16553
15766
 
16554
- var abi$p = [
15767
+ var abi$m = [
16555
15768
  {
16556
15769
  inputs: [
16557
15770
  {
@@ -16722,7 +15935,7 @@ var abi$p = [
16722
15935
  }
16723
15936
  ];
16724
15937
  var IVelodromeCLGauge = {
16725
- abi: abi$p
15938
+ abi: abi$m
16726
15939
  };
16727
15940
 
16728
15941
  function call(_x, _x2, _x3, _x4) {
@@ -17008,7 +16221,7 @@ function _getStrike() {
17008
16221
  return _getStrike.apply(this, arguments);
17009
16222
  }
17010
16223
 
17011
- var abi$q = [
16224
+ var abi$n = [
17012
16225
  {
17013
16226
  inputs: [
17014
16227
  {
@@ -18360,7 +17573,7 @@ var abi$q = [
18360
17573
  }
18361
17574
  ];
18362
17575
  var IOptionMarketWrapper = {
18363
- abi: abi$q
17576
+ abi: abi$n
18364
17577
  };
18365
17578
 
18366
17579
  function getLyraTradeOptionType(isCall, isLong, isCoveredCall) {
@@ -18377,7 +17590,7 @@ function isLong(optionType) {
18377
17590
  return optionType === 0 || optionType === 1;
18378
17591
  }
18379
17592
 
18380
- var abi$r = [
17593
+ var abi$o = [
18381
17594
  {
18382
17595
  inputs: [
18383
17596
  {
@@ -20711,7 +19924,7 @@ var abi$r = [
20711
19924
  }
20712
19925
  ];
20713
19926
  var IOptionToken = {
20714
- abi: abi$r
19927
+ abi: abi$o
20715
19928
  };
20716
19929
 
20717
19930
  function getOptionPositions(_x, _x2) {
@@ -20849,7 +20062,7 @@ function _getLyraOptionTxData() {
20849
20062
  return _getLyraOptionTxData.apply(this, arguments);
20850
20063
  }
20851
20064
 
20852
- var abi$s = [
20065
+ var abi$p = [
20853
20066
  {
20854
20067
  inputs: [
20855
20068
  {
@@ -21394,7 +20607,7 @@ var abi$s = [
21394
20607
  }
21395
20608
  ];
21396
20609
  var ISynthetixFuturesMarketV2 = {
21397
- abi: abi$s
20610
+ abi: abi$p
21398
20611
  };
21399
20612
 
21400
20613
  function getFuturesChangeMarginTxData(amount) {
@@ -21545,67 +20758,7 @@ var getZeroExTradeTxData = /*#__PURE__*/function () {
21545
20758
  };
21546
20759
  }();
21547
20760
 
21548
- var oneInchBaseUrl = "https://api.1inch.dev/swap/v6.0/";
21549
- function getOneInchSwapTxData(_x, _x2, _x3, _x4, _x5) {
21550
- return _getOneInchSwapTxData.apply(this, arguments);
21551
- }
21552
-
21553
- function _getOneInchSwapTxData() {
21554
- _getOneInchSwapTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool, assetFrom, assetTo, amountIn, slippage) {
21555
- var chainId, apiUrl, params, response;
21556
- return runtime_1.wrap(function _callee$(_context) {
21557
- while (1) {
21558
- switch (_context.prev = _context.next) {
21559
- case 0:
21560
- if (process.env.ONEINCH_API_KEY) {
21561
- _context.next = 2;
21562
- break;
21563
- }
21564
-
21565
- throw new Error("ONEINCH_API_KEY not configured in .env file");
21566
-
21567
- case 2:
21568
- chainId = networkChainIdMap[pool.network];
21569
- apiUrl = "" + oneInchBaseUrl + chainId + "/swap";
21570
- params = {
21571
- src: assetFrom,
21572
- dst: assetTo,
21573
- amount: amountIn.toString(),
21574
- from: pool.address,
21575
- origin: pool.signer.address,
21576
- slippage: slippage,
21577
- disableEstimate: true,
21578
- usePermit2: false
21579
- };
21580
- _context.prev = 5;
21581
- _context.next = 8;
21582
- return axios.get(apiUrl, {
21583
- headers: {
21584
- Authorization: "Bearer " + process.env.ONEINCH_API_KEY
21585
- },
21586
- params: params
21587
- });
21588
-
21589
- case 8:
21590
- response = _context.sent;
21591
- return _context.abrupt("return", response.data.tx.data);
21592
-
21593
- case 12:
21594
- _context.prev = 12;
21595
- _context.t0 = _context["catch"](5);
21596
- throw new ApiError("Swap api request of 1inch failed");
21597
-
21598
- case 15:
21599
- case "end":
21600
- return _context.stop();
21601
- }
21602
- }
21603
- }, _callee, null, [[5, 12]]);
21604
- }));
21605
- return _getOneInchSwapTxData.apply(this, arguments);
21606
- }
21607
-
21608
- var abi$t = [
20761
+ var abi$q = [
21609
20762
  {
21610
20763
  inputs: [
21611
20764
  {
@@ -21706,7 +20859,7 @@ var abi$t = [
21706
20859
  }
21707
20860
  ];
21708
20861
  var IXRam = {
21709
- abi: abi$t
20862
+ abi: abi$q
21710
20863
  };
21711
20864
 
21712
20865
  /* eslint-disable @typescript-eslint/no-explicit-any */
@@ -24470,31 +23623,454 @@ var ICompoundV3Comet = [
24470
23623
  {
24471
23624
  inputs: [
24472
23625
  ],
24473
- name: "baseToken",
23626
+ name: "baseToken",
23627
+ outputs: [
23628
+ {
23629
+ internalType: "address",
23630
+ name: "",
23631
+ type: "address"
23632
+ }
23633
+ ],
23634
+ stateMutability: "view",
23635
+ type: "function"
23636
+ },
23637
+ {
23638
+ inputs: [
23639
+ {
23640
+ internalType: "address",
23641
+ name: "asset",
23642
+ type: "address"
23643
+ },
23644
+ {
23645
+ internalType: "uint256",
23646
+ name: "amount",
23647
+ type: "uint256"
23648
+ }
23649
+ ],
23650
+ name: "supply",
23651
+ outputs: [
23652
+ ],
23653
+ stateMutability: "nonpayable",
23654
+ type: "function"
23655
+ },
23656
+ {
23657
+ inputs: [
23658
+ {
23659
+ internalType: "address",
23660
+ name: "asset",
23661
+ type: "address"
23662
+ },
23663
+ {
23664
+ internalType: "uint256",
23665
+ name: "amount",
23666
+ type: "uint256"
23667
+ }
23668
+ ],
23669
+ name: "withdraw",
23670
+ outputs: [
23671
+ ],
23672
+ stateMutability: "nonpayable",
23673
+ type: "function"
23674
+ }
23675
+ ];
23676
+
23677
+ function getCompoundV3LendTxData(asset, amount) {
23678
+ return new ethers.utils.Interface(ICompoundV3Comet).encodeFunctionData("supply", [asset, amount]);
23679
+ }
23680
+ function getCompoundV3WithdrawTxData(asset, amount) {
23681
+ return new ethers.utils.Interface(ICompoundV3Comet).encodeFunctionData("withdraw", [asset, amount]);
23682
+ }
23683
+
23684
+ var ICometRewards = [
23685
+ {
23686
+ inputs: [
23687
+ {
23688
+ internalType: "address",
23689
+ name: "governor_",
23690
+ type: "address"
23691
+ }
23692
+ ],
23693
+ stateMutability: "nonpayable",
23694
+ type: "constructor"
23695
+ },
23696
+ {
23697
+ inputs: [
23698
+ {
23699
+ internalType: "address",
23700
+ name: "",
23701
+ type: "address"
23702
+ }
23703
+ ],
23704
+ name: "AlreadyConfigured",
23705
+ type: "error"
23706
+ },
23707
+ {
23708
+ inputs: [
23709
+ ],
23710
+ name: "BadData",
23711
+ type: "error"
23712
+ },
23713
+ {
23714
+ inputs: [
23715
+ {
23716
+ internalType: "uint256",
23717
+ name: "",
23718
+ type: "uint256"
23719
+ }
23720
+ ],
23721
+ name: "InvalidUInt64",
23722
+ type: "error"
23723
+ },
23724
+ {
23725
+ inputs: [
23726
+ {
23727
+ internalType: "address",
23728
+ name: "",
23729
+ type: "address"
23730
+ }
23731
+ ],
23732
+ name: "NotPermitted",
23733
+ type: "error"
23734
+ },
23735
+ {
23736
+ inputs: [
23737
+ {
23738
+ internalType: "address",
23739
+ name: "",
23740
+ type: "address"
23741
+ }
23742
+ ],
23743
+ name: "NotSupported",
23744
+ type: "error"
23745
+ },
23746
+ {
23747
+ inputs: [
23748
+ {
23749
+ internalType: "address",
23750
+ name: "",
23751
+ type: "address"
23752
+ },
23753
+ {
23754
+ internalType: "uint256",
23755
+ name: "",
23756
+ type: "uint256"
23757
+ }
23758
+ ],
23759
+ name: "TransferOutFailed",
23760
+ type: "error"
23761
+ },
23762
+ {
23763
+ anonymous: false,
23764
+ inputs: [
23765
+ {
23766
+ indexed: true,
23767
+ internalType: "address",
23768
+ name: "oldGovernor",
23769
+ type: "address"
23770
+ },
23771
+ {
23772
+ indexed: true,
23773
+ internalType: "address",
23774
+ name: "newGovernor",
23775
+ type: "address"
23776
+ }
23777
+ ],
23778
+ name: "GovernorTransferred",
23779
+ type: "event"
23780
+ },
23781
+ {
23782
+ anonymous: false,
23783
+ inputs: [
23784
+ {
23785
+ indexed: true,
23786
+ internalType: "address",
23787
+ name: "src",
23788
+ type: "address"
23789
+ },
23790
+ {
23791
+ indexed: true,
23792
+ internalType: "address",
23793
+ name: "recipient",
23794
+ type: "address"
23795
+ },
23796
+ {
23797
+ indexed: true,
23798
+ internalType: "address",
23799
+ name: "token",
23800
+ type: "address"
23801
+ },
23802
+ {
23803
+ indexed: false,
23804
+ internalType: "uint256",
23805
+ name: "amount",
23806
+ type: "uint256"
23807
+ }
23808
+ ],
23809
+ name: "RewardClaimed",
23810
+ type: "event"
23811
+ },
23812
+ {
23813
+ anonymous: false,
23814
+ inputs: [
23815
+ {
23816
+ indexed: true,
23817
+ internalType: "address",
23818
+ name: "user",
23819
+ type: "address"
23820
+ },
23821
+ {
23822
+ indexed: true,
23823
+ internalType: "address",
23824
+ name: "comet",
23825
+ type: "address"
23826
+ },
23827
+ {
23828
+ indexed: false,
23829
+ internalType: "uint256",
23830
+ name: "amount",
23831
+ type: "uint256"
23832
+ }
23833
+ ],
23834
+ name: "RewardsClaimedSet",
23835
+ type: "event"
23836
+ },
23837
+ {
23838
+ inputs: [
23839
+ {
23840
+ internalType: "address",
23841
+ name: "comet",
23842
+ type: "address"
23843
+ },
23844
+ {
23845
+ internalType: "address",
23846
+ name: "src",
23847
+ type: "address"
23848
+ },
23849
+ {
23850
+ internalType: "bool",
23851
+ name: "shouldAccrue",
23852
+ type: "bool"
23853
+ }
23854
+ ],
23855
+ name: "claim",
23856
+ outputs: [
23857
+ ],
23858
+ stateMutability: "nonpayable",
23859
+ type: "function"
23860
+ },
23861
+ {
23862
+ inputs: [
23863
+ {
23864
+ internalType: "address",
23865
+ name: "comet",
23866
+ type: "address"
23867
+ },
23868
+ {
23869
+ internalType: "address",
23870
+ name: "src",
23871
+ type: "address"
23872
+ },
23873
+ {
23874
+ internalType: "address",
23875
+ name: "to",
23876
+ type: "address"
23877
+ },
23878
+ {
23879
+ internalType: "bool",
23880
+ name: "shouldAccrue",
23881
+ type: "bool"
23882
+ }
23883
+ ],
23884
+ name: "claimTo",
23885
+ outputs: [
23886
+ ],
23887
+ stateMutability: "nonpayable",
23888
+ type: "function"
23889
+ },
23890
+ {
23891
+ inputs: [
23892
+ {
23893
+ internalType: "address",
23894
+ name: "comet",
23895
+ type: "address"
23896
+ },
23897
+ {
23898
+ internalType: "address",
23899
+ name: "account",
23900
+ type: "address"
23901
+ }
23902
+ ],
23903
+ name: "getRewardOwed",
23904
+ outputs: [
23905
+ {
23906
+ components: [
23907
+ {
23908
+ internalType: "address",
23909
+ name: "token",
23910
+ type: "address"
23911
+ },
23912
+ {
23913
+ internalType: "uint256",
23914
+ name: "owed",
23915
+ type: "uint256"
23916
+ }
23917
+ ],
23918
+ internalType: "struct CometRewards.RewardOwed",
23919
+ name: "",
23920
+ type: "tuple"
23921
+ }
23922
+ ],
23923
+ stateMutability: "nonpayable",
23924
+ type: "function"
23925
+ },
23926
+ {
23927
+ inputs: [
23928
+ ],
23929
+ name: "governor",
23930
+ outputs: [
23931
+ {
23932
+ internalType: "address",
23933
+ name: "",
23934
+ type: "address"
23935
+ }
23936
+ ],
23937
+ stateMutability: "view",
23938
+ type: "function"
23939
+ },
23940
+ {
23941
+ inputs: [
23942
+ {
23943
+ internalType: "address",
23944
+ name: "",
23945
+ type: "address"
23946
+ }
23947
+ ],
23948
+ name: "rewardConfig",
23949
+ outputs: [
23950
+ {
23951
+ internalType: "address",
23952
+ name: "token",
23953
+ type: "address"
23954
+ },
23955
+ {
23956
+ internalType: "uint64",
23957
+ name: "rescaleFactor",
23958
+ type: "uint64"
23959
+ },
23960
+ {
23961
+ internalType: "bool",
23962
+ name: "shouldUpscale",
23963
+ type: "bool"
23964
+ },
23965
+ {
23966
+ internalType: "uint256",
23967
+ name: "multiplier",
23968
+ type: "uint256"
23969
+ }
23970
+ ],
23971
+ stateMutability: "view",
23972
+ type: "function"
23973
+ },
23974
+ {
23975
+ inputs: [
23976
+ {
23977
+ internalType: "address",
23978
+ name: "",
23979
+ type: "address"
23980
+ },
23981
+ {
23982
+ internalType: "address",
23983
+ name: "",
23984
+ type: "address"
23985
+ }
23986
+ ],
23987
+ name: "rewardsClaimed",
23988
+ outputs: [
23989
+ {
23990
+ internalType: "uint256",
23991
+ name: "",
23992
+ type: "uint256"
23993
+ }
23994
+ ],
23995
+ stateMutability: "view",
23996
+ type: "function"
23997
+ },
23998
+ {
23999
+ inputs: [
24000
+ {
24001
+ internalType: "address",
24002
+ name: "comet",
24003
+ type: "address"
24004
+ },
24005
+ {
24006
+ internalType: "address",
24007
+ name: "token",
24008
+ type: "address"
24009
+ }
24010
+ ],
24011
+ name: "setRewardConfig",
24012
+ outputs: [
24013
+ ],
24014
+ stateMutability: "nonpayable",
24015
+ type: "function"
24016
+ },
24017
+ {
24018
+ inputs: [
24019
+ {
24020
+ internalType: "address",
24021
+ name: "comet",
24022
+ type: "address"
24023
+ },
24024
+ {
24025
+ internalType: "address",
24026
+ name: "token",
24027
+ type: "address"
24028
+ },
24029
+ {
24030
+ internalType: "uint256",
24031
+ name: "multiplier",
24032
+ type: "uint256"
24033
+ }
24034
+ ],
24035
+ name: "setRewardConfigWithMultiplier",
24474
24036
  outputs: [
24037
+ ],
24038
+ stateMutability: "nonpayable",
24039
+ type: "function"
24040
+ },
24041
+ {
24042
+ inputs: [
24475
24043
  {
24476
24044
  internalType: "address",
24477
- name: "",
24045
+ name: "comet",
24478
24046
  type: "address"
24047
+ },
24048
+ {
24049
+ internalType: "address[]",
24050
+ name: "users",
24051
+ type: "address[]"
24052
+ },
24053
+ {
24054
+ internalType: "uint256[]",
24055
+ name: "claimedAmounts",
24056
+ type: "uint256[]"
24479
24057
  }
24480
24058
  ],
24481
- stateMutability: "view",
24059
+ name: "setRewardsClaimed",
24060
+ outputs: [
24061
+ ],
24062
+ stateMutability: "nonpayable",
24482
24063
  type: "function"
24483
24064
  },
24484
24065
  {
24485
24066
  inputs: [
24486
24067
  {
24487
24068
  internalType: "address",
24488
- name: "asset",
24069
+ name: "newGovernor",
24489
24070
  type: "address"
24490
- },
24491
- {
24492
- internalType: "uint256",
24493
- name: "amount",
24494
- type: "uint256"
24495
24071
  }
24496
24072
  ],
24497
- name: "supply",
24073
+ name: "transferGovernor",
24498
24074
  outputs: [
24499
24075
  ],
24500
24076
  stateMutability: "nonpayable",
@@ -24504,7 +24080,12 @@ var ICompoundV3Comet = [
24504
24080
  inputs: [
24505
24081
  {
24506
24082
  internalType: "address",
24507
- name: "asset",
24083
+ name: "token",
24084
+ type: "address"
24085
+ },
24086
+ {
24087
+ internalType: "address",
24088
+ name: "to",
24508
24089
  type: "address"
24509
24090
  },
24510
24091
  {
@@ -24513,7 +24094,7 @@ var ICompoundV3Comet = [
24513
24094
  type: "uint256"
24514
24095
  }
24515
24096
  ],
24516
- name: "withdraw",
24097
+ name: "withdrawToken",
24517
24098
  outputs: [
24518
24099
  ],
24519
24100
  stateMutability: "nonpayable",
@@ -24521,11 +24102,9 @@ var ICompoundV3Comet = [
24521
24102
  }
24522
24103
  ];
24523
24104
 
24524
- function getCompoundV3LendTxData(asset, amount) {
24525
- return new ethers.utils.Interface(ICompoundV3Comet).encodeFunctionData("supply", [asset, amount]);
24526
- }
24527
- function getCompoundV3WithdrawTxData(asset, amount) {
24528
- return new ethers.utils.Interface(ICompoundV3Comet).encodeFunctionData("withdraw", [asset, amount]);
24105
+ function getCompoundV3ClaimTxData(pool, asset) {
24106
+ var iCometRewards = new ethers.utils.Interface(ICometRewards);
24107
+ return iCometRewards.encodeFunctionData("claim", [asset, pool.address, true]);
24529
24108
  }
24530
24109
 
24531
24110
  var Pool = /*#__PURE__*/function () {
@@ -25041,7 +24620,8 @@ var Pool = /*#__PURE__*/function () {
25041
24620
  /*#__PURE__*/
25042
24621
  function () {
25043
24622
  var _trade = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(dapp, assetFrom, assetTo, amountIn, slippage, options, estimateGas) {
25044
- var swapTxData, iSynthetix, assets, daoAddress, iUniswapV2Router, minAmountOut, tx;
24623
+ var swapTxData, _yield$getOneInchSwap, iSynthetix, assets, daoAddress, iUniswapV2Router, minAmountOut, tx;
24624
+
25045
24625
  return runtime_1.wrap(function _callee10$(_context10) {
25046
24626
  while (1) {
25047
24627
  switch (_context10.prev = _context10.next) {
@@ -25059,7 +24639,7 @@ var Pool = /*#__PURE__*/function () {
25059
24639
  }
25060
24640
 
25061
24641
  _context10.t0 = dapp;
25062
- _context10.next = _context10.t0 === Dapp.ZEROEX ? 6 : _context10.t0 === Dapp.ONEINCH ? 10 : _context10.t0 === Dapp.BALANCER ? 14 : _context10.t0 === Dapp.SYNTHETIX ? 18 : _context10.t0 === Dapp.TOROS ? 25 : 29;
24642
+ _context10.next = _context10.t0 === Dapp.ZEROEX ? 6 : _context10.t0 === Dapp.ONEINCH ? 10 : _context10.t0 === Dapp.BALANCER ? 15 : _context10.t0 === Dapp.SYNTHETIX ? 19 : _context10.t0 === Dapp.TOROS ? 26 : 30;
25063
24643
  break;
25064
24644
 
25065
24645
  case 6:
@@ -25068,51 +24648,52 @@ var Pool = /*#__PURE__*/function () {
25068
24648
 
25069
24649
  case 8:
25070
24650
  swapTxData = _context10.sent;
25071
- return _context10.abrupt("break", 44);
24651
+ return _context10.abrupt("break", 45);
25072
24652
 
25073
24653
  case 10:
25074
24654
  _context10.next = 12;
25075
24655
  return getOneInchSwapTxData(this, assetFrom, assetTo, amountIn, slippage);
25076
24656
 
25077
24657
  case 12:
25078
- swapTxData = _context10.sent;
25079
- return _context10.abrupt("break", 44);
24658
+ _yield$getOneInchSwap = _context10.sent;
24659
+ swapTxData = _yield$getOneInchSwap.swapTxData;
24660
+ return _context10.abrupt("break", 45);
25080
24661
 
25081
- case 14:
25082
- _context10.next = 16;
24662
+ case 15:
24663
+ _context10.next = 17;
25083
24664
  return this.utils.getBalancerSwapTx(this, assetFrom, assetTo, amountIn, slippage);
25084
24665
 
25085
- case 16:
24666
+ case 17:
25086
24667
  swapTxData = _context10.sent;
25087
- return _context10.abrupt("break", 44);
24668
+ return _context10.abrupt("break", 45);
25088
24669
 
25089
- case 18:
24670
+ case 19:
25090
24671
  iSynthetix = new ethers.utils.Interface(ISynthetix.abi);
25091
24672
  assets = [assetFrom, assetTo].map(function (asset) {
25092
24673
  return ethers.utils.formatBytes32String(asset);
25093
24674
  });
25094
- _context10.next = 22;
24675
+ _context10.next = 23;
25095
24676
  return this.factory.owner();
25096
24677
 
25097
- case 22:
24678
+ case 23:
25098
24679
  daoAddress = _context10.sent;
25099
24680
  swapTxData = iSynthetix.encodeFunctionData(Transaction.SWAP_SYNTHS, [assets[0], amountIn, assets[1], daoAddress, SYNTHETIX_TRACKING_CODE]);
25100
- return _context10.abrupt("break", 44);
24681
+ return _context10.abrupt("break", 45);
25101
24682
 
25102
- case 25:
25103
- _context10.next = 27;
24683
+ case 26:
24684
+ _context10.next = 28;
25104
24685
  return getEasySwapperTxData(this, assetFrom, assetTo, ethers.BigNumber.from(amountIn), slippage);
25105
24686
 
25106
- case 27:
24687
+ case 28:
25107
24688
  swapTxData = _context10.sent;
25108
- return _context10.abrupt("break", 44);
24689
+ return _context10.abrupt("break", 45);
25109
24690
 
25110
- case 29:
24691
+ case 30:
25111
24692
  iUniswapV2Router = new ethers.utils.Interface(IUniswapV2Router.abi);
25112
- _context10.next = 32;
24693
+ _context10.next = 33;
25113
24694
  return this.utils.getMinAmountOut(dapp, assetFrom, assetTo, amountIn, slippage);
25114
24695
 
25115
- case 32:
24696
+ case 33:
25116
24697
  minAmountOut = _context10.sent;
25117
24698
  _context10.t1 = iUniswapV2Router;
25118
24699
  _context10.t2 = Transaction.SWAP;
@@ -25120,23 +24701,23 @@ var Pool = /*#__PURE__*/function () {
25120
24701
  _context10.t4 = minAmountOut;
25121
24702
  _context10.t5 = [assetFrom, assetTo];
25122
24703
  _context10.t6 = this.address;
25123
- _context10.next = 41;
24704
+ _context10.next = 42;
25124
24705
  return getDeadline(this);
25125
24706
 
25126
- case 41:
24707
+ case 42:
25127
24708
  _context10.t7 = _context10.sent;
25128
24709
  _context10.t8 = [_context10.t3, _context10.t4, _context10.t5, _context10.t6, _context10.t7];
25129
24710
  swapTxData = _context10.t1.encodeFunctionData.call(_context10.t1, _context10.t2, _context10.t8);
25130
24711
 
25131
- case 44:
25132
- _context10.next = 46;
24712
+ case 45:
24713
+ _context10.next = 47;
25133
24714
  return getPoolTxOrGasEstimate(this, [routerAddress[this.network][dapp], swapTxData, options], estimateGas);
25134
24715
 
25135
- case 46:
24716
+ case 47:
25136
24717
  tx = _context10.sent;
25137
24718
  return _context10.abrupt("return", tx);
25138
24719
 
25139
- case 48:
24720
+ case 49:
25140
24721
  case "end":
25141
24722
  return _context10.stop();
25142
24723
  }
@@ -26231,6 +25812,58 @@ var Pool = /*#__PURE__*/function () {
26231
25812
 
26232
25813
  return harvestAaveV3Rewards;
26233
25814
  }()
25815
+ /**
25816
+ * Claim rewards from CompoundV3
25817
+ * @param {string} asset Compound lending asset
25818
+ * @param {any} options Transaction options
25819
+ * @param {boolean} estimateGas Simulate/estimate gas
25820
+ * @returns {Promise<any>} Transaction
25821
+ */
25822
+ ;
25823
+
25824
+ _proto.harvestCompoundV3Rewards =
25825
+ /*#__PURE__*/
25826
+ function () {
25827
+ var _harvestCompoundV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee30(asset, options, estimateGas) {
25828
+ var claimTxData, tx;
25829
+ return runtime_1.wrap(function _callee30$(_context30) {
25830
+ while (1) {
25831
+ switch (_context30.prev = _context30.next) {
25832
+ case 0:
25833
+ if (options === void 0) {
25834
+ options = null;
25835
+ }
25836
+
25837
+ if (estimateGas === void 0) {
25838
+ estimateGas = false;
25839
+ }
25840
+
25841
+ _context30.next = 4;
25842
+ return getCompoundV3ClaimTxData(this, asset);
25843
+
25844
+ case 4:
25845
+ claimTxData = _context30.sent;
25846
+ _context30.next = 7;
25847
+ return getPoolTxOrGasEstimate(this, [stakingAddress[this.network][Dapp.COMPOUNDV3], claimTxData, options], estimateGas);
25848
+
25849
+ case 7:
25850
+ tx = _context30.sent;
25851
+ return _context30.abrupt("return", tx);
25852
+
25853
+ case 9:
25854
+ case "end":
25855
+ return _context30.stop();
25856
+ }
25857
+ }
25858
+ }, _callee30, this);
25859
+ }));
25860
+
25861
+ function harvestCompoundV3Rewards(_x135, _x136, _x137) {
25862
+ return _harvestCompoundV3Rewards.apply(this, arguments);
25863
+ }
25864
+
25865
+ return harvestCompoundV3Rewards;
25866
+ }()
26234
25867
  /**
26235
25868
  * Create UniswapV3 liquidity pool
26236
25869
  * @param {dapp} Platform UniswapV3, VelodromeCL, AerodromeCL or RamesesCL
@@ -26252,11 +25885,11 @@ var Pool = /*#__PURE__*/function () {
26252
25885
  _proto.addLiquidityUniswapV3 =
26253
25886
  /*#__PURE__*/
26254
25887
  function () {
26255
- var _addLiquidityUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee30(dapp, assetA, assetB, amountA, amountB, minPrice, maxPrice, minTick, maxTick, feeAmountOrTickSpacing, options, estimateGas) {
25888
+ var _addLiquidityUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee31(dapp, assetA, assetB, amountA, amountB, minPrice, maxPrice, minTick, maxTick, feeAmountOrTickSpacing, options, estimateGas) {
26256
25889
  var mintTxData, tx;
26257
- return runtime_1.wrap(function _callee30$(_context30) {
25890
+ return runtime_1.wrap(function _callee31$(_context31) {
26258
25891
  while (1) {
26259
- switch (_context30.prev = _context30.next) {
25892
+ switch (_context31.prev = _context31.next) {
26260
25893
  case 0:
26261
25894
  if (options === void 0) {
26262
25895
  options = null;
@@ -26267,7 +25900,7 @@ var Pool = /*#__PURE__*/function () {
26267
25900
  }
26268
25901
 
26269
25902
  if (!((minPrice === null || maxPrice === null) && (minTick === null || maxTick === null))) {
26270
- _context30.next = 4;
25903
+ _context31.next = 4;
26271
25904
  break;
26272
25905
  }
26273
25906
 
@@ -26275,34 +25908,34 @@ var Pool = /*#__PURE__*/function () {
26275
25908
 
26276
25909
  case 4:
26277
25910
  if (!((minPrice || maxPrice) && dapp !== Dapp.UNISWAPV3)) {
26278
- _context30.next = 6;
25911
+ _context31.next = 6;
26279
25912
  break;
26280
25913
  }
26281
25914
 
26282
25915
  throw new Error("no price conversion for Aerodrome/Velodrome CL");
26283
25916
 
26284
25917
  case 6:
26285
- _context30.next = 8;
25918
+ _context31.next = 8;
26286
25919
  return getUniswapV3MintTxData(dapp, this, assetA, assetB, amountA, amountB, minPrice, maxPrice, minTick, maxTick, feeAmountOrTickSpacing);
26287
25920
 
26288
25921
  case 8:
26289
- mintTxData = _context30.sent;
26290
- _context30.next = 11;
25922
+ mintTxData = _context31.sent;
25923
+ _context31.next = 11;
26291
25924
  return getPoolTxOrGasEstimate(this, [nonfungiblePositionManagerAddress[this.network][dapp], mintTxData, options], estimateGas);
26292
25925
 
26293
25926
  case 11:
26294
- tx = _context30.sent;
26295
- return _context30.abrupt("return", tx);
25927
+ tx = _context31.sent;
25928
+ return _context31.abrupt("return", tx);
26296
25929
 
26297
25930
  case 13:
26298
25931
  case "end":
26299
- return _context30.stop();
25932
+ return _context31.stop();
26300
25933
  }
26301
25934
  }
26302
- }, _callee30, this);
25935
+ }, _callee31, this);
26303
25936
  }));
26304
25937
 
26305
- function addLiquidityUniswapV3(_x135, _x136, _x137, _x138, _x139, _x140, _x141, _x142, _x143, _x144, _x145, _x146) {
25938
+ function addLiquidityUniswapV3(_x138, _x139, _x140, _x141, _x142, _x143, _x144, _x145, _x146, _x147, _x148, _x149) {
26306
25939
  return _addLiquidityUniswapV.apply(this, arguments);
26307
25940
  }
26308
25941
 
@@ -26322,11 +25955,11 @@ var Pool = /*#__PURE__*/function () {
26322
25955
  _proto.decreaseLiquidity =
26323
25956
  /*#__PURE__*/
26324
25957
  function () {
26325
- var _decreaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee31(dapp, tokenId, amount, options, estimateGas) {
25958
+ var _decreaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee32(dapp, tokenId, amount, options, estimateGas) {
26326
25959
  var dappAddress, isStaked, txData, tokenIdOwner, tx;
26327
- return runtime_1.wrap(function _callee31$(_context31) {
25960
+ return runtime_1.wrap(function _callee32$(_context32) {
26328
25961
  while (1) {
26329
- switch (_context31.prev = _context31.next) {
25962
+ switch (_context32.prev = _context32.next) {
26330
25963
  case 0:
26331
25964
  if (amount === void 0) {
26332
25965
  amount = 100;
@@ -26341,20 +25974,20 @@ var Pool = /*#__PURE__*/function () {
26341
25974
  }
26342
25975
 
26343
25976
  isStaked = false;
26344
- _context31.t0 = dapp;
26345
- _context31.next = _context31.t0 === Dapp.UNISWAPV3 ? 7 : _context31.t0 === Dapp.RAMSESCL ? 7 : _context31.t0 === Dapp.VELODROMECL ? 9 : _context31.t0 === Dapp.AERODROMECL ? 9 : _context31.t0 === Dapp.ARRAKIS ? 14 : 16;
25977
+ _context32.t0 = dapp;
25978
+ _context32.next = _context32.t0 === Dapp.UNISWAPV3 ? 7 : _context32.t0 === Dapp.RAMSESCL ? 7 : _context32.t0 === Dapp.VELODROMECL ? 9 : _context32.t0 === Dapp.AERODROMECL ? 9 : _context32.t0 === Dapp.ARRAKIS ? 14 : 16;
26346
25979
  break;
26347
25980
 
26348
25981
  case 7:
26349
25982
  dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
26350
- return _context31.abrupt("break", 17);
25983
+ return _context32.abrupt("break", 17);
26351
25984
 
26352
25985
  case 9:
26353
- _context31.next = 11;
25986
+ _context32.next = 11;
26354
25987
  return getVelodromeClOwner(this, dapp, tokenId);
26355
25988
 
26356
25989
  case 11:
26357
- tokenIdOwner = _context31.sent;
25990
+ tokenIdOwner = _context32.sent;
26358
25991
 
26359
25992
  if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
26360
25993
  dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
@@ -26364,49 +25997,49 @@ var Pool = /*#__PURE__*/function () {
26364
25997
  isStaked = true;
26365
25998
  }
26366
25999
 
26367
- return _context31.abrupt("break", 17);
26000
+ return _context32.abrupt("break", 17);
26368
26001
 
26369
26002
  case 14:
26370
26003
  dappAddress = routerAddress[this.network][dapp];
26371
- return _context31.abrupt("break", 17);
26004
+ return _context32.abrupt("break", 17);
26372
26005
 
26373
26006
  case 16:
26374
26007
  throw new Error("dapp not supported");
26375
26008
 
26376
26009
  case 17:
26377
26010
  if (isStaked) {
26378
- _context31.next = 23;
26011
+ _context32.next = 23;
26379
26012
  break;
26380
26013
  }
26381
26014
 
26382
- _context31.next = 20;
26015
+ _context32.next = 20;
26383
26016
  return getDecreaseLiquidityTxData(this, dapp, tokenId, amount);
26384
26017
 
26385
26018
  case 20:
26386
- txData = _context31.sent;
26387
- _context31.next = 24;
26019
+ txData = _context32.sent;
26020
+ _context32.next = 24;
26388
26021
  break;
26389
26022
 
26390
26023
  case 23:
26391
26024
  throw new Error("unsupported decreaseStakedLiquidity: unstake first to decrease lp");
26392
26025
 
26393
26026
  case 24:
26394
- _context31.next = 26;
26027
+ _context32.next = 26;
26395
26028
  return getPoolTxOrGasEstimate(this, [dappAddress, txData, options], estimateGas);
26396
26029
 
26397
26030
  case 26:
26398
- tx = _context31.sent;
26399
- return _context31.abrupt("return", tx);
26031
+ tx = _context32.sent;
26032
+ return _context32.abrupt("return", tx);
26400
26033
 
26401
26034
  case 28:
26402
26035
  case "end":
26403
- return _context31.stop();
26036
+ return _context32.stop();
26404
26037
  }
26405
26038
  }
26406
- }, _callee31, this);
26039
+ }, _callee32, this);
26407
26040
  }));
26408
26041
 
26409
- function decreaseLiquidity(_x147, _x148, _x149, _x150, _x151) {
26042
+ function decreaseLiquidity(_x150, _x151, _x152, _x153, _x154) {
26410
26043
  return _decreaseLiquidity.apply(this, arguments);
26411
26044
  }
26412
26045
 
@@ -26427,11 +26060,11 @@ var Pool = /*#__PURE__*/function () {
26427
26060
  _proto.increaseLiquidity =
26428
26061
  /*#__PURE__*/
26429
26062
  function () {
26430
- var _increaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee32(dapp, tokenId, amountA, amountB, options, estimateGas) {
26063
+ var _increaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee33(dapp, tokenId, amountA, amountB, options, estimateGas) {
26431
26064
  var dappAddress, isStaked, txData, tokenIdOwner, tx;
26432
- return runtime_1.wrap(function _callee32$(_context32) {
26065
+ return runtime_1.wrap(function _callee33$(_context33) {
26433
26066
  while (1) {
26434
- switch (_context32.prev = _context32.next) {
26067
+ switch (_context33.prev = _context33.next) {
26435
26068
  case 0:
26436
26069
  if (options === void 0) {
26437
26070
  options = null;
@@ -26442,20 +26075,20 @@ var Pool = /*#__PURE__*/function () {
26442
26075
  }
26443
26076
 
26444
26077
  isStaked = false;
26445
- _context32.t0 = dapp;
26446
- _context32.next = _context32.t0 === Dapp.UNISWAPV3 ? 6 : _context32.t0 === Dapp.RAMSESCL ? 6 : _context32.t0 === Dapp.VELODROMECL ? 8 : _context32.t0 === Dapp.AERODROMECL ? 8 : _context32.t0 === Dapp.ARRAKIS ? 13 : 15;
26078
+ _context33.t0 = dapp;
26079
+ _context33.next = _context33.t0 === Dapp.UNISWAPV3 ? 6 : _context33.t0 === Dapp.RAMSESCL ? 6 : _context33.t0 === Dapp.VELODROMECL ? 8 : _context33.t0 === Dapp.AERODROMECL ? 8 : _context33.t0 === Dapp.ARRAKIS ? 13 : 15;
26447
26080
  break;
26448
26081
 
26449
26082
  case 6:
26450
26083
  dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
26451
- return _context32.abrupt("break", 16);
26084
+ return _context33.abrupt("break", 16);
26452
26085
 
26453
26086
  case 8:
26454
- _context32.next = 10;
26087
+ _context33.next = 10;
26455
26088
  return getVelodromeClOwner(this, dapp, tokenId);
26456
26089
 
26457
26090
  case 10:
26458
- tokenIdOwner = _context32.sent;
26091
+ tokenIdOwner = _context33.sent;
26459
26092
 
26460
26093
  if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
26461
26094
  dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
@@ -26465,49 +26098,49 @@ var Pool = /*#__PURE__*/function () {
26465
26098
  isStaked = true;
26466
26099
  }
26467
26100
 
26468
- return _context32.abrupt("break", 16);
26101
+ return _context33.abrupt("break", 16);
26469
26102
 
26470
26103
  case 13:
26471
26104
  dappAddress = routerAddress[this.network][dapp];
26472
- return _context32.abrupt("break", 16);
26105
+ return _context33.abrupt("break", 16);
26473
26106
 
26474
26107
  case 15:
26475
26108
  throw new Error("dapp not supported");
26476
26109
 
26477
26110
  case 16:
26478
26111
  if (isStaked) {
26479
- _context32.next = 22;
26112
+ _context33.next = 22;
26480
26113
  break;
26481
26114
  }
26482
26115
 
26483
- _context32.next = 19;
26116
+ _context33.next = 19;
26484
26117
  return getIncreaseLiquidityTxData(this, dapp, tokenId, amountA, amountB);
26485
26118
 
26486
26119
  case 19:
26487
- txData = _context32.sent;
26488
- _context32.next = 23;
26120
+ txData = _context33.sent;
26121
+ _context33.next = 23;
26489
26122
  break;
26490
26123
 
26491
26124
  case 22:
26492
26125
  throw new Error("unsupported increaseStakedLiquidity: unstake first to increase lp");
26493
26126
 
26494
26127
  case 23:
26495
- _context32.next = 25;
26128
+ _context33.next = 25;
26496
26129
  return getPoolTxOrGasEstimate(this, [dappAddress, txData, options], estimateGas);
26497
26130
 
26498
26131
  case 25:
26499
- tx = _context32.sent;
26500
- return _context32.abrupt("return", tx);
26132
+ tx = _context33.sent;
26133
+ return _context33.abrupt("return", tx);
26501
26134
 
26502
26135
  case 27:
26503
26136
  case "end":
26504
- return _context32.stop();
26137
+ return _context33.stop();
26505
26138
  }
26506
26139
  }
26507
- }, _callee32, this);
26140
+ }, _callee33, this);
26508
26141
  }));
26509
26142
 
26510
- function increaseLiquidity(_x152, _x153, _x154, _x155, _x156, _x157) {
26143
+ function increaseLiquidity(_x155, _x156, _x157, _x158, _x159, _x160) {
26511
26144
  return _increaseLiquidity.apply(this, arguments);
26512
26145
  }
26513
26146
 
@@ -26526,11 +26159,11 @@ var Pool = /*#__PURE__*/function () {
26526
26159
  _proto.claimFees =
26527
26160
  /*#__PURE__*/
26528
26161
  function () {
26529
- var _claimFees = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee33(dapp, tokenId, options, estimateGas) {
26162
+ var _claimFees = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee34(dapp, tokenId, options, estimateGas) {
26530
26163
  var txData, contractAddress, iNonfungiblePositionManager, abi, tokenIdOwner, tx;
26531
- return runtime_1.wrap(function _callee33$(_context33) {
26164
+ return runtime_1.wrap(function _callee34$(_context34) {
26532
26165
  while (1) {
26533
- switch (_context33.prev = _context33.next) {
26166
+ switch (_context34.prev = _context34.next) {
26534
26167
  case 0:
26535
26168
  if (options === void 0) {
26536
26169
  options = null;
@@ -26541,37 +26174,37 @@ var Pool = /*#__PURE__*/function () {
26541
26174
  }
26542
26175
 
26543
26176
  iNonfungiblePositionManager = new ethers.utils.Interface(INonfungiblePositionManager.abi);
26544
- _context33.t0 = dapp;
26545
- _context33.next = _context33.t0 === Dapp.UNISWAPV3 ? 6 : _context33.t0 === Dapp.RAMSESCL ? 6 : _context33.t0 === Dapp.ARRAKIS ? 9 : _context33.t0 === Dapp.BALANCER ? 9 : _context33.t0 === Dapp.VELODROME ? 13 : _context33.t0 === Dapp.RAMSES ? 13 : _context33.t0 === Dapp.VELODROMEV2 ? 16 : _context33.t0 === Dapp.AERODROME ? 16 : _context33.t0 === Dapp.VELODROMECL ? 19 : _context33.t0 === Dapp.AERODROMECL ? 19 : 24;
26177
+ _context34.t0 = dapp;
26178
+ _context34.next = _context34.t0 === Dapp.UNISWAPV3 ? 6 : _context34.t0 === Dapp.RAMSESCL ? 6 : _context34.t0 === Dapp.ARRAKIS ? 9 : _context34.t0 === Dapp.BALANCER ? 9 : _context34.t0 === Dapp.VELODROME ? 13 : _context34.t0 === Dapp.RAMSES ? 13 : _context34.t0 === Dapp.VELODROMEV2 ? 16 : _context34.t0 === Dapp.AERODROME ? 16 : _context34.t0 === Dapp.VELODROMECL ? 19 : _context34.t0 === Dapp.AERODROMECL ? 19 : 24;
26546
26179
  break;
26547
26180
 
26548
26181
  case 6:
26549
26182
  contractAddress = nonfungiblePositionManagerAddress[this.network][dapp];
26550
26183
  txData = iNonfungiblePositionManager.encodeFunctionData(Transaction.COLLECT, [[tokenId, this.address, MaxUint128, MaxUint128]]);
26551
- return _context33.abrupt("break", 25);
26184
+ return _context34.abrupt("break", 25);
26552
26185
 
26553
26186
  case 9:
26554
26187
  contractAddress = tokenId;
26555
26188
  abi = new ethers.utils.Interface(ILiquidityGaugeV4.abi);
26556
26189
  txData = abi.encodeFunctionData("claim_rewards()", []);
26557
- return _context33.abrupt("break", 25);
26190
+ return _context34.abrupt("break", 25);
26558
26191
 
26559
26192
  case 13:
26560
26193
  contractAddress = tokenId;
26561
26194
  txData = getVelodromeClaimTxData(this, tokenId, false);
26562
- return _context33.abrupt("break", 25);
26195
+ return _context34.abrupt("break", 25);
26563
26196
 
26564
26197
  case 16:
26565
26198
  contractAddress = tokenId;
26566
26199
  txData = getVelodromeClaimTxData(this, tokenId, true);
26567
- return _context33.abrupt("break", 25);
26200
+ return _context34.abrupt("break", 25);
26568
26201
 
26569
26202
  case 19:
26570
- _context33.next = 21;
26203
+ _context34.next = 21;
26571
26204
  return getVelodromeClOwner(this, dapp, tokenId);
26572
26205
 
26573
26206
  case 21:
26574
- tokenIdOwner = _context33.sent;
26207
+ tokenIdOwner = _context34.sent;
26575
26208
 
26576
26209
  if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
26577
26210
  contractAddress = nonfungiblePositionManagerAddress[this.network][dapp];
@@ -26582,28 +26215,28 @@ var Pool = /*#__PURE__*/function () {
26582
26215
  txData = getVelodromeCLClaimTxData(tokenId);
26583
26216
  }
26584
26217
 
26585
- return _context33.abrupt("break", 25);
26218
+ return _context34.abrupt("break", 25);
26586
26219
 
26587
26220
  case 24:
26588
26221
  throw new Error("dapp not supported");
26589
26222
 
26590
26223
  case 25:
26591
- _context33.next = 27;
26224
+ _context34.next = 27;
26592
26225
  return getPoolTxOrGasEstimate(this, [contractAddress, txData, options], estimateGas);
26593
26226
 
26594
26227
  case 27:
26595
- tx = _context33.sent;
26596
- return _context33.abrupt("return", tx);
26228
+ tx = _context34.sent;
26229
+ return _context34.abrupt("return", tx);
26597
26230
 
26598
26231
  case 29:
26599
26232
  case "end":
26600
- return _context33.stop();
26233
+ return _context34.stop();
26601
26234
  }
26602
26235
  }
26603
- }, _callee33, this);
26236
+ }, _callee34, this);
26604
26237
  }));
26605
26238
 
26606
- function claimFees(_x158, _x159, _x160, _x161) {
26239
+ function claimFees(_x161, _x162, _x163, _x164) {
26607
26240
  return _claimFees.apply(this, arguments);
26608
26241
  }
26609
26242
 
@@ -26623,11 +26256,11 @@ var Pool = /*#__PURE__*/function () {
26623
26256
  _proto.getRewards =
26624
26257
  /*#__PURE__*/
26625
26258
  function () {
26626
- var _getRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee34(dapp, tokenId, rewards, options, estimateGas) {
26259
+ var _getRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee35(dapp, tokenId, rewards, options, estimateGas) {
26627
26260
  var tx;
26628
- return runtime_1.wrap(function _callee34$(_context34) {
26261
+ return runtime_1.wrap(function _callee35$(_context35) {
26629
26262
  while (1) {
26630
- switch (_context34.prev = _context34.next) {
26263
+ switch (_context35.prev = _context35.next) {
26631
26264
  case 0:
26632
26265
  if (options === void 0) {
26633
26266
  options = null;
@@ -26637,22 +26270,22 @@ var Pool = /*#__PURE__*/function () {
26637
26270
  estimateGas = false;
26638
26271
  }
26639
26272
 
26640
- _context34.next = 4;
26273
+ _context35.next = 4;
26641
26274
  return getPoolTxOrGasEstimate(this, [nonfungiblePositionManagerAddress[this.network][dapp], getRewardsTxDta(tokenId, rewards), options], estimateGas);
26642
26275
 
26643
26276
  case 4:
26644
- tx = _context34.sent;
26645
- return _context34.abrupt("return", tx);
26277
+ tx = _context35.sent;
26278
+ return _context35.abrupt("return", tx);
26646
26279
 
26647
26280
  case 6:
26648
26281
  case "end":
26649
- return _context34.stop();
26282
+ return _context35.stop();
26650
26283
  }
26651
26284
  }
26652
- }, _callee34, this);
26285
+ }, _callee35, this);
26653
26286
  }));
26654
26287
 
26655
- function getRewards(_x162, _x163, _x164, _x165, _x166) {
26288
+ function getRewards(_x165, _x166, _x167, _x168, _x169) {
26656
26289
  return _getRewards.apply(this, arguments);
26657
26290
  }
26658
26291
 
@@ -26675,11 +26308,11 @@ var Pool = /*#__PURE__*/function () {
26675
26308
  _proto.tradeUniswapV3 =
26676
26309
  /*#__PURE__*/
26677
26310
  function () {
26678
- var _tradeUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee35(assetFrom, assetTo, amountIn, feeAmount, slippage, options, estimateGas) {
26311
+ var _tradeUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(assetFrom, assetTo, amountIn, feeAmount, slippage, options, estimateGas) {
26679
26312
  var swapxData, tx;
26680
- return runtime_1.wrap(function _callee35$(_context35) {
26313
+ return runtime_1.wrap(function _callee36$(_context36) {
26681
26314
  while (1) {
26682
- switch (_context35.prev = _context35.next) {
26315
+ switch (_context36.prev = _context36.next) {
26683
26316
  case 0:
26684
26317
  if (slippage === void 0) {
26685
26318
  slippage = 0.5;
@@ -26693,27 +26326,27 @@ var Pool = /*#__PURE__*/function () {
26693
26326
  estimateGas = false;
26694
26327
  }
26695
26328
 
26696
- _context35.next = 5;
26329
+ _context36.next = 5;
26697
26330
  return getUniswapV3SwapTxData(this, assetFrom, assetTo, amountIn, slippage, feeAmount);
26698
26331
 
26699
26332
  case 5:
26700
- swapxData = _context35.sent;
26701
- _context35.next = 8;
26333
+ swapxData = _context36.sent;
26334
+ _context36.next = 8;
26702
26335
  return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.UNISWAPV3], swapxData, options], estimateGas);
26703
26336
 
26704
26337
  case 8:
26705
- tx = _context35.sent;
26706
- return _context35.abrupt("return", tx);
26338
+ tx = _context36.sent;
26339
+ return _context36.abrupt("return", tx);
26707
26340
 
26708
26341
  case 10:
26709
26342
  case "end":
26710
- return _context35.stop();
26343
+ return _context36.stop();
26711
26344
  }
26712
26345
  }
26713
- }, _callee35, this);
26346
+ }, _callee36, this);
26714
26347
  }));
26715
26348
 
26716
- function tradeUniswapV3(_x167, _x168, _x169, _x170, _x171, _x172, _x173) {
26349
+ function tradeUniswapV3(_x170, _x171, _x172, _x173, _x174, _x175, _x176) {
26717
26350
  return _tradeUniswapV.apply(this, arguments);
26718
26351
  }
26719
26352
 
@@ -26735,68 +26368,7 @@ var Pool = /*#__PURE__*/function () {
26735
26368
  _proto.addLiquidityVelodrome =
26736
26369
  /*#__PURE__*/
26737
26370
  function () {
26738
- var _addLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
26739
- var tx;
26740
- return runtime_1.wrap(function _callee36$(_context36) {
26741
- while (1) {
26742
- switch (_context36.prev = _context36.next) {
26743
- case 0:
26744
- if (options === void 0) {
26745
- options = null;
26746
- }
26747
-
26748
- if (estimateGas === void 0) {
26749
- estimateGas = false;
26750
- }
26751
-
26752
- _context36.t0 = getPoolTxOrGasEstimate;
26753
- _context36.t1 = this;
26754
- _context36.t2 = routerAddress[this.network][Dapp.VELODROME];
26755
- _context36.next = 7;
26756
- return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
26757
-
26758
- case 7:
26759
- _context36.t3 = _context36.sent;
26760
- _context36.t4 = options;
26761
- _context36.t5 = [_context36.t2, _context36.t3, _context36.t4];
26762
- _context36.t6 = estimateGas;
26763
- _context36.next = 13;
26764
- return (0, _context36.t0)(_context36.t1, _context36.t5, _context36.t6);
26765
-
26766
- case 13:
26767
- tx = _context36.sent;
26768
- return _context36.abrupt("return", tx);
26769
-
26770
- case 15:
26771
- case "end":
26772
- return _context36.stop();
26773
- }
26774
- }
26775
- }, _callee36, this);
26776
- }));
26777
-
26778
- function addLiquidityVelodrome(_x174, _x175, _x176, _x177, _x178, _x179, _x180) {
26779
- return _addLiquidityVelodrome.apply(this, arguments);
26780
- }
26781
-
26782
- return addLiquidityVelodrome;
26783
- }()
26784
- /**
26785
- * Remove liquidity from Velodrome pool
26786
- * @param {string} assetA First asset
26787
- * @param {string} assetB Second asset
26788
- * @param {BigNumber | string} amount Amount of LP tokens
26789
- * @param { boolean } isStable Is stable pool
26790
- * @param {any} options Transaction options
26791
- * @param {boolean} estimateGas Simulate/estimate gas
26792
- * @returns {Promise<any>} Transaction
26793
- */
26794
- ;
26795
-
26796
- _proto.removeLiquidityVelodrome =
26797
- /*#__PURE__*/
26798
- function () {
26799
- var _removeLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee37(assetA, assetB, amount, isStable, options, estimateGas) {
26371
+ var _addLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee37(assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
26800
26372
  var tx;
26801
26373
  return runtime_1.wrap(function _callee37$(_context37) {
26802
26374
  while (1) {
@@ -26814,7 +26386,7 @@ var Pool = /*#__PURE__*/function () {
26814
26386
  _context37.t1 = this;
26815
26387
  _context37.t2 = routerAddress[this.network][Dapp.VELODROME];
26816
26388
  _context37.next = 7;
26817
- return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
26389
+ return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
26818
26390
 
26819
26391
  case 7:
26820
26392
  _context37.t3 = _context37.sent;
@@ -26836,18 +26408,17 @@ var Pool = /*#__PURE__*/function () {
26836
26408
  }, _callee37, this);
26837
26409
  }));
26838
26410
 
26839
- function removeLiquidityVelodrome(_x181, _x182, _x183, _x184, _x185, _x186) {
26840
- return _removeLiquidityVelodrome.apply(this, arguments);
26411
+ function addLiquidityVelodrome(_x177, _x178, _x179, _x180, _x181, _x182, _x183) {
26412
+ return _addLiquidityVelodrome.apply(this, arguments);
26841
26413
  }
26842
26414
 
26843
- return removeLiquidityVelodrome;
26415
+ return addLiquidityVelodrome;
26844
26416
  }()
26845
26417
  /**
26846
- * Add liquidity to Velodrome V2 pool
26418
+ * Remove liquidity from Velodrome pool
26847
26419
  * @param {string} assetA First asset
26848
26420
  * @param {string} assetB Second asset
26849
- * @param {BigNumber | string} amountA Amount first asset
26850
- * @param {BigNumber | string} amountB Amount second asset
26421
+ * @param {BigNumber | string} amount Amount of LP tokens
26851
26422
  * @param { boolean } isStable Is stable pool
26852
26423
  * @param {any} options Transaction options
26853
26424
  * @param {boolean} estimateGas Simulate/estimate gas
@@ -26855,10 +26426,10 @@ var Pool = /*#__PURE__*/function () {
26855
26426
  */
26856
26427
  ;
26857
26428
 
26858
- _proto.addLiquidityVelodromeV2 =
26429
+ _proto.removeLiquidityVelodrome =
26859
26430
  /*#__PURE__*/
26860
26431
  function () {
26861
- var _addLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
26432
+ var _removeLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(assetA, assetB, amount, isStable, options, estimateGas) {
26862
26433
  var tx;
26863
26434
  return runtime_1.wrap(function _callee38$(_context38) {
26864
26435
  while (1) {
@@ -26874,9 +26445,9 @@ var Pool = /*#__PURE__*/function () {
26874
26445
 
26875
26446
  _context38.t0 = getPoolTxOrGasEstimate;
26876
26447
  _context38.t1 = this;
26877
- _context38.t2 = routerAddress[this.network][Dapp.VELODROMEV2];
26448
+ _context38.t2 = routerAddress[this.network][Dapp.VELODROME];
26878
26449
  _context38.next = 7;
26879
- return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
26450
+ return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
26880
26451
 
26881
26452
  case 7:
26882
26453
  _context38.t3 = _context38.sent;
@@ -26898,17 +26469,18 @@ var Pool = /*#__PURE__*/function () {
26898
26469
  }, _callee38, this);
26899
26470
  }));
26900
26471
 
26901
- function addLiquidityVelodromeV2(_x187, _x188, _x189, _x190, _x191, _x192, _x193) {
26902
- return _addLiquidityVelodromeV.apply(this, arguments);
26472
+ function removeLiquidityVelodrome(_x184, _x185, _x186, _x187, _x188, _x189) {
26473
+ return _removeLiquidityVelodrome.apply(this, arguments);
26903
26474
  }
26904
26475
 
26905
- return addLiquidityVelodromeV2;
26476
+ return removeLiquidityVelodrome;
26906
26477
  }()
26907
26478
  /**
26908
- * Remove liquidity from Velodrome V2 pool
26479
+ * Add liquidity to Velodrome V2 pool
26909
26480
  * @param {string} assetA First asset
26910
26481
  * @param {string} assetB Second asset
26911
- * @param {BigNumber | string} amount Amount of LP tokens
26482
+ * @param {BigNumber | string} amountA Amount first asset
26483
+ * @param {BigNumber | string} amountB Amount second asset
26912
26484
  * @param { boolean } isStable Is stable pool
26913
26485
  * @param {any} options Transaction options
26914
26486
  * @param {boolean} estimateGas Simulate/estimate gas
@@ -26916,10 +26488,10 @@ var Pool = /*#__PURE__*/function () {
26916
26488
  */
26917
26489
  ;
26918
26490
 
26919
- _proto.removeLiquidityVelodromeV2 =
26491
+ _proto.addLiquidityVelodromeV2 =
26920
26492
  /*#__PURE__*/
26921
26493
  function () {
26922
- var _removeLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee39(assetA, assetB, amount, isStable, options, estimateGas) {
26494
+ var _addLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee39(assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
26923
26495
  var tx;
26924
26496
  return runtime_1.wrap(function _callee39$(_context39) {
26925
26497
  while (1) {
@@ -26937,7 +26509,7 @@ var Pool = /*#__PURE__*/function () {
26937
26509
  _context39.t1 = this;
26938
26510
  _context39.t2 = routerAddress[this.network][Dapp.VELODROMEV2];
26939
26511
  _context39.next = 7;
26940
- return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
26512
+ return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
26941
26513
 
26942
26514
  case 7:
26943
26515
  _context39.t3 = _context39.sent;
@@ -26959,19 +26531,17 @@ var Pool = /*#__PURE__*/function () {
26959
26531
  }, _callee39, this);
26960
26532
  }));
26961
26533
 
26962
- function removeLiquidityVelodromeV2(_x194, _x195, _x196, _x197, _x198, _x199) {
26963
- return _removeLiquidityVelodromeV.apply(this, arguments);
26534
+ function addLiquidityVelodromeV2(_x190, _x191, _x192, _x193, _x194, _x195, _x196) {
26535
+ return _addLiquidityVelodromeV.apply(this, arguments);
26964
26536
  }
26965
26537
 
26966
- return removeLiquidityVelodromeV2;
26538
+ return addLiquidityVelodromeV2;
26967
26539
  }()
26968
26540
  /**
26969
- * Add liquidity to Velodrome V2 or Ramses pool
26970
- * @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
26541
+ * Remove liquidity from Velodrome V2 pool
26971
26542
  * @param {string} assetA First asset
26972
26543
  * @param {string} assetB Second asset
26973
- * @param {BigNumber | string} amountA Amount first asset
26974
- * @param {BigNumber | string} amountB Amount second asset
26544
+ * @param {BigNumber | string} amount Amount of LP tokens
26975
26545
  * @param { boolean } isStable Is stable pool
26976
26546
  * @param {any} options Transaction options
26977
26547
  * @param {boolean} estimateGas Simulate/estimate gas
@@ -26979,10 +26549,10 @@ var Pool = /*#__PURE__*/function () {
26979
26549
  */
26980
26550
  ;
26981
26551
 
26982
- _proto.addLiquidityV2 =
26552
+ _proto.removeLiquidityVelodromeV2 =
26983
26553
  /*#__PURE__*/
26984
26554
  function () {
26985
- var _addLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee40(dapp, assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
26555
+ var _removeLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee40(assetA, assetB, amount, isStable, options, estimateGas) {
26986
26556
  var tx;
26987
26557
  return runtime_1.wrap(function _callee40$(_context40) {
26988
26558
  while (1) {
@@ -26998,9 +26568,9 @@ var Pool = /*#__PURE__*/function () {
26998
26568
 
26999
26569
  _context40.t0 = getPoolTxOrGasEstimate;
27000
26570
  _context40.t1 = this;
27001
- _context40.t2 = routerAddress[this.network][dapp];
26571
+ _context40.t2 = routerAddress[this.network][Dapp.VELODROMEV2];
27002
26572
  _context40.next = 7;
27003
- return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
26573
+ return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
27004
26574
 
27005
26575
  case 7:
27006
26576
  _context40.t3 = _context40.sent;
@@ -27022,18 +26592,19 @@ var Pool = /*#__PURE__*/function () {
27022
26592
  }, _callee40, this);
27023
26593
  }));
27024
26594
 
27025
- function addLiquidityV2(_x200, _x201, _x202, _x203, _x204, _x205, _x206, _x207) {
27026
- return _addLiquidityV.apply(this, arguments);
26595
+ function removeLiquidityVelodromeV2(_x197, _x198, _x199, _x200, _x201, _x202) {
26596
+ return _removeLiquidityVelodromeV.apply(this, arguments);
27027
26597
  }
27028
26598
 
27029
- return addLiquidityV2;
26599
+ return removeLiquidityVelodromeV2;
27030
26600
  }()
27031
26601
  /**
27032
- * Remove liquidity from Velodrome V2 or Ramses pool
26602
+ * Add liquidity to Velodrome V2 or Ramses pool
27033
26603
  * @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
27034
26604
  * @param {string} assetA First asset
27035
26605
  * @param {string} assetB Second asset
27036
- * @param {BigNumber | string} amount Amount of LP tokens
26606
+ * @param {BigNumber | string} amountA Amount first asset
26607
+ * @param {BigNumber | string} amountB Amount second asset
27037
26608
  * @param { boolean } isStable Is stable pool
27038
26609
  * @param {any} options Transaction options
27039
26610
  * @param {boolean} estimateGas Simulate/estimate gas
@@ -27041,10 +26612,10 @@ var Pool = /*#__PURE__*/function () {
27041
26612
  */
27042
26613
  ;
27043
26614
 
27044
- _proto.removeLiquidityV2 =
26615
+ _proto.addLiquidityV2 =
27045
26616
  /*#__PURE__*/
27046
26617
  function () {
27047
- var _removeLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee41(dapp, assetA, assetB, amount, isStable, options, estimateGas) {
26618
+ var _addLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee41(dapp, assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
27048
26619
  var tx;
27049
26620
  return runtime_1.wrap(function _callee41$(_context41) {
27050
26621
  while (1) {
@@ -27062,7 +26633,7 @@ var Pool = /*#__PURE__*/function () {
27062
26633
  _context41.t1 = this;
27063
26634
  _context41.t2 = routerAddress[this.network][dapp];
27064
26635
  _context41.next = 7;
27065
- return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
26636
+ return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
27066
26637
 
27067
26638
  case 7:
27068
26639
  _context41.t3 = _context41.sent;
@@ -27084,7 +26655,69 @@ var Pool = /*#__PURE__*/function () {
27084
26655
  }, _callee41, this);
27085
26656
  }));
27086
26657
 
27087
- function removeLiquidityV2(_x208, _x209, _x210, _x211, _x212, _x213, _x214) {
26658
+ function addLiquidityV2(_x203, _x204, _x205, _x206, _x207, _x208, _x209, _x210) {
26659
+ return _addLiquidityV.apply(this, arguments);
26660
+ }
26661
+
26662
+ return addLiquidityV2;
26663
+ }()
26664
+ /**
26665
+ * Remove liquidity from Velodrome V2 or Ramses pool
26666
+ * @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
26667
+ * @param {string} assetA First asset
26668
+ * @param {string} assetB Second asset
26669
+ * @param {BigNumber | string} amount Amount of LP tokens
26670
+ * @param { boolean } isStable Is stable pool
26671
+ * @param {any} options Transaction options
26672
+ * @param {boolean} estimateGas Simulate/estimate gas
26673
+ * @returns {Promise<any>} Transaction
26674
+ */
26675
+ ;
26676
+
26677
+ _proto.removeLiquidityV2 =
26678
+ /*#__PURE__*/
26679
+ function () {
26680
+ var _removeLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee42(dapp, assetA, assetB, amount, isStable, options, estimateGas) {
26681
+ var tx;
26682
+ return runtime_1.wrap(function _callee42$(_context42) {
26683
+ while (1) {
26684
+ switch (_context42.prev = _context42.next) {
26685
+ case 0:
26686
+ if (options === void 0) {
26687
+ options = null;
26688
+ }
26689
+
26690
+ if (estimateGas === void 0) {
26691
+ estimateGas = false;
26692
+ }
26693
+
26694
+ _context42.t0 = getPoolTxOrGasEstimate;
26695
+ _context42.t1 = this;
26696
+ _context42.t2 = routerAddress[this.network][dapp];
26697
+ _context42.next = 7;
26698
+ return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
26699
+
26700
+ case 7:
26701
+ _context42.t3 = _context42.sent;
26702
+ _context42.t4 = options;
26703
+ _context42.t5 = [_context42.t2, _context42.t3, _context42.t4];
26704
+ _context42.t6 = estimateGas;
26705
+ _context42.next = 13;
26706
+ return (0, _context42.t0)(_context42.t1, _context42.t5, _context42.t6);
26707
+
26708
+ case 13:
26709
+ tx = _context42.sent;
26710
+ return _context42.abrupt("return", tx);
26711
+
26712
+ case 15:
26713
+ case "end":
26714
+ return _context42.stop();
26715
+ }
26716
+ }
26717
+ }, _callee42, this);
26718
+ }));
26719
+
26720
+ function removeLiquidityV2(_x211, _x212, _x213, _x214, _x215, _x216, _x217) {
27088
26721
  return _removeLiquidityV.apply(this, arguments);
27089
26722
  }
27090
26723
 
@@ -27110,11 +26743,11 @@ var Pool = /*#__PURE__*/function () {
27110
26743
  _proto.tradeLyraOption =
27111
26744
  /*#__PURE__*/
27112
26745
  function () {
27113
- var _tradeLyraOption = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee42(market, expiry, strike, optionType, tradeType, optionAmount, assetIn, collateralChangeAmount, isCoveredCall, options, estimateGas) {
26746
+ var _tradeLyraOption = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee43(market, expiry, strike, optionType, tradeType, optionAmount, assetIn, collateralChangeAmount, isCoveredCall, options, estimateGas) {
27114
26747
  var swapxData, tx;
27115
- return runtime_1.wrap(function _callee42$(_context42) {
26748
+ return runtime_1.wrap(function _callee43$(_context43) {
27116
26749
  while (1) {
27117
- switch (_context42.prev = _context42.next) {
26750
+ switch (_context43.prev = _context43.next) {
27118
26751
  case 0:
27119
26752
  if (collateralChangeAmount === void 0) {
27120
26753
  collateralChangeAmount = "0";
@@ -27132,27 +26765,27 @@ var Pool = /*#__PURE__*/function () {
27132
26765
  estimateGas = false;
27133
26766
  }
27134
26767
 
27135
- _context42.next = 6;
26768
+ _context43.next = 6;
27136
26769
  return getLyraOptionTxData(this, market, optionType, expiry, strike, tradeType, optionAmount, assetIn, BigNumber$1.from(collateralChangeAmount), isCoveredCall);
27137
26770
 
27138
26771
  case 6:
27139
- swapxData = _context42.sent;
27140
- _context42.next = 9;
26772
+ swapxData = _context43.sent;
26773
+ _context43.next = 9;
27141
26774
  return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.LYRA], swapxData, options], estimateGas);
27142
26775
 
27143
26776
  case 9:
27144
- tx = _context42.sent;
27145
- return _context42.abrupt("return", tx);
26777
+ tx = _context43.sent;
26778
+ return _context43.abrupt("return", tx);
27146
26779
 
27147
26780
  case 11:
27148
26781
  case "end":
27149
- return _context42.stop();
26782
+ return _context43.stop();
27150
26783
  }
27151
26784
  }
27152
- }, _callee42, this);
26785
+ }, _callee43, this);
27153
26786
  }));
27154
26787
 
27155
- function tradeLyraOption(_x215, _x216, _x217, _x218, _x219, _x220, _x221, _x222, _x223, _x224, _x225) {
26788
+ function tradeLyraOption(_x218, _x219, _x220, _x221, _x222, _x223, _x224, _x225, _x226, _x227, _x228) {
27156
26789
  return _tradeLyraOption.apply(this, arguments);
27157
26790
  }
27158
26791
 
@@ -27167,26 +26800,26 @@ var Pool = /*#__PURE__*/function () {
27167
26800
  _proto.getLyraPositions =
27168
26801
  /*#__PURE__*/
27169
26802
  function () {
27170
- var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee43(market) {
27171
- return runtime_1.wrap(function _callee43$(_context43) {
26803
+ var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee44(market) {
26804
+ return runtime_1.wrap(function _callee44$(_context44) {
27172
26805
  while (1) {
27173
- switch (_context43.prev = _context43.next) {
26806
+ switch (_context44.prev = _context44.next) {
27174
26807
  case 0:
27175
- _context43.next = 2;
26808
+ _context44.next = 2;
27176
26809
  return getOptionPositions(this, market);
27177
26810
 
27178
26811
  case 2:
27179
- return _context43.abrupt("return", _context43.sent);
26812
+ return _context44.abrupt("return", _context44.sent);
27180
26813
 
27181
26814
  case 3:
27182
26815
  case "end":
27183
- return _context43.stop();
26816
+ return _context44.stop();
27184
26817
  }
27185
26818
  }
27186
- }, _callee43, this);
26819
+ }, _callee44, this);
27187
26820
  }));
27188
26821
 
27189
- function getLyraPositions(_x226) {
26822
+ function getLyraPositions(_x229) {
27190
26823
  return _getLyraPositions.apply(this, arguments);
27191
26824
  }
27192
26825
 
@@ -27205,11 +26838,11 @@ var Pool = /*#__PURE__*/function () {
27205
26838
  _proto.changeFuturesMargin =
27206
26839
  /*#__PURE__*/
27207
26840
  function () {
27208
- var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee44(market, changeAmount, options, estimateGas) {
26841
+ var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee45(market, changeAmount, options, estimateGas) {
27209
26842
  var tx;
27210
- return runtime_1.wrap(function _callee44$(_context44) {
26843
+ return runtime_1.wrap(function _callee45$(_context45) {
27211
26844
  while (1) {
27212
- switch (_context44.prev = _context44.next) {
26845
+ switch (_context45.prev = _context45.next) {
27213
26846
  case 0:
27214
26847
  if (options === void 0) {
27215
26848
  options = null;
@@ -27219,22 +26852,22 @@ var Pool = /*#__PURE__*/function () {
27219
26852
  estimateGas = false;
27220
26853
  }
27221
26854
 
27222
- _context44.next = 4;
26855
+ _context45.next = 4;
27223
26856
  return getPoolTxOrGasEstimate(this, [market, getFuturesChangeMarginTxData(changeAmount), options], estimateGas);
27224
26857
 
27225
26858
  case 4:
27226
- tx = _context44.sent;
27227
- return _context44.abrupt("return", tx);
26859
+ tx = _context45.sent;
26860
+ return _context45.abrupt("return", tx);
27228
26861
 
27229
26862
  case 6:
27230
26863
  case "end":
27231
- return _context44.stop();
26864
+ return _context45.stop();
27232
26865
  }
27233
26866
  }
27234
- }, _callee44, this);
26867
+ }, _callee45, this);
27235
26868
  }));
27236
26869
 
27237
- function changeFuturesMargin(_x227, _x228, _x229, _x230) {
26870
+ function changeFuturesMargin(_x230, _x231, _x232, _x233) {
27238
26871
  return _changeFuturesMargin.apply(this, arguments);
27239
26872
  }
27240
26873
 
@@ -27253,11 +26886,11 @@ var Pool = /*#__PURE__*/function () {
27253
26886
  _proto.changeFuturesPosition =
27254
26887
  /*#__PURE__*/
27255
26888
  function () {
27256
- var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee45(market, changeAmount, options, estimateGas) {
26889
+ var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee46(market, changeAmount, options, estimateGas) {
27257
26890
  var txData, tx;
27258
- return runtime_1.wrap(function _callee45$(_context45) {
26891
+ return runtime_1.wrap(function _callee46$(_context46) {
27259
26892
  while (1) {
27260
- switch (_context45.prev = _context45.next) {
26893
+ switch (_context46.prev = _context46.next) {
27261
26894
  case 0:
27262
26895
  if (options === void 0) {
27263
26896
  options = null;
@@ -27267,27 +26900,27 @@ var Pool = /*#__PURE__*/function () {
27267
26900
  estimateGas = false;
27268
26901
  }
27269
26902
 
27270
- _context45.next = 4;
26903
+ _context46.next = 4;
27271
26904
  return getFuturesChangePositionTxData(changeAmount, market, this);
27272
26905
 
27273
26906
  case 4:
27274
- txData = _context45.sent;
27275
- _context45.next = 7;
26907
+ txData = _context46.sent;
26908
+ _context46.next = 7;
27276
26909
  return getPoolTxOrGasEstimate(this, [market, txData, options], estimateGas);
27277
26910
 
27278
26911
  case 7:
27279
- tx = _context45.sent;
27280
- return _context45.abrupt("return", tx);
26912
+ tx = _context46.sent;
26913
+ return _context46.abrupt("return", tx);
27281
26914
 
27282
26915
  case 9:
27283
26916
  case "end":
27284
- return _context45.stop();
26917
+ return _context46.stop();
27285
26918
  }
27286
26919
  }
27287
- }, _callee45, this);
26920
+ }, _callee46, this);
27288
26921
  }));
27289
26922
 
27290
- function changeFuturesPosition(_x231, _x232, _x233, _x234) {
26923
+ function changeFuturesPosition(_x234, _x235, _x236, _x237) {
27291
26924
  return _changeFuturesPosition.apply(this, arguments);
27292
26925
  }
27293
26926
 
@@ -27305,11 +26938,11 @@ var Pool = /*#__PURE__*/function () {
27305
26938
  _proto.cancelFuturesOrder =
27306
26939
  /*#__PURE__*/
27307
26940
  function () {
27308
- var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee46(market, options, estimateGas) {
26941
+ var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee47(market, options, estimateGas) {
27309
26942
  var txData, tx;
27310
- return runtime_1.wrap(function _callee46$(_context46) {
26943
+ return runtime_1.wrap(function _callee47$(_context47) {
27311
26944
  while (1) {
27312
- switch (_context46.prev = _context46.next) {
26945
+ switch (_context47.prev = _context47.next) {
27313
26946
  case 0:
27314
26947
  if (options === void 0) {
27315
26948
  options = null;
@@ -27319,27 +26952,27 @@ var Pool = /*#__PURE__*/function () {
27319
26952
  estimateGas = false;
27320
26953
  }
27321
26954
 
27322
- _context46.next = 4;
26955
+ _context47.next = 4;
27323
26956
  return getFuturesCancelOrderTxData(this);
27324
26957
 
27325
26958
  case 4:
27326
- txData = _context46.sent;
27327
- _context46.next = 7;
26959
+ txData = _context47.sent;
26960
+ _context47.next = 7;
27328
26961
  return getPoolTxOrGasEstimate(this, [market, txData, options], estimateGas);
27329
26962
 
27330
26963
  case 7:
27331
- tx = _context46.sent;
27332
- return _context46.abrupt("return", tx);
26964
+ tx = _context47.sent;
26965
+ return _context47.abrupt("return", tx);
27333
26966
 
27334
26967
  case 9:
27335
26968
  case "end":
27336
- return _context46.stop();
26969
+ return _context47.stop();
27337
26970
  }
27338
26971
  }
27339
- }, _callee46, this);
26972
+ }, _callee47, this);
27340
26973
  }));
27341
26974
 
27342
- function cancelFuturesOrder(_x235, _x236, _x237) {
26975
+ function cancelFuturesOrder(_x238, _x239, _x240) {
27343
26976
  return _cancelFuturesOrder.apply(this, arguments);
27344
26977
  }
27345
26978
 
@@ -27356,11 +26989,11 @@ var Pool = /*#__PURE__*/function () {
27356
26989
  _proto.mintManagerFee =
27357
26990
  /*#__PURE__*/
27358
26991
  function () {
27359
- var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee47(options, estimateGas) {
26992
+ var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee48(options, estimateGas) {
27360
26993
  var tx;
27361
- return runtime_1.wrap(function _callee47$(_context47) {
26994
+ return runtime_1.wrap(function _callee48$(_context48) {
27362
26995
  while (1) {
27363
- switch (_context47.prev = _context47.next) {
26996
+ switch (_context48.prev = _context48.next) {
27364
26997
  case 0:
27365
26998
  if (options === void 0) {
27366
26999
  options = null;
@@ -27371,33 +27004,33 @@ var Pool = /*#__PURE__*/function () {
27371
27004
  }
27372
27005
 
27373
27006
  if (!estimateGas) {
27374
- _context47.next = 6;
27007
+ _context48.next = 6;
27375
27008
  break;
27376
27009
  }
27377
27010
 
27378
- _context47.next = 5;
27011
+ _context48.next = 5;
27379
27012
  return this.poolLogic.estimateGas.mintManagerFee(options);
27380
27013
 
27381
27014
  case 5:
27382
- return _context47.abrupt("return", _context47.sent);
27015
+ return _context48.abrupt("return", _context48.sent);
27383
27016
 
27384
27017
  case 6:
27385
- _context47.next = 8;
27018
+ _context48.next = 8;
27386
27019
  return this.poolLogic.mintManagerFee(options);
27387
27020
 
27388
27021
  case 8:
27389
- tx = _context47.sent;
27390
- return _context47.abrupt("return", tx);
27022
+ tx = _context48.sent;
27023
+ return _context48.abrupt("return", tx);
27391
27024
 
27392
27025
  case 10:
27393
27026
  case "end":
27394
- return _context47.stop();
27027
+ return _context48.stop();
27395
27028
  }
27396
27029
  }
27397
- }, _callee47, this);
27030
+ }, _callee48, this);
27398
27031
  }));
27399
27032
 
27400
- function mintManagerFee(_x238, _x239) {
27033
+ function mintManagerFee(_x241, _x242) {
27401
27034
  return _mintManagerFee.apply(this, arguments);
27402
27035
  }
27403
27036
 
@@ -27412,25 +27045,25 @@ var Pool = /*#__PURE__*/function () {
27412
27045
  _proto.getAvailableManagerFee =
27413
27046
  /*#__PURE__*/
27414
27047
  function () {
27415
- var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee48() {
27048
+ var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee49() {
27416
27049
  var fee;
27417
- return runtime_1.wrap(function _callee48$(_context48) {
27050
+ return runtime_1.wrap(function _callee49$(_context49) {
27418
27051
  while (1) {
27419
- switch (_context48.prev = _context48.next) {
27052
+ switch (_context49.prev = _context49.next) {
27420
27053
  case 0:
27421
- _context48.next = 2;
27054
+ _context49.next = 2;
27422
27055
  return this.poolLogic.availableManagerFee();
27423
27056
 
27424
27057
  case 2:
27425
- fee = _context48.sent;
27426
- return _context48.abrupt("return", BigNumber$1.from(fee));
27058
+ fee = _context49.sent;
27059
+ return _context49.abrupt("return", BigNumber$1.from(fee));
27427
27060
 
27428
27061
  case 4:
27429
27062
  case "end":
27430
- return _context48.stop();
27063
+ return _context49.stop();
27431
27064
  }
27432
27065
  }
27433
- }, _callee48, this);
27066
+ }, _callee49, this);
27434
27067
  }));
27435
27068
 
27436
27069
  function getAvailableManagerFee() {
@@ -27452,11 +27085,11 @@ var Pool = /*#__PURE__*/function () {
27452
27085
  _proto.vestTokens =
27453
27086
  /*#__PURE__*/
27454
27087
  function () {
27455
- var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee49(tokenAddress, amount, options, estimateGas) {
27088
+ var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee50(tokenAddress, amount, options, estimateGas) {
27456
27089
  var txData, tx;
27457
- return runtime_1.wrap(function _callee49$(_context49) {
27090
+ return runtime_1.wrap(function _callee50$(_context50) {
27458
27091
  while (1) {
27459
- switch (_context49.prev = _context49.next) {
27092
+ switch (_context50.prev = _context50.next) {
27460
27093
  case 0:
27461
27094
  if (options === void 0) {
27462
27095
  options = null;
@@ -27466,27 +27099,27 @@ var Pool = /*#__PURE__*/function () {
27466
27099
  estimateGas = false;
27467
27100
  }
27468
27101
 
27469
- _context49.next = 4;
27102
+ _context50.next = 4;
27470
27103
  return getCreateVestTxData(amount);
27471
27104
 
27472
27105
  case 4:
27473
- txData = _context49.sent;
27474
- _context49.next = 7;
27106
+ txData = _context50.sent;
27107
+ _context50.next = 7;
27475
27108
  return getPoolTxOrGasEstimate(this, [tokenAddress, txData, options], estimateGas);
27476
27109
 
27477
27110
  case 7:
27478
- tx = _context49.sent;
27479
- return _context49.abrupt("return", tx);
27111
+ tx = _context50.sent;
27112
+ return _context50.abrupt("return", tx);
27480
27113
 
27481
27114
  case 9:
27482
27115
  case "end":
27483
- return _context49.stop();
27116
+ return _context50.stop();
27484
27117
  }
27485
27118
  }
27486
- }, _callee49, this);
27119
+ }, _callee50, this);
27487
27120
  }));
27488
27121
 
27489
- function vestTokens(_x240, _x241, _x242, _x243) {
27122
+ function vestTokens(_x243, _x244, _x245, _x246) {
27490
27123
  return _vestTokens.apply(this, arguments);
27491
27124
  }
27492
27125
 
@@ -27505,11 +27138,11 @@ var Pool = /*#__PURE__*/function () {
27505
27138
  _proto.exitVestedToken =
27506
27139
  /*#__PURE__*/
27507
27140
  function () {
27508
- var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee50(tokenAddress, id, options, estimateGas) {
27141
+ var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee51(tokenAddress, id, options, estimateGas) {
27509
27142
  var txData, tx;
27510
- return runtime_1.wrap(function _callee50$(_context50) {
27143
+ return runtime_1.wrap(function _callee51$(_context51) {
27511
27144
  while (1) {
27512
- switch (_context50.prev = _context50.next) {
27145
+ switch (_context51.prev = _context51.next) {
27513
27146
  case 0:
27514
27147
  if (options === void 0) {
27515
27148
  options = null;
@@ -27519,27 +27152,27 @@ var Pool = /*#__PURE__*/function () {
27519
27152
  estimateGas = false;
27520
27153
  }
27521
27154
 
27522
- _context50.next = 4;
27155
+ _context51.next = 4;
27523
27156
  return getExitVestTxData(id);
27524
27157
 
27525
27158
  case 4:
27526
- txData = _context50.sent;
27527
- _context50.next = 7;
27159
+ txData = _context51.sent;
27160
+ _context51.next = 7;
27528
27161
  return getPoolTxOrGasEstimate(this, [tokenAddress, txData, options], estimateGas);
27529
27162
 
27530
27163
  case 7:
27531
- tx = _context50.sent;
27532
- return _context50.abrupt("return", tx);
27164
+ tx = _context51.sent;
27165
+ return _context51.abrupt("return", tx);
27533
27166
 
27534
27167
  case 9:
27535
27168
  case "end":
27536
- return _context50.stop();
27169
+ return _context51.stop();
27537
27170
  }
27538
27171
  }
27539
- }, _callee50, this);
27172
+ }, _callee51, this);
27540
27173
  }));
27541
27174
 
27542
- function exitVestedToken(_x244, _x245, _x246, _x247) {
27175
+ function exitVestedToken(_x247, _x248, _x249, _x250) {
27543
27176
  return _exitVestedToken.apply(this, arguments);
27544
27177
  }
27545
27178
 
@@ -27559,11 +27192,11 @@ var Pool = /*#__PURE__*/function () {
27559
27192
  _proto.mintUnitViaFlatMoney =
27560
27193
  /*#__PURE__*/
27561
27194
  function () {
27562
- var _mintUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee51(depositAmount, slippage, maxKeeperFeeInUsd, options, estimateGas) {
27195
+ var _mintUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee52(depositAmount, slippage, maxKeeperFeeInUsd, options, estimateGas) {
27563
27196
  var tx;
27564
- return runtime_1.wrap(function _callee51$(_context51) {
27197
+ return runtime_1.wrap(function _callee52$(_context52) {
27565
27198
  while (1) {
27566
- switch (_context51.prev = _context51.next) {
27199
+ switch (_context52.prev = _context52.next) {
27567
27200
  case 0:
27568
27201
  if (slippage === void 0) {
27569
27202
  slippage = 0.5;
@@ -27577,22 +27210,22 @@ var Pool = /*#__PURE__*/function () {
27577
27210
  estimateGas = false;
27578
27211
  }
27579
27212
 
27580
- _context51.next = 5;
27213
+ _context52.next = 5;
27581
27214
  return mintUnitViaFlatMoney(this, depositAmount, slippage, maxKeeperFeeInUsd, options, estimateGas);
27582
27215
 
27583
27216
  case 5:
27584
- tx = _context51.sent;
27585
- return _context51.abrupt("return", tx);
27217
+ tx = _context52.sent;
27218
+ return _context52.abrupt("return", tx);
27586
27219
 
27587
27220
  case 7:
27588
27221
  case "end":
27589
- return _context51.stop();
27222
+ return _context52.stop();
27590
27223
  }
27591
27224
  }
27592
- }, _callee51, this);
27225
+ }, _callee52, this);
27593
27226
  }));
27594
27227
 
27595
- function mintUnitViaFlatMoney$1(_x248, _x249, _x250, _x251, _x252) {
27228
+ function mintUnitViaFlatMoney$1(_x251, _x252, _x253, _x254, _x255) {
27596
27229
  return _mintUnitViaFlatMoney2.apply(this, arguments);
27597
27230
  }
27598
27231
 
@@ -27612,11 +27245,11 @@ var Pool = /*#__PURE__*/function () {
27612
27245
  _proto.redeemUnitViaFlatMoney =
27613
27246
  /*#__PURE__*/
27614
27247
  function () {
27615
- var _redeemUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee52(withdrawAmount, slippage, maxKeeperFeeInUsd, options, estimateGas) {
27248
+ var _redeemUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee53(withdrawAmount, slippage, maxKeeperFeeInUsd, options, estimateGas) {
27616
27249
  var tx;
27617
- return runtime_1.wrap(function _callee52$(_context52) {
27250
+ return runtime_1.wrap(function _callee53$(_context53) {
27618
27251
  while (1) {
27619
- switch (_context52.prev = _context52.next) {
27252
+ switch (_context53.prev = _context53.next) {
27620
27253
  case 0:
27621
27254
  if (slippage === void 0) {
27622
27255
  slippage = 0.5;
@@ -27630,22 +27263,22 @@ var Pool = /*#__PURE__*/function () {
27630
27263
  estimateGas = false;
27631
27264
  }
27632
27265
 
27633
- _context52.next = 5;
27266
+ _context53.next = 5;
27634
27267
  return redeemUnitViaFlatMoney(this, withdrawAmount, slippage, maxKeeperFeeInUsd, options, estimateGas);
27635
27268
 
27636
27269
  case 5:
27637
- tx = _context52.sent;
27638
- return _context52.abrupt("return", tx);
27270
+ tx = _context53.sent;
27271
+ return _context53.abrupt("return", tx);
27639
27272
 
27640
27273
  case 7:
27641
27274
  case "end":
27642
- return _context52.stop();
27275
+ return _context53.stop();
27643
27276
  }
27644
27277
  }
27645
- }, _callee52, this);
27278
+ }, _callee53, this);
27646
27279
  }));
27647
27280
 
27648
- function redeemUnitViaFlatMoney$1(_x253, _x254, _x255, _x256, _x257) {
27281
+ function redeemUnitViaFlatMoney$1(_x256, _x257, _x258, _x259, _x260) {
27649
27282
  return _redeemUnitViaFlatMoney2.apply(this, arguments);
27650
27283
  }
27651
27284
 
@@ -27653,11 +27286,11 @@ var Pool = /*#__PURE__*/function () {
27653
27286
  }();
27654
27287
 
27655
27288
  _proto.cancelOrderViaFlatMoney = /*#__PURE__*/function () {
27656
- var _cancelOrderViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee53(options, estimateGas) {
27289
+ var _cancelOrderViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee54(options, estimateGas) {
27657
27290
  var tx;
27658
- return runtime_1.wrap(function _callee53$(_context53) {
27291
+ return runtime_1.wrap(function _callee54$(_context54) {
27659
27292
  while (1) {
27660
- switch (_context53.prev = _context53.next) {
27293
+ switch (_context54.prev = _context54.next) {
27661
27294
  case 0:
27662
27295
  if (options === void 0) {
27663
27296
  options = null;
@@ -27667,32 +27300,89 @@ var Pool = /*#__PURE__*/function () {
27667
27300
  estimateGas = false;
27668
27301
  }
27669
27302
 
27670
- _context53.next = 4;
27303
+ _context54.next = 4;
27671
27304
  return cancelOrderViaFlatMoney(this, options, estimateGas);
27672
27305
 
27673
27306
  case 4:
27674
- tx = _context53.sent;
27675
- return _context53.abrupt("return", tx);
27307
+ tx = _context54.sent;
27308
+ return _context54.abrupt("return", tx);
27676
27309
 
27677
27310
  case 6:
27678
27311
  case "end":
27679
- return _context53.stop();
27312
+ return _context54.stop();
27680
27313
  }
27681
27314
  }
27682
- }, _callee53, this);
27315
+ }, _callee54, this);
27683
27316
  }));
27684
27317
 
27685
- function cancelOrderViaFlatMoney$1(_x258, _x259) {
27318
+ function cancelOrderViaFlatMoney$1(_x261, _x262) {
27686
27319
  return _cancelOrderViaFlatMoney2.apply(this, arguments);
27687
27320
  }
27688
27321
 
27689
27322
  return cancelOrderViaFlatMoney$1;
27323
+ }()
27324
+ /**
27325
+ * Complete a Toros withdrawal to a single asset
27326
+ * @param {string} destinationToken Address of destination asset
27327
+ * @param {number} slippage Slippage tolerance in %
27328
+ * @param {any} options Transaction options
27329
+ * @param {boolean} estimateGas Simulate/estimate gas
27330
+ * @returns {Promise<any>} Transaction
27331
+ */
27332
+ ;
27333
+
27334
+ _proto.completeTorosWithdrawal =
27335
+ /*#__PURE__*/
27336
+ function () {
27337
+ var _completeTorosWithdrawal = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee55(destinationToken, slippage, options, estimateGas) {
27338
+ var txData, tx;
27339
+ return runtime_1.wrap(function _callee55$(_context55) {
27340
+ while (1) {
27341
+ switch (_context55.prev = _context55.next) {
27342
+ case 0:
27343
+ if (slippage === void 0) {
27344
+ slippage = 0.5;
27345
+ }
27346
+
27347
+ if (options === void 0) {
27348
+ options = null;
27349
+ }
27350
+
27351
+ if (estimateGas === void 0) {
27352
+ estimateGas = false;
27353
+ }
27354
+
27355
+ _context55.next = 5;
27356
+ return getCompleteWithdrawalTxData(this, destinationToken, slippage);
27357
+
27358
+ case 5:
27359
+ txData = _context55.sent;
27360
+ _context55.next = 8;
27361
+ return getPoolTxOrGasEstimate(this, [routerAddress[this.network].toros, txData, options], estimateGas);
27362
+
27363
+ case 8:
27364
+ tx = _context55.sent;
27365
+ return _context55.abrupt("return", tx);
27366
+
27367
+ case 10:
27368
+ case "end":
27369
+ return _context55.stop();
27370
+ }
27371
+ }
27372
+ }, _callee55, this);
27373
+ }));
27374
+
27375
+ function completeTorosWithdrawal(_x263, _x264, _x265, _x266) {
27376
+ return _completeTorosWithdrawal.apply(this, arguments);
27377
+ }
27378
+
27379
+ return completeTorosWithdrawal;
27690
27380
  }();
27691
27381
 
27692
27382
  return Pool;
27693
27383
  }();
27694
27384
 
27695
- var abi$u = [
27385
+ var abi$r = [
27696
27386
  {
27697
27387
  inputs: [
27698
27388
  {
@@ -27916,10 +27606,10 @@ var abi$u = [
27916
27606
  }
27917
27607
  ];
27918
27608
  var UniswapV2Factory = {
27919
- abi: abi$u
27609
+ abi: abi$r
27920
27610
  };
27921
27611
 
27922
- var abi$v = [
27612
+ var abi$s = [
27923
27613
  {
27924
27614
  anonymous: false,
27925
27615
  inputs: [
@@ -28663,7 +28353,7 @@ var evm = {
28663
28353
  }
28664
28354
  };
28665
28355
  var UniswapV2Pair = {
28666
- abi: abi$v,
28356
+ abi: abi$s,
28667
28357
  evm: evm,
28668
28358
  "interface": [
28669
28359
  {
@@ -29394,7 +29084,7 @@ var UniswapV2Pair = {
29394
29084
  ]
29395
29085
  };
29396
29086
 
29397
- var abi$w = [
29087
+ var abi$t = [
29398
29088
  {
29399
29089
  inputs: [
29400
29090
  {
@@ -30589,7 +30279,7 @@ var abi$w = [
30589
30279
  }
30590
30280
  ];
30591
30281
  var IBalancerV2Vault = {
30592
- abi: abi$w
30282
+ abi: abi$t
30593
30283
  };
30594
30284
 
30595
30285
  var Utils = /*#__PURE__*/function () {