@dhedge/v2-sdk 1.9.3 → 1.9.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.
@@ -3922,6 +3922,7 @@ var Dapp;
3922
3922
  Dapp["VELODROMEV2"] = "velodromeV2";
3923
3923
  Dapp["LYRA"] = "lyra";
3924
3924
  Dapp["ZEROEX"] = "0x";
3925
+ Dapp["RAMSES"] = "ramses";
3925
3926
  })(Dapp || (Dapp = {}));
3926
3927
 
3927
3928
  var Transaction;
@@ -3953,7 +3954,7 @@ var _factoryAddress, _Network$POLYGON, _Network$OPTIMISM, _Network$ARBITRUM, _ro
3953
3954
  require("dotenv").config();
3954
3955
 
3955
3956
  var factoryAddress = (_factoryAddress = {}, _factoryAddress[Network.POLYGON] = process.env.STAGING_CONTRACTS ? "0xDd87eCdB10cFF7004276AAbAbd30e7a08F69bb53" : "0xfdc7b8bFe0DD3513Cc669bB8d601Cb83e2F69cB0", _factoryAddress[Network.OPTIMISM] = "0x5e61a079A178f0E5784107a4963baAe0c5a680c6", _factoryAddress[Network.ARBITRUM] = "0xfffb5fb14606eb3a548c113026355020ddf27535", _factoryAddress);
