@dhedge/v2-sdk 1.10.4 → 1.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/dist/entities/pool.d.ts +21 -2
- package/dist/services/oneInch/index.d.ts +4 -1
- package/dist/services/ramses/vesting.d.ts +1 -0
- package/dist/services/toros/easySwapper.d.ts +2 -1
- package/dist/services/uniswap/V3Liquidity.d.ts +2 -2
- package/dist/test/constants.d.ts +7 -0
- package/dist/test/utils/testingHelper.d.ts +0 -1
- package/dist/types.d.ts +2 -1
- package/dist/v2-sdk.cjs.development.js +1748 -1988
- package/dist/v2-sdk.cjs.development.js.map +1 -1
- package/dist/v2-sdk.cjs.production.min.js +1 -1
- package/dist/v2-sdk.cjs.production.min.js.map +1 -1
- package/dist/v2-sdk.esm.js +1748 -1988
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/IDhedgeEasySwapper.json +184 -303
- package/src/abi/IRamsesNonfungiblePositionManager.json +486 -0
- package/src/config.ts +8 -5
- package/src/entities/pool.ts +68 -6
- package/src/services/oneInch/index.ts +9 -6
- package/src/services/ramses/vesting.ts +11 -0
- package/src/services/toros/easySwapper.ts +64 -22
- package/src/services/uniswap/V3Liquidity.ts +14 -4
- package/src/test/constants.ts +12 -5
- package/src/test/ramsesCL.test.ts +155 -0
- package/src/test/toros.test.ts +81 -53
- package/src/test/utils/testingHelper.ts +3 -2
- package/src/types.ts +2 -1
package/dist/v2-sdk.esm.js
CHANGED
|
@@ -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
|
}
|
|
@@ -4217,6 +4255,7 @@ var Dapp;
|
|
|
4217
4255
|
Dapp["RAMSES"] = "ramses";
|
|
4218
4256
|
Dapp["AERODROME"] = "aerodrome";
|
|
4219
4257
|
Dapp["AERODROMECL"] = "aerodromeCL";
|
|
4258
|
+
Dapp["RAMSESCL"] = "ramsesCL";
|
|
4220
4259
|
})(Dapp || (Dapp = {}));
|
|
4221
4260
|
|
|
4222
4261
|
var Transaction;
|
|
@@ -4248,11 +4287,11 @@ var _factoryAddress, _Network$POLYGON, _Network$OPTIMISM, _Network$ARBITRUM, _Ne
|
|
|
4248
4287
|
require("dotenv").config();
|
|
4249
4288
|
|
|
4250
4289
|
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);
|
|
4251
|
-
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] = "
|
|
4290
|
+
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);
|
|
4252
4291
|
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);
|
|
4253
4292
|
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);
|
|
4254
4293
|
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);
|
|
4255
|
-
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), _nonfungiblePositionM[Network.BASE] = (_Network$BASE3 = {}, _Network$BASE3[Dapp.UNISWAPV3] = "0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1", _Network$BASE3[Dapp.AERODROMECL] = "0x827922686190790b37229fd06084350e74485b72", _Network$BASE3), _nonfungiblePositionM);
|
|
4294
|
+
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);
|
|
4256
4295
|
var networkChainIdMap = (_networkChainIdMap = {}, _networkChainIdMap[Network.POLYGON] = 137, _networkChainIdMap[Network.OPTIMISM] = 10, _networkChainIdMap[Network.ARBITRUM] = 42161, _networkChainIdMap[Network.BASE] = 8453, _networkChainIdMap);
|
|
4257
4296
|
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);
|
|
4258
4297
|
var multiCallAddress = (_multiCallAddress = {}, _multiCallAddress[Network.POLYGON] = "0x275617327c958bD06b5D6b871E7f491D76113dd8", _multiCallAddress[Network.OPTIMISM] = "", _multiCallAddress[Network.ARBITRUM] = "", _multiCallAddress[Network.BASE] = "", _multiCallAddress);
|
|
@@ -8644,95 +8683,196 @@ var IVeldodromePositionManager = {
|
|
|
8644
8683
|
abi: abi$d
|
|
8645
8684
|
};
|
|
8646
8685
|
|
|
8647
|
-
var
|
|
8686
|
+
var IRamsesNonfungiblePositionManager = [
|
|
8648
8687
|
{
|
|
8688
|
+
anonymous: false,
|
|
8649
8689
|
inputs: [
|
|
8650
8690
|
{
|
|
8691
|
+
indexed: true,
|
|
8692
|
+
internalType: "uint256",
|
|
8693
|
+
name: "tokenId",
|
|
8694
|
+
type: "uint256"
|
|
8695
|
+
},
|
|
8696
|
+
{
|
|
8697
|
+
indexed: false,
|
|
8651
8698
|
internalType: "address",
|
|
8652
|
-
name: "
|
|
8699
|
+
name: "recipient",
|
|
8653
8700
|
type: "address"
|
|
8654
8701
|
},
|
|
8655
8702
|
{
|
|
8703
|
+
indexed: false,
|
|
8656
8704
|
internalType: "uint256",
|
|
8657
|
-
name: "
|
|
8705
|
+
name: "amount0",
|
|
8658
8706
|
type: "uint256"
|
|
8659
8707
|
},
|
|
8660
8708
|
{
|
|
8709
|
+
indexed: false,
|
|
8661
8710
|
internalType: "uint256",
|
|
8662
|
-
name: "
|
|
8711
|
+
name: "amount1",
|
|
8663
8712
|
type: "uint256"
|
|
8664
|
-
}
|
|
8713
|
+
}
|
|
8714
|
+
],
|
|
8715
|
+
name: "Collect",
|
|
8716
|
+
type: "event"
|
|
8717
|
+
},
|
|
8718
|
+
{
|
|
8719
|
+
anonymous: false,
|
|
8720
|
+
inputs: [
|
|
8665
8721
|
{
|
|
8722
|
+
indexed: true,
|
|
8666
8723
|
internalType: "uint256",
|
|
8667
|
-
name: "
|
|
8724
|
+
name: "tokenId",
|
|
8668
8725
|
type: "uint256"
|
|
8669
8726
|
},
|
|
8670
8727
|
{
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8728
|
+
indexed: false,
|
|
8729
|
+
internalType: "uint128",
|
|
8730
|
+
name: "liquidity",
|
|
8731
|
+
type: "uint128"
|
|
8674
8732
|
},
|
|
8675
8733
|
{
|
|
8734
|
+
indexed: false,
|
|
8676
8735
|
internalType: "uint256",
|
|
8677
|
-
name: "
|
|
8736
|
+
name: "amount0",
|
|
8678
8737
|
type: "uint256"
|
|
8679
8738
|
},
|
|
8680
8739
|
{
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
8740
|
+
indexed: false,
|
|
8741
|
+
internalType: "uint256",
|
|
8742
|
+
name: "amount1",
|
|
8743
|
+
type: "uint256"
|
|
8684
8744
|
}
|
|
8685
8745
|
],
|
|
8686
|
-
name: "
|
|
8687
|
-
|
|
8746
|
+
name: "DecreaseLiquidity",
|
|
8747
|
+
type: "event"
|
|
8748
|
+
},
|
|
8749
|
+
{
|
|
8750
|
+
anonymous: false,
|
|
8751
|
+
inputs: [
|
|
8688
8752
|
{
|
|
8753
|
+
indexed: true,
|
|
8689
8754
|
internalType: "uint256",
|
|
8690
|
-
name: "
|
|
8755
|
+
name: "tokenId",
|
|
8691
8756
|
type: "uint256"
|
|
8692
8757
|
},
|
|
8693
8758
|
{
|
|
8759
|
+
indexed: false,
|
|
8760
|
+
internalType: "uint128",
|
|
8761
|
+
name: "liquidity",
|
|
8762
|
+
type: "uint128"
|
|
8763
|
+
},
|
|
8764
|
+
{
|
|
8765
|
+
indexed: false,
|
|
8694
8766
|
internalType: "uint256",
|
|
8695
|
-
name: "
|
|
8767
|
+
name: "amount0",
|
|
8696
8768
|
type: "uint256"
|
|
8697
8769
|
},
|
|
8698
8770
|
{
|
|
8771
|
+
indexed: false,
|
|
8699
8772
|
internalType: "uint256",
|
|
8700
|
-
name: "
|
|
8773
|
+
name: "amount1",
|
|
8701
8774
|
type: "uint256"
|
|
8702
8775
|
}
|
|
8703
8776
|
],
|
|
8704
|
-
|
|
8705
|
-
type: "
|
|
8777
|
+
name: "IncreaseLiquidity",
|
|
8778
|
+
type: "event"
|
|
8706
8779
|
},
|
|
8707
8780
|
{
|
|
8708
8781
|
inputs: [
|
|
8709
|
-
{
|
|
8710
|
-
internalType: "address",
|
|
8711
|
-
name: "gauge",
|
|
8712
|
-
type: "address"
|
|
8713
|
-
},
|
|
8714
8782
|
{
|
|
8715
8783
|
internalType: "uint256",
|
|
8716
|
-
name: "
|
|
8784
|
+
name: "tokenId",
|
|
8717
8785
|
type: "uint256"
|
|
8718
|
-
}
|
|
8786
|
+
}
|
|
8787
|
+
],
|
|
8788
|
+
name: "burn",
|
|
8789
|
+
outputs: [
|
|
8790
|
+
],
|
|
8791
|
+
stateMutability: "payable",
|
|
8792
|
+
type: "function"
|
|
8793
|
+
},
|
|
8794
|
+
{
|
|
8795
|
+
inputs: [
|
|
8796
|
+
{
|
|
8797
|
+
components: [
|
|
8798
|
+
{
|
|
8799
|
+
internalType: "uint256",
|
|
8800
|
+
name: "tokenId",
|
|
8801
|
+
type: "uint256"
|
|
8802
|
+
},
|
|
8803
|
+
{
|
|
8804
|
+
internalType: "address",
|
|
8805
|
+
name: "recipient",
|
|
8806
|
+
type: "address"
|
|
8807
|
+
},
|
|
8808
|
+
{
|
|
8809
|
+
internalType: "uint128",
|
|
8810
|
+
name: "amount0Max",
|
|
8811
|
+
type: "uint128"
|
|
8812
|
+
},
|
|
8813
|
+
{
|
|
8814
|
+
internalType: "uint128",
|
|
8815
|
+
name: "amount1Max",
|
|
8816
|
+
type: "uint128"
|
|
8817
|
+
}
|
|
8818
|
+
],
|
|
8819
|
+
internalType: "struct IRamsesNonfungiblePositionManager.CollectParams",
|
|
8820
|
+
name: "params",
|
|
8821
|
+
type: "tuple"
|
|
8822
|
+
}
|
|
8823
|
+
],
|
|
8824
|
+
name: "collect",
|
|
8825
|
+
outputs: [
|
|
8719
8826
|
{
|
|
8720
8827
|
internalType: "uint256",
|
|
8721
|
-
name: "
|
|
8828
|
+
name: "amount0",
|
|
8722
8829
|
type: "uint256"
|
|
8723
8830
|
},
|
|
8724
8831
|
{
|
|
8725
8832
|
internalType: "uint256",
|
|
8726
|
-
name: "
|
|
8833
|
+
name: "amount1",
|
|
8727
8834
|
type: "uint256"
|
|
8728
|
-
}
|
|
8835
|
+
}
|
|
8836
|
+
],
|
|
8837
|
+
stateMutability: "payable",
|
|
8838
|
+
type: "function"
|
|
8839
|
+
},
|
|
8840
|
+
{
|
|
8841
|
+
inputs: [
|
|
8729
8842
|
{
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8843
|
+
components: [
|
|
8844
|
+
{
|
|
8845
|
+
internalType: "uint256",
|
|
8846
|
+
name: "tokenId",
|
|
8847
|
+
type: "uint256"
|
|
8848
|
+
},
|
|
8849
|
+
{
|
|
8850
|
+
internalType: "uint128",
|
|
8851
|
+
name: "liquidity",
|
|
8852
|
+
type: "uint128"
|
|
8853
|
+
},
|
|
8854
|
+
{
|
|
8855
|
+
internalType: "uint256",
|
|
8856
|
+
name: "amount0Min",
|
|
8857
|
+
type: "uint256"
|
|
8858
|
+
},
|
|
8859
|
+
{
|
|
8860
|
+
internalType: "uint256",
|
|
8861
|
+
name: "amount1Min",
|
|
8862
|
+
type: "uint256"
|
|
8863
|
+
},
|
|
8864
|
+
{
|
|
8865
|
+
internalType: "uint256",
|
|
8866
|
+
name: "deadline",
|
|
8867
|
+
type: "uint256"
|
|
8868
|
+
}
|
|
8869
|
+
],
|
|
8870
|
+
internalType: "struct IRamsesNonfungiblePositionManager.DecreaseLiquidityParams",
|
|
8871
|
+
name: "params",
|
|
8872
|
+
type: "tuple"
|
|
8733
8873
|
}
|
|
8734
8874
|
],
|
|
8735
|
-
name: "
|
|
8875
|
+
name: "decreaseLiquidity",
|
|
8736
8876
|
outputs: [
|
|
8737
8877
|
{
|
|
8738
8878
|
internalType: "uint256",
|
|
@@ -8743,62 +8883,451 @@ var abi$e = [
|
|
|
8743
8883
|
internalType: "uint256",
|
|
8744
8884
|
name: "amount1",
|
|
8745
8885
|
type: "uint256"
|
|
8886
|
+
}
|
|
8887
|
+
],
|
|
8888
|
+
stateMutability: "payable",
|
|
8889
|
+
type: "function"
|
|
8890
|
+
},
|
|
8891
|
+
{
|
|
8892
|
+
inputs: [
|
|
8893
|
+
],
|
|
8894
|
+
name: "factory",
|
|
8895
|
+
outputs: [
|
|
8896
|
+
{
|
|
8897
|
+
internalType: "address",
|
|
8898
|
+
name: "",
|
|
8899
|
+
type: "address"
|
|
8900
|
+
}
|
|
8901
|
+
],
|
|
8902
|
+
stateMutability: "view",
|
|
8903
|
+
type: "function"
|
|
8904
|
+
},
|
|
8905
|
+
{
|
|
8906
|
+
inputs: [
|
|
8907
|
+
{
|
|
8908
|
+
internalType: "uint256",
|
|
8909
|
+
name: "tokenId",
|
|
8910
|
+
type: "uint256"
|
|
8746
8911
|
},
|
|
8747
8912
|
{
|
|
8748
|
-
internalType: "
|
|
8749
|
-
name: "
|
|
8750
|
-
type: "
|
|
8913
|
+
internalType: "address[]",
|
|
8914
|
+
name: "tokens",
|
|
8915
|
+
type: "address[]"
|
|
8751
8916
|
}
|
|
8752
8917
|
],
|
|
8918
|
+
name: "getReward",
|
|
8919
|
+
outputs: [
|
|
8920
|
+
],
|
|
8753
8921
|
stateMutability: "nonpayable",
|
|
8754
8922
|
type: "function"
|
|
8755
|
-
}
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
|
|
8784
|
-
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8923
|
+
},
|
|
8924
|
+
{
|
|
8925
|
+
inputs: [
|
|
8926
|
+
{
|
|
8927
|
+
components: [
|
|
8928
|
+
{
|
|
8929
|
+
internalType: "uint256",
|
|
8930
|
+
name: "tokenId",
|
|
8931
|
+
type: "uint256"
|
|
8932
|
+
},
|
|
8933
|
+
{
|
|
8934
|
+
internalType: "uint256",
|
|
8935
|
+
name: "amount0Desired",
|
|
8936
|
+
type: "uint256"
|
|
8937
|
+
},
|
|
8938
|
+
{
|
|
8939
|
+
internalType: "uint256",
|
|
8940
|
+
name: "amount1Desired",
|
|
8941
|
+
type: "uint256"
|
|
8942
|
+
},
|
|
8943
|
+
{
|
|
8944
|
+
internalType: "uint256",
|
|
8945
|
+
name: "amount0Min",
|
|
8946
|
+
type: "uint256"
|
|
8947
|
+
},
|
|
8948
|
+
{
|
|
8949
|
+
internalType: "uint256",
|
|
8950
|
+
name: "amount1Min",
|
|
8951
|
+
type: "uint256"
|
|
8952
|
+
},
|
|
8953
|
+
{
|
|
8954
|
+
internalType: "uint256",
|
|
8955
|
+
name: "deadline",
|
|
8956
|
+
type: "uint256"
|
|
8957
|
+
}
|
|
8958
|
+
],
|
|
8959
|
+
internalType: "struct IRamsesNonfungiblePositionManager.IncreaseLiquidityParams",
|
|
8960
|
+
name: "params",
|
|
8961
|
+
type: "tuple"
|
|
8962
|
+
}
|
|
8963
|
+
],
|
|
8964
|
+
name: "increaseLiquidity",
|
|
8965
|
+
outputs: [
|
|
8966
|
+
{
|
|
8967
|
+
internalType: "uint128",
|
|
8968
|
+
name: "liquidity",
|
|
8969
|
+
type: "uint128"
|
|
8970
|
+
},
|
|
8971
|
+
{
|
|
8972
|
+
internalType: "uint256",
|
|
8973
|
+
name: "amount0",
|
|
8974
|
+
type: "uint256"
|
|
8975
|
+
},
|
|
8976
|
+
{
|
|
8977
|
+
internalType: "uint256",
|
|
8978
|
+
name: "amount1",
|
|
8979
|
+
type: "uint256"
|
|
8980
|
+
}
|
|
8981
|
+
],
|
|
8982
|
+
stateMutability: "payable",
|
|
8983
|
+
type: "function"
|
|
8984
|
+
},
|
|
8985
|
+
{
|
|
8986
|
+
inputs: [
|
|
8987
|
+
{
|
|
8988
|
+
components: [
|
|
8989
|
+
{
|
|
8990
|
+
internalType: "address",
|
|
8991
|
+
name: "token0",
|
|
8992
|
+
type: "address"
|
|
8993
|
+
},
|
|
8994
|
+
{
|
|
8995
|
+
internalType: "address",
|
|
8996
|
+
name: "token1",
|
|
8997
|
+
type: "address"
|
|
8998
|
+
},
|
|
8999
|
+
{
|
|
9000
|
+
internalType: "uint24",
|
|
9001
|
+
name: "fee",
|
|
9002
|
+
type: "uint24"
|
|
9003
|
+
},
|
|
9004
|
+
{
|
|
9005
|
+
internalType: "int24",
|
|
9006
|
+
name: "tickLower",
|
|
9007
|
+
type: "int24"
|
|
9008
|
+
},
|
|
9009
|
+
{
|
|
9010
|
+
internalType: "int24",
|
|
9011
|
+
name: "tickUpper",
|
|
9012
|
+
type: "int24"
|
|
9013
|
+
},
|
|
9014
|
+
{
|
|
9015
|
+
internalType: "uint256",
|
|
9016
|
+
name: "amount0Desired",
|
|
9017
|
+
type: "uint256"
|
|
9018
|
+
},
|
|
9019
|
+
{
|
|
9020
|
+
internalType: "uint256",
|
|
9021
|
+
name: "amount1Desired",
|
|
9022
|
+
type: "uint256"
|
|
9023
|
+
},
|
|
9024
|
+
{
|
|
9025
|
+
internalType: "uint256",
|
|
9026
|
+
name: "amount0Min",
|
|
9027
|
+
type: "uint256"
|
|
9028
|
+
},
|
|
9029
|
+
{
|
|
9030
|
+
internalType: "uint256",
|
|
9031
|
+
name: "amount1Min",
|
|
9032
|
+
type: "uint256"
|
|
9033
|
+
},
|
|
9034
|
+
{
|
|
9035
|
+
internalType: "address",
|
|
9036
|
+
name: "recipient",
|
|
9037
|
+
type: "address"
|
|
9038
|
+
},
|
|
9039
|
+
{
|
|
9040
|
+
internalType: "uint256",
|
|
9041
|
+
name: "deadline",
|
|
9042
|
+
type: "uint256"
|
|
9043
|
+
},
|
|
9044
|
+
{
|
|
9045
|
+
internalType: "uint256",
|
|
9046
|
+
name: "veRamTokenId",
|
|
9047
|
+
type: "uint256"
|
|
9048
|
+
}
|
|
9049
|
+
],
|
|
9050
|
+
internalType: "struct IRamsesNonfungiblePositionManager.MintParams",
|
|
9051
|
+
name: "params",
|
|
9052
|
+
type: "tuple"
|
|
9053
|
+
}
|
|
9054
|
+
],
|
|
9055
|
+
name: "mint",
|
|
9056
|
+
outputs: [
|
|
9057
|
+
{
|
|
9058
|
+
internalType: "uint256",
|
|
9059
|
+
name: "tokenId",
|
|
9060
|
+
type: "uint256"
|
|
9061
|
+
},
|
|
9062
|
+
{
|
|
9063
|
+
internalType: "uint128",
|
|
9064
|
+
name: "liquidity",
|
|
9065
|
+
type: "uint128"
|
|
9066
|
+
},
|
|
9067
|
+
{
|
|
9068
|
+
internalType: "uint256",
|
|
9069
|
+
name: "amount0",
|
|
9070
|
+
type: "uint256"
|
|
9071
|
+
},
|
|
9072
|
+
{
|
|
9073
|
+
internalType: "uint256",
|
|
9074
|
+
name: "amount1",
|
|
9075
|
+
type: "uint256"
|
|
9076
|
+
}
|
|
9077
|
+
],
|
|
9078
|
+
stateMutability: "payable",
|
|
9079
|
+
type: "function"
|
|
9080
|
+
},
|
|
9081
|
+
{
|
|
9082
|
+
inputs: [
|
|
9083
|
+
{
|
|
9084
|
+
internalType: "uint256",
|
|
9085
|
+
name: "tokenId",
|
|
9086
|
+
type: "uint256"
|
|
9087
|
+
}
|
|
9088
|
+
],
|
|
9089
|
+
name: "positions",
|
|
9090
|
+
outputs: [
|
|
9091
|
+
{
|
|
9092
|
+
internalType: "uint96",
|
|
9093
|
+
name: "nonce",
|
|
9094
|
+
type: "uint96"
|
|
9095
|
+
},
|
|
9096
|
+
{
|
|
9097
|
+
internalType: "address",
|
|
9098
|
+
name: "operator",
|
|
9099
|
+
type: "address"
|
|
9100
|
+
},
|
|
9101
|
+
{
|
|
9102
|
+
internalType: "address",
|
|
9103
|
+
name: "token0",
|
|
9104
|
+
type: "address"
|
|
9105
|
+
},
|
|
9106
|
+
{
|
|
9107
|
+
internalType: "address",
|
|
9108
|
+
name: "token1",
|
|
9109
|
+
type: "address"
|
|
9110
|
+
},
|
|
9111
|
+
{
|
|
9112
|
+
internalType: "uint24",
|
|
9113
|
+
name: "fee",
|
|
9114
|
+
type: "uint24"
|
|
9115
|
+
},
|
|
9116
|
+
{
|
|
9117
|
+
internalType: "int24",
|
|
9118
|
+
name: "tickLower",
|
|
9119
|
+
type: "int24"
|
|
9120
|
+
},
|
|
9121
|
+
{
|
|
9122
|
+
internalType: "int24",
|
|
9123
|
+
name: "tickUpper",
|
|
9124
|
+
type: "int24"
|
|
9125
|
+
},
|
|
9126
|
+
{
|
|
9127
|
+
internalType: "uint128",
|
|
9128
|
+
name: "liquidity",
|
|
9129
|
+
type: "uint128"
|
|
9130
|
+
},
|
|
9131
|
+
{
|
|
9132
|
+
internalType: "uint256",
|
|
9133
|
+
name: "feeGrowthInside0LastX128",
|
|
9134
|
+
type: "uint256"
|
|
9135
|
+
},
|
|
9136
|
+
{
|
|
9137
|
+
internalType: "uint256",
|
|
9138
|
+
name: "feeGrowthInside1LastX128",
|
|
9139
|
+
type: "uint256"
|
|
9140
|
+
},
|
|
9141
|
+
{
|
|
9142
|
+
internalType: "uint128",
|
|
9143
|
+
name: "tokensOwed0",
|
|
9144
|
+
type: "uint128"
|
|
9145
|
+
},
|
|
9146
|
+
{
|
|
9147
|
+
internalType: "uint128",
|
|
9148
|
+
name: "tokensOwed1",
|
|
9149
|
+
type: "uint128"
|
|
9150
|
+
}
|
|
9151
|
+
],
|
|
9152
|
+
stateMutability: "view",
|
|
9153
|
+
type: "function"
|
|
9154
|
+
},
|
|
9155
|
+
{
|
|
9156
|
+
inputs: [
|
|
9157
|
+
{
|
|
9158
|
+
internalType: "address",
|
|
9159
|
+
name: "owner",
|
|
9160
|
+
type: "address"
|
|
9161
|
+
}
|
|
9162
|
+
],
|
|
9163
|
+
name: "balanceOf",
|
|
9164
|
+
outputs: [
|
|
9165
|
+
{
|
|
9166
|
+
internalType: "uint256",
|
|
9167
|
+
name: "",
|
|
9168
|
+
type: "uint256"
|
|
9169
|
+
}
|
|
9170
|
+
],
|
|
9171
|
+
stateMutability: "view",
|
|
9172
|
+
type: "function"
|
|
9173
|
+
}
|
|
9174
|
+
];
|
|
9175
|
+
|
|
9176
|
+
var abi$e = [
|
|
9177
|
+
{
|
|
9178
|
+
inputs: [
|
|
9179
|
+
{
|
|
9180
|
+
internalType: "address",
|
|
9181
|
+
name: "gauge",
|
|
9182
|
+
type: "address"
|
|
9183
|
+
},
|
|
9184
|
+
{
|
|
9185
|
+
internalType: "uint256",
|
|
9186
|
+
name: "amount0Max",
|
|
9187
|
+
type: "uint256"
|
|
9188
|
+
},
|
|
9189
|
+
{
|
|
9190
|
+
internalType: "uint256",
|
|
9191
|
+
name: "amount1Max",
|
|
9192
|
+
type: "uint256"
|
|
9193
|
+
},
|
|
9194
|
+
{
|
|
9195
|
+
internalType: "uint256",
|
|
9196
|
+
name: "amount0Min",
|
|
9197
|
+
type: "uint256"
|
|
9198
|
+
},
|
|
9199
|
+
{
|
|
9200
|
+
internalType: "uint256",
|
|
9201
|
+
name: "amount1Min",
|
|
9202
|
+
type: "uint256"
|
|
9203
|
+
},
|
|
9204
|
+
{
|
|
9205
|
+
internalType: "uint256",
|
|
9206
|
+
name: "amountSharesMin",
|
|
9207
|
+
type: "uint256"
|
|
9208
|
+
},
|
|
9209
|
+
{
|
|
9210
|
+
internalType: "address",
|
|
9211
|
+
name: "receiver",
|
|
9212
|
+
type: "address"
|
|
9213
|
+
}
|
|
9214
|
+
],
|
|
9215
|
+
name: "addLiquidityAndStake",
|
|
9216
|
+
outputs: [
|
|
9217
|
+
{
|
|
9218
|
+
internalType: "uint256",
|
|
9219
|
+
name: "amount0",
|
|
9220
|
+
type: "uint256"
|
|
9221
|
+
},
|
|
9222
|
+
{
|
|
9223
|
+
internalType: "uint256",
|
|
9224
|
+
name: "amount1",
|
|
9225
|
+
type: "uint256"
|
|
9226
|
+
},
|
|
9227
|
+
{
|
|
9228
|
+
internalType: "uint256",
|
|
9229
|
+
name: "mintAmount",
|
|
9230
|
+
type: "uint256"
|
|
9231
|
+
}
|
|
9232
|
+
],
|
|
9233
|
+
stateMutability: "nonpayable",
|
|
9234
|
+
type: "function"
|
|
9235
|
+
},
|
|
9236
|
+
{
|
|
9237
|
+
inputs: [
|
|
9238
|
+
{
|
|
9239
|
+
internalType: "address",
|
|
9240
|
+
name: "gauge",
|
|
9241
|
+
type: "address"
|
|
9242
|
+
},
|
|
9243
|
+
{
|
|
9244
|
+
internalType: "uint256",
|
|
9245
|
+
name: "burnAmount",
|
|
9246
|
+
type: "uint256"
|
|
9247
|
+
},
|
|
9248
|
+
{
|
|
9249
|
+
internalType: "uint256",
|
|
9250
|
+
name: "amount0Min",
|
|
9251
|
+
type: "uint256"
|
|
9252
|
+
},
|
|
9253
|
+
{
|
|
9254
|
+
internalType: "uint256",
|
|
9255
|
+
name: "amount1Min",
|
|
9256
|
+
type: "uint256"
|
|
9257
|
+
},
|
|
9258
|
+
{
|
|
9259
|
+
internalType: "address",
|
|
9260
|
+
name: "receiver",
|
|
9261
|
+
type: "address"
|
|
9262
|
+
}
|
|
9263
|
+
],
|
|
9264
|
+
name: "removeLiquidityAndUnstake",
|
|
9265
|
+
outputs: [
|
|
9266
|
+
{
|
|
9267
|
+
internalType: "uint256",
|
|
9268
|
+
name: "amount0",
|
|
9269
|
+
type: "uint256"
|
|
9270
|
+
},
|
|
9271
|
+
{
|
|
9272
|
+
internalType: "uint256",
|
|
9273
|
+
name: "amount1",
|
|
9274
|
+
type: "uint256"
|
|
9275
|
+
},
|
|
9276
|
+
{
|
|
9277
|
+
internalType: "uint128",
|
|
9278
|
+
name: "liquidityBurned",
|
|
9279
|
+
type: "uint128"
|
|
9280
|
+
}
|
|
9281
|
+
],
|
|
9282
|
+
stateMutability: "nonpayable",
|
|
9283
|
+
type: "function"
|
|
9284
|
+
}
|
|
9285
|
+
];
|
|
9286
|
+
var IArrakisV1RouterStaking = {
|
|
9287
|
+
abi: abi$e
|
|
9288
|
+
};
|
|
9289
|
+
|
|
9290
|
+
var getDeadline = /*#__PURE__*/function () {
|
|
9291
|
+
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool) {
|
|
9292
|
+
var timestamp;
|
|
9293
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
9294
|
+
while (1) {
|
|
9295
|
+
switch (_context.prev = _context.next) {
|
|
9296
|
+
case 0:
|
|
9297
|
+
_context.next = 2;
|
|
9298
|
+
return pool.signer.provider.getBlock("latest");
|
|
9299
|
+
|
|
9300
|
+
case 2:
|
|
9301
|
+
timestamp = _context.sent.timestamp;
|
|
9302
|
+
return _context.abrupt("return", timestamp + 60 * 20);
|
|
9303
|
+
|
|
9304
|
+
case 4:
|
|
9305
|
+
case "end":
|
|
9306
|
+
return _context.stop();
|
|
9307
|
+
}
|
|
9308
|
+
}
|
|
9309
|
+
}, _callee);
|
|
9310
|
+
}));
|
|
9311
|
+
|
|
9312
|
+
return function getDeadline(_x) {
|
|
9313
|
+
return _ref.apply(this, arguments);
|
|
9314
|
+
};
|
|
9315
|
+
}();
|
|
9316
|
+
|
|
9317
|
+
function tryParsePrice(baseToken, quoteToken, value) {
|
|
9318
|
+
var _fraction$length;
|
|
9319
|
+
|
|
9320
|
+
var _value$split = value.split("."),
|
|
9321
|
+
whole = _value$split[0],
|
|
9322
|
+
fraction = _value$split[1];
|
|
9323
|
+
|
|
9324
|
+
var decimals = (_fraction$length = fraction == null ? void 0 : fraction.length) != null ? _fraction$length : 0;
|
|
9325
|
+
var withoutDecimals = JSBI.BigInt((whole != null ? whole : "") + (fraction != null ? fraction : ""));
|
|
9326
|
+
return new Price(baseToken, quoteToken, JSBI.multiply(JSBI.BigInt(Math.pow(10, decimals)), JSBI.BigInt(Math.pow(10, baseToken.decimals))), JSBI.multiply(withoutDecimals, JSBI.BigInt(Math.pow(10, quoteToken.decimals))));
|
|
9327
|
+
}
|
|
9328
|
+
function tryParseTick(baseToken, quoteToken, feeAmount, value) {
|
|
9329
|
+
var price = tryParsePrice(baseToken, quoteToken, value);
|
|
9330
|
+
var tick; // check price is within min/max bounds, if outside return min/max
|
|
8802
9331
|
|
|
8803
9332
|
var sqrtRatioX96 = encodeSqrtRatioX96(price.numerator, price.denominator);
|
|
8804
9333
|
|
|
@@ -8870,9 +9399,14 @@ function _getUniswapV3MintTxData() {
|
|
|
8870
9399
|
mintParams.push(0);
|
|
8871
9400
|
}
|
|
8872
9401
|
|
|
9402
|
+
if (dapp === Dapp.RAMSESCL) {
|
|
9403
|
+
iNonfungiblePositionManager = new ethers.utils.Interface(IRamsesNonfungiblePositionManager);
|
|
9404
|
+
mintParams.push(0);
|
|
9405
|
+
}
|
|
9406
|
+
|
|
8873
9407
|
return _context.abrupt("return", iNonfungiblePositionManager.encodeFunctionData(Transaction.MINT, [mintParams]));
|
|
8874
9408
|
|
|
8875
|
-
case
|
|
9409
|
+
case 29:
|
|
8876
9410
|
case "end":
|
|
8877
9411
|
return _context.stop();
|
|
8878
9412
|
}
|
|
@@ -8924,7 +9458,7 @@ function _getIncreaseLiquidityTxData() {
|
|
|
8924
9458
|
while (1) {
|
|
8925
9459
|
switch (_context3.prev = _context3.next) {
|
|
8926
9460
|
case 0:
|
|
8927
|
-
if (!(dapp === Dapp.UNISWAPV3 || dapp === Dapp.VELODROMECL || dapp === Dapp.AERODROMECL)) {
|
|
9461
|
+
if (!(dapp === Dapp.UNISWAPV3 || dapp === Dapp.VELODROMECL || dapp === Dapp.AERODROMECL || dapp === Dapp.RAMSESCL)) {
|
|
8928
9462
|
_context3.next = 15;
|
|
8929
9463
|
break;
|
|
8930
9464
|
}
|
|
@@ -8989,7 +9523,7 @@ function _getDecreaseLiquidityTxData() {
|
|
|
8989
9523
|
amount = 100;
|
|
8990
9524
|
}
|
|
8991
9525
|
|
|
8992
|
-
if (!(dapp === Dapp.UNISWAPV3 || dapp === Dapp.VELODROMECL || dapp === Dapp.AERODROMECL)) {
|
|
9526
|
+
if (!(dapp === Dapp.UNISWAPV3 || dapp === Dapp.VELODROMECL || dapp === Dapp.AERODROMECL || dapp === Dapp.RAMSESCL)) {
|
|
8993
9527
|
_context4.next = 22;
|
|
8994
9528
|
break;
|
|
8995
9529
|
}
|
|
@@ -9026,1686 +9560,682 @@ function _getDecreaseLiquidityTxData() {
|
|
|
9026
9560
|
|
|
9027
9561
|
case 22:
|
|
9028
9562
|
if (!(dapp === Dapp.ARRAKIS)) {
|
|
9029
|
-
_context4.next = 32;
|
|
9030
|
-
break;
|
|
9031
|
-
}
|
|
9032
|
-
|
|
9033
|
-
_abi2 = new ethers.utils.Interface(IArrakisV1RouterStaking.abi);
|
|
9034
|
-
_context4.t7 = BigNumber;
|
|
9035
|
-
_context4.next = 27;
|
|
9036
|
-
return pool.utils.getBalance(tokenId, pool.address);
|
|
9037
|
-
|
|
9038
|
-
case 27:
|
|
9039
|
-
_context4.t8 = _context4.sent.toString();
|
|
9040
|
-
_liquidity = new _context4.t7(_context4.t8).times(amount).div(100);
|
|
9041
|
-
txData = _abi2.encodeFunctionData(Transaction.REMOVE_LIQUIDITY_UNSTAKE, [tokenId, _liquidity, 0, 0, pool.address]);
|
|
9042
|
-
_context4.next = 33;
|
|
9043
|
-
break;
|
|
9044
|
-
|
|
9045
|
-
case 32:
|
|
9046
|
-
throw new Error("dapp not supported");
|
|
9047
|
-
|
|
9048
|
-
case 33:
|
|
9049
|
-
return _context4.abrupt("return", txData);
|
|
9050
|
-
|
|
9051
|
-
case 34:
|
|
9052
|
-
case "end":
|
|
9053
|
-
return _context4.stop();
|
|
9054
|
-
}
|
|
9055
|
-
}
|
|
9056
|
-
}, _callee4);
|
|
9057
|
-
}));
|
|
9058
|
-
return _getDecreaseLiquidityTxData.apply(this, arguments);
|
|
9059
|
-
}
|
|
9060
|
-
|
|
9061
|
-
var abi$f = [
|
|
9062
|
-
{
|
|
9063
|
-
inputs: [
|
|
9064
|
-
{
|
|
9065
|
-
components: [
|
|
9066
|
-
{
|
|
9067
|
-
internalType: "bytes",
|
|
9068
|
-
name: "path",
|
|
9069
|
-
type: "bytes"
|
|
9070
|
-
},
|
|
9071
|
-
{
|
|
9072
|
-
internalType: "address",
|
|
9073
|
-
name: "recipient",
|
|
9074
|
-
type: "address"
|
|
9075
|
-
},
|
|
9076
|
-
{
|
|
9077
|
-
internalType: "uint256",
|
|
9078
|
-
name: "amountIn",
|
|
9079
|
-
type: "uint256"
|
|
9080
|
-
},
|
|
9081
|
-
{
|
|
9082
|
-
internalType: "uint256",
|
|
9083
|
-
name: "amountOutMinimum",
|
|
9084
|
-
type: "uint256"
|
|
9085
|
-
}
|
|
9086
|
-
],
|
|
9087
|
-
internalType: "struct ISwapRouter.ExactInputParams",
|
|
9088
|
-
name: "params",
|
|
9089
|
-
type: "tuple"
|
|
9090
|
-
}
|
|
9091
|
-
],
|
|
9092
|
-
name: "exactInput",
|
|
9093
|
-
outputs: [
|
|
9094
|
-
{
|
|
9095
|
-
internalType: "uint256",
|
|
9096
|
-
name: "amountOut",
|
|
9097
|
-
type: "uint256"
|
|
9098
|
-
}
|
|
9099
|
-
],
|
|
9100
|
-
stateMutability: "payable",
|
|
9101
|
-
type: "function"
|
|
9102
|
-
},
|
|
9103
|
-
{
|
|
9104
|
-
inputs: [
|
|
9105
|
-
{
|
|
9106
|
-
components: [
|
|
9107
|
-
{
|
|
9108
|
-
internalType: "address",
|
|
9109
|
-
name: "tokenIn",
|
|
9110
|
-
type: "address"
|
|
9111
|
-
},
|
|
9112
|
-
{
|
|
9113
|
-
internalType: "address",
|
|
9114
|
-
name: "tokenOut",
|
|
9115
|
-
type: "address"
|
|
9116
|
-
},
|
|
9117
|
-
{
|
|
9118
|
-
internalType: "uint24",
|
|
9119
|
-
name: "fee",
|
|
9120
|
-
type: "uint24"
|
|
9121
|
-
},
|
|
9122
|
-
{
|
|
9123
|
-
internalType: "address",
|
|
9124
|
-
name: "recipient",
|
|
9125
|
-
type: "address"
|
|
9126
|
-
},
|
|
9127
|
-
{
|
|
9128
|
-
internalType: "uint256",
|
|
9129
|
-
name: "amountIn",
|
|
9130
|
-
type: "uint256"
|
|
9131
|
-
},
|
|
9132
|
-
{
|
|
9133
|
-
internalType: "uint256",
|
|
9134
|
-
name: "amountOutMinimum",
|
|
9135
|
-
type: "uint256"
|
|
9136
|
-
},
|
|
9137
|
-
{
|
|
9138
|
-
internalType: "uint160",
|
|
9139
|
-
name: "sqrtPriceLimitX96",
|
|
9140
|
-
type: "uint160"
|
|
9141
|
-
}
|
|
9142
|
-
],
|
|
9143
|
-
internalType: "struct ISwapRouter.ExactInputSingleParams",
|
|
9144
|
-
name: "params",
|
|
9145
|
-
type: "tuple"
|
|
9146
|
-
}
|
|
9147
|
-
],
|
|
9148
|
-
name: "exactInputSingle",
|
|
9149
|
-
outputs: [
|
|
9150
|
-
{
|
|
9151
|
-
internalType: "uint256",
|
|
9152
|
-
name: "amountOut",
|
|
9153
|
-
type: "uint256"
|
|
9154
|
-
}
|
|
9155
|
-
],
|
|
9156
|
-
stateMutability: "payable",
|
|
9157
|
-
type: "function"
|
|
9158
|
-
},
|
|
9159
|
-
{
|
|
9160
|
-
inputs: [
|
|
9161
|
-
{
|
|
9162
|
-
components: [
|
|
9163
|
-
{
|
|
9164
|
-
internalType: "bytes",
|
|
9165
|
-
name: "path",
|
|
9166
|
-
type: "bytes"
|
|
9167
|
-
},
|
|
9168
|
-
{
|
|
9169
|
-
internalType: "address",
|
|
9170
|
-
name: "recipient",
|
|
9171
|
-
type: "address"
|
|
9172
|
-
},
|
|
9173
|
-
{
|
|
9174
|
-
internalType: "uint256",
|
|
9175
|
-
name: "amountOut",
|
|
9176
|
-
type: "uint256"
|
|
9177
|
-
},
|
|
9178
|
-
{
|
|
9179
|
-
internalType: "uint256",
|
|
9180
|
-
name: "amountInMaximum",
|
|
9181
|
-
type: "uint256"
|
|
9182
|
-
}
|
|
9183
|
-
],
|
|
9184
|
-
internalType: "struct ISwapRouter.ExactOutputParams",
|
|
9185
|
-
name: "params",
|
|
9186
|
-
type: "tuple"
|
|
9187
|
-
}
|
|
9188
|
-
],
|
|
9189
|
-
name: "exactOutput",
|
|
9190
|
-
outputs: [
|
|
9191
|
-
{
|
|
9192
|
-
internalType: "uint256",
|
|
9193
|
-
name: "amountIn",
|
|
9194
|
-
type: "uint256"
|
|
9195
|
-
}
|
|
9196
|
-
],
|
|
9197
|
-
stateMutability: "payable",
|
|
9198
|
-
type: "function"
|
|
9199
|
-
},
|
|
9200
|
-
{
|
|
9201
|
-
inputs: [
|
|
9202
|
-
{
|
|
9203
|
-
components: [
|
|
9204
|
-
{
|
|
9205
|
-
internalType: "address",
|
|
9206
|
-
name: "tokenIn",
|
|
9207
|
-
type: "address"
|
|
9208
|
-
},
|
|
9209
|
-
{
|
|
9210
|
-
internalType: "address",
|
|
9211
|
-
name: "tokenOut",
|
|
9212
|
-
type: "address"
|
|
9213
|
-
},
|
|
9214
|
-
{
|
|
9215
|
-
internalType: "uint24",
|
|
9216
|
-
name: "fee",
|
|
9217
|
-
type: "uint24"
|
|
9218
|
-
},
|
|
9219
|
-
{
|
|
9220
|
-
internalType: "address",
|
|
9221
|
-
name: "recipient",
|
|
9222
|
-
type: "address"
|
|
9223
|
-
},
|
|
9224
|
-
{
|
|
9225
|
-
internalType: "uint256",
|
|
9226
|
-
name: "amountOut",
|
|
9227
|
-
type: "uint256"
|
|
9228
|
-
},
|
|
9229
|
-
{
|
|
9230
|
-
internalType: "uint256",
|
|
9231
|
-
name: "amountInMaximum",
|
|
9232
|
-
type: "uint256"
|
|
9233
|
-
},
|
|
9234
|
-
{
|
|
9235
|
-
internalType: "uint160",
|
|
9236
|
-
name: "sqrtPriceLimitX96",
|
|
9237
|
-
type: "uint160"
|
|
9238
|
-
}
|
|
9239
|
-
],
|
|
9240
|
-
internalType: "struct ISwapRouter.ExactOutputSingleParams",
|
|
9241
|
-
name: "params",
|
|
9242
|
-
type: "tuple"
|
|
9243
|
-
}
|
|
9244
|
-
],
|
|
9245
|
-
name: "exactOutputSingle",
|
|
9246
|
-
outputs: [
|
|
9247
|
-
{
|
|
9248
|
-
internalType: "uint256",
|
|
9249
|
-
name: "amountIn",
|
|
9250
|
-
type: "uint256"
|
|
9251
|
-
}
|
|
9252
|
-
],
|
|
9253
|
-
stateMutability: "payable",
|
|
9254
|
-
type: "function"
|
|
9255
|
-
},
|
|
9256
|
-
{
|
|
9257
|
-
inputs: [
|
|
9258
|
-
{
|
|
9259
|
-
internalType: "int256",
|
|
9260
|
-
name: "amount0Delta",
|
|
9261
|
-
type: "int256"
|
|
9262
|
-
},
|
|
9263
|
-
{
|
|
9264
|
-
internalType: "int256",
|
|
9265
|
-
name: "amount1Delta",
|
|
9266
|
-
type: "int256"
|
|
9267
|
-
},
|
|
9268
|
-
{
|
|
9269
|
-
internalType: "bytes",
|
|
9270
|
-
name: "data",
|
|
9271
|
-
type: "bytes"
|
|
9272
|
-
}
|
|
9273
|
-
],
|
|
9274
|
-
name: "uniswapV3SwapCallback",
|
|
9275
|
-
outputs: [
|
|
9276
|
-
],
|
|
9277
|
-
stateMutability: "nonpayable",
|
|
9278
|
-
type: "function"
|
|
9279
|
-
}
|
|
9280
|
-
];
|
|
9281
|
-
var IUniswapV3Router = {
|
|
9282
|
-
abi: abi$f
|
|
9283
|
-
};
|
|
9284
|
-
|
|
9285
|
-
var abi$g = [
|
|
9286
|
-
{
|
|
9287
|
-
inputs: [
|
|
9288
|
-
{
|
|
9289
|
-
internalType: "address",
|
|
9290
|
-
name: "_factory",
|
|
9291
|
-
type: "address"
|
|
9292
|
-
},
|
|
9293
|
-
{
|
|
9294
|
-
internalType: "address",
|
|
9295
|
-
name: "_WETH9",
|
|
9296
|
-
type: "address"
|
|
9297
|
-
}
|
|
9298
|
-
],
|
|
9299
|
-
stateMutability: "nonpayable",
|
|
9300
|
-
type: "constructor"
|
|
9301
|
-
},
|
|
9302
|
-
{
|
|
9303
|
-
inputs: [
|
|
9304
|
-
],
|
|
9305
|
-
name: "WETH9",
|
|
9306
|
-
outputs: [
|
|
9307
|
-
{
|
|
9308
|
-
internalType: "address",
|
|
9309
|
-
name: "",
|
|
9310
|
-
type: "address"
|
|
9311
|
-
}
|
|
9312
|
-
],
|
|
9313
|
-
stateMutability: "view",
|
|
9314
|
-
type: "function"
|
|
9315
|
-
},
|
|
9316
|
-
{
|
|
9317
|
-
inputs: [
|
|
9318
|
-
],
|
|
9319
|
-
name: "factory",
|
|
9320
|
-
outputs: [
|
|
9321
|
-
{
|
|
9322
|
-
internalType: "address",
|
|
9323
|
-
name: "",
|
|
9324
|
-
type: "address"
|
|
9325
|
-
}
|
|
9326
|
-
],
|
|
9327
|
-
stateMutability: "view",
|
|
9328
|
-
type: "function"
|
|
9329
|
-
},
|
|
9330
|
-
{
|
|
9331
|
-
inputs: [
|
|
9332
|
-
{
|
|
9333
|
-
internalType: "bytes",
|
|
9334
|
-
name: "path",
|
|
9335
|
-
type: "bytes"
|
|
9336
|
-
},
|
|
9337
|
-
{
|
|
9338
|
-
internalType: "uint256",
|
|
9339
|
-
name: "amountIn",
|
|
9340
|
-
type: "uint256"
|
|
9341
|
-
}
|
|
9342
|
-
],
|
|
9343
|
-
name: "quoteExactInput",
|
|
9344
|
-
outputs: [
|
|
9345
|
-
{
|
|
9346
|
-
internalType: "uint256",
|
|
9347
|
-
name: "amountOut",
|
|
9348
|
-
type: "uint256"
|
|
9349
|
-
}
|
|
9350
|
-
],
|
|
9351
|
-
stateMutability: "nonpayable",
|
|
9352
|
-
type: "function"
|
|
9353
|
-
},
|
|
9354
|
-
{
|
|
9355
|
-
inputs: [
|
|
9356
|
-
{
|
|
9357
|
-
internalType: "address",
|
|
9358
|
-
name: "tokenIn",
|
|
9359
|
-
type: "address"
|
|
9360
|
-
},
|
|
9361
|
-
{
|
|
9362
|
-
internalType: "address",
|
|
9363
|
-
name: "tokenOut",
|
|
9364
|
-
type: "address"
|
|
9365
|
-
},
|
|
9366
|
-
{
|
|
9367
|
-
internalType: "uint24",
|
|
9368
|
-
name: "fee",
|
|
9369
|
-
type: "uint24"
|
|
9370
|
-
},
|
|
9371
|
-
{
|
|
9372
|
-
internalType: "uint256",
|
|
9373
|
-
name: "amountIn",
|
|
9374
|
-
type: "uint256"
|
|
9375
|
-
},
|
|
9376
|
-
{
|
|
9377
|
-
internalType: "uint160",
|
|
9378
|
-
name: "sqrtPriceLimitX96",
|
|
9379
|
-
type: "uint160"
|
|
9380
|
-
}
|
|
9381
|
-
],
|
|
9382
|
-
name: "quoteExactInputSingle",
|
|
9383
|
-
outputs: [
|
|
9384
|
-
{
|
|
9385
|
-
internalType: "uint256",
|
|
9386
|
-
name: "amountOut",
|
|
9387
|
-
type: "uint256"
|
|
9388
|
-
}
|
|
9389
|
-
],
|
|
9390
|
-
stateMutability: "nonpayable",
|
|
9391
|
-
type: "function"
|
|
9392
|
-
},
|
|
9393
|
-
{
|
|
9394
|
-
inputs: [
|
|
9395
|
-
{
|
|
9396
|
-
internalType: "bytes",
|
|
9397
|
-
name: "path",
|
|
9398
|
-
type: "bytes"
|
|
9399
|
-
},
|
|
9400
|
-
{
|
|
9401
|
-
internalType: "uint256",
|
|
9402
|
-
name: "amountOut",
|
|
9403
|
-
type: "uint256"
|
|
9404
|
-
}
|
|
9405
|
-
],
|
|
9406
|
-
name: "quoteExactOutput",
|
|
9407
|
-
outputs: [
|
|
9408
|
-
{
|
|
9409
|
-
internalType: "uint256",
|
|
9410
|
-
name: "amountIn",
|
|
9411
|
-
type: "uint256"
|
|
9412
|
-
}
|
|
9413
|
-
],
|
|
9414
|
-
stateMutability: "nonpayable",
|
|
9415
|
-
type: "function"
|
|
9416
|
-
},
|
|
9417
|
-
{
|
|
9418
|
-
inputs: [
|
|
9419
|
-
{
|
|
9420
|
-
internalType: "address",
|
|
9421
|
-
name: "tokenIn",
|
|
9422
|
-
type: "address"
|
|
9423
|
-
},
|
|
9424
|
-
{
|
|
9425
|
-
internalType: "address",
|
|
9426
|
-
name: "tokenOut",
|
|
9427
|
-
type: "address"
|
|
9428
|
-
},
|
|
9429
|
-
{
|
|
9430
|
-
internalType: "uint24",
|
|
9431
|
-
name: "fee",
|
|
9432
|
-
type: "uint24"
|
|
9433
|
-
},
|
|
9434
|
-
{
|
|
9435
|
-
internalType: "uint256",
|
|
9436
|
-
name: "amountOut",
|
|
9437
|
-
type: "uint256"
|
|
9438
|
-
},
|
|
9439
|
-
{
|
|
9440
|
-
internalType: "uint160",
|
|
9441
|
-
name: "sqrtPriceLimitX96",
|
|
9442
|
-
type: "uint160"
|
|
9443
|
-
}
|
|
9444
|
-
],
|
|
9445
|
-
name: "quoteExactOutputSingle",
|
|
9446
|
-
outputs: [
|
|
9447
|
-
{
|
|
9448
|
-
internalType: "uint256",
|
|
9449
|
-
name: "amountIn",
|
|
9450
|
-
type: "uint256"
|
|
9451
|
-
}
|
|
9452
|
-
],
|
|
9453
|
-
stateMutability: "nonpayable",
|
|
9454
|
-
type: "function"
|
|
9455
|
-
},
|
|
9456
|
-
{
|
|
9457
|
-
inputs: [
|
|
9458
|
-
{
|
|
9459
|
-
internalType: "int256",
|
|
9460
|
-
name: "amount0Delta",
|
|
9461
|
-
type: "int256"
|
|
9462
|
-
},
|
|
9463
|
-
{
|
|
9464
|
-
internalType: "int256",
|
|
9465
|
-
name: "amount1Delta",
|
|
9466
|
-
type: "int256"
|
|
9467
|
-
},
|
|
9468
|
-
{
|
|
9469
|
-
internalType: "bytes",
|
|
9470
|
-
name: "path",
|
|
9471
|
-
type: "bytes"
|
|
9472
|
-
}
|
|
9473
|
-
],
|
|
9474
|
-
name: "uniswapV3SwapCallback",
|
|
9475
|
-
outputs: [
|
|
9476
|
-
],
|
|
9477
|
-
stateMutability: "view",
|
|
9478
|
-
type: "function"
|
|
9479
|
-
}
|
|
9480
|
-
];
|
|
9481
|
-
var IUniswapV3Quoter = {
|
|
9482
|
-
abi: abi$g
|
|
9483
|
-
};
|
|
9484
|
-
|
|
9485
|
-
function getUniswapV3SwapTxData(_x, _x2, _x3, _x4, _x5, _x6) {
|
|
9486
|
-
return _getUniswapV3SwapTxData.apply(this, arguments);
|
|
9487
|
-
}
|
|
9488
|
-
|
|
9489
|
-
function _getUniswapV3SwapTxData() {
|
|
9490
|
-
_getUniswapV3SwapTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool, assetA, assetB, amountIn, slippage, feeAmount // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9491
|
-
) {
|
|
9492
|
-
var quoterContract, quotedAmountOut, minAmountOut, iUniswapV3Router, swapTx;
|
|
9493
|
-
return runtime_1.wrap(function _callee$(_context) {
|
|
9494
|
-
while (1) {
|
|
9495
|
-
switch (_context.prev = _context.next) {
|
|
9496
|
-
case 0:
|
|
9497
|
-
quoterContract = new ethers.Contract(UNISWAPV3_QUOTER_ADDRESS, IUniswapV3Quoter.abi, pool.signer);
|
|
9498
|
-
_context.next = 3;
|
|
9499
|
-
return quoterContract.callStatic.quoteExactInputSingle(assetA, assetB, feeAmount, amountIn.toString(), 0);
|
|
9500
|
-
|
|
9501
|
-
case 3:
|
|
9502
|
-
quotedAmountOut = _context.sent;
|
|
9503
|
-
minAmountOut = quotedAmountOut.mul((100 - slippage) * 100).div(10000);
|
|
9504
|
-
iUniswapV3Router = new ethers.utils.Interface(IUniswapV3Router.abi);
|
|
9505
|
-
swapTx = iUniswapV3Router.encodeFunctionData("exactInputSingle", [[assetA, assetB, feeAmount, pool.address, amountIn.toString(), minAmountOut.toString(), 0]]);
|
|
9506
|
-
return _context.abrupt("return", swapTx);
|
|
9507
|
-
|
|
9508
|
-
case 8:
|
|
9509
|
-
case "end":
|
|
9510
|
-
return _context.stop();
|
|
9511
|
-
}
|
|
9512
|
-
}
|
|
9513
|
-
}, _callee);
|
|
9514
|
-
}));
|
|
9515
|
-
return _getUniswapV3SwapTxData.apply(this, arguments);
|
|
9516
|
-
}
|
|
9517
|
-
|
|
9518
|
-
var abi$h = [
|
|
9519
|
-
{
|
|
9520
|
-
inputs: [
|
|
9521
|
-
{
|
|
9522
|
-
internalType: "address",
|
|
9523
|
-
name: "",
|
|
9524
|
-
type: "address"
|
|
9525
|
-
}
|
|
9526
|
-
],
|
|
9527
|
-
name: "allowedPools",
|
|
9528
|
-
outputs: [
|
|
9529
|
-
{
|
|
9530
|
-
internalType: "bool",
|
|
9531
|
-
name: "",
|
|
9532
|
-
type: "bool"
|
|
9533
|
-
}
|
|
9534
|
-
],
|
|
9535
|
-
stateMutability: "view",
|
|
9536
|
-
type: "function"
|
|
9537
|
-
},
|
|
9538
|
-
{
|
|
9539
|
-
inputs: [
|
|
9540
|
-
{
|
|
9541
|
-
internalType: "address",
|
|
9542
|
-
name: "pool",
|
|
9543
|
-
type: "address"
|
|
9544
|
-
},
|
|
9545
|
-
{
|
|
9546
|
-
internalType: "contract IERC20Extended",
|
|
9547
|
-
name: "depositAsset",
|
|
9548
|
-
type: "address"
|
|
9549
|
-
},
|
|
9550
|
-
{
|
|
9551
|
-
internalType: "uint256",
|
|
9552
|
-
name: "amount",
|
|
9553
|
-
type: "uint256"
|
|
9554
|
-
},
|
|
9555
|
-
{
|
|
9556
|
-
internalType: "contract IERC20Extended",
|
|
9557
|
-
name: "poolDepositAsset",
|
|
9558
|
-
type: "address"
|
|
9559
|
-
},
|
|
9560
|
-
{
|
|
9561
|
-
internalType: "uint256",
|
|
9562
|
-
name: "expectedLiquidityMinted",
|
|
9563
|
-
type: "uint256"
|
|
9564
|
-
}
|
|
9565
|
-
],
|
|
9566
|
-
name: "deposit",
|
|
9567
|
-
outputs: [
|
|
9568
|
-
{
|
|
9569
|
-
internalType: "uint256",
|
|
9570
|
-
name: "liquidityMinted",
|
|
9571
|
-
type: "uint256"
|
|
9572
|
-
}
|
|
9573
|
-
],
|
|
9574
|
-
stateMutability: "nonpayable",
|
|
9575
|
-
type: "function"
|
|
9576
|
-
},
|
|
9577
|
-
{
|
|
9578
|
-
inputs: [
|
|
9579
|
-
{
|
|
9580
|
-
internalType: "address",
|
|
9581
|
-
name: "pool",
|
|
9582
|
-
type: "address"
|
|
9583
|
-
},
|
|
9584
|
-
{
|
|
9585
|
-
internalType: "contract IERC20Extended",
|
|
9586
|
-
name: "depositAsset",
|
|
9587
|
-
type: "address"
|
|
9588
|
-
},
|
|
9589
|
-
{
|
|
9590
|
-
internalType: "uint256",
|
|
9591
|
-
name: "amount",
|
|
9592
|
-
type: "uint256"
|
|
9593
|
-
},
|
|
9594
|
-
{
|
|
9595
|
-
internalType: "contract IERC20Extended",
|
|
9596
|
-
name: "poolDepositAsset",
|
|
9597
|
-
type: "address"
|
|
9598
|
-
},
|
|
9599
|
-
{
|
|
9600
|
-
internalType: "uint256",
|
|
9601
|
-
name: "expectedLiquidityMinted",
|
|
9602
|
-
type: "uint256"
|
|
9603
|
-
}
|
|
9604
|
-
],
|
|
9605
|
-
name: "depositWithCustomCooldown",
|
|
9606
|
-
outputs: [
|
|
9607
|
-
{
|
|
9608
|
-
internalType: "uint256",
|
|
9609
|
-
name: "liquidityMinted",
|
|
9610
|
-
type: "uint256"
|
|
9611
|
-
}
|
|
9612
|
-
],
|
|
9613
|
-
stateMutability: "nonpayable",
|
|
9614
|
-
type: "function"
|
|
9615
|
-
},
|
|
9616
|
-
{
|
|
9617
|
-
inputs: [
|
|
9618
|
-
{
|
|
9619
|
-
internalType: "address",
|
|
9620
|
-
name: "pool",
|
|
9621
|
-
type: "address"
|
|
9622
|
-
},
|
|
9623
|
-
{
|
|
9624
|
-
internalType: "contract IERC20Extended",
|
|
9625
|
-
name: "poolDepositAsset",
|
|
9626
|
-
type: "address"
|
|
9627
|
-
},
|
|
9628
|
-
{
|
|
9629
|
-
internalType: "uint256",
|
|
9630
|
-
name: "expectedLiquidityMinted",
|
|
9631
|
-
type: "uint256"
|
|
9632
|
-
}
|
|
9633
|
-
],
|
|
9634
|
-
name: "depositNative",
|
|
9635
|
-
outputs: [
|
|
9636
|
-
{
|
|
9637
|
-
internalType: "uint256",
|
|
9638
|
-
name: "liquidityMinted",
|
|
9639
|
-
type: "uint256"
|
|
9640
|
-
}
|
|
9641
|
-
],
|
|
9642
|
-
stateMutability: "payable",
|
|
9643
|
-
type: "function"
|
|
9644
|
-
},
|
|
9645
|
-
{
|
|
9646
|
-
inputs: [
|
|
9647
|
-
{
|
|
9648
|
-
internalType: "address",
|
|
9649
|
-
name: "pool",
|
|
9650
|
-
type: "address"
|
|
9651
|
-
},
|
|
9652
|
-
{
|
|
9653
|
-
internalType: "contract IERC20Extended",
|
|
9654
|
-
name: "poolDepositAsset",
|
|
9655
|
-
type: "address"
|
|
9656
|
-
},
|
|
9657
|
-
{
|
|
9658
|
-
internalType: "uint256",
|
|
9659
|
-
name: "expectedLiquidityMinted",
|
|
9660
|
-
type: "uint256"
|
|
9661
|
-
}
|
|
9662
|
-
],
|
|
9663
|
-
name: "depositNativeWithCustomCooldown",
|
|
9664
|
-
outputs: [
|
|
9665
|
-
{
|
|
9666
|
-
internalType: "uint256",
|
|
9667
|
-
name: "liquidityMinted",
|
|
9668
|
-
type: "uint256"
|
|
9669
|
-
}
|
|
9670
|
-
],
|
|
9671
|
-
stateMutability: "payable",
|
|
9672
|
-
type: "function"
|
|
9673
|
-
},
|
|
9674
|
-
{
|
|
9675
|
-
inputs: [
|
|
9676
|
-
{
|
|
9677
|
-
internalType: "address",
|
|
9678
|
-
name: "pool",
|
|
9679
|
-
type: "address"
|
|
9680
|
-
},
|
|
9681
|
-
{
|
|
9682
|
-
internalType: "contract IERC20Extended",
|
|
9683
|
-
name: "depositAsset",
|
|
9684
|
-
type: "address"
|
|
9685
|
-
},
|
|
9686
|
-
{
|
|
9687
|
-
internalType: "uint256",
|
|
9688
|
-
name: "amount",
|
|
9689
|
-
type: "uint256"
|
|
9690
|
-
},
|
|
9691
|
-
{
|
|
9692
|
-
internalType: "contract IERC20Extended",
|
|
9693
|
-
name: "poolDepositAsset",
|
|
9694
|
-
type: "address"
|
|
9695
|
-
},
|
|
9696
|
-
{
|
|
9697
|
-
internalType: "bool",
|
|
9698
|
-
name: "customCooldown",
|
|
9699
|
-
type: "bool"
|
|
9700
|
-
}
|
|
9701
|
-
],
|
|
9702
|
-
name: "depositQuote",
|
|
9703
|
-
outputs: [
|
|
9704
|
-
{
|
|
9705
|
-
internalType: "uint256",
|
|
9706
|
-
name: "expectedLiquidityMinted",
|
|
9707
|
-
type: "uint256"
|
|
9708
|
-
}
|
|
9709
|
-
],
|
|
9710
|
-
stateMutability: "view",
|
|
9711
|
-
type: "function"
|
|
9712
|
-
},
|
|
9713
|
-
{
|
|
9714
|
-
inputs: [
|
|
9715
|
-
],
|
|
9716
|
-
name: "feeDenominator",
|
|
9717
|
-
outputs: [
|
|
9718
|
-
{
|
|
9719
|
-
internalType: "uint256",
|
|
9720
|
-
name: "",
|
|
9721
|
-
type: "uint256"
|
|
9722
|
-
}
|
|
9723
|
-
],
|
|
9724
|
-
stateMutability: "view",
|
|
9725
|
-
type: "function"
|
|
9726
|
-
},
|
|
9727
|
-
{
|
|
9728
|
-
inputs: [
|
|
9729
|
-
],
|
|
9730
|
-
name: "feeNumerator",
|
|
9731
|
-
outputs: [
|
|
9732
|
-
{
|
|
9733
|
-
internalType: "uint256",
|
|
9734
|
-
name: "",
|
|
9735
|
-
type: "uint256"
|
|
9736
|
-
}
|
|
9737
|
-
],
|
|
9738
|
-
stateMutability: "view",
|
|
9739
|
-
type: "function"
|
|
9740
|
-
},
|
|
9741
|
-
{
|
|
9742
|
-
inputs: [
|
|
9743
|
-
{
|
|
9744
|
-
internalType: "address",
|
|
9745
|
-
name: "pool",
|
|
9746
|
-
type: "address"
|
|
9747
|
-
},
|
|
9748
|
-
{
|
|
9749
|
-
internalType: "uint256",
|
|
9750
|
-
name: "fundTokenAmount",
|
|
9751
|
-
type: "uint256"
|
|
9752
|
-
},
|
|
9753
|
-
{
|
|
9754
|
-
internalType: "contract IERC20Extended",
|
|
9755
|
-
name: "withdrawalAsset",
|
|
9756
|
-
type: "address"
|
|
9757
|
-
},
|
|
9758
|
-
{
|
|
9759
|
-
internalType: "uint256",
|
|
9760
|
-
name: "expectedAmountOut",
|
|
9761
|
-
type: "uint256"
|
|
9762
|
-
}
|
|
9763
|
-
],
|
|
9764
|
-
name: "withdraw",
|
|
9765
|
-
outputs: [
|
|
9766
|
-
],
|
|
9767
|
-
stateMutability: "nonpayable",
|
|
9768
|
-
type: "function"
|
|
9769
|
-
},
|
|
9770
|
-
{
|
|
9771
|
-
inputs: [
|
|
9772
|
-
{
|
|
9773
|
-
internalType: "address",
|
|
9774
|
-
name: "pool",
|
|
9775
|
-
type: "address"
|
|
9776
|
-
},
|
|
9777
|
-
{
|
|
9778
|
-
internalType: "uint256",
|
|
9779
|
-
name: "fundTokenAmount",
|
|
9780
|
-
type: "uint256"
|
|
9781
|
-
},
|
|
9782
|
-
{
|
|
9783
|
-
internalType: "uint256",
|
|
9784
|
-
name: "expectedAmountOut",
|
|
9785
|
-
type: "uint256"
|
|
9786
|
-
}
|
|
9787
|
-
],
|
|
9788
|
-
name: "withdrawNative",
|
|
9789
|
-
outputs: [
|
|
9790
|
-
],
|
|
9791
|
-
stateMutability: "nonpayable",
|
|
9792
|
-
type: "function"
|
|
9793
|
-
},
|
|
9794
|
-
{
|
|
9795
|
-
inputs: [
|
|
9796
|
-
{
|
|
9797
|
-
internalType: "address",
|
|
9798
|
-
name: "pool",
|
|
9799
|
-
type: "address"
|
|
9800
|
-
},
|
|
9801
|
-
{
|
|
9802
|
-
internalType: "uint256",
|
|
9803
|
-
name: "fundTokenAmount",
|
|
9804
|
-
type: "uint256"
|
|
9805
|
-
},
|
|
9806
|
-
{
|
|
9807
|
-
internalType: "contract IERC20Extended",
|
|
9808
|
-
name: "intermediateAsset",
|
|
9809
|
-
type: "address"
|
|
9810
|
-
},
|
|
9811
|
-
{
|
|
9812
|
-
internalType: "uint256",
|
|
9813
|
-
name: "expectedAmountSUSD",
|
|
9814
|
-
type: "uint256"
|
|
9815
|
-
}
|
|
9816
|
-
],
|
|
9817
|
-
name: "withdrawSUSD",
|
|
9818
|
-
outputs: [
|
|
9819
|
-
],
|
|
9820
|
-
stateMutability: "nonpayable",
|
|
9821
|
-
type: "function"
|
|
9822
|
-
}
|
|
9823
|
-
];
|
|
9824
|
-
var IDhedgeEasySwapper = {
|
|
9825
|
-
abi: abi$h
|
|
9826
|
-
};
|
|
9827
|
-
|
|
9828
|
-
var abi$i = [
|
|
9829
|
-
{
|
|
9830
|
-
inputs: [
|
|
9831
|
-
{
|
|
9832
|
-
internalType: "string",
|
|
9833
|
-
name: "marketId",
|
|
9834
|
-
type: "string"
|
|
9835
|
-
},
|
|
9836
|
-
{
|
|
9837
|
-
internalType: "address",
|
|
9838
|
-
name: "owner",
|
|
9839
|
-
type: "address"
|
|
9840
|
-
}
|
|
9841
|
-
],
|
|
9842
|
-
stateMutability: "nonpayable",
|
|
9843
|
-
type: "constructor"
|
|
9844
|
-
},
|
|
9845
|
-
{
|
|
9846
|
-
anonymous: false,
|
|
9847
|
-
inputs: [
|
|
9848
|
-
{
|
|
9849
|
-
indexed: true,
|
|
9850
|
-
internalType: "address",
|
|
9851
|
-
name: "oldAddress",
|
|
9852
|
-
type: "address"
|
|
9853
|
-
},
|
|
9854
|
-
{
|
|
9855
|
-
indexed: true,
|
|
9856
|
-
internalType: "address",
|
|
9857
|
-
name: "newAddress",
|
|
9858
|
-
type: "address"
|
|
9859
|
-
}
|
|
9860
|
-
],
|
|
9861
|
-
name: "ACLAdminUpdated",
|
|
9862
|
-
type: "event"
|
|
9863
|
-
},
|
|
9864
|
-
{
|
|
9865
|
-
anonymous: false,
|
|
9866
|
-
inputs: [
|
|
9867
|
-
{
|
|
9868
|
-
indexed: true,
|
|
9869
|
-
internalType: "address",
|
|
9870
|
-
name: "oldAddress",
|
|
9871
|
-
type: "address"
|
|
9872
|
-
},
|
|
9873
|
-
{
|
|
9874
|
-
indexed: true,
|
|
9875
|
-
internalType: "address",
|
|
9876
|
-
name: "newAddress",
|
|
9877
|
-
type: "address"
|
|
9878
|
-
}
|
|
9879
|
-
],
|
|
9880
|
-
name: "ACLManagerUpdated",
|
|
9881
|
-
type: "event"
|
|
9882
|
-
},
|
|
9883
|
-
{
|
|
9884
|
-
anonymous: false,
|
|
9885
|
-
inputs: [
|
|
9886
|
-
{
|
|
9887
|
-
indexed: true,
|
|
9888
|
-
internalType: "bytes32",
|
|
9889
|
-
name: "id",
|
|
9890
|
-
type: "bytes32"
|
|
9891
|
-
},
|
|
9892
|
-
{
|
|
9893
|
-
indexed: true,
|
|
9894
|
-
internalType: "address",
|
|
9895
|
-
name: "oldAddress",
|
|
9896
|
-
type: "address"
|
|
9897
|
-
},
|
|
9898
|
-
{
|
|
9899
|
-
indexed: true,
|
|
9900
|
-
internalType: "address",
|
|
9901
|
-
name: "newAddress",
|
|
9902
|
-
type: "address"
|
|
9903
|
-
}
|
|
9904
|
-
],
|
|
9905
|
-
name: "AddressSet",
|
|
9906
|
-
type: "event"
|
|
9907
|
-
},
|
|
9908
|
-
{
|
|
9909
|
-
anonymous: false,
|
|
9910
|
-
inputs: [
|
|
9911
|
-
{
|
|
9912
|
-
indexed: true,
|
|
9913
|
-
internalType: "bytes32",
|
|
9914
|
-
name: "id",
|
|
9915
|
-
type: "bytes32"
|
|
9916
|
-
},
|
|
9917
|
-
{
|
|
9918
|
-
indexed: true,
|
|
9919
|
-
internalType: "address",
|
|
9920
|
-
name: "proxyAddress",
|
|
9921
|
-
type: "address"
|
|
9922
|
-
},
|
|
9923
|
-
{
|
|
9924
|
-
indexed: false,
|
|
9925
|
-
internalType: "address",
|
|
9926
|
-
name: "oldImplementationAddress",
|
|
9927
|
-
type: "address"
|
|
9928
|
-
},
|
|
9929
|
-
{
|
|
9930
|
-
indexed: true,
|
|
9931
|
-
internalType: "address",
|
|
9932
|
-
name: "newImplementationAddress",
|
|
9933
|
-
type: "address"
|
|
9934
|
-
}
|
|
9935
|
-
],
|
|
9936
|
-
name: "AddressSetAsProxy",
|
|
9937
|
-
type: "event"
|
|
9938
|
-
},
|
|
9939
|
-
{
|
|
9940
|
-
anonymous: false,
|
|
9941
|
-
inputs: [
|
|
9942
|
-
{
|
|
9943
|
-
indexed: true,
|
|
9944
|
-
internalType: "string",
|
|
9945
|
-
name: "oldMarketId",
|
|
9946
|
-
type: "string"
|
|
9947
|
-
},
|
|
9948
|
-
{
|
|
9949
|
-
indexed: true,
|
|
9950
|
-
internalType: "string",
|
|
9951
|
-
name: "newMarketId",
|
|
9952
|
-
type: "string"
|
|
9953
|
-
}
|
|
9954
|
-
],
|
|
9955
|
-
name: "MarketIdSet",
|
|
9956
|
-
type: "event"
|
|
9957
|
-
},
|
|
9958
|
-
{
|
|
9959
|
-
anonymous: false,
|
|
9960
|
-
inputs: [
|
|
9961
|
-
{
|
|
9962
|
-
indexed: true,
|
|
9963
|
-
internalType: "address",
|
|
9964
|
-
name: "previousOwner",
|
|
9965
|
-
type: "address"
|
|
9966
|
-
},
|
|
9967
|
-
{
|
|
9968
|
-
indexed: true,
|
|
9969
|
-
internalType: "address",
|
|
9970
|
-
name: "newOwner",
|
|
9971
|
-
type: "address"
|
|
9972
|
-
}
|
|
9973
|
-
],
|
|
9974
|
-
name: "OwnershipTransferred",
|
|
9975
|
-
type: "event"
|
|
9976
|
-
},
|
|
9977
|
-
{
|
|
9978
|
-
anonymous: false,
|
|
9979
|
-
inputs: [
|
|
9980
|
-
{
|
|
9981
|
-
indexed: true,
|
|
9982
|
-
internalType: "address",
|
|
9983
|
-
name: "oldAddress",
|
|
9984
|
-
type: "address"
|
|
9985
|
-
},
|
|
9986
|
-
{
|
|
9987
|
-
indexed: true,
|
|
9988
|
-
internalType: "address",
|
|
9989
|
-
name: "newAddress",
|
|
9990
|
-
type: "address"
|
|
9991
|
-
}
|
|
9992
|
-
],
|
|
9993
|
-
name: "PoolConfiguratorUpdated",
|
|
9994
|
-
type: "event"
|
|
9995
|
-
},
|
|
9996
|
-
{
|
|
9997
|
-
anonymous: false,
|
|
9998
|
-
inputs: [
|
|
9999
|
-
{
|
|
10000
|
-
indexed: true,
|
|
10001
|
-
internalType: "address",
|
|
10002
|
-
name: "oldAddress",
|
|
10003
|
-
type: "address"
|
|
10004
|
-
},
|
|
10005
|
-
{
|
|
10006
|
-
indexed: true,
|
|
10007
|
-
internalType: "address",
|
|
10008
|
-
name: "newAddress",
|
|
10009
|
-
type: "address"
|
|
10010
|
-
}
|
|
10011
|
-
],
|
|
10012
|
-
name: "PoolDataProviderUpdated",
|
|
10013
|
-
type: "event"
|
|
10014
|
-
},
|
|
10015
|
-
{
|
|
10016
|
-
anonymous: false,
|
|
10017
|
-
inputs: [
|
|
10018
|
-
{
|
|
10019
|
-
indexed: true,
|
|
10020
|
-
internalType: "address",
|
|
10021
|
-
name: "oldAddress",
|
|
10022
|
-
type: "address"
|
|
10023
|
-
},
|
|
10024
|
-
{
|
|
10025
|
-
indexed: true,
|
|
10026
|
-
internalType: "address",
|
|
10027
|
-
name: "newAddress",
|
|
10028
|
-
type: "address"
|
|
10029
|
-
}
|
|
10030
|
-
],
|
|
10031
|
-
name: "PoolUpdated",
|
|
10032
|
-
type: "event"
|
|
10033
|
-
},
|
|
10034
|
-
{
|
|
10035
|
-
anonymous: false,
|
|
10036
|
-
inputs: [
|
|
10037
|
-
{
|
|
10038
|
-
indexed: true,
|
|
10039
|
-
internalType: "address",
|
|
10040
|
-
name: "oldAddress",
|
|
10041
|
-
type: "address"
|
|
10042
|
-
},
|
|
10043
|
-
{
|
|
10044
|
-
indexed: true,
|
|
10045
|
-
internalType: "address",
|
|
10046
|
-
name: "newAddress",
|
|
10047
|
-
type: "address"
|
|
10048
|
-
}
|
|
10049
|
-
],
|
|
10050
|
-
name: "PriceOracleSentinelUpdated",
|
|
10051
|
-
type: "event"
|
|
10052
|
-
},
|
|
10053
|
-
{
|
|
10054
|
-
anonymous: false,
|
|
10055
|
-
inputs: [
|
|
10056
|
-
{
|
|
10057
|
-
indexed: true,
|
|
10058
|
-
internalType: "address",
|
|
10059
|
-
name: "oldAddress",
|
|
10060
|
-
type: "address"
|
|
10061
|
-
},
|
|
10062
|
-
{
|
|
10063
|
-
indexed: true,
|
|
10064
|
-
internalType: "address",
|
|
10065
|
-
name: "newAddress",
|
|
10066
|
-
type: "address"
|
|
10067
|
-
}
|
|
10068
|
-
],
|
|
10069
|
-
name: "PriceOracleUpdated",
|
|
10070
|
-
type: "event"
|
|
10071
|
-
},
|
|
10072
|
-
{
|
|
10073
|
-
anonymous: false,
|
|
10074
|
-
inputs: [
|
|
10075
|
-
{
|
|
10076
|
-
indexed: true,
|
|
10077
|
-
internalType: "bytes32",
|
|
10078
|
-
name: "id",
|
|
10079
|
-
type: "bytes32"
|
|
10080
|
-
},
|
|
10081
|
-
{
|
|
10082
|
-
indexed: true,
|
|
10083
|
-
internalType: "address",
|
|
10084
|
-
name: "proxyAddress",
|
|
10085
|
-
type: "address"
|
|
10086
|
-
},
|
|
10087
|
-
{
|
|
10088
|
-
indexed: true,
|
|
10089
|
-
internalType: "address",
|
|
10090
|
-
name: "implementationAddress",
|
|
10091
|
-
type: "address"
|
|
10092
|
-
}
|
|
10093
|
-
],
|
|
10094
|
-
name: "ProxyCreated",
|
|
10095
|
-
type: "event"
|
|
10096
|
-
},
|
|
10097
|
-
{
|
|
10098
|
-
inputs: [
|
|
10099
|
-
],
|
|
10100
|
-
name: "getACLAdmin",
|
|
10101
|
-
outputs: [
|
|
10102
|
-
{
|
|
10103
|
-
internalType: "address",
|
|
10104
|
-
name: "",
|
|
10105
|
-
type: "address"
|
|
10106
|
-
}
|
|
10107
|
-
],
|
|
10108
|
-
stateMutability: "view",
|
|
10109
|
-
type: "function"
|
|
10110
|
-
},
|
|
10111
|
-
{
|
|
10112
|
-
inputs: [
|
|
10113
|
-
],
|
|
10114
|
-
name: "getACLManager",
|
|
10115
|
-
outputs: [
|
|
10116
|
-
{
|
|
10117
|
-
internalType: "address",
|
|
10118
|
-
name: "",
|
|
10119
|
-
type: "address"
|
|
10120
|
-
}
|
|
10121
|
-
],
|
|
10122
|
-
stateMutability: "view",
|
|
10123
|
-
type: "function"
|
|
10124
|
-
},
|
|
10125
|
-
{
|
|
10126
|
-
inputs: [
|
|
10127
|
-
{
|
|
10128
|
-
internalType: "bytes32",
|
|
10129
|
-
name: "id",
|
|
10130
|
-
type: "bytes32"
|
|
10131
|
-
}
|
|
10132
|
-
],
|
|
10133
|
-
name: "getAddress",
|
|
10134
|
-
outputs: [
|
|
10135
|
-
{
|
|
10136
|
-
internalType: "address",
|
|
10137
|
-
name: "",
|
|
10138
|
-
type: "address"
|
|
10139
|
-
}
|
|
10140
|
-
],
|
|
10141
|
-
stateMutability: "view",
|
|
10142
|
-
type: "function"
|
|
10143
|
-
},
|
|
10144
|
-
{
|
|
10145
|
-
inputs: [
|
|
10146
|
-
],
|
|
10147
|
-
name: "getMarketId",
|
|
10148
|
-
outputs: [
|
|
10149
|
-
{
|
|
10150
|
-
internalType: "string",
|
|
10151
|
-
name: "",
|
|
10152
|
-
type: "string"
|
|
10153
|
-
}
|
|
10154
|
-
],
|
|
10155
|
-
stateMutability: "view",
|
|
10156
|
-
type: "function"
|
|
10157
|
-
},
|
|
10158
|
-
{
|
|
10159
|
-
inputs: [
|
|
10160
|
-
],
|
|
10161
|
-
name: "getPool",
|
|
10162
|
-
outputs: [
|
|
10163
|
-
{
|
|
10164
|
-
internalType: "address",
|
|
10165
|
-
name: "",
|
|
10166
|
-
type: "address"
|
|
10167
|
-
}
|
|
10168
|
-
],
|
|
10169
|
-
stateMutability: "view",
|
|
10170
|
-
type: "function"
|
|
10171
|
-
},
|
|
10172
|
-
{
|
|
10173
|
-
inputs: [
|
|
10174
|
-
],
|
|
10175
|
-
name: "getPoolConfigurator",
|
|
10176
|
-
outputs: [
|
|
10177
|
-
{
|
|
10178
|
-
internalType: "address",
|
|
10179
|
-
name: "",
|
|
10180
|
-
type: "address"
|
|
10181
|
-
}
|
|
10182
|
-
],
|
|
10183
|
-
stateMutability: "view",
|
|
10184
|
-
type: "function"
|
|
10185
|
-
},
|
|
10186
|
-
{
|
|
10187
|
-
inputs: [
|
|
10188
|
-
],
|
|
10189
|
-
name: "getPoolDataProvider",
|
|
10190
|
-
outputs: [
|
|
10191
|
-
{
|
|
10192
|
-
internalType: "address",
|
|
10193
|
-
name: "",
|
|
10194
|
-
type: "address"
|
|
10195
|
-
}
|
|
10196
|
-
],
|
|
10197
|
-
stateMutability: "view",
|
|
10198
|
-
type: "function"
|
|
10199
|
-
},
|
|
10200
|
-
{
|
|
10201
|
-
inputs: [
|
|
10202
|
-
],
|
|
10203
|
-
name: "getPriceOracle",
|
|
10204
|
-
outputs: [
|
|
10205
|
-
{
|
|
10206
|
-
internalType: "address",
|
|
10207
|
-
name: "",
|
|
10208
|
-
type: "address"
|
|
10209
|
-
}
|
|
10210
|
-
],
|
|
10211
|
-
stateMutability: "view",
|
|
10212
|
-
type: "function"
|
|
10213
|
-
},
|
|
9563
|
+
_context4.next = 32;
|
|
9564
|
+
break;
|
|
9565
|
+
}
|
|
9566
|
+
|
|
9567
|
+
_abi2 = new ethers.utils.Interface(IArrakisV1RouterStaking.abi);
|
|
9568
|
+
_context4.t7 = BigNumber;
|
|
9569
|
+
_context4.next = 27;
|
|
9570
|
+
return pool.utils.getBalance(tokenId, pool.address);
|
|
9571
|
+
|
|
9572
|
+
case 27:
|
|
9573
|
+
_context4.t8 = _context4.sent.toString();
|
|
9574
|
+
_liquidity = new _context4.t7(_context4.t8).times(amount).div(100);
|
|
9575
|
+
txData = _abi2.encodeFunctionData(Transaction.REMOVE_LIQUIDITY_UNSTAKE, [tokenId, _liquidity, 0, 0, pool.address]);
|
|
9576
|
+
_context4.next = 33;
|
|
9577
|
+
break;
|
|
9578
|
+
|
|
9579
|
+
case 32:
|
|
9580
|
+
throw new Error("dapp not supported");
|
|
9581
|
+
|
|
9582
|
+
case 33:
|
|
9583
|
+
return _context4.abrupt("return", txData);
|
|
9584
|
+
|
|
9585
|
+
case 34:
|
|
9586
|
+
case "end":
|
|
9587
|
+
return _context4.stop();
|
|
9588
|
+
}
|
|
9589
|
+
}
|
|
9590
|
+
}, _callee4);
|
|
9591
|
+
}));
|
|
9592
|
+
return _getDecreaseLiquidityTxData.apply(this, arguments);
|
|
9593
|
+
}
|
|
9594
|
+
|
|
9595
|
+
var abi$f = [
|
|
10214
9596
|
{
|
|
10215
9597
|
inputs: [
|
|
10216
|
-
],
|
|
10217
|
-
name: "getPriceOracleSentinel",
|
|
10218
|
-
outputs: [
|
|
10219
9598
|
{
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
|
|
9599
|
+
components: [
|
|
9600
|
+
{
|
|
9601
|
+
internalType: "bytes",
|
|
9602
|
+
name: "path",
|
|
9603
|
+
type: "bytes"
|
|
9604
|
+
},
|
|
9605
|
+
{
|
|
9606
|
+
internalType: "address",
|
|
9607
|
+
name: "recipient",
|
|
9608
|
+
type: "address"
|
|
9609
|
+
},
|
|
9610
|
+
{
|
|
9611
|
+
internalType: "uint256",
|
|
9612
|
+
name: "amountIn",
|
|
9613
|
+
type: "uint256"
|
|
9614
|
+
},
|
|
9615
|
+
{
|
|
9616
|
+
internalType: "uint256",
|
|
9617
|
+
name: "amountOutMinimum",
|
|
9618
|
+
type: "uint256"
|
|
9619
|
+
}
|
|
9620
|
+
],
|
|
9621
|
+
internalType: "struct ISwapRouter.ExactInputParams",
|
|
9622
|
+
name: "params",
|
|
9623
|
+
type: "tuple"
|
|
10223
9624
|
}
|
|
10224
9625
|
],
|
|
10225
|
-
|
|
10226
|
-
type: "function"
|
|
10227
|
-
},
|
|
10228
|
-
{
|
|
10229
|
-
inputs: [
|
|
10230
|
-
],
|
|
10231
|
-
name: "owner",
|
|
9626
|
+
name: "exactInput",
|
|
10232
9627
|
outputs: [
|
|
10233
9628
|
{
|
|
10234
|
-
internalType: "
|
|
10235
|
-
name: "",
|
|
10236
|
-
type: "
|
|
9629
|
+
internalType: "uint256",
|
|
9630
|
+
name: "amountOut",
|
|
9631
|
+
type: "uint256"
|
|
10237
9632
|
}
|
|
10238
9633
|
],
|
|
10239
|
-
stateMutability: "
|
|
10240
|
-
type: "function"
|
|
10241
|
-
},
|
|
10242
|
-
{
|
|
10243
|
-
inputs: [
|
|
10244
|
-
],
|
|
10245
|
-
name: "renounceOwnership",
|
|
10246
|
-
outputs: [
|
|
10247
|
-
],
|
|
10248
|
-
stateMutability: "nonpayable",
|
|
9634
|
+
stateMutability: "payable",
|
|
10249
9635
|
type: "function"
|
|
10250
9636
|
},
|
|
10251
9637
|
{
|
|
10252
9638
|
inputs: [
|
|
10253
9639
|
{
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
9640
|
+
components: [
|
|
9641
|
+
{
|
|
9642
|
+
internalType: "address",
|
|
9643
|
+
name: "tokenIn",
|
|
9644
|
+
type: "address"
|
|
9645
|
+
},
|
|
9646
|
+
{
|
|
9647
|
+
internalType: "address",
|
|
9648
|
+
name: "tokenOut",
|
|
9649
|
+
type: "address"
|
|
9650
|
+
},
|
|
9651
|
+
{
|
|
9652
|
+
internalType: "uint24",
|
|
9653
|
+
name: "fee",
|
|
9654
|
+
type: "uint24"
|
|
9655
|
+
},
|
|
9656
|
+
{
|
|
9657
|
+
internalType: "address",
|
|
9658
|
+
name: "recipient",
|
|
9659
|
+
type: "address"
|
|
9660
|
+
},
|
|
9661
|
+
{
|
|
9662
|
+
internalType: "uint256",
|
|
9663
|
+
name: "amountIn",
|
|
9664
|
+
type: "uint256"
|
|
9665
|
+
},
|
|
9666
|
+
{
|
|
9667
|
+
internalType: "uint256",
|
|
9668
|
+
name: "amountOutMinimum",
|
|
9669
|
+
type: "uint256"
|
|
9670
|
+
},
|
|
9671
|
+
{
|
|
9672
|
+
internalType: "uint160",
|
|
9673
|
+
name: "sqrtPriceLimitX96",
|
|
9674
|
+
type: "uint160"
|
|
9675
|
+
}
|
|
9676
|
+
],
|
|
9677
|
+
internalType: "struct ISwapRouter.ExactInputSingleParams",
|
|
9678
|
+
name: "params",
|
|
9679
|
+
type: "tuple"
|
|
10257
9680
|
}
|
|
10258
9681
|
],
|
|
10259
|
-
name: "
|
|
9682
|
+
name: "exactInputSingle",
|
|
10260
9683
|
outputs: [
|
|
10261
|
-
],
|
|
10262
|
-
stateMutability: "nonpayable",
|
|
10263
|
-
type: "function"
|
|
10264
|
-
},
|
|
10265
|
-
{
|
|
10266
|
-
inputs: [
|
|
10267
9684
|
{
|
|
10268
|
-
internalType: "
|
|
10269
|
-
name: "
|
|
10270
|
-
type: "
|
|
9685
|
+
internalType: "uint256",
|
|
9686
|
+
name: "amountOut",
|
|
9687
|
+
type: "uint256"
|
|
10271
9688
|
}
|
|
10272
9689
|
],
|
|
10273
|
-
|
|
10274
|
-
outputs: [
|
|
10275
|
-
],
|
|
10276
|
-
stateMutability: "nonpayable",
|
|
9690
|
+
stateMutability: "payable",
|
|
10277
9691
|
type: "function"
|
|
10278
9692
|
},
|
|
10279
9693
|
{
|
|
10280
9694
|
inputs: [
|
|
10281
9695
|
{
|
|
10282
|
-
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
9696
|
+
components: [
|
|
9697
|
+
{
|
|
9698
|
+
internalType: "bytes",
|
|
9699
|
+
name: "path",
|
|
9700
|
+
type: "bytes"
|
|
9701
|
+
},
|
|
9702
|
+
{
|
|
9703
|
+
internalType: "address",
|
|
9704
|
+
name: "recipient",
|
|
9705
|
+
type: "address"
|
|
9706
|
+
},
|
|
9707
|
+
{
|
|
9708
|
+
internalType: "uint256",
|
|
9709
|
+
name: "amountOut",
|
|
9710
|
+
type: "uint256"
|
|
9711
|
+
},
|
|
9712
|
+
{
|
|
9713
|
+
internalType: "uint256",
|
|
9714
|
+
name: "amountInMaximum",
|
|
9715
|
+
type: "uint256"
|
|
9716
|
+
}
|
|
9717
|
+
],
|
|
9718
|
+
internalType: "struct ISwapRouter.ExactOutputParams",
|
|
9719
|
+
name: "params",
|
|
9720
|
+
type: "tuple"
|
|
10290
9721
|
}
|
|
10291
9722
|
],
|
|
10292
|
-
name: "
|
|
9723
|
+
name: "exactOutput",
|
|
10293
9724
|
outputs: [
|
|
10294
|
-
],
|
|
10295
|
-
stateMutability: "nonpayable",
|
|
10296
|
-
type: "function"
|
|
10297
|
-
},
|
|
10298
|
-
{
|
|
10299
|
-
inputs: [
|
|
10300
|
-
{
|
|
10301
|
-
internalType: "bytes32",
|
|
10302
|
-
name: "id",
|
|
10303
|
-
type: "bytes32"
|
|
10304
|
-
},
|
|
10305
9725
|
{
|
|
10306
|
-
internalType: "
|
|
10307
|
-
name: "
|
|
10308
|
-
type: "
|
|
9726
|
+
internalType: "uint256",
|
|
9727
|
+
name: "amountIn",
|
|
9728
|
+
type: "uint256"
|
|
10309
9729
|
}
|
|
10310
9730
|
],
|
|
10311
|
-
|
|
10312
|
-
outputs: [
|
|
10313
|
-
],
|
|
10314
|
-
stateMutability: "nonpayable",
|
|
9731
|
+
stateMutability: "payable",
|
|
10315
9732
|
type: "function"
|
|
10316
9733
|
},
|
|
10317
9734
|
{
|
|
10318
9735
|
inputs: [
|
|
10319
9736
|
{
|
|
10320
|
-
|
|
10321
|
-
|
|
10322
|
-
|
|
9737
|
+
components: [
|
|
9738
|
+
{
|
|
9739
|
+
internalType: "address",
|
|
9740
|
+
name: "tokenIn",
|
|
9741
|
+
type: "address"
|
|
9742
|
+
},
|
|
9743
|
+
{
|
|
9744
|
+
internalType: "address",
|
|
9745
|
+
name: "tokenOut",
|
|
9746
|
+
type: "address"
|
|
9747
|
+
},
|
|
9748
|
+
{
|
|
9749
|
+
internalType: "uint24",
|
|
9750
|
+
name: "fee",
|
|
9751
|
+
type: "uint24"
|
|
9752
|
+
},
|
|
9753
|
+
{
|
|
9754
|
+
internalType: "address",
|
|
9755
|
+
name: "recipient",
|
|
9756
|
+
type: "address"
|
|
9757
|
+
},
|
|
9758
|
+
{
|
|
9759
|
+
internalType: "uint256",
|
|
9760
|
+
name: "amountOut",
|
|
9761
|
+
type: "uint256"
|
|
9762
|
+
},
|
|
9763
|
+
{
|
|
9764
|
+
internalType: "uint256",
|
|
9765
|
+
name: "amountInMaximum",
|
|
9766
|
+
type: "uint256"
|
|
9767
|
+
},
|
|
9768
|
+
{
|
|
9769
|
+
internalType: "uint160",
|
|
9770
|
+
name: "sqrtPriceLimitX96",
|
|
9771
|
+
type: "uint160"
|
|
9772
|
+
}
|
|
9773
|
+
],
|
|
9774
|
+
internalType: "struct ISwapRouter.ExactOutputSingleParams",
|
|
9775
|
+
name: "params",
|
|
9776
|
+
type: "tuple"
|
|
10323
9777
|
}
|
|
10324
9778
|
],
|
|
10325
|
-
name: "
|
|
9779
|
+
name: "exactOutputSingle",
|
|
10326
9780
|
outputs: [
|
|
10327
|
-
],
|
|
10328
|
-
stateMutability: "nonpayable",
|
|
10329
|
-
type: "function"
|
|
10330
|
-
},
|
|
10331
|
-
{
|
|
10332
|
-
inputs: [
|
|
10333
9781
|
{
|
|
10334
|
-
internalType: "
|
|
10335
|
-
name: "
|
|
10336
|
-
type: "
|
|
9782
|
+
internalType: "uint256",
|
|
9783
|
+
name: "amountIn",
|
|
9784
|
+
type: "uint256"
|
|
10337
9785
|
}
|
|
10338
9786
|
],
|
|
10339
|
-
|
|
10340
|
-
outputs: [
|
|
10341
|
-
],
|
|
10342
|
-
stateMutability: "nonpayable",
|
|
9787
|
+
stateMutability: "payable",
|
|
10343
9788
|
type: "function"
|
|
10344
9789
|
},
|
|
10345
9790
|
{
|
|
10346
9791
|
inputs: [
|
|
10347
9792
|
{
|
|
10348
|
-
internalType: "
|
|
10349
|
-
name: "
|
|
10350
|
-
type: "
|
|
9793
|
+
internalType: "int256",
|
|
9794
|
+
name: "amount0Delta",
|
|
9795
|
+
type: "int256"
|
|
9796
|
+
},
|
|
9797
|
+
{
|
|
9798
|
+
internalType: "int256",
|
|
9799
|
+
name: "amount1Delta",
|
|
9800
|
+
type: "int256"
|
|
9801
|
+
},
|
|
9802
|
+
{
|
|
9803
|
+
internalType: "bytes",
|
|
9804
|
+
name: "data",
|
|
9805
|
+
type: "bytes"
|
|
10351
9806
|
}
|
|
10352
9807
|
],
|
|
10353
|
-
name: "
|
|
9808
|
+
name: "uniswapV3SwapCallback",
|
|
10354
9809
|
outputs: [
|
|
10355
9810
|
],
|
|
10356
9811
|
stateMutability: "nonpayable",
|
|
10357
9812
|
type: "function"
|
|
10358
|
-
}
|
|
9813
|
+
}
|
|
9814
|
+
];
|
|
9815
|
+
var IUniswapV3Router = {
|
|
9816
|
+
abi: abi$f
|
|
9817
|
+
};
|
|
9818
|
+
|
|
9819
|
+
var abi$g = [
|
|
10359
9820
|
{
|
|
10360
9821
|
inputs: [
|
|
10361
9822
|
{
|
|
10362
9823
|
internalType: "address",
|
|
10363
|
-
name: "
|
|
9824
|
+
name: "_factory",
|
|
10364
9825
|
type: "address"
|
|
10365
|
-
}
|
|
10366
|
-
],
|
|
10367
|
-
name: "setPoolImpl",
|
|
10368
|
-
outputs: [
|
|
10369
|
-
],
|
|
10370
|
-
stateMutability: "nonpayable",
|
|
10371
|
-
type: "function"
|
|
10372
|
-
},
|
|
10373
|
-
{
|
|
10374
|
-
inputs: [
|
|
9826
|
+
},
|
|
10375
9827
|
{
|
|
10376
9828
|
internalType: "address",
|
|
10377
|
-
name: "
|
|
9829
|
+
name: "_WETH9",
|
|
10378
9830
|
type: "address"
|
|
10379
9831
|
}
|
|
10380
9832
|
],
|
|
10381
|
-
name: "setPriceOracle",
|
|
10382
|
-
outputs: [
|
|
10383
|
-
],
|
|
10384
9833
|
stateMutability: "nonpayable",
|
|
10385
|
-
type: "
|
|
9834
|
+
type: "constructor"
|
|
10386
9835
|
},
|
|
10387
9836
|
{
|
|
10388
9837
|
inputs: [
|
|
9838
|
+
],
|
|
9839
|
+
name: "WETH9",
|
|
9840
|
+
outputs: [
|
|
10389
9841
|
{
|
|
10390
9842
|
internalType: "address",
|
|
10391
|
-
name: "
|
|
9843
|
+
name: "",
|
|
10392
9844
|
type: "address"
|
|
10393
9845
|
}
|
|
10394
9846
|
],
|
|
10395
|
-
|
|
10396
|
-
outputs: [
|
|
10397
|
-
],
|
|
10398
|
-
stateMutability: "nonpayable",
|
|
9847
|
+
stateMutability: "view",
|
|
10399
9848
|
type: "function"
|
|
10400
9849
|
},
|
|
10401
9850
|
{
|
|
10402
9851
|
inputs: [
|
|
9852
|
+
],
|
|
9853
|
+
name: "factory",
|
|
9854
|
+
outputs: [
|
|
10403
9855
|
{
|
|
10404
9856
|
internalType: "address",
|
|
10405
|
-
name: "
|
|
9857
|
+
name: "",
|
|
10406
9858
|
type: "address"
|
|
10407
9859
|
}
|
|
10408
9860
|
],
|
|
10409
|
-
|
|
10410
|
-
outputs: [
|
|
10411
|
-
],
|
|
10412
|
-
stateMutability: "nonpayable",
|
|
9861
|
+
stateMutability: "view",
|
|
10413
9862
|
type: "function"
|
|
10414
|
-
}
|
|
10415
|
-
];
|
|
10416
|
-
var IAaveV3PoolAddressProvider = {
|
|
10417
|
-
abi: abi$i
|
|
10418
|
-
};
|
|
10419
|
-
|
|
10420
|
-
var abi$j = [
|
|
9863
|
+
},
|
|
10421
9864
|
{
|
|
10422
9865
|
inputs: [
|
|
10423
9866
|
{
|
|
10424
|
-
internalType: "
|
|
10425
|
-
name: "
|
|
10426
|
-
type: "
|
|
9867
|
+
internalType: "bytes",
|
|
9868
|
+
name: "path",
|
|
9869
|
+
type: "bytes"
|
|
10427
9870
|
},
|
|
10428
9871
|
{
|
|
10429
|
-
internalType: "
|
|
10430
|
-
name: "
|
|
10431
|
-
type: "
|
|
10432
|
-
}
|
|
9872
|
+
internalType: "uint256",
|
|
9873
|
+
name: "amountIn",
|
|
9874
|
+
type: "uint256"
|
|
9875
|
+
}
|
|
9876
|
+
],
|
|
9877
|
+
name: "quoteExactInput",
|
|
9878
|
+
outputs: [
|
|
10433
9879
|
{
|
|
10434
|
-
internalType: "
|
|
10435
|
-
name: "
|
|
10436
|
-
type: "
|
|
9880
|
+
internalType: "uint256",
|
|
9881
|
+
name: "amountOut",
|
|
9882
|
+
type: "uint256"
|
|
10437
9883
|
}
|
|
10438
9884
|
],
|
|
10439
|
-
payable: false,
|
|
10440
9885
|
stateMutability: "nonpayable",
|
|
10441
|
-
type: "
|
|
9886
|
+
type: "function"
|
|
10442
9887
|
},
|
|
10443
9888
|
{
|
|
10444
|
-
anonymous: false,
|
|
10445
9889
|
inputs: [
|
|
10446
9890
|
{
|
|
10447
|
-
indexed: true,
|
|
10448
9891
|
internalType: "address",
|
|
10449
|
-
name: "
|
|
9892
|
+
name: "tokenIn",
|
|
10450
9893
|
type: "address"
|
|
10451
9894
|
},
|
|
10452
9895
|
{
|
|
10453
|
-
indexed: true,
|
|
10454
9896
|
internalType: "address",
|
|
10455
|
-
name: "
|
|
9897
|
+
name: "tokenOut",
|
|
10456
9898
|
type: "address"
|
|
9899
|
+
},
|
|
9900
|
+
{
|
|
9901
|
+
internalType: "uint24",
|
|
9902
|
+
name: "fee",
|
|
9903
|
+
type: "uint24"
|
|
9904
|
+
},
|
|
9905
|
+
{
|
|
9906
|
+
internalType: "uint256",
|
|
9907
|
+
name: "amountIn",
|
|
9908
|
+
type: "uint256"
|
|
9909
|
+
},
|
|
9910
|
+
{
|
|
9911
|
+
internalType: "uint160",
|
|
9912
|
+
name: "sqrtPriceLimitX96",
|
|
9913
|
+
type: "uint160"
|
|
10457
9914
|
}
|
|
10458
9915
|
],
|
|
10459
|
-
name: "
|
|
10460
|
-
|
|
10461
|
-
},
|
|
10462
|
-
{
|
|
10463
|
-
anonymous: false,
|
|
10464
|
-
inputs: [
|
|
9916
|
+
name: "quoteExactInputSingle",
|
|
9917
|
+
outputs: [
|
|
10465
9918
|
{
|
|
10466
|
-
|
|
10467
|
-
|
|
10468
|
-
|
|
10469
|
-
type: "address"
|
|
9919
|
+
internalType: "uint256",
|
|
9920
|
+
name: "amountOut",
|
|
9921
|
+
type: "uint256"
|
|
10470
9922
|
}
|
|
10471
9923
|
],
|
|
10472
|
-
|
|
10473
|
-
type: "
|
|
9924
|
+
stateMutability: "nonpayable",
|
|
9925
|
+
type: "function"
|
|
10474
9926
|
},
|
|
10475
9927
|
{
|
|
10476
|
-
anonymous: false,
|
|
10477
9928
|
inputs: [
|
|
10478
9929
|
{
|
|
10479
|
-
|
|
10480
|
-
|
|
10481
|
-
|
|
10482
|
-
type: "address"
|
|
9930
|
+
internalType: "bytes",
|
|
9931
|
+
name: "path",
|
|
9932
|
+
type: "bytes"
|
|
10483
9933
|
},
|
|
10484
9934
|
{
|
|
10485
|
-
|
|
10486
|
-
|
|
10487
|
-
|
|
10488
|
-
type: "address"
|
|
9935
|
+
internalType: "uint256",
|
|
9936
|
+
name: "amountOut",
|
|
9937
|
+
type: "uint256"
|
|
10489
9938
|
}
|
|
10490
9939
|
],
|
|
10491
|
-
name: "
|
|
10492
|
-
type: "event"
|
|
10493
|
-
},
|
|
10494
|
-
{
|
|
10495
|
-
constant: true,
|
|
10496
|
-
inputs: [
|
|
10497
|
-
],
|
|
10498
|
-
name: "isOwner",
|
|
9940
|
+
name: "quoteExactOutput",
|
|
10499
9941
|
outputs: [
|
|
10500
9942
|
{
|
|
10501
|
-
internalType: "
|
|
10502
|
-
name: "",
|
|
10503
|
-
type: "
|
|
9943
|
+
internalType: "uint256",
|
|
9944
|
+
name: "amountIn",
|
|
9945
|
+
type: "uint256"
|
|
10504
9946
|
}
|
|
10505
9947
|
],
|
|
10506
|
-
|
|
10507
|
-
stateMutability: "view",
|
|
9948
|
+
stateMutability: "nonpayable",
|
|
10508
9949
|
type: "function"
|
|
10509
9950
|
},
|
|
10510
9951
|
{
|
|
10511
|
-
constant: true,
|
|
10512
9952
|
inputs: [
|
|
10513
|
-
],
|
|
10514
|
-
name: "owner",
|
|
10515
|
-
outputs: [
|
|
10516
9953
|
{
|
|
10517
9954
|
internalType: "address",
|
|
10518
|
-
name: "",
|
|
9955
|
+
name: "tokenIn",
|
|
9956
|
+
type: "address"
|
|
9957
|
+
},
|
|
9958
|
+
{
|
|
9959
|
+
internalType: "address",
|
|
9960
|
+
name: "tokenOut",
|
|
10519
9961
|
type: "address"
|
|
9962
|
+
},
|
|
9963
|
+
{
|
|
9964
|
+
internalType: "uint24",
|
|
9965
|
+
name: "fee",
|
|
9966
|
+
type: "uint24"
|
|
9967
|
+
},
|
|
9968
|
+
{
|
|
9969
|
+
internalType: "uint256",
|
|
9970
|
+
name: "amountOut",
|
|
9971
|
+
type: "uint256"
|
|
9972
|
+
},
|
|
9973
|
+
{
|
|
9974
|
+
internalType: "uint160",
|
|
9975
|
+
name: "sqrtPriceLimitX96",
|
|
9976
|
+
type: "uint160"
|
|
10520
9977
|
}
|
|
10521
9978
|
],
|
|
10522
|
-
|
|
10523
|
-
stateMutability: "view",
|
|
10524
|
-
type: "function"
|
|
10525
|
-
},
|
|
10526
|
-
{
|
|
10527
|
-
constant: false,
|
|
10528
|
-
inputs: [
|
|
10529
|
-
],
|
|
10530
|
-
name: "renounceOwnership",
|
|
9979
|
+
name: "quoteExactOutputSingle",
|
|
10531
9980
|
outputs: [
|
|
9981
|
+
{
|
|
9982
|
+
internalType: "uint256",
|
|
9983
|
+
name: "amountIn",
|
|
9984
|
+
type: "uint256"
|
|
9985
|
+
}
|
|
10532
9986
|
],
|
|
10533
|
-
payable: false,
|
|
10534
9987
|
stateMutability: "nonpayable",
|
|
10535
9988
|
type: "function"
|
|
10536
9989
|
},
|
|
10537
9990
|
{
|
|
10538
|
-
constant: false,
|
|
10539
9991
|
inputs: [
|
|
10540
9992
|
{
|
|
10541
|
-
internalType: "
|
|
10542
|
-
name: "
|
|
10543
|
-
type: "
|
|
9993
|
+
internalType: "int256",
|
|
9994
|
+
name: "amount0Delta",
|
|
9995
|
+
type: "int256"
|
|
9996
|
+
},
|
|
9997
|
+
{
|
|
9998
|
+
internalType: "int256",
|
|
9999
|
+
name: "amount1Delta",
|
|
10000
|
+
type: "int256"
|
|
10001
|
+
},
|
|
10002
|
+
{
|
|
10003
|
+
internalType: "bytes",
|
|
10004
|
+
name: "path",
|
|
10005
|
+
type: "bytes"
|
|
10544
10006
|
}
|
|
10545
10007
|
],
|
|
10546
|
-
name: "
|
|
10008
|
+
name: "uniswapV3SwapCallback",
|
|
10547
10009
|
outputs: [
|
|
10548
10010
|
],
|
|
10549
|
-
|
|
10550
|
-
stateMutability: "nonpayable",
|
|
10011
|
+
stateMutability: "view",
|
|
10551
10012
|
type: "function"
|
|
10552
|
-
}
|
|
10013
|
+
}
|
|
10014
|
+
];
|
|
10015
|
+
var IUniswapV3Quoter = {
|
|
10016
|
+
abi: abi$g
|
|
10017
|
+
};
|
|
10018
|
+
|
|
10019
|
+
function getUniswapV3SwapTxData(_x, _x2, _x3, _x4, _x5, _x6) {
|
|
10020
|
+
return _getUniswapV3SwapTxData.apply(this, arguments);
|
|
10021
|
+
}
|
|
10022
|
+
|
|
10023
|
+
function _getUniswapV3SwapTxData() {
|
|
10024
|
+
_getUniswapV3SwapTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool, assetA, assetB, amountIn, slippage, feeAmount // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10025
|
+
) {
|
|
10026
|
+
var quoterContract, quotedAmountOut, minAmountOut, iUniswapV3Router, swapTx;
|
|
10027
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
10028
|
+
while (1) {
|
|
10029
|
+
switch (_context.prev = _context.next) {
|
|
10030
|
+
case 0:
|
|
10031
|
+
quoterContract = new ethers.Contract(UNISWAPV3_QUOTER_ADDRESS, IUniswapV3Quoter.abi, pool.signer);
|
|
10032
|
+
_context.next = 3;
|
|
10033
|
+
return quoterContract.callStatic.quoteExactInputSingle(assetA, assetB, feeAmount, amountIn.toString(), 0);
|
|
10034
|
+
|
|
10035
|
+
case 3:
|
|
10036
|
+
quotedAmountOut = _context.sent;
|
|
10037
|
+
minAmountOut = quotedAmountOut.mul((100 - slippage) * 100).div(10000);
|
|
10038
|
+
iUniswapV3Router = new ethers.utils.Interface(IUniswapV3Router.abi);
|
|
10039
|
+
swapTx = iUniswapV3Router.encodeFunctionData("exactInputSingle", [[assetA, assetB, feeAmount, pool.address, amountIn.toString(), minAmountOut.toString(), 0]]);
|
|
10040
|
+
return _context.abrupt("return", swapTx);
|
|
10041
|
+
|
|
10042
|
+
case 8:
|
|
10043
|
+
case "end":
|
|
10044
|
+
return _context.stop();
|
|
10045
|
+
}
|
|
10046
|
+
}
|
|
10047
|
+
}, _callee);
|
|
10048
|
+
}));
|
|
10049
|
+
return _getUniswapV3SwapTxData.apply(this, arguments);
|
|
10050
|
+
}
|
|
10051
|
+
|
|
10052
|
+
var IDhedgeEasySwapper = [
|
|
10553
10053
|
{
|
|
10554
|
-
constant: false,
|
|
10555
10054
|
inputs: [
|
|
10556
10055
|
{
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
|
|
10056
|
+
components: [
|
|
10057
|
+
{
|
|
10058
|
+
components: [
|
|
10059
|
+
{
|
|
10060
|
+
internalType: "contract IERC20",
|
|
10061
|
+
name: "token",
|
|
10062
|
+
type: "address"
|
|
10063
|
+
},
|
|
10064
|
+
{
|
|
10065
|
+
internalType: "uint256",
|
|
10066
|
+
name: "amount",
|
|
10067
|
+
type: "uint256"
|
|
10068
|
+
},
|
|
10069
|
+
{
|
|
10070
|
+
components: [
|
|
10071
|
+
{
|
|
10072
|
+
internalType: "bytes32",
|
|
10073
|
+
name: "routerKey",
|
|
10074
|
+
type: "bytes32"
|
|
10075
|
+
},
|
|
10076
|
+
{
|
|
10077
|
+
internalType: "bytes",
|
|
10078
|
+
name: "swapData",
|
|
10079
|
+
type: "bytes"
|
|
10080
|
+
}
|
|
10081
|
+
],
|
|
10082
|
+
internalType: "struct ISwapper.AggregatorData",
|
|
10083
|
+
name: "aggregatorData",
|
|
10084
|
+
type: "tuple"
|
|
10085
|
+
}
|
|
10086
|
+
],
|
|
10087
|
+
internalType: "struct ISwapper.SrcTokenSwapDetails[]",
|
|
10088
|
+
name: "srcData",
|
|
10089
|
+
type: "tuple[]"
|
|
10090
|
+
},
|
|
10091
|
+
{
|
|
10092
|
+
components: [
|
|
10093
|
+
{
|
|
10094
|
+
internalType: "contract IERC20",
|
|
10095
|
+
name: "destToken",
|
|
10096
|
+
type: "address"
|
|
10097
|
+
},
|
|
10098
|
+
{
|
|
10099
|
+
internalType: "uint256",
|
|
10100
|
+
name: "minDestAmount",
|
|
10101
|
+
type: "uint256"
|
|
10102
|
+
}
|
|
10103
|
+
],
|
|
10104
|
+
internalType: "struct ISwapper.DestData",
|
|
10105
|
+
name: "destData",
|
|
10106
|
+
type: "tuple"
|
|
10107
|
+
}
|
|
10108
|
+
],
|
|
10109
|
+
internalType: "struct IWithdrawalVault.MultiInSingleOutData",
|
|
10110
|
+
name: "_swapData",
|
|
10111
|
+
type: "tuple"
|
|
10560
10112
|
},
|
|
10561
10113
|
{
|
|
10562
|
-
internalType: "
|
|
10563
|
-
name: "
|
|
10564
|
-
type: "
|
|
10114
|
+
internalType: "uint256",
|
|
10115
|
+
name: "_expectedDestTokenAmount",
|
|
10116
|
+
type: "uint256"
|
|
10565
10117
|
}
|
|
10566
10118
|
],
|
|
10567
|
-
name: "
|
|
10119
|
+
name: "completeWithdrawal",
|
|
10568
10120
|
outputs: [
|
|
10569
10121
|
],
|
|
10570
|
-
payable: false,
|
|
10571
10122
|
stateMutability: "nonpayable",
|
|
10572
10123
|
type: "function"
|
|
10573
10124
|
},
|
|
10574
10125
|
{
|
|
10575
|
-
constant: false,
|
|
10576
10126
|
inputs: [
|
|
10577
10127
|
{
|
|
10578
10128
|
internalType: "address",
|
|
10579
|
-
name: "
|
|
10129
|
+
name: "_dHedgeVault",
|
|
10580
10130
|
type: "address"
|
|
10581
|
-
}
|
|
10582
|
-
],
|
|
10583
|
-
name: "setFallbackOracle",
|
|
10584
|
-
outputs: [
|
|
10585
|
-
],
|
|
10586
|
-
payable: false,
|
|
10587
|
-
stateMutability: "nonpayable",
|
|
10588
|
-
type: "function"
|
|
10589
|
-
},
|
|
10590
|
-
{
|
|
10591
|
-
constant: true,
|
|
10592
|
-
inputs: [
|
|
10131
|
+
},
|
|
10593
10132
|
{
|
|
10594
10133
|
internalType: "address",
|
|
10595
|
-
name: "
|
|
10134
|
+
name: "_vaultDepositToken",
|
|
10596
10135
|
type: "address"
|
|
10136
|
+
},
|
|
10137
|
+
{
|
|
10138
|
+
internalType: "uint256",
|
|
10139
|
+
name: "_depositAmount",
|
|
10140
|
+
type: "uint256"
|
|
10597
10141
|
}
|
|
10598
10142
|
],
|
|
10599
|
-
name: "
|
|
10143
|
+
name: "depositQuote",
|
|
10600
10144
|
outputs: [
|
|
10601
10145
|
{
|
|
10602
10146
|
internalType: "uint256",
|
|
10603
|
-
name: "",
|
|
10147
|
+
name: "expectedAmountReceived",
|
|
10604
10148
|
type: "uint256"
|
|
10605
10149
|
}
|
|
10606
10150
|
],
|
|
10607
|
-
payable: false,
|
|
10608
10151
|
stateMutability: "view",
|
|
10609
10152
|
type: "function"
|
|
10610
10153
|
},
|
|
10611
10154
|
{
|
|
10612
|
-
constant: true,
|
|
10613
10155
|
inputs: [
|
|
10614
10156
|
{
|
|
10615
|
-
internalType: "address
|
|
10616
|
-
name: "
|
|
10617
|
-
type: "address
|
|
10157
|
+
internalType: "address",
|
|
10158
|
+
name: "_dHedgeVault",
|
|
10159
|
+
type: "address"
|
|
10160
|
+
},
|
|
10161
|
+
{
|
|
10162
|
+
internalType: "contract IERC20",
|
|
10163
|
+
name: "_vaultDepositToken",
|
|
10164
|
+
type: "address"
|
|
10165
|
+
},
|
|
10166
|
+
{
|
|
10167
|
+
internalType: "uint256",
|
|
10168
|
+
name: "_depositAmount",
|
|
10169
|
+
type: "uint256"
|
|
10170
|
+
},
|
|
10171
|
+
{
|
|
10172
|
+
internalType: "uint256",
|
|
10173
|
+
name: "_expectedAmountReceived",
|
|
10174
|
+
type: "uint256"
|
|
10618
10175
|
}
|
|
10619
10176
|
],
|
|
10620
|
-
name: "
|
|
10177
|
+
name: "depositWithCustomCooldown",
|
|
10621
10178
|
outputs: [
|
|
10622
|
-
{
|
|
10623
|
-
internalType: "uint256[]",
|
|
10624
|
-
name: "",
|
|
10625
|
-
type: "uint256[]"
|
|
10626
|
-
}
|
|
10627
10179
|
],
|
|
10628
|
-
|
|
10629
|
-
stateMutability: "view",
|
|
10180
|
+
stateMutability: "nonpayable",
|
|
10630
10181
|
type: "function"
|
|
10631
10182
|
},
|
|
10632
10183
|
{
|
|
10633
|
-
constant: true,
|
|
10634
10184
|
inputs: [
|
|
10635
10185
|
{
|
|
10636
10186
|
internalType: "address",
|
|
10637
|
-
name: "
|
|
10187
|
+
name: "_depositor",
|
|
10638
10188
|
type: "address"
|
|
10639
10189
|
}
|
|
10640
10190
|
],
|
|
10641
|
-
name: "
|
|
10191
|
+
name: "getTrackedAssets",
|
|
10642
10192
|
outputs: [
|
|
10643
10193
|
{
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10194
|
+
components: [
|
|
10195
|
+
{
|
|
10196
|
+
internalType: "address",
|
|
10197
|
+
name: "token",
|
|
10198
|
+
type: "address"
|
|
10199
|
+
},
|
|
10200
|
+
{
|
|
10201
|
+
internalType: "uint256",
|
|
10202
|
+
name: "balance",
|
|
10203
|
+
type: "uint256"
|
|
10204
|
+
}
|
|
10205
|
+
],
|
|
10206
|
+
internalType: "struct IWithdrawalVault.TrackedAsset[]",
|
|
10207
|
+
name: "trackedAssets_",
|
|
10208
|
+
type: "tuple[]"
|
|
10647
10209
|
}
|
|
10648
10210
|
],
|
|
10649
|
-
payable: false,
|
|
10650
10211
|
stateMutability: "view",
|
|
10651
10212
|
type: "function"
|
|
10652
10213
|
},
|
|
10653
10214
|
{
|
|
10654
|
-
constant: true,
|
|
10655
10215
|
inputs: [
|
|
10656
|
-
],
|
|
10657
|
-
name: "getFallbackOracle",
|
|
10658
|
-
outputs: [
|
|
10659
10216
|
{
|
|
10660
10217
|
internalType: "address",
|
|
10661
|
-
name: "",
|
|
10218
|
+
name: "_dHedgeVault",
|
|
10662
10219
|
type: "address"
|
|
10220
|
+
},
|
|
10221
|
+
{
|
|
10222
|
+
internalType: "uint256",
|
|
10223
|
+
name: "_amountIn",
|
|
10224
|
+
type: "uint256"
|
|
10225
|
+
},
|
|
10226
|
+
{
|
|
10227
|
+
internalType: "uint256",
|
|
10228
|
+
name: "_slippageTolerance",
|
|
10229
|
+
type: "uint256"
|
|
10663
10230
|
}
|
|
10664
10231
|
],
|
|
10665
|
-
|
|
10666
|
-
|
|
10232
|
+
name: "initWithdrawal",
|
|
10233
|
+
outputs: [
|
|
10234
|
+
],
|
|
10235
|
+
stateMutability: "nonpayable",
|
|
10667
10236
|
type: "function"
|
|
10668
10237
|
}
|
|
10669
10238
|
];
|
|
10670
|
-
var IPriceOracle = {
|
|
10671
|
-
abi: abi$j
|
|
10672
|
-
};
|
|
10673
|
-
|
|
10674
|
-
function getChainlinkPriceInUsd(_x, _x2) {
|
|
10675
|
-
return _getChainlinkPriceInUsd.apply(this, arguments);
|
|
10676
|
-
}
|
|
10677
|
-
|
|
10678
|
-
function _getChainlinkPriceInUsd() {
|
|
10679
|
-
_getChainlinkPriceInUsd = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool, asset) {
|
|
10680
|
-
var lendingPoolAddressProvider, priceOracleAddress, priceOracle;
|
|
10681
|
-
return runtime_1.wrap(function _callee$(_context) {
|
|
10682
|
-
while (1) {
|
|
10683
|
-
switch (_context.prev = _context.next) {
|
|
10684
|
-
case 0:
|
|
10685
|
-
//Workaround as Chainlink doesn't have feed registry on Polygon/Optimism
|
|
10686
|
-
//Use oracle from Aave which uses Chainlink
|
|
10687
|
-
lendingPoolAddressProvider = new ethers.Contract(aaveAddressProvider[pool.network][Dapp.AAVEV3], IAaveV3PoolAddressProvider.abi, pool.signer);
|
|
10688
|
-
_context.next = 3;
|
|
10689
|
-
return lendingPoolAddressProvider.getPriceOracle();
|
|
10690
|
-
|
|
10691
|
-
case 3:
|
|
10692
|
-
priceOracleAddress = _context.sent;
|
|
10693
|
-
priceOracle = new ethers.Contract(priceOracleAddress, IPriceOracle.abi, pool.signer);
|
|
10694
|
-
_context.next = 7;
|
|
10695
|
-
return priceOracle.getAssetPrice(asset);
|
|
10696
|
-
|
|
10697
|
-
case 7:
|
|
10698
|
-
return _context.abrupt("return", _context.sent);
|
|
10699
|
-
|
|
10700
|
-
case 8:
|
|
10701
|
-
case "end":
|
|
10702
|
-
return _context.stop();
|
|
10703
|
-
}
|
|
10704
|
-
}
|
|
10705
|
-
}, _callee);
|
|
10706
|
-
}));
|
|
10707
|
-
return _getChainlinkPriceInUsd.apply(this, arguments);
|
|
10708
|
-
}
|
|
10709
10239
|
|
|
10710
10240
|
function loadPool(_x, _x2) {
|
|
10711
10241
|
return _loadPool.apply(this, arguments);
|
|
@@ -10763,6 +10293,169 @@ function _isPool() {
|
|
|
10763
10293
|
return _isPool.apply(this, arguments);
|
|
10764
10294
|
}
|
|
10765
10295
|
|
|
10296
|
+
var oneInchBaseUrl = "https://api.1inch.dev/swap/v6.0/";
|
|
10297
|
+
function getOneInchSwapTxData(_x, _x2, _x3, _x4, _x5, _x6) {
|
|
10298
|
+
return _getOneInchSwapTxData.apply(this, arguments);
|
|
10299
|
+
}
|
|
10300
|
+
|
|
10301
|
+
function _getOneInchSwapTxData() {
|
|
10302
|
+
_getOneInchSwapTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool, assetFrom, assetTo, amountIn, slippage, forEasySwapper) {
|
|
10303
|
+
var chainId, apiUrl, params, response, swapTxData, dstAmount;
|
|
10304
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
10305
|
+
while (1) {
|
|
10306
|
+
switch (_context.prev = _context.next) {
|
|
10307
|
+
case 0:
|
|
10308
|
+
if (forEasySwapper === void 0) {
|
|
10309
|
+
forEasySwapper = false;
|
|
10310
|
+
}
|
|
10311
|
+
|
|
10312
|
+
if (process.env.ONEINCH_API_KEY) {
|
|
10313
|
+
_context.next = 3;
|
|
10314
|
+
break;
|
|
10315
|
+
}
|
|
10316
|
+
|
|
10317
|
+
throw new Error("ONEINCH_API_KEY not configured in .env file");
|
|
10318
|
+
|
|
10319
|
+
case 3:
|
|
10320
|
+
chainId = networkChainIdMap[pool.network];
|
|
10321
|
+
apiUrl = "" + oneInchBaseUrl + chainId + "/swap";
|
|
10322
|
+
params = {
|
|
10323
|
+
src: assetFrom,
|
|
10324
|
+
dst: assetTo,
|
|
10325
|
+
amount: amountIn.toString(),
|
|
10326
|
+
from: forEasySwapper ? routerAddress[pool.network].toros : pool.address,
|
|
10327
|
+
receiver: forEasySwapper ? routerAddress[pool.network].toros : pool.address,
|
|
10328
|
+
slippage: slippage,
|
|
10329
|
+
disableEstimate: true,
|
|
10330
|
+
usePermit2: false
|
|
10331
|
+
};
|
|
10332
|
+
_context.prev = 6;
|
|
10333
|
+
_context.next = 9;
|
|
10334
|
+
return axios.get(apiUrl, {
|
|
10335
|
+
headers: {
|
|
10336
|
+
Authorization: "Bearer " + process.env.ONEINCH_API_KEY
|
|
10337
|
+
},
|
|
10338
|
+
params: params
|
|
10339
|
+
});
|
|
10340
|
+
|
|
10341
|
+
case 9:
|
|
10342
|
+
response = _context.sent;
|
|
10343
|
+
swapTxData = response.data.tx.data;
|
|
10344
|
+
dstAmount = response.data.dstAmount;
|
|
10345
|
+
return _context.abrupt("return", {
|
|
10346
|
+
swapTxData: swapTxData,
|
|
10347
|
+
dstAmount: dstAmount
|
|
10348
|
+
});
|
|
10349
|
+
|
|
10350
|
+
case 15:
|
|
10351
|
+
_context.prev = 15;
|
|
10352
|
+
_context.t0 = _context["catch"](6);
|
|
10353
|
+
throw new ApiError("Swap api request of 1inch failed");
|
|
10354
|
+
|
|
10355
|
+
case 18:
|
|
10356
|
+
case "end":
|
|
10357
|
+
return _context.stop();
|
|
10358
|
+
}
|
|
10359
|
+
}
|
|
10360
|
+
}, _callee, null, [[6, 15]]);
|
|
10361
|
+
}));
|
|
10362
|
+
return _getOneInchSwapTxData.apply(this, arguments);
|
|
10363
|
+
}
|
|
10364
|
+
|
|
10365
|
+
var _networkPortMap;
|
|
10366
|
+
|
|
10367
|
+
require("dotenv").config();
|
|
10368
|
+
|
|
10369
|
+
var networkPortMap = (_networkPortMap = {}, _networkPortMap[Network.POLYGON] = 8542, _networkPortMap[Network.OPTIMISM] = 8544, _networkPortMap[Network.ARBITRUM] = 8540, _networkPortMap[Network.BASE] = 8546, _networkPortMap);
|
|
10370
|
+
|
|
10371
|
+
var _TEST_POOL, _CONTRACT_ADDRESS, _USDC_BALANCEOF_SLOT, _WETH_BALANCEOF_SLOT;
|
|
10372
|
+
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);
|
|
10373
|
+
var CONTRACT_ADDRESS = (_CONTRACT_ADDRESS = {}, _CONTRACT_ADDRESS[Network.POLYGON] = {
|
|
10374
|
+
USDC: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
|
10375
|
+
USDT: "",
|
|
10376
|
+
SUSD: "",
|
|
10377
|
+
SWETH: "",
|
|
10378
|
+
WETH: "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
|
|
10379
|
+
WBTC: "0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",
|
|
10380
|
+
ARRAKIS_USDC_WETH_GAUGE: "0x33d1ad9Cd88A509397CD924C2d7613C285602C20",
|
|
10381
|
+
ARRAKIS_USDC_WETH_LP: "0xa173340f1e942c2845bcbce8ebd411022e18eb13",
|
|
10382
|
+
WMATIC: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
|
|
10383
|
+
uniswapV3: {
|
|
10384
|
+
nonfungiblePositionManager: "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"
|
|
10385
|
+
},
|
|
10386
|
+
VELODROME_CL_USDC_WETH_GAUGE: "",
|
|
10387
|
+
VELO: "",
|
|
10388
|
+
COMPOUNDV3_WETH: "",
|
|
10389
|
+
TOROS: ""
|
|
10390
|
+
}, _CONTRACT_ADDRESS[Network.OPTIMISM] = {
|
|
10391
|
+
USDC: "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
|
|
10392
|
+
USDT: "",
|
|
10393
|
+
SWETH: "",
|
|
10394
|
+
SUSD: "0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9",
|
|
10395
|
+
WETH: "0x4200000000000000000000000000000000000006",
|
|
10396
|
+
WBTC: "0x68f180fcCe6836688e9084f035309E29Bf0A2095",
|
|
10397
|
+
KWENTA_ETH_PERP_V2: "0x2b3bb4c683bfc5239b029131eef3b1d214478d93",
|
|
10398
|
+
uniswapV3: {
|
|
10399
|
+
nonfungiblePositionManager: "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"
|
|
10400
|
+
},
|
|
10401
|
+
WMATIC: "",
|
|
10402
|
+
//
|
|
10403
|
+
ARRAKIS_USDC_WETH_GAUGE: "",
|
|
10404
|
+
ARRAKIS_USDC_WETH_LP: "",
|
|
10405
|
+
VELODROME_CL_USDC_WETH_GAUGE: "0xa75127121d28a9BF848F3B70e7Eea26570aa7700",
|
|
10406
|
+
VELO: "0x9560e827aF36c94D2Ac33a39bCE1Fe78631088Db",
|
|
10407
|
+
COMPOUNDV3_WETH: "",
|
|
10408
|
+
TOROS: "0x49bf093277bf4dde49c48c6aa55a3bda3eedef68" //USDmny
|
|
10409
|
+
|
|
10410
|
+
}, _CONTRACT_ADDRESS[Network.ARBITRUM] = {
|
|
10411
|
+
USDC: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
10412
|
+
USDT: "",
|
|
10413
|
+
SUSD: "",
|
|
10414
|
+
SWETH: "0xbc011A12Da28e8F0f528d9eE5E7039E22F91cf18",
|
|
10415
|
+
WETH: "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
|
|
10416
|
+
WBTC: "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f",
|
|
10417
|
+
WSTETH: "0x5979d7b546e38e414f7e9822514be443a4800529",
|
|
10418
|
+
BALANCER_WSTETH_WETH_POOL: "0x36bf227d6bac96e2ab1ebb5492ecec69c691943f",
|
|
10419
|
+
BALANCER_WSTETH_WETH_GAUGE: "0x251e51b25afa40f2b6b9f05aaf1bc7eaa0551771",
|
|
10420
|
+
uniswapV3: {
|
|
10421
|
+
nonfungiblePositionManager: "0xC36442b4a4522E871399CD717aBDD847Ab11FE88"
|
|
10422
|
+
},
|
|
10423
|
+
//
|
|
10424
|
+
ARRAKIS_USDC_WETH_GAUGE: "",
|
|
10425
|
+
ARRAKIS_USDC_WETH_LP: "",
|
|
10426
|
+
WMATIC: "",
|
|
10427
|
+
VELODROME_CL_USDC_WETH_GAUGE: "",
|
|
10428
|
+
VELO: "",
|
|
10429
|
+
COMPOUNDV3_WETH: "0x6f7D514bbD4aFf3BcD1140B7344b32f063dEe486",
|
|
10430
|
+
TOROS: ""
|
|
10431
|
+
}, _CONTRACT_ADDRESS[Network.BASE] = {
|
|
10432
|
+
USDC: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
|
|
10433
|
+
USDT: "0xfde4c96c8593536e31f229ea8f37b2ada2699bb2",
|
|
10434
|
+
SUSD: "",
|
|
10435
|
+
WETH: "0x4200000000000000000000000000000000000006",
|
|
10436
|
+
WBTC: "",
|
|
10437
|
+
SWETH: "",
|
|
10438
|
+
uniswapV3: {
|
|
10439
|
+
nonfungiblePositionManager: ""
|
|
10440
|
+
},
|
|
10441
|
+
//
|
|
10442
|
+
ARRAKIS_USDC_WETH_GAUGE: "",
|
|
10443
|
+
ARRAKIS_USDC_WETH_LP: "",
|
|
10444
|
+
WMATIC: "",
|
|
10445
|
+
VELODROME_CL_USDC_WETH_GAUGE: "0xF33a96b5932D9E9B9A0eDA447AbD8C9d48d2e0c8",
|
|
10446
|
+
VELO: "0x940181a94A35A4569E4529A3CDfB74e38FD98631",
|
|
10447
|
+
COMPOUNDV3_WETH: "",
|
|
10448
|
+
TOROS: ""
|
|
10449
|
+
}, _CONTRACT_ADDRESS);
|
|
10450
|
+
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);
|
|
10451
|
+
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);
|
|
10452
|
+
|
|
10453
|
+
var wait = function wait(seconds) {
|
|
10454
|
+
return new Promise(function (resolve) {
|
|
10455
|
+
return setTimeout(resolve, seconds * 1000);
|
|
10456
|
+
});
|
|
10457
|
+
};
|
|
10458
|
+
|
|
10766
10459
|
function getPoolDepositAsset(_x, _x2, _x3) {
|
|
10767
10460
|
return _getPoolDepositAsset.apply(this, arguments);
|
|
10768
10461
|
}
|
|
@@ -10811,52 +10504,20 @@ function _getPoolDepositAsset() {
|
|
|
10811
10504
|
return _getPoolDepositAsset.apply(this, arguments);
|
|
10812
10505
|
}
|
|
10813
10506
|
|
|
10814
|
-
function
|
|
10815
|
-
return _getTorosPoolTokenPrice.apply(this, arguments);
|
|
10816
|
-
}
|
|
10817
|
-
|
|
10818
|
-
function _getTorosPoolTokenPrice() {
|
|
10819
|
-
_getTorosPoolTokenPrice = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(pool, poolAddress) {
|
|
10820
|
-
var torosPool;
|
|
10821
|
-
return runtime_1.wrap(function _callee2$(_context2) {
|
|
10822
|
-
while (1) {
|
|
10823
|
-
switch (_context2.prev = _context2.next) {
|
|
10824
|
-
case 0:
|
|
10825
|
-
_context2.next = 2;
|
|
10826
|
-
return loadPool(pool, poolAddress);
|
|
10827
|
-
|
|
10828
|
-
case 2:
|
|
10829
|
-
torosPool = _context2.sent;
|
|
10830
|
-
_context2.next = 5;
|
|
10831
|
-
return torosPool.poolLogic.tokenPrice();
|
|
10832
|
-
|
|
10833
|
-
case 5:
|
|
10834
|
-
return _context2.abrupt("return", _context2.sent);
|
|
10835
|
-
|
|
10836
|
-
case 6:
|
|
10837
|
-
case "end":
|
|
10838
|
-
return _context2.stop();
|
|
10839
|
-
}
|
|
10840
|
-
}
|
|
10841
|
-
}, _callee2);
|
|
10842
|
-
}));
|
|
10843
|
-
return _getTorosPoolTokenPrice.apply(this, arguments);
|
|
10844
|
-
}
|
|
10845
|
-
|
|
10846
|
-
function getEasySwapperDepositQuote(_x6, _x7, _x8, _x9, _x10) {
|
|
10507
|
+
function getEasySwapperDepositQuote(_x6, _x7, _x8, _x9) {
|
|
10847
10508
|
return _getEasySwapperDepositQuote.apply(this, arguments);
|
|
10848
10509
|
}
|
|
10849
10510
|
|
|
10850
10511
|
function _getEasySwapperDepositQuote() {
|
|
10851
|
-
_getEasySwapperDepositQuote = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(pool, torosAsset, investAsset,
|
|
10512
|
+
_getEasySwapperDepositQuote = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(pool, torosAsset, investAsset, amountIn) {
|
|
10852
10513
|
var easySwapper;
|
|
10853
10514
|
return runtime_1.wrap(function _callee3$(_context3) {
|
|
10854
10515
|
while (1) {
|
|
10855
10516
|
switch (_context3.prev = _context3.next) {
|
|
10856
10517
|
case 0:
|
|
10857
|
-
easySwapper = new ethers.Contract(routerAddress[pool.network][Dapp.TOROS], IDhedgeEasySwapper
|
|
10518
|
+
easySwapper = new ethers.Contract(routerAddress[pool.network][Dapp.TOROS], IDhedgeEasySwapper, pool.signer);
|
|
10858
10519
|
_context3.next = 3;
|
|
10859
|
-
return easySwapper.depositQuote(torosAsset, investAsset, amountIn
|
|
10520
|
+
return easySwapper.depositQuote(torosAsset, investAsset, amountIn);
|
|
10860
10521
|
|
|
10861
10522
|
case 3:
|
|
10862
10523
|
return _context3.abrupt("return", _context3.sent);
|
|
@@ -10866,51 +10527,19 @@ function _getEasySwapperDepositQuote() {
|
|
|
10866
10527
|
return _context3.stop();
|
|
10867
10528
|
}
|
|
10868
10529
|
}
|
|
10869
|
-
}, _callee3);
|
|
10870
|
-
}));
|
|
10871
|
-
return _getEasySwapperDepositQuote.apply(this, arguments);
|
|
10872
|
-
}
|
|
10873
|
-
|
|
10874
|
-
function getEasySwapperWithdrawalQuote(_x11, _x12, _x13, _x14) {
|
|
10875
|
-
return _getEasySwapperWithdrawalQuote.apply(this, arguments);
|
|
10876
|
-
}
|
|
10877
|
-
|
|
10878
|
-
function _getEasySwapperWithdrawalQuote() {
|
|
10879
|
-
_getEasySwapperWithdrawalQuote = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(pool, torosAsset, investAsset, amountIn) {
|
|
10880
|
-
var _yield$Promise$all, torosTokenPrice, assetPrice, assetDecimals;
|
|
10881
|
-
|
|
10882
|
-
return runtime_1.wrap(function _callee4$(_context4) {
|
|
10883
|
-
while (1) {
|
|
10884
|
-
switch (_context4.prev = _context4.next) {
|
|
10885
|
-
case 0:
|
|
10886
|
-
_context4.next = 2;
|
|
10887
|
-
return Promise.all([getTorosPoolTokenPrice(pool, torosAsset), getChainlinkPriceInUsd(pool, investAsset), pool.utils.getDecimals(investAsset)]);
|
|
10888
|
-
|
|
10889
|
-
case 2:
|
|
10890
|
-
_yield$Promise$all = _context4.sent;
|
|
10891
|
-
torosTokenPrice = _yield$Promise$all[0];
|
|
10892
|
-
assetPrice = _yield$Promise$all[1];
|
|
10893
|
-
assetDecimals = _yield$Promise$all[2];
|
|
10894
|
-
return _context4.abrupt("return", amountIn.mul(torosTokenPrice).div(assetPrice).div(1e10).div(Math.pow(10, 18 - assetDecimals)));
|
|
10895
|
-
|
|
10896
|
-
case 7:
|
|
10897
|
-
case "end":
|
|
10898
|
-
return _context4.stop();
|
|
10899
|
-
}
|
|
10900
|
-
}
|
|
10901
|
-
}, _callee4);
|
|
10530
|
+
}, _callee3);
|
|
10902
10531
|
}));
|
|
10903
|
-
return
|
|
10532
|
+
return _getEasySwapperDepositQuote.apply(this, arguments);
|
|
10904
10533
|
}
|
|
10905
10534
|
|
|
10906
|
-
function getEasySwapperTxData(_x15, _x16, _x17, _x18
|
|
10535
|
+
function getEasySwapperTxData(_x14, _x15, _x16, _x17, _x18) {
|
|
10907
10536
|
return _getEasySwapperTxData.apply(this, arguments);
|
|
10908
10537
|
}
|
|
10909
10538
|
|
|
10910
10539
|
function _getEasySwapperTxData() {
|
|
10911
10540
|
_getEasySwapperTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(pool, assetFrom, assetTo, amountIn, slippage // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10912
10541
|
) {
|
|
10913
|
-
var isWithdrawal, _ref, torosAsset, investAsset, iDhedgeEasySwapper,
|
|
10542
|
+
var isWithdrawal, _ref, torosAsset, investAsset, iDhedgeEasySwapper, depositAsset, minAmountOut;
|
|
10914
10543
|
|
|
10915
10544
|
return runtime_1.wrap(function _callee5$(_context5) {
|
|
10916
10545
|
while (1) {
|
|
@@ -10922,43 +10551,46 @@ function _getEasySwapperTxData() {
|
|
|
10922
10551
|
case 2:
|
|
10923
10552
|
isWithdrawal = _context5.sent;
|
|
10924
10553
|
_ref = isWithdrawal ? [assetFrom, assetTo] : [assetTo, assetFrom], torosAsset = _ref[0], investAsset = _ref[1];
|
|
10925
|
-
iDhedgeEasySwapper = new ethers.utils.Interface(IDhedgeEasySwapper
|
|
10554
|
+
iDhedgeEasySwapper = new ethers.utils.Interface(IDhedgeEasySwapper);
|
|
10926
10555
|
|
|
10927
10556
|
if (!isWithdrawal) {
|
|
10928
|
-
_context5.next =
|
|
10557
|
+
_context5.next = 9;
|
|
10929
10558
|
break;
|
|
10930
10559
|
}
|
|
10931
10560
|
|
|
10932
|
-
_context5.
|
|
10933
|
-
return getEasySwapperWithdrawalQuote(pool, torosAsset, investAsset, amountIn);
|
|
10934
|
-
|
|
10935
|
-
case 8:
|
|
10936
|
-
minAmountOut = _context5.sent;
|
|
10937
|
-
return _context5.abrupt("return", iDhedgeEasySwapper.encodeFunctionData("withdraw", [torosAsset, amountIn, investAsset, minAmountOut.mul(10000 - slippage * 100).div(10000)]));
|
|
10561
|
+
return _context5.abrupt("return", iDhedgeEasySwapper.encodeFunctionData("initWithdrawal", [torosAsset, amountIn, slippage * 100]));
|
|
10938
10562
|
|
|
10939
|
-
case
|
|
10940
|
-
_context5.next =
|
|
10563
|
+
case 9:
|
|
10564
|
+
_context5.next = 11;
|
|
10941
10565
|
return getPoolDepositAsset(pool, torosAsset, investAsset);
|
|
10942
10566
|
|
|
10943
|
-
case
|
|
10567
|
+
case 11:
|
|
10944
10568
|
depositAsset = _context5.sent;
|
|
10945
10569
|
|
|
10946
10570
|
if (depositAsset) {
|
|
10947
|
-
_context5.next =
|
|
10571
|
+
_context5.next = 14;
|
|
10948
10572
|
break;
|
|
10949
10573
|
}
|
|
10950
10574
|
|
|
10951
10575
|
throw new Error("no deposit assets");
|
|
10952
10576
|
|
|
10953
|
-
case
|
|
10954
|
-
|
|
10955
|
-
|
|
10577
|
+
case 14:
|
|
10578
|
+
if (!(depositAsset.toLowerCase() !== investAsset.toLowerCase())) {
|
|
10579
|
+
_context5.next = 16;
|
|
10580
|
+
break;
|
|
10581
|
+
}
|
|
10956
10582
|
|
|
10957
|
-
|
|
10958
|
-
_minAmountOut = _context5.sent;
|
|
10959
|
-
return _context5.abrupt("return", iDhedgeEasySwapper.encodeFunctionData("depositWithCustomCooldown", [torosAsset, investAsset, amountIn, depositAsset, _minAmountOut.mul(10000 - slippage * 100).div(10000)]));
|
|
10583
|
+
throw new Error("can only trade deposit asset");
|
|
10960
10584
|
|
|
10961
|
-
case
|
|
10585
|
+
case 16:
|
|
10586
|
+
_context5.next = 18;
|
|
10587
|
+
return getEasySwapperDepositQuote(pool, torosAsset, investAsset, amountIn);
|
|
10588
|
+
|
|
10589
|
+
case 18:
|
|
10590
|
+
minAmountOut = _context5.sent;
|
|
10591
|
+
return _context5.abrupt("return", iDhedgeEasySwapper.encodeFunctionData("depositWithCustomCooldown", [torosAsset, depositAsset, amountIn, minAmountOut.mul(10000 - slippage * 100).div(10000)]));
|
|
10592
|
+
|
|
10593
|
+
case 20:
|
|
10962
10594
|
case "end":
|
|
10963
10595
|
return _context5.stop();
|
|
10964
10596
|
}
|
|
@@ -10968,7 +10600,83 @@ function _getEasySwapperTxData() {
|
|
|
10968
10600
|
return _getEasySwapperTxData.apply(this, arguments);
|
|
10969
10601
|
}
|
|
10970
10602
|
|
|
10971
|
-
|
|
10603
|
+
function getCompleteWithdrawalTxData(_x19, _x20, _x21) {
|
|
10604
|
+
return _getCompleteWithdrawalTxData.apply(this, arguments);
|
|
10605
|
+
}
|
|
10606
|
+
|
|
10607
|
+
function _getCompleteWithdrawalTxData() {
|
|
10608
|
+
_getCompleteWithdrawalTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(pool, destToken, slippage // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10609
|
+
) {
|
|
10610
|
+
var easySwapper, trackedAssets, trackedAssetsExcludingDestToken, srcData, minDestAmount, _iterator, _step, _step$value, token, balance, _yield$getOneInchSwap, swapTxData, dstAmount;
|
|
10611
|
+
|
|
10612
|
+
return runtime_1.wrap(function _callee6$(_context6) {
|
|
10613
|
+
while (1) {
|
|
10614
|
+
switch (_context6.prev = _context6.next) {
|
|
10615
|
+
case 0:
|
|
10616
|
+
easySwapper = new ethers.Contract(routerAddress[pool.network][Dapp.TOROS], IDhedgeEasySwapper, pool.signer);
|
|
10617
|
+
_context6.next = 3;
|
|
10618
|
+
return easySwapper.getTrackedAssets(pool.address);
|
|
10619
|
+
|
|
10620
|
+
case 3:
|
|
10621
|
+
trackedAssets = _context6.sent;
|
|
10622
|
+
trackedAssetsExcludingDestToken = trackedAssets.filter(function (_ref2) {
|
|
10623
|
+
var token = _ref2.token;
|
|
10624
|
+
return token.toLowerCase() !== destToken.toLowerCase();
|
|
10625
|
+
});
|
|
10626
|
+
srcData = [];
|
|
10627
|
+
minDestAmount = ethers.BigNumber.from(0);
|
|
10628
|
+
_iterator = _createForOfIteratorHelperLoose(trackedAssetsExcludingDestToken);
|
|
10629
|
+
|
|
10630
|
+
case 8:
|
|
10631
|
+
if ((_step = _iterator()).done) {
|
|
10632
|
+
_context6.next = 21;
|
|
10633
|
+
break;
|
|
10634
|
+
}
|
|
10635
|
+
|
|
10636
|
+
_step$value = _step.value, token = _step$value.token, balance = _step$value.balance;
|
|
10637
|
+
_context6.next = 12;
|
|
10638
|
+
return getOneInchSwapTxData(pool, token, destToken, balance, slippage, true);
|
|
10639
|
+
|
|
10640
|
+
case 12:
|
|
10641
|
+
_yield$getOneInchSwap = _context6.sent;
|
|
10642
|
+
swapTxData = _yield$getOneInchSwap.swapTxData;
|
|
10643
|
+
dstAmount = _yield$getOneInchSwap.dstAmount;
|
|
10644
|
+
srcData.push({
|
|
10645
|
+
token: token,
|
|
10646
|
+
amount: balance,
|
|
10647
|
+
aggregatorData: {
|
|
10648
|
+
routerKey: ethers.utils.formatBytes32String("ONE_INCH"),
|
|
10649
|
+
swapData: swapTxData
|
|
10650
|
+
}
|
|
10651
|
+
});
|
|
10652
|
+
minDestAmount = minDestAmount.add(dstAmount);
|
|
10653
|
+
_context6.next = 19;
|
|
10654
|
+
return wait(2);
|
|
10655
|
+
|
|
10656
|
+
case 19:
|
|
10657
|
+
_context6.next = 8;
|
|
10658
|
+
break;
|
|
10659
|
+
|
|
10660
|
+
case 21:
|
|
10661
|
+
return _context6.abrupt("return", easySwapper["interface"].encodeFunctionData("completeWithdrawal", [{
|
|
10662
|
+
srcData: srcData,
|
|
10663
|
+
destData: {
|
|
10664
|
+
destToken: destToken,
|
|
10665
|
+
minDestAmount: minDestAmount
|
|
10666
|
+
}
|
|
10667
|
+
}, minDestAmount.mul(10000 - slippage * 100).div(10000)]));
|
|
10668
|
+
|
|
10669
|
+
case 22:
|
|
10670
|
+
case "end":
|
|
10671
|
+
return _context6.stop();
|
|
10672
|
+
}
|
|
10673
|
+
}
|
|
10674
|
+
}, _callee6);
|
|
10675
|
+
}));
|
|
10676
|
+
return _getCompleteWithdrawalTxData.apply(this, arguments);
|
|
10677
|
+
}
|
|
10678
|
+
|
|
10679
|
+
var abi$h = [
|
|
10972
10680
|
{
|
|
10973
10681
|
inputs: [
|
|
10974
10682
|
{
|
|
@@ -11895,10 +11603,10 @@ var abi$k = [
|
|
|
11895
11603
|
}
|
|
11896
11604
|
];
|
|
11897
11605
|
var IAaveV3Incentives = {
|
|
11898
|
-
abi: abi$
|
|
11606
|
+
abi: abi$h
|
|
11899
11607
|
};
|
|
11900
11608
|
|
|
11901
|
-
var abi$
|
|
11609
|
+
var abi$i = [
|
|
11902
11610
|
{
|
|
11903
11611
|
inputs: [
|
|
11904
11612
|
{
|
|
@@ -13647,7 +13355,7 @@ var abi$l = [
|
|
|
13647
13355
|
}
|
|
13648
13356
|
];
|
|
13649
13357
|
var ILendingPoolV3 = {
|
|
13650
|
-
abi: abi$
|
|
13358
|
+
abi: abi$i
|
|
13651
13359
|
};
|
|
13652
13360
|
|
|
13653
13361
|
function getAaveAssetsForUnderlying(_x, _x2, _x3) {
|
|
@@ -13718,7 +13426,7 @@ function _getAaveV3ClaimTxData() {
|
|
|
13718
13426
|
return _getAaveV3ClaimTxData.apply(this, arguments);
|
|
13719
13427
|
}
|
|
13720
13428
|
|
|
13721
|
-
var abi$
|
|
13429
|
+
var abi$j = [
|
|
13722
13430
|
{
|
|
13723
13431
|
inputs: [
|
|
13724
13432
|
{
|
|
@@ -14700,7 +14408,7 @@ var abi$m = [
|
|
|
14700
14408
|
}
|
|
14701
14409
|
];
|
|
14702
14410
|
var IVelodromeRouter = {
|
|
14703
|
-
abi: abi$
|
|
14411
|
+
abi: abi$j
|
|
14704
14412
|
};
|
|
14705
14413
|
|
|
14706
14414
|
function getVelodromeAddLiquidityTxData(_x, _x2, _x3, _x4, _x5, _x6) {
|
|
@@ -14807,7 +14515,7 @@ function _getVelodromeClOwner() {
|
|
|
14807
14515
|
return _getVelodromeClOwner.apply(this, arguments);
|
|
14808
14516
|
}
|
|
14809
14517
|
|
|
14810
|
-
var abi$
|
|
14518
|
+
var abi$k = [
|
|
14811
14519
|
{
|
|
14812
14520
|
inputs: [
|
|
14813
14521
|
{
|
|
@@ -15849,10 +15557,10 @@ var abi$n = [
|
|
|
15849
15557
|
}
|
|
15850
15558
|
];
|
|
15851
15559
|
var IVelodromeGaugeV1 = {
|
|
15852
|
-
abi: abi$
|
|
15560
|
+
abi: abi$k
|
|
15853
15561
|
};
|
|
15854
15562
|
|
|
15855
|
-
var abi$
|
|
15563
|
+
var abi$l = [
|
|
15856
15564
|
{
|
|
15857
15565
|
inputs: [
|
|
15858
15566
|
{
|
|
@@ -16052,10 +15760,10 @@ var abi$o = [
|
|
|
16052
15760
|
}
|
|
16053
15761
|
];
|
|
16054
15762
|
var IVelodromeGaugeV2 = {
|
|
16055
|
-
abi: abi$
|
|
15763
|
+
abi: abi$l
|
|
16056
15764
|
};
|
|
16057
15765
|
|
|
16058
|
-
var abi$
|
|
15766
|
+
var abi$m = [
|
|
16059
15767
|
{
|
|
16060
15768
|
inputs: [
|
|
16061
15769
|
{
|
|
@@ -16226,7 +15934,7 @@ var abi$p = [
|
|
|
16226
15934
|
}
|
|
16227
15935
|
];
|
|
16228
15936
|
var IVelodromeCLGauge = {
|
|
16229
|
-
abi: abi$
|
|
15937
|
+
abi: abi$m
|
|
16230
15938
|
};
|
|
16231
15939
|
|
|
16232
15940
|
function call(_x, _x2, _x3, _x4) {
|
|
@@ -16512,7 +16220,7 @@ function _getStrike() {
|
|
|
16512
16220
|
return _getStrike.apply(this, arguments);
|
|
16513
16221
|
}
|
|
16514
16222
|
|
|
16515
|
-
var abi$
|
|
16223
|
+
var abi$n = [
|
|
16516
16224
|
{
|
|
16517
16225
|
inputs: [
|
|
16518
16226
|
{
|
|
@@ -17864,7 +17572,7 @@ var abi$q = [
|
|
|
17864
17572
|
}
|
|
17865
17573
|
];
|
|
17866
17574
|
var IOptionMarketWrapper = {
|
|
17867
|
-
abi: abi$
|
|
17575
|
+
abi: abi$n
|
|
17868
17576
|
};
|
|
17869
17577
|
|
|
17870
17578
|
function getLyraTradeOptionType(isCall, isLong, isCoveredCall) {
|
|
@@ -17881,7 +17589,7 @@ function isLong(optionType) {
|
|
|
17881
17589
|
return optionType === 0 || optionType === 1;
|
|
17882
17590
|
}
|
|
17883
17591
|
|
|
17884
|
-
var abi$
|
|
17592
|
+
var abi$o = [
|
|
17885
17593
|
{
|
|
17886
17594
|
inputs: [
|
|
17887
17595
|
{
|
|
@@ -20215,7 +19923,7 @@ var abi$r = [
|
|
|
20215
19923
|
}
|
|
20216
19924
|
];
|
|
20217
19925
|
var IOptionToken = {
|
|
20218
|
-
abi: abi$
|
|
19926
|
+
abi: abi$o
|
|
20219
19927
|
};
|
|
20220
19928
|
|
|
20221
19929
|
function getOptionPositions(_x, _x2) {
|
|
@@ -20353,7 +20061,7 @@ function _getLyraOptionTxData() {
|
|
|
20353
20061
|
return _getLyraOptionTxData.apply(this, arguments);
|
|
20354
20062
|
}
|
|
20355
20063
|
|
|
20356
|
-
var abi$
|
|
20064
|
+
var abi$p = [
|
|
20357
20065
|
{
|
|
20358
20066
|
inputs: [
|
|
20359
20067
|
{
|
|
@@ -20898,7 +20606,7 @@ var abi$s = [
|
|
|
20898
20606
|
}
|
|
20899
20607
|
];
|
|
20900
20608
|
var ISynthetixFuturesMarketV2 = {
|
|
20901
|
-
abi: abi$
|
|
20609
|
+
abi: abi$p
|
|
20902
20610
|
};
|
|
20903
20611
|
|
|
20904
20612
|
function getFuturesChangeMarginTxData(amount) {
|
|
@@ -21049,67 +20757,7 @@ var getZeroExTradeTxData = /*#__PURE__*/function () {
|
|
|
21049
20757
|
};
|
|
21050
20758
|
}();
|
|
21051
20759
|
|
|
21052
|
-
var
|
|
21053
|
-
function getOneInchSwapTxData(_x, _x2, _x3, _x4, _x5) {
|
|
21054
|
-
return _getOneInchSwapTxData.apply(this, arguments);
|
|
21055
|
-
}
|
|
21056
|
-
|
|
21057
|
-
function _getOneInchSwapTxData() {
|
|
21058
|
-
_getOneInchSwapTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool, assetFrom, assetTo, amountIn, slippage) {
|
|
21059
|
-
var chainId, apiUrl, params, response;
|
|
21060
|
-
return runtime_1.wrap(function _callee$(_context) {
|
|
21061
|
-
while (1) {
|
|
21062
|
-
switch (_context.prev = _context.next) {
|
|
21063
|
-
case 0:
|
|
21064
|
-
if (process.env.ONEINCH_API_KEY) {
|
|
21065
|
-
_context.next = 2;
|
|
21066
|
-
break;
|
|
21067
|
-
}
|
|
21068
|
-
|
|
21069
|
-
throw new Error("ONEINCH_API_KEY not configured in .env file");
|
|
21070
|
-
|
|
21071
|
-
case 2:
|
|
21072
|
-
chainId = networkChainIdMap[pool.network];
|
|
21073
|
-
apiUrl = "" + oneInchBaseUrl + chainId + "/swap";
|
|
21074
|
-
params = {
|
|
21075
|
-
src: assetFrom,
|
|
21076
|
-
dst: assetTo,
|
|
21077
|
-
amount: amountIn.toString(),
|
|
21078
|
-
from: pool.address,
|
|
21079
|
-
origin: pool.signer.address,
|
|
21080
|
-
slippage: slippage,
|
|
21081
|
-
disableEstimate: true,
|
|
21082
|
-
usePermit2: false
|
|
21083
|
-
};
|
|
21084
|
-
_context.prev = 5;
|
|
21085
|
-
_context.next = 8;
|
|
21086
|
-
return axios.get(apiUrl, {
|
|
21087
|
-
headers: {
|
|
21088
|
-
Authorization: "Bearer " + process.env.ONEINCH_API_KEY
|
|
21089
|
-
},
|
|
21090
|
-
params: params
|
|
21091
|
-
});
|
|
21092
|
-
|
|
21093
|
-
case 8:
|
|
21094
|
-
response = _context.sent;
|
|
21095
|
-
return _context.abrupt("return", response.data.tx.data);
|
|
21096
|
-
|
|
21097
|
-
case 12:
|
|
21098
|
-
_context.prev = 12;
|
|
21099
|
-
_context.t0 = _context["catch"](5);
|
|
21100
|
-
throw new ApiError("Swap api request of 1inch failed");
|
|
21101
|
-
|
|
21102
|
-
case 15:
|
|
21103
|
-
case "end":
|
|
21104
|
-
return _context.stop();
|
|
21105
|
-
}
|
|
21106
|
-
}
|
|
21107
|
-
}, _callee, null, [[5, 12]]);
|
|
21108
|
-
}));
|
|
21109
|
-
return _getOneInchSwapTxData.apply(this, arguments);
|
|
21110
|
-
}
|
|
21111
|
-
|
|
21112
|
-
var abi$t = [
|
|
20760
|
+
var abi$q = [
|
|
21113
20761
|
{
|
|
21114
20762
|
inputs: [
|
|
21115
20763
|
{
|
|
@@ -21210,17 +20858,21 @@ var abi$t = [
|
|
|
21210
20858
|
}
|
|
21211
20859
|
];
|
|
21212
20860
|
var IXRam = {
|
|
21213
|
-
abi: abi$
|
|
20861
|
+
abi: abi$q
|
|
21214
20862
|
};
|
|
21215
20863
|
|
|
21216
20864
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
21217
20865
|
var iXRam = /*#__PURE__*/new ethers.utils.Interface(IXRam.abi);
|
|
20866
|
+
var iRamsesNonfungiblePositionManager = /*#__PURE__*/new ethers.utils.Interface(IRamsesNonfungiblePositionManager);
|
|
21218
20867
|
function getCreateVestTxData(amount) {
|
|
21219
20868
|
return iXRam.encodeFunctionData("createVest", [amount]);
|
|
21220
20869
|
}
|
|
21221
20870
|
function getExitVestTxData(vestId) {
|
|
21222
20871
|
return iXRam.encodeFunctionData("exitVest", [vestId, false]);
|
|
21223
20872
|
}
|
|
20873
|
+
function getRewardsTxDta(tokenId, rewards) {
|
|
20874
|
+
return iRamsesNonfungiblePositionManager.encodeFunctionData("getReward", [tokenId, rewards]);
|
|
20875
|
+
}
|
|
21224
20876
|
|
|
21225
20877
|
var DelayedOrderAbi = [
|
|
21226
20878
|
{
|
|
@@ -24541,7 +24193,8 @@ var Pool = /*#__PURE__*/function () {
|
|
|
24541
24193
|
/*#__PURE__*/
|
|
24542
24194
|
function () {
|
|
24543
24195
|
var _trade = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(dapp, assetFrom, assetTo, amountIn, slippage, options, estimateGas) {
|
|
24544
|
-
var swapTxData, iSynthetix, assets, daoAddress, iUniswapV2Router, minAmountOut, tx;
|
|
24196
|
+
var swapTxData, _yield$getOneInchSwap, iSynthetix, assets, daoAddress, iUniswapV2Router, minAmountOut, tx;
|
|
24197
|
+
|
|
24545
24198
|
return runtime_1.wrap(function _callee10$(_context10) {
|
|
24546
24199
|
while (1) {
|
|
24547
24200
|
switch (_context10.prev = _context10.next) {
|
|
@@ -24559,7 +24212,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
24559
24212
|
}
|
|
24560
24213
|
|
|
24561
24214
|
_context10.t0 = dapp;
|
|
24562
|
-
_context10.next = _context10.t0 === Dapp.ZEROEX ? 6 : _context10.t0 === Dapp.ONEINCH ? 10 : _context10.t0 === Dapp.BALANCER ?
|
|
24215
|
+
_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;
|
|
24563
24216
|
break;
|
|
24564
24217
|
|
|
24565
24218
|
case 6:
|
|
@@ -24568,51 +24221,52 @@ var Pool = /*#__PURE__*/function () {
|
|
|
24568
24221
|
|
|
24569
24222
|
case 8:
|
|
24570
24223
|
swapTxData = _context10.sent;
|
|
24571
|
-
return _context10.abrupt("break",
|
|
24224
|
+
return _context10.abrupt("break", 45);
|
|
24572
24225
|
|
|
24573
24226
|
case 10:
|
|
24574
24227
|
_context10.next = 12;
|
|
24575
24228
|
return getOneInchSwapTxData(this, assetFrom, assetTo, amountIn, slippage);
|
|
24576
24229
|
|
|
24577
24230
|
case 12:
|
|
24578
|
-
|
|
24579
|
-
|
|
24231
|
+
_yield$getOneInchSwap = _context10.sent;
|
|
24232
|
+
swapTxData = _yield$getOneInchSwap.swapTxData;
|
|
24233
|
+
return _context10.abrupt("break", 45);
|
|
24580
24234
|
|
|
24581
|
-
case
|
|
24582
|
-
_context10.next =
|
|
24235
|
+
case 15:
|
|
24236
|
+
_context10.next = 17;
|
|
24583
24237
|
return this.utils.getBalancerSwapTx(this, assetFrom, assetTo, amountIn, slippage);
|
|
24584
24238
|
|
|
24585
|
-
case
|
|
24239
|
+
case 17:
|
|
24586
24240
|
swapTxData = _context10.sent;
|
|
24587
|
-
return _context10.abrupt("break",
|
|
24241
|
+
return _context10.abrupt("break", 45);
|
|
24588
24242
|
|
|
24589
|
-
case
|
|
24243
|
+
case 19:
|
|
24590
24244
|
iSynthetix = new ethers.utils.Interface(ISynthetix.abi);
|
|
24591
24245
|
assets = [assetFrom, assetTo].map(function (asset) {
|
|
24592
24246
|
return ethers.utils.formatBytes32String(asset);
|
|
24593
24247
|
});
|
|
24594
|
-
_context10.next =
|
|
24248
|
+
_context10.next = 23;
|
|
24595
24249
|
return this.factory.owner();
|
|
24596
24250
|
|
|
24597
|
-
case
|
|
24251
|
+
case 23:
|
|
24598
24252
|
daoAddress = _context10.sent;
|
|
24599
24253
|
swapTxData = iSynthetix.encodeFunctionData(Transaction.SWAP_SYNTHS, [assets[0], amountIn, assets[1], daoAddress, SYNTHETIX_TRACKING_CODE]);
|
|
24600
|
-
return _context10.abrupt("break",
|
|
24254
|
+
return _context10.abrupt("break", 45);
|
|
24601
24255
|
|
|
24602
|
-
case
|
|
24603
|
-
_context10.next =
|
|
24256
|
+
case 26:
|
|
24257
|
+
_context10.next = 28;
|
|
24604
24258
|
return getEasySwapperTxData(this, assetFrom, assetTo, ethers.BigNumber.from(amountIn), slippage);
|
|
24605
24259
|
|
|
24606
|
-
case
|
|
24260
|
+
case 28:
|
|
24607
24261
|
swapTxData = _context10.sent;
|
|
24608
|
-
return _context10.abrupt("break",
|
|
24262
|
+
return _context10.abrupt("break", 45);
|
|
24609
24263
|
|
|
24610
|
-
case
|
|
24264
|
+
case 30:
|
|
24611
24265
|
iUniswapV2Router = new ethers.utils.Interface(IUniswapV2Router.abi);
|
|
24612
|
-
_context10.next =
|
|
24266
|
+
_context10.next = 33;
|
|
24613
24267
|
return this.utils.getMinAmountOut(dapp, assetFrom, assetTo, amountIn, slippage);
|
|
24614
24268
|
|
|
24615
|
-
case
|
|
24269
|
+
case 33:
|
|
24616
24270
|
minAmountOut = _context10.sent;
|
|
24617
24271
|
_context10.t1 = iUniswapV2Router;
|
|
24618
24272
|
_context10.t2 = Transaction.SWAP;
|
|
@@ -24620,23 +24274,23 @@ var Pool = /*#__PURE__*/function () {
|
|
|
24620
24274
|
_context10.t4 = minAmountOut;
|
|
24621
24275
|
_context10.t5 = [assetFrom, assetTo];
|
|
24622
24276
|
_context10.t6 = this.address;
|
|
24623
|
-
_context10.next =
|
|
24277
|
+
_context10.next = 42;
|
|
24624
24278
|
return getDeadline(this);
|
|
24625
24279
|
|
|
24626
|
-
case
|
|
24280
|
+
case 42:
|
|
24627
24281
|
_context10.t7 = _context10.sent;
|
|
24628
24282
|
_context10.t8 = [_context10.t3, _context10.t4, _context10.t5, _context10.t6, _context10.t7];
|
|
24629
24283
|
swapTxData = _context10.t1.encodeFunctionData.call(_context10.t1, _context10.t2, _context10.t8);
|
|
24630
24284
|
|
|
24631
|
-
case
|
|
24632
|
-
_context10.next =
|
|
24285
|
+
case 45:
|
|
24286
|
+
_context10.next = 47;
|
|
24633
24287
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][dapp], swapTxData, options], estimateGas);
|
|
24634
24288
|
|
|
24635
|
-
case
|
|
24289
|
+
case 47:
|
|
24636
24290
|
tx = _context10.sent;
|
|
24637
24291
|
return _context10.abrupt("return", tx);
|
|
24638
24292
|
|
|
24639
|
-
case
|
|
24293
|
+
case 49:
|
|
24640
24294
|
case "end":
|
|
24641
24295
|
return _context10.stop();
|
|
24642
24296
|
}
|
|
@@ -25733,7 +25387,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25733
25387
|
}()
|
|
25734
25388
|
/**
|
|
25735
25389
|
* Create UniswapV3 liquidity pool
|
|
25736
|
-
* @param {dapp} Platform UniswapV3, VelodromeCL or
|
|
25390
|
+
* @param {dapp} Platform UniswapV3, VelodromeCL, AerodromeCL or RamesesCL
|
|
25737
25391
|
* @param {string} assetA First asset
|
|
25738
25392
|
* @param {string} assetB Second asset
|
|
25739
25393
|
* @param {BigNumber | string} amountA Amount first asset
|
|
@@ -25842,7 +25496,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25842
25496
|
|
|
25843
25497
|
isStaked = false;
|
|
25844
25498
|
_context31.t0 = dapp;
|
|
25845
|
-
_context31.next = _context31.t0 === Dapp.UNISWAPV3 ? 7 : _context31.t0 === Dapp.VELODROMECL ? 9 : _context31.t0 === Dapp.AERODROMECL ? 9 : _context31.t0 === Dapp.ARRAKIS ? 14 : 16;
|
|
25499
|
+
_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;
|
|
25846
25500
|
break;
|
|
25847
25501
|
|
|
25848
25502
|
case 7:
|
|
@@ -25943,7 +25597,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
25943
25597
|
|
|
25944
25598
|
isStaked = false;
|
|
25945
25599
|
_context32.t0 = dapp;
|
|
25946
|
-
_context32.next = _context32.t0 === Dapp.UNISWAPV3 ? 6 : _context32.t0 === Dapp.VELODROMECL ? 8 : _context32.t0 === Dapp.AERODROMECL ? 8 : _context32.t0 === Dapp.ARRAKIS ? 13 : 15;
|
|
25600
|
+
_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;
|
|
25947
25601
|
break;
|
|
25948
25602
|
|
|
25949
25603
|
case 6:
|
|
@@ -26042,7 +25696,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26042
25696
|
|
|
26043
25697
|
iNonfungiblePositionManager = new ethers.utils.Interface(INonfungiblePositionManager.abi);
|
|
26044
25698
|
_context33.t0 = dapp;
|
|
26045
|
-
_context33.next = _context33.t0 === Dapp.UNISWAPV3 ? 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;
|
|
25699
|
+
_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;
|
|
26046
25700
|
break;
|
|
26047
25701
|
|
|
26048
25702
|
case 6:
|
|
@@ -26110,32 +25764,25 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26110
25764
|
return claimFees;
|
|
26111
25765
|
}()
|
|
26112
25766
|
/**
|
|
26113
|
-
*
|
|
26114
|
-
* @param {Dapp} dapp Platform
|
|
26115
|
-
* @param {string}
|
|
26116
|
-
* @param {string}
|
|
26117
|
-
* @param {
|
|
26118
|
-
* @param { FeeAmount } feeAmount Fee tier (Low 0.05%, Medium 0.3%, High 1%)
|
|
26119
|
-
* @param {number} slippage Slippage tolerance in %
|
|
26120
|
-
* @param {any} options Transaction options
|
|
25767
|
+
* Get rewards of an NFT position
|
|
25768
|
+
* @param {Dapp} dapp Platform e.g. Ramses CL
|
|
25769
|
+
* @param {string} tokenId Token Id
|
|
25770
|
+
* @param {string[]} rewards Reward tokens
|
|
25771
|
+
* @param {any} options Transaction option
|
|
26121
25772
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
26122
25773
|
* @returns {Promise<any>} Transaction
|
|
26123
25774
|
*/
|
|
26124
25775
|
;
|
|
26125
25776
|
|
|
26126
|
-
_proto.
|
|
25777
|
+
_proto.getRewards =
|
|
26127
25778
|
/*#__PURE__*/
|
|
26128
25779
|
function () {
|
|
26129
|
-
var
|
|
26130
|
-
var
|
|
25780
|
+
var _getRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee34(dapp, tokenId, rewards, options, estimateGas) {
|
|
25781
|
+
var tx;
|
|
26131
25782
|
return runtime_1.wrap(function _callee34$(_context34) {
|
|
26132
25783
|
while (1) {
|
|
26133
25784
|
switch (_context34.prev = _context34.next) {
|
|
26134
25785
|
case 0:
|
|
26135
|
-
if (slippage === void 0) {
|
|
26136
|
-
slippage = 0.5;
|
|
26137
|
-
}
|
|
26138
|
-
|
|
26139
25786
|
if (options === void 0) {
|
|
26140
25787
|
options = null;
|
|
26141
25788
|
}
|
|
@@ -26144,19 +25791,14 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26144
25791
|
estimateGas = false;
|
|
26145
25792
|
}
|
|
26146
25793
|
|
|
26147
|
-
_context34.next =
|
|
26148
|
-
return
|
|
26149
|
-
|
|
26150
|
-
case 5:
|
|
26151
|
-
swapxData = _context34.sent;
|
|
26152
|
-
_context34.next = 8;
|
|
26153
|
-
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.UNISWAPV3], swapxData, options], estimateGas);
|
|
25794
|
+
_context34.next = 4;
|
|
25795
|
+
return getPoolTxOrGasEstimate(this, [nonfungiblePositionManagerAddress[this.network][dapp], getRewardsTxDta(tokenId, rewards), options], estimateGas);
|
|
26154
25796
|
|
|
26155
|
-
case
|
|
25797
|
+
case 4:
|
|
26156
25798
|
tx = _context34.sent;
|
|
26157
25799
|
return _context34.abrupt("return", tx);
|
|
26158
25800
|
|
|
26159
|
-
case
|
|
25801
|
+
case 6:
|
|
26160
25802
|
case "end":
|
|
26161
25803
|
return _context34.stop();
|
|
26162
25804
|
}
|
|
@@ -26164,34 +25806,39 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26164
25806
|
}, _callee34, this);
|
|
26165
25807
|
}));
|
|
26166
25808
|
|
|
26167
|
-
function
|
|
26168
|
-
return
|
|
25809
|
+
function getRewards(_x162, _x163, _x164, _x165, _x166) {
|
|
25810
|
+
return _getRewards.apply(this, arguments);
|
|
26169
25811
|
}
|
|
26170
25812
|
|
|
26171
|
-
return
|
|
25813
|
+
return getRewards;
|
|
26172
25814
|
}()
|
|
26173
25815
|
/**
|
|
26174
|
-
*
|
|
26175
|
-
* @param {
|
|
26176
|
-
* @param {string}
|
|
26177
|
-
* @param {
|
|
26178
|
-
* @param {BigNumber | string}
|
|
26179
|
-
* @param {
|
|
25816
|
+
* Trade an asset into another asset
|
|
25817
|
+
* @param {Dapp} dapp Platform like Sushiswap or Uniswap
|
|
25818
|
+
* @param {string} assetFrom Asset to trade from
|
|
25819
|
+
* @param {string} assetTo Asset to trade into
|
|
25820
|
+
* @param {BigNumber | string} amountIn Amount
|
|
25821
|
+
* @param { FeeAmount } feeAmount Fee tier (Low 0.05%, Medium 0.3%, High 1%)
|
|
25822
|
+
* @param {number} slippage Slippage tolerance in %
|
|
26180
25823
|
* @param {any} options Transaction options
|
|
26181
25824
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
26182
25825
|
* @returns {Promise<any>} Transaction
|
|
26183
25826
|
*/
|
|
26184
25827
|
;
|
|
26185
25828
|
|
|
26186
|
-
_proto.
|
|
25829
|
+
_proto.tradeUniswapV3 =
|
|
26187
25830
|
/*#__PURE__*/
|
|
26188
25831
|
function () {
|
|
26189
|
-
var
|
|
26190
|
-
var tx;
|
|
25832
|
+
var _tradeUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee35(assetFrom, assetTo, amountIn, feeAmount, slippage, options, estimateGas) {
|
|
25833
|
+
var swapxData, tx;
|
|
26191
25834
|
return runtime_1.wrap(function _callee35$(_context35) {
|
|
26192
25835
|
while (1) {
|
|
26193
25836
|
switch (_context35.prev = _context35.next) {
|
|
26194
25837
|
case 0:
|
|
25838
|
+
if (slippage === void 0) {
|
|
25839
|
+
slippage = 0.5;
|
|
25840
|
+
}
|
|
25841
|
+
|
|
26195
25842
|
if (options === void 0) {
|
|
26196
25843
|
options = null;
|
|
26197
25844
|
}
|
|
@@ -26200,25 +25847,19 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26200
25847
|
estimateGas = false;
|
|
26201
25848
|
}
|
|
26202
25849
|
|
|
26203
|
-
_context35.
|
|
26204
|
-
|
|
26205
|
-
_context35.t2 = routerAddress[this.network][Dapp.VELODROME];
|
|
26206
|
-
_context35.next = 7;
|
|
26207
|
-
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
25850
|
+
_context35.next = 5;
|
|
25851
|
+
return getUniswapV3SwapTxData(this, assetFrom, assetTo, amountIn, slippage, feeAmount);
|
|
26208
25852
|
|
|
26209
|
-
case
|
|
26210
|
-
|
|
26211
|
-
_context35.
|
|
26212
|
-
|
|
26213
|
-
_context35.t6 = estimateGas;
|
|
26214
|
-
_context35.next = 13;
|
|
26215
|
-
return (0, _context35.t0)(_context35.t1, _context35.t5, _context35.t6);
|
|
25853
|
+
case 5:
|
|
25854
|
+
swapxData = _context35.sent;
|
|
25855
|
+
_context35.next = 8;
|
|
25856
|
+
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.UNISWAPV3], swapxData, options], estimateGas);
|
|
26216
25857
|
|
|
26217
|
-
case
|
|
25858
|
+
case 8:
|
|
26218
25859
|
tx = _context35.sent;
|
|
26219
25860
|
return _context35.abrupt("return", tx);
|
|
26220
25861
|
|
|
26221
|
-
case
|
|
25862
|
+
case 10:
|
|
26222
25863
|
case "end":
|
|
26223
25864
|
return _context35.stop();
|
|
26224
25865
|
}
|
|
@@ -26226,17 +25867,18 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26226
25867
|
}, _callee35, this);
|
|
26227
25868
|
}));
|
|
26228
25869
|
|
|
26229
|
-
function
|
|
26230
|
-
return
|
|
25870
|
+
function tradeUniswapV3(_x167, _x168, _x169, _x170, _x171, _x172, _x173) {
|
|
25871
|
+
return _tradeUniswapV.apply(this, arguments);
|
|
26231
25872
|
}
|
|
26232
25873
|
|
|
26233
|
-
return
|
|
25874
|
+
return tradeUniswapV3;
|
|
26234
25875
|
}()
|
|
26235
25876
|
/**
|
|
26236
|
-
*
|
|
25877
|
+
* Add liquidity to Velodrome pool
|
|
26237
25878
|
* @param {string} assetA First asset
|
|
26238
25879
|
* @param {string} assetB Second asset
|
|
26239
|
-
* @param {BigNumber | string}
|
|
25880
|
+
* @param {BigNumber | string} amountA Amount first asset
|
|
25881
|
+
* @param {BigNumber | string} amountB Amount second asset
|
|
26240
25882
|
* @param { boolean } isStable Is stable pool
|
|
26241
25883
|
* @param {any} options Transaction options
|
|
26242
25884
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
@@ -26244,10 +25886,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26244
25886
|
*/
|
|
26245
25887
|
;
|
|
26246
25888
|
|
|
26247
|
-
_proto.
|
|
25889
|
+
_proto.addLiquidityVelodrome =
|
|
26248
25890
|
/*#__PURE__*/
|
|
26249
25891
|
function () {
|
|
26250
|
-
var
|
|
25892
|
+
var _addLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
|
|
26251
25893
|
var tx;
|
|
26252
25894
|
return runtime_1.wrap(function _callee36$(_context36) {
|
|
26253
25895
|
while (1) {
|
|
@@ -26265,7 +25907,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26265
25907
|
_context36.t1 = this;
|
|
26266
25908
|
_context36.t2 = routerAddress[this.network][Dapp.VELODROME];
|
|
26267
25909
|
_context36.next = 7;
|
|
26268
|
-
return
|
|
25910
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
26269
25911
|
|
|
26270
25912
|
case 7:
|
|
26271
25913
|
_context36.t3 = _context36.sent;
|
|
@@ -26287,18 +25929,17 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26287
25929
|
}, _callee36, this);
|
|
26288
25930
|
}));
|
|
26289
25931
|
|
|
26290
|
-
function
|
|
26291
|
-
return
|
|
25932
|
+
function addLiquidityVelodrome(_x174, _x175, _x176, _x177, _x178, _x179, _x180) {
|
|
25933
|
+
return _addLiquidityVelodrome.apply(this, arguments);
|
|
26292
25934
|
}
|
|
26293
25935
|
|
|
26294
|
-
return
|
|
25936
|
+
return addLiquidityVelodrome;
|
|
26295
25937
|
}()
|
|
26296
25938
|
/**
|
|
26297
|
-
*
|
|
25939
|
+
* Remove liquidity from Velodrome pool
|
|
26298
25940
|
* @param {string} assetA First asset
|
|
26299
25941
|
* @param {string} assetB Second asset
|
|
26300
|
-
* @param {BigNumber | string}
|
|
26301
|
-
* @param {BigNumber | string} amountB Amount second asset
|
|
25942
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
26302
25943
|
* @param { boolean } isStable Is stable pool
|
|
26303
25944
|
* @param {any} options Transaction options
|
|
26304
25945
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
@@ -26306,10 +25947,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26306
25947
|
*/
|
|
26307
25948
|
;
|
|
26308
25949
|
|
|
26309
|
-
_proto.
|
|
25950
|
+
_proto.removeLiquidityVelodrome =
|
|
26310
25951
|
/*#__PURE__*/
|
|
26311
25952
|
function () {
|
|
26312
|
-
var
|
|
25953
|
+
var _removeLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee37(assetA, assetB, amount, isStable, options, estimateGas) {
|
|
26313
25954
|
var tx;
|
|
26314
25955
|
return runtime_1.wrap(function _callee37$(_context37) {
|
|
26315
25956
|
while (1) {
|
|
@@ -26325,9 +25966,9 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26325
25966
|
|
|
26326
25967
|
_context37.t0 = getPoolTxOrGasEstimate;
|
|
26327
25968
|
_context37.t1 = this;
|
|
26328
|
-
_context37.t2 = routerAddress[this.network][Dapp.
|
|
25969
|
+
_context37.t2 = routerAddress[this.network][Dapp.VELODROME];
|
|
26329
25970
|
_context37.next = 7;
|
|
26330
|
-
return
|
|
25971
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
26331
25972
|
|
|
26332
25973
|
case 7:
|
|
26333
25974
|
_context37.t3 = _context37.sent;
|
|
@@ -26349,17 +25990,18 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26349
25990
|
}, _callee37, this);
|
|
26350
25991
|
}));
|
|
26351
25992
|
|
|
26352
|
-
function
|
|
26353
|
-
return
|
|
25993
|
+
function removeLiquidityVelodrome(_x181, _x182, _x183, _x184, _x185, _x186) {
|
|
25994
|
+
return _removeLiquidityVelodrome.apply(this, arguments);
|
|
26354
25995
|
}
|
|
26355
25996
|
|
|
26356
|
-
return
|
|
25997
|
+
return removeLiquidityVelodrome;
|
|
26357
25998
|
}()
|
|
26358
25999
|
/**
|
|
26359
|
-
*
|
|
26000
|
+
* Add liquidity to Velodrome V2 pool
|
|
26360
26001
|
* @param {string} assetA First asset
|
|
26361
26002
|
* @param {string} assetB Second asset
|
|
26362
|
-
* @param {BigNumber | string}
|
|
26003
|
+
* @param {BigNumber | string} amountA Amount first asset
|
|
26004
|
+
* @param {BigNumber | string} amountB Amount second asset
|
|
26363
26005
|
* @param { boolean } isStable Is stable pool
|
|
26364
26006
|
* @param {any} options Transaction options
|
|
26365
26007
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
@@ -26367,10 +26009,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26367
26009
|
*/
|
|
26368
26010
|
;
|
|
26369
26011
|
|
|
26370
|
-
_proto.
|
|
26012
|
+
_proto.addLiquidityVelodromeV2 =
|
|
26371
26013
|
/*#__PURE__*/
|
|
26372
26014
|
function () {
|
|
26373
|
-
var
|
|
26015
|
+
var _addLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
|
|
26374
26016
|
var tx;
|
|
26375
26017
|
return runtime_1.wrap(function _callee38$(_context38) {
|
|
26376
26018
|
while (1) {
|
|
@@ -26388,7 +26030,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26388
26030
|
_context38.t1 = this;
|
|
26389
26031
|
_context38.t2 = routerAddress[this.network][Dapp.VELODROMEV2];
|
|
26390
26032
|
_context38.next = 7;
|
|
26391
|
-
return
|
|
26033
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
26392
26034
|
|
|
26393
26035
|
case 7:
|
|
26394
26036
|
_context38.t3 = _context38.sent;
|
|
@@ -26410,19 +26052,17 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26410
26052
|
}, _callee38, this);
|
|
26411
26053
|
}));
|
|
26412
26054
|
|
|
26413
|
-
function
|
|
26414
|
-
return
|
|
26055
|
+
function addLiquidityVelodromeV2(_x187, _x188, _x189, _x190, _x191, _x192, _x193) {
|
|
26056
|
+
return _addLiquidityVelodromeV.apply(this, arguments);
|
|
26415
26057
|
}
|
|
26416
26058
|
|
|
26417
|
-
return
|
|
26059
|
+
return addLiquidityVelodromeV2;
|
|
26418
26060
|
}()
|
|
26419
26061
|
/**
|
|
26420
|
-
*
|
|
26421
|
-
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
26062
|
+
* Remove liquidity from Velodrome V2 pool
|
|
26422
26063
|
* @param {string} assetA First asset
|
|
26423
26064
|
* @param {string} assetB Second asset
|
|
26424
|
-
* @param {BigNumber | string}
|
|
26425
|
-
* @param {BigNumber | string} amountB Amount second asset
|
|
26065
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
26426
26066
|
* @param { boolean } isStable Is stable pool
|
|
26427
26067
|
* @param {any} options Transaction options
|
|
26428
26068
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
@@ -26430,10 +26070,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26430
26070
|
*/
|
|
26431
26071
|
;
|
|
26432
26072
|
|
|
26433
|
-
_proto.
|
|
26073
|
+
_proto.removeLiquidityVelodromeV2 =
|
|
26434
26074
|
/*#__PURE__*/
|
|
26435
26075
|
function () {
|
|
26436
|
-
var
|
|
26076
|
+
var _removeLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee39(assetA, assetB, amount, isStable, options, estimateGas) {
|
|
26437
26077
|
var tx;
|
|
26438
26078
|
return runtime_1.wrap(function _callee39$(_context39) {
|
|
26439
26079
|
while (1) {
|
|
@@ -26449,9 +26089,9 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26449
26089
|
|
|
26450
26090
|
_context39.t0 = getPoolTxOrGasEstimate;
|
|
26451
26091
|
_context39.t1 = this;
|
|
26452
|
-
_context39.t2 = routerAddress[this.network][
|
|
26092
|
+
_context39.t2 = routerAddress[this.network][Dapp.VELODROMEV2];
|
|
26453
26093
|
_context39.next = 7;
|
|
26454
|
-
return
|
|
26094
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
26455
26095
|
|
|
26456
26096
|
case 7:
|
|
26457
26097
|
_context39.t3 = _context39.sent;
|
|
@@ -26473,18 +26113,19 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26473
26113
|
}, _callee39, this);
|
|
26474
26114
|
}));
|
|
26475
26115
|
|
|
26476
|
-
function
|
|
26477
|
-
return
|
|
26116
|
+
function removeLiquidityVelodromeV2(_x194, _x195, _x196, _x197, _x198, _x199) {
|
|
26117
|
+
return _removeLiquidityVelodromeV.apply(this, arguments);
|
|
26478
26118
|
}
|
|
26479
26119
|
|
|
26480
|
-
return
|
|
26120
|
+
return removeLiquidityVelodromeV2;
|
|
26481
26121
|
}()
|
|
26482
26122
|
/**
|
|
26483
|
-
*
|
|
26123
|
+
* Add liquidity to Velodrome V2 or Ramses pool
|
|
26484
26124
|
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
26485
26125
|
* @param {string} assetA First asset
|
|
26486
26126
|
* @param {string} assetB Second asset
|
|
26487
|
-
* @param {BigNumber | string}
|
|
26127
|
+
* @param {BigNumber | string} amountA Amount first asset
|
|
26128
|
+
* @param {BigNumber | string} amountB Amount second asset
|
|
26488
26129
|
* @param { boolean } isStable Is stable pool
|
|
26489
26130
|
* @param {any} options Transaction options
|
|
26490
26131
|
* @param {boolean} estimateGas Simulate/estimate gas
|
|
@@ -26492,10 +26133,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26492
26133
|
*/
|
|
26493
26134
|
;
|
|
26494
26135
|
|
|
26495
|
-
_proto.
|
|
26136
|
+
_proto.addLiquidityV2 =
|
|
26496
26137
|
/*#__PURE__*/
|
|
26497
26138
|
function () {
|
|
26498
|
-
var
|
|
26139
|
+
var _addLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee40(dapp, assetA, assetB, amountA, amountB, isStable, options, estimateGas) {
|
|
26499
26140
|
var tx;
|
|
26500
26141
|
return runtime_1.wrap(function _callee40$(_context40) {
|
|
26501
26142
|
while (1) {
|
|
@@ -26513,7 +26154,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26513
26154
|
_context40.t1 = this;
|
|
26514
26155
|
_context40.t2 = routerAddress[this.network][dapp];
|
|
26515
26156
|
_context40.next = 7;
|
|
26516
|
-
return
|
|
26157
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
26517
26158
|
|
|
26518
26159
|
case 7:
|
|
26519
26160
|
_context40.t3 = _context40.sent;
|
|
@@ -26535,7 +26176,69 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26535
26176
|
}, _callee40, this);
|
|
26536
26177
|
}));
|
|
26537
26178
|
|
|
26538
|
-
function
|
|
26179
|
+
function addLiquidityV2(_x200, _x201, _x202, _x203, _x204, _x205, _x206, _x207) {
|
|
26180
|
+
return _addLiquidityV.apply(this, arguments);
|
|
26181
|
+
}
|
|
26182
|
+
|
|
26183
|
+
return addLiquidityV2;
|
|
26184
|
+
}()
|
|
26185
|
+
/**
|
|
26186
|
+
* Remove liquidity from Velodrome V2 or Ramses pool
|
|
26187
|
+
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
26188
|
+
* @param {string} assetA First asset
|
|
26189
|
+
* @param {string} assetB Second asset
|
|
26190
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
26191
|
+
* @param { boolean } isStable Is stable pool
|
|
26192
|
+
* @param {any} options Transaction options
|
|
26193
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
26194
|
+
* @returns {Promise<any>} Transaction
|
|
26195
|
+
*/
|
|
26196
|
+
;
|
|
26197
|
+
|
|
26198
|
+
_proto.removeLiquidityV2 =
|
|
26199
|
+
/*#__PURE__*/
|
|
26200
|
+
function () {
|
|
26201
|
+
var _removeLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee41(dapp, assetA, assetB, amount, isStable, options, estimateGas) {
|
|
26202
|
+
var tx;
|
|
26203
|
+
return runtime_1.wrap(function _callee41$(_context41) {
|
|
26204
|
+
while (1) {
|
|
26205
|
+
switch (_context41.prev = _context41.next) {
|
|
26206
|
+
case 0:
|
|
26207
|
+
if (options === void 0) {
|
|
26208
|
+
options = null;
|
|
26209
|
+
}
|
|
26210
|
+
|
|
26211
|
+
if (estimateGas === void 0) {
|
|
26212
|
+
estimateGas = false;
|
|
26213
|
+
}
|
|
26214
|
+
|
|
26215
|
+
_context41.t0 = getPoolTxOrGasEstimate;
|
|
26216
|
+
_context41.t1 = this;
|
|
26217
|
+
_context41.t2 = routerAddress[this.network][dapp];
|
|
26218
|
+
_context41.next = 7;
|
|
26219
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
26220
|
+
|
|
26221
|
+
case 7:
|
|
26222
|
+
_context41.t3 = _context41.sent;
|
|
26223
|
+
_context41.t4 = options;
|
|
26224
|
+
_context41.t5 = [_context41.t2, _context41.t3, _context41.t4];
|
|
26225
|
+
_context41.t6 = estimateGas;
|
|
26226
|
+
_context41.next = 13;
|
|
26227
|
+
return (0, _context41.t0)(_context41.t1, _context41.t5, _context41.t6);
|
|
26228
|
+
|
|
26229
|
+
case 13:
|
|
26230
|
+
tx = _context41.sent;
|
|
26231
|
+
return _context41.abrupt("return", tx);
|
|
26232
|
+
|
|
26233
|
+
case 15:
|
|
26234
|
+
case "end":
|
|
26235
|
+
return _context41.stop();
|
|
26236
|
+
}
|
|
26237
|
+
}
|
|
26238
|
+
}, _callee41, this);
|
|
26239
|
+
}));
|
|
26240
|
+
|
|
26241
|
+
function removeLiquidityV2(_x208, _x209, _x210, _x211, _x212, _x213, _x214) {
|
|
26539
26242
|
return _removeLiquidityV.apply(this, arguments);
|
|
26540
26243
|
}
|
|
26541
26244
|
|
|
@@ -26561,11 +26264,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26561
26264
|
_proto.tradeLyraOption =
|
|
26562
26265
|
/*#__PURE__*/
|
|
26563
26266
|
function () {
|
|
26564
|
-
var _tradeLyraOption = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26267
|
+
var _tradeLyraOption = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee42(market, expiry, strike, optionType, tradeType, optionAmount, assetIn, collateralChangeAmount, isCoveredCall, options, estimateGas) {
|
|
26565
26268
|
var swapxData, tx;
|
|
26566
|
-
return runtime_1.wrap(function
|
|
26269
|
+
return runtime_1.wrap(function _callee42$(_context42) {
|
|
26567
26270
|
while (1) {
|
|
26568
|
-
switch (
|
|
26271
|
+
switch (_context42.prev = _context42.next) {
|
|
26569
26272
|
case 0:
|
|
26570
26273
|
if (collateralChangeAmount === void 0) {
|
|
26571
26274
|
collateralChangeAmount = "0";
|
|
@@ -26583,27 +26286,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26583
26286
|
estimateGas = false;
|
|
26584
26287
|
}
|
|
26585
26288
|
|
|
26586
|
-
|
|
26289
|
+
_context42.next = 6;
|
|
26587
26290
|
return getLyraOptionTxData(this, market, optionType, expiry, strike, tradeType, optionAmount, assetIn, BigNumber$1.from(collateralChangeAmount), isCoveredCall);
|
|
26588
26291
|
|
|
26589
26292
|
case 6:
|
|
26590
|
-
swapxData =
|
|
26591
|
-
|
|
26293
|
+
swapxData = _context42.sent;
|
|
26294
|
+
_context42.next = 9;
|
|
26592
26295
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.LYRA], swapxData, options], estimateGas);
|
|
26593
26296
|
|
|
26594
26297
|
case 9:
|
|
26595
|
-
tx =
|
|
26596
|
-
return
|
|
26298
|
+
tx = _context42.sent;
|
|
26299
|
+
return _context42.abrupt("return", tx);
|
|
26597
26300
|
|
|
26598
26301
|
case 11:
|
|
26599
26302
|
case "end":
|
|
26600
|
-
return
|
|
26303
|
+
return _context42.stop();
|
|
26601
26304
|
}
|
|
26602
26305
|
}
|
|
26603
|
-
},
|
|
26306
|
+
}, _callee42, this);
|
|
26604
26307
|
}));
|
|
26605
26308
|
|
|
26606
|
-
function tradeLyraOption(
|
|
26309
|
+
function tradeLyraOption(_x215, _x216, _x217, _x218, _x219, _x220, _x221, _x222, _x223, _x224, _x225) {
|
|
26607
26310
|
return _tradeLyraOption.apply(this, arguments);
|
|
26608
26311
|
}
|
|
26609
26312
|
|
|
@@ -26618,26 +26321,26 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26618
26321
|
_proto.getLyraPositions =
|
|
26619
26322
|
/*#__PURE__*/
|
|
26620
26323
|
function () {
|
|
26621
|
-
var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26622
|
-
return runtime_1.wrap(function
|
|
26324
|
+
var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee43(market) {
|
|
26325
|
+
return runtime_1.wrap(function _callee43$(_context43) {
|
|
26623
26326
|
while (1) {
|
|
26624
|
-
switch (
|
|
26327
|
+
switch (_context43.prev = _context43.next) {
|
|
26625
26328
|
case 0:
|
|
26626
|
-
|
|
26329
|
+
_context43.next = 2;
|
|
26627
26330
|
return getOptionPositions(this, market);
|
|
26628
26331
|
|
|
26629
26332
|
case 2:
|
|
26630
|
-
return
|
|
26333
|
+
return _context43.abrupt("return", _context43.sent);
|
|
26631
26334
|
|
|
26632
26335
|
case 3:
|
|
26633
26336
|
case "end":
|
|
26634
|
-
return
|
|
26337
|
+
return _context43.stop();
|
|
26635
26338
|
}
|
|
26636
26339
|
}
|
|
26637
|
-
},
|
|
26340
|
+
}, _callee43, this);
|
|
26638
26341
|
}));
|
|
26639
26342
|
|
|
26640
|
-
function getLyraPositions(
|
|
26343
|
+
function getLyraPositions(_x226) {
|
|
26641
26344
|
return _getLyraPositions.apply(this, arguments);
|
|
26642
26345
|
}
|
|
26643
26346
|
|
|
@@ -26656,11 +26359,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26656
26359
|
_proto.changeFuturesMargin =
|
|
26657
26360
|
/*#__PURE__*/
|
|
26658
26361
|
function () {
|
|
26659
|
-
var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26362
|
+
var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee44(market, changeAmount, options, estimateGas) {
|
|
26660
26363
|
var tx;
|
|
26661
|
-
return runtime_1.wrap(function
|
|
26364
|
+
return runtime_1.wrap(function _callee44$(_context44) {
|
|
26662
26365
|
while (1) {
|
|
26663
|
-
switch (
|
|
26366
|
+
switch (_context44.prev = _context44.next) {
|
|
26664
26367
|
case 0:
|
|
26665
26368
|
if (options === void 0) {
|
|
26666
26369
|
options = null;
|
|
@@ -26670,22 +26373,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26670
26373
|
estimateGas = false;
|
|
26671
26374
|
}
|
|
26672
26375
|
|
|
26673
|
-
|
|
26376
|
+
_context44.next = 4;
|
|
26674
26377
|
return getPoolTxOrGasEstimate(this, [market, getFuturesChangeMarginTxData(changeAmount), options], estimateGas);
|
|
26675
26378
|
|
|
26676
26379
|
case 4:
|
|
26677
|
-
tx =
|
|
26678
|
-
return
|
|
26380
|
+
tx = _context44.sent;
|
|
26381
|
+
return _context44.abrupt("return", tx);
|
|
26679
26382
|
|
|
26680
26383
|
case 6:
|
|
26681
26384
|
case "end":
|
|
26682
|
-
return
|
|
26385
|
+
return _context44.stop();
|
|
26683
26386
|
}
|
|
26684
26387
|
}
|
|
26685
|
-
},
|
|
26388
|
+
}, _callee44, this);
|
|
26686
26389
|
}));
|
|
26687
26390
|
|
|
26688
|
-
function changeFuturesMargin(
|
|
26391
|
+
function changeFuturesMargin(_x227, _x228, _x229, _x230) {
|
|
26689
26392
|
return _changeFuturesMargin.apply(this, arguments);
|
|
26690
26393
|
}
|
|
26691
26394
|
|
|
@@ -26704,11 +26407,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26704
26407
|
_proto.changeFuturesPosition =
|
|
26705
26408
|
/*#__PURE__*/
|
|
26706
26409
|
function () {
|
|
26707
|
-
var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26410
|
+
var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee45(market, changeAmount, options, estimateGas) {
|
|
26708
26411
|
var txData, tx;
|
|
26709
|
-
return runtime_1.wrap(function
|
|
26412
|
+
return runtime_1.wrap(function _callee45$(_context45) {
|
|
26710
26413
|
while (1) {
|
|
26711
|
-
switch (
|
|
26414
|
+
switch (_context45.prev = _context45.next) {
|
|
26712
26415
|
case 0:
|
|
26713
26416
|
if (options === void 0) {
|
|
26714
26417
|
options = null;
|
|
@@ -26718,27 +26421,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26718
26421
|
estimateGas = false;
|
|
26719
26422
|
}
|
|
26720
26423
|
|
|
26721
|
-
|
|
26424
|
+
_context45.next = 4;
|
|
26722
26425
|
return getFuturesChangePositionTxData(changeAmount, market, this);
|
|
26723
26426
|
|
|
26724
26427
|
case 4:
|
|
26725
|
-
txData =
|
|
26726
|
-
|
|
26428
|
+
txData = _context45.sent;
|
|
26429
|
+
_context45.next = 7;
|
|
26727
26430
|
return getPoolTxOrGasEstimate(this, [market, txData, options], estimateGas);
|
|
26728
26431
|
|
|
26729
26432
|
case 7:
|
|
26730
|
-
tx =
|
|
26731
|
-
return
|
|
26433
|
+
tx = _context45.sent;
|
|
26434
|
+
return _context45.abrupt("return", tx);
|
|
26732
26435
|
|
|
26733
26436
|
case 9:
|
|
26734
26437
|
case "end":
|
|
26735
|
-
return
|
|
26438
|
+
return _context45.stop();
|
|
26736
26439
|
}
|
|
26737
26440
|
}
|
|
26738
|
-
},
|
|
26441
|
+
}, _callee45, this);
|
|
26739
26442
|
}));
|
|
26740
26443
|
|
|
26741
|
-
function changeFuturesPosition(
|
|
26444
|
+
function changeFuturesPosition(_x231, _x232, _x233, _x234) {
|
|
26742
26445
|
return _changeFuturesPosition.apply(this, arguments);
|
|
26743
26446
|
}
|
|
26744
26447
|
|
|
@@ -26756,11 +26459,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26756
26459
|
_proto.cancelFuturesOrder =
|
|
26757
26460
|
/*#__PURE__*/
|
|
26758
26461
|
function () {
|
|
26759
|
-
var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26462
|
+
var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee46(market, options, estimateGas) {
|
|
26760
26463
|
var txData, tx;
|
|
26761
|
-
return runtime_1.wrap(function
|
|
26464
|
+
return runtime_1.wrap(function _callee46$(_context46) {
|
|
26762
26465
|
while (1) {
|
|
26763
|
-
switch (
|
|
26466
|
+
switch (_context46.prev = _context46.next) {
|
|
26764
26467
|
case 0:
|
|
26765
26468
|
if (options === void 0) {
|
|
26766
26469
|
options = null;
|
|
@@ -26770,27 +26473,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26770
26473
|
estimateGas = false;
|
|
26771
26474
|
}
|
|
26772
26475
|
|
|
26773
|
-
|
|
26476
|
+
_context46.next = 4;
|
|
26774
26477
|
return getFuturesCancelOrderTxData(this);
|
|
26775
26478
|
|
|
26776
26479
|
case 4:
|
|
26777
|
-
txData =
|
|
26778
|
-
|
|
26480
|
+
txData = _context46.sent;
|
|
26481
|
+
_context46.next = 7;
|
|
26779
26482
|
return getPoolTxOrGasEstimate(this, [market, txData, options], estimateGas);
|
|
26780
26483
|
|
|
26781
26484
|
case 7:
|
|
26782
|
-
tx =
|
|
26783
|
-
return
|
|
26485
|
+
tx = _context46.sent;
|
|
26486
|
+
return _context46.abrupt("return", tx);
|
|
26784
26487
|
|
|
26785
26488
|
case 9:
|
|
26786
26489
|
case "end":
|
|
26787
|
-
return
|
|
26490
|
+
return _context46.stop();
|
|
26788
26491
|
}
|
|
26789
26492
|
}
|
|
26790
|
-
},
|
|
26493
|
+
}, _callee46, this);
|
|
26791
26494
|
}));
|
|
26792
26495
|
|
|
26793
|
-
function cancelFuturesOrder(
|
|
26496
|
+
function cancelFuturesOrder(_x235, _x236, _x237) {
|
|
26794
26497
|
return _cancelFuturesOrder.apply(this, arguments);
|
|
26795
26498
|
}
|
|
26796
26499
|
|
|
@@ -26807,11 +26510,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26807
26510
|
_proto.mintManagerFee =
|
|
26808
26511
|
/*#__PURE__*/
|
|
26809
26512
|
function () {
|
|
26810
|
-
var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26513
|
+
var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee47(options, estimateGas) {
|
|
26811
26514
|
var tx;
|
|
26812
|
-
return runtime_1.wrap(function
|
|
26515
|
+
return runtime_1.wrap(function _callee47$(_context47) {
|
|
26813
26516
|
while (1) {
|
|
26814
|
-
switch (
|
|
26517
|
+
switch (_context47.prev = _context47.next) {
|
|
26815
26518
|
case 0:
|
|
26816
26519
|
if (options === void 0) {
|
|
26817
26520
|
options = null;
|
|
@@ -26822,33 +26525,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26822
26525
|
}
|
|
26823
26526
|
|
|
26824
26527
|
if (!estimateGas) {
|
|
26825
|
-
|
|
26528
|
+
_context47.next = 6;
|
|
26826
26529
|
break;
|
|
26827
26530
|
}
|
|
26828
26531
|
|
|
26829
|
-
|
|
26532
|
+
_context47.next = 5;
|
|
26830
26533
|
return this.poolLogic.estimateGas.mintManagerFee(options);
|
|
26831
26534
|
|
|
26832
26535
|
case 5:
|
|
26833
|
-
return
|
|
26536
|
+
return _context47.abrupt("return", _context47.sent);
|
|
26834
26537
|
|
|
26835
26538
|
case 6:
|
|
26836
|
-
|
|
26539
|
+
_context47.next = 8;
|
|
26837
26540
|
return this.poolLogic.mintManagerFee(options);
|
|
26838
26541
|
|
|
26839
26542
|
case 8:
|
|
26840
|
-
tx =
|
|
26841
|
-
return
|
|
26543
|
+
tx = _context47.sent;
|
|
26544
|
+
return _context47.abrupt("return", tx);
|
|
26842
26545
|
|
|
26843
26546
|
case 10:
|
|
26844
26547
|
case "end":
|
|
26845
|
-
return
|
|
26548
|
+
return _context47.stop();
|
|
26846
26549
|
}
|
|
26847
26550
|
}
|
|
26848
|
-
},
|
|
26551
|
+
}, _callee47, this);
|
|
26849
26552
|
}));
|
|
26850
26553
|
|
|
26851
|
-
function mintManagerFee(
|
|
26554
|
+
function mintManagerFee(_x238, _x239) {
|
|
26852
26555
|
return _mintManagerFee.apply(this, arguments);
|
|
26853
26556
|
}
|
|
26854
26557
|
|
|
@@ -26863,25 +26566,25 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26863
26566
|
_proto.getAvailableManagerFee =
|
|
26864
26567
|
/*#__PURE__*/
|
|
26865
26568
|
function () {
|
|
26866
|
-
var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26569
|
+
var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee48() {
|
|
26867
26570
|
var fee;
|
|
26868
|
-
return runtime_1.wrap(function
|
|
26571
|
+
return runtime_1.wrap(function _callee48$(_context48) {
|
|
26869
26572
|
while (1) {
|
|
26870
|
-
switch (
|
|
26573
|
+
switch (_context48.prev = _context48.next) {
|
|
26871
26574
|
case 0:
|
|
26872
|
-
|
|
26575
|
+
_context48.next = 2;
|
|
26873
26576
|
return this.poolLogic.availableManagerFee();
|
|
26874
26577
|
|
|
26875
26578
|
case 2:
|
|
26876
|
-
fee =
|
|
26877
|
-
return
|
|
26579
|
+
fee = _context48.sent;
|
|
26580
|
+
return _context48.abrupt("return", BigNumber$1.from(fee));
|
|
26878
26581
|
|
|
26879
26582
|
case 4:
|
|
26880
26583
|
case "end":
|
|
26881
|
-
return
|
|
26584
|
+
return _context48.stop();
|
|
26882
26585
|
}
|
|
26883
26586
|
}
|
|
26884
|
-
},
|
|
26587
|
+
}, _callee48, this);
|
|
26885
26588
|
}));
|
|
26886
26589
|
|
|
26887
26590
|
function getAvailableManagerFee() {
|
|
@@ -26903,11 +26606,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26903
26606
|
_proto.vestTokens =
|
|
26904
26607
|
/*#__PURE__*/
|
|
26905
26608
|
function () {
|
|
26906
|
-
var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26609
|
+
var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee49(tokenAddress, amount, options, estimateGas) {
|
|
26907
26610
|
var txData, tx;
|
|
26908
|
-
return runtime_1.wrap(function
|
|
26611
|
+
return runtime_1.wrap(function _callee49$(_context49) {
|
|
26909
26612
|
while (1) {
|
|
26910
|
-
switch (
|
|
26613
|
+
switch (_context49.prev = _context49.next) {
|
|
26911
26614
|
case 0:
|
|
26912
26615
|
if (options === void 0) {
|
|
26913
26616
|
options = null;
|
|
@@ -26917,27 +26620,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26917
26620
|
estimateGas = false;
|
|
26918
26621
|
}
|
|
26919
26622
|
|
|
26920
|
-
|
|
26623
|
+
_context49.next = 4;
|
|
26921
26624
|
return getCreateVestTxData(amount);
|
|
26922
26625
|
|
|
26923
26626
|
case 4:
|
|
26924
|
-
txData =
|
|
26925
|
-
|
|
26627
|
+
txData = _context49.sent;
|
|
26628
|
+
_context49.next = 7;
|
|
26926
26629
|
return getPoolTxOrGasEstimate(this, [tokenAddress, txData, options], estimateGas);
|
|
26927
26630
|
|
|
26928
26631
|
case 7:
|
|
26929
|
-
tx =
|
|
26930
|
-
return
|
|
26632
|
+
tx = _context49.sent;
|
|
26633
|
+
return _context49.abrupt("return", tx);
|
|
26931
26634
|
|
|
26932
26635
|
case 9:
|
|
26933
26636
|
case "end":
|
|
26934
|
-
return
|
|
26637
|
+
return _context49.stop();
|
|
26935
26638
|
}
|
|
26936
26639
|
}
|
|
26937
|
-
},
|
|
26640
|
+
}, _callee49, this);
|
|
26938
26641
|
}));
|
|
26939
26642
|
|
|
26940
|
-
function vestTokens(
|
|
26643
|
+
function vestTokens(_x240, _x241, _x242, _x243) {
|
|
26941
26644
|
return _vestTokens.apply(this, arguments);
|
|
26942
26645
|
}
|
|
26943
26646
|
|
|
@@ -26956,11 +26659,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26956
26659
|
_proto.exitVestedToken =
|
|
26957
26660
|
/*#__PURE__*/
|
|
26958
26661
|
function () {
|
|
26959
|
-
var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26662
|
+
var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee50(tokenAddress, id, options, estimateGas) {
|
|
26960
26663
|
var txData, tx;
|
|
26961
|
-
return runtime_1.wrap(function
|
|
26664
|
+
return runtime_1.wrap(function _callee50$(_context50) {
|
|
26962
26665
|
while (1) {
|
|
26963
|
-
switch (
|
|
26666
|
+
switch (_context50.prev = _context50.next) {
|
|
26964
26667
|
case 0:
|
|
26965
26668
|
if (options === void 0) {
|
|
26966
26669
|
options = null;
|
|
@@ -26970,27 +26673,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
26970
26673
|
estimateGas = false;
|
|
26971
26674
|
}
|
|
26972
26675
|
|
|
26973
|
-
|
|
26676
|
+
_context50.next = 4;
|
|
26974
26677
|
return getExitVestTxData(id);
|
|
26975
26678
|
|
|
26976
26679
|
case 4:
|
|
26977
|
-
txData =
|
|
26978
|
-
|
|
26680
|
+
txData = _context50.sent;
|
|
26681
|
+
_context50.next = 7;
|
|
26979
26682
|
return getPoolTxOrGasEstimate(this, [tokenAddress, txData, options], estimateGas);
|
|
26980
26683
|
|
|
26981
26684
|
case 7:
|
|
26982
|
-
tx =
|
|
26983
|
-
return
|
|
26685
|
+
tx = _context50.sent;
|
|
26686
|
+
return _context50.abrupt("return", tx);
|
|
26984
26687
|
|
|
26985
26688
|
case 9:
|
|
26986
26689
|
case "end":
|
|
26987
|
-
return
|
|
26690
|
+
return _context50.stop();
|
|
26988
26691
|
}
|
|
26989
26692
|
}
|
|
26990
|
-
},
|
|
26693
|
+
}, _callee50, this);
|
|
26991
26694
|
}));
|
|
26992
26695
|
|
|
26993
|
-
function exitVestedToken(
|
|
26696
|
+
function exitVestedToken(_x244, _x245, _x246, _x247) {
|
|
26994
26697
|
return _exitVestedToken.apply(this, arguments);
|
|
26995
26698
|
}
|
|
26996
26699
|
|
|
@@ -27010,11 +26713,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
27010
26713
|
_proto.mintUnitViaFlatMoney =
|
|
27011
26714
|
/*#__PURE__*/
|
|
27012
26715
|
function () {
|
|
27013
|
-
var _mintUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26716
|
+
var _mintUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee51(depositAmount, slippage, maxKeeperFeeInUsd, options, estimateGas) {
|
|
27014
26717
|
var tx;
|
|
27015
|
-
return runtime_1.wrap(function
|
|
26718
|
+
return runtime_1.wrap(function _callee51$(_context51) {
|
|
27016
26719
|
while (1) {
|
|
27017
|
-
switch (
|
|
26720
|
+
switch (_context51.prev = _context51.next) {
|
|
27018
26721
|
case 0:
|
|
27019
26722
|
if (slippage === void 0) {
|
|
27020
26723
|
slippage = 0.5;
|
|
@@ -27028,22 +26731,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
27028
26731
|
estimateGas = false;
|
|
27029
26732
|
}
|
|
27030
26733
|
|
|
27031
|
-
|
|
26734
|
+
_context51.next = 5;
|
|
27032
26735
|
return mintUnitViaFlatMoney(this, depositAmount, slippage, maxKeeperFeeInUsd, options, estimateGas);
|
|
27033
26736
|
|
|
27034
26737
|
case 5:
|
|
27035
|
-
tx =
|
|
27036
|
-
return
|
|
26738
|
+
tx = _context51.sent;
|
|
26739
|
+
return _context51.abrupt("return", tx);
|
|
27037
26740
|
|
|
27038
26741
|
case 7:
|
|
27039
26742
|
case "end":
|
|
27040
|
-
return
|
|
26743
|
+
return _context51.stop();
|
|
27041
26744
|
}
|
|
27042
26745
|
}
|
|
27043
|
-
},
|
|
26746
|
+
}, _callee51, this);
|
|
27044
26747
|
}));
|
|
27045
26748
|
|
|
27046
|
-
function mintUnitViaFlatMoney$1(
|
|
26749
|
+
function mintUnitViaFlatMoney$1(_x248, _x249, _x250, _x251, _x252) {
|
|
27047
26750
|
return _mintUnitViaFlatMoney2.apply(this, arguments);
|
|
27048
26751
|
}
|
|
27049
26752
|
|
|
@@ -27063,11 +26766,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
27063
26766
|
_proto.redeemUnitViaFlatMoney =
|
|
27064
26767
|
/*#__PURE__*/
|
|
27065
26768
|
function () {
|
|
27066
|
-
var _redeemUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26769
|
+
var _redeemUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee52(withdrawAmount, slippage, maxKeeperFeeInUsd, options, estimateGas) {
|
|
27067
26770
|
var tx;
|
|
27068
|
-
return runtime_1.wrap(function
|
|
26771
|
+
return runtime_1.wrap(function _callee52$(_context52) {
|
|
27069
26772
|
while (1) {
|
|
27070
|
-
switch (
|
|
26773
|
+
switch (_context52.prev = _context52.next) {
|
|
27071
26774
|
case 0:
|
|
27072
26775
|
if (slippage === void 0) {
|
|
27073
26776
|
slippage = 0.5;
|
|
@@ -27081,22 +26784,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
27081
26784
|
estimateGas = false;
|
|
27082
26785
|
}
|
|
27083
26786
|
|
|
27084
|
-
|
|
26787
|
+
_context52.next = 5;
|
|
27085
26788
|
return redeemUnitViaFlatMoney(this, withdrawAmount, slippage, maxKeeperFeeInUsd, options, estimateGas);
|
|
27086
26789
|
|
|
27087
26790
|
case 5:
|
|
27088
|
-
tx =
|
|
27089
|
-
return
|
|
26791
|
+
tx = _context52.sent;
|
|
26792
|
+
return _context52.abrupt("return", tx);
|
|
27090
26793
|
|
|
27091
26794
|
case 7:
|
|
27092
26795
|
case "end":
|
|
27093
|
-
return
|
|
26796
|
+
return _context52.stop();
|
|
27094
26797
|
}
|
|
27095
26798
|
}
|
|
27096
|
-
},
|
|
26799
|
+
}, _callee52, this);
|
|
27097
26800
|
}));
|
|
27098
26801
|
|
|
27099
|
-
function redeemUnitViaFlatMoney$1(
|
|
26802
|
+
function redeemUnitViaFlatMoney$1(_x253, _x254, _x255, _x256, _x257) {
|
|
27100
26803
|
return _redeemUnitViaFlatMoney2.apply(this, arguments);
|
|
27101
26804
|
}
|
|
27102
26805
|
|
|
@@ -27104,11 +26807,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
27104
26807
|
}();
|
|
27105
26808
|
|
|
27106
26809
|
_proto.cancelOrderViaFlatMoney = /*#__PURE__*/function () {
|
|
27107
|
-
var _cancelOrderViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
26810
|
+
var _cancelOrderViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee53(options, estimateGas) {
|
|
27108
26811
|
var tx;
|
|
27109
|
-
return runtime_1.wrap(function
|
|
26812
|
+
return runtime_1.wrap(function _callee53$(_context53) {
|
|
27110
26813
|
while (1) {
|
|
27111
|
-
switch (
|
|
26814
|
+
switch (_context53.prev = _context53.next) {
|
|
27112
26815
|
case 0:
|
|
27113
26816
|
if (options === void 0) {
|
|
27114
26817
|
options = null;
|
|
@@ -27118,32 +26821,89 @@ var Pool = /*#__PURE__*/function () {
|
|
|
27118
26821
|
estimateGas = false;
|
|
27119
26822
|
}
|
|
27120
26823
|
|
|
27121
|
-
|
|
26824
|
+
_context53.next = 4;
|
|
27122
26825
|
return cancelOrderViaFlatMoney(this, options, estimateGas);
|
|
27123
26826
|
|
|
27124
26827
|
case 4:
|
|
27125
|
-
tx =
|
|
27126
|
-
return
|
|
26828
|
+
tx = _context53.sent;
|
|
26829
|
+
return _context53.abrupt("return", tx);
|
|
27127
26830
|
|
|
27128
26831
|
case 6:
|
|
27129
26832
|
case "end":
|
|
27130
|
-
return
|
|
26833
|
+
return _context53.stop();
|
|
27131
26834
|
}
|
|
27132
26835
|
}
|
|
27133
|
-
},
|
|
26836
|
+
}, _callee53, this);
|
|
27134
26837
|
}));
|
|
27135
26838
|
|
|
27136
|
-
function cancelOrderViaFlatMoney$1(
|
|
26839
|
+
function cancelOrderViaFlatMoney$1(_x258, _x259) {
|
|
27137
26840
|
return _cancelOrderViaFlatMoney2.apply(this, arguments);
|
|
27138
26841
|
}
|
|
27139
26842
|
|
|
27140
26843
|
return cancelOrderViaFlatMoney$1;
|
|
26844
|
+
}()
|
|
26845
|
+
/**
|
|
26846
|
+
* Complete a Toros withdrawal to a single asset
|
|
26847
|
+
* @param {string} destinationToken Address of destination asset
|
|
26848
|
+
* @param {number} slippage Slippage tolerance in %
|
|
26849
|
+
* @param {any} options Transaction options
|
|
26850
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
26851
|
+
* @returns {Promise<any>} Transaction
|
|
26852
|
+
*/
|
|
26853
|
+
;
|
|
26854
|
+
|
|
26855
|
+
_proto.completeTorosWithdrawal =
|
|
26856
|
+
/*#__PURE__*/
|
|
26857
|
+
function () {
|
|
26858
|
+
var _completeTorosWithdrawal = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee54(destinationToken, slippage, options, estimateGas) {
|
|
26859
|
+
var txData, tx;
|
|
26860
|
+
return runtime_1.wrap(function _callee54$(_context54) {
|
|
26861
|
+
while (1) {
|
|
26862
|
+
switch (_context54.prev = _context54.next) {
|
|
26863
|
+
case 0:
|
|
26864
|
+
if (slippage === void 0) {
|
|
26865
|
+
slippage = 0.5;
|
|
26866
|
+
}
|
|
26867
|
+
|
|
26868
|
+
if (options === void 0) {
|
|
26869
|
+
options = null;
|
|
26870
|
+
}
|
|
26871
|
+
|
|
26872
|
+
if (estimateGas === void 0) {
|
|
26873
|
+
estimateGas = false;
|
|
26874
|
+
}
|
|
26875
|
+
|
|
26876
|
+
_context54.next = 5;
|
|
26877
|
+
return getCompleteWithdrawalTxData(this, destinationToken, slippage);
|
|
26878
|
+
|
|
26879
|
+
case 5:
|
|
26880
|
+
txData = _context54.sent;
|
|
26881
|
+
_context54.next = 8;
|
|
26882
|
+
return getPoolTxOrGasEstimate(this, [routerAddress[this.network].toros, txData, options], estimateGas);
|
|
26883
|
+
|
|
26884
|
+
case 8:
|
|
26885
|
+
tx = _context54.sent;
|
|
26886
|
+
return _context54.abrupt("return", tx);
|
|
26887
|
+
|
|
26888
|
+
case 10:
|
|
26889
|
+
case "end":
|
|
26890
|
+
return _context54.stop();
|
|
26891
|
+
}
|
|
26892
|
+
}
|
|
26893
|
+
}, _callee54, this);
|
|
26894
|
+
}));
|
|
26895
|
+
|
|
26896
|
+
function completeTorosWithdrawal(_x260, _x261, _x262, _x263) {
|
|
26897
|
+
return _completeTorosWithdrawal.apply(this, arguments);
|
|
26898
|
+
}
|
|
26899
|
+
|
|
26900
|
+
return completeTorosWithdrawal;
|
|
27141
26901
|
}();
|
|
27142
26902
|
|
|
27143
26903
|
return Pool;
|
|
27144
26904
|
}();
|
|
27145
26905
|
|
|
27146
|
-
var abi$
|
|
26906
|
+
var abi$r = [
|
|
27147
26907
|
{
|
|
27148
26908
|
inputs: [
|
|
27149
26909
|
{
|
|
@@ -27367,10 +27127,10 @@ var abi$u = [
|
|
|
27367
27127
|
}
|
|
27368
27128
|
];
|
|
27369
27129
|
var UniswapV2Factory = {
|
|
27370
|
-
abi: abi$
|
|
27130
|
+
abi: abi$r
|
|
27371
27131
|
};
|
|
27372
27132
|
|
|
27373
|
-
var abi$
|
|
27133
|
+
var abi$s = [
|
|
27374
27134
|
{
|
|
27375
27135
|
anonymous: false,
|
|
27376
27136
|
inputs: [
|
|
@@ -28114,7 +27874,7 @@ var evm = {
|
|
|
28114
27874
|
}
|
|
28115
27875
|
};
|
|
28116
27876
|
var UniswapV2Pair = {
|
|
28117
|
-
abi: abi$
|
|
27877
|
+
abi: abi$s,
|
|
28118
27878
|
evm: evm,
|
|
28119
27879
|
"interface": [
|
|
28120
27880
|
{
|
|
@@ -28845,7 +28605,7 @@ var UniswapV2Pair = {
|
|
|
28845
28605
|
]
|
|
28846
28606
|
};
|
|
28847
28607
|
|
|
28848
|
-
var abi$
|
|
28608
|
+
var abi$t = [
|
|
28849
28609
|
{
|
|
28850
28610
|
inputs: [
|
|
28851
28611
|
{
|
|
@@ -30040,7 +29800,7 @@ var abi$w = [
|
|
|
30040
29800
|
}
|
|
30041
29801
|
];
|
|
30042
29802
|
var IBalancerV2Vault = {
|
|
30043
|
-
abi: abi$
|
|
29803
|
+
abi: abi$t
|
|
30044
29804
|
};
|
|
30045
29805
|
|
|
30046
29806
|
var Utils = /*#__PURE__*/function () {
|