@dhedge/v2-sdk 2.1.1 → 2.1.3
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/dist/entities/pool.d.ts +9 -1
- package/dist/v2-sdk.cjs.development.js +504 -405
- 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 +504 -405
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/PoolManagerLogic.json +27 -1
- package/src/entities/pool.ts +26 -1
- package/src/services/pendle/index.ts +10 -8
- package/src/test/pendle.test.ts +19 -19
- package/src/test/pool.test.ts +35 -24
package/dist/v2-sdk.esm.js
CHANGED
|
@@ -4266,6 +4266,34 @@ var abi$2 = [
|
|
|
4266
4266
|
],
|
|
4267
4267
|
stateMutability: "nonpayable",
|
|
4268
4268
|
type: "function"
|
|
4269
|
+
},
|
|
4270
|
+
{
|
|
4271
|
+
inputs: [
|
|
4272
|
+
{
|
|
4273
|
+
internalType: "uint256",
|
|
4274
|
+
name: "_maxSupplyCapD18",
|
|
4275
|
+
type: "uint256"
|
|
4276
|
+
}
|
|
4277
|
+
],
|
|
4278
|
+
name: "setMaxSupplyCap",
|
|
4279
|
+
outputs: [
|
|
4280
|
+
],
|
|
4281
|
+
stateMutability: "nonpayable",
|
|
4282
|
+
type: "function"
|
|
4283
|
+
},
|
|
4284
|
+
{
|
|
4285
|
+
inputs: [
|
|
4286
|
+
],
|
|
4287
|
+
name: "maxSupplyCap",
|
|
4288
|
+
outputs: [
|
|
4289
|
+
{
|
|
4290
|
+
internalType: "uint256",
|
|
4291
|
+
name: "",
|
|
4292
|
+
type: "uint256"
|
|
4293
|
+
}
|
|
4294
|
+
],
|
|
4295
|
+
stateMutability: "view",
|
|
4296
|
+
type: "function"
|
|
4269
4297
|
}
|
|
4270
4298
|
];
|
|
4271
4299
|
var ManagerLogic = {
|
|
@@ -27033,7 +27061,7 @@ var SYAbi = [
|
|
|
27033
27061
|
}
|
|
27034
27062
|
];
|
|
27035
27063
|
|
|
27036
|
-
var pendleBaseUrl = "https://api-v2.pendle.finance/core
|
|
27064
|
+
var pendleBaseUrl = "https://api-v2.pendle.finance/core";
|
|
27037
27065
|
function getPendleSwapTxData(_x, _x2, _x3, _x4, _x5) {
|
|
27038
27066
|
return _getPendleSwapTxData.apply(this, arguments);
|
|
27039
27067
|
}
|
|
@@ -27081,7 +27109,7 @@ function _getPendleSwapTxData() {
|
|
|
27081
27109
|
market = _context3.sent;
|
|
27082
27110
|
_context3.prev = 12;
|
|
27083
27111
|
_context3.next = 15;
|
|
27084
|
-
return axios.get(pendleBaseUrl + "/sdk/" + networkChainIdMap[pool.network] + "/markets/" + market + "/swap", {
|
|
27112
|
+
return axios.get(pendleBaseUrl + "/v2/sdk/" + networkChainIdMap[pool.network] + "/markets/" + market + "/swap", {
|
|
27085
27113
|
params: params
|
|
27086
27114
|
});
|
|
27087
27115
|
|
|
@@ -27120,28 +27148,34 @@ function getMarket(_x6, _x7, _x8) {
|
|
|
27120
27148
|
|
|
27121
27149
|
function _getMarket() {
|
|
27122
27150
|
_getMarket = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(pool, tokenIn, tokenOut) {
|
|
27123
|
-
var networkId, marketResult, allMarkets, markets;
|
|
27151
|
+
var networkId, marketResult, params, allMarkets, markets;
|
|
27124
27152
|
return runtime_1.wrap(function _callee4$(_context4) {
|
|
27125
27153
|
while (1) {
|
|
27126
27154
|
switch (_context4.prev = _context4.next) {
|
|
27127
27155
|
case 0:
|
|
27128
27156
|
networkId = networkChainIdMap[pool.network];
|
|
27129
27157
|
_context4.prev = 1;
|
|
27130
|
-
|
|
27131
|
-
|
|
27158
|
+
params = {
|
|
27159
|
+
isActive: true,
|
|
27160
|
+
chainId: networkId
|
|
27161
|
+
};
|
|
27162
|
+
_context4.next = 5;
|
|
27163
|
+
return axios.get(pendleBaseUrl + "/v1/markets/all", {
|
|
27164
|
+
params: params
|
|
27165
|
+
});
|
|
27132
27166
|
|
|
27133
|
-
case
|
|
27167
|
+
case 5:
|
|
27134
27168
|
marketResult = _context4.sent;
|
|
27135
|
-
_context4.next =
|
|
27169
|
+
_context4.next = 12;
|
|
27136
27170
|
break;
|
|
27137
27171
|
|
|
27138
|
-
case
|
|
27139
|
-
_context4.prev =
|
|
27172
|
+
case 8:
|
|
27173
|
+
_context4.prev = 8;
|
|
27140
27174
|
_context4.t0 = _context4["catch"](1);
|
|
27141
27175
|
console.error("Error in Pendle API request:", _context4.t0);
|
|
27142
27176
|
throw new ApiError("Pendle api request failed");
|
|
27143
27177
|
|
|
27144
|
-
case
|
|
27178
|
+
case 12:
|
|
27145
27179
|
allMarkets = marketResult.data.markets;
|
|
27146
27180
|
markets = [tokenIn, tokenOut].map(function (token) {
|
|
27147
27181
|
return allMarkets.find(function (market) {
|
|
@@ -27150,59 +27184,65 @@ function _getMarket() {
|
|
|
27150
27184
|
});
|
|
27151
27185
|
|
|
27152
27186
|
if (!markets[0]) {
|
|
27153
|
-
_context4.next =
|
|
27187
|
+
_context4.next = 19;
|
|
27154
27188
|
break;
|
|
27155
27189
|
}
|
|
27156
27190
|
|
|
27157
27191
|
checkUnderlying(markets[0], tokenOut, networkId);
|
|
27158
27192
|
return _context4.abrupt("return", markets[0].address);
|
|
27159
27193
|
|
|
27160
|
-
case
|
|
27194
|
+
case 19:
|
|
27161
27195
|
if (!markets[1]) {
|
|
27162
|
-
_context4.next =
|
|
27196
|
+
_context4.next = 24;
|
|
27163
27197
|
break;
|
|
27164
27198
|
}
|
|
27165
27199
|
|
|
27166
27200
|
checkUnderlying(markets[1], tokenIn, networkId);
|
|
27167
27201
|
return _context4.abrupt("return", markets[1].address);
|
|
27168
27202
|
|
|
27169
|
-
case
|
|
27203
|
+
case 24:
|
|
27170
27204
|
throw new Error("Can only trade PT assets");
|
|
27171
27205
|
|
|
27172
|
-
case
|
|
27206
|
+
case 25:
|
|
27173
27207
|
case "end":
|
|
27174
27208
|
return _context4.stop();
|
|
27175
27209
|
}
|
|
27176
27210
|
}
|
|
27177
|
-
}, _callee4, null, [[1,
|
|
27211
|
+
}, _callee4, null, [[1, 8]]);
|
|
27178
27212
|
}));
|
|
27179
27213
|
return _getMarket.apply(this, arguments);
|
|
27180
27214
|
}
|
|
27181
27215
|
|
|
27182
27216
|
var checkExitPostExpPT = /*#__PURE__*/function () {
|
|
27183
27217
|
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool, tokenIn, tokenOut) {
|
|
27184
|
-
var networkId, inactiveMarketResult, allInactiveMarkets, markets;
|
|
27218
|
+
var networkId, inactiveMarketResult, params, allInactiveMarkets, markets;
|
|
27185
27219
|
return runtime_1.wrap(function _callee$(_context) {
|
|
27186
27220
|
while (1) {
|
|
27187
27221
|
switch (_context.prev = _context.next) {
|
|
27188
27222
|
case 0:
|
|
27189
27223
|
networkId = networkChainIdMap[pool.network];
|
|
27190
27224
|
_context.prev = 1;
|
|
27191
|
-
|
|
27192
|
-
|
|
27225
|
+
params = {
|
|
27226
|
+
isActive: false,
|
|
27227
|
+
chainId: networkId
|
|
27228
|
+
};
|
|
27229
|
+
_context.next = 5;
|
|
27230
|
+
return axios.get(pendleBaseUrl + "/v1/markets/all", {
|
|
27231
|
+
params: params
|
|
27232
|
+
});
|
|
27193
27233
|
|
|
27194
|
-
case
|
|
27234
|
+
case 5:
|
|
27195
27235
|
inactiveMarketResult = _context.sent;
|
|
27196
|
-
_context.next =
|
|
27236
|
+
_context.next = 12;
|
|
27197
27237
|
break;
|
|
27198
27238
|
|
|
27199
|
-
case
|
|
27200
|
-
_context.prev =
|
|
27239
|
+
case 8:
|
|
27240
|
+
_context.prev = 8;
|
|
27201
27241
|
_context.t0 = _context["catch"](1);
|
|
27202
27242
|
console.error("Error in Pendle API request:", _context.t0);
|
|
27203
27243
|
throw new ApiError("Pendle api request failed");
|
|
27204
27244
|
|
|
27205
|
-
case
|
|
27245
|
+
case 12:
|
|
27206
27246
|
allInactiveMarkets = inactiveMarketResult.data.markets;
|
|
27207
27247
|
markets = [tokenIn, tokenOut].map(function (token) {
|
|
27208
27248
|
return allInactiveMarkets.find(function (market) {
|
|
@@ -27211,30 +27251,30 @@ var checkExitPostExpPT = /*#__PURE__*/function () {
|
|
|
27211
27251
|
});
|
|
27212
27252
|
|
|
27213
27253
|
if (!markets[0]) {
|
|
27214
|
-
_context.next =
|
|
27254
|
+
_context.next = 19;
|
|
27215
27255
|
break;
|
|
27216
27256
|
}
|
|
27217
27257
|
|
|
27218
27258
|
checkUnderlying(markets[0], tokenOut, networkId);
|
|
27219
27259
|
return _context.abrupt("return", markets[0].address);
|
|
27220
27260
|
|
|
27221
|
-
case
|
|
27261
|
+
case 19:
|
|
27222
27262
|
if (!markets[1]) {
|
|
27223
|
-
_context.next =
|
|
27263
|
+
_context.next = 23;
|
|
27224
27264
|
break;
|
|
27225
27265
|
}
|
|
27226
27266
|
|
|
27227
27267
|
throw new Error("Can not trade to expired PT asset");
|
|
27228
27268
|
|
|
27229
|
-
case
|
|
27269
|
+
case 23:
|
|
27230
27270
|
return _context.abrupt("return", null);
|
|
27231
27271
|
|
|
27232
|
-
case
|
|
27272
|
+
case 24:
|
|
27233
27273
|
case "end":
|
|
27234
27274
|
return _context.stop();
|
|
27235
27275
|
}
|
|
27236
27276
|
}
|
|
27237
|
-
}, _callee, null, [[1,
|
|
27277
|
+
}, _callee, null, [[1, 8]]);
|
|
27238
27278
|
}));
|
|
27239
27279
|
|
|
27240
27280
|
return function checkExitPostExpPT(_x9, _x10, _x11) {
|
|
@@ -29588,6 +29628,65 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29588
29628
|
|
|
29589
29629
|
return setPrivate;
|
|
29590
29630
|
}()
|
|
29631
|
+
/**
|
|
29632
|
+
* Sets max supply cap for a pool
|
|
29633
|
+
* @param {BigNumberish} _maxSupplyCapD18 Max supply cap with 18 decimals
|
|
29634
|
+
* @param {any} options Transaction options
|
|
29635
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
29636
|
+
* @returns {Promise<any>} Transaction
|
|
29637
|
+
*/
|
|
29638
|
+
;
|
|
29639
|
+
|
|
29640
|
+
_proto.setMaxCap =
|
|
29641
|
+
/*#__PURE__*/
|
|
29642
|
+
function () {
|
|
29643
|
+
var _setMaxCap = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee27(_maxSupplyCapD18, options, estimateGas) {
|
|
29644
|
+
var tx;
|
|
29645
|
+
return runtime_1.wrap(function _callee27$(_context27) {
|
|
29646
|
+
while (1) {
|
|
29647
|
+
switch (_context27.prev = _context27.next) {
|
|
29648
|
+
case 0:
|
|
29649
|
+
if (options === void 0) {
|
|
29650
|
+
options = null;
|
|
29651
|
+
}
|
|
29652
|
+
|
|
29653
|
+
if (estimateGas === void 0) {
|
|
29654
|
+
estimateGas = false;
|
|
29655
|
+
}
|
|
29656
|
+
|
|
29657
|
+
if (!estimateGas) {
|
|
29658
|
+
_context27.next = 6;
|
|
29659
|
+
break;
|
|
29660
|
+
}
|
|
29661
|
+
|
|
29662
|
+
_context27.next = 5;
|
|
29663
|
+
return this.managerLogic.estimateGas.setMaxSupplyCap(_maxSupplyCapD18, options);
|
|
29664
|
+
|
|
29665
|
+
case 5:
|
|
29666
|
+
return _context27.abrupt("return", _context27.sent);
|
|
29667
|
+
|
|
29668
|
+
case 6:
|
|
29669
|
+
_context27.next = 8;
|
|
29670
|
+
return this.managerLogic.setMaxSupplyCap(_maxSupplyCapD18, options);
|
|
29671
|
+
|
|
29672
|
+
case 8:
|
|
29673
|
+
tx = _context27.sent;
|
|
29674
|
+
return _context27.abrupt("return", tx);
|
|
29675
|
+
|
|
29676
|
+
case 10:
|
|
29677
|
+
case "end":
|
|
29678
|
+
return _context27.stop();
|
|
29679
|
+
}
|
|
29680
|
+
}
|
|
29681
|
+
}, _callee27, this);
|
|
29682
|
+
}));
|
|
29683
|
+
|
|
29684
|
+
function setMaxCap(_x120, _x121, _x122) {
|
|
29685
|
+
return _setMaxCap.apply(this, arguments);
|
|
29686
|
+
}
|
|
29687
|
+
|
|
29688
|
+
return setMaxCap;
|
|
29689
|
+
}()
|
|
29591
29690
|
/**
|
|
29592
29691
|
* Invest into a Balancer pool
|
|
29593
29692
|
* @param {string} poolId Balancer pool id
|
|
@@ -29602,11 +29701,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29602
29701
|
_proto.joinBalancerPool =
|
|
29603
29702
|
/*#__PURE__*/
|
|
29604
29703
|
function () {
|
|
29605
|
-
var _joinBalancerPool = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29704
|
+
var _joinBalancerPool = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee28(poolId, assets, amountsIn, options, sdkOptions) {
|
|
29606
29705
|
var joinPoolTxData, tx;
|
|
29607
|
-
return runtime_1.wrap(function
|
|
29706
|
+
return runtime_1.wrap(function _callee28$(_context28) {
|
|
29608
29707
|
while (1) {
|
|
29609
|
-
switch (
|
|
29708
|
+
switch (_context28.prev = _context28.next) {
|
|
29610
29709
|
case 0:
|
|
29611
29710
|
if (options === void 0) {
|
|
29612
29711
|
options = null;
|
|
@@ -29619,22 +29718,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29619
29718
|
}
|
|
29620
29719
|
|
|
29621
29720
|
joinPoolTxData = this.utils.getBalancerJoinPoolTx(this, poolId, assets, amountsIn);
|
|
29622
|
-
|
|
29721
|
+
_context28.next = 5;
|
|
29623
29722
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.BALANCER], joinPoolTxData, options], sdkOptions);
|
|
29624
29723
|
|
|
29625
29724
|
case 5:
|
|
29626
|
-
tx =
|
|
29627
|
-
return
|
|
29725
|
+
tx = _context28.sent;
|
|
29726
|
+
return _context28.abrupt("return", tx);
|
|
29628
29727
|
|
|
29629
29728
|
case 7:
|
|
29630
29729
|
case "end":
|
|
29631
|
-
return
|
|
29730
|
+
return _context28.stop();
|
|
29632
29731
|
}
|
|
29633
29732
|
}
|
|
29634
|
-
},
|
|
29733
|
+
}, _callee28, this);
|
|
29635
29734
|
}));
|
|
29636
29735
|
|
|
29637
|
-
function joinBalancerPool(
|
|
29736
|
+
function joinBalancerPool(_x123, _x124, _x125, _x126, _x127) {
|
|
29638
29737
|
return _joinBalancerPool.apply(this, arguments);
|
|
29639
29738
|
}
|
|
29640
29739
|
|
|
@@ -29655,11 +29754,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29655
29754
|
_proto.exitBalancerPool =
|
|
29656
29755
|
/*#__PURE__*/
|
|
29657
29756
|
function () {
|
|
29658
|
-
var _exitBalancerPool = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29757
|
+
var _exitBalancerPool = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee29(poolId, assets, amount, singleExitAssetIndex, options, sdkOptions) {
|
|
29659
29758
|
var exitPoolTxData, tx;
|
|
29660
|
-
return runtime_1.wrap(function
|
|
29759
|
+
return runtime_1.wrap(function _callee29$(_context29) {
|
|
29661
29760
|
while (1) {
|
|
29662
|
-
switch (
|
|
29761
|
+
switch (_context29.prev = _context29.next) {
|
|
29663
29762
|
case 0:
|
|
29664
29763
|
if (singleExitAssetIndex === void 0) {
|
|
29665
29764
|
singleExitAssetIndex = null;
|
|
@@ -29676,22 +29775,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29676
29775
|
}
|
|
29677
29776
|
|
|
29678
29777
|
exitPoolTxData = this.utils.getBalancerExitPoolTx(this, poolId, assets, singleExitAssetIndex, amount);
|
|
29679
|
-
|
|
29778
|
+
_context29.next = 6;
|
|
29680
29779
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.BALANCER], exitPoolTxData, options], sdkOptions);
|
|
29681
29780
|
|
|
29682
29781
|
case 6:
|
|
29683
|
-
tx =
|
|
29684
|
-
return
|
|
29782
|
+
tx = _context29.sent;
|
|
29783
|
+
return _context29.abrupt("return", tx);
|
|
29685
29784
|
|
|
29686
29785
|
case 8:
|
|
29687
29786
|
case "end":
|
|
29688
|
-
return
|
|
29787
|
+
return _context29.stop();
|
|
29689
29788
|
}
|
|
29690
29789
|
}
|
|
29691
|
-
},
|
|
29790
|
+
}, _callee29, this);
|
|
29692
29791
|
}));
|
|
29693
29792
|
|
|
29694
|
-
function exitBalancerPool(
|
|
29793
|
+
function exitBalancerPool(_x128, _x129, _x130, _x131, _x132, _x133) {
|
|
29695
29794
|
return _exitBalancerPool.apply(this, arguments);
|
|
29696
29795
|
}
|
|
29697
29796
|
|
|
@@ -29709,11 +29808,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29709
29808
|
_proto.harvestAaveRewards =
|
|
29710
29809
|
/*#__PURE__*/
|
|
29711
29810
|
function () {
|
|
29712
|
-
var _harvestAaveRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29811
|
+
var _harvestAaveRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee30(assets, options, sdkOptions) {
|
|
29713
29812
|
var aaveIncentivesAddress, iAaveIncentivesController, aaveIncentivesController, amount, claimTxData, tx;
|
|
29714
|
-
return runtime_1.wrap(function
|
|
29813
|
+
return runtime_1.wrap(function _callee30$(_context30) {
|
|
29715
29814
|
while (1) {
|
|
29716
|
-
switch (
|
|
29815
|
+
switch (_context30.prev = _context30.next) {
|
|
29717
29816
|
case 0:
|
|
29718
29817
|
if (options === void 0) {
|
|
29719
29818
|
options = null;
|
|
@@ -29728,28 +29827,28 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29728
29827
|
aaveIncentivesAddress = stakingAddress[this.network][Dapp.AAVE];
|
|
29729
29828
|
iAaveIncentivesController = new ethers.utils.Interface(IAaveIncentivesController.abi);
|
|
29730
29829
|
aaveIncentivesController = new ethers.Contract(aaveIncentivesAddress, iAaveIncentivesController, this.signer);
|
|
29731
|
-
|
|
29830
|
+
_context30.next = 7;
|
|
29732
29831
|
return aaveIncentivesController.getUserUnclaimedRewards(this.address);
|
|
29733
29832
|
|
|
29734
29833
|
case 7:
|
|
29735
|
-
amount =
|
|
29834
|
+
amount = _context30.sent;
|
|
29736
29835
|
claimTxData = iAaveIncentivesController.encodeFunctionData(Transaction.CLAIM_REWARDS, [assets, amount, this.address]);
|
|
29737
|
-
|
|
29836
|
+
_context30.next = 11;
|
|
29738
29837
|
return getPoolTxOrGasEstimate(this, [aaveIncentivesAddress, claimTxData, options], sdkOptions);
|
|
29739
29838
|
|
|
29740
29839
|
case 11:
|
|
29741
|
-
tx =
|
|
29742
|
-
return
|
|
29840
|
+
tx = _context30.sent;
|
|
29841
|
+
return _context30.abrupt("return", tx);
|
|
29743
29842
|
|
|
29744
29843
|
case 13:
|
|
29745
29844
|
case "end":
|
|
29746
|
-
return
|
|
29845
|
+
return _context30.stop();
|
|
29747
29846
|
}
|
|
29748
29847
|
}
|
|
29749
|
-
},
|
|
29848
|
+
}, _callee30, this);
|
|
29750
29849
|
}));
|
|
29751
29850
|
|
|
29752
|
-
function harvestAaveRewards(
|
|
29851
|
+
function harvestAaveRewards(_x134, _x135, _x136) {
|
|
29753
29852
|
return _harvestAaveRewards.apply(this, arguments);
|
|
29754
29853
|
}
|
|
29755
29854
|
|
|
@@ -29768,11 +29867,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29768
29867
|
_proto.harvestAaveV3Rewards =
|
|
29769
29868
|
/*#__PURE__*/
|
|
29770
29869
|
function () {
|
|
29771
|
-
var _harvestAaveV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29870
|
+
var _harvestAaveV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee31(assets, rewardAsset, options, sdkOptions) {
|
|
29772
29871
|
var claimTxData, tx;
|
|
29773
|
-
return runtime_1.wrap(function
|
|
29872
|
+
return runtime_1.wrap(function _callee31$(_context31) {
|
|
29774
29873
|
while (1) {
|
|
29775
|
-
switch (
|
|
29874
|
+
switch (_context31.prev = _context31.next) {
|
|
29776
29875
|
case 0:
|
|
29777
29876
|
if (options === void 0) {
|
|
29778
29877
|
options = null;
|
|
@@ -29784,27 +29883,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29784
29883
|
};
|
|
29785
29884
|
}
|
|
29786
29885
|
|
|
29787
|
-
|
|
29886
|
+
_context31.next = 4;
|
|
29788
29887
|
return getAaveV3ClaimTxData(this, assets, rewardAsset);
|
|
29789
29888
|
|
|
29790
29889
|
case 4:
|
|
29791
|
-
claimTxData =
|
|
29792
|
-
|
|
29890
|
+
claimTxData = _context31.sent;
|
|
29891
|
+
_context31.next = 7;
|
|
29793
29892
|
return getPoolTxOrGasEstimate(this, [stakingAddress[this.network][Dapp.AAVEV3], claimTxData, options], sdkOptions);
|
|
29794
29893
|
|
|
29795
29894
|
case 7:
|
|
29796
|
-
tx =
|
|
29797
|
-
return
|
|
29895
|
+
tx = _context31.sent;
|
|
29896
|
+
return _context31.abrupt("return", tx);
|
|
29798
29897
|
|
|
29799
29898
|
case 9:
|
|
29800
29899
|
case "end":
|
|
29801
|
-
return
|
|
29900
|
+
return _context31.stop();
|
|
29802
29901
|
}
|
|
29803
29902
|
}
|
|
29804
|
-
},
|
|
29903
|
+
}, _callee31, this);
|
|
29805
29904
|
}));
|
|
29806
29905
|
|
|
29807
|
-
function harvestAaveV3Rewards(
|
|
29906
|
+
function harvestAaveV3Rewards(_x137, _x138, _x139, _x140) {
|
|
29808
29907
|
return _harvestAaveV3Rewards.apply(this, arguments);
|
|
29809
29908
|
}
|
|
29810
29909
|
|
|
@@ -29822,11 +29921,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29822
29921
|
_proto.harvestCompoundV3Rewards =
|
|
29823
29922
|
/*#__PURE__*/
|
|
29824
29923
|
function () {
|
|
29825
|
-
var _harvestCompoundV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29924
|
+
var _harvestCompoundV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee32(asset, options, sdkOptions) {
|
|
29826
29925
|
var claimTxData, tx;
|
|
29827
|
-
return runtime_1.wrap(function
|
|
29926
|
+
return runtime_1.wrap(function _callee32$(_context32) {
|
|
29828
29927
|
while (1) {
|
|
29829
|
-
switch (
|
|
29928
|
+
switch (_context32.prev = _context32.next) {
|
|
29830
29929
|
case 0:
|
|
29831
29930
|
if (options === void 0) {
|
|
29832
29931
|
options = null;
|
|
@@ -29838,27 +29937,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29838
29937
|
};
|
|
29839
29938
|
}
|
|
29840
29939
|
|
|
29841
|
-
|
|
29940
|
+
_context32.next = 4;
|
|
29842
29941
|
return getCompoundV3ClaimTxData(this, asset);
|
|
29843
29942
|
|
|
29844
29943
|
case 4:
|
|
29845
|
-
claimTxData =
|
|
29846
|
-
|
|
29944
|
+
claimTxData = _context32.sent;
|
|
29945
|
+
_context32.next = 7;
|
|
29847
29946
|
return getPoolTxOrGasEstimate(this, [stakingAddress[this.network][Dapp.COMPOUNDV3], claimTxData, options], sdkOptions);
|
|
29848
29947
|
|
|
29849
29948
|
case 7:
|
|
29850
|
-
tx =
|
|
29851
|
-
return
|
|
29949
|
+
tx = _context32.sent;
|
|
29950
|
+
return _context32.abrupt("return", tx);
|
|
29852
29951
|
|
|
29853
29952
|
case 9:
|
|
29854
29953
|
case "end":
|
|
29855
|
-
return
|
|
29954
|
+
return _context32.stop();
|
|
29856
29955
|
}
|
|
29857
29956
|
}
|
|
29858
|
-
},
|
|
29957
|
+
}, _callee32, this);
|
|
29859
29958
|
}));
|
|
29860
29959
|
|
|
29861
|
-
function harvestCompoundV3Rewards(
|
|
29960
|
+
function harvestCompoundV3Rewards(_x141, _x142, _x143) {
|
|
29862
29961
|
return _harvestCompoundV3Rewards.apply(this, arguments);
|
|
29863
29962
|
}
|
|
29864
29963
|
|
|
@@ -29885,11 +29984,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29885
29984
|
_proto.addLiquidityUniswapV3 =
|
|
29886
29985
|
/*#__PURE__*/
|
|
29887
29986
|
function () {
|
|
29888
|
-
var _addLiquidityUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29987
|
+
var _addLiquidityUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee33(dapp, assetA, assetB, amountA, amountB, minPrice, maxPrice, minTick, maxTick, feeAmountOrTickSpacing, options, sdkOptions) {
|
|
29889
29988
|
var mintTxData, tx;
|
|
29890
|
-
return runtime_1.wrap(function
|
|
29989
|
+
return runtime_1.wrap(function _callee33$(_context33) {
|
|
29891
29990
|
while (1) {
|
|
29892
|
-
switch (
|
|
29991
|
+
switch (_context33.prev = _context33.next) {
|
|
29893
29992
|
case 0:
|
|
29894
29993
|
if (options === void 0) {
|
|
29895
29994
|
options = null;
|
|
@@ -29902,7 +30001,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29902
30001
|
}
|
|
29903
30002
|
|
|
29904
30003
|
if (!((minPrice === null || maxPrice === null) && (minTick === null || maxTick === null))) {
|
|
29905
|
-
|
|
30004
|
+
_context33.next = 4;
|
|
29906
30005
|
break;
|
|
29907
30006
|
}
|
|
29908
30007
|
|
|
@@ -29910,34 +30009,34 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29910
30009
|
|
|
29911
30010
|
case 4:
|
|
29912
30011
|
if (!((minPrice || maxPrice) && dapp !== Dapp.UNISWAPV3)) {
|
|
29913
|
-
|
|
30012
|
+
_context33.next = 6;
|
|
29914
30013
|
break;
|
|
29915
30014
|
}
|
|
29916
30015
|
|
|
29917
30016
|
throw new Error("no price conversion for Aerodrome/Velodrome CL");
|
|
29918
30017
|
|
|
29919
30018
|
case 6:
|
|
29920
|
-
|
|
30019
|
+
_context33.next = 8;
|
|
29921
30020
|
return getUniswapV3MintTxData(dapp, this, assetA, assetB, amountA, amountB, minPrice, maxPrice, minTick, maxTick, feeAmountOrTickSpacing);
|
|
29922
30021
|
|
|
29923
30022
|
case 8:
|
|
29924
|
-
mintTxData =
|
|
29925
|
-
|
|
30023
|
+
mintTxData = _context33.sent;
|
|
30024
|
+
_context33.next = 11;
|
|
29926
30025
|
return getPoolTxOrGasEstimate(this, [nonfungiblePositionManagerAddress[this.network][dapp], mintTxData, options], sdkOptions);
|
|
29927
30026
|
|
|
29928
30027
|
case 11:
|
|
29929
|
-
tx =
|
|
29930
|
-
return
|
|
30028
|
+
tx = _context33.sent;
|
|
30029
|
+
return _context33.abrupt("return", tx);
|
|
29931
30030
|
|
|
29932
30031
|
case 13:
|
|
29933
30032
|
case "end":
|
|
29934
|
-
return
|
|
30033
|
+
return _context33.stop();
|
|
29935
30034
|
}
|
|
29936
30035
|
}
|
|
29937
|
-
},
|
|
30036
|
+
}, _callee33, this);
|
|
29938
30037
|
}));
|
|
29939
30038
|
|
|
29940
|
-
function addLiquidityUniswapV3(
|
|
30039
|
+
function addLiquidityUniswapV3(_x144, _x145, _x146, _x147, _x148, _x149, _x150, _x151, _x152, _x153, _x154, _x155) {
|
|
29941
30040
|
return _addLiquidityUniswapV.apply(this, arguments);
|
|
29942
30041
|
}
|
|
29943
30042
|
|
|
@@ -29957,11 +30056,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29957
30056
|
_proto.decreaseLiquidity =
|
|
29958
30057
|
/*#__PURE__*/
|
|
29959
30058
|
function () {
|
|
29960
|
-
var _decreaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30059
|
+
var _decreaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee34(dapp, tokenId, amount, options, sdkOptions) {
|
|
29961
30060
|
var dappAddress, isStaked, txData, tokenIdOwner, tx;
|
|
29962
|
-
return runtime_1.wrap(function
|
|
30061
|
+
return runtime_1.wrap(function _callee34$(_context34) {
|
|
29963
30062
|
while (1) {
|
|
29964
|
-
switch (
|
|
30063
|
+
switch (_context34.prev = _context34.next) {
|
|
29965
30064
|
case 0:
|
|
29966
30065
|
if (amount === void 0) {
|
|
29967
30066
|
amount = 100;
|
|
@@ -29978,20 +30077,20 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29978
30077
|
}
|
|
29979
30078
|
|
|
29980
30079
|
isStaked = false;
|
|
29981
|
-
|
|
29982
|
-
|
|
30080
|
+
_context34.t0 = dapp;
|
|
30081
|
+
_context34.next = _context34.t0 === Dapp.UNISWAPV3 ? 7 : _context34.t0 === Dapp.RAMSESCL ? 7 : _context34.t0 === Dapp.VELODROMECL ? 9 : _context34.t0 === Dapp.AERODROMECL ? 9 : _context34.t0 === Dapp.PANCAKECL ? 9 : _context34.t0 === Dapp.ARRAKIS ? 14 : 16;
|
|
29983
30082
|
break;
|
|
29984
30083
|
|
|
29985
30084
|
case 7:
|
|
29986
30085
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
29987
|
-
return
|
|
30086
|
+
return _context34.abrupt("break", 17);
|
|
29988
30087
|
|
|
29989
30088
|
case 9:
|
|
29990
|
-
|
|
30089
|
+
_context34.next = 11;
|
|
29991
30090
|
return getClOwner(this, dapp, tokenId);
|
|
29992
30091
|
|
|
29993
30092
|
case 11:
|
|
29994
|
-
tokenIdOwner =
|
|
30093
|
+
tokenIdOwner = _context34.sent;
|
|
29995
30094
|
|
|
29996
30095
|
if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
|
|
29997
30096
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
@@ -30001,49 +30100,49 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30001
30100
|
isStaked = true;
|
|
30002
30101
|
}
|
|
30003
30102
|
|
|
30004
|
-
return
|
|
30103
|
+
return _context34.abrupt("break", 17);
|
|
30005
30104
|
|
|
30006
30105
|
case 14:
|
|
30007
30106
|
dappAddress = routerAddress[this.network][dapp];
|
|
30008
|
-
return
|
|
30107
|
+
return _context34.abrupt("break", 17);
|
|
30009
30108
|
|
|
30010
30109
|
case 16:
|
|
30011
30110
|
throw new Error("dapp not supported");
|
|
30012
30111
|
|
|
30013
30112
|
case 17:
|
|
30014
30113
|
if (!(!isStaked || dapp === Dapp.PANCAKECL)) {
|
|
30015
|
-
|
|
30114
|
+
_context34.next = 23;
|
|
30016
30115
|
break;
|
|
30017
30116
|
}
|
|
30018
30117
|
|
|
30019
|
-
|
|
30118
|
+
_context34.next = 20;
|
|
30020
30119
|
return getDecreaseLiquidityTxData(this, dapp, tokenId, amount, isStaked);
|
|
30021
30120
|
|
|
30022
30121
|
case 20:
|
|
30023
|
-
txData =
|
|
30024
|
-
|
|
30122
|
+
txData = _context34.sent;
|
|
30123
|
+
_context34.next = 24;
|
|
30025
30124
|
break;
|
|
30026
30125
|
|
|
30027
30126
|
case 23:
|
|
30028
30127
|
throw new Error("unsupported decreaseStakedLiquidity: unstake first to decrease lp");
|
|
30029
30128
|
|
|
30030
30129
|
case 24:
|
|
30031
|
-
|
|
30130
|
+
_context34.next = 26;
|
|
30032
30131
|
return getPoolTxOrGasEstimate(this, [dappAddress, txData, options], sdkOptions);
|
|
30033
30132
|
|
|
30034
30133
|
case 26:
|
|
30035
|
-
tx =
|
|
30036
|
-
return
|
|
30134
|
+
tx = _context34.sent;
|
|
30135
|
+
return _context34.abrupt("return", tx);
|
|
30037
30136
|
|
|
30038
30137
|
case 28:
|
|
30039
30138
|
case "end":
|
|
30040
|
-
return
|
|
30139
|
+
return _context34.stop();
|
|
30041
30140
|
}
|
|
30042
30141
|
}
|
|
30043
|
-
},
|
|
30142
|
+
}, _callee34, this);
|
|
30044
30143
|
}));
|
|
30045
30144
|
|
|
30046
|
-
function decreaseLiquidity(
|
|
30145
|
+
function decreaseLiquidity(_x156, _x157, _x158, _x159, _x160) {
|
|
30047
30146
|
return _decreaseLiquidity.apply(this, arguments);
|
|
30048
30147
|
}
|
|
30049
30148
|
|
|
@@ -30064,11 +30163,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30064
30163
|
_proto.increaseLiquidity =
|
|
30065
30164
|
/*#__PURE__*/
|
|
30066
30165
|
function () {
|
|
30067
|
-
var _increaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30166
|
+
var _increaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee35(dapp, tokenId, amountA, amountB, options, sdkOptions) {
|
|
30068
30167
|
var dappAddress, isStaked, txData, tokenIdOwner, tx;
|
|
30069
|
-
return runtime_1.wrap(function
|
|
30168
|
+
return runtime_1.wrap(function _callee35$(_context35) {
|
|
30070
30169
|
while (1) {
|
|
30071
|
-
switch (
|
|
30170
|
+
switch (_context35.prev = _context35.next) {
|
|
30072
30171
|
case 0:
|
|
30073
30172
|
if (options === void 0) {
|
|
30074
30173
|
options = null;
|
|
@@ -30081,20 +30180,20 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30081
30180
|
}
|
|
30082
30181
|
|
|
30083
30182
|
isStaked = false;
|
|
30084
|
-
|
|
30085
|
-
|
|
30183
|
+
_context35.t0 = dapp;
|
|
30184
|
+
_context35.next = _context35.t0 === Dapp.UNISWAPV3 ? 6 : _context35.t0 === Dapp.RAMSESCL ? 6 : _context35.t0 === Dapp.VELODROMECL ? 8 : _context35.t0 === Dapp.AERODROMECL ? 8 : _context35.t0 === Dapp.PANCAKECL ? 8 : _context35.t0 === Dapp.ARRAKIS ? 13 : 15;
|
|
30086
30185
|
break;
|
|
30087
30186
|
|
|
30088
30187
|
case 6:
|
|
30089
30188
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
30090
|
-
return
|
|
30189
|
+
return _context35.abrupt("break", 16);
|
|
30091
30190
|
|
|
30092
30191
|
case 8:
|
|
30093
|
-
|
|
30192
|
+
_context35.next = 10;
|
|
30094
30193
|
return getClOwner(this, dapp, tokenId);
|
|
30095
30194
|
|
|
30096
30195
|
case 10:
|
|
30097
|
-
tokenIdOwner =
|
|
30196
|
+
tokenIdOwner = _context35.sent;
|
|
30098
30197
|
|
|
30099
30198
|
if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
|
|
30100
30199
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
@@ -30104,49 +30203,49 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30104
30203
|
isStaked = true;
|
|
30105
30204
|
}
|
|
30106
30205
|
|
|
30107
|
-
return
|
|
30206
|
+
return _context35.abrupt("break", 16);
|
|
30108
30207
|
|
|
30109
30208
|
case 13:
|
|
30110
30209
|
dappAddress = routerAddress[this.network][dapp];
|
|
30111
|
-
return
|
|
30210
|
+
return _context35.abrupt("break", 16);
|
|
30112
30211
|
|
|
30113
30212
|
case 15:
|
|
30114
30213
|
throw new Error("dapp not supported");
|
|
30115
30214
|
|
|
30116
30215
|
case 16:
|
|
30117
30216
|
if (!(!isStaked || dapp === Dapp.PANCAKECL)) {
|
|
30118
|
-
|
|
30217
|
+
_context35.next = 22;
|
|
30119
30218
|
break;
|
|
30120
30219
|
}
|
|
30121
30220
|
|
|
30122
|
-
|
|
30221
|
+
_context35.next = 19;
|
|
30123
30222
|
return getIncreaseLiquidityTxData(this, dapp, tokenId, amountA, amountB);
|
|
30124
30223
|
|
|
30125
30224
|
case 19:
|
|
30126
|
-
txData =
|
|
30127
|
-
|
|
30225
|
+
txData = _context35.sent;
|
|
30226
|
+
_context35.next = 23;
|
|
30128
30227
|
break;
|
|
30129
30228
|
|
|
30130
30229
|
case 22:
|
|
30131
30230
|
throw new Error("unsupported increaseStakedLiquidity: unstake first to increase lp");
|
|
30132
30231
|
|
|
30133
30232
|
case 23:
|
|
30134
|
-
|
|
30233
|
+
_context35.next = 25;
|
|
30135
30234
|
return getPoolTxOrGasEstimate(this, [dappAddress, txData, options], sdkOptions);
|
|
30136
30235
|
|
|
30137
30236
|
case 25:
|
|
30138
|
-
tx =
|
|
30139
|
-
return
|
|
30237
|
+
tx = _context35.sent;
|
|
30238
|
+
return _context35.abrupt("return", tx);
|
|
30140
30239
|
|
|
30141
30240
|
case 27:
|
|
30142
30241
|
case "end":
|
|
30143
|
-
return
|
|
30242
|
+
return _context35.stop();
|
|
30144
30243
|
}
|
|
30145
30244
|
}
|
|
30146
|
-
},
|
|
30245
|
+
}, _callee35, this);
|
|
30147
30246
|
}));
|
|
30148
30247
|
|
|
30149
|
-
function increaseLiquidity(
|
|
30248
|
+
function increaseLiquidity(_x161, _x162, _x163, _x164, _x165, _x166) {
|
|
30150
30249
|
return _increaseLiquidity.apply(this, arguments);
|
|
30151
30250
|
}
|
|
30152
30251
|
|
|
@@ -30165,11 +30264,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30165
30264
|
_proto.claimFees =
|
|
30166
30265
|
/*#__PURE__*/
|
|
30167
30266
|
function () {
|
|
30168
|
-
var _claimFees = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30267
|
+
var _claimFees = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(dapp, tokenId, options, sdkOptions) {
|
|
30169
30268
|
var txData, contractAddress, iNonfungiblePositionManager, abi, tokenIdOwner, tx;
|
|
30170
|
-
return runtime_1.wrap(function
|
|
30269
|
+
return runtime_1.wrap(function _callee36$(_context36) {
|
|
30171
30270
|
while (1) {
|
|
30172
|
-
switch (
|
|
30271
|
+
switch (_context36.prev = _context36.next) {
|
|
30173
30272
|
case 0:
|
|
30174
30273
|
if (options === void 0) {
|
|
30175
30274
|
options = null;
|
|
@@ -30182,37 +30281,37 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30182
30281
|
}
|
|
30183
30282
|
|
|
30184
30283
|
iNonfungiblePositionManager = new ethers.utils.Interface(INonfungiblePositionManager.abi);
|
|
30185
|
-
|
|
30186
|
-
|
|
30284
|
+
_context36.t0 = dapp;
|
|
30285
|
+
_context36.next = _context36.t0 === Dapp.UNISWAPV3 ? 6 : _context36.t0 === Dapp.RAMSESCL ? 6 : _context36.t0 === Dapp.ARRAKIS ? 9 : _context36.t0 === Dapp.BALANCER ? 9 : _context36.t0 === Dapp.VELODROME ? 13 : _context36.t0 === Dapp.RAMSES ? 13 : _context36.t0 === Dapp.VELODROMEV2 ? 16 : _context36.t0 === Dapp.AERODROME ? 16 : _context36.t0 === Dapp.VELODROMECL ? 19 : _context36.t0 === Dapp.AERODROMECL ? 19 : _context36.t0 === Dapp.PANCAKECL ? 19 : 24;
|
|
30187
30286
|
break;
|
|
30188
30287
|
|
|
30189
30288
|
case 6:
|
|
30190
30289
|
contractAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
30191
30290
|
txData = iNonfungiblePositionManager.encodeFunctionData(Transaction.COLLECT, [[tokenId, this.address, MaxUint128, MaxUint128]]);
|
|
30192
|
-
return
|
|
30291
|
+
return _context36.abrupt("break", 25);
|
|
30193
30292
|
|
|
30194
30293
|
case 9:
|
|
30195
30294
|
contractAddress = tokenId;
|
|
30196
30295
|
abi = new ethers.utils.Interface(ILiquidityGaugeV4.abi);
|
|
30197
30296
|
txData = abi.encodeFunctionData("claim_rewards()", []);
|
|
30198
|
-
return
|
|
30297
|
+
return _context36.abrupt("break", 25);
|
|
30199
30298
|
|
|
30200
30299
|
case 13:
|
|
30201
30300
|
contractAddress = tokenId;
|
|
30202
30301
|
txData = getVelodromeClaimTxData(this, tokenId, false);
|
|
30203
|
-
return
|
|
30302
|
+
return _context36.abrupt("break", 25);
|
|
30204
30303
|
|
|
30205
30304
|
case 16:
|
|
30206
30305
|
contractAddress = tokenId;
|
|
30207
30306
|
txData = getVelodromeClaimTxData(this, tokenId, true);
|
|
30208
|
-
return
|
|
30307
|
+
return _context36.abrupt("break", 25);
|
|
30209
30308
|
|
|
30210
30309
|
case 19:
|
|
30211
|
-
|
|
30310
|
+
_context36.next = 21;
|
|
30212
30311
|
return getClOwner(this, dapp, tokenId);
|
|
30213
30312
|
|
|
30214
30313
|
case 21:
|
|
30215
|
-
tokenIdOwner =
|
|
30314
|
+
tokenIdOwner = _context36.sent;
|
|
30216
30315
|
|
|
30217
30316
|
if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
|
|
30218
30317
|
contractAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
@@ -30228,28 +30327,28 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30228
30327
|
}
|
|
30229
30328
|
}
|
|
30230
30329
|
|
|
30231
|
-
return
|
|
30330
|
+
return _context36.abrupt("break", 25);
|
|
30232
30331
|
|
|
30233
30332
|
case 24:
|
|
30234
30333
|
throw new Error("dapp not supported");
|
|
30235
30334
|
|
|
30236
30335
|
case 25:
|
|
30237
|
-
|
|
30336
|
+
_context36.next = 27;
|
|
30238
30337
|
return getPoolTxOrGasEstimate(this, [contractAddress, txData, options], sdkOptions);
|
|
30239
30338
|
|
|
30240
30339
|
case 27:
|
|
30241
|
-
tx =
|
|
30242
|
-
return
|
|
30340
|
+
tx = _context36.sent;
|
|
30341
|
+
return _context36.abrupt("return", tx);
|
|
30243
30342
|
|
|
30244
30343
|
case 29:
|
|
30245
30344
|
case "end":
|
|
30246
|
-
return
|
|
30345
|
+
return _context36.stop();
|
|
30247
30346
|
}
|
|
30248
30347
|
}
|
|
30249
|
-
},
|
|
30348
|
+
}, _callee36, this);
|
|
30250
30349
|
}));
|
|
30251
30350
|
|
|
30252
|
-
function claimFees(
|
|
30351
|
+
function claimFees(_x167, _x168, _x169, _x170) {
|
|
30253
30352
|
return _claimFees.apply(this, arguments);
|
|
30254
30353
|
}
|
|
30255
30354
|
|
|
@@ -30269,11 +30368,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30269
30368
|
_proto.getRewards =
|
|
30270
30369
|
/*#__PURE__*/
|
|
30271
30370
|
function () {
|
|
30272
|
-
var _getRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30371
|
+
var _getRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee37(dapp, tokenId, rewards, options, sdkOptions) {
|
|
30273
30372
|
var tx;
|
|
30274
|
-
return runtime_1.wrap(function
|
|
30373
|
+
return runtime_1.wrap(function _callee37$(_context37) {
|
|
30275
30374
|
while (1) {
|
|
30276
|
-
switch (
|
|
30375
|
+
switch (_context37.prev = _context37.next) {
|
|
30277
30376
|
case 0:
|
|
30278
30377
|
if (options === void 0) {
|
|
30279
30378
|
options = null;
|
|
@@ -30285,22 +30384,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30285
30384
|
};
|
|
30286
30385
|
}
|
|
30287
30386
|
|
|
30288
|
-
|
|
30387
|
+
_context37.next = 4;
|
|
30289
30388
|
return getPoolTxOrGasEstimate(this, [nonfungiblePositionManagerAddress[this.network][dapp], getRewardsTxDta(tokenId, rewards), options], sdkOptions);
|
|
30290
30389
|
|
|
30291
30390
|
case 4:
|
|
30292
|
-
tx =
|
|
30293
|
-
return
|
|
30391
|
+
tx = _context37.sent;
|
|
30392
|
+
return _context37.abrupt("return", tx);
|
|
30294
30393
|
|
|
30295
30394
|
case 6:
|
|
30296
30395
|
case "end":
|
|
30297
|
-
return
|
|
30396
|
+
return _context37.stop();
|
|
30298
30397
|
}
|
|
30299
30398
|
}
|
|
30300
|
-
},
|
|
30399
|
+
}, _callee37, this);
|
|
30301
30400
|
}));
|
|
30302
30401
|
|
|
30303
|
-
function getRewards(
|
|
30402
|
+
function getRewards(_x171, _x172, _x173, _x174, _x175) {
|
|
30304
30403
|
return _getRewards.apply(this, arguments);
|
|
30305
30404
|
}
|
|
30306
30405
|
|
|
@@ -30323,11 +30422,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30323
30422
|
_proto.tradeUniswapV3 =
|
|
30324
30423
|
/*#__PURE__*/
|
|
30325
30424
|
function () {
|
|
30326
|
-
var _tradeUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30425
|
+
var _tradeUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(assetFrom, assetTo, amountIn, feeAmount, slippage, options, sdkOptions) {
|
|
30327
30426
|
var swapxData, tx;
|
|
30328
|
-
return runtime_1.wrap(function
|
|
30427
|
+
return runtime_1.wrap(function _callee38$(_context38) {
|
|
30329
30428
|
while (1) {
|
|
30330
|
-
switch (
|
|
30429
|
+
switch (_context38.prev = _context38.next) {
|
|
30331
30430
|
case 0:
|
|
30332
30431
|
if (slippage === void 0) {
|
|
30333
30432
|
slippage = 0.5;
|
|
@@ -30343,27 +30442,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30343
30442
|
};
|
|
30344
30443
|
}
|
|
30345
30444
|
|
|
30346
|
-
|
|
30445
|
+
_context38.next = 5;
|
|
30347
30446
|
return getUniswapV3SwapTxData(this, assetFrom, assetTo, amountIn, slippage, feeAmount);
|
|
30348
30447
|
|
|
30349
30448
|
case 5:
|
|
30350
|
-
swapxData =
|
|
30351
|
-
|
|
30449
|
+
swapxData = _context38.sent;
|
|
30450
|
+
_context38.next = 8;
|
|
30352
30451
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.UNISWAPV3], swapxData, options], sdkOptions);
|
|
30353
30452
|
|
|
30354
30453
|
case 8:
|
|
30355
|
-
tx =
|
|
30356
|
-
return
|
|
30454
|
+
tx = _context38.sent;
|
|
30455
|
+
return _context38.abrupt("return", tx);
|
|
30357
30456
|
|
|
30358
30457
|
case 10:
|
|
30359
30458
|
case "end":
|
|
30360
|
-
return
|
|
30459
|
+
return _context38.stop();
|
|
30361
30460
|
}
|
|
30362
30461
|
}
|
|
30363
|
-
},
|
|
30462
|
+
}, _callee38, this);
|
|
30364
30463
|
}));
|
|
30365
30464
|
|
|
30366
|
-
function tradeUniswapV3(
|
|
30465
|
+
function tradeUniswapV3(_x176, _x177, _x178, _x179, _x180, _x181, _x182) {
|
|
30367
30466
|
return _tradeUniswapV.apply(this, arguments);
|
|
30368
30467
|
}
|
|
30369
30468
|
|
|
@@ -30385,70 +30484,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30385
30484
|
_proto.addLiquidityVelodrome =
|
|
30386
30485
|
/*#__PURE__*/
|
|
30387
30486
|
function () {
|
|
30388
|
-
var _addLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30389
|
-
var tx;
|
|
30390
|
-
return runtime_1.wrap(function _callee38$(_context38) {
|
|
30391
|
-
while (1) {
|
|
30392
|
-
switch (_context38.prev = _context38.next) {
|
|
30393
|
-
case 0:
|
|
30394
|
-
if (options === void 0) {
|
|
30395
|
-
options = null;
|
|
30396
|
-
}
|
|
30397
|
-
|
|
30398
|
-
if (sdkOptions === void 0) {
|
|
30399
|
-
sdkOptions = {
|
|
30400
|
-
estimateGas: false
|
|
30401
|
-
};
|
|
30402
|
-
}
|
|
30403
|
-
|
|
30404
|
-
_context38.t0 = getPoolTxOrGasEstimate;
|
|
30405
|
-
_context38.t1 = this;
|
|
30406
|
-
_context38.t2 = routerAddress[this.network][Dapp.VELODROME];
|
|
30407
|
-
_context38.next = 7;
|
|
30408
|
-
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
30409
|
-
|
|
30410
|
-
case 7:
|
|
30411
|
-
_context38.t3 = _context38.sent;
|
|
30412
|
-
_context38.t4 = options;
|
|
30413
|
-
_context38.t5 = [_context38.t2, _context38.t3, _context38.t4];
|
|
30414
|
-
_context38.t6 = sdkOptions;
|
|
30415
|
-
_context38.next = 13;
|
|
30416
|
-
return (0, _context38.t0)(_context38.t1, _context38.t5, _context38.t6);
|
|
30417
|
-
|
|
30418
|
-
case 13:
|
|
30419
|
-
tx = _context38.sent;
|
|
30420
|
-
return _context38.abrupt("return", tx);
|
|
30421
|
-
|
|
30422
|
-
case 15:
|
|
30423
|
-
case "end":
|
|
30424
|
-
return _context38.stop();
|
|
30425
|
-
}
|
|
30426
|
-
}
|
|
30427
|
-
}, _callee38, this);
|
|
30428
|
-
}));
|
|
30429
|
-
|
|
30430
|
-
function addLiquidityVelodrome(_x180, _x181, _x182, _x183, _x184, _x185, _x186) {
|
|
30431
|
-
return _addLiquidityVelodrome.apply(this, arguments);
|
|
30432
|
-
}
|
|
30433
|
-
|
|
30434
|
-
return addLiquidityVelodrome;
|
|
30435
|
-
}()
|
|
30436
|
-
/**
|
|
30437
|
-
* Remove liquidity from Velodrome pool
|
|
30438
|
-
* @param {string} assetA First asset
|
|
30439
|
-
* @param {string} assetB Second asset
|
|
30440
|
-
* @param {BigNumber | string} amount Amount of LP tokens
|
|
30441
|
-
* @param { boolean } isStable Is stable pool
|
|
30442
|
-
* @param {any} options Transaction options
|
|
30443
|
-
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
30444
|
-
* @returns {Promise<any>} Transaction
|
|
30445
|
-
*/
|
|
30446
|
-
;
|
|
30447
|
-
|
|
30448
|
-
_proto.removeLiquidityVelodrome =
|
|
30449
|
-
/*#__PURE__*/
|
|
30450
|
-
function () {
|
|
30451
|
-
var _removeLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee39(assetA, assetB, amount, isStable, options, sdkOptions) {
|
|
30487
|
+
var _addLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee39(assetA, assetB, amountA, amountB, isStable, options, sdkOptions) {
|
|
30452
30488
|
var tx;
|
|
30453
30489
|
return runtime_1.wrap(function _callee39$(_context39) {
|
|
30454
30490
|
while (1) {
|
|
@@ -30468,7 +30504,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30468
30504
|
_context39.t1 = this;
|
|
30469
30505
|
_context39.t2 = routerAddress[this.network][Dapp.VELODROME];
|
|
30470
30506
|
_context39.next = 7;
|
|
30471
|
-
return
|
|
30507
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
30472
30508
|
|
|
30473
30509
|
case 7:
|
|
30474
30510
|
_context39.t3 = _context39.sent;
|
|
@@ -30490,18 +30526,17 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30490
30526
|
}, _callee39, this);
|
|
30491
30527
|
}));
|
|
30492
30528
|
|
|
30493
|
-
function
|
|
30494
|
-
return
|
|
30529
|
+
function addLiquidityVelodrome(_x183, _x184, _x185, _x186, _x187, _x188, _x189) {
|
|
30530
|
+
return _addLiquidityVelodrome.apply(this, arguments);
|
|
30495
30531
|
}
|
|
30496
30532
|
|
|
30497
|
-
return
|
|
30533
|
+
return addLiquidityVelodrome;
|
|
30498
30534
|
}()
|
|
30499
30535
|
/**
|
|
30500
|
-
*
|
|
30536
|
+
* Remove liquidity from Velodrome pool
|
|
30501
30537
|
* @param {string} assetA First asset
|
|
30502
30538
|
* @param {string} assetB Second asset
|
|
30503
|
-
* @param {BigNumber | string}
|
|
30504
|
-
* @param {BigNumber | string} amountB Amount second asset
|
|
30539
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
30505
30540
|
* @param { boolean } isStable Is stable pool
|
|
30506
30541
|
* @param {any} options Transaction options
|
|
30507
30542
|
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
@@ -30509,10 +30544,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30509
30544
|
*/
|
|
30510
30545
|
;
|
|
30511
30546
|
|
|
30512
|
-
_proto.
|
|
30547
|
+
_proto.removeLiquidityVelodrome =
|
|
30513
30548
|
/*#__PURE__*/
|
|
30514
30549
|
function () {
|
|
30515
|
-
var
|
|
30550
|
+
var _removeLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee40(assetA, assetB, amount, isStable, options, sdkOptions) {
|
|
30516
30551
|
var tx;
|
|
30517
30552
|
return runtime_1.wrap(function _callee40$(_context40) {
|
|
30518
30553
|
while (1) {
|
|
@@ -30530,9 +30565,9 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30530
30565
|
|
|
30531
30566
|
_context40.t0 = getPoolTxOrGasEstimate;
|
|
30532
30567
|
_context40.t1 = this;
|
|
30533
|
-
_context40.t2 = routerAddress[this.network][Dapp.
|
|
30568
|
+
_context40.t2 = routerAddress[this.network][Dapp.VELODROME];
|
|
30534
30569
|
_context40.next = 7;
|
|
30535
|
-
return
|
|
30570
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
30536
30571
|
|
|
30537
30572
|
case 7:
|
|
30538
30573
|
_context40.t3 = _context40.sent;
|
|
@@ -30554,17 +30589,18 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30554
30589
|
}, _callee40, this);
|
|
30555
30590
|
}));
|
|
30556
30591
|
|
|
30557
|
-
function
|
|
30558
|
-
return
|
|
30592
|
+
function removeLiquidityVelodrome(_x190, _x191, _x192, _x193, _x194, _x195) {
|
|
30593
|
+
return _removeLiquidityVelodrome.apply(this, arguments);
|
|
30559
30594
|
}
|
|
30560
30595
|
|
|
30561
|
-
return
|
|
30596
|
+
return removeLiquidityVelodrome;
|
|
30562
30597
|
}()
|
|
30563
30598
|
/**
|
|
30564
|
-
*
|
|
30599
|
+
* Add liquidity to Velodrome V2 pool
|
|
30565
30600
|
* @param {string} assetA First asset
|
|
30566
30601
|
* @param {string} assetB Second asset
|
|
30567
|
-
* @param {BigNumber | string}
|
|
30602
|
+
* @param {BigNumber | string} amountA Amount first asset
|
|
30603
|
+
* @param {BigNumber | string} amountB Amount second asset
|
|
30568
30604
|
* @param { boolean } isStable Is stable pool
|
|
30569
30605
|
* @param {any} options Transaction options
|
|
30570
30606
|
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
@@ -30572,10 +30608,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30572
30608
|
*/
|
|
30573
30609
|
;
|
|
30574
30610
|
|
|
30575
|
-
_proto.
|
|
30611
|
+
_proto.addLiquidityVelodromeV2 =
|
|
30576
30612
|
/*#__PURE__*/
|
|
30577
30613
|
function () {
|
|
30578
|
-
var
|
|
30614
|
+
var _addLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee41(assetA, assetB, amountA, amountB, isStable, options, sdkOptions) {
|
|
30579
30615
|
var tx;
|
|
30580
30616
|
return runtime_1.wrap(function _callee41$(_context41) {
|
|
30581
30617
|
while (1) {
|
|
@@ -30595,7 +30631,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30595
30631
|
_context41.t1 = this;
|
|
30596
30632
|
_context41.t2 = routerAddress[this.network][Dapp.VELODROMEV2];
|
|
30597
30633
|
_context41.next = 7;
|
|
30598
|
-
return
|
|
30634
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
30599
30635
|
|
|
30600
30636
|
case 7:
|
|
30601
30637
|
_context41.t3 = _context41.sent;
|
|
@@ -30617,19 +30653,17 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30617
30653
|
}, _callee41, this);
|
|
30618
30654
|
}));
|
|
30619
30655
|
|
|
30620
|
-
function
|
|
30621
|
-
return
|
|
30656
|
+
function addLiquidityVelodromeV2(_x196, _x197, _x198, _x199, _x200, _x201, _x202) {
|
|
30657
|
+
return _addLiquidityVelodromeV.apply(this, arguments);
|
|
30622
30658
|
}
|
|
30623
30659
|
|
|
30624
|
-
return
|
|
30660
|
+
return addLiquidityVelodromeV2;
|
|
30625
30661
|
}()
|
|
30626
30662
|
/**
|
|
30627
|
-
*
|
|
30628
|
-
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
30663
|
+
* Remove liquidity from Velodrome V2 pool
|
|
30629
30664
|
* @param {string} assetA First asset
|
|
30630
30665
|
* @param {string} assetB Second asset
|
|
30631
|
-
* @param {BigNumber | string}
|
|
30632
|
-
* @param {BigNumber | string} amountB Amount second asset
|
|
30666
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
30633
30667
|
* @param { boolean } isStable Is stable pool
|
|
30634
30668
|
* @param {any} options Transaction options
|
|
30635
30669
|
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
@@ -30637,10 +30671,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30637
30671
|
*/
|
|
30638
30672
|
;
|
|
30639
30673
|
|
|
30640
|
-
_proto.
|
|
30674
|
+
_proto.removeLiquidityVelodromeV2 =
|
|
30641
30675
|
/*#__PURE__*/
|
|
30642
30676
|
function () {
|
|
30643
|
-
var
|
|
30677
|
+
var _removeLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee42(assetA, assetB, amount, isStable, options, sdkOptions) {
|
|
30644
30678
|
var tx;
|
|
30645
30679
|
return runtime_1.wrap(function _callee42$(_context42) {
|
|
30646
30680
|
while (1) {
|
|
@@ -30658,9 +30692,9 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30658
30692
|
|
|
30659
30693
|
_context42.t0 = getPoolTxOrGasEstimate;
|
|
30660
30694
|
_context42.t1 = this;
|
|
30661
|
-
_context42.t2 = routerAddress[this.network][
|
|
30695
|
+
_context42.t2 = routerAddress[this.network][Dapp.VELODROMEV2];
|
|
30662
30696
|
_context42.next = 7;
|
|
30663
|
-
return
|
|
30697
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
30664
30698
|
|
|
30665
30699
|
case 7:
|
|
30666
30700
|
_context42.t3 = _context42.sent;
|
|
@@ -30682,18 +30716,19 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30682
30716
|
}, _callee42, this);
|
|
30683
30717
|
}));
|
|
30684
30718
|
|
|
30685
|
-
function
|
|
30686
|
-
return
|
|
30719
|
+
function removeLiquidityVelodromeV2(_x203, _x204, _x205, _x206, _x207, _x208) {
|
|
30720
|
+
return _removeLiquidityVelodromeV.apply(this, arguments);
|
|
30687
30721
|
}
|
|
30688
30722
|
|
|
30689
|
-
return
|
|
30723
|
+
return removeLiquidityVelodromeV2;
|
|
30690
30724
|
}()
|
|
30691
30725
|
/**
|
|
30692
|
-
*
|
|
30726
|
+
* Add liquidity to Velodrome V2 or Ramses pool
|
|
30693
30727
|
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
30694
30728
|
* @param {string} assetA First asset
|
|
30695
30729
|
* @param {string} assetB Second asset
|
|
30696
|
-
* @param {BigNumber | string}
|
|
30730
|
+
* @param {BigNumber | string} amountA Amount first asset
|
|
30731
|
+
* @param {BigNumber | string} amountB Amount second asset
|
|
30697
30732
|
* @param { boolean } isStable Is stable pool
|
|
30698
30733
|
* @param {any} options Transaction options
|
|
30699
30734
|
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
@@ -30701,10 +30736,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30701
30736
|
*/
|
|
30702
30737
|
;
|
|
30703
30738
|
|
|
30704
|
-
_proto.
|
|
30739
|
+
_proto.addLiquidityV2 =
|
|
30705
30740
|
/*#__PURE__*/
|
|
30706
30741
|
function () {
|
|
30707
|
-
var
|
|
30742
|
+
var _addLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee43(dapp, assetA, assetB, amountA, amountB, isStable, options, sdkOptions) {
|
|
30708
30743
|
var tx;
|
|
30709
30744
|
return runtime_1.wrap(function _callee43$(_context43) {
|
|
30710
30745
|
while (1) {
|
|
@@ -30724,7 +30759,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30724
30759
|
_context43.t1 = this;
|
|
30725
30760
|
_context43.t2 = routerAddress[this.network][dapp];
|
|
30726
30761
|
_context43.next = 7;
|
|
30727
|
-
return
|
|
30762
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
30728
30763
|
|
|
30729
30764
|
case 7:
|
|
30730
30765
|
_context43.t3 = _context43.sent;
|
|
@@ -30746,7 +30781,71 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30746
30781
|
}, _callee43, this);
|
|
30747
30782
|
}));
|
|
30748
30783
|
|
|
30749
|
-
function
|
|
30784
|
+
function addLiquidityV2(_x209, _x210, _x211, _x212, _x213, _x214, _x215, _x216) {
|
|
30785
|
+
return _addLiquidityV.apply(this, arguments);
|
|
30786
|
+
}
|
|
30787
|
+
|
|
30788
|
+
return addLiquidityV2;
|
|
30789
|
+
}()
|
|
30790
|
+
/**
|
|
30791
|
+
* Remove liquidity from Velodrome V2 or Ramses pool
|
|
30792
|
+
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
30793
|
+
* @param {string} assetA First asset
|
|
30794
|
+
* @param {string} assetB Second asset
|
|
30795
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
30796
|
+
* @param { boolean } isStable Is stable pool
|
|
30797
|
+
* @param {any} options Transaction options
|
|
30798
|
+
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
30799
|
+
* @returns {Promise<any>} Transaction
|
|
30800
|
+
*/
|
|
30801
|
+
;
|
|
30802
|
+
|
|
30803
|
+
_proto.removeLiquidityV2 =
|
|
30804
|
+
/*#__PURE__*/
|
|
30805
|
+
function () {
|
|
30806
|
+
var _removeLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee44(dapp, assetA, assetB, amount, isStable, options, sdkOptions) {
|
|
30807
|
+
var tx;
|
|
30808
|
+
return runtime_1.wrap(function _callee44$(_context44) {
|
|
30809
|
+
while (1) {
|
|
30810
|
+
switch (_context44.prev = _context44.next) {
|
|
30811
|
+
case 0:
|
|
30812
|
+
if (options === void 0) {
|
|
30813
|
+
options = null;
|
|
30814
|
+
}
|
|
30815
|
+
|
|
30816
|
+
if (sdkOptions === void 0) {
|
|
30817
|
+
sdkOptions = {
|
|
30818
|
+
estimateGas: false
|
|
30819
|
+
};
|
|
30820
|
+
}
|
|
30821
|
+
|
|
30822
|
+
_context44.t0 = getPoolTxOrGasEstimate;
|
|
30823
|
+
_context44.t1 = this;
|
|
30824
|
+
_context44.t2 = routerAddress[this.network][dapp];
|
|
30825
|
+
_context44.next = 7;
|
|
30826
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
30827
|
+
|
|
30828
|
+
case 7:
|
|
30829
|
+
_context44.t3 = _context44.sent;
|
|
30830
|
+
_context44.t4 = options;
|
|
30831
|
+
_context44.t5 = [_context44.t2, _context44.t3, _context44.t4];
|
|
30832
|
+
_context44.t6 = sdkOptions;
|
|
30833
|
+
_context44.next = 13;
|
|
30834
|
+
return (0, _context44.t0)(_context44.t1, _context44.t5, _context44.t6);
|
|
30835
|
+
|
|
30836
|
+
case 13:
|
|
30837
|
+
tx = _context44.sent;
|
|
30838
|
+
return _context44.abrupt("return", tx);
|
|
30839
|
+
|
|
30840
|
+
case 15:
|
|
30841
|
+
case "end":
|
|
30842
|
+
return _context44.stop();
|
|
30843
|
+
}
|
|
30844
|
+
}
|
|
30845
|
+
}, _callee44, this);
|
|
30846
|
+
}));
|
|
30847
|
+
|
|
30848
|
+
function removeLiquidityV2(_x217, _x218, _x219, _x220, _x221, _x222, _x223) {
|
|
30750
30849
|
return _removeLiquidityV.apply(this, arguments);
|
|
30751
30850
|
}
|
|
30752
30851
|
|
|
@@ -30772,11 +30871,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30772
30871
|
_proto.tradeLyraOption =
|
|
30773
30872
|
/*#__PURE__*/
|
|
30774
30873
|
function () {
|
|
30775
|
-
var _tradeLyraOption = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30874
|
+
var _tradeLyraOption = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee45(market, expiry, strike, optionType, tradeType, optionAmount, assetIn, collateralChangeAmount, isCoveredCall, options, sdkOptions) {
|
|
30776
30875
|
var swapxData, tx;
|
|
30777
|
-
return runtime_1.wrap(function
|
|
30876
|
+
return runtime_1.wrap(function _callee45$(_context45) {
|
|
30778
30877
|
while (1) {
|
|
30779
|
-
switch (
|
|
30878
|
+
switch (_context45.prev = _context45.next) {
|
|
30780
30879
|
case 0:
|
|
30781
30880
|
if (collateralChangeAmount === void 0) {
|
|
30782
30881
|
collateralChangeAmount = "0";
|
|
@@ -30796,27 +30895,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30796
30895
|
};
|
|
30797
30896
|
}
|
|
30798
30897
|
|
|
30799
|
-
|
|
30898
|
+
_context45.next = 6;
|
|
30800
30899
|
return getLyraOptionTxData(this, market, optionType, expiry, strike, tradeType, optionAmount, assetIn, BigNumber$1.from(collateralChangeAmount), isCoveredCall);
|
|
30801
30900
|
|
|
30802
30901
|
case 6:
|
|
30803
|
-
swapxData =
|
|
30804
|
-
|
|
30902
|
+
swapxData = _context45.sent;
|
|
30903
|
+
_context45.next = 9;
|
|
30805
30904
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.LYRA], swapxData, options], sdkOptions);
|
|
30806
30905
|
|
|
30807
30906
|
case 9:
|
|
30808
|
-
tx =
|
|
30809
|
-
return
|
|
30907
|
+
tx = _context45.sent;
|
|
30908
|
+
return _context45.abrupt("return", tx);
|
|
30810
30909
|
|
|
30811
30910
|
case 11:
|
|
30812
30911
|
case "end":
|
|
30813
|
-
return
|
|
30912
|
+
return _context45.stop();
|
|
30814
30913
|
}
|
|
30815
30914
|
}
|
|
30816
|
-
},
|
|
30915
|
+
}, _callee45, this);
|
|
30817
30916
|
}));
|
|
30818
30917
|
|
|
30819
|
-
function tradeLyraOption(
|
|
30918
|
+
function tradeLyraOption(_x224, _x225, _x226, _x227, _x228, _x229, _x230, _x231, _x232, _x233, _x234) {
|
|
30820
30919
|
return _tradeLyraOption.apply(this, arguments);
|
|
30821
30920
|
}
|
|
30822
30921
|
|
|
@@ -30831,26 +30930,26 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30831
30930
|
_proto.getLyraPositions =
|
|
30832
30931
|
/*#__PURE__*/
|
|
30833
30932
|
function () {
|
|
30834
|
-
var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30835
|
-
return runtime_1.wrap(function
|
|
30933
|
+
var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee46(market) {
|
|
30934
|
+
return runtime_1.wrap(function _callee46$(_context46) {
|
|
30836
30935
|
while (1) {
|
|
30837
|
-
switch (
|
|
30936
|
+
switch (_context46.prev = _context46.next) {
|
|
30838
30937
|
case 0:
|
|
30839
|
-
|
|
30938
|
+
_context46.next = 2;
|
|
30840
30939
|
return getOptionPositions(this, market);
|
|
30841
30940
|
|
|
30842
30941
|
case 2:
|
|
30843
|
-
return
|
|
30942
|
+
return _context46.abrupt("return", _context46.sent);
|
|
30844
30943
|
|
|
30845
30944
|
case 3:
|
|
30846
30945
|
case "end":
|
|
30847
|
-
return
|
|
30946
|
+
return _context46.stop();
|
|
30848
30947
|
}
|
|
30849
30948
|
}
|
|
30850
|
-
},
|
|
30949
|
+
}, _callee46, this);
|
|
30851
30950
|
}));
|
|
30852
30951
|
|
|
30853
|
-
function getLyraPositions(
|
|
30952
|
+
function getLyraPositions(_x235) {
|
|
30854
30953
|
return _getLyraPositions.apply(this, arguments);
|
|
30855
30954
|
}
|
|
30856
30955
|
|
|
@@ -30869,11 +30968,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30869
30968
|
_proto.changeFuturesMargin =
|
|
30870
30969
|
/*#__PURE__*/
|
|
30871
30970
|
function () {
|
|
30872
|
-
var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30971
|
+
var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee47(market, changeAmount, options, sdkOptions) {
|
|
30873
30972
|
var tx;
|
|
30874
|
-
return runtime_1.wrap(function
|
|
30973
|
+
return runtime_1.wrap(function _callee47$(_context47) {
|
|
30875
30974
|
while (1) {
|
|
30876
|
-
switch (
|
|
30975
|
+
switch (_context47.prev = _context47.next) {
|
|
30877
30976
|
case 0:
|
|
30878
30977
|
if (options === void 0) {
|
|
30879
30978
|
options = null;
|
|
@@ -30885,22 +30984,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30885
30984
|
};
|
|
30886
30985
|
}
|
|
30887
30986
|
|
|
30888
|
-
|
|
30987
|
+
_context47.next = 4;
|
|
30889
30988
|
return getPoolTxOrGasEstimate(this, [market, getFuturesChangeMarginTxData(changeAmount), options], sdkOptions);
|
|
30890
30989
|
|
|
30891
30990
|
case 4:
|
|
30892
|
-
tx =
|
|
30893
|
-
return
|
|
30991
|
+
tx = _context47.sent;
|
|
30992
|
+
return _context47.abrupt("return", tx);
|
|
30894
30993
|
|
|
30895
30994
|
case 6:
|
|
30896
30995
|
case "end":
|
|
30897
|
-
return
|
|
30996
|
+
return _context47.stop();
|
|
30898
30997
|
}
|
|
30899
30998
|
}
|
|
30900
|
-
},
|
|
30999
|
+
}, _callee47, this);
|
|
30901
31000
|
}));
|
|
30902
31001
|
|
|
30903
|
-
function changeFuturesMargin(
|
|
31002
|
+
function changeFuturesMargin(_x236, _x237, _x238, _x239) {
|
|
30904
31003
|
return _changeFuturesMargin.apply(this, arguments);
|
|
30905
31004
|
}
|
|
30906
31005
|
|
|
@@ -30919,11 +31018,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30919
31018
|
_proto.changeFuturesPosition =
|
|
30920
31019
|
/*#__PURE__*/
|
|
30921
31020
|
function () {
|
|
30922
|
-
var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31021
|
+
var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee48(market, changeAmount, options, sdkOptions) {
|
|
30923
31022
|
var txData, tx;
|
|
30924
|
-
return runtime_1.wrap(function
|
|
31023
|
+
return runtime_1.wrap(function _callee48$(_context48) {
|
|
30925
31024
|
while (1) {
|
|
30926
|
-
switch (
|
|
31025
|
+
switch (_context48.prev = _context48.next) {
|
|
30927
31026
|
case 0:
|
|
30928
31027
|
if (options === void 0) {
|
|
30929
31028
|
options = null;
|
|
@@ -30935,27 +31034,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30935
31034
|
};
|
|
30936
31035
|
}
|
|
30937
31036
|
|
|
30938
|
-
|
|
31037
|
+
_context48.next = 4;
|
|
30939
31038
|
return getFuturesChangePositionTxData(changeAmount, market, this);
|
|
30940
31039
|
|
|
30941
31040
|
case 4:
|
|
30942
|
-
txData =
|
|
30943
|
-
|
|
31041
|
+
txData = _context48.sent;
|
|
31042
|
+
_context48.next = 7;
|
|
30944
31043
|
return getPoolTxOrGasEstimate(this, [market, txData, options], sdkOptions);
|
|
30945
31044
|
|
|
30946
31045
|
case 7:
|
|
30947
|
-
tx =
|
|
30948
|
-
return
|
|
31046
|
+
tx = _context48.sent;
|
|
31047
|
+
return _context48.abrupt("return", tx);
|
|
30949
31048
|
|
|
30950
31049
|
case 9:
|
|
30951
31050
|
case "end":
|
|
30952
|
-
return
|
|
31051
|
+
return _context48.stop();
|
|
30953
31052
|
}
|
|
30954
31053
|
}
|
|
30955
|
-
},
|
|
31054
|
+
}, _callee48, this);
|
|
30956
31055
|
}));
|
|
30957
31056
|
|
|
30958
|
-
function changeFuturesPosition(
|
|
31057
|
+
function changeFuturesPosition(_x240, _x241, _x242, _x243) {
|
|
30959
31058
|
return _changeFuturesPosition.apply(this, arguments);
|
|
30960
31059
|
}
|
|
30961
31060
|
|
|
@@ -30973,11 +31072,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30973
31072
|
_proto.cancelFuturesOrder =
|
|
30974
31073
|
/*#__PURE__*/
|
|
30975
31074
|
function () {
|
|
30976
|
-
var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31075
|
+
var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee49(market, options, sdkOptions) {
|
|
30977
31076
|
var txData, tx;
|
|
30978
|
-
return runtime_1.wrap(function
|
|
31077
|
+
return runtime_1.wrap(function _callee49$(_context49) {
|
|
30979
31078
|
while (1) {
|
|
30980
|
-
switch (
|
|
31079
|
+
switch (_context49.prev = _context49.next) {
|
|
30981
31080
|
case 0:
|
|
30982
31081
|
if (options === void 0) {
|
|
30983
31082
|
options = null;
|
|
@@ -30989,27 +31088,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30989
31088
|
};
|
|
30990
31089
|
}
|
|
30991
31090
|
|
|
30992
|
-
|
|
31091
|
+
_context49.next = 4;
|
|
30993
31092
|
return getFuturesCancelOrderTxData(this);
|
|
30994
31093
|
|
|
30995
31094
|
case 4:
|
|
30996
|
-
txData =
|
|
30997
|
-
|
|
31095
|
+
txData = _context49.sent;
|
|
31096
|
+
_context49.next = 7;
|
|
30998
31097
|
return getPoolTxOrGasEstimate(this, [market, txData, options], sdkOptions);
|
|
30999
31098
|
|
|
31000
31099
|
case 7:
|
|
31001
|
-
tx =
|
|
31002
|
-
return
|
|
31100
|
+
tx = _context49.sent;
|
|
31101
|
+
return _context49.abrupt("return", tx);
|
|
31003
31102
|
|
|
31004
31103
|
case 9:
|
|
31005
31104
|
case "end":
|
|
31006
|
-
return
|
|
31105
|
+
return _context49.stop();
|
|
31007
31106
|
}
|
|
31008
31107
|
}
|
|
31009
|
-
},
|
|
31108
|
+
}, _callee49, this);
|
|
31010
31109
|
}));
|
|
31011
31110
|
|
|
31012
|
-
function cancelFuturesOrder(
|
|
31111
|
+
function cancelFuturesOrder(_x244, _x245, _x246) {
|
|
31013
31112
|
return _cancelFuturesOrder.apply(this, arguments);
|
|
31014
31113
|
}
|
|
31015
31114
|
|
|
@@ -31026,11 +31125,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31026
31125
|
_proto.mintManagerFee =
|
|
31027
31126
|
/*#__PURE__*/
|
|
31028
31127
|
function () {
|
|
31029
|
-
var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31128
|
+
var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee50(options, estimateGas) {
|
|
31030
31129
|
var tx;
|
|
31031
|
-
return runtime_1.wrap(function
|
|
31130
|
+
return runtime_1.wrap(function _callee50$(_context50) {
|
|
31032
31131
|
while (1) {
|
|
31033
|
-
switch (
|
|
31132
|
+
switch (_context50.prev = _context50.next) {
|
|
31034
31133
|
case 0:
|
|
31035
31134
|
if (options === void 0) {
|
|
31036
31135
|
options = null;
|
|
@@ -31041,33 +31140,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31041
31140
|
}
|
|
31042
31141
|
|
|
31043
31142
|
if (!estimateGas) {
|
|
31044
|
-
|
|
31143
|
+
_context50.next = 6;
|
|
31045
31144
|
break;
|
|
31046
31145
|
}
|
|
31047
31146
|
|
|
31048
|
-
|
|
31147
|
+
_context50.next = 5;
|
|
31049
31148
|
return this.poolLogic.estimateGas.mintManagerFee(options);
|
|
31050
31149
|
|
|
31051
31150
|
case 5:
|
|
31052
|
-
return
|
|
31151
|
+
return _context50.abrupt("return", _context50.sent);
|
|
31053
31152
|
|
|
31054
31153
|
case 6:
|
|
31055
|
-
|
|
31154
|
+
_context50.next = 8;
|
|
31056
31155
|
return this.poolLogic.mintManagerFee(options);
|
|
31057
31156
|
|
|
31058
31157
|
case 8:
|
|
31059
|
-
tx =
|
|
31060
|
-
return
|
|
31158
|
+
tx = _context50.sent;
|
|
31159
|
+
return _context50.abrupt("return", tx);
|
|
31061
31160
|
|
|
31062
31161
|
case 10:
|
|
31063
31162
|
case "end":
|
|
31064
|
-
return
|
|
31163
|
+
return _context50.stop();
|
|
31065
31164
|
}
|
|
31066
31165
|
}
|
|
31067
|
-
},
|
|
31166
|
+
}, _callee50, this);
|
|
31068
31167
|
}));
|
|
31069
31168
|
|
|
31070
|
-
function mintManagerFee(
|
|
31169
|
+
function mintManagerFee(_x247, _x248) {
|
|
31071
31170
|
return _mintManagerFee.apply(this, arguments);
|
|
31072
31171
|
}
|
|
31073
31172
|
|
|
@@ -31082,25 +31181,25 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31082
31181
|
_proto.getAvailableManagerFee =
|
|
31083
31182
|
/*#__PURE__*/
|
|
31084
31183
|
function () {
|
|
31085
|
-
var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31184
|
+
var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee51() {
|
|
31086
31185
|
var fee;
|
|
31087
|
-
return runtime_1.wrap(function
|
|
31186
|
+
return runtime_1.wrap(function _callee51$(_context51) {
|
|
31088
31187
|
while (1) {
|
|
31089
|
-
switch (
|
|
31188
|
+
switch (_context51.prev = _context51.next) {
|
|
31090
31189
|
case 0:
|
|
31091
|
-
|
|
31190
|
+
_context51.next = 2;
|
|
31092
31191
|
return this.poolLogic.availableManagerFee();
|
|
31093
31192
|
|
|
31094
31193
|
case 2:
|
|
31095
|
-
fee =
|
|
31096
|
-
return
|
|
31194
|
+
fee = _context51.sent;
|
|
31195
|
+
return _context51.abrupt("return", BigNumber$1.from(fee));
|
|
31097
31196
|
|
|
31098
31197
|
case 4:
|
|
31099
31198
|
case "end":
|
|
31100
|
-
return
|
|
31199
|
+
return _context51.stop();
|
|
31101
31200
|
}
|
|
31102
31201
|
}
|
|
31103
|
-
},
|
|
31202
|
+
}, _callee51, this);
|
|
31104
31203
|
}));
|
|
31105
31204
|
|
|
31106
31205
|
function getAvailableManagerFee() {
|
|
@@ -31122,11 +31221,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31122
31221
|
_proto.vestTokens =
|
|
31123
31222
|
/*#__PURE__*/
|
|
31124
31223
|
function () {
|
|
31125
|
-
var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31224
|
+
var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee52(tokenAddress, amount, options, sdkOptions) {
|
|
31126
31225
|
var txData, tx;
|
|
31127
|
-
return runtime_1.wrap(function
|
|
31226
|
+
return runtime_1.wrap(function _callee52$(_context52) {
|
|
31128
31227
|
while (1) {
|
|
31129
|
-
switch (
|
|
31228
|
+
switch (_context52.prev = _context52.next) {
|
|
31130
31229
|
case 0:
|
|
31131
31230
|
if (options === void 0) {
|
|
31132
31231
|
options = null;
|
|
@@ -31138,27 +31237,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31138
31237
|
};
|
|
31139
31238
|
}
|
|
31140
31239
|
|
|
31141
|
-
|
|
31240
|
+
_context52.next = 4;
|
|
31142
31241
|
return getCreateVestTxData(amount);
|
|
31143
31242
|
|
|
31144
31243
|
case 4:
|
|
31145
|
-
txData =
|
|
31146
|
-
|
|
31244
|
+
txData = _context52.sent;
|
|
31245
|
+
_context52.next = 7;
|
|
31147
31246
|
return getPoolTxOrGasEstimate(this, [tokenAddress, txData, options], sdkOptions);
|
|
31148
31247
|
|
|
31149
31248
|
case 7:
|
|
31150
|
-
tx =
|
|
31151
|
-
return
|
|
31249
|
+
tx = _context52.sent;
|
|
31250
|
+
return _context52.abrupt("return", tx);
|
|
31152
31251
|
|
|
31153
31252
|
case 9:
|
|
31154
31253
|
case "end":
|
|
31155
|
-
return
|
|
31254
|
+
return _context52.stop();
|
|
31156
31255
|
}
|
|
31157
31256
|
}
|
|
31158
|
-
},
|
|
31257
|
+
}, _callee52, this);
|
|
31159
31258
|
}));
|
|
31160
31259
|
|
|
31161
|
-
function vestTokens(
|
|
31260
|
+
function vestTokens(_x249, _x250, _x251, _x252) {
|
|
31162
31261
|
return _vestTokens.apply(this, arguments);
|
|
31163
31262
|
}
|
|
31164
31263
|
|
|
@@ -31177,11 +31276,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31177
31276
|
_proto.exitVestedToken =
|
|
31178
31277
|
/*#__PURE__*/
|
|
31179
31278
|
function () {
|
|
31180
|
-
var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31279
|
+
var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee53(tokenAddress, id, options, sdkOptions) {
|
|
31181
31280
|
var txData, tx;
|
|
31182
|
-
return runtime_1.wrap(function
|
|
31281
|
+
return runtime_1.wrap(function _callee53$(_context53) {
|
|
31183
31282
|
while (1) {
|
|
31184
|
-
switch (
|
|
31283
|
+
switch (_context53.prev = _context53.next) {
|
|
31185
31284
|
case 0:
|
|
31186
31285
|
if (options === void 0) {
|
|
31187
31286
|
options = null;
|
|
@@ -31193,27 +31292,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31193
31292
|
};
|
|
31194
31293
|
}
|
|
31195
31294
|
|
|
31196
|
-
|
|
31295
|
+
_context53.next = 4;
|
|
31197
31296
|
return getExitVestTxData(id);
|
|
31198
31297
|
|
|
31199
31298
|
case 4:
|
|
31200
|
-
txData =
|
|
31201
|
-
|
|
31299
|
+
txData = _context53.sent;
|
|
31300
|
+
_context53.next = 7;
|
|
31202
31301
|
return getPoolTxOrGasEstimate(this, [tokenAddress, txData, options], sdkOptions);
|
|
31203
31302
|
|
|
31204
31303
|
case 7:
|
|
31205
|
-
tx =
|
|
31206
|
-
return
|
|
31304
|
+
tx = _context53.sent;
|
|
31305
|
+
return _context53.abrupt("return", tx);
|
|
31207
31306
|
|
|
31208
31307
|
case 9:
|
|
31209
31308
|
case "end":
|
|
31210
|
-
return
|
|
31309
|
+
return _context53.stop();
|
|
31211
31310
|
}
|
|
31212
31311
|
}
|
|
31213
|
-
},
|
|
31312
|
+
}, _callee53, this);
|
|
31214
31313
|
}));
|
|
31215
31314
|
|
|
31216
|
-
function exitVestedToken(
|
|
31315
|
+
function exitVestedToken(_x253, _x254, _x255, _x256) {
|
|
31217
31316
|
return _exitVestedToken.apply(this, arguments);
|
|
31218
31317
|
}
|
|
31219
31318
|
|
|
@@ -31233,11 +31332,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31233
31332
|
_proto.mintUnitViaFlatMoney =
|
|
31234
31333
|
/*#__PURE__*/
|
|
31235
31334
|
function () {
|
|
31236
|
-
var _mintUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31335
|
+
var _mintUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee54(depositAmount, slippage, maxKeeperFeeInUsd, options, sdkOptions) {
|
|
31237
31336
|
var tx;
|
|
31238
|
-
return runtime_1.wrap(function
|
|
31337
|
+
return runtime_1.wrap(function _callee54$(_context54) {
|
|
31239
31338
|
while (1) {
|
|
31240
|
-
switch (
|
|
31339
|
+
switch (_context54.prev = _context54.next) {
|
|
31241
31340
|
case 0:
|
|
31242
31341
|
if (slippage === void 0) {
|
|
31243
31342
|
slippage = 0.5;
|
|
@@ -31253,22 +31352,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31253
31352
|
};
|
|
31254
31353
|
}
|
|
31255
31354
|
|
|
31256
|
-
|
|
31355
|
+
_context54.next = 5;
|
|
31257
31356
|
return mintUnitViaFlatMoney(this, depositAmount, slippage, maxKeeperFeeInUsd, options, sdkOptions);
|
|
31258
31357
|
|
|
31259
31358
|
case 5:
|
|
31260
|
-
tx =
|
|
31261
|
-
return
|
|
31359
|
+
tx = _context54.sent;
|
|
31360
|
+
return _context54.abrupt("return", tx);
|
|
31262
31361
|
|
|
31263
31362
|
case 7:
|
|
31264
31363
|
case "end":
|
|
31265
|
-
return
|
|
31364
|
+
return _context54.stop();
|
|
31266
31365
|
}
|
|
31267
31366
|
}
|
|
31268
|
-
},
|
|
31367
|
+
}, _callee54, this);
|
|
31269
31368
|
}));
|
|
31270
31369
|
|
|
31271
|
-
function mintUnitViaFlatMoney$1(
|
|
31370
|
+
function mintUnitViaFlatMoney$1(_x257, _x258, _x259, _x260, _x261) {
|
|
31272
31371
|
return _mintUnitViaFlatMoney2.apply(this, arguments);
|
|
31273
31372
|
}
|
|
31274
31373
|
|
|
@@ -31288,11 +31387,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31288
31387
|
_proto.redeemUnitViaFlatMoney =
|
|
31289
31388
|
/*#__PURE__*/
|
|
31290
31389
|
function () {
|
|
31291
|
-
var _redeemUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31390
|
+
var _redeemUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee55(withdrawAmount, slippage, maxKeeperFeeInUsd, options, sdkOptions) {
|
|
31292
31391
|
var tx;
|
|
31293
|
-
return runtime_1.wrap(function
|
|
31392
|
+
return runtime_1.wrap(function _callee55$(_context55) {
|
|
31294
31393
|
while (1) {
|
|
31295
|
-
switch (
|
|
31394
|
+
switch (_context55.prev = _context55.next) {
|
|
31296
31395
|
case 0:
|
|
31297
31396
|
if (slippage === void 0) {
|
|
31298
31397
|
slippage = 0.5;
|
|
@@ -31308,22 +31407,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31308
31407
|
};
|
|
31309
31408
|
}
|
|
31310
31409
|
|
|
31311
|
-
|
|
31410
|
+
_context55.next = 5;
|
|
31312
31411
|
return redeemUnitViaFlatMoney(this, withdrawAmount, slippage, maxKeeperFeeInUsd, options, sdkOptions);
|
|
31313
31412
|
|
|
31314
31413
|
case 5:
|
|
31315
|
-
tx =
|
|
31316
|
-
return
|
|
31414
|
+
tx = _context55.sent;
|
|
31415
|
+
return _context55.abrupt("return", tx);
|
|
31317
31416
|
|
|
31318
31417
|
case 7:
|
|
31319
31418
|
case "end":
|
|
31320
|
-
return
|
|
31419
|
+
return _context55.stop();
|
|
31321
31420
|
}
|
|
31322
31421
|
}
|
|
31323
|
-
},
|
|
31422
|
+
}, _callee55, this);
|
|
31324
31423
|
}));
|
|
31325
31424
|
|
|
31326
|
-
function redeemUnitViaFlatMoney$1(
|
|
31425
|
+
function redeemUnitViaFlatMoney$1(_x262, _x263, _x264, _x265, _x266) {
|
|
31327
31426
|
return _redeemUnitViaFlatMoney2.apply(this, arguments);
|
|
31328
31427
|
}
|
|
31329
31428
|
|
|
@@ -31331,11 +31430,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31331
31430
|
}();
|
|
31332
31431
|
|
|
31333
31432
|
_proto.cancelOrderViaFlatMoney = /*#__PURE__*/function () {
|
|
31334
|
-
var _cancelOrderViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31433
|
+
var _cancelOrderViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee56(options, estimateGas) {
|
|
31335
31434
|
var tx;
|
|
31336
|
-
return runtime_1.wrap(function
|
|
31435
|
+
return runtime_1.wrap(function _callee56$(_context56) {
|
|
31337
31436
|
while (1) {
|
|
31338
|
-
switch (
|
|
31437
|
+
switch (_context56.prev = _context56.next) {
|
|
31339
31438
|
case 0:
|
|
31340
31439
|
if (options === void 0) {
|
|
31341
31440
|
options = null;
|
|
@@ -31345,22 +31444,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31345
31444
|
estimateGas = false;
|
|
31346
31445
|
}
|
|
31347
31446
|
|
|
31348
|
-
|
|
31447
|
+
_context56.next = 4;
|
|
31349
31448
|
return cancelOrderViaFlatMoney(this, options, estimateGas);
|
|
31350
31449
|
|
|
31351
31450
|
case 4:
|
|
31352
|
-
tx =
|
|
31353
|
-
return
|
|
31451
|
+
tx = _context56.sent;
|
|
31452
|
+
return _context56.abrupt("return", tx);
|
|
31354
31453
|
|
|
31355
31454
|
case 6:
|
|
31356
31455
|
case "end":
|
|
31357
|
-
return
|
|
31456
|
+
return _context56.stop();
|
|
31358
31457
|
}
|
|
31359
31458
|
}
|
|
31360
|
-
},
|
|
31459
|
+
}, _callee56, this);
|
|
31361
31460
|
}));
|
|
31362
31461
|
|
|
31363
|
-
function cancelOrderViaFlatMoney$1(
|
|
31462
|
+
function cancelOrderViaFlatMoney$1(_x267, _x268) {
|
|
31364
31463
|
return _cancelOrderViaFlatMoney2.apply(this, arguments);
|
|
31365
31464
|
}
|
|
31366
31465
|
|
|
@@ -31379,11 +31478,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31379
31478
|
_proto.completeTorosWithdrawal =
|
|
31380
31479
|
/*#__PURE__*/
|
|
31381
31480
|
function () {
|
|
31382
|
-
var _completeTorosWithdrawal = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31481
|
+
var _completeTorosWithdrawal = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee57(destinationToken, slippage, options, sdkOptions) {
|
|
31383
31482
|
var txData, tx;
|
|
31384
|
-
return runtime_1.wrap(function
|
|
31483
|
+
return runtime_1.wrap(function _callee57$(_context57) {
|
|
31385
31484
|
while (1) {
|
|
31386
|
-
switch (
|
|
31485
|
+
switch (_context57.prev = _context57.next) {
|
|
31387
31486
|
case 0:
|
|
31388
31487
|
if (slippage === void 0) {
|
|
31389
31488
|
slippage = 0.5;
|
|
@@ -31399,27 +31498,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31399
31498
|
};
|
|
31400
31499
|
}
|
|
31401
31500
|
|
|
31402
|
-
|
|
31501
|
+
_context57.next = 5;
|
|
31403
31502
|
return getCompleteWithdrawalTxData(this, destinationToken, slippage * 100, false);
|
|
31404
31503
|
|
|
31405
31504
|
case 5:
|
|
31406
|
-
txData =
|
|
31407
|
-
|
|
31505
|
+
txData = _context57.sent;
|
|
31506
|
+
_context57.next = 8;
|
|
31408
31507
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network].toros, txData, options], sdkOptions);
|
|
31409
31508
|
|
|
31410
31509
|
case 8:
|
|
31411
|
-
tx =
|
|
31412
|
-
return
|
|
31510
|
+
tx = _context57.sent;
|
|
31511
|
+
return _context57.abrupt("return", tx);
|
|
31413
31512
|
|
|
31414
31513
|
case 10:
|
|
31415
31514
|
case "end":
|
|
31416
|
-
return
|
|
31515
|
+
return _context57.stop();
|
|
31417
31516
|
}
|
|
31418
31517
|
}
|
|
31419
|
-
},
|
|
31518
|
+
}, _callee57, this);
|
|
31420
31519
|
}));
|
|
31421
31520
|
|
|
31422
|
-
function completeTorosWithdrawal(
|
|
31521
|
+
function completeTorosWithdrawal(_x269, _x270, _x271, _x272) {
|
|
31423
31522
|
return _completeTorosWithdrawal.apply(this, arguments);
|
|
31424
31523
|
}
|
|
31425
31524
|
|