@dhedge/v2-sdk 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/pool.d.ts +20 -1
- package/dist/services/pendle/index.d.ts +4 -0
- package/dist/v2-sdk.cjs.development.js +614 -394
- 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 +614 -394
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/PoolManagerLogic.json +27 -1
- package/src/abi/pendle/PT.json +13 -0
- package/src/entities/pool.ts +67 -2
- package/src/services/pendle/index.ts +33 -0
- package/src/test/pendleMint.test.ts +59 -0
- 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 = {
|
|
@@ -27013,6 +27041,20 @@ var PTAbi = [
|
|
|
27013
27041
|
],
|
|
27014
27042
|
stateMutability: "view",
|
|
27015
27043
|
type: "function"
|
|
27044
|
+
},
|
|
27045
|
+
{
|
|
27046
|
+
inputs: [
|
|
27047
|
+
],
|
|
27048
|
+
name: "YT",
|
|
27049
|
+
outputs: [
|
|
27050
|
+
{
|
|
27051
|
+
internalType: "address",
|
|
27052
|
+
name: "",
|
|
27053
|
+
type: "address"
|
|
27054
|
+
}
|
|
27055
|
+
],
|
|
27056
|
+
stateMutability: "view",
|
|
27057
|
+
type: "function"
|
|
27016
27058
|
}
|
|
27017
27059
|
];
|
|
27018
27060
|
|
|
@@ -27108,43 +27150,98 @@ function _getPendleSwapTxData() {
|
|
|
27108
27150
|
return _getPendleSwapTxData.apply(this, arguments);
|
|
27109
27151
|
}
|
|
27110
27152
|
|
|
27153
|
+
function getPendleMintTxData(_x6, _x7, _x8, _x9, _x10) {
|
|
27154
|
+
return _getPendleMintTxData.apply(this, arguments);
|
|
27155
|
+
}
|
|
27156
|
+
|
|
27157
|
+
function _getPendleMintTxData() {
|
|
27158
|
+
_getPendleMintTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(pool, tokenIn, pt, amountIn, slippage) {
|
|
27159
|
+
var PTcontract, ytAddress, params, swapResult;
|
|
27160
|
+
return runtime_1.wrap(function _callee4$(_context4) {
|
|
27161
|
+
while (1) {
|
|
27162
|
+
switch (_context4.prev = _context4.next) {
|
|
27163
|
+
case 0:
|
|
27164
|
+
PTcontract = new ethers.Contract(pt, PTAbi, pool.signer);
|
|
27165
|
+
_context4.next = 3;
|
|
27166
|
+
return PTcontract.YT();
|
|
27167
|
+
|
|
27168
|
+
case 3:
|
|
27169
|
+
ytAddress = _context4.sent;
|
|
27170
|
+
params = {
|
|
27171
|
+
receiver: pool.address,
|
|
27172
|
+
tokensIn: tokenIn,
|
|
27173
|
+
tokensOut: pt + "," + ytAddress,
|
|
27174
|
+
amountsIn: amountIn.toString(),
|
|
27175
|
+
slippage: slippage / 100
|
|
27176
|
+
};
|
|
27177
|
+
_context4.prev = 5;
|
|
27178
|
+
_context4.next = 8;
|
|
27179
|
+
return axios.get(pendleBaseUrl + "/v2/sdk/" + networkChainIdMap[pool.network] + "/convert", {
|
|
27180
|
+
params: params
|
|
27181
|
+
});
|
|
27182
|
+
|
|
27183
|
+
case 8:
|
|
27184
|
+
swapResult = _context4.sent;
|
|
27185
|
+
return _context4.abrupt("return", {
|
|
27186
|
+
swapTxData: swapResult.data.routes[0].tx.data,
|
|
27187
|
+
minAmountOut: swapResult.data.routes[0].outputs.filter(function (e) {
|
|
27188
|
+
return e.token === pt.toLowerCase();
|
|
27189
|
+
})[0].amount
|
|
27190
|
+
});
|
|
27191
|
+
|
|
27192
|
+
case 12:
|
|
27193
|
+
_context4.prev = 12;
|
|
27194
|
+
_context4.t0 = _context4["catch"](5);
|
|
27195
|
+
console.error("Error in Pendle API request:", _context4.t0);
|
|
27196
|
+
throw new ApiError("Pendle api request failed");
|
|
27197
|
+
|
|
27198
|
+
case 16:
|
|
27199
|
+
case "end":
|
|
27200
|
+
return _context4.stop();
|
|
27201
|
+
}
|
|
27202
|
+
}
|
|
27203
|
+
}, _callee4, null, [[5, 12]]);
|
|
27204
|
+
}));
|
|
27205
|
+
return _getPendleMintTxData.apply(this, arguments);
|
|
27206
|
+
}
|
|
27207
|
+
|
|
27111
27208
|
var checkUnderlying = function checkUnderlying(market, token, networkId) {
|
|
27112
27209
|
if (market.underlyingAsset !== networkId + "-" + token.toLocaleLowerCase()) {
|
|
27113
27210
|
throw new Error("Can only trade in or out of the underlying asset");
|
|
27114
27211
|
}
|
|
27115
27212
|
};
|
|
27116
27213
|
|
|
27117
|
-
function getMarket(
|
|
27214
|
+
function getMarket(_x11, _x12, _x13) {
|
|
27118
27215
|
return _getMarket.apply(this, arguments);
|
|
27119
27216
|
}
|
|
27120
27217
|
|
|
27121
27218
|
function _getMarket() {
|
|
27122
|
-
_getMarket = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
27219
|
+
_getMarket = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(pool, tokenIn, tokenOut) {
|
|
27123
27220
|
var networkId, marketResult, params, allMarkets, markets;
|
|
27124
|
-
return runtime_1.wrap(function
|
|
27221
|
+
return runtime_1.wrap(function _callee5$(_context5) {
|
|
27125
27222
|
while (1) {
|
|
27126
|
-
switch (
|
|
27223
|
+
switch (_context5.prev = _context5.next) {
|
|
27127
27224
|
case 0:
|
|
27128
27225
|
networkId = networkChainIdMap[pool.network];
|
|
27129
|
-
|
|
27226
|
+
_context5.prev = 1;
|
|
27130
27227
|
params = {
|
|
27131
27228
|
isActive: true,
|
|
27132
27229
|
chainId: networkId
|
|
27133
27230
|
};
|
|
27134
|
-
|
|
27231
|
+
_context5.next = 5;
|
|
27135
27232
|
return axios.get(pendleBaseUrl + "/v1/markets/all", {
|
|
27136
27233
|
params: params
|
|
27137
27234
|
});
|
|
27138
27235
|
|
|
27139
27236
|
case 5:
|
|
27140
|
-
marketResult =
|
|
27141
|
-
|
|
27237
|
+
marketResult = _context5.sent;
|
|
27238
|
+
_context5.next = 12;
|
|
27142
27239
|
break;
|
|
27143
27240
|
|
|
27144
27241
|
case 8:
|
|
27145
|
-
|
|
27146
|
-
|
|
27147
|
-
console.error("Error in Pendle API request:",
|
|
27242
|
+
_context5.prev = 8;
|
|
27243
|
+
_context5.t0 = _context5["catch"](1);
|
|
27244
|
+
console.error("Error in Pendle API request:", _context5.t0);
|
|
27148
27245
|
throw new ApiError("Pendle api request failed");
|
|
27149
27246
|
|
|
27150
27247
|
case 12:
|
|
@@ -27156,31 +27253,31 @@ function _getMarket() {
|
|
|
27156
27253
|
});
|
|
27157
27254
|
|
|
27158
27255
|
if (!markets[0]) {
|
|
27159
|
-
|
|
27256
|
+
_context5.next = 19;
|
|
27160
27257
|
break;
|
|
27161
27258
|
}
|
|
27162
27259
|
|
|
27163
27260
|
checkUnderlying(markets[0], tokenOut, networkId);
|
|
27164
|
-
return
|
|
27261
|
+
return _context5.abrupt("return", markets[0].address);
|
|
27165
27262
|
|
|
27166
27263
|
case 19:
|
|
27167
27264
|
if (!markets[1]) {
|
|
27168
|
-
|
|
27265
|
+
_context5.next = 24;
|
|
27169
27266
|
break;
|
|
27170
27267
|
}
|
|
27171
27268
|
|
|
27172
27269
|
checkUnderlying(markets[1], tokenIn, networkId);
|
|
27173
|
-
return
|
|
27270
|
+
return _context5.abrupt("return", markets[1].address);
|
|
27174
27271
|
|
|
27175
27272
|
case 24:
|
|
27176
27273
|
throw new Error("Can only trade PT assets");
|
|
27177
27274
|
|
|
27178
27275
|
case 25:
|
|
27179
27276
|
case "end":
|
|
27180
|
-
return
|
|
27277
|
+
return _context5.stop();
|
|
27181
27278
|
}
|
|
27182
27279
|
}
|
|
27183
|
-
},
|
|
27280
|
+
}, _callee5, null, [[1, 8]]);
|
|
27184
27281
|
}));
|
|
27185
27282
|
return _getMarket.apply(this, arguments);
|
|
27186
27283
|
}
|
|
@@ -27249,7 +27346,7 @@ var checkExitPostExpPT = /*#__PURE__*/function () {
|
|
|
27249
27346
|
}, _callee, null, [[1, 8]]);
|
|
27250
27347
|
}));
|
|
27251
27348
|
|
|
27252
|
-
return function checkExitPostExpPT(
|
|
27349
|
+
return function checkExitPostExpPT(_x14, _x15, _x16) {
|
|
27253
27350
|
return _ref.apply(this, arguments);
|
|
27254
27351
|
};
|
|
27255
27352
|
}();
|
|
@@ -27296,7 +27393,7 @@ var getExitExpPTTxData = /*#__PURE__*/function () {
|
|
|
27296
27393
|
}, _callee2);
|
|
27297
27394
|
}));
|
|
27298
27395
|
|
|
27299
|
-
return function getExitExpPTTxData(
|
|
27396
|
+
return function getExitExpPTTxData(_x17, _x18, _x19, _x20, _x21) {
|
|
27300
27397
|
return _ref2.apply(this, arguments);
|
|
27301
27398
|
};
|
|
27302
27399
|
}();
|
|
@@ -29600,6 +29697,65 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29600
29697
|
|
|
29601
29698
|
return setPrivate;
|
|
29602
29699
|
}()
|
|
29700
|
+
/**
|
|
29701
|
+
* Sets max supply cap for a pool
|
|
29702
|
+
* @param {BigNumberish} _maxSupplyCapD18 Max supply cap with 18 decimals
|
|
29703
|
+
* @param {any} options Transaction options
|
|
29704
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
29705
|
+
* @returns {Promise<any>} Transaction
|
|
29706
|
+
*/
|
|
29707
|
+
;
|
|
29708
|
+
|
|
29709
|
+
_proto.setMaxCap =
|
|
29710
|
+
/*#__PURE__*/
|
|
29711
|
+
function () {
|
|
29712
|
+
var _setMaxCap = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee27(_maxSupplyCapD18, options, estimateGas) {
|
|
29713
|
+
var tx;
|
|
29714
|
+
return runtime_1.wrap(function _callee27$(_context27) {
|
|
29715
|
+
while (1) {
|
|
29716
|
+
switch (_context27.prev = _context27.next) {
|
|
29717
|
+
case 0:
|
|
29718
|
+
if (options === void 0) {
|
|
29719
|
+
options = null;
|
|
29720
|
+
}
|
|
29721
|
+
|
|
29722
|
+
if (estimateGas === void 0) {
|
|
29723
|
+
estimateGas = false;
|
|
29724
|
+
}
|
|
29725
|
+
|
|
29726
|
+
if (!estimateGas) {
|
|
29727
|
+
_context27.next = 6;
|
|
29728
|
+
break;
|
|
29729
|
+
}
|
|
29730
|
+
|
|
29731
|
+
_context27.next = 5;
|
|
29732
|
+
return this.managerLogic.estimateGas.setMaxSupplyCap(_maxSupplyCapD18, options);
|
|
29733
|
+
|
|
29734
|
+
case 5:
|
|
29735
|
+
return _context27.abrupt("return", _context27.sent);
|
|
29736
|
+
|
|
29737
|
+
case 6:
|
|
29738
|
+
_context27.next = 8;
|
|
29739
|
+
return this.managerLogic.setMaxSupplyCap(_maxSupplyCapD18, options);
|
|
29740
|
+
|
|
29741
|
+
case 8:
|
|
29742
|
+
tx = _context27.sent;
|
|
29743
|
+
return _context27.abrupt("return", tx);
|
|
29744
|
+
|
|
29745
|
+
case 10:
|
|
29746
|
+
case "end":
|
|
29747
|
+
return _context27.stop();
|
|
29748
|
+
}
|
|
29749
|
+
}
|
|
29750
|
+
}, _callee27, this);
|
|
29751
|
+
}));
|
|
29752
|
+
|
|
29753
|
+
function setMaxCap(_x120, _x121, _x122) {
|
|
29754
|
+
return _setMaxCap.apply(this, arguments);
|
|
29755
|
+
}
|
|
29756
|
+
|
|
29757
|
+
return setMaxCap;
|
|
29758
|
+
}()
|
|
29603
29759
|
/**
|
|
29604
29760
|
* Invest into a Balancer pool
|
|
29605
29761
|
* @param {string} poolId Balancer pool id
|
|
@@ -29614,11 +29770,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29614
29770
|
_proto.joinBalancerPool =
|
|
29615
29771
|
/*#__PURE__*/
|
|
29616
29772
|
function () {
|
|
29617
|
-
var _joinBalancerPool = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29773
|
+
var _joinBalancerPool = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee28(poolId, assets, amountsIn, options, sdkOptions) {
|
|
29618
29774
|
var joinPoolTxData, tx;
|
|
29619
|
-
return runtime_1.wrap(function
|
|
29775
|
+
return runtime_1.wrap(function _callee28$(_context28) {
|
|
29620
29776
|
while (1) {
|
|
29621
|
-
switch (
|
|
29777
|
+
switch (_context28.prev = _context28.next) {
|
|
29622
29778
|
case 0:
|
|
29623
29779
|
if (options === void 0) {
|
|
29624
29780
|
options = null;
|
|
@@ -29631,22 +29787,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29631
29787
|
}
|
|
29632
29788
|
|
|
29633
29789
|
joinPoolTxData = this.utils.getBalancerJoinPoolTx(this, poolId, assets, amountsIn);
|
|
29634
|
-
|
|
29790
|
+
_context28.next = 5;
|
|
29635
29791
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.BALANCER], joinPoolTxData, options], sdkOptions);
|
|
29636
29792
|
|
|
29637
29793
|
case 5:
|
|
29638
|
-
tx =
|
|
29639
|
-
return
|
|
29794
|
+
tx = _context28.sent;
|
|
29795
|
+
return _context28.abrupt("return", tx);
|
|
29640
29796
|
|
|
29641
29797
|
case 7:
|
|
29642
29798
|
case "end":
|
|
29643
|
-
return
|
|
29799
|
+
return _context28.stop();
|
|
29644
29800
|
}
|
|
29645
29801
|
}
|
|
29646
|
-
},
|
|
29802
|
+
}, _callee28, this);
|
|
29647
29803
|
}));
|
|
29648
29804
|
|
|
29649
|
-
function joinBalancerPool(
|
|
29805
|
+
function joinBalancerPool(_x123, _x124, _x125, _x126, _x127) {
|
|
29650
29806
|
return _joinBalancerPool.apply(this, arguments);
|
|
29651
29807
|
}
|
|
29652
29808
|
|
|
@@ -29667,11 +29823,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29667
29823
|
_proto.exitBalancerPool =
|
|
29668
29824
|
/*#__PURE__*/
|
|
29669
29825
|
function () {
|
|
29670
|
-
var _exitBalancerPool = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29826
|
+
var _exitBalancerPool = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee29(poolId, assets, amount, singleExitAssetIndex, options, sdkOptions) {
|
|
29671
29827
|
var exitPoolTxData, tx;
|
|
29672
|
-
return runtime_1.wrap(function
|
|
29828
|
+
return runtime_1.wrap(function _callee29$(_context29) {
|
|
29673
29829
|
while (1) {
|
|
29674
|
-
switch (
|
|
29830
|
+
switch (_context29.prev = _context29.next) {
|
|
29675
29831
|
case 0:
|
|
29676
29832
|
if (singleExitAssetIndex === void 0) {
|
|
29677
29833
|
singleExitAssetIndex = null;
|
|
@@ -29688,22 +29844,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29688
29844
|
}
|
|
29689
29845
|
|
|
29690
29846
|
exitPoolTxData = this.utils.getBalancerExitPoolTx(this, poolId, assets, singleExitAssetIndex, amount);
|
|
29691
|
-
|
|
29847
|
+
_context29.next = 6;
|
|
29692
29848
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.BALANCER], exitPoolTxData, options], sdkOptions);
|
|
29693
29849
|
|
|
29694
29850
|
case 6:
|
|
29695
|
-
tx =
|
|
29696
|
-
return
|
|
29851
|
+
tx = _context29.sent;
|
|
29852
|
+
return _context29.abrupt("return", tx);
|
|
29697
29853
|
|
|
29698
29854
|
case 8:
|
|
29699
29855
|
case "end":
|
|
29700
|
-
return
|
|
29856
|
+
return _context29.stop();
|
|
29701
29857
|
}
|
|
29702
29858
|
}
|
|
29703
|
-
},
|
|
29859
|
+
}, _callee29, this);
|
|
29704
29860
|
}));
|
|
29705
29861
|
|
|
29706
|
-
function exitBalancerPool(
|
|
29862
|
+
function exitBalancerPool(_x128, _x129, _x130, _x131, _x132, _x133) {
|
|
29707
29863
|
return _exitBalancerPool.apply(this, arguments);
|
|
29708
29864
|
}
|
|
29709
29865
|
|
|
@@ -29721,11 +29877,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29721
29877
|
_proto.harvestAaveRewards =
|
|
29722
29878
|
/*#__PURE__*/
|
|
29723
29879
|
function () {
|
|
29724
|
-
var _harvestAaveRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29880
|
+
var _harvestAaveRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee30(assets, options, sdkOptions) {
|
|
29725
29881
|
var aaveIncentivesAddress, iAaveIncentivesController, aaveIncentivesController, amount, claimTxData, tx;
|
|
29726
|
-
return runtime_1.wrap(function
|
|
29882
|
+
return runtime_1.wrap(function _callee30$(_context30) {
|
|
29727
29883
|
while (1) {
|
|
29728
|
-
switch (
|
|
29884
|
+
switch (_context30.prev = _context30.next) {
|
|
29729
29885
|
case 0:
|
|
29730
29886
|
if (options === void 0) {
|
|
29731
29887
|
options = null;
|
|
@@ -29740,28 +29896,28 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29740
29896
|
aaveIncentivesAddress = stakingAddress[this.network][Dapp.AAVE];
|
|
29741
29897
|
iAaveIncentivesController = new ethers.utils.Interface(IAaveIncentivesController.abi);
|
|
29742
29898
|
aaveIncentivesController = new ethers.Contract(aaveIncentivesAddress, iAaveIncentivesController, this.signer);
|
|
29743
|
-
|
|
29899
|
+
_context30.next = 7;
|
|
29744
29900
|
return aaveIncentivesController.getUserUnclaimedRewards(this.address);
|
|
29745
29901
|
|
|
29746
29902
|
case 7:
|
|
29747
|
-
amount =
|
|
29903
|
+
amount = _context30.sent;
|
|
29748
29904
|
claimTxData = iAaveIncentivesController.encodeFunctionData(Transaction.CLAIM_REWARDS, [assets, amount, this.address]);
|
|
29749
|
-
|
|
29905
|
+
_context30.next = 11;
|
|
29750
29906
|
return getPoolTxOrGasEstimate(this, [aaveIncentivesAddress, claimTxData, options], sdkOptions);
|
|
29751
29907
|
|
|
29752
29908
|
case 11:
|
|
29753
|
-
tx =
|
|
29754
|
-
return
|
|
29909
|
+
tx = _context30.sent;
|
|
29910
|
+
return _context30.abrupt("return", tx);
|
|
29755
29911
|
|
|
29756
29912
|
case 13:
|
|
29757
29913
|
case "end":
|
|
29758
|
-
return
|
|
29914
|
+
return _context30.stop();
|
|
29759
29915
|
}
|
|
29760
29916
|
}
|
|
29761
|
-
},
|
|
29917
|
+
}, _callee30, this);
|
|
29762
29918
|
}));
|
|
29763
29919
|
|
|
29764
|
-
function harvestAaveRewards(
|
|
29920
|
+
function harvestAaveRewards(_x134, _x135, _x136) {
|
|
29765
29921
|
return _harvestAaveRewards.apply(this, arguments);
|
|
29766
29922
|
}
|
|
29767
29923
|
|
|
@@ -29780,11 +29936,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29780
29936
|
_proto.harvestAaveV3Rewards =
|
|
29781
29937
|
/*#__PURE__*/
|
|
29782
29938
|
function () {
|
|
29783
|
-
var _harvestAaveV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29939
|
+
var _harvestAaveV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee31(assets, rewardAsset, options, sdkOptions) {
|
|
29784
29940
|
var claimTxData, tx;
|
|
29785
|
-
return runtime_1.wrap(function
|
|
29941
|
+
return runtime_1.wrap(function _callee31$(_context31) {
|
|
29786
29942
|
while (1) {
|
|
29787
|
-
switch (
|
|
29943
|
+
switch (_context31.prev = _context31.next) {
|
|
29788
29944
|
case 0:
|
|
29789
29945
|
if (options === void 0) {
|
|
29790
29946
|
options = null;
|
|
@@ -29796,27 +29952,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29796
29952
|
};
|
|
29797
29953
|
}
|
|
29798
29954
|
|
|
29799
|
-
|
|
29955
|
+
_context31.next = 4;
|
|
29800
29956
|
return getAaveV3ClaimTxData(this, assets, rewardAsset);
|
|
29801
29957
|
|
|
29802
29958
|
case 4:
|
|
29803
|
-
claimTxData =
|
|
29804
|
-
|
|
29959
|
+
claimTxData = _context31.sent;
|
|
29960
|
+
_context31.next = 7;
|
|
29805
29961
|
return getPoolTxOrGasEstimate(this, [stakingAddress[this.network][Dapp.AAVEV3], claimTxData, options], sdkOptions);
|
|
29806
29962
|
|
|
29807
29963
|
case 7:
|
|
29808
|
-
tx =
|
|
29809
|
-
return
|
|
29964
|
+
tx = _context31.sent;
|
|
29965
|
+
return _context31.abrupt("return", tx);
|
|
29810
29966
|
|
|
29811
29967
|
case 9:
|
|
29812
29968
|
case "end":
|
|
29813
|
-
return
|
|
29969
|
+
return _context31.stop();
|
|
29814
29970
|
}
|
|
29815
29971
|
}
|
|
29816
|
-
},
|
|
29972
|
+
}, _callee31, this);
|
|
29817
29973
|
}));
|
|
29818
29974
|
|
|
29819
|
-
function harvestAaveV3Rewards(
|
|
29975
|
+
function harvestAaveV3Rewards(_x137, _x138, _x139, _x140) {
|
|
29820
29976
|
return _harvestAaveV3Rewards.apply(this, arguments);
|
|
29821
29977
|
}
|
|
29822
29978
|
|
|
@@ -29834,11 +29990,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29834
29990
|
_proto.harvestCompoundV3Rewards =
|
|
29835
29991
|
/*#__PURE__*/
|
|
29836
29992
|
function () {
|
|
29837
|
-
var _harvestCompoundV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29993
|
+
var _harvestCompoundV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee32(asset, options, sdkOptions) {
|
|
29838
29994
|
var claimTxData, tx;
|
|
29839
|
-
return runtime_1.wrap(function
|
|
29995
|
+
return runtime_1.wrap(function _callee32$(_context32) {
|
|
29840
29996
|
while (1) {
|
|
29841
|
-
switch (
|
|
29997
|
+
switch (_context32.prev = _context32.next) {
|
|
29842
29998
|
case 0:
|
|
29843
29999
|
if (options === void 0) {
|
|
29844
30000
|
options = null;
|
|
@@ -29850,27 +30006,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29850
30006
|
};
|
|
29851
30007
|
}
|
|
29852
30008
|
|
|
29853
|
-
|
|
30009
|
+
_context32.next = 4;
|
|
29854
30010
|
return getCompoundV3ClaimTxData(this, asset);
|
|
29855
30011
|
|
|
29856
30012
|
case 4:
|
|
29857
|
-
claimTxData =
|
|
29858
|
-
|
|
30013
|
+
claimTxData = _context32.sent;
|
|
30014
|
+
_context32.next = 7;
|
|
29859
30015
|
return getPoolTxOrGasEstimate(this, [stakingAddress[this.network][Dapp.COMPOUNDV3], claimTxData, options], sdkOptions);
|
|
29860
30016
|
|
|
29861
30017
|
case 7:
|
|
29862
|
-
tx =
|
|
29863
|
-
return
|
|
30018
|
+
tx = _context32.sent;
|
|
30019
|
+
return _context32.abrupt("return", tx);
|
|
29864
30020
|
|
|
29865
30021
|
case 9:
|
|
29866
30022
|
case "end":
|
|
29867
|
-
return
|
|
30023
|
+
return _context32.stop();
|
|
29868
30024
|
}
|
|
29869
30025
|
}
|
|
29870
|
-
},
|
|
30026
|
+
}, _callee32, this);
|
|
29871
30027
|
}));
|
|
29872
30028
|
|
|
29873
|
-
function harvestCompoundV3Rewards(
|
|
30029
|
+
function harvestCompoundV3Rewards(_x141, _x142, _x143) {
|
|
29874
30030
|
return _harvestCompoundV3Rewards.apply(this, arguments);
|
|
29875
30031
|
}
|
|
29876
30032
|
|
|
@@ -29897,11 +30053,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29897
30053
|
_proto.addLiquidityUniswapV3 =
|
|
29898
30054
|
/*#__PURE__*/
|
|
29899
30055
|
function () {
|
|
29900
|
-
var _addLiquidityUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30056
|
+
var _addLiquidityUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee33(dapp, assetA, assetB, amountA, amountB, minPrice, maxPrice, minTick, maxTick, feeAmountOrTickSpacing, options, sdkOptions) {
|
|
29901
30057
|
var mintTxData, tx;
|
|
29902
|
-
return runtime_1.wrap(function
|
|
30058
|
+
return runtime_1.wrap(function _callee33$(_context33) {
|
|
29903
30059
|
while (1) {
|
|
29904
|
-
switch (
|
|
30060
|
+
switch (_context33.prev = _context33.next) {
|
|
29905
30061
|
case 0:
|
|
29906
30062
|
if (options === void 0) {
|
|
29907
30063
|
options = null;
|
|
@@ -29914,7 +30070,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29914
30070
|
}
|
|
29915
30071
|
|
|
29916
30072
|
if (!((minPrice === null || maxPrice === null) && (minTick === null || maxTick === null))) {
|
|
29917
|
-
|
|
30073
|
+
_context33.next = 4;
|
|
29918
30074
|
break;
|
|
29919
30075
|
}
|
|
29920
30076
|
|
|
@@ -29922,34 +30078,34 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29922
30078
|
|
|
29923
30079
|
case 4:
|
|
29924
30080
|
if (!((minPrice || maxPrice) && dapp !== Dapp.UNISWAPV3)) {
|
|
29925
|
-
|
|
30081
|
+
_context33.next = 6;
|
|
29926
30082
|
break;
|
|
29927
30083
|
}
|
|
29928
30084
|
|
|
29929
30085
|
throw new Error("no price conversion for Aerodrome/Velodrome CL");
|
|
29930
30086
|
|
|
29931
30087
|
case 6:
|
|
29932
|
-
|
|
30088
|
+
_context33.next = 8;
|
|
29933
30089
|
return getUniswapV3MintTxData(dapp, this, assetA, assetB, amountA, amountB, minPrice, maxPrice, minTick, maxTick, feeAmountOrTickSpacing);
|
|
29934
30090
|
|
|
29935
30091
|
case 8:
|
|
29936
|
-
mintTxData =
|
|
29937
|
-
|
|
30092
|
+
mintTxData = _context33.sent;
|
|
30093
|
+
_context33.next = 11;
|
|
29938
30094
|
return getPoolTxOrGasEstimate(this, [nonfungiblePositionManagerAddress[this.network][dapp], mintTxData, options], sdkOptions);
|
|
29939
30095
|
|
|
29940
30096
|
case 11:
|
|
29941
|
-
tx =
|
|
29942
|
-
return
|
|
30097
|
+
tx = _context33.sent;
|
|
30098
|
+
return _context33.abrupt("return", tx);
|
|
29943
30099
|
|
|
29944
30100
|
case 13:
|
|
29945
30101
|
case "end":
|
|
29946
|
-
return
|
|
30102
|
+
return _context33.stop();
|
|
29947
30103
|
}
|
|
29948
30104
|
}
|
|
29949
|
-
},
|
|
30105
|
+
}, _callee33, this);
|
|
29950
30106
|
}));
|
|
29951
30107
|
|
|
29952
|
-
function addLiquidityUniswapV3(
|
|
30108
|
+
function addLiquidityUniswapV3(_x144, _x145, _x146, _x147, _x148, _x149, _x150, _x151, _x152, _x153, _x154, _x155) {
|
|
29953
30109
|
return _addLiquidityUniswapV.apply(this, arguments);
|
|
29954
30110
|
}
|
|
29955
30111
|
|
|
@@ -29969,11 +30125,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29969
30125
|
_proto.decreaseLiquidity =
|
|
29970
30126
|
/*#__PURE__*/
|
|
29971
30127
|
function () {
|
|
29972
|
-
var _decreaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30128
|
+
var _decreaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee34(dapp, tokenId, amount, options, sdkOptions) {
|
|
29973
30129
|
var dappAddress, isStaked, txData, tokenIdOwner, tx;
|
|
29974
|
-
return runtime_1.wrap(function
|
|
30130
|
+
return runtime_1.wrap(function _callee34$(_context34) {
|
|
29975
30131
|
while (1) {
|
|
29976
|
-
switch (
|
|
30132
|
+
switch (_context34.prev = _context34.next) {
|
|
29977
30133
|
case 0:
|
|
29978
30134
|
if (amount === void 0) {
|
|
29979
30135
|
amount = 100;
|
|
@@ -29990,20 +30146,20 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29990
30146
|
}
|
|
29991
30147
|
|
|
29992
30148
|
isStaked = false;
|
|
29993
|
-
|
|
29994
|
-
|
|
30149
|
+
_context34.t0 = dapp;
|
|
30150
|
+
_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;
|
|
29995
30151
|
break;
|
|
29996
30152
|
|
|
29997
30153
|
case 7:
|
|
29998
30154
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
29999
|
-
return
|
|
30155
|
+
return _context34.abrupt("break", 17);
|
|
30000
30156
|
|
|
30001
30157
|
case 9:
|
|
30002
|
-
|
|
30158
|
+
_context34.next = 11;
|
|
30003
30159
|
return getClOwner(this, dapp, tokenId);
|
|
30004
30160
|
|
|
30005
30161
|
case 11:
|
|
30006
|
-
tokenIdOwner =
|
|
30162
|
+
tokenIdOwner = _context34.sent;
|
|
30007
30163
|
|
|
30008
30164
|
if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
|
|
30009
30165
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
@@ -30013,49 +30169,49 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30013
30169
|
isStaked = true;
|
|
30014
30170
|
}
|
|
30015
30171
|
|
|
30016
|
-
return
|
|
30172
|
+
return _context34.abrupt("break", 17);
|
|
30017
30173
|
|
|
30018
30174
|
case 14:
|
|
30019
30175
|
dappAddress = routerAddress[this.network][dapp];
|
|
30020
|
-
return
|
|
30176
|
+
return _context34.abrupt("break", 17);
|
|
30021
30177
|
|
|
30022
30178
|
case 16:
|
|
30023
30179
|
throw new Error("dapp not supported");
|
|
30024
30180
|
|
|
30025
30181
|
case 17:
|
|
30026
30182
|
if (!(!isStaked || dapp === Dapp.PANCAKECL)) {
|
|
30027
|
-
|
|
30183
|
+
_context34.next = 23;
|
|
30028
30184
|
break;
|
|
30029
30185
|
}
|
|
30030
30186
|
|
|
30031
|
-
|
|
30187
|
+
_context34.next = 20;
|
|
30032
30188
|
return getDecreaseLiquidityTxData(this, dapp, tokenId, amount, isStaked);
|
|
30033
30189
|
|
|
30034
30190
|
case 20:
|
|
30035
|
-
txData =
|
|
30036
|
-
|
|
30191
|
+
txData = _context34.sent;
|
|
30192
|
+
_context34.next = 24;
|
|
30037
30193
|
break;
|
|
30038
30194
|
|
|
30039
30195
|
case 23:
|
|
30040
30196
|
throw new Error("unsupported decreaseStakedLiquidity: unstake first to decrease lp");
|
|
30041
30197
|
|
|
30042
30198
|
case 24:
|
|
30043
|
-
|
|
30199
|
+
_context34.next = 26;
|
|
30044
30200
|
return getPoolTxOrGasEstimate(this, [dappAddress, txData, options], sdkOptions);
|
|
30045
30201
|
|
|
30046
30202
|
case 26:
|
|
30047
|
-
tx =
|
|
30048
|
-
return
|
|
30203
|
+
tx = _context34.sent;
|
|
30204
|
+
return _context34.abrupt("return", tx);
|
|
30049
30205
|
|
|
30050
30206
|
case 28:
|
|
30051
30207
|
case "end":
|
|
30052
|
-
return
|
|
30208
|
+
return _context34.stop();
|
|
30053
30209
|
}
|
|
30054
30210
|
}
|
|
30055
|
-
},
|
|
30211
|
+
}, _callee34, this);
|
|
30056
30212
|
}));
|
|
30057
30213
|
|
|
30058
|
-
function decreaseLiquidity(
|
|
30214
|
+
function decreaseLiquidity(_x156, _x157, _x158, _x159, _x160) {
|
|
30059
30215
|
return _decreaseLiquidity.apply(this, arguments);
|
|
30060
30216
|
}
|
|
30061
30217
|
|
|
@@ -30076,11 +30232,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30076
30232
|
_proto.increaseLiquidity =
|
|
30077
30233
|
/*#__PURE__*/
|
|
30078
30234
|
function () {
|
|
30079
|
-
var _increaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30235
|
+
var _increaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee35(dapp, tokenId, amountA, amountB, options, sdkOptions) {
|
|
30080
30236
|
var dappAddress, isStaked, txData, tokenIdOwner, tx;
|
|
30081
|
-
return runtime_1.wrap(function
|
|
30237
|
+
return runtime_1.wrap(function _callee35$(_context35) {
|
|
30082
30238
|
while (1) {
|
|
30083
|
-
switch (
|
|
30239
|
+
switch (_context35.prev = _context35.next) {
|
|
30084
30240
|
case 0:
|
|
30085
30241
|
if (options === void 0) {
|
|
30086
30242
|
options = null;
|
|
@@ -30093,20 +30249,20 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30093
30249
|
}
|
|
30094
30250
|
|
|
30095
30251
|
isStaked = false;
|
|
30096
|
-
|
|
30097
|
-
|
|
30252
|
+
_context35.t0 = dapp;
|
|
30253
|
+
_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;
|
|
30098
30254
|
break;
|
|
30099
30255
|
|
|
30100
30256
|
case 6:
|
|
30101
30257
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
30102
|
-
return
|
|
30258
|
+
return _context35.abrupt("break", 16);
|
|
30103
30259
|
|
|
30104
30260
|
case 8:
|
|
30105
|
-
|
|
30261
|
+
_context35.next = 10;
|
|
30106
30262
|
return getClOwner(this, dapp, tokenId);
|
|
30107
30263
|
|
|
30108
30264
|
case 10:
|
|
30109
|
-
tokenIdOwner =
|
|
30265
|
+
tokenIdOwner = _context35.sent;
|
|
30110
30266
|
|
|
30111
30267
|
if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
|
|
30112
30268
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
@@ -30116,49 +30272,49 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30116
30272
|
isStaked = true;
|
|
30117
30273
|
}
|
|
30118
30274
|
|
|
30119
|
-
return
|
|
30275
|
+
return _context35.abrupt("break", 16);
|
|
30120
30276
|
|
|
30121
30277
|
case 13:
|
|
30122
30278
|
dappAddress = routerAddress[this.network][dapp];
|
|
30123
|
-
return
|
|
30279
|
+
return _context35.abrupt("break", 16);
|
|
30124
30280
|
|
|
30125
30281
|
case 15:
|
|
30126
30282
|
throw new Error("dapp not supported");
|
|
30127
30283
|
|
|
30128
30284
|
case 16:
|
|
30129
30285
|
if (!(!isStaked || dapp === Dapp.PANCAKECL)) {
|
|
30130
|
-
|
|
30286
|
+
_context35.next = 22;
|
|
30131
30287
|
break;
|
|
30132
30288
|
}
|
|
30133
30289
|
|
|
30134
|
-
|
|
30290
|
+
_context35.next = 19;
|
|
30135
30291
|
return getIncreaseLiquidityTxData(this, dapp, tokenId, amountA, amountB);
|
|
30136
30292
|
|
|
30137
30293
|
case 19:
|
|
30138
|
-
txData =
|
|
30139
|
-
|
|
30294
|
+
txData = _context35.sent;
|
|
30295
|
+
_context35.next = 23;
|
|
30140
30296
|
break;
|
|
30141
30297
|
|
|
30142
30298
|
case 22:
|
|
30143
30299
|
throw new Error("unsupported increaseStakedLiquidity: unstake first to increase lp");
|
|
30144
30300
|
|
|
30145
30301
|
case 23:
|
|
30146
|
-
|
|
30302
|
+
_context35.next = 25;
|
|
30147
30303
|
return getPoolTxOrGasEstimate(this, [dappAddress, txData, options], sdkOptions);
|
|
30148
30304
|
|
|
30149
30305
|
case 25:
|
|
30150
|
-
tx =
|
|
30151
|
-
return
|
|
30306
|
+
tx = _context35.sent;
|
|
30307
|
+
return _context35.abrupt("return", tx);
|
|
30152
30308
|
|
|
30153
30309
|
case 27:
|
|
30154
30310
|
case "end":
|
|
30155
|
-
return
|
|
30311
|
+
return _context35.stop();
|
|
30156
30312
|
}
|
|
30157
30313
|
}
|
|
30158
|
-
},
|
|
30314
|
+
}, _callee35, this);
|
|
30159
30315
|
}));
|
|
30160
30316
|
|
|
30161
|
-
function increaseLiquidity(
|
|
30317
|
+
function increaseLiquidity(_x161, _x162, _x163, _x164, _x165, _x166) {
|
|
30162
30318
|
return _increaseLiquidity.apply(this, arguments);
|
|
30163
30319
|
}
|
|
30164
30320
|
|
|
@@ -30177,11 +30333,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30177
30333
|
_proto.claimFees =
|
|
30178
30334
|
/*#__PURE__*/
|
|
30179
30335
|
function () {
|
|
30180
|
-
var _claimFees = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30336
|
+
var _claimFees = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(dapp, tokenId, options, sdkOptions) {
|
|
30181
30337
|
var txData, contractAddress, iNonfungiblePositionManager, abi, tokenIdOwner, tx;
|
|
30182
|
-
return runtime_1.wrap(function
|
|
30338
|
+
return runtime_1.wrap(function _callee36$(_context36) {
|
|
30183
30339
|
while (1) {
|
|
30184
|
-
switch (
|
|
30340
|
+
switch (_context36.prev = _context36.next) {
|
|
30185
30341
|
case 0:
|
|
30186
30342
|
if (options === void 0) {
|
|
30187
30343
|
options = null;
|
|
@@ -30194,37 +30350,37 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30194
30350
|
}
|
|
30195
30351
|
|
|
30196
30352
|
iNonfungiblePositionManager = new ethers.utils.Interface(INonfungiblePositionManager.abi);
|
|
30197
|
-
|
|
30198
|
-
|
|
30353
|
+
_context36.t0 = dapp;
|
|
30354
|
+
_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;
|
|
30199
30355
|
break;
|
|
30200
30356
|
|
|
30201
30357
|
case 6:
|
|
30202
30358
|
contractAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
30203
30359
|
txData = iNonfungiblePositionManager.encodeFunctionData(Transaction.COLLECT, [[tokenId, this.address, MaxUint128, MaxUint128]]);
|
|
30204
|
-
return
|
|
30360
|
+
return _context36.abrupt("break", 25);
|
|
30205
30361
|
|
|
30206
30362
|
case 9:
|
|
30207
30363
|
contractAddress = tokenId;
|
|
30208
30364
|
abi = new ethers.utils.Interface(ILiquidityGaugeV4.abi);
|
|
30209
30365
|
txData = abi.encodeFunctionData("claim_rewards()", []);
|
|
30210
|
-
return
|
|
30366
|
+
return _context36.abrupt("break", 25);
|
|
30211
30367
|
|
|
30212
30368
|
case 13:
|
|
30213
30369
|
contractAddress = tokenId;
|
|
30214
30370
|
txData = getVelodromeClaimTxData(this, tokenId, false);
|
|
30215
|
-
return
|
|
30371
|
+
return _context36.abrupt("break", 25);
|
|
30216
30372
|
|
|
30217
30373
|
case 16:
|
|
30218
30374
|
contractAddress = tokenId;
|
|
30219
30375
|
txData = getVelodromeClaimTxData(this, tokenId, true);
|
|
30220
|
-
return
|
|
30376
|
+
return _context36.abrupt("break", 25);
|
|
30221
30377
|
|
|
30222
30378
|
case 19:
|
|
30223
|
-
|
|
30379
|
+
_context36.next = 21;
|
|
30224
30380
|
return getClOwner(this, dapp, tokenId);
|
|
30225
30381
|
|
|
30226
30382
|
case 21:
|
|
30227
|
-
tokenIdOwner =
|
|
30383
|
+
tokenIdOwner = _context36.sent;
|
|
30228
30384
|
|
|
30229
30385
|
if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
|
|
30230
30386
|
contractAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
@@ -30240,28 +30396,28 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30240
30396
|
}
|
|
30241
30397
|
}
|
|
30242
30398
|
|
|
30243
|
-
return
|
|
30399
|
+
return _context36.abrupt("break", 25);
|
|
30244
30400
|
|
|
30245
30401
|
case 24:
|
|
30246
30402
|
throw new Error("dapp not supported");
|
|
30247
30403
|
|
|
30248
30404
|
case 25:
|
|
30249
|
-
|
|
30405
|
+
_context36.next = 27;
|
|
30250
30406
|
return getPoolTxOrGasEstimate(this, [contractAddress, txData, options], sdkOptions);
|
|
30251
30407
|
|
|
30252
30408
|
case 27:
|
|
30253
|
-
tx =
|
|
30254
|
-
return
|
|
30409
|
+
tx = _context36.sent;
|
|
30410
|
+
return _context36.abrupt("return", tx);
|
|
30255
30411
|
|
|
30256
30412
|
case 29:
|
|
30257
30413
|
case "end":
|
|
30258
|
-
return
|
|
30414
|
+
return _context36.stop();
|
|
30259
30415
|
}
|
|
30260
30416
|
}
|
|
30261
|
-
},
|
|
30417
|
+
}, _callee36, this);
|
|
30262
30418
|
}));
|
|
30263
30419
|
|
|
30264
|
-
function claimFees(
|
|
30420
|
+
function claimFees(_x167, _x168, _x169, _x170) {
|
|
30265
30421
|
return _claimFees.apply(this, arguments);
|
|
30266
30422
|
}
|
|
30267
30423
|
|
|
@@ -30281,11 +30437,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30281
30437
|
_proto.getRewards =
|
|
30282
30438
|
/*#__PURE__*/
|
|
30283
30439
|
function () {
|
|
30284
|
-
var _getRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30440
|
+
var _getRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee37(dapp, tokenId, rewards, options, sdkOptions) {
|
|
30285
30441
|
var tx;
|
|
30286
|
-
return runtime_1.wrap(function
|
|
30442
|
+
return runtime_1.wrap(function _callee37$(_context37) {
|
|
30287
30443
|
while (1) {
|
|
30288
|
-
switch (
|
|
30444
|
+
switch (_context37.prev = _context37.next) {
|
|
30289
30445
|
case 0:
|
|
30290
30446
|
if (options === void 0) {
|
|
30291
30447
|
options = null;
|
|
@@ -30297,22 +30453,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30297
30453
|
};
|
|
30298
30454
|
}
|
|
30299
30455
|
|
|
30300
|
-
|
|
30456
|
+
_context37.next = 4;
|
|
30301
30457
|
return getPoolTxOrGasEstimate(this, [nonfungiblePositionManagerAddress[this.network][dapp], getRewardsTxDta(tokenId, rewards), options], sdkOptions);
|
|
30302
30458
|
|
|
30303
30459
|
case 4:
|
|
30304
|
-
tx =
|
|
30305
|
-
return
|
|
30460
|
+
tx = _context37.sent;
|
|
30461
|
+
return _context37.abrupt("return", tx);
|
|
30306
30462
|
|
|
30307
30463
|
case 6:
|
|
30308
30464
|
case "end":
|
|
30309
|
-
return
|
|
30465
|
+
return _context37.stop();
|
|
30310
30466
|
}
|
|
30311
30467
|
}
|
|
30312
|
-
},
|
|
30468
|
+
}, _callee37, this);
|
|
30313
30469
|
}));
|
|
30314
30470
|
|
|
30315
|
-
function getRewards(
|
|
30471
|
+
function getRewards(_x171, _x172, _x173, _x174, _x175) {
|
|
30316
30472
|
return _getRewards.apply(this, arguments);
|
|
30317
30473
|
}
|
|
30318
30474
|
|
|
@@ -30335,11 +30491,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30335
30491
|
_proto.tradeUniswapV3 =
|
|
30336
30492
|
/*#__PURE__*/
|
|
30337
30493
|
function () {
|
|
30338
|
-
var _tradeUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30494
|
+
var _tradeUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(assetFrom, assetTo, amountIn, feeAmount, slippage, options, sdkOptions) {
|
|
30339
30495
|
var swapxData, tx;
|
|
30340
|
-
return runtime_1.wrap(function
|
|
30496
|
+
return runtime_1.wrap(function _callee38$(_context38) {
|
|
30341
30497
|
while (1) {
|
|
30342
|
-
switch (
|
|
30498
|
+
switch (_context38.prev = _context38.next) {
|
|
30343
30499
|
case 0:
|
|
30344
30500
|
if (slippage === void 0) {
|
|
30345
30501
|
slippage = 0.5;
|
|
@@ -30355,27 +30511,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30355
30511
|
};
|
|
30356
30512
|
}
|
|
30357
30513
|
|
|
30358
|
-
|
|
30514
|
+
_context38.next = 5;
|
|
30359
30515
|
return getUniswapV3SwapTxData(this, assetFrom, assetTo, amountIn, slippage, feeAmount);
|
|
30360
30516
|
|
|
30361
30517
|
case 5:
|
|
30362
|
-
swapxData =
|
|
30363
|
-
|
|
30518
|
+
swapxData = _context38.sent;
|
|
30519
|
+
_context38.next = 8;
|
|
30364
30520
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.UNISWAPV3], swapxData, options], sdkOptions);
|
|
30365
30521
|
|
|
30366
30522
|
case 8:
|
|
30367
|
-
tx =
|
|
30368
|
-
return
|
|
30523
|
+
tx = _context38.sent;
|
|
30524
|
+
return _context38.abrupt("return", tx);
|
|
30369
30525
|
|
|
30370
30526
|
case 10:
|
|
30371
30527
|
case "end":
|
|
30372
|
-
return
|
|
30528
|
+
return _context38.stop();
|
|
30373
30529
|
}
|
|
30374
30530
|
}
|
|
30375
|
-
},
|
|
30531
|
+
}, _callee38, this);
|
|
30376
30532
|
}));
|
|
30377
30533
|
|
|
30378
|
-
function tradeUniswapV3(
|
|
30534
|
+
function tradeUniswapV3(_x176, _x177, _x178, _x179, _x180, _x181, _x182) {
|
|
30379
30535
|
return _tradeUniswapV.apply(this, arguments);
|
|
30380
30536
|
}
|
|
30381
30537
|
|
|
@@ -30397,70 +30553,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30397
30553
|
_proto.addLiquidityVelodrome =
|
|
30398
30554
|
/*#__PURE__*/
|
|
30399
30555
|
function () {
|
|
30400
|
-
var _addLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30401
|
-
var tx;
|
|
30402
|
-
return runtime_1.wrap(function _callee38$(_context38) {
|
|
30403
|
-
while (1) {
|
|
30404
|
-
switch (_context38.prev = _context38.next) {
|
|
30405
|
-
case 0:
|
|
30406
|
-
if (options === void 0) {
|
|
30407
|
-
options = null;
|
|
30408
|
-
}
|
|
30409
|
-
|
|
30410
|
-
if (sdkOptions === void 0) {
|
|
30411
|
-
sdkOptions = {
|
|
30412
|
-
estimateGas: false
|
|
30413
|
-
};
|
|
30414
|
-
}
|
|
30415
|
-
|
|
30416
|
-
_context38.t0 = getPoolTxOrGasEstimate;
|
|
30417
|
-
_context38.t1 = this;
|
|
30418
|
-
_context38.t2 = routerAddress[this.network][Dapp.VELODROME];
|
|
30419
|
-
_context38.next = 7;
|
|
30420
|
-
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
30421
|
-
|
|
30422
|
-
case 7:
|
|
30423
|
-
_context38.t3 = _context38.sent;
|
|
30424
|
-
_context38.t4 = options;
|
|
30425
|
-
_context38.t5 = [_context38.t2, _context38.t3, _context38.t4];
|
|
30426
|
-
_context38.t6 = sdkOptions;
|
|
30427
|
-
_context38.next = 13;
|
|
30428
|
-
return (0, _context38.t0)(_context38.t1, _context38.t5, _context38.t6);
|
|
30429
|
-
|
|
30430
|
-
case 13:
|
|
30431
|
-
tx = _context38.sent;
|
|
30432
|
-
return _context38.abrupt("return", tx);
|
|
30433
|
-
|
|
30434
|
-
case 15:
|
|
30435
|
-
case "end":
|
|
30436
|
-
return _context38.stop();
|
|
30437
|
-
}
|
|
30438
|
-
}
|
|
30439
|
-
}, _callee38, this);
|
|
30440
|
-
}));
|
|
30441
|
-
|
|
30442
|
-
function addLiquidityVelodrome(_x180, _x181, _x182, _x183, _x184, _x185, _x186) {
|
|
30443
|
-
return _addLiquidityVelodrome.apply(this, arguments);
|
|
30444
|
-
}
|
|
30445
|
-
|
|
30446
|
-
return addLiquidityVelodrome;
|
|
30447
|
-
}()
|
|
30448
|
-
/**
|
|
30449
|
-
* Remove liquidity from Velodrome pool
|
|
30450
|
-
* @param {string} assetA First asset
|
|
30451
|
-
* @param {string} assetB Second asset
|
|
30452
|
-
* @param {BigNumber | string} amount Amount of LP tokens
|
|
30453
|
-
* @param { boolean } isStable Is stable pool
|
|
30454
|
-
* @param {any} options Transaction options
|
|
30455
|
-
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
30456
|
-
* @returns {Promise<any>} Transaction
|
|
30457
|
-
*/
|
|
30458
|
-
;
|
|
30459
|
-
|
|
30460
|
-
_proto.removeLiquidityVelodrome =
|
|
30461
|
-
/*#__PURE__*/
|
|
30462
|
-
function () {
|
|
30463
|
-
var _removeLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee39(assetA, assetB, amount, isStable, options, sdkOptions) {
|
|
30556
|
+
var _addLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee39(assetA, assetB, amountA, amountB, isStable, options, sdkOptions) {
|
|
30464
30557
|
var tx;
|
|
30465
30558
|
return runtime_1.wrap(function _callee39$(_context39) {
|
|
30466
30559
|
while (1) {
|
|
@@ -30480,7 +30573,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30480
30573
|
_context39.t1 = this;
|
|
30481
30574
|
_context39.t2 = routerAddress[this.network][Dapp.VELODROME];
|
|
30482
30575
|
_context39.next = 7;
|
|
30483
|
-
return
|
|
30576
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
30484
30577
|
|
|
30485
30578
|
case 7:
|
|
30486
30579
|
_context39.t3 = _context39.sent;
|
|
@@ -30502,18 +30595,17 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30502
30595
|
}, _callee39, this);
|
|
30503
30596
|
}));
|
|
30504
30597
|
|
|
30505
|
-
function
|
|
30506
|
-
return
|
|
30598
|
+
function addLiquidityVelodrome(_x183, _x184, _x185, _x186, _x187, _x188, _x189) {
|
|
30599
|
+
return _addLiquidityVelodrome.apply(this, arguments);
|
|
30507
30600
|
}
|
|
30508
30601
|
|
|
30509
|
-
return
|
|
30602
|
+
return addLiquidityVelodrome;
|
|
30510
30603
|
}()
|
|
30511
30604
|
/**
|
|
30512
|
-
*
|
|
30605
|
+
* Remove liquidity from Velodrome pool
|
|
30513
30606
|
* @param {string} assetA First asset
|
|
30514
30607
|
* @param {string} assetB Second asset
|
|
30515
|
-
* @param {BigNumber | string}
|
|
30516
|
-
* @param {BigNumber | string} amountB Amount second asset
|
|
30608
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
30517
30609
|
* @param { boolean } isStable Is stable pool
|
|
30518
30610
|
* @param {any} options Transaction options
|
|
30519
30611
|
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
@@ -30521,10 +30613,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30521
30613
|
*/
|
|
30522
30614
|
;
|
|
30523
30615
|
|
|
30524
|
-
_proto.
|
|
30616
|
+
_proto.removeLiquidityVelodrome =
|
|
30525
30617
|
/*#__PURE__*/
|
|
30526
30618
|
function () {
|
|
30527
|
-
var
|
|
30619
|
+
var _removeLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee40(assetA, assetB, amount, isStable, options, sdkOptions) {
|
|
30528
30620
|
var tx;
|
|
30529
30621
|
return runtime_1.wrap(function _callee40$(_context40) {
|
|
30530
30622
|
while (1) {
|
|
@@ -30542,9 +30634,9 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30542
30634
|
|
|
30543
30635
|
_context40.t0 = getPoolTxOrGasEstimate;
|
|
30544
30636
|
_context40.t1 = this;
|
|
30545
|
-
_context40.t2 = routerAddress[this.network][Dapp.
|
|
30637
|
+
_context40.t2 = routerAddress[this.network][Dapp.VELODROME];
|
|
30546
30638
|
_context40.next = 7;
|
|
30547
|
-
return
|
|
30639
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
30548
30640
|
|
|
30549
30641
|
case 7:
|
|
30550
30642
|
_context40.t3 = _context40.sent;
|
|
@@ -30566,17 +30658,18 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30566
30658
|
}, _callee40, this);
|
|
30567
30659
|
}));
|
|
30568
30660
|
|
|
30569
|
-
function
|
|
30570
|
-
return
|
|
30661
|
+
function removeLiquidityVelodrome(_x190, _x191, _x192, _x193, _x194, _x195) {
|
|
30662
|
+
return _removeLiquidityVelodrome.apply(this, arguments);
|
|
30571
30663
|
}
|
|
30572
30664
|
|
|
30573
|
-
return
|
|
30665
|
+
return removeLiquidityVelodrome;
|
|
30574
30666
|
}()
|
|
30575
30667
|
/**
|
|
30576
|
-
*
|
|
30668
|
+
* Add liquidity to Velodrome V2 pool
|
|
30577
30669
|
* @param {string} assetA First asset
|
|
30578
30670
|
* @param {string} assetB Second asset
|
|
30579
|
-
* @param {BigNumber | string}
|
|
30671
|
+
* @param {BigNumber | string} amountA Amount first asset
|
|
30672
|
+
* @param {BigNumber | string} amountB Amount second asset
|
|
30580
30673
|
* @param { boolean } isStable Is stable pool
|
|
30581
30674
|
* @param {any} options Transaction options
|
|
30582
30675
|
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
@@ -30584,10 +30677,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30584
30677
|
*/
|
|
30585
30678
|
;
|
|
30586
30679
|
|
|
30587
|
-
_proto.
|
|
30680
|
+
_proto.addLiquidityVelodromeV2 =
|
|
30588
30681
|
/*#__PURE__*/
|
|
30589
30682
|
function () {
|
|
30590
|
-
var
|
|
30683
|
+
var _addLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee41(assetA, assetB, amountA, amountB, isStable, options, sdkOptions) {
|
|
30591
30684
|
var tx;
|
|
30592
30685
|
return runtime_1.wrap(function _callee41$(_context41) {
|
|
30593
30686
|
while (1) {
|
|
@@ -30607,7 +30700,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30607
30700
|
_context41.t1 = this;
|
|
30608
30701
|
_context41.t2 = routerAddress[this.network][Dapp.VELODROMEV2];
|
|
30609
30702
|
_context41.next = 7;
|
|
30610
|
-
return
|
|
30703
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
30611
30704
|
|
|
30612
30705
|
case 7:
|
|
30613
30706
|
_context41.t3 = _context41.sent;
|
|
@@ -30629,19 +30722,17 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30629
30722
|
}, _callee41, this);
|
|
30630
30723
|
}));
|
|
30631
30724
|
|
|
30632
|
-
function
|
|
30633
|
-
return
|
|
30725
|
+
function addLiquidityVelodromeV2(_x196, _x197, _x198, _x199, _x200, _x201, _x202) {
|
|
30726
|
+
return _addLiquidityVelodromeV.apply(this, arguments);
|
|
30634
30727
|
}
|
|
30635
30728
|
|
|
30636
|
-
return
|
|
30729
|
+
return addLiquidityVelodromeV2;
|
|
30637
30730
|
}()
|
|
30638
30731
|
/**
|
|
30639
|
-
*
|
|
30640
|
-
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
30732
|
+
* Remove liquidity from Velodrome V2 pool
|
|
30641
30733
|
* @param {string} assetA First asset
|
|
30642
30734
|
* @param {string} assetB Second asset
|
|
30643
|
-
* @param {BigNumber | string}
|
|
30644
|
-
* @param {BigNumber | string} amountB Amount second asset
|
|
30735
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
30645
30736
|
* @param { boolean } isStable Is stable pool
|
|
30646
30737
|
* @param {any} options Transaction options
|
|
30647
30738
|
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
@@ -30649,10 +30740,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30649
30740
|
*/
|
|
30650
30741
|
;
|
|
30651
30742
|
|
|
30652
|
-
_proto.
|
|
30743
|
+
_proto.removeLiquidityVelodromeV2 =
|
|
30653
30744
|
/*#__PURE__*/
|
|
30654
30745
|
function () {
|
|
30655
|
-
var
|
|
30746
|
+
var _removeLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee42(assetA, assetB, amount, isStable, options, sdkOptions) {
|
|
30656
30747
|
var tx;
|
|
30657
30748
|
return runtime_1.wrap(function _callee42$(_context42) {
|
|
30658
30749
|
while (1) {
|
|
@@ -30670,9 +30761,9 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30670
30761
|
|
|
30671
30762
|
_context42.t0 = getPoolTxOrGasEstimate;
|
|
30672
30763
|
_context42.t1 = this;
|
|
30673
|
-
_context42.t2 = routerAddress[this.network][
|
|
30764
|
+
_context42.t2 = routerAddress[this.network][Dapp.VELODROMEV2];
|
|
30674
30765
|
_context42.next = 7;
|
|
30675
|
-
return
|
|
30766
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
30676
30767
|
|
|
30677
30768
|
case 7:
|
|
30678
30769
|
_context42.t3 = _context42.sent;
|
|
@@ -30694,18 +30785,19 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30694
30785
|
}, _callee42, this);
|
|
30695
30786
|
}));
|
|
30696
30787
|
|
|
30697
|
-
function
|
|
30698
|
-
return
|
|
30788
|
+
function removeLiquidityVelodromeV2(_x203, _x204, _x205, _x206, _x207, _x208) {
|
|
30789
|
+
return _removeLiquidityVelodromeV.apply(this, arguments);
|
|
30699
30790
|
}
|
|
30700
30791
|
|
|
30701
|
-
return
|
|
30792
|
+
return removeLiquidityVelodromeV2;
|
|
30702
30793
|
}()
|
|
30703
30794
|
/**
|
|
30704
|
-
*
|
|
30795
|
+
* Add liquidity to Velodrome V2 or Ramses pool
|
|
30705
30796
|
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
30706
30797
|
* @param {string} assetA First asset
|
|
30707
30798
|
* @param {string} assetB Second asset
|
|
30708
|
-
* @param {BigNumber | string}
|
|
30799
|
+
* @param {BigNumber | string} amountA Amount first asset
|
|
30800
|
+
* @param {BigNumber | string} amountB Amount second asset
|
|
30709
30801
|
* @param { boolean } isStable Is stable pool
|
|
30710
30802
|
* @param {any} options Transaction options
|
|
30711
30803
|
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
@@ -30713,10 +30805,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30713
30805
|
*/
|
|
30714
30806
|
;
|
|
30715
30807
|
|
|
30716
|
-
_proto.
|
|
30808
|
+
_proto.addLiquidityV2 =
|
|
30717
30809
|
/*#__PURE__*/
|
|
30718
30810
|
function () {
|
|
30719
|
-
var
|
|
30811
|
+
var _addLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee43(dapp, assetA, assetB, amountA, amountB, isStable, options, sdkOptions) {
|
|
30720
30812
|
var tx;
|
|
30721
30813
|
return runtime_1.wrap(function _callee43$(_context43) {
|
|
30722
30814
|
while (1) {
|
|
@@ -30736,7 +30828,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30736
30828
|
_context43.t1 = this;
|
|
30737
30829
|
_context43.t2 = routerAddress[this.network][dapp];
|
|
30738
30830
|
_context43.next = 7;
|
|
30739
|
-
return
|
|
30831
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
30740
30832
|
|
|
30741
30833
|
case 7:
|
|
30742
30834
|
_context43.t3 = _context43.sent;
|
|
@@ -30758,7 +30850,71 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30758
30850
|
}, _callee43, this);
|
|
30759
30851
|
}));
|
|
30760
30852
|
|
|
30761
|
-
function
|
|
30853
|
+
function addLiquidityV2(_x209, _x210, _x211, _x212, _x213, _x214, _x215, _x216) {
|
|
30854
|
+
return _addLiquidityV.apply(this, arguments);
|
|
30855
|
+
}
|
|
30856
|
+
|
|
30857
|
+
return addLiquidityV2;
|
|
30858
|
+
}()
|
|
30859
|
+
/**
|
|
30860
|
+
* Remove liquidity from Velodrome V2 or Ramses pool
|
|
30861
|
+
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
30862
|
+
* @param {string} assetA First asset
|
|
30863
|
+
* @param {string} assetB Second asset
|
|
30864
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
30865
|
+
* @param { boolean } isStable Is stable pool
|
|
30866
|
+
* @param {any} options Transaction options
|
|
30867
|
+
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
30868
|
+
* @returns {Promise<any>} Transaction
|
|
30869
|
+
*/
|
|
30870
|
+
;
|
|
30871
|
+
|
|
30872
|
+
_proto.removeLiquidityV2 =
|
|
30873
|
+
/*#__PURE__*/
|
|
30874
|
+
function () {
|
|
30875
|
+
var _removeLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee44(dapp, assetA, assetB, amount, isStable, options, sdkOptions) {
|
|
30876
|
+
var tx;
|
|
30877
|
+
return runtime_1.wrap(function _callee44$(_context44) {
|
|
30878
|
+
while (1) {
|
|
30879
|
+
switch (_context44.prev = _context44.next) {
|
|
30880
|
+
case 0:
|
|
30881
|
+
if (options === void 0) {
|
|
30882
|
+
options = null;
|
|
30883
|
+
}
|
|
30884
|
+
|
|
30885
|
+
if (sdkOptions === void 0) {
|
|
30886
|
+
sdkOptions = {
|
|
30887
|
+
estimateGas: false
|
|
30888
|
+
};
|
|
30889
|
+
}
|
|
30890
|
+
|
|
30891
|
+
_context44.t0 = getPoolTxOrGasEstimate;
|
|
30892
|
+
_context44.t1 = this;
|
|
30893
|
+
_context44.t2 = routerAddress[this.network][dapp];
|
|
30894
|
+
_context44.next = 7;
|
|
30895
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
30896
|
+
|
|
30897
|
+
case 7:
|
|
30898
|
+
_context44.t3 = _context44.sent;
|
|
30899
|
+
_context44.t4 = options;
|
|
30900
|
+
_context44.t5 = [_context44.t2, _context44.t3, _context44.t4];
|
|
30901
|
+
_context44.t6 = sdkOptions;
|
|
30902
|
+
_context44.next = 13;
|
|
30903
|
+
return (0, _context44.t0)(_context44.t1, _context44.t5, _context44.t6);
|
|
30904
|
+
|
|
30905
|
+
case 13:
|
|
30906
|
+
tx = _context44.sent;
|
|
30907
|
+
return _context44.abrupt("return", tx);
|
|
30908
|
+
|
|
30909
|
+
case 15:
|
|
30910
|
+
case "end":
|
|
30911
|
+
return _context44.stop();
|
|
30912
|
+
}
|
|
30913
|
+
}
|
|
30914
|
+
}, _callee44, this);
|
|
30915
|
+
}));
|
|
30916
|
+
|
|
30917
|
+
function removeLiquidityV2(_x217, _x218, _x219, _x220, _x221, _x222, _x223) {
|
|
30762
30918
|
return _removeLiquidityV.apply(this, arguments);
|
|
30763
30919
|
}
|
|
30764
30920
|
|
|
@@ -30784,11 +30940,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30784
30940
|
_proto.tradeLyraOption =
|
|
30785
30941
|
/*#__PURE__*/
|
|
30786
30942
|
function () {
|
|
30787
|
-
var _tradeLyraOption = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30943
|
+
var _tradeLyraOption = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee45(market, expiry, strike, optionType, tradeType, optionAmount, assetIn, collateralChangeAmount, isCoveredCall, options, sdkOptions) {
|
|
30788
30944
|
var swapxData, tx;
|
|
30789
|
-
return runtime_1.wrap(function
|
|
30945
|
+
return runtime_1.wrap(function _callee45$(_context45) {
|
|
30790
30946
|
while (1) {
|
|
30791
|
-
switch (
|
|
30947
|
+
switch (_context45.prev = _context45.next) {
|
|
30792
30948
|
case 0:
|
|
30793
30949
|
if (collateralChangeAmount === void 0) {
|
|
30794
30950
|
collateralChangeAmount = "0";
|
|
@@ -30808,27 +30964,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30808
30964
|
};
|
|
30809
30965
|
}
|
|
30810
30966
|
|
|
30811
|
-
|
|
30967
|
+
_context45.next = 6;
|
|
30812
30968
|
return getLyraOptionTxData(this, market, optionType, expiry, strike, tradeType, optionAmount, assetIn, BigNumber$1.from(collateralChangeAmount), isCoveredCall);
|
|
30813
30969
|
|
|
30814
30970
|
case 6:
|
|
30815
|
-
swapxData =
|
|
30816
|
-
|
|
30971
|
+
swapxData = _context45.sent;
|
|
30972
|
+
_context45.next = 9;
|
|
30817
30973
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.LYRA], swapxData, options], sdkOptions);
|
|
30818
30974
|
|
|
30819
30975
|
case 9:
|
|
30820
|
-
tx =
|
|
30821
|
-
return
|
|
30976
|
+
tx = _context45.sent;
|
|
30977
|
+
return _context45.abrupt("return", tx);
|
|
30822
30978
|
|
|
30823
30979
|
case 11:
|
|
30824
30980
|
case "end":
|
|
30825
|
-
return
|
|
30981
|
+
return _context45.stop();
|
|
30826
30982
|
}
|
|
30827
30983
|
}
|
|
30828
|
-
},
|
|
30984
|
+
}, _callee45, this);
|
|
30829
30985
|
}));
|
|
30830
30986
|
|
|
30831
|
-
function tradeLyraOption(
|
|
30987
|
+
function tradeLyraOption(_x224, _x225, _x226, _x227, _x228, _x229, _x230, _x231, _x232, _x233, _x234) {
|
|
30832
30988
|
return _tradeLyraOption.apply(this, arguments);
|
|
30833
30989
|
}
|
|
30834
30990
|
|
|
@@ -30843,26 +30999,26 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30843
30999
|
_proto.getLyraPositions =
|
|
30844
31000
|
/*#__PURE__*/
|
|
30845
31001
|
function () {
|
|
30846
|
-
var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30847
|
-
return runtime_1.wrap(function
|
|
31002
|
+
var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee46(market) {
|
|
31003
|
+
return runtime_1.wrap(function _callee46$(_context46) {
|
|
30848
31004
|
while (1) {
|
|
30849
|
-
switch (
|
|
31005
|
+
switch (_context46.prev = _context46.next) {
|
|
30850
31006
|
case 0:
|
|
30851
|
-
|
|
31007
|
+
_context46.next = 2;
|
|
30852
31008
|
return getOptionPositions(this, market);
|
|
30853
31009
|
|
|
30854
31010
|
case 2:
|
|
30855
|
-
return
|
|
31011
|
+
return _context46.abrupt("return", _context46.sent);
|
|
30856
31012
|
|
|
30857
31013
|
case 3:
|
|
30858
31014
|
case "end":
|
|
30859
|
-
return
|
|
31015
|
+
return _context46.stop();
|
|
30860
31016
|
}
|
|
30861
31017
|
}
|
|
30862
|
-
},
|
|
31018
|
+
}, _callee46, this);
|
|
30863
31019
|
}));
|
|
30864
31020
|
|
|
30865
|
-
function getLyraPositions(
|
|
31021
|
+
function getLyraPositions(_x235) {
|
|
30866
31022
|
return _getLyraPositions.apply(this, arguments);
|
|
30867
31023
|
}
|
|
30868
31024
|
|
|
@@ -30881,11 +31037,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30881
31037
|
_proto.changeFuturesMargin =
|
|
30882
31038
|
/*#__PURE__*/
|
|
30883
31039
|
function () {
|
|
30884
|
-
var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31040
|
+
var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee47(market, changeAmount, options, sdkOptions) {
|
|
30885
31041
|
var tx;
|
|
30886
|
-
return runtime_1.wrap(function
|
|
31042
|
+
return runtime_1.wrap(function _callee47$(_context47) {
|
|
30887
31043
|
while (1) {
|
|
30888
|
-
switch (
|
|
31044
|
+
switch (_context47.prev = _context47.next) {
|
|
30889
31045
|
case 0:
|
|
30890
31046
|
if (options === void 0) {
|
|
30891
31047
|
options = null;
|
|
@@ -30897,22 +31053,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30897
31053
|
};
|
|
30898
31054
|
}
|
|
30899
31055
|
|
|
30900
|
-
|
|
31056
|
+
_context47.next = 4;
|
|
30901
31057
|
return getPoolTxOrGasEstimate(this, [market, getFuturesChangeMarginTxData(changeAmount), options], sdkOptions);
|
|
30902
31058
|
|
|
30903
31059
|
case 4:
|
|
30904
|
-
tx =
|
|
30905
|
-
return
|
|
31060
|
+
tx = _context47.sent;
|
|
31061
|
+
return _context47.abrupt("return", tx);
|
|
30906
31062
|
|
|
30907
31063
|
case 6:
|
|
30908
31064
|
case "end":
|
|
30909
|
-
return
|
|
31065
|
+
return _context47.stop();
|
|
30910
31066
|
}
|
|
30911
31067
|
}
|
|
30912
|
-
},
|
|
31068
|
+
}, _callee47, this);
|
|
30913
31069
|
}));
|
|
30914
31070
|
|
|
30915
|
-
function changeFuturesMargin(
|
|
31071
|
+
function changeFuturesMargin(_x236, _x237, _x238, _x239) {
|
|
30916
31072
|
return _changeFuturesMargin.apply(this, arguments);
|
|
30917
31073
|
}
|
|
30918
31074
|
|
|
@@ -30931,11 +31087,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30931
31087
|
_proto.changeFuturesPosition =
|
|
30932
31088
|
/*#__PURE__*/
|
|
30933
31089
|
function () {
|
|
30934
|
-
var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31090
|
+
var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee48(market, changeAmount, options, sdkOptions) {
|
|
30935
31091
|
var txData, tx;
|
|
30936
|
-
return runtime_1.wrap(function
|
|
31092
|
+
return runtime_1.wrap(function _callee48$(_context48) {
|
|
30937
31093
|
while (1) {
|
|
30938
|
-
switch (
|
|
31094
|
+
switch (_context48.prev = _context48.next) {
|
|
30939
31095
|
case 0:
|
|
30940
31096
|
if (options === void 0) {
|
|
30941
31097
|
options = null;
|
|
@@ -30947,27 +31103,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30947
31103
|
};
|
|
30948
31104
|
}
|
|
30949
31105
|
|
|
30950
|
-
|
|
31106
|
+
_context48.next = 4;
|
|
30951
31107
|
return getFuturesChangePositionTxData(changeAmount, market, this);
|
|
30952
31108
|
|
|
30953
31109
|
case 4:
|
|
30954
|
-
txData =
|
|
30955
|
-
|
|
31110
|
+
txData = _context48.sent;
|
|
31111
|
+
_context48.next = 7;
|
|
30956
31112
|
return getPoolTxOrGasEstimate(this, [market, txData, options], sdkOptions);
|
|
30957
31113
|
|
|
30958
31114
|
case 7:
|
|
30959
|
-
tx =
|
|
30960
|
-
return
|
|
31115
|
+
tx = _context48.sent;
|
|
31116
|
+
return _context48.abrupt("return", tx);
|
|
30961
31117
|
|
|
30962
31118
|
case 9:
|
|
30963
31119
|
case "end":
|
|
30964
|
-
return
|
|
31120
|
+
return _context48.stop();
|
|
30965
31121
|
}
|
|
30966
31122
|
}
|
|
30967
|
-
},
|
|
31123
|
+
}, _callee48, this);
|
|
30968
31124
|
}));
|
|
30969
31125
|
|
|
30970
|
-
function changeFuturesPosition(
|
|
31126
|
+
function changeFuturesPosition(_x240, _x241, _x242, _x243) {
|
|
30971
31127
|
return _changeFuturesPosition.apply(this, arguments);
|
|
30972
31128
|
}
|
|
30973
31129
|
|
|
@@ -30985,11 +31141,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30985
31141
|
_proto.cancelFuturesOrder =
|
|
30986
31142
|
/*#__PURE__*/
|
|
30987
31143
|
function () {
|
|
30988
|
-
var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31144
|
+
var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee49(market, options, sdkOptions) {
|
|
30989
31145
|
var txData, tx;
|
|
30990
|
-
return runtime_1.wrap(function
|
|
31146
|
+
return runtime_1.wrap(function _callee49$(_context49) {
|
|
30991
31147
|
while (1) {
|
|
30992
|
-
switch (
|
|
31148
|
+
switch (_context49.prev = _context49.next) {
|
|
30993
31149
|
case 0:
|
|
30994
31150
|
if (options === void 0) {
|
|
30995
31151
|
options = null;
|
|
@@ -31001,27 +31157,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31001
31157
|
};
|
|
31002
31158
|
}
|
|
31003
31159
|
|
|
31004
|
-
|
|
31160
|
+
_context49.next = 4;
|
|
31005
31161
|
return getFuturesCancelOrderTxData(this);
|
|
31006
31162
|
|
|
31007
31163
|
case 4:
|
|
31008
|
-
txData =
|
|
31009
|
-
|
|
31164
|
+
txData = _context49.sent;
|
|
31165
|
+
_context49.next = 7;
|
|
31010
31166
|
return getPoolTxOrGasEstimate(this, [market, txData, options], sdkOptions);
|
|
31011
31167
|
|
|
31012
31168
|
case 7:
|
|
31013
|
-
tx =
|
|
31014
|
-
return
|
|
31169
|
+
tx = _context49.sent;
|
|
31170
|
+
return _context49.abrupt("return", tx);
|
|
31015
31171
|
|
|
31016
31172
|
case 9:
|
|
31017
31173
|
case "end":
|
|
31018
|
-
return
|
|
31174
|
+
return _context49.stop();
|
|
31019
31175
|
}
|
|
31020
31176
|
}
|
|
31021
|
-
},
|
|
31177
|
+
}, _callee49, this);
|
|
31022
31178
|
}));
|
|
31023
31179
|
|
|
31024
|
-
function cancelFuturesOrder(
|
|
31180
|
+
function cancelFuturesOrder(_x244, _x245, _x246) {
|
|
31025
31181
|
return _cancelFuturesOrder.apply(this, arguments);
|
|
31026
31182
|
}
|
|
31027
31183
|
|
|
@@ -31038,11 +31194,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31038
31194
|
_proto.mintManagerFee =
|
|
31039
31195
|
/*#__PURE__*/
|
|
31040
31196
|
function () {
|
|
31041
|
-
var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31197
|
+
var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee50(options, estimateGas) {
|
|
31042
31198
|
var tx;
|
|
31043
|
-
return runtime_1.wrap(function
|
|
31199
|
+
return runtime_1.wrap(function _callee50$(_context50) {
|
|
31044
31200
|
while (1) {
|
|
31045
|
-
switch (
|
|
31201
|
+
switch (_context50.prev = _context50.next) {
|
|
31046
31202
|
case 0:
|
|
31047
31203
|
if (options === void 0) {
|
|
31048
31204
|
options = null;
|
|
@@ -31053,33 +31209,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31053
31209
|
}
|
|
31054
31210
|
|
|
31055
31211
|
if (!estimateGas) {
|
|
31056
|
-
|
|
31212
|
+
_context50.next = 6;
|
|
31057
31213
|
break;
|
|
31058
31214
|
}
|
|
31059
31215
|
|
|
31060
|
-
|
|
31216
|
+
_context50.next = 5;
|
|
31061
31217
|
return this.poolLogic.estimateGas.mintManagerFee(options);
|
|
31062
31218
|
|
|
31063
31219
|
case 5:
|
|
31064
|
-
return
|
|
31220
|
+
return _context50.abrupt("return", _context50.sent);
|
|
31065
31221
|
|
|
31066
31222
|
case 6:
|
|
31067
|
-
|
|
31223
|
+
_context50.next = 8;
|
|
31068
31224
|
return this.poolLogic.mintManagerFee(options);
|
|
31069
31225
|
|
|
31070
31226
|
case 8:
|
|
31071
|
-
tx =
|
|
31072
|
-
return
|
|
31227
|
+
tx = _context50.sent;
|
|
31228
|
+
return _context50.abrupt("return", tx);
|
|
31073
31229
|
|
|
31074
31230
|
case 10:
|
|
31075
31231
|
case "end":
|
|
31076
|
-
return
|
|
31232
|
+
return _context50.stop();
|
|
31077
31233
|
}
|
|
31078
31234
|
}
|
|
31079
|
-
},
|
|
31235
|
+
}, _callee50, this);
|
|
31080
31236
|
}));
|
|
31081
31237
|
|
|
31082
|
-
function mintManagerFee(
|
|
31238
|
+
function mintManagerFee(_x247, _x248) {
|
|
31083
31239
|
return _mintManagerFee.apply(this, arguments);
|
|
31084
31240
|
}
|
|
31085
31241
|
|
|
@@ -31094,25 +31250,25 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31094
31250
|
_proto.getAvailableManagerFee =
|
|
31095
31251
|
/*#__PURE__*/
|
|
31096
31252
|
function () {
|
|
31097
|
-
var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31253
|
+
var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee51() {
|
|
31098
31254
|
var fee;
|
|
31099
|
-
return runtime_1.wrap(function
|
|
31255
|
+
return runtime_1.wrap(function _callee51$(_context51) {
|
|
31100
31256
|
while (1) {
|
|
31101
|
-
switch (
|
|
31257
|
+
switch (_context51.prev = _context51.next) {
|
|
31102
31258
|
case 0:
|
|
31103
|
-
|
|
31259
|
+
_context51.next = 2;
|
|
31104
31260
|
return this.poolLogic.availableManagerFee();
|
|
31105
31261
|
|
|
31106
31262
|
case 2:
|
|
31107
|
-
fee =
|
|
31108
|
-
return
|
|
31263
|
+
fee = _context51.sent;
|
|
31264
|
+
return _context51.abrupt("return", BigNumber$1.from(fee));
|
|
31109
31265
|
|
|
31110
31266
|
case 4:
|
|
31111
31267
|
case "end":
|
|
31112
|
-
return
|
|
31268
|
+
return _context51.stop();
|
|
31113
31269
|
}
|
|
31114
31270
|
}
|
|
31115
|
-
},
|
|
31271
|
+
}, _callee51, this);
|
|
31116
31272
|
}));
|
|
31117
31273
|
|
|
31118
31274
|
function getAvailableManagerFee() {
|
|
@@ -31134,11 +31290,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31134
31290
|
_proto.vestTokens =
|
|
31135
31291
|
/*#__PURE__*/
|
|
31136
31292
|
function () {
|
|
31137
|
-
var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31293
|
+
var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee52(tokenAddress, amount, options, sdkOptions) {
|
|
31138
31294
|
var txData, tx;
|
|
31139
|
-
return runtime_1.wrap(function
|
|
31295
|
+
return runtime_1.wrap(function _callee52$(_context52) {
|
|
31140
31296
|
while (1) {
|
|
31141
|
-
switch (
|
|
31297
|
+
switch (_context52.prev = _context52.next) {
|
|
31142
31298
|
case 0:
|
|
31143
31299
|
if (options === void 0) {
|
|
31144
31300
|
options = null;
|
|
@@ -31150,27 +31306,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31150
31306
|
};
|
|
31151
31307
|
}
|
|
31152
31308
|
|
|
31153
|
-
|
|
31309
|
+
_context52.next = 4;
|
|
31154
31310
|
return getCreateVestTxData(amount);
|
|
31155
31311
|
|
|
31156
31312
|
case 4:
|
|
31157
|
-
txData =
|
|
31158
|
-
|
|
31313
|
+
txData = _context52.sent;
|
|
31314
|
+
_context52.next = 7;
|
|
31159
31315
|
return getPoolTxOrGasEstimate(this, [tokenAddress, txData, options], sdkOptions);
|
|
31160
31316
|
|
|
31161
31317
|
case 7:
|
|
31162
|
-
tx =
|
|
31163
|
-
return
|
|
31318
|
+
tx = _context52.sent;
|
|
31319
|
+
return _context52.abrupt("return", tx);
|
|
31164
31320
|
|
|
31165
31321
|
case 9:
|
|
31166
31322
|
case "end":
|
|
31167
|
-
return
|
|
31323
|
+
return _context52.stop();
|
|
31168
31324
|
}
|
|
31169
31325
|
}
|
|
31170
|
-
},
|
|
31326
|
+
}, _callee52, this);
|
|
31171
31327
|
}));
|
|
31172
31328
|
|
|
31173
|
-
function vestTokens(
|
|
31329
|
+
function vestTokens(_x249, _x250, _x251, _x252) {
|
|
31174
31330
|
return _vestTokens.apply(this, arguments);
|
|
31175
31331
|
}
|
|
31176
31332
|
|
|
@@ -31189,11 +31345,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31189
31345
|
_proto.exitVestedToken =
|
|
31190
31346
|
/*#__PURE__*/
|
|
31191
31347
|
function () {
|
|
31192
|
-
var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31348
|
+
var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee53(tokenAddress, id, options, sdkOptions) {
|
|
31193
31349
|
var txData, tx;
|
|
31194
|
-
return runtime_1.wrap(function
|
|
31350
|
+
return runtime_1.wrap(function _callee53$(_context53) {
|
|
31195
31351
|
while (1) {
|
|
31196
|
-
switch (
|
|
31352
|
+
switch (_context53.prev = _context53.next) {
|
|
31197
31353
|
case 0:
|
|
31198
31354
|
if (options === void 0) {
|
|
31199
31355
|
options = null;
|
|
@@ -31205,27 +31361,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31205
31361
|
};
|
|
31206
31362
|
}
|
|
31207
31363
|
|
|
31208
|
-
|
|
31364
|
+
_context53.next = 4;
|
|
31209
31365
|
return getExitVestTxData(id);
|
|
31210
31366
|
|
|
31211
31367
|
case 4:
|
|
31212
|
-
txData =
|
|
31213
|
-
|
|
31368
|
+
txData = _context53.sent;
|
|
31369
|
+
_context53.next = 7;
|
|
31214
31370
|
return getPoolTxOrGasEstimate(this, [tokenAddress, txData, options], sdkOptions);
|
|
31215
31371
|
|
|
31216
31372
|
case 7:
|
|
31217
|
-
tx =
|
|
31218
|
-
return
|
|
31373
|
+
tx = _context53.sent;
|
|
31374
|
+
return _context53.abrupt("return", tx);
|
|
31219
31375
|
|
|
31220
31376
|
case 9:
|
|
31221
31377
|
case "end":
|
|
31222
|
-
return
|
|
31378
|
+
return _context53.stop();
|
|
31223
31379
|
}
|
|
31224
31380
|
}
|
|
31225
|
-
},
|
|
31381
|
+
}, _callee53, this);
|
|
31226
31382
|
}));
|
|
31227
31383
|
|
|
31228
|
-
function exitVestedToken(
|
|
31384
|
+
function exitVestedToken(_x253, _x254, _x255, _x256) {
|
|
31229
31385
|
return _exitVestedToken.apply(this, arguments);
|
|
31230
31386
|
}
|
|
31231
31387
|
|
|
@@ -31245,11 +31401,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31245
31401
|
_proto.mintUnitViaFlatMoney =
|
|
31246
31402
|
/*#__PURE__*/
|
|
31247
31403
|
function () {
|
|
31248
|
-
var _mintUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31404
|
+
var _mintUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee54(depositAmount, slippage, maxKeeperFeeInUsd, options, sdkOptions) {
|
|
31249
31405
|
var tx;
|
|
31250
|
-
return runtime_1.wrap(function
|
|
31406
|
+
return runtime_1.wrap(function _callee54$(_context54) {
|
|
31251
31407
|
while (1) {
|
|
31252
|
-
switch (
|
|
31408
|
+
switch (_context54.prev = _context54.next) {
|
|
31253
31409
|
case 0:
|
|
31254
31410
|
if (slippage === void 0) {
|
|
31255
31411
|
slippage = 0.5;
|
|
@@ -31265,22 +31421,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31265
31421
|
};
|
|
31266
31422
|
}
|
|
31267
31423
|
|
|
31268
|
-
|
|
31424
|
+
_context54.next = 5;
|
|
31269
31425
|
return mintUnitViaFlatMoney(this, depositAmount, slippage, maxKeeperFeeInUsd, options, sdkOptions);
|
|
31270
31426
|
|
|
31271
31427
|
case 5:
|
|
31272
|
-
tx =
|
|
31273
|
-
return
|
|
31428
|
+
tx = _context54.sent;
|
|
31429
|
+
return _context54.abrupt("return", tx);
|
|
31274
31430
|
|
|
31275
31431
|
case 7:
|
|
31276
31432
|
case "end":
|
|
31277
|
-
return
|
|
31433
|
+
return _context54.stop();
|
|
31278
31434
|
}
|
|
31279
31435
|
}
|
|
31280
|
-
},
|
|
31436
|
+
}, _callee54, this);
|
|
31281
31437
|
}));
|
|
31282
31438
|
|
|
31283
|
-
function mintUnitViaFlatMoney$1(
|
|
31439
|
+
function mintUnitViaFlatMoney$1(_x257, _x258, _x259, _x260, _x261) {
|
|
31284
31440
|
return _mintUnitViaFlatMoney2.apply(this, arguments);
|
|
31285
31441
|
}
|
|
31286
31442
|
|
|
@@ -31300,11 +31456,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31300
31456
|
_proto.redeemUnitViaFlatMoney =
|
|
31301
31457
|
/*#__PURE__*/
|
|
31302
31458
|
function () {
|
|
31303
|
-
var _redeemUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31459
|
+
var _redeemUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee55(withdrawAmount, slippage, maxKeeperFeeInUsd, options, sdkOptions) {
|
|
31304
31460
|
var tx;
|
|
31305
|
-
return runtime_1.wrap(function
|
|
31461
|
+
return runtime_1.wrap(function _callee55$(_context55) {
|
|
31306
31462
|
while (1) {
|
|
31307
|
-
switch (
|
|
31463
|
+
switch (_context55.prev = _context55.next) {
|
|
31308
31464
|
case 0:
|
|
31309
31465
|
if (slippage === void 0) {
|
|
31310
31466
|
slippage = 0.5;
|
|
@@ -31320,22 +31476,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31320
31476
|
};
|
|
31321
31477
|
}
|
|
31322
31478
|
|
|
31323
|
-
|
|
31479
|
+
_context55.next = 5;
|
|
31324
31480
|
return redeemUnitViaFlatMoney(this, withdrawAmount, slippage, maxKeeperFeeInUsd, options, sdkOptions);
|
|
31325
31481
|
|
|
31326
31482
|
case 5:
|
|
31327
|
-
tx =
|
|
31328
|
-
return
|
|
31483
|
+
tx = _context55.sent;
|
|
31484
|
+
return _context55.abrupt("return", tx);
|
|
31329
31485
|
|
|
31330
31486
|
case 7:
|
|
31331
31487
|
case "end":
|
|
31332
|
-
return
|
|
31488
|
+
return _context55.stop();
|
|
31333
31489
|
}
|
|
31334
31490
|
}
|
|
31335
|
-
},
|
|
31491
|
+
}, _callee55, this);
|
|
31336
31492
|
}));
|
|
31337
31493
|
|
|
31338
|
-
function redeemUnitViaFlatMoney$1(
|
|
31494
|
+
function redeemUnitViaFlatMoney$1(_x262, _x263, _x264, _x265, _x266) {
|
|
31339
31495
|
return _redeemUnitViaFlatMoney2.apply(this, arguments);
|
|
31340
31496
|
}
|
|
31341
31497
|
|
|
@@ -31343,11 +31499,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31343
31499
|
}();
|
|
31344
31500
|
|
|
31345
31501
|
_proto.cancelOrderViaFlatMoney = /*#__PURE__*/function () {
|
|
31346
|
-
var _cancelOrderViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31502
|
+
var _cancelOrderViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee56(options, estimateGas) {
|
|
31347
31503
|
var tx;
|
|
31348
|
-
return runtime_1.wrap(function
|
|
31504
|
+
return runtime_1.wrap(function _callee56$(_context56) {
|
|
31349
31505
|
while (1) {
|
|
31350
|
-
switch (
|
|
31506
|
+
switch (_context56.prev = _context56.next) {
|
|
31351
31507
|
case 0:
|
|
31352
31508
|
if (options === void 0) {
|
|
31353
31509
|
options = null;
|
|
@@ -31357,22 +31513,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31357
31513
|
estimateGas = false;
|
|
31358
31514
|
}
|
|
31359
31515
|
|
|
31360
|
-
|
|
31516
|
+
_context56.next = 4;
|
|
31361
31517
|
return cancelOrderViaFlatMoney(this, options, estimateGas);
|
|
31362
31518
|
|
|
31363
31519
|
case 4:
|
|
31364
|
-
tx =
|
|
31365
|
-
return
|
|
31520
|
+
tx = _context56.sent;
|
|
31521
|
+
return _context56.abrupt("return", tx);
|
|
31366
31522
|
|
|
31367
31523
|
case 6:
|
|
31368
31524
|
case "end":
|
|
31369
|
-
return
|
|
31525
|
+
return _context56.stop();
|
|
31370
31526
|
}
|
|
31371
31527
|
}
|
|
31372
|
-
},
|
|
31528
|
+
}, _callee56, this);
|
|
31373
31529
|
}));
|
|
31374
31530
|
|
|
31375
|
-
function cancelOrderViaFlatMoney$1(
|
|
31531
|
+
function cancelOrderViaFlatMoney$1(_x267, _x268) {
|
|
31376
31532
|
return _cancelOrderViaFlatMoney2.apply(this, arguments);
|
|
31377
31533
|
}
|
|
31378
31534
|
|
|
@@ -31391,11 +31547,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31391
31547
|
_proto.completeTorosWithdrawal =
|
|
31392
31548
|
/*#__PURE__*/
|
|
31393
31549
|
function () {
|
|
31394
|
-
var _completeTorosWithdrawal = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31550
|
+
var _completeTorosWithdrawal = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee57(destinationToken, slippage, options, sdkOptions) {
|
|
31395
31551
|
var txData, tx;
|
|
31396
|
-
return runtime_1.wrap(function
|
|
31552
|
+
return runtime_1.wrap(function _callee57$(_context57) {
|
|
31397
31553
|
while (1) {
|
|
31398
|
-
switch (
|
|
31554
|
+
switch (_context57.prev = _context57.next) {
|
|
31399
31555
|
case 0:
|
|
31400
31556
|
if (slippage === void 0) {
|
|
31401
31557
|
slippage = 0.5;
|
|
@@ -31411,31 +31567,95 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31411
31567
|
};
|
|
31412
31568
|
}
|
|
31413
31569
|
|
|
31414
|
-
|
|
31570
|
+
_context57.next = 5;
|
|
31415
31571
|
return getCompleteWithdrawalTxData(this, destinationToken, slippage * 100, false);
|
|
31416
31572
|
|
|
31417
31573
|
case 5:
|
|
31418
|
-
txData =
|
|
31419
|
-
|
|
31574
|
+
txData = _context57.sent;
|
|
31575
|
+
_context57.next = 8;
|
|
31420
31576
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network].toros, txData, options], sdkOptions);
|
|
31421
31577
|
|
|
31422
31578
|
case 8:
|
|
31423
|
-
tx =
|
|
31424
|
-
return
|
|
31579
|
+
tx = _context57.sent;
|
|
31580
|
+
return _context57.abrupt("return", tx);
|
|
31425
31581
|
|
|
31426
31582
|
case 10:
|
|
31427
31583
|
case "end":
|
|
31428
|
-
return
|
|
31584
|
+
return _context57.stop();
|
|
31429
31585
|
}
|
|
31430
31586
|
}
|
|
31431
|
-
},
|
|
31587
|
+
}, _callee57, this);
|
|
31432
31588
|
}));
|
|
31433
31589
|
|
|
31434
|
-
function completeTorosWithdrawal(
|
|
31590
|
+
function completeTorosWithdrawal(_x269, _x270, _x271, _x272) {
|
|
31435
31591
|
return _completeTorosWithdrawal.apply(this, arguments);
|
|
31436
31592
|
}
|
|
31437
31593
|
|
|
31438
31594
|
return completeTorosWithdrawal;
|
|
31595
|
+
}()
|
|
31596
|
+
/**
|
|
31597
|
+
* Mint PT and YT tokens on Pendle
|
|
31598
|
+
* @param {string} assetFrom Asset to mint from (only underlying asset)
|
|
31599
|
+
* @param {string} pt PT address
|
|
31600
|
+
* @param {BigNumber | string} amountIn Amount underlying asset
|
|
31601
|
+
* @param {number} slippage Slippage tolerance in %
|
|
31602
|
+
* @param {any} options Transaction options
|
|
31603
|
+
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
31604
|
+
* @returns {Promise<any>} Transaction
|
|
31605
|
+
*/
|
|
31606
|
+
;
|
|
31607
|
+
|
|
31608
|
+
_proto.mintPendle =
|
|
31609
|
+
/*#__PURE__*/
|
|
31610
|
+
function () {
|
|
31611
|
+
var _mintPendle = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee58(assetFrom, pt, amountIn, slippage, options, sdkOptions) {
|
|
31612
|
+
var _yield$getPendleMintT, swapTxData, minAmountOut, tx;
|
|
31613
|
+
|
|
31614
|
+
return runtime_1.wrap(function _callee58$(_context58) {
|
|
31615
|
+
while (1) {
|
|
31616
|
+
switch (_context58.prev = _context58.next) {
|
|
31617
|
+
case 0:
|
|
31618
|
+
if (slippage === void 0) {
|
|
31619
|
+
slippage = 0.5;
|
|
31620
|
+
}
|
|
31621
|
+
|
|
31622
|
+
if (options === void 0) {
|
|
31623
|
+
options = null;
|
|
31624
|
+
}
|
|
31625
|
+
|
|
31626
|
+
if (sdkOptions === void 0) {
|
|
31627
|
+
sdkOptions = {
|
|
31628
|
+
estimateGas: false
|
|
31629
|
+
};
|
|
31630
|
+
}
|
|
31631
|
+
|
|
31632
|
+
_context58.next = 5;
|
|
31633
|
+
return getPendleMintTxData(this, assetFrom, pt, amountIn, slippage);
|
|
31634
|
+
|
|
31635
|
+
case 5:
|
|
31636
|
+
_yield$getPendleMintT = _context58.sent;
|
|
31637
|
+
swapTxData = _yield$getPendleMintT.swapTxData;
|
|
31638
|
+
minAmountOut = _yield$getPendleMintT.minAmountOut;
|
|
31639
|
+
_context58.next = 10;
|
|
31640
|
+
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.PENDLE], swapTxData, options, minAmountOut], sdkOptions);
|
|
31641
|
+
|
|
31642
|
+
case 10:
|
|
31643
|
+
tx = _context58.sent;
|
|
31644
|
+
return _context58.abrupt("return", tx);
|
|
31645
|
+
|
|
31646
|
+
case 12:
|
|
31647
|
+
case "end":
|
|
31648
|
+
return _context58.stop();
|
|
31649
|
+
}
|
|
31650
|
+
}
|
|
31651
|
+
}, _callee58, this);
|
|
31652
|
+
}));
|
|
31653
|
+
|
|
31654
|
+
function mintPendle(_x273, _x274, _x275, _x276, _x277, _x278) {
|
|
31655
|
+
return _mintPendle.apply(this, arguments);
|
|
31656
|
+
}
|
|
31657
|
+
|
|
31658
|
+
return mintPendle;
|
|
31439
31659
|
}();
|
|
31440
31660
|
|
|
31441
31661
|
return Pool;
|