@dhedge/v2-sdk 1.10.7 → 1.10.8

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.
@@ -4256,6 +4256,7 @@ var Dapp;
4256
4256
  Dapp["AERODROME"] = "aerodrome";
4257
4257
  Dapp["AERODROMECL"] = "aerodromeCL";
4258
4258
  Dapp["RAMSESCL"] = "ramsesCL";
4259
+ Dapp["PANCAKECL"] = "pancakeCL";
4259
4260
  Dapp["COMPOUNDV3"] = "compoundV3";
4260
4261
  })(Dapp || (Dapp = {}));
4261
4262
 
@@ -4283,16 +4284,16 @@ var Transaction;
4283
4284
  Transaction["REMOVE_LIQUIDITY_UNSTAKE"] = "removeLiquidityAndUnstake";
4284
4285
  })(Transaction || (Transaction = {}));
4285
4286
 
4286
- var _factoryAddress, _Network$POLYGON, _Network$OPTIMISM, _Network$ARBITRUM, _Network$BASE, _routerAddress, _Network$POLYGON2, _dappFactoryAddress, _Network$POLYGON3, _Network$OPTIMISM2, _Network$ARBITRUM2, _stakingAddress, _Network$POLYGON4, _Network$OPTIMISM3, _Network$ARBITRUM3, _Network$BASE2, _aaveAddressProvider, _Network$POLYGON5, _Network$OPTIMISM4, _Network$ARBITRUM4, _Network$BASE3, _nonfungiblePositionM, _networkChainIdMap, _balancerSubgraph, _multiCallAddress, _lyraNetworkMap, _flatMoneyContractAdd;
4287
+ var _factoryAddress, _Network$POLYGON, _Network$OPTIMISM, _Network$ARBITRUM, _Network$BASE, _routerAddress, _Network$POLYGON2, _dappFactoryAddress, _Network$POLYGON3, _Network$OPTIMISM2, _Network$ARBITRUM2, _Network$BASE2, _stakingAddress, _Network$POLYGON4, _Network$OPTIMISM3, _Network$ARBITRUM3, _Network$BASE3, _aaveAddressProvider, _Network$POLYGON5, _Network$OPTIMISM4, _Network$ARBITRUM4, _Network$BASE4, _nonfungiblePositionM, _networkChainIdMap, _balancerSubgraph, _multiCallAddress, _lyraNetworkMap, _flatMoneyContractAdd;
4287
4288
 
4288
4289
  require("dotenv").config();
4289
4290
 
4290
4291
  var factoryAddress = (_factoryAddress = {}, _factoryAddress[Network.POLYGON] = process.env.STAGING_CONTRACTS ? "0xDd87eCdB10cFF7004276AAbAbd30e7a08F69bb53" : "0xfdc7b8bFe0DD3513Cc669bB8d601Cb83e2F69cB0", _factoryAddress[Network.OPTIMISM] = "0x5e61a079A178f0E5784107a4963baAe0c5a680c6", _factoryAddress[Network.ARBITRUM] = "0xfffb5fb14606eb3a548c113026355020ddf27535", _factoryAddress[Network.BASE] = "0x49Afe3abCf66CF09Fab86cb1139D8811C8afe56F", _factoryAddress);
4291
4292
  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] = "0x111111125421ca6dc452d289314280a0f8842a65", _Network$POLYGON[Dapp.QUICKSWAP] = "0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff", _Network$POLYGON[Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$POLYGON[Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$POLYGON[Dapp.ARRAKIS] = "0xc73fb100a995b33f9fa181d420f4c8d74506df66", _Network$POLYGON[Dapp.TOROS] = "0x45b90480D6F643dE2f128db091A357C3c90399f2", _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] = "0x111111125421ca6dc452d289314280a0f8842a65", _Network$OPTIMISM[Dapp.TOROS] = "0x2Ed1bd7f66e47113672f3870308b5E867C5bb743", _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] = "0x111111125421ca6dc452d289314280a0f8842a65", _Network$ARBITRUM[Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$ARBITRUM[Dapp.AAVEV3] = "0x794a61358D6845594F94dc1DB02A252b5b4814aD", _Network$ARBITRUM[Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$ARBITRUM[Dapp.RAMSES] = "0xaaa87963efeb6f7e0a2711f397663105acb1805e", _Network$ARBITRUM[Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _Network$ARBITRUM[Dapp.TOROS] = "0xA5679C4272A056Bb83f039961fae7D99C48529F5", _Network$ARBITRUM), _routerAddress[Network.BASE] = (_Network$BASE = {}, _Network$BASE[Dapp.ONEINCH] = "0x111111125421ca6dc452d289314280a0f8842a65", _Network$BASE[Dapp.ZEROEX] = "0xdef1c0ded9bec7f1a1670819833240f027b25eff", _Network$BASE[Dapp.AERODROME] = "0xcF77a3Ba9A5CA399B7c97c74d54e5b1Beb874E43", _Network$BASE[Dapp.AAVEV3] = "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5", _Network$BASE[Dapp.TOROS] = "0xf067575Eb60c7587C11e867907AA7284833704d1", _Network$BASE), _routerAddress);
4292
4293
  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);