3956
- var routerAddress = (_routerAddress = {}, _routerAddress[Network.POLYGON] = (_Network$POLYGON = {}, _Network$POLYGON[Dapp.SUSHISWAP] = "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506", _Network$POLYGON[Dapp.AAVE] = "0x8dFf5E27EA6b7AC08EbFdf9eB090F32ee9a30fcf", _Network$POLYGON[Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$POLYGON[Dapp.ONEINCH] = "0x1111111254EEB25477B68fb85Ed929f73A960582", _Network$POLYGON[Dapp.QUICKSWAP] = "0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff", _Network$POLYGON[Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$POLYGON[Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$POLYGON[Dapp.ARRAKIS] = "0xc73fb100a995b33f9fa181d420f4c8d74506df66", _Network$POLYGON[Dapp.TOROS] = "0xB2F1498983bf9c9442c35F772e6C1AdE66a8DeDE", _Network$POLYGON[Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _Network$POLYGON), _routerAddress[Network.OPTIMISM] = (_Network$OPTIMISM = {}, _Network$OPTIMISM[Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$OPTIMISM[Dapp.SYNTHETIX] = "0x8700dAec35aF8Ff88c16BdF0418774CB3D7599B4", _Network$OPTIMISM[Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$OPTIMISM[Dapp.ONEINCH] = "0x1111111254EEB25477B68fb85Ed929f73A960582", _Network$OPTIMISM[Dapp.TOROS] = "0x3988513793bCE39f0167064A9F7fC3617FaF35AB", _Network$OPTIMISM[Dapp.VELODROME] = "0x9c12939390052919aF3155f41Bf4160Fd3666A6f", _Network$OPTIMISM[Dapp.VELODROMEV2] = "0xa062ae8a9c5e11aaa026fc2670b0d65ccc8b2858", _Network$OPTIMISM[Dapp.LYRA] = "0xCCE7819d65f348c64B7Beb205BA367b3fE33763B", _Network$OPTIMISM[Dapp.ARRAKIS] = "0x9ce88a56d120300061593eF7AD074A1B710094d5", _Network$OPTIMISM[Dapp.ZEROEX] = "0xdef1abe32c034e558cdd535791643c58a13acc10", _Network$OPTIMISM), _routerAddress[Network.ARBITRUM] = (_Network$ARBITRUM = {}, _Network$ARBITRUM[Dapp.ONEINCH] = "0x1111111254EEB25477B68fb85Ed929f73A960582", _Network$ARBITRUM[Dapp.UNISWAPV3] = "0xe592427a0aece92de3edee1f18e0157c05861564", _Network$ARBITRUM[Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$ARBITRUM[Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$ARBITRUM), _routerAddress);
3957
+ var routerAddress = (_routerAddress = {}, _routerAddress[Network.POLYGON] = (_Network$POLYGON = {}, _Network$POLYGON[Dapp.SUSHISWAP] = "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506", _Network$POLYGON[Dapp.AAVE] = "0x8dFf5E27EA6b7AC08EbFdf9eB090F32ee9a30fcf", _Network$POLYGON[Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$POLYGON[Dapp.ONEINCH] = "0x1111111254EEB25477B68fb85Ed929f73A960582", _Network$POLYGON[Dapp.QUICKSWAP] = "0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff", _Network$POLYGON[Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$POLYGON[Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$POLYGON[Dapp.ARRAKIS] = "0xc73fb100a995b33f9fa181d420f4c8d74506df66", _Network$POLYGON[Dapp.TOROS] = "0xB2F1498983bf9c9442c35F772e6C1AdE66a8DeDE", _Network$POLYGON[Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _Network$POLYGON), _routerAddress[Network.OPTIMISM] = (_Network$OPTIMISM = {}, _Network$OPTIMISM[Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$OPTIMISM[Dapp.SYNTHETIX] = "0x8700dAec35aF8Ff88c16BdF0418774CB3D7599B4", _Network$OPTIMISM[Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$OPTIMISM[Dapp.ONEINCH] = "0x1111111254EEB25477B68fb85Ed929f73A960582", _Network$OPTIMISM[Dapp.TOROS] = "0x3988513793bCE39f0167064A9F7fC3617FaF35AB", _Network$OPTIMISM[Dapp.VELODROME] = "0x9c12939390052919aF3155f41Bf4160Fd3666A6f", _Network$OPTIMISM[Dapp.VELODROMEV2] = "0xa062ae8a9c5e11aaa026fc2670b0d65ccc8b2858", _Network$OPTIMISM[Dapp.LYRA] = "0xCCE7819d65f348c64B7Beb205BA367b3fE33763B", _Network$OPTIMISM[Dapp.ARRAKIS] = "0x9ce88a56d120300061593eF7AD074A1B710094d5", _Network$OPTIMISM[Dapp.ZEROEX] = "0xdef1abe32c034e558cdd535791643c58a13acc10", _Network$OPTIMISM), _routerAddress[Network.ARBITRUM] = (_Network$ARBITRUM = {}, _Network$ARBITRUM[Dapp.ONEINCH] = "0x1111111254EEB25477B68fb85Ed929f73A960582", _Network$ARBITRUM[Dapp.UNISWAPV3] = "0xe592427a0aece92de3edee1f18e0157c05861564", _Network$ARBITRUM[Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$ARBITRUM[Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$ARBITRUM[Dapp.RAMSES] = "0xaaa87963efeb6f7e0a2711f397663105acb1805e", _Network$ARBITRUM), _routerAddress);
3957
3958
  var dappFactoryAddress = (_dappFactoryAddress = {}, _dappFactoryAddress[Network.POLYGON] = (_Network$POLYGON2 = {}, _Network$POLYGON2[Dapp.SUSHISWAP] = "0xc35DADB65012eC5796536bD9864eD8773aBc74C4", _Network$POLYGON2[Dapp.QUICKSWAP] = "0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32", _Network$POLYGON2), _dappFactoryAddress[Network.OPTIMISM] = {}, _dappFactoryAddress[Network.ARBITRUM] = {}, _dappFactoryAddress);
3958
3959
  var stakingAddress = (_stakingAddress = {}, _stakingAddress[Network.POLYGON] = (_Network$POLYGON3 = {}, _Network$POLYGON3[Dapp.SUSHISWAP] = "0x0769fd68dFb93167989C6f7254cd0D766Fb2841F", _Network$POLYGON3[Dapp.BALANCER] = "0x0F3e0c4218b7b0108a3643cFe9D3ec0d4F57c54e", _Network$POLYGON3[Dapp.AAVE] = "0x357D51124f59836DeD84c8a1730D72B749d8BC23", _Network$POLYGON3[Dapp.AAVEV3] = "0x929EC64c34a17401F460460D4B9390518E5B473e", _Network$POLYGON3), _stakingAddress[Network.OPTIMISM] = {}, _stakingAddress[Network.ARBITRUM] = {}, _stakingAddress);
3959
3960
  var aaveAddressProvider = (_aaveAddressProvider = {}, _aaveAddressProvider[Network.POLYGON] = (_Network$POLYGON4 = {}, _Network$POLYGON4[Dapp.AAVE] = "0xd05e3E715d945B59290df0ae8eF85c1BdB684744", _Network$POLYGON4[Dapp.AAVEV3] = "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb", _Network$POLYGON4), _aaveAddressProvider[Network.OPTIMISM] = (_Network$OPTIMISM2 = {}, _Network$OPTIMISM2[Dapp.AAVEV3] = "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb", _Network$OPTIMISM2), _aaveAddressProvider[Network.ARBITRUM] = (_Network$ARBITRUM2 = {}, _Network$ARBITRUM2[Dapp.AAVEV3] = "0xa97684ead0e402dc232d5a977953df7ecbab3cdb", _Network$ARBITRUM2), _aaveAddressProvider);
@@ -19617,6 +19618,119 @@ function _getOneInchSwapTxData() {
19617
19618
  return _getOneInchSwapTxData.apply(this, arguments);
19618
19619
  }
19619
19620
 
19621
+ var abi$q = [
19622
+ {
19623
+ inputs: [
19624
+ {
19625
+ internalType: "uint256",
19626
+ name: "_amount",
19627
+ type: "uint256"
19628
+ }
19629
+ ],
19630
+ name: "createVest",
19631
+ outputs: [
19632
+ ],
19633
+ stateMutability: "nonpayable",
19634
+ type: "function"
19635
+ },
19636
+ {
19637
+ inputs: [
19638
+ {
19639
+ internalType: "uint256",
19640
+ name: "_vestID",
19641
+ type: "uint256"
19642
+ },
19643
+ {
19644
+ internalType: "bool",
19645
+ name: "_ve",
19646
+ type: "bool"
19647
+ }
19648
+ ],
19649
+ name: "exitVest",
19650
+ outputs: [
19651
+ {
19652
+ internalType: "bool",
19653
+ name: "",
19654
+ type: "bool"
19655
+ }
19656
+ ],
19657
+ stateMutability: "nonpayable",
19658
+ type: "function"
19659
+ },
19660
+ {
19661
+ inputs: [
19662
+ {
19663
+ internalType: "address",
19664
+ name: "_user",
19665
+ type: "address"
19666
+ }
19667
+ ],
19668
+ name: "usersTotalVests",
19669
+ outputs: [
19670
+ {
19671
+ internalType: "uint256",
19672
+ name: "",
19673
+ type: "uint256"
19674
+ }
19675
+ ],
19676
+ stateMutability: "view",
19677
+ type: "function"
19678
+ },
19679
+ {
19680
+ inputs: [
19681
+ {
19682
+ internalType: "address",
19683
+ name: "user",
19684
+ type: "address"
19685
+ }
19686
+ ],
19687
+ name: "vestInfo",
19688
+ outputs: [
19689
+ {
19690
+ components: [
19691
+ {
19692
+ internalType: "uint256",
19693
+ name: "amount",
19694
+ type: "uint256"
19695
+ },
19696
+ {
19697
+ internalType: "uint256",
19698
+ name: "start",
19699
+ type: "uint256"
19700
+ },
19701
+ {
19702
+ internalType: "uint256",
19703
+ name: "maxEnd",
19704
+ type: "uint256"
19705
+ },
19706
+ {
19707
+ internalType: "uint256",
19708
+ name: "vestID",
19709
+ type: "uint256"
19710
+ }
19711
+ ],
19712
+ internalType: "struct IXRam.VestPosition[]",
19713
+ name: "",
19714
+ type: "tuple[]"
19715
+ }
19716
+ ],
19717
+ stateMutability: "view",
19718
+ type: "function"
19719
+ }
19720
+ ];
19721
+ var IXRam = {
19722
+ abi: abi$q
19723
+ };
19724
+
19725
+ /* eslint-disable @typescript-eslint/no-explicit-any */
19726
+ var iXRam = /*#__PURE__*/new ethers.utils.Interface(IXRam.abi);
19727
+ function getCreateVestTxData(amount) {
19728
+ return iXRam.encodeFunctionData("createVest", [amount]);
19729
+ }
19730
+ function getExitVestTxData(vestId) {
19731
+ return iXRam.encodeFunctionData("exitVest", [vestId, false]);
19732
+ }
19733
+
19620
19734
  var Pool = /*#__PURE__*/function () {
19621
19735
  function Pool(network, signer, poolLogic, mangerLogic, utils, factory) {
19622
19736
  this.network = network;
@@ -20306,7 +20420,7 @@ var Pool = /*#__PURE__*/function () {
20306
20420
  }
20307
20421
 
20308
20422
  _context13.t0 = dapp;
20309
- _context13.next = _context13.t0 === Dapp.BALANCER ? 4 : _context13.t0 === Dapp.VELODROME ? 7 : _context13.t0 === Dapp.VELODROMEV2 ? 9 : 11;
20423
+ _context13.next = _context13.t0 === Dapp.BALANCER ? 4 : _context13.t0 === Dapp.VELODROME ? 7 : _context13.t0 === Dapp.RAMSES ? 7 : _context13.t0 === Dapp.VELODROMEV2 ? 9 : 11;
20310
20424
  break;
20311
20425
 
20312
20426
  case 4:
@@ -21261,7 +21375,7 @@ var Pool = /*#__PURE__*/function () {
21261
21375
  }
21262
21376
 
21263
21377
  _context30.t0 = dapp;
21264
- _context30.next = _context30.t0 === Dapp.UNISWAPV3 ? 4 : _context30.t0 === Dapp.ARRAKIS ? 8 : _context30.t0 === Dapp.BALANCER ? 8 : _context30.t0 === Dapp.VELODROME ? 12 : _context30.t0 === Dapp.VELODROMEV2 ? 15 : 18;
21378
+ _context30.next = _context30.t0 === Dapp.UNISWAPV3 ? 4 : _context30.t0 === Dapp.ARRAKIS ? 8 : _context30.t0 === Dapp.BALANCER ? 8 : _context30.t0 === Dapp.VELODROME ? 12 : _context30.t0 === Dapp.RAMSES ? 12 : _context30.t0 === Dapp.VELODROMEV2 ? 15 : 18;
21265
21379
  break;
21266
21380
 
21267
21381
  case 4:
@@ -21581,6 +21695,115 @@ var Pool = /*#__PURE__*/function () {
21581
21695
 
21582
21696
  return removeLiquidityVelodromeV2;
21583
21697
  }()
21698
+ /**
21699
+ * Add liquidity to Velodrome V2 or Ramses pool
21700
+ * @param {Dapp} dapp VelodromeV2 or Ramses
21701
+ * @param {string} assetA First asset
21702
+ * @param {string} assetB Second asset
21703
+ * @param {BigNumber | string} amountA Amount first asset
21704
+ * @param {BigNumber | string} amountB Amount second asset
21705
+ * @param { boolean } isStable Is stable pool
21706
+ * @param {any} options Transaction options
21707
+ * @returns {Promise<any>} Transaction
21708
+ */
21709
+ ;
21710
+
21711
+ _proto.addLiquidityV2 =
21712
+ /*#__PURE__*/
21713
+ function () {
21714
+ var _addLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(dapp, assetA, assetB, amountA, amountB, isStable, options) {
21715
+ var tx;
21716
+ return runtime_1.wrap(function _callee36$(_context36) {
21717
+ while (1) {
21718
+ switch (_context36.prev = _context36.next) {
21719
+ case 0:
21720
+ if (options === void 0) {
21721
+ options = null;
21722
+ }
21723
+
21724
+ _context36.t0 = this.poolLogic;
21725
+ _context36.t1 = routerAddress[this.network][dapp];
21726
+ _context36.next = 5;
21727
+ return getVelodromeAddLiquidityTxData(this, assetA, assetB, amountA, amountB, isStable);
21728
+
21729
+ case 5:
21730
+ _context36.t2 = _context36.sent;
21731
+ _context36.t3 = options;
21732
+ _context36.next = 9;
21733
+ return _context36.t0.execTransaction.call(_context36.t0, _context36.t1, _context36.t2, _context36.t3);
21734
+
21735
+ case 9:
21736
+ tx = _context36.sent;
21737
+ return _context36.abrupt("return", tx);
21738
+
21739
+ case 11:
21740
+ case "end":
21741
+ return _context36.stop();
21742
+ }
21743
+ }
21744
+ }, _callee36, this);
21745
+ }));
21746
+
21747
+ function addLiquidityV2(_x145, _x146, _x147, _x148, _x149, _x150, _x151) {
21748
+ return _addLiquidityV.apply(this, arguments);
21749
+ }
21750
+
21751
+ return addLiquidityV2;
21752
+ }()
21753
+ /**
21754
+ * Remove liquidity from Velodrome V2 or Ramses pool
21755
+ * @param {Dapp} dapp VelodromeV2 or Ramses
21756
+ * @param {string} assetA First asset
21757
+ * @param {string} assetB Second asset
21758
+ * @param {BigNumber | string} amount Amount of LP tokens
21759
+ * @param { boolean } isStable Is stable pool
21760
+ * @param {any} options Transaction options
21761
+ * @returns {Promise<any>} Transaction
21762
+ */
21763
+ ;
21764
+
21765
+ _proto.removeLiquidityV2 =
21766
+ /*#__PURE__*/
21767
+ function () {
21768
+ var _removeLiquidityV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee37(dapp, assetA, assetB, amount, isStable, options) {
21769
+ var tx;
21770
+ return runtime_1.wrap(function _callee37$(_context37) {
21771
+ while (1) {
21772
+ switch (_context37.prev = _context37.next) {
21773
+ case 0:
21774
+ if (options === void 0) {
21775
+ options = null;
21776
+ }
21777
+
21778
+ _context37.t0 = this.poolLogic;
21779
+ _context37.t1 = routerAddress[this.network][dapp];
21780
+ _context37.next = 5;
21781
+ return getVelodromeRemoveLiquidityTxData(this, assetA, assetB, amount, isStable);
21782
+
21783
+ case 5:
21784
+ _context37.t2 = _context37.sent;
21785
+ _context37.t3 = options;
21786
+ _context37.next = 9;
21787
+ return _context37.t0.execTransaction.call(_context37.t0, _context37.t1, _context37.t2, _context37.t3);
21788
+
21789
+ case 9:
21790
+ tx = _context37.sent;
21791
+ return _context37.abrupt("return", tx);
21792
+
21793
+ case 11:
21794
+ case "end":
21795
+ return _context37.stop();
21796
+ }
21797
+ }
21798
+ }, _callee37, this);
21799
+ }));
21800
+
21801
+ function removeLiquidityV2(_x152, _x153, _x154, _x155, _x156, _x157) {
21802
+ return _removeLiquidityV.apply(this, arguments);
21803
+ }
21804
+
21805
+ return removeLiquidityV2;
21806
+ }()
21584
21807
  /**
21585
21808
  * Trade options on lyra
21586
21809
  * @param {LyraOptionMarket} market Underlying market e.g. eth
@@ -21600,11 +21823,11 @@ var Pool = /*#__PURE__*/function () {
21600
21823
  _proto.tradeLyraOption =
21601
21824
  /*#__PURE__*/
21602
21825
  function () {
21603
- var _tradeLyraOption = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(market, expiry, strike, optionType, tradeType, optionAmount, assetIn, collateralChangeAmount, isCoveredCall, options) {
21826
+ var _tradeLyraOption = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(market, expiry, strike, optionType, tradeType, optionAmount, assetIn, collateralChangeAmount, isCoveredCall, options) {
21604
21827
  var swapxData, tx;
21605
- return runtime_1.wrap(function _callee36$(_context36) {
21828
+ return runtime_1.wrap(function _callee38$(_context38) {
21606
21829
  while (1) {
21607
- switch (_context36.prev = _context36.next) {
21830
+ switch (_context38.prev = _context38.next) {
21608
21831
  case 0:
21609
21832
  if (collateralChangeAmount === void 0) {
21610
21833
  collateralChangeAmount = "0";
@@ -21618,27 +21841,27 @@ var Pool = /*#__PURE__*/function () {
21618
21841
  options = null;
21619
21842
  }
21620
21843
 
21621
- _context36.next = 5;
21844
+ _context38.next = 5;
21622
21845
  return getLyraOptionTxData(this, market, optionType, expiry, strike, tradeType, optionAmount, assetIn, BigNumber.from(collateralChangeAmount), isCoveredCall);
21623
21846
 
21624
21847
  case 5:
21625
- swapxData = _context36.sent;
21626
- _context36.next = 8;
21848
+ swapxData = _context38.sent;
21849
+ _context38.next = 8;
21627
21850
  return this.poolLogic.execTransaction(routerAddress[this.network][Dapp.LYRA], swapxData, options);
21628
21851
 
21629
21852
  case 8:
21630
- tx = _context36.sent;
21631
- return _context36.abrupt("return", tx);
21853
+ tx = _context38.sent;
21854
+ return _context38.abrupt("return", tx);
21632
21855
 
21633
21856
  case 10:
21634
21857
  case "end":
21635
- return _context36.stop();
21858
+ return _context38.stop();
21636
21859
  }
21637
21860
  }
21638
- }, _callee36, this);
21861
+ }, _callee38, this);
21639
21862
  }));
21640
21863
 
21641
- function tradeLyraOption(_x145, _x146, _x147, _x148, _x149, _x150, _x151, _x152, _x153, _x154) {
21864
+ function tradeLyraOption(_x158, _x159, _x160, _x161, _x162, _x163, _x164, _x165, _x166, _x167) {
21642
21865
  return _tradeLyraOption.apply(this, arguments);
21643
21866
  }
21644
21867
 
@@ -21653,26 +21876,26 @@ var Pool = /*#__PURE__*/function () {
21653
21876
  _proto.getLyraPositions =
21654
21877
  /*#__PURE__*/
21655
21878
  function () {
21656
- var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee37(market) {
21657
- return runtime_1.wrap(function _callee37$(_context37) {
21879
+ var _getLyraPositions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee39(market) {
21880
+ return runtime_1.wrap(function _callee39$(_context39) {
21658
21881
  while (1) {
21659
- switch (_context37.prev = _context37.next) {
21882
+ switch (_context39.prev = _context39.next) {
21660
21883
  case 0:
21661
- _context37.next = 2;
21884
+ _context39.next = 2;
21662
21885
  return getOptionPositions(this, market);
21663
21886
 
21664
21887
  case 2:
21665
- return _context37.abrupt("return", _context37.sent);
21888
+ return _context39.abrupt("return", _context39.sent);
21666
21889
 
21667
21890
  case 3:
21668
21891
  case "end":
21669
- return _context37.stop();
21892
+ return _context39.stop();
21670
21893
  }
21671
21894
  }
21672
- }, _callee37, this);
21895
+ }, _callee39, this);
21673
21896
  }));
21674
21897
 
21675
- function getLyraPositions(_x155) {
21898
+ function getLyraPositions(_x168) {
21676
21899
  return _getLyraPositions.apply(this, arguments);
21677
21900
  }
21678
21901
 
@@ -21690,32 +21913,32 @@ var Pool = /*#__PURE__*/function () {
21690
21913
  _proto.changeFuturesMargin =
21691
21914
  /*#__PURE__*/
21692
21915
  function () {
21693
- var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(market, changeAmount, options) {
21916
+ var _changeFuturesMargin = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee40(market, changeAmount, options) {
21694
21917
  var tx;
21695
- return runtime_1.wrap(function _callee38$(_context38) {
21918
+ return runtime_1.wrap(function _callee40$(_context40) {
21696
21919
  while (1) {
21697
- switch (_context38.prev = _context38.next) {
21920
+ switch (_context40.prev = _context40.next) {
21698
21921
  case 0:
21699
21922
  if (options === void 0) {
21700
21923
  options = null;
21701
21924
  }
21702
21925
 
21703
- _context38.next = 3;
21926
+ _context40.next = 3;
21704
21927
  return this.poolLogic.execTransaction(market, getFuturesChangeMarginTxData(changeAmount), options);
21705
21928
 
21706
21929
  case 3:
21707
- tx = _context38.sent;
21708
- return _context38.abrupt("return", tx);
21930
+ tx = _context40.sent;
21931
+ return _context40.abrupt("return", tx);
21709
21932
 
21710
21933
  case 5:
21711
21934
  case "end":
21712
- return _context38.stop();
21935
+ return _context40.stop();
21713
21936
  }
21714
21937
  }
21715
- }, _callee38, this);
21938
+ }, _callee40, this);
21716
21939
  }));
21717
21940
 
21718
- function changeFuturesMargin(_x156, _x157, _x158) {
21941
+ function changeFuturesMargin(_x169, _x170, _x171) {
21719
21942
  return _changeFuturesMargin.apply(this, arguments);
21720
21943
  }
21721
21944
 
@@ -21733,37 +21956,37 @@ var Pool = /*#__PURE__*/function () {
21733
21956
  _proto.changeFuturesPosition =
21734
21957
  /*#__PURE__*/
21735
21958
  function () {
21736
- var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee39(market, changeAmount, options) {
21959
+ var _changeFuturesPosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee41(market, changeAmount, options) {
21737
21960
  var txData, tx;
21738
- return runtime_1.wrap(function _callee39$(_context39) {
21961
+ return runtime_1.wrap(function _callee41$(_context41) {
21739
21962
  while (1) {
21740
- switch (_context39.prev = _context39.next) {
21963
+ switch (_context41.prev = _context41.next) {
21741
21964
  case 0:
21742
21965
  if (options === void 0) {
21743
21966
  options = null;
21744
21967
  }
21745
21968
 
21746
- _context39.next = 3;
21969
+ _context41.next = 3;
21747
21970
  return getFuturesChangePositionTxData(changeAmount, market, this);
21748
21971
 
21749
21972
  case 3:
21750
- txData = _context39.sent;
21751
- _context39.next = 6;
21973
+ txData = _context41.sent;
21974
+ _context41.next = 6;
21752
21975
  return this.poolLogic.execTransaction(market, txData, options);
21753
21976
 
21754
21977
  case 6:
21755
- tx = _context39.sent;
21756
- return _context39.abrupt("return", tx);
21978
+ tx = _context41.sent;
21979
+ return _context41.abrupt("return", tx);
21757
21980
 
21758
21981
  case 8:
21759
21982
  case "end":
21760
- return _context39.stop();
21983
+ return _context41.stop();
21761
21984
  }
21762
21985
  }
21763
- }, _callee39, this);
21986
+ }, _callee41, this);
21764
21987
  }));
21765
21988
 
21766
- function changeFuturesPosition(_x159, _x160, _x161) {
21989
+ function changeFuturesPosition(_x172, _x173, _x174) {
21767
21990
  return _changeFuturesPosition.apply(this, arguments);
21768
21991
  }
21769
21992
 
@@ -21780,37 +22003,37 @@ var Pool = /*#__PURE__*/function () {
21780
22003
  _proto.cancelFuturesOrder =
21781
22004
  /*#__PURE__*/
21782
22005
  function () {
21783
- var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee40(market, options) {
22006
+ var _cancelFuturesOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee42(market, options) {
21784
22007
  var txData, tx;
21785
- return runtime_1.wrap(function _callee40$(_context40) {
22008
+ return runtime_1.wrap(function _callee42$(_context42) {
21786
22009
  while (1) {
21787
- switch (_context40.prev = _context40.next) {
22010
+ switch (_context42.prev = _context42.next) {
21788
22011
  case 0:
21789
22012
  if (options === void 0) {
21790
22013
  options = null;
21791
22014
  }
21792
22015
 
21793
- _context40.next = 3;
22016
+ _context42.next = 3;
21794
22017
  return getFuturesCancelOrderTxData(this);
21795
22018
 
21796
22019
  case 3:
21797
- txData = _context40.sent;
21798
- _context40.next = 6;
22020
+ txData = _context42.sent;
22021
+ _context42.next = 6;
21799
22022
  return this.poolLogic.execTransaction(market, txData, options);
21800
22023
 
21801
22024
  case 6:
21802
- tx = _context40.sent;
21803
- return _context40.abrupt("return", tx);
22025
+ tx = _context42.sent;
22026
+ return _context42.abrupt("return", tx);
21804
22027
 
21805
22028
  case 8:
21806
22029
  case "end":
21807
- return _context40.stop();
22030
+ return _context42.stop();
21808
22031
  }
21809
22032
  }
21810
- }, _callee40, this);
22033
+ }, _callee42, this);
21811
22034
  }));
21812
22035
 
21813
- function cancelFuturesOrder(_x162, _x163) {
22036
+ function cancelFuturesOrder(_x175, _x176) {
21814
22037
  return _cancelFuturesOrder.apply(this, arguments);
21815
22038
  }
21816
22039
 
@@ -21826,32 +22049,32 @@ var Pool = /*#__PURE__*/function () {
21826
22049
  _proto.mintManagerFee =
21827
22050
  /*#__PURE__*/
21828
22051
  function () {
21829
- var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee41(options) {
22052
+ var _mintManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee43(options) {
21830
22053
  var tx;
21831
- return runtime_1.wrap(function _callee41$(_context41) {
22054
+ return runtime_1.wrap(function _callee43$(_context43) {
21832
22055
  while (1) {
21833
- switch (_context41.prev = _context41.next) {
22056
+ switch (_context43.prev = _context43.next) {
21834
22057
  case 0:
21835
22058
  if (options === void 0) {
21836
22059
  options = null;
21837
22060
  }
21838
22061
 
21839
- _context41.next = 3;
22062
+ _context43.next = 3;
21840
22063
  return this.poolLogic.mintManagerFee(options);
21841
22064
 
21842
22065
  case 3:
21843
- tx = _context41.sent;
21844
- return _context41.abrupt("return", tx);
22066
+ tx = _context43.sent;
22067
+ return _context43.abrupt("return", tx);
21845
22068
 
21846
22069
  case 5:
21847
22070
  case "end":
21848
- return _context41.stop();
22071
+ return _context43.stop();
21849
22072
  }
21850
22073
  }
21851
- }, _callee41, this);
22074
+ }, _callee43, this);
21852
22075
  }));
21853
22076
 
21854
- function mintManagerFee(_x164) {
22077
+ function mintManagerFee(_x177) {
21855
22078
  return _mintManagerFee.apply(this, arguments);
21856
22079
  }
21857
22080
 
@@ -21866,25 +22089,25 @@ var Pool = /*#__PURE__*/function () {
21866
22089
  _proto.getAvailableManagerFee =
21867
22090
  /*#__PURE__*/
21868
22091
  function () {
21869
- var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee42() {
22092
+ var _getAvailableManagerFee = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee44() {
21870
22093
  var fee;
21871
- return runtime_1.wrap(function _callee42$(_context42) {
22094
+ return runtime_1.wrap(function _callee44$(_context44) {
21872
22095
  while (1) {
21873
- switch (_context42.prev = _context42.next) {
22096
+ switch (_context44.prev = _context44.next) {
21874
22097
  case 0:
21875
- _context42.next = 2;
22098
+ _context44.next = 2;
21876
22099
  return this.poolLogic.availableManagerFee();
21877
22100
 
21878
22101
  case 2:
21879
- fee = _context42.sent;
21880
- return _context42.abrupt("return", BigNumber.from(fee));
22102
+ fee = _context44.sent;
22103
+ return _context44.abrupt("return", BigNumber.from(fee));
21881
22104
 
21882
22105
  case 4:
21883
22106
  case "end":
21884
- return _context42.stop();
22107
+ return _context44.stop();
21885
22108
  }
21886
22109
  }
21887
- }, _callee42, this);
22110
+ }, _callee44, this);
21888
22111
  }));
21889
22112
 
21890
22113
  function getAvailableManagerFee() {
@@ -21892,12 +22115,108 @@ var Pool = /*#__PURE__*/function () {
21892
22115
  }
21893
22116
 
21894
22117
  return getAvailableManagerFee;
22118
+ }()
22119
+ /** Vest tokens (e.g. Ramses xoRAM)
22120
+ *
22121
+ * @param {string} tokenAddress Address of the token to vest
22122
+ * @param {BigNumber | string } changeAmount Negative for short, positive for long
22123
+ * @param {any} options Transaction options
22124
+ * @returns {Promise<any>} Transaction
22125
+ */
22126
+ ;
22127
+
22128
+ _proto.vestTokens =
22129
+ /*#__PURE__*/
22130
+ function () {
22131
+ var _vestTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee45(tokenAddress, amount, options) {
22132
+ var txData, tx;
22133
+ return runtime_1.wrap(function _callee45$(_context45) {
22134
+ while (1) {
22135
+ switch (_context45.prev = _context45.next) {
22136
+ case 0:
22137
+ if (options === void 0) {
22138
+ options = null;
22139
+ }
22140
+
22141
+ _context45.next = 3;
22142
+ return getCreateVestTxData(amount);
22143
+
22144
+ case 3:
22145
+ txData = _context45.sent;
22146
+ _context45.next = 6;
22147
+ return this.poolLogic.execTransaction(tokenAddress, txData, options);
22148
+
22149
+ case 6:
22150
+ tx = _context45.sent;
22151
+ return _context45.abrupt("return", tx);
22152
+
22153
+ case 8:
22154
+ case "end":
22155
+ return _context45.stop();
22156
+ }
22157
+ }
22158
+ }, _callee45, this);
22159
+ }));
22160
+
22161
+ function vestTokens(_x178, _x179, _x180) {
22162
+ return _vestTokens.apply(this, arguments);
22163
+ }
22164
+
22165
+ return vestTokens;
22166
+ }()
22167
+ /** Exit position of vested tokens (e.g. Ramses xoRAM)
22168
+ *
22169
+ * @param {string} tokenAddress Address of the token to vest
22170
+ * @param {number } id position Id of the vested tokens
22171
+ * @param {any} options Transaction options
22172
+ * @returns {Promise<any>} Transaction
22173
+ */
22174
+ ;
22175
+
22176
+ _proto.exitVestedToken =
22177
+ /*#__PURE__*/
22178
+ function () {
22179
+ var _exitVestedToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee46(tokenAddress, id, options) {
22180
+ var txData, tx;
22181
+ return runtime_1.wrap(function _callee46$(_context46) {
22182
+ while (1) {
22183
+ switch (_context46.prev = _context46.next) {
22184
+ case 0:
22185
+ if (options === void 0) {
22186
+ options = null;
22187
+ }
22188
+
22189
+ _context46.next = 3;
22190
+ return getExitVestTxData(id);
22191
+
22192
+ case 3:
22193
+ txData = _context46.sent;
22194
+ _context46.next = 6;
22195
+ return this.poolLogic.execTransaction(tokenAddress, txData, options);
22196
+
22197
+ case 6:
22198
+ tx = _context46.sent;
22199
+ return _context46.abrupt("return", tx);
22200
+
22201
+ case 8:
22202
+ case "end":
22203
+ return _context46.stop();
22204
+ }
22205
+ }
22206
+ }, _callee46, this);
22207
+ }));
22208
+
22209
+ function exitVestedToken(_x181, _x182, _x183) {
22210
+ return _exitVestedToken.apply(this, arguments);
22211
+ }
22212
+
22213
+ return exitVestedToken;
21895
22214
  }();
21896
22215
 
21897
22216
  return Pool;
21898
22217
  }();
21899
22218
 
21900
- var abi$q = [
22219
+ var abi$r = [
21901
22220
  {
21902
22221
  inputs: [
21903
22222
  {
@@ -22121,10 +22440,10 @@ var abi$q = [
22121
22440
  }
22122
22441
  ];
22123
22442
  var UniswapV2Factory = {
22124
- abi: abi$q
22443
+ abi: abi$r
22125
22444
  };
22126
22445
 
22127
- var abi$r = [
22446
+ var abi$s = [
22128
22447
  {
22129
22448
  anonymous: false,
22130
22449
  inputs: [
@@ -22868,7 +23187,7 @@ var evm = {
22868
23187
  }
22869
23188
  };
22870
23189
  var UniswapV2Pair = {
22871
- abi: abi$r,
23190
+ abi: abi$s,
22872
23191
  evm: evm,
22873
23192
  "interface": [
22874
23193
  {
@@ -23599,7 +23918,7 @@ var UniswapV2Pair = {
23599
23918
  ]
23600
23919
  };
23601
23920
 
23602
- var abi$s = [
23921
+ var abi$t = [
23603
23922
  {
23604
23923
  inputs: [
23605
23924
  {
@@ -24794,7 +25113,7 @@ var abi$s = [
24794
25113
  }
24795
25114
  ];
24796
25115
  var IBalancerV2Vault = {
24797
- abi: abi$s
25116
+ abi: abi$t
24798
25117
  };
24799
25118
 
24800
25119
  var Utils = /*#__PURE__*/function () {