@dhedge/v2-sdk 1.10.2 → 1.10.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.
@@ -4216,6 +4216,7 @@ var Dapp;
4216
4216
  Dapp["ZEROEX"] = "0x";
4217
4217
  Dapp["RAMSES"] = "ramses";
4218
4218
  Dapp["AERODROME"] = "aerodrome";
4219
+ Dapp["AERODROMECL"] = "aerodromeCL";
4219
4220
  })(Dapp || (Dapp = {}));
4220
4221
 
4221
4222
  var Transaction;
@@ -4251,7 +4252,7 @@ var routerAddress = (_routerAddress = {}, _routerAddress[Network.POLYGON] = (_Ne
4251
4252
  var dappFactoryAddress = (_dappFactoryAddress = {}, _dappFactoryAddress[Network.POLYGON] = (_Network$POLYGON2 = {}, _Network$POLYGON2[Dapp.SUSHISWAP] = "0xc35DADB65012eC5796536bD9864eD8773aBc74C4", _Network$POLYGON2[Dapp.QUICKSWAP] = "0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32", _Network$POLYGON2), _dappFactoryAddress[Network.OPTIMISM] = {}, _dappFactoryAddress[Network.ARBITRUM] = {}, _dappFactoryAddress[Network.BASE] = {}, _dappFactoryAddress);
4252
4253
  var stakingAddress = (_stakingAddress = {}, _stakingAddress[Network.POLYGON] = (_Network$POLYGON3 = {}, _Network$POLYGON3[Dapp.SUSHISWAP] = "0x0769fd68dFb93167989C6f7254cd0D766Fb2841F", _Network$POLYGON3[Dapp.BALANCER] = "0x0F3e0c4218b7b0108a3643cFe9D3ec0d4F57c54e", _Network$POLYGON3[Dapp.AAVE] = "0x357D51124f59836DeD84c8a1730D72B749d8BC23", _Network$POLYGON3[Dapp.AAVEV3] = "0x929EC64c34a17401F460460D4B9390518E5B473e", _Network$POLYGON3), _stakingAddress[Network.OPTIMISM] = (_Network$OPTIMISM2 = {}, _Network$OPTIMISM2[Dapp.AAVEV3] = "0x929EC64c34a17401F460460D4B9390518E5B473e", _Network$OPTIMISM2), _stakingAddress[Network.ARBITRUM] = {}, _stakingAddress[Network.BASE] = {}, _stakingAddress);
4253
4254
  var aaveAddressProvider = (_aaveAddressProvider = {}, _aaveAddressProvider[Network.POLYGON] = (_Network$POLYGON4 = {}, _Network$POLYGON4[Dapp.AAVE] = "0xd05e3E715d945B59290df0ae8eF85c1BdB684744", _Network$POLYGON4[Dapp.AAVEV3] = "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb", _Network$POLYGON4), _aaveAddressProvider[Network.OPTIMISM] = (_Network$OPTIMISM3 = {}, _Network$OPTIMISM3[Dapp.AAVEV3] = "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb", _Network$OPTIMISM3), _aaveAddressProvider[Network.ARBITRUM] = (_Network$ARBITRUM2 = {}, _Network$ARBITRUM2[Dapp.AAVEV3] = "0xa97684ead0e402dc232d5a977953df7ecbab3cdb", _Network$ARBITRUM2), _aaveAddressProvider[Network.BASE] = (_Network$BASE2 = {}, _Network$BASE2[Dapp.AAVEV3] = "0xe20fCBdBfFC4Dd138cE8b2E6FBb6CB49777ad64D", _Network$BASE2), _aaveAddressProvider);
4254
- var nonfungiblePositionManagerAddress = (_nonfungiblePositionM = {}, _nonfungiblePositionM[Network.POLYGON] = (_Network$POLYGON5 = {}, _Network$POLYGON5[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$POLYGON5), _nonfungiblePositionM[Network.OPTIMISM] = (_Network$OPTIMISM4 = {}, _Network$OPTIMISM4[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$OPTIMISM4[Dapp.VELODROMECL] = "0x416b433906b1B72FA758e166e239c43d68dC6F29", _Network$OPTIMISM4), _nonfungiblePositionM[Network.ARBITRUM] = (_Network$ARBITRUM3 = {}, _Network$ARBITRUM3[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$ARBITRUM3), _nonfungiblePositionM[Network.BASE] = (_Network$BASE3 = {}, _Network$BASE3[Dapp.UNISWAPV3] = "0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1", _Network$BASE3), _nonfungiblePositionM);
4255
+ var nonfungiblePositionManagerAddress = (_nonfungiblePositionM = {}, _nonfungiblePositionM[Network.POLYGON] = (_Network$POLYGON5 = {}, _Network$POLYGON5[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$POLYGON5), _nonfungiblePositionM[Network.OPTIMISM] = (_Network$OPTIMISM4 = {}, _Network$OPTIMISM4[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$OPTIMISM4[Dapp.VELODROMECL] = "0x416b433906b1B72FA758e166e239c43d68dC6F29", _Network$OPTIMISM4), _nonfungiblePositionM[Network.ARBITRUM] = (_Network$ARBITRUM3 = {}, _Network$ARBITRUM3[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$ARBITRUM3), _nonfungiblePositionM[Network.BASE] = (_Network$BASE3 = {}, _Network$BASE3[Dapp.UNISWAPV3] = "0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1", _Network$BASE3[Dapp.AERODROMECL] = "0x827922686190790b37229fd06084350e74485b72", _Network$BASE3), _nonfungiblePositionM);
4255
4256
  var networkChainIdMap = (_networkChainIdMap = {}, _networkChainIdMap[Network.POLYGON] = 137, _networkChainIdMap[Network.OPTIMISM] = 10, _networkChainIdMap[Network.ARBITRUM] = 42161, _networkChainIdMap[Network.BASE] = 8453, _networkChainIdMap);
4256
4257
  var balancerSubgraph = (_balancerSubgraph = {}, _balancerSubgraph[Network.POLYGON] = "https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-polygon-v2", _balancerSubgraph[Network.OPTIMISM] = "", _balancerSubgraph[Network.ARBITRUM] = "", _balancerSubgraph[Network.BASE] = "", _balancerSubgraph);
4257
4258
  var multiCallAddress = (_multiCallAddress = {}, _multiCallAddress[Network.POLYGON] = "0x275617327c958bD06b5D6b871E7f491D76113dd8", _multiCallAddress[Network.OPTIMISM] = "", _multiCallAddress[Network.ARBITRUM] = "", _multiCallAddress[Network.BASE] = "", _multiCallAddress);
@@ -8864,7 +8865,7 @@ function _getUniswapV3MintTxData() {
8864
8865
  mintParams = [_context.t0, _context.t1, _context.t2, _context.t3, _context.t4, _context.t5, _context.t6, "0", "0", _context.t7, _context.t8];
8865
8866
  iNonfungiblePositionManager = new ethers.utils.Interface(INonfungiblePositionManager.abi);
8866
8867
 
8867
- if (dapp === Dapp.VELODROMECL) {
8868
+ if (dapp === Dapp.VELODROMECL || dapp === Dapp.AERODROMECL) {
8868
8869
  iNonfungiblePositionManager = new ethers.utils.Interface(IVeldodromePositionManager.abi);
8869
8870
  mintParams.push(0);
8870
8871
  }
@@ -8923,7 +8924,7 @@ function _getIncreaseLiquidityTxData() {
8923
8924
  while (1) {
8924
8925
  switch (_context3.prev = _context3.next) {
8925
8926
  case 0:
8926
- if (!(dapp === Dapp.UNISWAPV3 || dapp === Dapp.VELODROMECL)) {
8927
+ if (!(dapp === Dapp.UNISWAPV3 || dapp === Dapp.VELODROMECL || dapp === Dapp.AERODROMECL)) {
8927
8928
  _context3.next = 15;
8928
8929
  break;
8929
8930
  }
@@ -8988,7 +8989,7 @@ function _getDecreaseLiquidityTxData() {
8988
8989
  amount = 100;
8989
8990
  }
8990
8991
 
8991
- if (!(dapp === Dapp.UNISWAPV3 || dapp === Dapp.VELODROMECL)) {
8992
+ if (!(dapp === Dapp.UNISWAPV3 || dapp === Dapp.VELODROMECL || dapp === Dapp.AERODROMECL)) {
8992
8993
  _context4.next = 22;
8993
8994
  break;
8994
8995
  }
@@ -14777,19 +14778,19 @@ function _getVelodromeRemoveLiquidityTxData() {
14777
14778
  return _getVelodromeRemoveLiquidityTxData.apply(this, arguments);
14778
14779
  }
14779
14780
 
14780
- function getVelodromeClOwner(_x12, _x13) {
14781
+ function getVelodromeClOwner(_x12, _x13, _x14) {
14781
14782
  return _getVelodromeClOwner.apply(this, arguments);
14782
14783
  }
14783
14784
 
14784
14785
  function _getVelodromeClOwner() {
14785
- _getVelodromeClOwner = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(pool, tokenId) {
14786
+ _getVelodromeClOwner = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(pool, dapp, tokenId) {
14786
14787
  var iNonfungiblePositionManager;
14787
14788
  return runtime_1.wrap(function _callee3$(_context3) {
14788
14789
  while (1) {
14789
14790
  switch (_context3.prev = _context3.next) {
14790
14791
  case 0:
14791
14792
  iNonfungiblePositionManager = new ethers.Contract( // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
14792
- nonfungiblePositionManagerAddress[pool.network][Dapp.VELODROMECL], INonfungiblePositionManager.abi, pool.signer);
14793
+ nonfungiblePositionManagerAddress[pool.network][dapp], INonfungiblePositionManager.abi, pool.signer);
14793
14794
  _context3.next = 3;
14794
14795
  return iNonfungiblePositionManager.ownerOf(tokenId);
14795
14796
 
@@ -24802,7 +24803,7 @@ var Pool = /*#__PURE__*/function () {
24802
24803
  }
24803
24804
 
24804
24805
  _context14.t0 = dapp;
24805
- _context14.next = _context14.t0 === Dapp.BALANCER ? 5 : _context14.t0 === Dapp.VELODROME ? 8 : _context14.t0 === Dapp.RAMSES ? 8 : _context14.t0 === Dapp.VELODROMEV2 ? 10 : _context14.t0 === Dapp.AERODROME ? 10 : _context14.t0 === Dapp.VELODROMECL ? 10 : 12;
24806
+ _context14.next = _context14.t0 === Dapp.BALANCER ? 5 : _context14.t0 === Dapp.VELODROME ? 8 : _context14.t0 === Dapp.RAMSES ? 8 : _context14.t0 === Dapp.VELODROMEV2 ? 10 : _context14.t0 === Dapp.AERODROME ? 10 : _context14.t0 === Dapp.VELODROMECL ? 10 : _context14.t0 === Dapp.AERODROMECL ? 10 : 12;
24806
24807
  break;
24807
24808
 
24808
24809
  case 5:
@@ -25570,7 +25571,7 @@ var Pool = /*#__PURE__*/function () {
25570
25571
  }()
25571
25572
  /**
25572
25573
  * Create UniswapV3 liquidity pool
25573
- * @param {dapp} Platform either UniswapV3 or VelodromeCL
25574
+ * @param {dapp} Platform UniswapV3, VelodromeCL or AerodromeCL
25574
25575
  * @param {string} assetA First asset
25575
25576
  * @param {string} assetB Second asset
25576
25577
  * @param {BigNumber | string} amountA Amount first asset
@@ -25611,12 +25612,12 @@ var Pool = /*#__PURE__*/function () {
25611
25612
  throw new Error("Need to provide price or tick range");
25612
25613
 
25613
25614
  case 4:
25614
- if (!((minPrice || maxPrice) && dapp === Dapp.VELODROMECL)) {
25615
+ if (!((minPrice || maxPrice) && dapp !== Dapp.UNISWAPV3)) {
25615
25616
  _context28.next = 6;
25616
25617
  break;
25617
25618
  }
25618
25619
 
25619
- throw new Error("no price conversion for Velodrome CL");
25620
+ throw new Error("no price conversion for Aerodrome/Velodrome CL");
25620
25621
 
25621
25622
  case 6:
25622
25623
  _context28.next = 8;
@@ -25679,7 +25680,7 @@ var Pool = /*#__PURE__*/function () {
25679
25680
 
25680
25681
  isStaked = false;
25681
25682
  _context29.t0 = dapp;
25682
- _context29.next = _context29.t0 === Dapp.UNISWAPV3 ? 7 : _context29.t0 === Dapp.VELODROMECL ? 9 : _context29.t0 === Dapp.ARRAKIS ? 14 : 16;
25683
+ _context29.next = _context29.t0 === Dapp.UNISWAPV3 ? 7 : _context29.t0 === Dapp.VELODROMECL ? 9 : _context29.t0 === Dapp.AERODROMECL ? 9 : _context29.t0 === Dapp.ARRAKIS ? 14 : 16;
25683
25684
  break;
25684
25685
 
25685
25686
  case 7:
@@ -25688,7 +25689,7 @@ var Pool = /*#__PURE__*/function () {
25688
25689
 
25689
25690
  case 9:
25690
25691
  _context29.next = 11;
25691
- return getVelodromeClOwner(this, tokenId);
25692
+ return getVelodromeClOwner(this, dapp, tokenId);
25692
25693
 
25693
25694
  case 11:
25694
25695
  tokenIdOwner = _context29.sent;
@@ -25780,7 +25781,7 @@ var Pool = /*#__PURE__*/function () {
25780
25781
 
25781
25782
  isStaked = false;
25782
25783
  _context30.t0 = dapp;
25783
- _context30.next = _context30.t0 === Dapp.UNISWAPV3 ? 6 : _context30.t0 === Dapp.VELODROMECL ? 8 : _context30.t0 === Dapp.ARRAKIS ? 13 : 15;
25784
+ _context30.next = _context30.t0 === Dapp.UNISWAPV3 ? 6 : _context30.t0 === Dapp.VELODROMECL ? 8 : _context30.t0 === Dapp.AERODROMECL ? 8 : _context30.t0 === Dapp.ARRAKIS ? 13 : 15;
25784
25785
  break;
25785
25786
 
25786
25787
  case 6:
@@ -25789,7 +25790,7 @@ var Pool = /*#__PURE__*/function () {
25789
25790
 
25790
25791
  case 8:
25791
25792
  _context30.next = 10;
25792
- return getVelodromeClOwner(this, tokenId);
25793
+ return getVelodromeClOwner(this, dapp, tokenId);
25793
25794
 
25794
25795
  case 10:
25795
25796
  tokenIdOwner = _context30.sent;
@@ -25879,7 +25880,7 @@ var Pool = /*#__PURE__*/function () {
25879
25880
 
25880
25881
  iNonfungiblePositionManager = new ethers.utils.Interface(INonfungiblePositionManager.abi);
25881
25882
  _context31.t0 = dapp;
25882
- _context31.next = _context31.t0 === Dapp.UNISWAPV3 ? 6 : _context31.t0 === Dapp.ARRAKIS ? 9 : _context31.t0 === Dapp.BALANCER ? 9 : _context31.t0 === Dapp.VELODROME ? 13 : _context31.t0 === Dapp.RAMSES ? 13 : _context31.t0 === Dapp.VELODROMEV2 ? 16 : _context31.t0 === Dapp.AERODROME ? 16 : _context31.t0 === Dapp.VELODROMECL ? 19 : 24;
25883
+ _context31.next = _context31.t0 === Dapp.UNISWAPV3 ? 6 : _context31.t0 === Dapp.ARRAKIS ? 9 : _context31.t0 === Dapp.BALANCER ? 9 : _context31.t0 === Dapp.VELODROME ? 13 : _context31.t0 === Dapp.RAMSES ? 13 : _context31.t0 === Dapp.VELODROMEV2 ? 16 : _context31.t0 === Dapp.AERODROME ? 16 : _context31.t0 === Dapp.VELODROMECL ? 19 : _context31.t0 === Dapp.AERODROMECL ? 19 : 24;
25883
25884
  break;
25884
25885
 
25885
25886
  case 6:
@@ -25905,7 +25906,7 @@ var Pool = /*#__PURE__*/function () {
25905
25906
 
25906
25907
  case 19:
25907
25908
  _context31.next = 21;
25908
- return getVelodromeClOwner(this, tokenId);
25909
+ return getVelodromeClOwner(this, dapp, tokenId);
25909
25910
 
25910
25911
  case 21:
25911
25912
  tokenIdOwner = _context31.sent;