4293
- 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[Dapp.COMPOUNDV3] = "0x443ea0340cb75a160f31a440722dec7b5bc3c2e9", _Network$OPTIMISM2), _stakingAddress[Network.ARBITRUM] = (_Network$ARBITRUM2 = {}, _Network$ARBITRUM2[Dapp.COMPOUNDV3] = "0x88730d254a2f7e6ac8388c3198afd694ba9f7fae", _Network$ARBITRUM2), _stakingAddress[Network.BASE] = {}, _stakingAddress);
4294
- 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$ARBITRUM3 = {}, _Network$ARBITRUM3[Dapp.AAVEV3] = "0xa97684ead0e402dc232d5a977953df7ecbab3cdb", _Network$ARBITRUM3), _aaveAddressProvider[Network.BASE] = (_Network$BASE2 = {}, _Network$BASE2[Dapp.AAVEV3] = "0xe20fCBdBfFC4Dd138cE8b2E6FBb6CB49777ad64D", _Network$BASE2), _aaveAddressProvider);
4295
- 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$ARBITRUM4 = {}, _Network$ARBITRUM4[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$ARBITRUM4[Dapp.RAMSESCL] = "0xAA277CB7914b7e5514946Da92cb9De332Ce610EF", _Network$ARBITRUM4), _nonfungiblePositionM[Network.BASE] = (_Network$BASE3 = {}, _Network$BASE3[Dapp.UNISWAPV3] = "0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1", _Network$BASE3[Dapp.AERODROMECL] = "0x827922686190790b37229fd06084350e74485b72", _Network$BASE3), _nonfungiblePositionM);
4294
+ 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[Dapp.COMPOUNDV3] = "0x443ea0340cb75a160f31a440722dec7b5bc3c2e9", _Network$OPTIMISM2), _stakingAddress[Network.ARBITRUM] = (_Network$ARBITRUM2 = {}, _Network$ARBITRUM2[Dapp.COMPOUNDV3] = "0x88730d254a2f7e6ac8388c3198afd694ba9f7fae", _Network$ARBITRUM2), _stakingAddress[Network.BASE] = (_Network$BASE2 = {}, _Network$BASE2[Dapp.PANCAKECL] = "0xC6A2Db661D5a5690172d8eB0a7DEA2d3008665A3", _Network$BASE2), _stakingAddress);
4295
+ 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$ARBITRUM3 = {}, _Network$ARBITRUM3[Dapp.AAVEV3] = "0xa97684ead0e402dc232d5a977953df7ecbab3cdb", _Network$ARBITRUM3), _aaveAddressProvider[Network.BASE] = (_Network$BASE3 = {}, _Network$BASE3[Dapp.AAVEV3] = "0xe20fCBdBfFC4Dd138cE8b2E6FBb6CB49777ad64D", _Network$BASE3), _aaveAddressProvider);
4296
+ 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$ARBITRUM4 = {}, _Network$ARBITRUM4[Dapp.UNISWAPV3] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _Network$ARBITRUM4[Dapp.RAMSESCL] = "0xAA277CB7914b7e5514946Da92cb9De332Ce610EF", _Network$ARBITRUM4), _nonfungiblePositionM[Network.BASE] = (_Network$BASE4 = {}, _Network$BASE4[Dapp.UNISWAPV3] = "0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1", _Network$BASE4[Dapp.AERODROMECL] = "0x827922686190790b37229fd06084350e74485b72", _Network$BASE4[Dapp.PANCAKECL] = "0x46A15B0b27311cedF172AB29E4f4766fbE7F4364", _Network$BASE4), _nonfungiblePositionM);
4296
4297
  var networkChainIdMap = (_networkChainIdMap = {}, _networkChainIdMap[Network.POLYGON] = 137, _networkChainIdMap[Network.OPTIMISM] = 10, _networkChainIdMap[Network.ARBITRUM] = 42161, _networkChainIdMap[Network.BASE] = 8453, _networkChainIdMap);
