@dhedge/v2-sdk 2.0.1 → 2.0.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 +8 -0
- package/dist/v2-sdk.cjs.development.js +486 -393
- 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 +486 -393
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/PoolManagerLogic.json +13 -0
- package/src/entities/pool.ts +22 -0
- package/src/test/flatmoney.test.ts +22 -0
- package/src/test/pool.test.ts +77 -74
- package/src/utils/contract.ts +25 -5
package/dist/v2-sdk.esm.js
CHANGED
|
@@ -4237,6 +4237,20 @@ var abi$2 = [
|
|
|
4237
4237
|
],
|
|
4238
4238
|
stateMutability: "view",
|
|
4239
4239
|
type: "function"
|
|
4240
|
+
},
|
|
4241
|
+
{
|
|
4242
|
+
inputs: [
|
|
4243
|
+
{
|
|
4244
|
+
internalType: "bool",
|
|
4245
|
+
name: "_privatePool",
|
|
4246
|
+
type: "bool"
|
|
4247
|
+
}
|
|
4248
|
+
],
|
|
4249
|
+
name: "setPoolPrivate",
|
|
4250
|
+
outputs: [
|
|
4251
|
+
],
|
|
4252
|
+
stateMutability: "nonpayable",
|
|
4253
|
+
type: "function"
|
|
4240
4254
|
}
|
|
4241
4255
|
];
|
|
4242
4256
|
var ManagerLogic = {
|
|
@@ -18312,7 +18326,7 @@ function _call() {
|
|
|
18312
18326
|
}
|
|
18313
18327
|
|
|
18314
18328
|
var getGasEstimateData = /*#__PURE__*/function () {
|
|
18315
|
-
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(estimateFunc, txInfoData, txOptions) {
|
|
18329
|
+
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(pool, estimateFunc, txInfoData, txOptions, sdkOptions) {
|
|
18316
18330
|
var gas, gasEstimationError;
|
|
18317
18331
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
18318
18332
|
while (1) {
|
|
@@ -18325,34 +18339,54 @@ var getGasEstimateData = /*#__PURE__*/function () {
|
|
|
18325
18339
|
gas = null;
|
|
18326
18340
|
gasEstimationError = null;
|
|
18327
18341
|
_context2.prev = 3;
|
|
18328
|
-
_context2.next = 6;
|
|
18329
|
-
return estimateFunc(txInfoData.to, txInfoData.txData, txOptions);
|
|
18330
18342
|
|
|
18331
|
-
|
|
18343
|
+
if (!(!pool.isDhedge || !isSdkOptionsBoolean(sdkOptions) && sdkOptions.useTraderAddressAsFrom)) {
|
|
18344
|
+
_context2.next = 10;
|
|
18345
|
+
break;
|
|
18346
|
+
}
|
|
18347
|
+
|
|
18348
|
+
_context2.next = 7;
|
|
18349
|
+
return estimateFunc(_extends({
|
|
18350
|
+
to: txInfoData.to,
|
|
18351
|
+
data: txInfoData.txData
|
|
18352
|
+
}, txOptions));
|
|
18353
|
+
|
|
18354
|
+
case 7:
|
|
18332
18355
|
gas = _context2.sent;
|
|
18356
|
+
_context2.next = 13;
|
|
18357
|
+
break;
|
|
18358
|
+
|
|
18359
|
+
case 10:
|
|
18333
18360
|
_context2.next = 12;
|
|
18361
|
+
return estimateFunc(txInfoData.to, txInfoData.txData, txOptions);
|
|
18362
|
+
|
|
18363
|
+
case 12:
|
|
18364
|
+
gas = _context2.sent;
|
|
18365
|
+
|
|
18366
|
+
case 13:
|
|
18367
|
+
_context2.next = 18;
|
|
18334
18368
|
break;
|
|
18335
18369
|
|
|
18336
|
-
case
|
|
18337
|
-
_context2.prev =
|
|
18370
|
+
case 15:
|
|
18371
|
+
_context2.prev = 15;
|
|
18338
18372
|
_context2.t0 = _context2["catch"](3);
|
|
18339
18373
|
gasEstimationError = _context2.t0;
|
|
18340
18374
|
|
|
18341
|
-
case
|
|
18375
|
+
case 18:
|
|
18342
18376
|
return _context2.abrupt("return", _extends({
|
|
18343
18377
|
gas: gas,
|
|
18344
18378
|
gasEstimationError: gasEstimationError
|
|
18345
18379
|
}, txInfoData));
|
|
18346
18380
|
|
|
18347
|
-
case
|
|
18381
|
+
case 19:
|
|
18348
18382
|
case "end":
|
|
18349
18383
|
return _context2.stop();
|
|
18350
18384
|
}
|
|
18351
18385
|
}
|
|
18352
|
-
}, _callee2, null, [[3,
|
|
18386
|
+
}, _callee2, null, [[3, 15]]);
|
|
18353
18387
|
}));
|
|
18354
18388
|
|
|
18355
|
-
return function getGasEstimateData(_x12, _x13, _x14) {
|
|
18389
|
+
return function getGasEstimateData(_x12, _x13, _x14, _x15, _x16) {
|
|
18356
18390
|
return _ref.apply(this, arguments);
|
|
18357
18391
|
};
|
|
18358
18392
|
}();
|
|
@@ -18394,7 +18428,7 @@ var getPoolTxOrGasEstimate = /*#__PURE__*/function () {
|
|
|
18394
18428
|
}
|
|
18395
18429
|
|
|
18396
18430
|
_context3.next = 8;
|
|
18397
|
-
return getGasEstimateData(pool.signer.estimateGas, txInfoData, txOptions);
|
|
18431
|
+
return getGasEstimateData(pool, pool.signer.estimateGas.bind(pool.signer), txInfoData, txOptions, sdkOptions);
|
|
18398
18432
|
|
|
18399
18433
|
case 8:
|
|
18400
18434
|
return _context3.abrupt("return", _context3.sent);
|
|
@@ -18420,7 +18454,7 @@ var getPoolTxOrGasEstimate = /*#__PURE__*/function () {
|
|
|
18420
18454
|
}
|
|
18421
18455
|
|
|
18422
18456
|
_context3.next = 19;
|
|
18423
|
-
return getGasEstimateData(pool.poolLogic.estimateGas.execTransaction, txInfoData, txOptions);
|
|
18457
|
+
return getGasEstimateData(pool, pool.poolLogic.estimateGas.execTransaction, txInfoData, txOptions, sdkOptions);
|
|
18424
18458
|
|
|
18425
18459
|
case 19:
|
|
18426
18460
|
return _context3.abrupt("return", _context3.sent);
|
|
@@ -18440,7 +18474,7 @@ var getPoolTxOrGasEstimate = /*#__PURE__*/function () {
|
|
|
18440
18474
|
}, _callee3);
|
|
18441
18475
|
}));
|
|
18442
18476
|
|
|
18443
|
-
return function getPoolTxOrGasEstimate(
|
|
18477
|
+
return function getPoolTxOrGasEstimate(_x17, _x18, _x19) {
|
|
18444
18478
|
return _ref2.apply(this, arguments);
|
|
18445
18479
|
};
|
|
18446
18480
|
}();
|
|
@@ -29403,6 +29437,65 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29403
29437
|
|
|
29404
29438
|
return setTrader;
|
|
29405
29439
|
}()
|
|
29440
|
+
/**
|
|
29441
|
+
* Sets a pool private or public
|
|
29442
|
+
* @param {boolean} _private True for private, false for public
|
|
29443
|
+
* @param {any} options Transaction options
|
|
29444
|
+
* @param {boolean} estimateGas Simulate/estimate gas
|
|
29445
|
+
* @returns {Promise<any>} Transaction
|
|
29446
|
+
*/
|
|
29447
|
+
;
|
|
29448
|
+
|
|
29449
|
+
_proto.setPrivate =
|
|
29450
|
+
/*#__PURE__*/
|
|
29451
|
+
function () {
|
|
29452
|
+
var _setPrivate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee26(_private, options, estimateGas) {
|
|
29453
|
+
var tx;
|
|
29454
|
+
return runtime_1.wrap(function _callee26$(_context26) {
|
|
29455
|
+
while (1) {
|
|
29456
|
+
switch (_context26.prev = _context26.next) {
|
|
29457
|
+
case 0:
|
|
29458
|
+
if (options === void 0) {
|
|
29459
|
+
options = null;
|
|
29460
|
+
}
|
|
29461
|
+
|
|
29462
|
+
if (estimateGas === void 0) {
|
|
29463
|
+
estimateGas = false;
|
|
29464
|
+
}
|
|
29465
|
+
|
|
29466
|
+
if (!estimateGas) {
|
|
29467
|
+
_context26.next = 6;
|
|
29468
|
+
break;
|
|
29469
|
+
}
|
|
29470
|
+
|
|
29471
|
+
_context26.next = 5;
|
|
29472
|
+
return this.managerLogic.estimateGas.setPoolPrivate(_private, options);
|
|
29473
|
+
|
|
29474
|
+
case 5:
|
|
29475
|
+
return _context26.abrupt("return", _context26.sent);
|
|
29476
|
+
|
|
29477
|
+
case 6:
|
|
29478
|
+
_context26.next = 8;
|
|
29479
|
+
return this.managerLogic.setPoolPrivate(_private, options);
|
|
29480
|
+
|
|
29481
|
+
case 8:
|
|
29482
|
+
tx = _context26.sent;
|
|
29483
|
+
return _context26.abrupt("return", tx);
|
|
29484
|
+
|
|
29485
|
+
case 10:
|
|
29486
|
+
case "end":
|
|
29487
|
+
return _context26.stop();
|
|
29488
|
+
}
|
|
29489
|
+
}
|
|
29490
|
+
}, _callee26, this);
|
|
29491
|
+
}));
|
|
29492
|
+
|
|
29493
|
+
function setPrivate(_x117, _x118, _x119) {
|
|
29494
|
+
return _setPrivate.apply(this, arguments);
|
|
29495
|
+
}
|
|
29496
|
+
|
|
29497
|
+
return setPrivate;
|
|
29498
|
+
}()
|
|
29406
29499
|
/**
|
|
29407
29500
|
* Invest into a Balancer pool
|
|
29408
29501
|
* @param {string} poolId Balancer pool id
|
|
@@ -29417,11 +29510,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29417
29510
|
_proto.joinBalancerPool =
|
|
29418
29511
|
/*#__PURE__*/
|
|
29419
29512
|
function () {
|
|
29420
|
-
var _joinBalancerPool = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29513
|
+
var _joinBalancerPool = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee27(poolId, assets, amountsIn, options, sdkOptions) {
|
|
29421
29514
|
var joinPoolTxData, tx;
|
|
29422
|
-
return runtime_1.wrap(function
|
|
29515
|
+
return runtime_1.wrap(function _callee27$(_context27) {
|
|
29423
29516
|
while (1) {
|
|
29424
|
-
switch (
|
|
29517
|
+
switch (_context27.prev = _context27.next) {
|
|
29425
29518
|
case 0:
|
|
29426
29519
|
if (options === void 0) {
|
|
29427
29520
|
options = null;
|
|
@@ -29434,22 +29527,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29434
29527
|
}
|
|
29435
29528
|
|
|
29436
29529
|
joinPoolTxData = this.utils.getBalancerJoinPoolTx(this, poolId, assets, amountsIn);
|
|
29437
|
-
|
|
29530
|
+
_context27.next = 5;
|
|
29438
29531
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.BALANCER], joinPoolTxData, options], sdkOptions);
|
|
29439
29532
|
|
|
29440
29533
|
case 5:
|
|
29441
|
-
tx =
|
|
29442
|
-
return
|
|
29534
|
+
tx = _context27.sent;
|
|
29535
|
+
return _context27.abrupt("return", tx);
|
|
29443
29536
|
|
|
29444
29537
|
case 7:
|
|
29445
29538
|
case "end":
|
|
29446
|
-
return
|
|
29539
|
+
return _context27.stop();
|
|
29447
29540
|
}
|
|
29448
29541
|
}
|
|
29449
|
-
},
|
|
29542
|
+
}, _callee27, this);
|
|
29450
29543
|
}));
|
|
29451
29544
|
|
|
29452
|
-
function joinBalancerPool(
|
|
29545
|
+
function joinBalancerPool(_x120, _x121, _x122, _x123, _x124) {
|
|
29453
29546
|
return _joinBalancerPool.apply(this, arguments);
|
|
29454
29547
|
}
|
|
29455
29548
|
|
|
@@ -29470,11 +29563,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29470
29563
|
_proto.exitBalancerPool =
|
|
29471
29564
|
/*#__PURE__*/
|
|
29472
29565
|
function () {
|
|
29473
|
-
var _exitBalancerPool = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29566
|
+
var _exitBalancerPool = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee28(poolId, assets, amount, singleExitAssetIndex, options, sdkOptions) {
|
|
29474
29567
|
var exitPoolTxData, tx;
|
|
29475
|
-
return runtime_1.wrap(function
|
|
29568
|
+
return runtime_1.wrap(function _callee28$(_context28) {
|
|
29476
29569
|
while (1) {
|
|
29477
|
-
switch (
|
|
29570
|
+
switch (_context28.prev = _context28.next) {
|
|
29478
29571
|
case 0:
|
|
29479
29572
|
if (singleExitAssetIndex === void 0) {
|
|
29480
29573
|
singleExitAssetIndex = null;
|
|
@@ -29491,22 +29584,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29491
29584
|
}
|
|
29492
29585
|
|
|
29493
29586
|
exitPoolTxData = this.utils.getBalancerExitPoolTx(this, poolId, assets, singleExitAssetIndex, amount);
|
|
29494
|
-
|
|
29587
|
+
_context28.next = 6;
|
|
29495
29588
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.BALANCER], exitPoolTxData, options], sdkOptions);
|
|
29496
29589
|
|
|
29497
29590
|
case 6:
|
|
29498
|
-
tx =
|
|
29499
|
-
return
|
|
29591
|
+
tx = _context28.sent;
|
|
29592
|
+
return _context28.abrupt("return", tx);
|
|
29500
29593
|
|
|
29501
29594
|
case 8:
|
|
29502
29595
|
case "end":
|
|
29503
|
-
return
|
|
29596
|
+
return _context28.stop();
|
|
29504
29597
|
}
|
|
29505
29598
|
}
|
|
29506
|
-
},
|
|
29599
|
+
}, _callee28, this);
|
|
29507
29600
|
}));
|
|
29508
29601
|
|
|
29509
|
-
function exitBalancerPool(
|
|
29602
|
+
function exitBalancerPool(_x125, _x126, _x127, _x128, _x129, _x130) {
|
|
29510
29603
|
return _exitBalancerPool.apply(this, arguments);
|
|
29511
29604
|
}
|
|
29512
29605
|
|
|
@@ -29524,11 +29617,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29524
29617
|
_proto.harvestAaveRewards =
|
|
29525
29618
|
/*#__PURE__*/
|
|
29526
29619
|
function () {
|
|
29527
|
-
var _harvestAaveRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29620
|
+
var _harvestAaveRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee29(assets, options, sdkOptions) {
|
|
29528
29621
|
var aaveIncentivesAddress, iAaveIncentivesController, aaveIncentivesController, amount, claimTxData, tx;
|
|
29529
|
-
return runtime_1.wrap(function
|
|
29622
|
+
return runtime_1.wrap(function _callee29$(_context29) {
|
|
29530
29623
|
while (1) {
|
|
29531
|
-
switch (
|
|
29624
|
+
switch (_context29.prev = _context29.next) {
|
|
29532
29625
|
case 0:
|
|
29533
29626
|
if (options === void 0) {
|
|
29534
29627
|
options = null;
|
|
@@ -29543,28 +29636,28 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29543
29636
|
aaveIncentivesAddress = stakingAddress[this.network][Dapp.AAVE];
|
|
29544
29637
|
iAaveIncentivesController = new ethers.utils.Interface(IAaveIncentivesController.abi);
|
|
29545
29638
|
aaveIncentivesController = new ethers.Contract(aaveIncentivesAddress, iAaveIncentivesController, this.signer);
|
|
29546
|
-
|
|
29639
|
+
_context29.next = 7;
|
|
29547
29640
|
return aaveIncentivesController.getUserUnclaimedRewards(this.address);
|
|
29548
29641
|
|
|
29549
29642
|
case 7:
|
|
29550
|
-
amount =
|
|
29643
|
+
amount = _context29.sent;
|
|
29551
29644
|
claimTxData = iAaveIncentivesController.encodeFunctionData(Transaction.CLAIM_REWARDS, [assets, amount, this.address]);
|
|
29552
|
-
|
|
29645
|
+
_context29.next = 11;
|
|
29553
29646
|
return getPoolTxOrGasEstimate(this, [aaveIncentivesAddress, claimTxData, options], sdkOptions);
|
|
29554
29647
|
|
|
29555
29648
|
case 11:
|
|
29556
|
-
tx =
|
|
29557
|
-
return
|
|
29649
|
+
tx = _context29.sent;
|
|
29650
|
+
return _context29.abrupt("return", tx);
|
|
29558
29651
|
|
|
29559
29652
|
case 13:
|
|
29560
29653
|
case "end":
|
|
29561
|
-
return
|
|
29654
|
+
return _context29.stop();
|
|
29562
29655
|
}
|
|
29563
29656
|
}
|
|
29564
|
-
},
|
|
29657
|
+
}, _callee29, this);
|
|
29565
29658
|
}));
|
|
29566
29659
|
|
|
29567
|
-
function harvestAaveRewards(
|
|
29660
|
+
function harvestAaveRewards(_x131, _x132, _x133) {
|
|
29568
29661
|
return _harvestAaveRewards.apply(this, arguments);
|
|
29569
29662
|
}
|
|
29570
29663
|
|
|
@@ -29583,11 +29676,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29583
29676
|
_proto.harvestAaveV3Rewards =
|
|
29584
29677
|
/*#__PURE__*/
|
|
29585
29678
|
function () {
|
|
29586
|
-
var _harvestAaveV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29679
|
+
var _harvestAaveV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee30(assets, rewardAsset, options, sdkOptions) {
|
|
29587
29680
|
var claimTxData, tx;
|
|
29588
|
-
return runtime_1.wrap(function
|
|
29681
|
+
return runtime_1.wrap(function _callee30$(_context30) {
|
|
29589
29682
|
while (1) {
|
|
29590
|
-
switch (
|
|
29683
|
+
switch (_context30.prev = _context30.next) {
|
|
29591
29684
|
case 0:
|
|
29592
29685
|
if (options === void 0) {
|
|
29593
29686
|
options = null;
|
|
@@ -29599,27 +29692,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29599
29692
|
};
|
|
29600
29693
|
}
|
|
29601
29694
|
|
|
29602
|
-
|
|
29695
|
+
_context30.next = 4;
|
|
29603
29696
|
return getAaveV3ClaimTxData(this, assets, rewardAsset);
|
|
29604
29697
|
|
|
29605
29698
|
case 4:
|
|
29606
|
-
claimTxData =
|
|
29607
|
-
|
|
29699
|
+
claimTxData = _context30.sent;
|
|
29700
|
+
_context30.next = 7;
|
|
29608
29701
|
return getPoolTxOrGasEstimate(this, [stakingAddress[this.network][Dapp.AAVEV3], claimTxData, options], sdkOptions);
|
|
29609
29702
|
|
|
29610
29703
|
case 7:
|
|
29611
|
-
tx =
|
|
29612
|
-
return
|
|
29704
|
+
tx = _context30.sent;
|
|
29705
|
+
return _context30.abrupt("return", tx);
|
|
29613
29706
|
|
|
29614
29707
|
case 9:
|
|
29615
29708
|
case "end":
|
|
29616
|
-
return
|
|
29709
|
+
return _context30.stop();
|
|
29617
29710
|
}
|
|
29618
29711
|
}
|
|
29619
|
-
},
|
|
29712
|
+
}, _callee30, this);
|
|
29620
29713
|
}));
|
|
29621
29714
|
|
|
29622
|
-
function harvestAaveV3Rewards(
|
|
29715
|
+
function harvestAaveV3Rewards(_x134, _x135, _x136, _x137) {
|
|
29623
29716
|
return _harvestAaveV3Rewards.apply(this, arguments);
|
|
29624
29717
|
}
|
|
29625
29718
|
|
|
@@ -29637,11 +29730,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29637
29730
|
_proto.harvestCompoundV3Rewards =
|
|
29638
29731
|
/*#__PURE__*/
|
|
29639
29732
|
function () {
|
|
29640
|
-
var _harvestCompoundV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29733
|
+
var _harvestCompoundV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee31(asset, options, sdkOptions) {
|
|
29641
29734
|
var claimTxData, tx;
|
|
29642
|
-
return runtime_1.wrap(function
|
|
29735
|
+
return runtime_1.wrap(function _callee31$(_context31) {
|
|
29643
29736
|
while (1) {
|
|
29644
|
-
switch (
|
|
29737
|
+
switch (_context31.prev = _context31.next) {
|
|
29645
29738
|
case 0:
|
|
29646
29739
|
if (options === void 0) {
|
|
29647
29740
|
options = null;
|
|
@@ -29653,27 +29746,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29653
29746
|
};
|
|
29654
29747
|
}
|
|
29655
29748
|
|
|
29656
|
-
|
|
29749
|
+
_context31.next = 4;
|
|
29657
29750
|
return getCompoundV3ClaimTxData(this, asset);
|
|
29658
29751
|
|
|
29659
29752
|
case 4:
|
|
29660
|
-
claimTxData =
|
|
29661
|
-
|
|
29753
|
+
claimTxData = _context31.sent;
|
|
29754
|
+
_context31.next = 7;
|
|
29662
29755
|
return getPoolTxOrGasEstimate(this, [stakingAddress[this.network][Dapp.COMPOUNDV3], claimTxData, options], sdkOptions);
|
|
29663
29756
|
|
|
29664
29757
|
case 7:
|
|
29665
|
-
tx =
|
|
29666
|
-
return
|
|
29758
|
+
tx = _context31.sent;
|
|
29759
|
+
return _context31.abrupt("return", tx);
|
|
29667
29760
|
|
|
29668
29761
|
case 9:
|
|
29669
29762
|
case "end":
|
|
29670
|
-
return
|
|
29763
|
+
return _context31.stop();
|
|
29671
29764
|
}
|
|
29672
29765
|
}
|
|
29673
|
-
},
|
|
29766
|
+
}, _callee31, this);
|
|
29674
29767
|
}));
|
|
29675
29768
|
|
|
29676
|
-
function harvestCompoundV3Rewards(
|
|
29769
|
+
function harvestCompoundV3Rewards(_x138, _x139, _x140) {
|
|
29677
29770
|
return _harvestCompoundV3Rewards.apply(this, arguments);
|
|
29678
29771
|
}
|
|
29679
29772
|
|
|
@@ -29700,11 +29793,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29700
29793
|
_proto.addLiquidityUniswapV3 =
|
|
29701
29794
|
/*#__PURE__*/
|
|
29702
29795
|
function () {
|
|
29703
|
-
var _addLiquidityUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29796
|
+
var _addLiquidityUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee32(dapp, assetA, assetB, amountA, amountB, minPrice, maxPrice, minTick, maxTick, feeAmountOrTickSpacing, options, sdkOptions) {
|
|
29704
29797
|
var mintTxData, tx;
|
|
29705
|
-
return runtime_1.wrap(function
|
|
29798
|
+
return runtime_1.wrap(function _callee32$(_context32) {
|
|
29706
29799
|
while (1) {
|
|
29707
|
-
switch (
|
|
29800
|
+
switch (_context32.prev = _context32.next) {
|
|
29708
29801
|
case 0:
|
|
29709
29802
|
if (options === void 0) {
|
|
29710
29803
|
options = null;
|
|
@@ -29717,7 +29810,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29717
29810
|
}
|
|
29718
29811
|
|
|
29719
29812
|
if (!((minPrice === null || maxPrice === null) && (minTick === null || maxTick === null))) {
|
|
29720
|
-
|
|
29813
|
+
_context32.next = 4;
|
|
29721
29814
|
break;
|
|
29722
29815
|
}
|
|
29723
29816
|
|
|
@@ -29725,34 +29818,34 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29725
29818
|
|
|
29726
29819
|
case 4:
|
|
29727
29820
|
if (!((minPrice || maxPrice) && dapp !== Dapp.UNISWAPV3)) {
|
|
29728
|
-
|
|
29821
|
+
_context32.next = 6;
|
|
29729
29822
|
break;
|
|
29730
29823
|
}
|
|
29731
29824
|
|
|
29732
29825
|
throw new Error("no price conversion for Aerodrome/Velodrome CL");
|
|
29733
29826
|
|
|
29734
29827
|
case 6:
|
|
29735
|
-
|
|
29828
|
+
_context32.next = 8;
|
|
29736
29829
|
return getUniswapV3MintTxData(dapp, this, assetA, assetB, amountA, amountB, minPrice, maxPrice, minTick, maxTick, feeAmountOrTickSpacing);
|
|
29737
29830
|
|
|
29738
29831
|
case 8:
|
|
29739
|
-
mintTxData =
|
|
29740
|
-
|
|
29832
|
+
mintTxData = _context32.sent;
|
|
29833
|
+
_context32.next = 11;
|
|
29741
29834
|
return getPoolTxOrGasEstimate(this, [nonfungiblePositionManagerAddress[this.network][dapp], mintTxData, options], sdkOptions);
|
|
29742
29835
|
|
|
29743
29836
|
case 11:
|
|
29744
|
-
tx =
|
|
29745
|
-
return
|
|
29837
|
+
tx = _context32.sent;
|
|
29838
|
+
return _context32.abrupt("return", tx);
|
|
29746
29839
|
|
|
29747
29840
|
case 13:
|
|
29748
29841
|
case "end":
|
|
29749
|
-
return
|
|
29842
|
+
return _context32.stop();
|
|
29750
29843
|
}
|
|
29751
29844
|
}
|
|
29752
|
-
},
|
|
29845
|
+
}, _callee32, this);
|
|
29753
29846
|
}));
|
|
29754
29847
|
|
|
29755
|
-
function addLiquidityUniswapV3(
|
|
29848
|
+
function addLiquidityUniswapV3(_x141, _x142, _x143, _x144, _x145, _x146, _x147, _x148, _x149, _x150, _x151, _x152) {
|
|
29756
29849
|
return _addLiquidityUniswapV.apply(this, arguments);
|
|
29757
29850
|
}
|
|
29758
29851
|
|
|
@@ -29772,11 +29865,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29772
29865
|
_proto.decreaseLiquidity =
|
|
29773
29866
|
/*#__PURE__*/
|
|
29774
29867
|
function () {
|
|
29775
|
-
var _decreaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29868
|
+
var _decreaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee33(dapp, tokenId, amount, options, sdkOptions) {
|
|
29776
29869
|
var dappAddress, isStaked, txData, tokenIdOwner, tx;
|
|
29777
|
-
return runtime_1.wrap(function
|
|
29870
|
+
return runtime_1.wrap(function _callee33$(_context33) {
|
|
29778
29871
|
while (1) {
|
|
29779
|
-
switch (
|
|
29872
|
+
switch (_context33.prev = _context33.next) {
|
|
29780
29873
|
case 0:
|
|
29781
29874
|
if (amount === void 0) {
|
|
29782
29875
|
amount = 100;
|
|
@@ -29793,20 +29886,20 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29793
29886
|
}
|
|
29794
29887
|
|
|
29795
29888
|
isStaked = false;
|
|
29796
|
-
|
|
29797
|
-
|
|
29889
|
+
_context33.t0 = dapp;
|
|
29890
|
+
_context33.next = _context33.t0 === Dapp.UNISWAPV3 ? 7 : _context33.t0 === Dapp.RAMSESCL ? 7 : _context33.t0 === Dapp.VELODROMECL ? 9 : _context33.t0 === Dapp.AERODROMECL ? 9 : _context33.t0 === Dapp.PANCAKECL ? 9 : _context33.t0 === Dapp.ARRAKIS ? 14 : 16;
|
|
29798
29891
|
break;
|
|
29799
29892
|
|
|
29800
29893
|
case 7:
|
|
29801
29894
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
29802
|
-
return
|
|
29895
|
+
return _context33.abrupt("break", 17);
|
|
29803
29896
|
|
|
29804
29897
|
case 9:
|
|
29805
|
-
|
|
29898
|
+
_context33.next = 11;
|
|
29806
29899
|
return getClOwner(this, dapp, tokenId);
|
|
29807
29900
|
|
|
29808
29901
|
case 11:
|
|
29809
|
-
tokenIdOwner =
|
|
29902
|
+
tokenIdOwner = _context33.sent;
|
|
29810
29903
|
|
|
29811
29904
|
if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
|
|
29812
29905
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
@@ -29816,49 +29909,49 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29816
29909
|
isStaked = true;
|
|
29817
29910
|
}
|
|
29818
29911
|
|
|
29819
|
-
return
|
|
29912
|
+
return _context33.abrupt("break", 17);
|
|
29820
29913
|
|
|
29821
29914
|
case 14:
|
|
29822
29915
|
dappAddress = routerAddress[this.network][dapp];
|
|
29823
|
-
return
|
|
29916
|
+
return _context33.abrupt("break", 17);
|
|
29824
29917
|
|
|
29825
29918
|
case 16:
|
|
29826
29919
|
throw new Error("dapp not supported");
|
|
29827
29920
|
|
|
29828
29921
|
case 17:
|
|
29829
29922
|
if (!(!isStaked || dapp === Dapp.PANCAKECL)) {
|
|
29830
|
-
|
|
29923
|
+
_context33.next = 23;
|
|
29831
29924
|
break;
|
|
29832
29925
|
}
|
|
29833
29926
|
|
|
29834
|
-
|
|
29927
|
+
_context33.next = 20;
|
|
29835
29928
|
return getDecreaseLiquidityTxData(this, dapp, tokenId, amount, isStaked);
|
|
29836
29929
|
|
|
29837
29930
|
case 20:
|
|
29838
|
-
txData =
|
|
29839
|
-
|
|
29931
|
+
txData = _context33.sent;
|
|
29932
|
+
_context33.next = 24;
|
|
29840
29933
|
break;
|
|
29841
29934
|
|
|
29842
29935
|
case 23:
|
|
29843
29936
|
throw new Error("unsupported decreaseStakedLiquidity: unstake first to decrease lp");
|
|
29844
29937
|
|
|
29845
29938
|
case 24:
|
|
29846
|
-
|
|
29939
|
+
_context33.next = 26;
|
|
29847
29940
|
return getPoolTxOrGasEstimate(this, [dappAddress, txData, options], sdkOptions);
|
|
29848
29941
|
|
|
29849
29942
|
case 26:
|
|
29850
|
-
tx =
|
|
29851
|
-
return
|
|
29943
|
+
tx = _context33.sent;
|
|
29944
|
+
return _context33.abrupt("return", tx);
|
|
29852
29945
|
|
|
29853
29946
|
case 28:
|
|
29854
29947
|
case "end":
|
|
29855
|
-
return
|
|
29948
|
+
return _context33.stop();
|
|
29856
29949
|
}
|
|
29857
29950
|
}
|
|
29858
|
-
},
|
|
29951
|
+
}, _callee33, this);
|
|
29859
29952
|
}));
|
|
29860
29953
|
|
|
29861
|
-
function decreaseLiquidity(
|
|
29954
|
+
function decreaseLiquidity(_x153, _x154, _x155, _x156, _x157) {
|
|
29862
29955
|
return _decreaseLiquidity.apply(this, arguments);
|
|
29863
29956
|
}
|
|
29864
29957
|
|
|
@@ -29879,11 +29972,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29879
29972
|
_proto.increaseLiquidity =
|
|
29880
29973
|
/*#__PURE__*/
|
|
29881
29974
|
function () {
|
|
29882
|
-
var _increaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
29975
|
+
var _increaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee34(dapp, tokenId, amountA, amountB, options, sdkOptions) {
|
|
29883
29976
|
var dappAddress, isStaked, txData, tokenIdOwner, tx;
|
|
29884
|
-
return runtime_1.wrap(function
|
|
29977
|
+
return runtime_1.wrap(function _callee34$(_context34) {
|
|
29885
29978
|
while (1) {
|
|
29886
|
-
switch (
|
|
29979
|
+
switch (_context34.prev = _context34.next) {
|
|
29887
29980
|
case 0:
|
|
29888
29981
|
if (options === void 0) {
|
|
29889
29982
|
options = null;
|
|
@@ -29896,20 +29989,20 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29896
29989
|
}
|
|
29897
29990
|
|
|
29898
29991
|
isStaked = false;
|
|
29899
|
-
|
|
29900
|
-
|
|
29992
|
+
_context34.t0 = dapp;
|
|
29993
|
+
_context34.next = _context34.t0 === Dapp.UNISWAPV3 ? 6 : _context34.t0 === Dapp.RAMSESCL ? 6 : _context34.t0 === Dapp.VELODROMECL ? 8 : _context34.t0 === Dapp.AERODROMECL ? 8 : _context34.t0 === Dapp.PANCAKECL ? 8 : _context34.t0 === Dapp.ARRAKIS ? 13 : 15;
|
|
29901
29994
|
break;
|
|
29902
29995
|
|
|
29903
29996
|
case 6:
|
|
29904
29997
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
29905
|
-
return
|
|
29998
|
+
return _context34.abrupt("break", 16);
|
|
29906
29999
|
|
|
29907
30000
|
case 8:
|
|
29908
|
-
|
|
30001
|
+
_context34.next = 10;
|
|
29909
30002
|
return getClOwner(this, dapp, tokenId);
|
|
29910
30003
|
|
|
29911
30004
|
case 10:
|
|
29912
|
-
tokenIdOwner =
|
|
30005
|
+
tokenIdOwner = _context34.sent;
|
|
29913
30006
|
|
|
29914
30007
|
if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
|
|
29915
30008
|
dappAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
@@ -29919,49 +30012,49 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29919
30012
|
isStaked = true;
|
|
29920
30013
|
}
|
|
29921
30014
|
|
|
29922
|
-
return
|
|
30015
|
+
return _context34.abrupt("break", 16);
|
|
29923
30016
|
|
|
29924
30017
|
case 13:
|
|
29925
30018
|
dappAddress = routerAddress[this.network][dapp];
|
|
29926
|
-
return
|
|
30019
|
+
return _context34.abrupt("break", 16);
|
|
29927
30020
|
|
|
29928
30021
|
case 15:
|
|
29929
30022
|
throw new Error("dapp not supported");
|
|
29930
30023
|
|
|
29931
30024
|
case 16:
|
|
29932
30025
|
if (!(!isStaked || dapp === Dapp.PANCAKECL)) {
|
|
29933
|
-
|
|
30026
|
+
_context34.next = 22;
|
|
29934
30027
|
break;
|
|
29935
30028
|
}
|
|
29936
30029
|
|
|
29937
|
-
|
|
30030
|
+
_context34.next = 19;
|
|
29938
30031
|
return getIncreaseLiquidityTxData(this, dapp, tokenId, amountA, amountB);
|
|
29939
30032
|
|
|
29940
30033
|
case 19:
|
|
29941
|
-
txData =
|
|
29942
|
-
|
|
30034
|
+
txData = _context34.sent;
|
|
30035
|
+
_context34.next = 23;
|
|
29943
30036
|
break;
|
|
29944
30037
|
|
|
29945
30038
|
case 22:
|
|
29946
30039
|
throw new Error("unsupported increaseStakedLiquidity: unstake first to increase lp");
|
|
29947
30040
|
|
|
29948
30041
|
case 23:
|
|
29949
|
-
|
|
30042
|
+
_context34.next = 25;
|
|
29950
30043
|
return getPoolTxOrGasEstimate(this, [dappAddress, txData, options], sdkOptions);
|
|
29951
30044
|
|
|
29952
30045
|
case 25:
|
|
29953
|
-
tx =
|
|
29954
|
-
return
|
|
30046
|
+
tx = _context34.sent;
|
|
30047
|
+
return _context34.abrupt("return", tx);
|
|
29955
30048
|
|
|
29956
30049
|
case 27:
|
|
29957
30050
|
case "end":
|
|
29958
|
-
return
|
|
30051
|
+
return _context34.stop();
|
|
29959
30052
|
}
|
|
29960
30053
|
}
|
|
29961
|
-
},
|
|
30054
|
+
}, _callee34, this);
|
|
29962
30055
|
}));
|
|
29963
30056
|
|
|
29964
|
-
function increaseLiquidity(
|
|
30057
|
+
function increaseLiquidity(_x158, _x159, _x160, _x161, _x162, _x163) {
|
|
29965
30058
|
return _increaseLiquidity.apply(this, arguments);
|
|
29966
30059
|
}
|
|
29967
30060
|
|
|
@@ -29980,11 +30073,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29980
30073
|
_proto.claimFees =
|
|
29981
30074
|
/*#__PURE__*/
|
|
29982
30075
|
function () {
|
|
29983
|
-
var _claimFees = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30076
|
+
var _claimFees = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee35(dapp, tokenId, options, sdkOptions) {
|
|
29984
30077
|
var txData, contractAddress, iNonfungiblePositionManager, abi, tokenIdOwner, tx;
|
|
29985
|
-
return runtime_1.wrap(function
|
|
30078
|
+
return runtime_1.wrap(function _callee35$(_context35) {
|
|
29986
30079
|
while (1) {
|
|
29987
|
-
switch (
|
|
30080
|
+
switch (_context35.prev = _context35.next) {
|
|
29988
30081
|
case 0:
|
|
29989
30082
|
if (options === void 0) {
|
|
29990
30083
|
options = null;
|
|
@@ -29997,37 +30090,37 @@ var Pool = /*#__PURE__*/function () {
|
|
|
29997
30090
|
}
|
|
29998
30091
|
|
|
29999
30092
|
iNonfungiblePositionManager = new ethers.utils.Interface(INonfungiblePositionManager.abi);
|
|
30000
|
-
|
|
30001
|
-
|
|
30093
|
+
_context35.t0 = dapp;
|
|
30094
|
+
_context35.next = _context35.t0 === Dapp.UNISWAPV3 ? 6 : _context35.t0 === Dapp.RAMSESCL ? 6 : _context35.t0 === Dapp.ARRAKIS ? 9 : _context35.t0 === Dapp.BALANCER ? 9 : _context35.t0 === Dapp.VELODROME ? 13 : _context35.t0 === Dapp.RAMSES ? 13 : _context35.t0 === Dapp.VELODROMEV2 ? 16 : _context35.t0 === Dapp.AERODROME ? 16 : _context35.t0 === Dapp.VELODROMECL ? 19 : _context35.t0 === Dapp.AERODROMECL ? 19 : _context35.t0 === Dapp.PANCAKECL ? 19 : 24;
|
|
30002
30095
|
break;
|
|
30003
30096
|
|
|
30004
30097
|
case 6:
|
|
30005
30098
|
contractAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
30006
30099
|
txData = iNonfungiblePositionManager.encodeFunctionData(Transaction.COLLECT, [[tokenId, this.address, MaxUint128, MaxUint128]]);
|
|
30007
|
-
return
|
|
30100
|
+
return _context35.abrupt("break", 25);
|
|
30008
30101
|
|
|
30009
30102
|
case 9:
|
|
30010
30103
|
contractAddress = tokenId;
|
|
30011
30104
|
abi = new ethers.utils.Interface(ILiquidityGaugeV4.abi);
|
|
30012
30105
|
txData = abi.encodeFunctionData("claim_rewards()", []);
|
|
30013
|
-
return
|
|
30106
|
+
return _context35.abrupt("break", 25);
|
|
30014
30107
|
|
|
30015
30108
|
case 13:
|
|
30016
30109
|
contractAddress = tokenId;
|
|
30017
30110
|
txData = getVelodromeClaimTxData(this, tokenId, false);
|
|
30018
|
-
return
|
|
30111
|
+
return _context35.abrupt("break", 25);
|
|
30019
30112
|
|
|
30020
30113
|
case 16:
|
|
30021
30114
|
contractAddress = tokenId;
|
|
30022
30115
|
txData = getVelodromeClaimTxData(this, tokenId, true);
|
|
30023
|
-
return
|
|
30116
|
+
return _context35.abrupt("break", 25);
|
|
30024
30117
|
|
|
30025
30118
|
case 19:
|
|
30026
|
-
|
|
30119
|
+
_context35.next = 21;
|
|
30027
30120
|
return getClOwner(this, dapp, tokenId);
|
|
30028
30121
|
|
|
30029
30122
|
case 21:
|
|
30030
|
-
tokenIdOwner =
|
|
30123
|
+
tokenIdOwner = _context35.sent;
|
|
30031
30124
|
|
|
30032
30125
|
if (tokenIdOwner.toLowerCase() === this.address.toLowerCase()) {
|
|
30033
30126
|
contractAddress = nonfungiblePositionManagerAddress[this.network][dapp];
|
|
@@ -30043,28 +30136,28 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30043
30136
|
}
|
|
30044
30137
|
}
|
|
30045
30138
|
|
|
30046
|
-
return
|
|
30139
|
+
return _context35.abrupt("break", 25);
|
|
30047
30140
|
|
|
30048
30141
|
case 24:
|
|
30049
30142
|
throw new Error("dapp not supported");
|
|
30050
30143
|
|
|
30051
30144
|
case 25:
|
|
30052
|
-
|
|
30145
|
+
_context35.next = 27;
|
|
30053
30146
|
return getPoolTxOrGasEstimate(this, [contractAddress, txData, options], sdkOptions);
|
|
30054
30147
|
|
|
30055
30148
|
case 27:
|
|
30056
|
-
tx =
|
|
30057
|
-
return
|
|
30149
|
+
tx = _context35.sent;
|
|
30150
|
+
return _context35.abrupt("return", tx);
|
|
30058
30151
|
|
|
30059
30152
|
case 29:
|
|
30060
30153
|
case "end":
|
|
30061
|
-
return
|
|
30154
|
+
return _context35.stop();
|
|
30062
30155
|
}
|
|
30063
30156
|
}
|
|
30064
|
-
},
|
|
30157
|
+
}, _callee35, this);
|
|
30065
30158
|
}));
|
|
30066
30159
|
|
|
30067
|
-
function claimFees(
|
|
30160
|
+
function claimFees(_x164, _x165, _x166, _x167) {
|
|
30068
30161
|
return _claimFees.apply(this, arguments);
|
|
30069
30162
|
}
|
|
30070
30163
|
|
|
@@ -30084,11 +30177,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30084
30177
|
_proto.getRewards =
|
|
30085
30178
|
/*#__PURE__*/
|
|
30086
30179
|
function () {
|
|
30087
|
-
var _getRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30180
|
+
var _getRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(dapp, tokenId, rewards, options, sdkOptions) {
|
|
30088
30181
|
var tx;
|
|
30089
|
-
return runtime_1.wrap(function
|
|
30182
|
+
return runtime_1.wrap(function _callee36$(_context36) {
|
|
30090
30183
|
while (1) {
|
|
30091
|
-
switch (
|
|
30184
|
+
switch (_context36.prev = _context36.next) {
|
|
30092
30185
|
case 0:
|
|
30093
30186
|
if (options === void 0) {
|
|
30094
30187
|
options = null;
|
|
@@ -30100,22 +30193,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30100
30193
|
};
|
|
30101
30194
|
}
|
|
30102
30195
|
|
|
30103
|
-
|
|
30196
|
+
_context36.next = 4;
|
|
30104
30197
|
return getPoolTxOrGasEstimate(this, [nonfungiblePositionManagerAddress[this.network][dapp], getRewardsTxDta(tokenId, rewards), options], sdkOptions);
|
|
30105
30198
|
|
|
30106
30199
|
case 4:
|
|
30107
|
-
tx =
|
|
30108
|
-
return
|
|
30200
|
+
tx = _context36.sent;
|
|
30201
|
+
return _context36.abrupt("return", tx);
|
|
30109
30202
|
|
|
30110
30203
|
case 6:
|
|
30111
30204
|
case "end":
|
|
30112
|
-
return
|
|
30205
|
+
return _context36.stop();
|
|
30113
30206
|
}
|
|
30114
30207
|
}
|
|
30115
|
-
},
|
|
30208
|
+
}, _callee36, this);
|
|
30116
30209
|
}));
|
|
30117
30210
|
|
|
30118
|
-
function getRewards(
|
|
30211
|
+
function getRewards(_x168, _x169, _x170, _x171, _x172) {
|
|
30119
30212
|
return _getRewards.apply(this, arguments);
|
|
30120
30213
|
}
|
|
30121
30214
|
|
|
@@ -30138,11 +30231,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30138
30231
|
_proto.tradeUniswapV3 =
|
|
30139
30232
|
/*#__PURE__*/
|
|
30140
30233
|
function () {
|
|
30141
|
-
var _tradeUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30234
|
+
var _tradeUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee37(assetFrom, assetTo, amountIn, feeAmount, slippage, options, sdkOptions) {
|
|
30142
30235
|
var swapxData, tx;
|
|
30143
|
-
return runtime_1.wrap(function
|
|
30236
|
+
return runtime_1.wrap(function _callee37$(_context37) {
|
|
30144
30237
|
while (1) {
|
|
30145
|
-
switch (
|
|
30238
|
+
switch (_context37.prev = _context37.next) {
|
|
30146
30239
|
case 0:
|
|
30147
30240
|
if (slippage === void 0) {
|
|
30148
30241
|
slippage = 0.5;
|
|
@@ -30158,27 +30251,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30158
30251
|
};
|
|
30159
30252
|
}
|
|
30160
30253
|
|
|
30161
|
-
|
|
30254
|
+
_context37.next = 5;
|
|
30162
30255
|
return getUniswapV3SwapTxData(this, assetFrom, assetTo, amountIn, slippage, feeAmount);
|
|
30163
30256
|
|
|
30164
30257
|
case 5:
|
|
30165
|
-
swapxData =
|
|
30166
|
-
|
|
30258
|
+
swapxData = _context37.sent;
|
|
30259
|
+
_context37.next = 8;
|
|
30167
30260
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.UNISWAPV3], swapxData, options], sdkOptions);
|
|
30168
30261
|
|
|
30169
30262
|
case 8:
|
|
30170
|
-
tx =
|
|
30171
|
-
return
|
|
30263
|
+
tx = _context37.sent;
|
|
30264
|
+
return _context37.abrupt("return", tx);
|
|
30172
30265
|
|
|
30173
30266
|
case 10:
|
|
30174
30267
|
case "end":
|
|
30175
|
-
return
|
|
30268
|
+
return _context37.stop();
|
|
30176
30269
|
}
|
|
30177
30270
|
}
|
|
30178
|
-
},
|
|
30271
|
+
}, _callee37, this);
|
|
30179
30272
|
}));
|
|
30180
30273
|
|
|
30181
|
-
function tradeUniswapV3(
|
|
30274
|
+
function tradeUniswapV3(_x173, _x174, _x175, _x176, _x177, _x178, _x179) {
|
|
30182
30275
|
return _tradeUniswapV.apply(this, arguments);
|
|
30183
30276
|
}
|
|
30184
30277
|
|
|
@@ -30200,11 +30293,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30200
30293
|
_proto.addLiquidityVelodrome =
|
|
30201
30294
|
/*#__PURE__*/
|
|
30202
30295
|
function () {
|
|
30203
|
-
var _addLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30296
|
+
var _addLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(assetA, assetB, amountA, amountB, isStable, options, sdkOptions) {
|
|
30204
30297
|
var tx;
|
|
30205
|
-
return runtime_1.wrap(function
|
|
30298
|
+
return runtime_1.wrap(function _callee38$(_context38) {
|
|
30206
30299
|
while (1) {
|
|
30207
|
-
switch (
|
|
30300
|
+
switch (_context38.prev = _context38.next) {
|
|
30208
30301
|
case 0:
|
|
30209
30302
|
if (options === void 0) {
|
|
30210
30303
|
options = null;
|
|
@@ -30216,75 +30309,12 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30216
30309
|
};
|
|
30217
30310
|
}
|
|
30218
30311
|
|
|
30219
|
-
|
|
30220
|
-
|
|
30221
|
-
|
|
30222
|
-
|
|
30312
|
+
_context38.t0 = getPoolTxOrGasEstimate;
|
|
30313
|
+
_context38.t1 = this;
|
|
30314
|
+
_context38.t2 = routerAddress[this.network][Dapp.VELODROME];
|
|
30315
|
+
_context38.next = 7;
|
|
30223
30316
|
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
30224
30317
|
|
|
30225
|
-
case 7:
|
|
30226
|
-
_context37.t3 = _context37.sent;
|
|
30227
|
-
_context37.t4 = options;
|
|
30228
|
-
_context37.t5 = [_context37.t2, _context37.t3, _context37.t4];
|
|
30229
|
-
_context37.t6 = sdkOptions;
|
|
30230
|
-
_context37.next = 13;
|
|
30231
|
-
return (0, _context37.t0)(_context37.t1, _context37.t5, _context37.t6);
|
|
30232
|
-
|
|
30233
|
-
case 13:
|
|
30234
|
-
tx = _context37.sent;
|
|
30235
|
-
return _context37.abrupt("return", tx);
|
|
30236
|
-
|
|
30237
|
-
case 15:
|
|
30238
|
-
case "end":
|
|
30239
|
-
return _context37.stop();
|
|
30240
|
-
}
|
|
30241
|
-
}
|
|
30242
|
-
}, _callee37, this);
|
|
30243
|
-
}));
|
|
30244
|
-
|
|
30245
|
-
function addLiquidityVelodrome(_x177, _x178, _x179, _x180, _x181, _x182, _x183) {
|
|
30246
|
-
return _addLiquidityVelodrome.apply(this, arguments);
|
|
30247
|
-
}
|
|
30248
|
-
|
|
30249
|
-
return addLiquidityVelodrome;
|
|
30250
|
-
}()
|
|
30251
|
-
/**
|
|
30252
|
-
* Remove liquidity from Velodrome pool
|
|
30253
|
-
* @param {string} assetA First asset
|
|
30254
|
-
* @param {string} assetB Second asset
|
|
30255
|
-
* @param {BigNumber | string} amount Amount of LP tokens
|
|
30256
|
-
* @param { boolean } isStable Is stable pool
|
|
30257
|
-
* @param {any} options Transaction options
|
|
30258
|
-
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
30259
|
-
* @returns {Promise<any>} Transaction
|
|
30260
|
-
*/
|
|
30261
|
-
;
|
|
30262
|
-
|
|
30263
|
-
_proto.removeLiquidityVelodrome =
|
|
30264
|
-
/*#__PURE__*/
|
|
30265
|
-
function () {
|
|
30266
|
-
var _removeLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(assetA, assetB, amount, isStable, options, sdkOptions) {
|
|
30267
|
-
var tx;
|
|
30268
|
-
return runtime_1.wrap(function _callee38$(_context38) {
|
|
30269
|
-
while (1) {
|
|
30270
|
-
switch (_context38.prev = _context38.next) {
|
|
30271
|
-
case 0:
|
|
30272
|
-
if (options === void 0) {
|
|
30273
|
-
options = null;
|
|
30274
|
-
}
|
|
30275
|
-
|
|
30276
|
-
if (sdkOptions === void 0) {
|
|
30277
|
-
sdkOptions = {
|
|
30278
|
-
estimateGas: false
|
|
30279
|
-
};
|
|
30280
|
-
}
|
|
30281
|
-
|
|
30282
|
-
_context38.t0 = getPoolTxOrGasEstimate;
|
|
30283
|
-
_context38.t1 = this;
|
|
30284
|
-
_context38.t2 = routerAddress[this.network][Dapp.VELODROME];
|
|
30285
|
-
_context38.next = 7;
|
|
30286
|
-
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
30287
|
-
|
|
30288
30318
|
case 7:
|
|
30289
30319
|
_context38.t3 = _context38.sent;
|
|
30290
30320
|
_context38.t4 = options;
|
|
@@ -30305,18 +30335,17 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30305
30335
|
}, _callee38, this);
|
|
30306
30336
|
}));
|
|
30307
30337
|
|
|
30308
|
-
function
|
|
30309
|
-
return
|
|
30338
|
+
function addLiquidityVelodrome(_x180, _x181, _x182, _x183, _x184, _x185, _x186) {
|
|
30339
|
+
return _addLiquidityVelodrome.apply(this, arguments);
|
|
30310
30340
|
}
|
|
30311
30341
|
|
|
30312
|
-
return
|
|
30342
|
+
return addLiquidityVelodrome;
|
|
30313
30343
|
}()
|
|
30314
30344
|
/**
|
|
30315
|
-
*
|
|
30345
|
+
* Remove liquidity from Velodrome pool
|
|
30316
30346
|
* @param {string} assetA First asset
|
|
30317
30347
|
* @param {string} assetB Second asset
|
|
30318
|
-
* @param {BigNumber | string}
|
|
30319
|
-
* @param {BigNumber | string} amountB Amount second asset
|
|
30348
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
30320
30349
|
* @param { boolean } isStable Is stable pool
|
|
30321
30350
|
* @param {any} options Transaction options
|
|
30322
30351
|
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
@@ -30324,10 +30353,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30324
30353
|
*/
|
|
30325
30354
|
;
|
|
30326
30355
|
|
|
30327
|
-
_proto.
|
|
30356
|
+
_proto.removeLiquidityVelodrome =
|
|
30328
30357
|
/*#__PURE__*/
|
|
30329
30358
|
function () {
|
|
30330
|
-
var
|
|
30359
|
+
var _removeLiquidityVelodrome = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee39(assetA, assetB, amount, isStable, options, sdkOptions) {
|
|
30331
30360
|
var tx;
|
|
30332
30361
|
return runtime_1.wrap(function _callee39$(_context39) {
|
|
30333
30362
|
while (1) {
|
|
@@ -30345,9 +30374,9 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30345
30374
|
|
|
30346
30375
|
_context39.t0 = getPoolTxOrGasEstimate;
|
|
30347
30376
|
_context39.t1 = this;
|
|
30348
|
-
_context39.t2 = routerAddress[this.network][Dapp.
|
|
30377
|
+
_context39.t2 = routerAddress[this.network][Dapp.VELODROME];
|
|
30349
30378
|
_context39.next = 7;
|
|
30350
|
-
return
|
|
30379
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
30351
30380
|
|
|
30352
30381
|
case 7:
|
|
30353
30382
|
_context39.t3 = _context39.sent;
|
|
@@ -30369,17 +30398,18 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30369
30398
|
}, _callee39, this);
|
|
30370
30399
|
}));
|
|
30371
30400
|
|
|
30372
|
-
function
|
|
30373
|
-
return
|
|
30401
|
+
function removeLiquidityVelodrome(_x187, _x188, _x189, _x190, _x191, _x192) {
|
|
30402
|
+
return _removeLiquidityVelodrome.apply(this, arguments);
|
|
30374
30403
|
}
|
|
30375
30404
|
|
|
30376
|
-
return
|
|
30405
|
+
return removeLiquidityVelodrome;
|
|
30377
30406
|
}()
|
|
30378
30407
|
/**
|
|
30379
|
-
*
|
|
30408
|
+
* Add liquidity to Velodrome V2 pool
|
|
30380
30409
|
* @param {string} assetA First asset
|
|
30381
30410
|
* @param {string} assetB Second asset
|
|
30382
|
-
* @param {BigNumber | string}
|
|
30411
|
+
* @param {BigNumber | string} amountA Amount first asset
|
|
30412
|
+
* @param {BigNumber | string} amountB Amount second asset
|
|
30383
30413
|
* @param { boolean } isStable Is stable pool
|
|
30384
30414
|
* @param {any} options Transaction options
|
|
30385
30415
|
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
@@ -30387,10 +30417,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30387
30417
|
*/
|
|
30388
30418
|
;
|
|
30389
30419
|
|
|
30390
|
-
_proto.
|
|
30420
|
+
_proto.addLiquidityVelodromeV2 =
|
|
30391
30421
|
/*#__PURE__*/
|
|
30392
30422
|
function () {
|
|
30393
|
-
var
|
|
30423
|
+
var _addLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee40(assetA, assetB, amountA, amountB, isStable, options, sdkOptions) {
|
|
30394
30424
|
var tx;
|
|
30395
30425
|
return runtime_1.wrap(function _callee40$(_context40) {
|
|
30396
30426
|
while (1) {
|
|
@@ -30410,7 +30440,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30410
30440
|
_context40.t1 = this;
|
|
30411
30441
|
_context40.t2 = routerAddress[this.network][Dapp.VELODROMEV2];
|
|
30412
30442
|
_context40.next = 7;
|
|
30413
|
-
return
|
|
30443
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
30414
30444
|
|
|
30415
30445
|
case 7:
|
|
30416
30446
|
_context40.t3 = _context40.sent;
|
|
@@ -30432,19 +30462,17 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30432
30462
|
}, _callee40, this);
|
|
30433
30463
|
}));
|
|
30434
30464
|
|
|
30435
|
-
function
|
|
30436
|
-
return
|
|
30465
|
+
function addLiquidityVelodromeV2(_x193, _x194, _x195, _x196, _x197, _x198, _x199) {
|
|
30466
|
+
return _addLiquidityVelodromeV.apply(this, arguments);
|
|
30437
30467
|
}
|
|
30438
30468
|
|
|
30439
|
-
return
|
|
30469
|
+
return addLiquidityVelodromeV2;
|
|
30440
30470
|
}()
|
|
30441
30471
|
/**
|
|
30442
|
-
*
|
|
30443
|
-
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
30472
|
+
* Remove liquidity from Velodrome V2 pool
|
|
30444
30473
|
* @param {string} assetA First asset
|
|
30445
30474
|
* @param {string} assetB Second asset
|
|
30446
|
-
* @param {BigNumber | string}
|
|
30447
|
-
* @param {BigNumber | string} amountB Amount second asset
|
|
30475
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
30448
30476
|
* @param { boolean } isStable Is stable pool
|
|
30449
30477
|
* @param {any} options Transaction options
|
|
30450
30478
|
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
@@ -30452,10 +30480,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30452
30480
|
*/
|
|
30453
30481
|
;
|
|
30454
30482
|
|
|
30455
|
-
_proto.
|
|
30483
|
+
_proto.removeLiquidityVelodromeV2 =
|
|
30456
30484
|
/*#__PURE__*/
|
|
30457
30485
|
function () {
|
|
30458
|
-
var
|
|
30486
|
+
var _removeLiquidityVelodromeV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee41(assetA, assetB, amount, isStable, options, sdkOptions) {
|
|
30459
30487
|
var tx;
|
|
30460
30488
|
return runtime_1.wrap(function _callee41$(_context41) {
|
|
30461
30489
|
while (1) {
|
|
@@ -30473,9 +30501,9 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30473
30501
|
|
|
30474
30502
|
_context41.t0 = getPoolTxOrGasEstimate;
|
|
30475
30503
|
_context41.t1 = this;
|
|
30476
|
-
_context41.t2 = routerAddress[this.network][
|
|
30504
|
+
_context41.t2 = routerAddress[this.network][Dapp.VELODROMEV2];
|
|
30477
30505
|
_context41.next = 7;
|
|
30478
|
-
return
|
|
30506
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
30479
30507
|
|
|
30480
30508
|
case 7:
|
|
30481
30509
|
_context41.t3 = _context41.sent;
|
|
@@ -30497,18 +30525,19 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30497
30525
|
}, _callee41, this);
|
|
30498
30526
|
}));
|
|
30499
30527
|
|
|
30500
|
-
function
|
|
30501
|
-
return
|
|
30528
|
+
function removeLiquidityVelodromeV2(_x200, _x201, _x202, _x203, _x204, _x205) {
|
|
30529
|
+
return _removeLiquidityVelodromeV.apply(this, arguments);
|
|
30502
30530
|
}
|
|
30503
30531
|
|
|
30504
|
-
return
|
|
30532
|
+
return removeLiquidityVelodromeV2;
|
|
30505
30533
|
}()
|
|
30506
30534
|
/**
|
|
30507
|
-
*
|
|
30535
|
+
* Add liquidity to Velodrome V2 or Ramses pool
|
|
30508
30536
|
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
30509
30537
|
* @param {string} assetA First asset
|
|
30510
30538
|
* @param {string} assetB Second asset
|
|
30511
|
-
* @param {BigNumber | string}
|
|
30539
|
+
* @param {BigNumber | string} amountA Amount first asset
|
|
30540
|
+
* @param {BigNumber | string} amountB Amount second asset
|
|
30512
30541
|
* @param { boolean } isStable Is stable pool
|
|
30513
30542
|
* @param {any} options Transaction options
|
|
30514
30543
|
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
@@ -30516,10 +30545,10 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30516
30545
|
*/
|
|
30517
30546
|
;
|
|
30518
30547
|
|
|
30519
|
-
_proto.
|
|
30548
|
+
_proto.addLiquidityV2 =
|
|
30520
30549
|
/*#__PURE__*/
|
|
30521
30550
|
function () {
|
|
30522
|
-
var
|
|
30551
|
+
var _addLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee42(dapp, assetA, assetB, amountA, amountB, isStable, options, sdkOptions) {
|
|
30523
30552
|
var tx;
|
|
30524
30553
|
return runtime_1.wrap(function _callee42$(_context42) {
|
|
30525
30554
|
while (1) {
|
|
@@ -30539,7 +30568,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30539
30568
|
_context42.t1 = this;
|
|
30540
30569
|
_context42.t2 = routerAddress[this.network][dapp];
|
|
30541
30570
|
_context42.next = 7;
|
|
30542
|
-
return
|
|
30571
|
+
return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
|
|
30543
30572
|
|
|
30544
30573
|
case 7:
|
|
30545
30574
|
_context42.t3 = _context42.sent;
|
|
@@ -30561,7 +30590,71 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30561
30590
|
}, _callee42, this);
|
|
30562
30591
|
}));
|
|
30563
30592
|
|
|
30564
|
-
function
|
|
30593
|
+
function addLiquidityV2(_x206, _x207, _x208, _x209, _x210, _x211, _x212, _x213) {
|
|
30594
|
+
return _addLiquidityV.apply(this, arguments);
|
|
30595
|
+
}
|
|
30596
|
+
|
|
30597
|
+
return addLiquidityV2;
|
|
30598
|
+
}()
|
|
30599
|
+
/**
|
|
30600
|
+
* Remove liquidity from Velodrome V2 or Ramses pool
|
|
30601
|
+
* @param {Dapp} dapp VelodromeV2, Ramses or Aerodrome
|
|
30602
|
+
* @param {string} assetA First asset
|
|
30603
|
+
* @param {string} assetB Second asset
|
|
30604
|
+
* @param {BigNumber | string} amount Amount of LP tokens
|
|
30605
|
+
* @param { boolean } isStable Is stable pool
|
|
30606
|
+
* @param {any} options Transaction options
|
|
30607
|
+
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
30608
|
+
* @returns {Promise<any>} Transaction
|
|
30609
|
+
*/
|
|
30610
|
+
;
|
|
30611
|
+
|
|
30612
|
+
_proto.removeLiquidityV2 =
|
|
30613
|
+
/*#__PURE__*/
|
|
30614
|
+
function () {
|
|
30615
|
+
var _removeLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee43(dapp, assetA, assetB, amount, isStable, options, sdkOptions) {
|
|
30616
|
+
var tx;
|
|
30617
|
+
return runtime_1.wrap(function _callee43$(_context43) {
|
|
30618
|
+
while (1) {
|
|
30619
|
+
switch (_context43.prev = _context43.next) {
|
|
30620
|
+
case 0:
|
|
30621
|
+
if (options === void 0) {
|
|
30622
|
+
options = null;
|
|
30623
|
+
}
|
|
30624
|
+
|
|
30625
|
+
if (sdkOptions === void 0) {
|
|
30626
|
+
sdkOptions = {
|
|
30627
|
+
estimateGas: false
|
|
30628
|
+
};
|
|
30629
|
+
}
|
|
30630
|
+
|
|
30631
|
+
_context43.t0 = getPoolTxOrGasEstimate;
|
|
30632
|
+
_context43.t1 = this;
|
|
30633
|
+
_context43.t2 = routerAddress[this.network][dapp];
|
|
30634
|
+
_context43.next = 7;
|
|
30635
|
+
return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
|
|
30636
|
+
|
|
30637
|
+
case 7:
|
|
30638
|
+
_context43.t3 = _context43.sent;
|
|
30639
|
+
_context43.t4 = options;
|
|
30640
|
+
_context43.t5 = [_context43.t2, _context43.t3, _context43.t4];
|
|
30641
|
+
_context43.t6 = sdkOptions;
|
|
30642
|
+
_context43.next = 13;
|
|
30643
|
+
return (0, _context43.t0)(_context43.t1, _context43.t5, _context43.t6);
|
|
30644
|
+
|
|
30645
|
+
case 13:
|
|
30646
|
+
tx = _context43.sent;
|
|
30647
|
+
return _context43.abrupt("return", tx);
|
|
30648
|
+
|
|
30649
|
+
case 15:
|
|
30650
|
+
case "end":
|
|
30651
|
+
return _context43.stop();
|
|
30652
|
+
}
|
|
30653
|
+
}
|
|
30654
|
+
}, _callee43, this);
|
|
30655
|
+
}));
|
|
30656
|
+
|
|
30657
|
+
function removeLiquidityV2(_x214, _x215, _x216, _x217, _x218, _x219, _x220) {
|
|
30565
30658
|
return _removeLiquidityV.apply(this, arguments);
|
|
30566
30659
|
}
|
|
30567
30660
|
|
|
@@ -30587,11 +30680,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30587
30680
|
_proto.tradeLyraOption =
|
|
30588
30681
|
/*#__PURE__*/
|
|
30589
30682
|
function () {
|
|
30590
|
-
var _tradeLyraOption = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30683
|
+
var _tradeLyraOption = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee44(market, expiry, strike, optionType, tradeType, optionAmount, assetIn, collateralChangeAmount, isCoveredCall, options, sdkOptions) {
|
|
30591
30684
|
var swapxData, tx;
|
|
30592
|
-
return runtime_1.wrap(function
|
|
30685
|
+
return runtime_1.wrap(function _callee44$(_context44) {
|
|
30593
30686
|
while (1) {
|
|
30594
|
-
switch (
|
|
30687
|
+
switch (_context44.prev = _context44.next) {
|
|
30595
30688
|
case 0:
|
|
30596
30689
|
if (collateralChangeAmount === void 0) {
|
|
30597
30690
|
collateralChangeAmount = "0";
|
|
@@ -30611,27 +30704,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30611
30704
|
};
|
|
30612
30705
|
}
|
|
30613
30706
|
|
|
30614
|
-
|
|
30707
|
+
_context44.next = 6;
|
|
30615
30708
|
return getLyraOptionTxData(this, market, optionType, expiry, strike, tradeType, optionAmount, assetIn, BigNumber$1.from(collateralChangeAmount), isCoveredCall);
|
|
30616
30709
|
|
|
30617
30710
|
case 6:
|
|
30618
|
-
swapxData =
|
|
30619
|
-
|
|
30711
|
+
swapxData = _context44.sent;
|
|
30712
|
+
_context44.next = 9;
|
|
30620
30713
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network][Dapp.LYRA], swapxData, options], sdkOptions);
|
|
30621
30714
|
|
|
30622
30715
|
case 9:
|
|
30623
|
-
tx =
|
|
30624
|
-
return
|
|
30716
|
+
tx = _context44.sent;
|
|
30717
|
+
return _context44.abrupt("return", tx);
|
|
30625
30718
|
|
|
30626
30719
|
case 11:
|
|
30627
30720
|
case "end":
|
|
30628
|
-
return
|
|
30721
|
+
return _context44.stop();
|
|
30629
30722
|
}
|
|
30630
30723
|
}
|
|
30631
|
-
},
|
|
30724
|
+
}, _callee44, this);
|
|
30632
30725
|
}));
|
|
30633
30726
|
|
|
30634
|
-
function tradeLyraOption(
|
|
30727
|
+
function tradeLyraOption(_x221, _x222, _x223, _x224, _x225, _x226, _x227, _x228, _x229, _x230, _x231) {
|
|
30635
30728
|
return _tradeLyraOption.apply(this, arguments);
|
|
30636
30729
|
}
|
|
30637
30730
|
|
|
@@ -30646,26 +30739,26 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30646
30739
|
_proto.getLyraPositions =
|
|
30647
30740
|
/*#__PURE__*/
|
|
30648
30741
|
function () {
|
|
30649
|
-
var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30650
|
-
return runtime_1.wrap(function
|
|
30742
|
+
var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee45(market) {
|
|
30743
|
+
return runtime_1.wrap(function _callee45$(_context45) {
|
|
30651
30744
|
while (1) {
|
|
30652
|
-
switch (
|
|
30745
|
+
switch (_context45.prev = _context45.next) {
|
|
30653
30746
|
case 0:
|
|
30654
|
-
|
|
30747
|
+
_context45.next = 2;
|
|
30655
30748
|
return getOptionPositions(this, market);
|
|
30656
30749
|
|
|
30657
30750
|
case 2:
|
|
30658
|
-
return
|
|
30751
|
+
return _context45.abrupt("return", _context45.sent);
|
|
30659
30752
|
|
|
30660
30753
|
case 3:
|
|
30661
30754
|
case "end":
|
|
30662
|
-
return
|
|
30755
|
+
return _context45.stop();
|
|
30663
30756
|
}
|
|
30664
30757
|
}
|
|
30665
|
-
},
|
|
30758
|
+
}, _callee45, this);
|
|
30666
30759
|
}));
|
|
30667
30760
|
|
|
30668
|
-
function getLyraPositions(
|
|
30761
|
+
function getLyraPositions(_x232) {
|
|
30669
30762
|
return _getLyraPositions.apply(this, arguments);
|
|
30670
30763
|
}
|
|
30671
30764
|
|
|
@@ -30684,11 +30777,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30684
30777
|
_proto.changeFuturesMargin =
|
|
30685
30778
|
/*#__PURE__*/
|
|
30686
30779
|
function () {
|
|
30687
|
-
var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30780
|
+
var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee46(market, changeAmount, options, sdkOptions) {
|
|
30688
30781
|
var tx;
|
|
30689
|
-
return runtime_1.wrap(function
|
|
30782
|
+
return runtime_1.wrap(function _callee46$(_context46) {
|
|
30690
30783
|
while (1) {
|
|
30691
|
-
switch (
|
|
30784
|
+
switch (_context46.prev = _context46.next) {
|
|
30692
30785
|
case 0:
|
|
30693
30786
|
if (options === void 0) {
|
|
30694
30787
|
options = null;
|
|
@@ -30700,22 +30793,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30700
30793
|
};
|
|
30701
30794
|
}
|
|
30702
30795
|
|
|
30703
|
-
|
|
30796
|
+
_context46.next = 4;
|
|
30704
30797
|
return getPoolTxOrGasEstimate(this, [market, getFuturesChangeMarginTxData(changeAmount), options], sdkOptions);
|
|
30705
30798
|
|
|
30706
30799
|
case 4:
|
|
30707
|
-
tx =
|
|
30708
|
-
return
|
|
30800
|
+
tx = _context46.sent;
|
|
30801
|
+
return _context46.abrupt("return", tx);
|
|
30709
30802
|
|
|
30710
30803
|
case 6:
|
|
30711
30804
|
case "end":
|
|
30712
|
-
return
|
|
30805
|
+
return _context46.stop();
|
|
30713
30806
|
}
|
|
30714
30807
|
}
|
|
30715
|
-
},
|
|
30808
|
+
}, _callee46, this);
|
|
30716
30809
|
}));
|
|
30717
30810
|
|
|
30718
|
-
function changeFuturesMargin(
|
|
30811
|
+
function changeFuturesMargin(_x233, _x234, _x235, _x236) {
|
|
30719
30812
|
return _changeFuturesMargin.apply(this, arguments);
|
|
30720
30813
|
}
|
|
30721
30814
|
|
|
@@ -30734,11 +30827,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30734
30827
|
_proto.changeFuturesPosition =
|
|
30735
30828
|
/*#__PURE__*/
|
|
30736
30829
|
function () {
|
|
30737
|
-
var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30830
|
+
var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee47(market, changeAmount, options, sdkOptions) {
|
|
30738
30831
|
var txData, tx;
|
|
30739
|
-
return runtime_1.wrap(function
|
|
30832
|
+
return runtime_1.wrap(function _callee47$(_context47) {
|
|
30740
30833
|
while (1) {
|
|
30741
|
-
switch (
|
|
30834
|
+
switch (_context47.prev = _context47.next) {
|
|
30742
30835
|
case 0:
|
|
30743
30836
|
if (options === void 0) {
|
|
30744
30837
|
options = null;
|
|
@@ -30750,27 +30843,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30750
30843
|
};
|
|
30751
30844
|
}
|
|
30752
30845
|
|
|
30753
|
-
|
|
30846
|
+
_context47.next = 4;
|
|
30754
30847
|
return getFuturesChangePositionTxData(changeAmount, market, this);
|
|
30755
30848
|
|
|
30756
30849
|
case 4:
|
|
30757
|
-
txData =
|
|
30758
|
-
|
|
30850
|
+
txData = _context47.sent;
|
|
30851
|
+
_context47.next = 7;
|
|
30759
30852
|
return getPoolTxOrGasEstimate(this, [market, txData, options], sdkOptions);
|
|
30760
30853
|
|
|
30761
30854
|
case 7:
|
|
30762
|
-
tx =
|
|
30763
|
-
return
|
|
30855
|
+
tx = _context47.sent;
|
|
30856
|
+
return _context47.abrupt("return", tx);
|
|
30764
30857
|
|
|
30765
30858
|
case 9:
|
|
30766
30859
|
case "end":
|
|
30767
|
-
return
|
|
30860
|
+
return _context47.stop();
|
|
30768
30861
|
}
|
|
30769
30862
|
}
|
|
30770
|
-
},
|
|
30863
|
+
}, _callee47, this);
|
|
30771
30864
|
}));
|
|
30772
30865
|
|
|
30773
|
-
function changeFuturesPosition(
|
|
30866
|
+
function changeFuturesPosition(_x237, _x238, _x239, _x240) {
|
|
30774
30867
|
return _changeFuturesPosition.apply(this, arguments);
|
|
30775
30868
|
}
|
|
30776
30869
|
|
|
@@ -30788,11 +30881,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30788
30881
|
_proto.cancelFuturesOrder =
|
|
30789
30882
|
/*#__PURE__*/
|
|
30790
30883
|
function () {
|
|
30791
|
-
var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30884
|
+
var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee48(market, options, sdkOptions) {
|
|
30792
30885
|
var txData, tx;
|
|
30793
|
-
return runtime_1.wrap(function
|
|
30886
|
+
return runtime_1.wrap(function _callee48$(_context48) {
|
|
30794
30887
|
while (1) {
|
|
30795
|
-
switch (
|
|
30888
|
+
switch (_context48.prev = _context48.next) {
|
|
30796
30889
|
case 0:
|
|
30797
30890
|
if (options === void 0) {
|
|
30798
30891
|
options = null;
|
|
@@ -30804,27 +30897,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30804
30897
|
};
|
|
30805
30898
|
}
|
|
30806
30899
|
|
|
30807
|
-
|
|
30900
|
+
_context48.next = 4;
|
|
30808
30901
|
return getFuturesCancelOrderTxData(this);
|
|
30809
30902
|
|
|
30810
30903
|
case 4:
|
|
30811
|
-
txData =
|
|
30812
|
-
|
|
30904
|
+
txData = _context48.sent;
|
|
30905
|
+
_context48.next = 7;
|
|
30813
30906
|
return getPoolTxOrGasEstimate(this, [market, txData, options], sdkOptions);
|
|
30814
30907
|
|
|
30815
30908
|
case 7:
|
|
30816
|
-
tx =
|
|
30817
|
-
return
|
|
30909
|
+
tx = _context48.sent;
|
|
30910
|
+
return _context48.abrupt("return", tx);
|
|
30818
30911
|
|
|
30819
30912
|
case 9:
|
|
30820
30913
|
case "end":
|
|
30821
|
-
return
|
|
30914
|
+
return _context48.stop();
|
|
30822
30915
|
}
|
|
30823
30916
|
}
|
|
30824
|
-
},
|
|
30917
|
+
}, _callee48, this);
|
|
30825
30918
|
}));
|
|
30826
30919
|
|
|
30827
|
-
function cancelFuturesOrder(
|
|
30920
|
+
function cancelFuturesOrder(_x241, _x242, _x243) {
|
|
30828
30921
|
return _cancelFuturesOrder.apply(this, arguments);
|
|
30829
30922
|
}
|
|
30830
30923
|
|
|
@@ -30841,11 +30934,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30841
30934
|
_proto.mintManagerFee =
|
|
30842
30935
|
/*#__PURE__*/
|
|
30843
30936
|
function () {
|
|
30844
|
-
var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30937
|
+
var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee49(options, estimateGas) {
|
|
30845
30938
|
var tx;
|
|
30846
|
-
return runtime_1.wrap(function
|
|
30939
|
+
return runtime_1.wrap(function _callee49$(_context49) {
|
|
30847
30940
|
while (1) {
|
|
30848
|
-
switch (
|
|
30941
|
+
switch (_context49.prev = _context49.next) {
|
|
30849
30942
|
case 0:
|
|
30850
30943
|
if (options === void 0) {
|
|
30851
30944
|
options = null;
|
|
@@ -30856,33 +30949,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30856
30949
|
}
|
|
30857
30950
|
|
|
30858
30951
|
if (!estimateGas) {
|
|
30859
|
-
|
|
30952
|
+
_context49.next = 6;
|
|
30860
30953
|
break;
|
|
30861
30954
|
}
|
|
30862
30955
|
|
|
30863
|
-
|
|
30956
|
+
_context49.next = 5;
|
|
30864
30957
|
return this.poolLogic.estimateGas.mintManagerFee(options);
|
|
30865
30958
|
|
|
30866
30959
|
case 5:
|
|
30867
|
-
return
|
|
30960
|
+
return _context49.abrupt("return", _context49.sent);
|
|
30868
30961
|
|
|
30869
30962
|
case 6:
|
|
30870
|
-
|
|
30963
|
+
_context49.next = 8;
|
|
30871
30964
|
return this.poolLogic.mintManagerFee(options);
|
|
30872
30965
|
|
|
30873
30966
|
case 8:
|
|
30874
|
-
tx =
|
|
30875
|
-
return
|
|
30967
|
+
tx = _context49.sent;
|
|
30968
|
+
return _context49.abrupt("return", tx);
|
|
30876
30969
|
|
|
30877
30970
|
case 10:
|
|
30878
30971
|
case "end":
|
|
30879
|
-
return
|
|
30972
|
+
return _context49.stop();
|
|
30880
30973
|
}
|
|
30881
30974
|
}
|
|
30882
|
-
},
|
|
30975
|
+
}, _callee49, this);
|
|
30883
30976
|
}));
|
|
30884
30977
|
|
|
30885
|
-
function mintManagerFee(
|
|
30978
|
+
function mintManagerFee(_x244, _x245) {
|
|
30886
30979
|
return _mintManagerFee.apply(this, arguments);
|
|
30887
30980
|
}
|
|
30888
30981
|
|
|
@@ -30897,25 +30990,25 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30897
30990
|
_proto.getAvailableManagerFee =
|
|
30898
30991
|
/*#__PURE__*/
|
|
30899
30992
|
function () {
|
|
30900
|
-
var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
30993
|
+
var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee50() {
|
|
30901
30994
|
var fee;
|
|
30902
|
-
return runtime_1.wrap(function
|
|
30995
|
+
return runtime_1.wrap(function _callee50$(_context50) {
|
|
30903
30996
|
while (1) {
|
|
30904
|
-
switch (
|
|
30997
|
+
switch (_context50.prev = _context50.next) {
|
|
30905
30998
|
case 0:
|
|
30906
|
-
|
|
30999
|
+
_context50.next = 2;
|
|
30907
31000
|
return this.poolLogic.availableManagerFee();
|
|
30908
31001
|
|
|
30909
31002
|
case 2:
|
|
30910
|
-
fee =
|
|
30911
|
-
return
|
|
31003
|
+
fee = _context50.sent;
|
|
31004
|
+
return _context50.abrupt("return", BigNumber$1.from(fee));
|
|
30912
31005
|
|
|
30913
31006
|
case 4:
|
|
30914
31007
|
case "end":
|
|
30915
|
-
return
|
|
31008
|
+
return _context50.stop();
|
|
30916
31009
|
}
|
|
30917
31010
|
}
|
|
30918
|
-
},
|
|
31011
|
+
}, _callee50, this);
|
|
30919
31012
|
}));
|
|
30920
31013
|
|
|
30921
31014
|
function getAvailableManagerFee() {
|
|
@@ -30937,11 +31030,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30937
31030
|
_proto.vestTokens =
|
|
30938
31031
|
/*#__PURE__*/
|
|
30939
31032
|
function () {
|
|
30940
|
-
var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31033
|
+
var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee51(tokenAddress, amount, options, sdkOptions) {
|
|
30941
31034
|
var txData, tx;
|
|
30942
|
-
return runtime_1.wrap(function
|
|
31035
|
+
return runtime_1.wrap(function _callee51$(_context51) {
|
|
30943
31036
|
while (1) {
|
|
30944
|
-
switch (
|
|
31037
|
+
switch (_context51.prev = _context51.next) {
|
|
30945
31038
|
case 0:
|
|
30946
31039
|
if (options === void 0) {
|
|
30947
31040
|
options = null;
|
|
@@ -30953,27 +31046,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30953
31046
|
};
|
|
30954
31047
|
}
|
|
30955
31048
|
|
|
30956
|
-
|
|
31049
|
+
_context51.next = 4;
|
|
30957
31050
|
return getCreateVestTxData(amount);
|
|
30958
31051
|
|
|
30959
31052
|
case 4:
|
|
30960
|
-
txData =
|
|
30961
|
-
|
|
31053
|
+
txData = _context51.sent;
|
|
31054
|
+
_context51.next = 7;
|
|
30962
31055
|
return getPoolTxOrGasEstimate(this, [tokenAddress, txData, options], sdkOptions);
|
|
30963
31056
|
|
|
30964
31057
|
case 7:
|
|
30965
|
-
tx =
|
|
30966
|
-
return
|
|
31058
|
+
tx = _context51.sent;
|
|
31059
|
+
return _context51.abrupt("return", tx);
|
|
30967
31060
|
|
|
30968
31061
|
case 9:
|
|
30969
31062
|
case "end":
|
|
30970
|
-
return
|
|
31063
|
+
return _context51.stop();
|
|
30971
31064
|
}
|
|
30972
31065
|
}
|
|
30973
|
-
},
|
|
31066
|
+
}, _callee51, this);
|
|
30974
31067
|
}));
|
|
30975
31068
|
|
|
30976
|
-
function vestTokens(
|
|
31069
|
+
function vestTokens(_x246, _x247, _x248, _x249) {
|
|
30977
31070
|
return _vestTokens.apply(this, arguments);
|
|
30978
31071
|
}
|
|
30979
31072
|
|
|
@@ -30992,11 +31085,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
30992
31085
|
_proto.exitVestedToken =
|
|
30993
31086
|
/*#__PURE__*/
|
|
30994
31087
|
function () {
|
|
30995
|
-
var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31088
|
+
var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee52(tokenAddress, id, options, sdkOptions) {
|
|
30996
31089
|
var txData, tx;
|
|
30997
|
-
return runtime_1.wrap(function
|
|
31090
|
+
return runtime_1.wrap(function _callee52$(_context52) {
|
|
30998
31091
|
while (1) {
|
|
30999
|
-
switch (
|
|
31092
|
+
switch (_context52.prev = _context52.next) {
|
|
31000
31093
|
case 0:
|
|
31001
31094
|
if (options === void 0) {
|
|
31002
31095
|
options = null;
|
|
@@ -31008,27 +31101,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31008
31101
|
};
|
|
31009
31102
|
}
|
|
31010
31103
|
|
|
31011
|
-
|
|
31104
|
+
_context52.next = 4;
|
|
31012
31105
|
return getExitVestTxData(id);
|
|
31013
31106
|
|
|
31014
31107
|
case 4:
|
|
31015
|
-
txData =
|
|
31016
|
-
|
|
31108
|
+
txData = _context52.sent;
|
|
31109
|
+
_context52.next = 7;
|
|
31017
31110
|
return getPoolTxOrGasEstimate(this, [tokenAddress, txData, options], sdkOptions);
|
|
31018
31111
|
|
|
31019
31112
|
case 7:
|
|
31020
|
-
tx =
|
|
31021
|
-
return
|
|
31113
|
+
tx = _context52.sent;
|
|
31114
|
+
return _context52.abrupt("return", tx);
|
|
31022
31115
|
|
|
31023
31116
|
case 9:
|
|
31024
31117
|
case "end":
|
|
31025
|
-
return
|
|
31118
|
+
return _context52.stop();
|
|
31026
31119
|
}
|
|
31027
31120
|
}
|
|
31028
|
-
},
|
|
31121
|
+
}, _callee52, this);
|
|
31029
31122
|
}));
|
|
31030
31123
|
|
|
31031
|
-
function exitVestedToken(
|
|
31124
|
+
function exitVestedToken(_x250, _x251, _x252, _x253) {
|
|
31032
31125
|
return _exitVestedToken.apply(this, arguments);
|
|
31033
31126
|
}
|
|
31034
31127
|
|
|
@@ -31048,11 +31141,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31048
31141
|
_proto.mintUnitViaFlatMoney =
|
|
31049
31142
|
/*#__PURE__*/
|
|
31050
31143
|
function () {
|
|
31051
|
-
var _mintUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31144
|
+
var _mintUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee53(depositAmount, slippage, maxKeeperFeeInUsd, options, sdkOptions) {
|
|
31052
31145
|
var tx;
|
|
31053
|
-
return runtime_1.wrap(function
|
|
31146
|
+
return runtime_1.wrap(function _callee53$(_context53) {
|
|
31054
31147
|
while (1) {
|
|
31055
|
-
switch (
|
|
31148
|
+
switch (_context53.prev = _context53.next) {
|
|
31056
31149
|
case 0:
|
|
31057
31150
|
if (slippage === void 0) {
|
|
31058
31151
|
slippage = 0.5;
|
|
@@ -31068,22 +31161,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31068
31161
|
};
|
|
31069
31162
|
}
|
|
31070
31163
|
|
|
31071
|
-
|
|
31164
|
+
_context53.next = 5;
|
|
31072
31165
|
return mintUnitViaFlatMoney(this, depositAmount, slippage, maxKeeperFeeInUsd, options, sdkOptions);
|
|
31073
31166
|
|
|
31074
31167
|
case 5:
|
|
31075
|
-
tx =
|
|
31076
|
-
return
|
|
31168
|
+
tx = _context53.sent;
|
|
31169
|
+
return _context53.abrupt("return", tx);
|
|
31077
31170
|
|
|
31078
31171
|
case 7:
|
|
31079
31172
|
case "end":
|
|
31080
|
-
return
|
|
31173
|
+
return _context53.stop();
|
|
31081
31174
|
}
|
|
31082
31175
|
}
|
|
31083
|
-
},
|
|
31176
|
+
}, _callee53, this);
|
|
31084
31177
|
}));
|
|
31085
31178
|
|
|
31086
|
-
function mintUnitViaFlatMoney$1(
|
|
31179
|
+
function mintUnitViaFlatMoney$1(_x254, _x255, _x256, _x257, _x258) {
|
|
31087
31180
|
return _mintUnitViaFlatMoney2.apply(this, arguments);
|
|
31088
31181
|
}
|
|
31089
31182
|
|
|
@@ -31103,11 +31196,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31103
31196
|
_proto.redeemUnitViaFlatMoney =
|
|
31104
31197
|
/*#__PURE__*/
|
|
31105
31198
|
function () {
|
|
31106
|
-
var _redeemUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31199
|
+
var _redeemUnitViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee54(withdrawAmount, slippage, maxKeeperFeeInUsd, options, sdkOptions) {
|
|
31107
31200
|
var tx;
|
|
31108
|
-
return runtime_1.wrap(function
|
|
31201
|
+
return runtime_1.wrap(function _callee54$(_context54) {
|
|
31109
31202
|
while (1) {
|
|
31110
|
-
switch (
|
|
31203
|
+
switch (_context54.prev = _context54.next) {
|
|
31111
31204
|
case 0:
|
|
31112
31205
|
if (slippage === void 0) {
|
|
31113
31206
|
slippage = 0.5;
|
|
@@ -31123,22 +31216,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31123
31216
|
};
|
|
31124
31217
|
}
|
|
31125
31218
|
|
|
31126
|
-
|
|
31219
|
+
_context54.next = 5;
|
|
31127
31220
|
return redeemUnitViaFlatMoney(this, withdrawAmount, slippage, maxKeeperFeeInUsd, options, sdkOptions);
|
|
31128
31221
|
|
|
31129
31222
|
case 5:
|
|
31130
|
-
tx =
|
|
31131
|
-
return
|
|
31223
|
+
tx = _context54.sent;
|
|
31224
|
+
return _context54.abrupt("return", tx);
|
|
31132
31225
|
|
|
31133
31226
|
case 7:
|
|
31134
31227
|
case "end":
|
|
31135
|
-
return
|
|
31228
|
+
return _context54.stop();
|
|
31136
31229
|
}
|
|
31137
31230
|
}
|
|
31138
|
-
},
|
|
31231
|
+
}, _callee54, this);
|
|
31139
31232
|
}));
|
|
31140
31233
|
|
|
31141
|
-
function redeemUnitViaFlatMoney$1(
|
|
31234
|
+
function redeemUnitViaFlatMoney$1(_x259, _x260, _x261, _x262, _x263) {
|
|
31142
31235
|
return _redeemUnitViaFlatMoney2.apply(this, arguments);
|
|
31143
31236
|
}
|
|
31144
31237
|
|
|
@@ -31146,11 +31239,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31146
31239
|
}();
|
|
31147
31240
|
|
|
31148
31241
|
_proto.cancelOrderViaFlatMoney = /*#__PURE__*/function () {
|
|
31149
|
-
var _cancelOrderViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31242
|
+
var _cancelOrderViaFlatMoney2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee55(options, estimateGas) {
|
|
31150
31243
|
var tx;
|
|
31151
|
-
return runtime_1.wrap(function
|
|
31244
|
+
return runtime_1.wrap(function _callee55$(_context55) {
|
|
31152
31245
|
while (1) {
|
|
31153
|
-
switch (
|
|
31246
|
+
switch (_context55.prev = _context55.next) {
|
|
31154
31247
|
case 0:
|
|
31155
31248
|
if (options === void 0) {
|
|
31156
31249
|
options = null;
|
|
@@ -31160,22 +31253,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31160
31253
|
estimateGas = false;
|
|
31161
31254
|
}
|
|
31162
31255
|
|
|
31163
|
-
|
|
31256
|
+
_context55.next = 4;
|
|
31164
31257
|
return cancelOrderViaFlatMoney(this, options, estimateGas);
|
|
31165
31258
|
|
|
31166
31259
|
case 4:
|
|
31167
|
-
tx =
|
|
31168
|
-
return
|
|
31260
|
+
tx = _context55.sent;
|
|
31261
|
+
return _context55.abrupt("return", tx);
|
|
31169
31262
|
|
|
31170
31263
|
case 6:
|
|
31171
31264
|
case "end":
|
|
31172
|
-
return
|
|
31265
|
+
return _context55.stop();
|
|
31173
31266
|
}
|
|
31174
31267
|
}
|
|
31175
|
-
},
|
|
31268
|
+
}, _callee55, this);
|
|
31176
31269
|
}));
|
|
31177
31270
|
|
|
31178
|
-
function cancelOrderViaFlatMoney$1(
|
|
31271
|
+
function cancelOrderViaFlatMoney$1(_x264, _x265) {
|
|
31179
31272
|
return _cancelOrderViaFlatMoney2.apply(this, arguments);
|
|
31180
31273
|
}
|
|
31181
31274
|
|
|
@@ -31194,11 +31287,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31194
31287
|
_proto.completeTorosWithdrawal =
|
|
31195
31288
|
/*#__PURE__*/
|
|
31196
31289
|
function () {
|
|
31197
|
-
var _completeTorosWithdrawal = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
31290
|
+
var _completeTorosWithdrawal = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee56(destinationToken, slippage, options, sdkOptions) {
|
|
31198
31291
|
var txData, tx;
|
|
31199
|
-
return runtime_1.wrap(function
|
|
31292
|
+
return runtime_1.wrap(function _callee56$(_context56) {
|
|
31200
31293
|
while (1) {
|
|
31201
|
-
switch (
|
|
31294
|
+
switch (_context56.prev = _context56.next) {
|
|
31202
31295
|
case 0:
|
|
31203
31296
|
if (slippage === void 0) {
|
|
31204
31297
|
slippage = 0.5;
|
|
@@ -31214,27 +31307,27 @@ var Pool = /*#__PURE__*/function () {
|
|
|
31214
31307
|
};
|
|
31215
31308
|
}
|
|
31216
31309
|
|
|
31217
|
-
|
|
31310
|
+
_context56.next = 5;
|
|
31218
31311
|
return getCompleteWithdrawalTxData(this, destinationToken, slippage * 100, false);
|
|
31219
31312
|
|
|
31220
31313
|
case 5:
|
|
31221
|
-
txData =
|
|
31222
|
-
|
|
31314
|
+
txData = _context56.sent;
|
|
31315
|
+
_context56.next = 8;
|
|
31223
31316
|
return getPoolTxOrGasEstimate(this, [routerAddress[this.network].toros, txData, options], sdkOptions);
|
|
31224
31317
|
|
|
31225
31318
|
case 8:
|
|
31226
|
-
tx =
|
|
31227
|
-
return
|
|
31319
|
+
tx = _context56.sent;
|
|
31320
|
+
return _context56.abrupt("return", tx);
|
|
31228
31321
|
|
|
31229
31322
|
case 10:
|
|
31230
31323
|
case "end":
|
|
31231
|
-
return
|
|
31324
|
+
return _context56.stop();
|
|
31232
31325
|
}
|
|
31233
31326
|
}
|
|
31234
|
-
},
|
|
31327
|
+
}, _callee56, this);
|
|
31235
31328
|
}));
|
|
31236
31329
|
|
|
31237
|
-
function completeTorosWithdrawal(
|
|
31330
|
+
function completeTorosWithdrawal(_x266, _x267, _x268, _x269) {
|
|
31238
31331
|
return _completeTorosWithdrawal.apply(this, arguments);
|
|
31239
31332
|
}
|
|
31240
31333
|
|