4297
4298
  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);
4298
4299
  var multiCallAddress = (_multiCallAddress = {}, _multiCallAddress[Network.POLYGON] = "0x275617327c958bD06b5D6b871E7f491D76113dd8", _multiCallAddress[Network.OPTIMISM] = "", _multiCallAddress[Network.ARBITRUM] = "", _multiCallAddress[Network.BASE] = "", _multiCallAddress);
@@ -7379,35 +7380,6 @@ var abi$9 = [
7379
7380
  stateMutability: "nonpayable",
7380
7381
  type: "function"
7381
7382
  },
7382
- {
7383
- inputs: [
7384
- {
7385
- internalType: "address",
7386
- name: "from",
7387
- type: "address"
7388
- },
7389
- {
7390
- internalType: "address",
7391
- name: "to",
7392
- type: "address"
7393
- },
7394
- {
7395
- internalType: "uint256",
7396
- name: "tokenId",
7397
- type: "uint256"
7398
- },
7399
- {
7400
- internalType: "bytes",
7401
- name: "_data",
7402
- type: "bytes"
7403
- }
7404
- ],
7405
- name: "safeTransferFrom",
7406
- outputs: [
7407
- ],
7408
- stateMutability: "nonpayable",
7409
- type: "function"
7410
- },
7411
7383
  {
7412
7384
  inputs: [
7413
7385
  {
@@ -9288,6 +9260,122 @@ var IArrakisV1RouterStaking = {
9288
9260
  abi: abi$e
9289
9261
  };
9290
9262
 
9263
+ var IPanncakeMasterChef = [
9264
+ {
9265
+ inputs: [
9266
+ {
9267
+ internalType: "uint256",
9268
+ name: "tokenId",
9269
+ type: "uint256"
9270
+ },
9271
+ {
9272
+ internalType: "address",
9273
+ name: "to",
9274
+ type: "address"
9275
+ }
9276
+ ],
9277
+ name: "harvest",
9278
+ outputs: [
9279
+ {
9280
+ internalType: "uint256",
9281
+ name: "reward",
9282
+ type: "uint256"
9283
+ }
9284
+ ],
9285
+ stateMutability: "nonpayable",
9286
+ type: "function"
9287
+ },
9288
+ {
9289
+ inputs: [
9290
+ {
9291
+ internalType: "uint256",
9292
+ name: "_tokenId",
9293
+ type: "uint256"
9294
+ },
9295
+ {
9296
+ internalType: "address",
9297
+ name: "_to",
9298
+ type: "address"
9299
+ }
9300
+ ],
9301
+ name: "withdraw",
9302
+ outputs: [
9303
+ {
9304
+ internalType: "uint256",
9305
+ name: "reward",
9306
+ type: "uint256"
9307
+ }
9308
+ ],
9309
+ stateMutability: "nonpayable",
9310
+ type: "function"
9311
+ },
9312
+ {
9313
+ inputs: [
9314
+ {
9315
+ internalType: "bytes[]",
9316
+ name: "data",
9317
+ type: "bytes[]"
9318
+ }
9319
+ ],
9320
+ name: "multicall",
9321
+ outputs: [
9322
+ {
9323
+ internalType: "bytes[]",
9324
+ name: "results",
9325
+ type: "bytes[]"
9326
+ }
9327
+ ],
9328
+ stateMutability: "payable",
9329
+ type: "function"
9330
+ },
9331
+ {
9332
+ inputs: [
9333
+ {
9334
+ components: [
9335
+ {
9336
+ internalType: "uint256",
9337
+ name: "tokenId",
9338
+ type: "uint256"
9339
+ },
9340
+ {
9341
+ internalType: "address",
9342
+ name: "recipient",
9343
+ type: "address"
9344
+ },
9345
+ {
9346
+ internalType: "uint128",
9347
+ name: "amount0Max",
9348
+ type: "uint128"
9349
+ },
9350
+ {
9351
+ internalType: "uint128",
9352
+ name: "amount1Max",
9353
+ type: "uint128"
9354
+ }
9355
+ ],
9356
+ internalType: "struct INonfungiblePositionManager.CollectParams",
9357
+ name: "params",
9358
+ type: "tuple"
9359
+ }
9360
+ ],
9361
+ name: "collect",
9362
+ outputs: [
9363
+ {
9364
+ internalType: "uint256",
9365
+ name: "amount0",
9366
+ type: "uint256"
9367
+ },
9368
+ {
9369
+ internalType: "uint256",
9370
+ name: "amount1",
9371
+ type: "uint256"
9372
+ }
9373
+ ],
9374
+ stateMutability: "payable",
9375
+ type: "function"
9376
+ }
9377
+ ];
9378
+
9291
9379
  var getDeadline = /*#__PURE__*/function () {
9292
9380
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool) {
9293
9381
  var timestamp;
@@ -9459,7 +9547,7 @@ function _getIncreaseLiquidityTxData() {
9459
9547
  while (1) {
9460
9548
  switch (_context3.prev = _context3.next) {
9461
9549
  case 0:
9462
- if (!(dapp === Dapp.UNISWAPV3 || dapp === Dapp.VELODROMECL || dapp === Dapp.AERODROMECL || dapp === Dapp.RAMSESCL)) {
9550
+ if (!(dapp === Dapp.UNISWAPV3 || dapp === Dapp.VELODROMECL || dapp === Dapp.AERODROMECL || dapp === Dapp.RAMSESCL || dapp === Dapp.PANCAKECL)) {
9463
9551
  _context3.next = 15;
9464
9552
  break;
9465
9553
  }
@@ -9508,13 +9596,13 @@ function _getIncreaseLiquidityTxData() {
9508
9596
  return _getIncreaseLiquidityTxData.apply(this, arguments);
9509
9597
  }
9510
9598
 
9511
- function getDecreaseLiquidityTxData(_x20, _x21, _x22, _x23) {
9599
+ function getDecreaseLiquidityTxData(_x20, _x21, _x22, _x23, _x24) {
9512
9600
  return _getDecreaseLiquidityTxData.apply(this, arguments);
9513
9601
  }
9514
9602
 
9515
9603
  function _getDecreaseLiquidityTxData() {
9516
- _getDecreaseLiquidityTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(pool, dapp, tokenId, amount) {
9517
- var txData, abi, liquidity, decreaseLiquidityTxData, collectTxData, multicallParams, burnTxData, _abi2, _liquidity;
9604
+ _getDecreaseLiquidityTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(pool, dapp, tokenId, amount, isStaked) {
9605
+ var txData, abi, liquidity, decreaseLiquidityTxData, collectTxData, multicallParams, _abi2, harvestTxData, burnTxData, _abi3, _liquidity;
9518
9606
 
9519
9607
  return runtime_1.wrap(function _callee4$(_context4) {
9520
9608
  while (1) {
@@ -9524,8 +9612,8 @@ function _getDecreaseLiquidityTxData() {
9524
9612
  amount = 100;
9525
9613
  }
9526
9614
 
9527
- if (!(dapp === Dapp.UNISWAPV3 || dapp === Dapp.VELODROMECL || dapp === Dapp.AERODROMECL || dapp === Dapp.RAMSESCL)) {
9528
- _context4.next = 22;
9615
+ if (!(dapp === Dapp.UNISWAPV3 || dapp === Dapp.VELODROMECL || dapp === Dapp.AERODROMECL || dapp === Dapp.RAMSESCL || dapp === Dapp.PANCAKECL)) {
9616
+ _context4.next = 23;
9529
9617
  break;
9530
9618
  }
9531
9619
 
@@ -9550,40 +9638,46 @@ function _getDecreaseLiquidityTxData() {
9550
9638
  collectTxData = abi.encodeFunctionData(Transaction.COLLECT, [[tokenId, pool.address, MaxUint128, MaxUint128]]);
9551
9639
  multicallParams = [decreaseLiquidityTxData, collectTxData];
9552
9640
 
9641
+ if (isStaked && dapp === Dapp.PANCAKECL) {
9642
+ _abi2 = new ethers.utils.Interface(IPanncakeMasterChef);
9643
+ harvestTxData = _abi2.encodeFunctionData(Transaction.HARVEST, [tokenId, pool.address]);
9644
+ multicallParams.unshift(harvestTxData);
9645
+ }
9646
+
9553
9647
  if (amount === 100) {
9554
9648
  burnTxData = abi.encodeFunctionData(Transaction.BURN, [tokenId]);
9555
9649
  multicallParams.push(burnTxData);
9556
9650
  }
9557
9651
 
9558
9652
  txData = abi.encodeFunctionData(Transaction.MULTI_CALL, [multicallParams]);
9559
- _context4.next = 33;
9653
+ _context4.next = 34;
9560
9654
  break;
9561
9655
 
9562
- case 22:
9656
+ case 23:
9563
9657
  if (!(dapp === Dapp.ARRAKIS)) {
9564
- _context4.next = 32;
9658
+ _context4.next = 33;
9565
9659
  break;
9566
9660
  }
9567
9661
 
9568
- _abi2 = new ethers.utils.Interface(IArrakisV1RouterStaking.abi);
9662
+ _abi3 = new ethers.utils.Interface(IArrakisV1RouterStaking.abi);
9569
9663
  _context4.t7 = BigNumber;
9570
- _context4.next = 27;
9664
+ _context4.next = 28;
9571
9665
  return pool.utils.getBalance(tokenId, pool.address);
9572
9666
 
9573
- case 27:
9667
+ case 28:
9574
9668
  _context4.t8 = _context4.sent.toString();
9575
9669
  _liquidity = new _context4.t7(_context4.t8).times(amount).div(100);
9576
- txData = _abi2.encodeFunctionData(Transaction.REMOVE_LIQUIDITY_UNSTAKE, [tokenId, _liquidity, 0, 0, pool.address]);
9577
- _context4.next = 33;
9670
+ txData = _abi3.encodeFunctionData(Transaction.REMOVE_LIQUIDITY_UNSTAKE, [tokenId, _liquidity, 0, 0, pool.address]);
9671
+ _context4.next = 34;
9578
9672
  break;
9579
9673
 
9580
- case 32:
9674
+ case 33:
9581
9675
  throw new Error("dapp not supported");
9582
9676
 
9583
- case 33:
9677
+ case 34:
9584
9678
  return _context4.abrupt("return", txData);
9585
9679
 
9586
- case 34:
9680
+ case 35:
9587
9681
  case "end":
9588
9682
  return _context4.stop();
9589
9683
  }
@@ -14487,12 +14581,12 @@ function _getVelodromeRemoveLiquidityTxData() {
14487
14581
  return _getVelodromeRemoveLiquidityTxData.apply(this, arguments);
14488
14582
  }
14489
14583
 
14490
- function getVelodromeClOwner(_x12, _x13, _x14) {
14491
- return _getVelodromeClOwner.apply(this, arguments);
14584
+ function getClOwner(_x12, _x13, _x14) {
14585
+ return _getClOwner.apply(this, arguments);
14492
14586
  }
14493
14587
 
14494
- function _getVelodromeClOwner() {
14495
- _getVelodromeClOwner = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(pool, dapp, tokenId) {
14588
+ function _getClOwner() {
14589
+ _getClOwner = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(pool, dapp, tokenId) {
14496
14590
  var iNonfungiblePositionManager;
14497
14591
  return runtime_1.wrap(function _callee3$(_context3) {
14498
14592
  while (1) {
@@ -14513,7 +14607,7 @@ function _getVelodromeClOwner() {
14513
14607
  }
14514
14608
  }, _callee3);
14515
14609
  }));
14516
- return _getVelodromeClOwner.apply(this, arguments);
14610
+ return _getClOwner.apply(this, arguments);
14517
14611
  }
14518
14612
 
14519
14613
  var abi$k = [
@@ -24107,6 +24201,22 @@ function getCompoundV3ClaimTxData(pool, asset) {
24107
24201
  return iCometRewards.encodeFunctionData("claim", [asset, pool.address, true]);
24108
24202
  }
24109
24203
 
24204
+ /* eslint-disable @typescript-eslint/no-explicit-any */
24205
+ var iNonfungiblePositionManager = /*#__PURE__*/new ethers.utils.Interface(INonfungiblePositionManager.abi);
24206
+ var iMasterChef = /*#__PURE__*/new ethers.utils.Interface(IPanncakeMasterChef);
24207
+ function getPancakeStakeTxData(pool, tokenId, stakingAddress) {
24208
+ return iNonfungiblePositionManager.encodeFunctionData("safeTransferFrom", [pool.address, stakingAddress, tokenId]);
24209
+ }
24210
+ function getPancakeUnStakeTxData(pool, tokenId) {
24211
+ return iMasterChef.encodeFunctionData("withdraw", [tokenId, pool.address]);
24212
+ }
24213
+ function getPancakeHarvestClaimTxData(pool, tokenId) {
24214
+ var harvestTxData = iMasterChef.encodeFunctionData(Transaction.HARVEST, [tokenId, pool.address]);
24215
+ var collectTxData = iMasterChef.encodeFunctionData(Transaction.COLLECT, [[tokenId, pool.address, MaxUint128, MaxUint128]]);
24216
+ var multicallParams = [harvestTxData, collectTxData];
24217
+ return iMasterChef.encodeFunctionData(Transaction.MULTI_CALL, [multicallParams]);
24218
+ }
24219
+
24110
24220
  var Pool = /*#__PURE__*/function () {
24111
24221
  function Pool(network, signer, poolLogic, mangerLogic, utils, factory) {
24112
24222
  this.network = network;
@@ -24932,7 +25042,7 @@ var Pool = /*#__PURE__*/function () {
24932
25042
  /*#__PURE__*/
24933
25043
  function () {
24934
25044
  var _stakeInGauge = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee14(dapp, gauge, amount, options, estimateGas) {
24935
- var stakeTxData, rewardsGauge, tx;
25045
+ var stakeTxData, rewardsGauge, txTo, tx;
24936
25046
  return runtime_1.wrap(function _callee14$(_context14) {
24937
25047
  while (1) {
24938
25048
  switch (_context14.prev = _context14.next) {
@@ -24946,34 +25056,39 @@ var Pool = /*#__PURE__*/function () {
24946
25056
  }
24947
25057
 
24948
25058
  _context14.t0 = dapp;
24949
- _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;
25059
+ _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 : _context14.t0 === Dapp.PANCAKECL ? 12 : 14;
24950
25060
  break;
24951
25061
 
24952
25062
  case 5:
24953
25063
  rewardsGauge = new ethers.utils.Interface(IBalancerRewardsGauge.abi);
24954
25064
  stakeTxData = rewardsGauge.encodeFunctionData("deposit(uint256)", [amount]);
24955
- return _context14.abrupt("break", 13);
25065
+ return _context14.abrupt("break", 15);
24956
25066
 
24957
25067
  case 8:
24958
25068
  stakeTxData = getVelodromeStakeTxData(amount, false);
24959
- return _context14.abrupt("break", 13);
25069
+ return _context14.abrupt("break", 15);
24960
25070
 
24961
25071
  case 10:
24962
25072
  stakeTxData = getVelodromeStakeTxData(amount, true);
24963
- return _context14.abrupt("break", 13);
25073
+ return _context14.abrupt("break", 15);
24964
25074
 
24965
25075
  case 12:
24966
- throw new Error("dapp not supported");
25076
+ stakeTxData = getPancakeStakeTxData(this, amount.toString(), gauge);
25077
+ return _context14.abrupt("break", 15);
24967
25078
 
24968
- case 13:
24969
- _context14.next = 15;
24970
- return getPoolTxOrGasEstimate(this, [gauge, stakeTxData, options], estimateGas);
25079
+ case 14:
25080
+ throw new Error("dapp not supported");
24971
25081
 
24972
25082
  case 15:
25083
+ txTo = dapp !== Dapp.PANCAKECL ? gauge : nonfungiblePositionManagerAddress[this.network][dapp];
25084
+ _context14.next = 18;
25085
+ return getPoolTxOrGasEstimate(this, [txTo, stakeTxData, options], estimateGas);
25086
+
25087
+ case 18:
24973
25088
  tx = _context14.sent;
24974
25089
  return _context14.abrupt("return", tx);
24975
25090
 
24976
- case 17:
25091
+ case 20:
24977
25092
  case "end":
24978
25093
  return _context14.stop();
24979
25094
  }
@@ -25057,7 +25172,9 @@ var Pool = /*#__PURE__*/function () {
25057
25172
  /*#__PURE__*/
25058
25173
  function () {
25059
25174
  var _unstakeFromGauge = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee16(gauge, amount, options, estimateGas) {
25060
- var rewardsGauge, unstakeTxData, tx;
25175
+ var _stakingAddress$this$;
25176
+
25177
+ var unstakeTxData, rewardsGauge, tx;
25061
25178
  return runtime_1.wrap(function _callee16$(_context16) {
25062
25179
  while (1) {
25063
25180
  switch (_context16.prev = _context16.next) {
@@ -25071,7 +25188,13 @@ var Pool = /*#__PURE__*/function () {
25071
25188
  }
25072
25189
 
25073
25190
  rewardsGauge = new ethers.utils.Interface(IBalancerRewardsGauge.abi);
25074
- unstakeTxData = rewardsGauge.encodeFunctionData("withdraw(uint256)", [amount]);
25191
+
25192
+ if (gauge.toLowerCase() === ((_stakingAddress$this$ = stakingAddress[this.network][Dapp.PANCAKECL]) == null ? void 0 : _stakingAddress$this$.toLowerCase())) {
25193
+ unstakeTxData = getPancakeUnStakeTxData(this, amount.toString());
25194
+ } else {
25195
+ unstakeTxData = rewardsGauge.encodeFunctionData("withdraw(uint256)", [amount]);
25196
+ }
25197
+
25075
25198
  _context16.next = 6;
25076
25199
  return getPoolTxOrGasEstimate(this, [gauge, unstakeTxData, options], estimateGas);
25077
25200
 
@@ -25975,7 +26098,7 @@ var Pool = /*#__PURE__*/function () {
25975
26098
 
25976
26099
  isStaked = false;
25977
26100
  _context32.t0 = dapp;
25978
- _context32.next = _context32.t0 === Dapp.UNISWAPV3 ? 7 : _context32.t0 === Dapp.RAMSESCL ? 7 : _context32.t0 === Dapp.VELODROMECL ? 9 : _context32.t0 === Dapp.AERODROMECL ? 9 : _context32.t0 === Dapp.ARRAKIS ? 14 : 16;
26101
+ _context32.next = _context32.t0 === Dapp.UNISWAPV3 ? 7 : _context32.t0 === Dapp.RAMSESCL ? 7 : _context32.t0 === Dapp.VELODROMECL ? 9 : _context32.t0 === Dapp.AERODROMECL ? 9 : _context32.t0 === Dapp.PANCAKECL ? 9 : _context32.t0 === Dapp.ARRAKIS ? 14 : 16;
25979
26102
  break;
25980
26103
 
25981
26104
  case 7:
@@ -25984,7 +26107,7 @@ var Pool = /*#__PURE__*/function () {
25984
26107
 
25985
26108
  case 9:
25986
26109
  _context32.next = 11;
25987
- return getVelodromeClOwner(this, dapp, tokenId);
26110
+ return getClOwner(this, dapp, tokenId);
25988
26111
 
25989
26112
  case 11:
25990
26113
  tokenIdOwner = _context32.sent;
@@ -26007,13 +26130,13 @@ var Pool = /*#__PURE__*/function () {
26007
26130
  throw new Error("dapp not supported");
26008
26131
 
26009
26132
  case 17:
26010
- if (isStaked) {
26133
+ if (!(!isStaked || dapp === Dapp.PANCAKECL)) {
26011
26134
  _context32.next = 23;
26012
26135
  break;
26013
26136
  }
26014
26137
 
26015
26138
  _context32.next = 20;
26016
- return getDecreaseLiquidityTxData(this, dapp, tokenId, amount);
26139
+ return getDecreaseLiquidityTxData(this, dapp, tokenId, amount, isStaked);
26017
26140
 
26018
26141
  case 20:
26019
26142
  txData = _context32.sent;
@@ -26076,7 +26199,7 @@ var Pool = /*#__PURE__*/function () {
26076
26199
 
26077
26200
  isStaked = false;
26078
26201
  _context33.t0 = dapp;
26079
- _context33.next = _context33.t0 === Dapp.UNISWAPV3 ? 6 : _context33.t0 === Dapp.RAMSESCL ? 6 : _context33.t0 === Dapp.VELODROMECL ? 8 : _context33.t0 === Dapp.AERODROMECL ? 8 : _context33.t0 === Dapp.ARRAKIS ? 13 : 15;
26202
+ _context33.next = _context33.t0 === Dapp.UNISWAPV3 ? 6 : _context33.t0 === Dapp.RAMSESCL ? 6 : _context33.t0 === Dapp.VELODROMECL ? 8 : _context33.t0 === Dapp.AERODROMECL ? 8 : _context33.t0 === Dapp.PANCAKECL ? 8 : _context33.t0 === Dapp.ARRAKIS ? 13 : 15;
26080
26203
  break;
26081
26204
 
26082
26205
  case 6:
@@ -26085,7 +26208,7 @@ var Pool = /*#__PURE__*/function () {
26085
26208
 
26086
26209
  case 8:
26087
26210
  _context33.next = 10;
26088
- return getVelodromeClOwner(this, dapp, tokenId);
26211
+ return getClOwner(this, dapp, tokenId);
26089
26212
 
26090
26213
  case 10:
26091
26214
  tokenIdOwner = _context33.sent;
@@ -26108,7 +26231,7 @@ var Pool = /*#__PURE__*/function () {
26108
26231
  throw new Error("dapp not supported");
26109
26232
 
26110
26233
  case 16:
26111
- if (isStaked) {
26234
+ if (!(!isStaked || dapp === Dapp.PANCAKECL)) {
26112
26235
  _context33.next = 22;
26113
26236
  break;
26114
26237
  }
@@ -26175,7 +26298,7 @@ var Pool = /*#__PURE__*/function () {
26175
26298
 
26176
26299
  iNonfungiblePositionManager = new ethers.utils.Interface(INonfungiblePositionManager.abi);
26177
26300
  _context34.t0 = dapp;
26178
- _context34.next = _context34.t0 === Dapp.UNISWAPV3 ? 6 : _context34.t0 === Dapp.RAMSESCL ? 6 : _context34.t0 === Dapp.ARRAKIS ? 9 : _context34.t0 === Dapp.BALANCER ? 9 : _context34.t0 === Dapp.VELODROME ? 13 : _context34.t0 === Dapp.RAMSES ? 13 : _context34.t0 === Dapp.VELODROMEV2 ? 16 : _context34.t0 === Dapp.AERODROME ? 16 : _context34.t0 === Dapp.VELODROMECL ? 19 : _context34.t0 === Dapp.AERODROMECL ? 19 : 24;
26301
+ _context34.next = _context34.t0 === Dapp.UNISWAPV3 ? 6 : _context34.t0 === Dapp.RAMSESCL ? 6 : _context34.t0 === Dapp.ARRAKIS ? 9 : _context34.t0 === Dapp.BALANCER ? 9 : _context34.t0 === Dapp.VELODROME ? 13 : _context34.t0 === Dapp.RAMSES ? 13 : _context34.t0 === Dapp.VELODROMEV2 ? 16 : _context34.t0 === Dapp.AERODROME ? 16 : _context34.t0 === Dapp.VELODROMECL ? 19 : _context34.t0 === Dapp.AERODROMECL ? 19 : _context34.t0 === Dapp.PANCAKECL ? 19 : 24;
26179
26302
  break;
26180
26303
 
26181
26304
  case 6:
@@ -26201,7 +26324,7 @@ var Pool = /*#__PURE__*/function () {
26201
26324
 
26202
26325
  case 19:
26203
26326
  _context34.next = 21;
26204
- return getVelodromeClOwner(this, dapp, tokenId);
26327
+ return getClOwner(this, dapp, tokenId);
26205
26328
 
26206
26329
  case 21:
26207
26330
  tokenIdOwner = _context34.sent;
@@ -26210,9 +26333,14 @@ var Pool = /*#__PURE__*/function () {
26210
26333
  contractAddress = nonfungiblePositionManagerAddress[this.network][dapp];
26211
26334
  txData = iNonfungiblePositionManager.encodeFunctionData(Transaction.COLLECT, [[tokenId, this.address, MaxUint128, MaxUint128]]);
26212
26335
  } else {
26213
- //staked in gauge
26336
+ //staked in gauge or pancake masterchef
26214
26337
  contractAddress = tokenIdOwner;
26215
- txData = getVelodromeCLClaimTxData(tokenId);
26338
+
26339
+ if (dapp === Dapp.PANCAKECL) {
26340
+ txData = getPancakeHarvestClaimTxData(this, tokenId);
26341
+ } else {
26342
+ txData = getVelodromeCLClaimTxData(tokenId);
26343
+ }
26216
26344
  }
26217
26345
 
26218
26346
  return _context34.abrupt("break", 25);