@dhedge/v2-sdk 1.4.2 → 1.5.1

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.
Files changed (39) hide show
  1. package/dist/config.d.ts +1 -0
  2. package/dist/entities/dhedge.d.ts +6 -0
  3. package/dist/entities/pool.d.ts +8 -0
  4. package/dist/services/aave/assets.d.ts +2 -0
  5. package/dist/services/aave/incentives.d.ts +2 -0
  6. package/dist/services/chainLink/price.d.ts +2 -0
  7. package/dist/services/oneInch/protocols.d.ts +1 -0
  8. package/dist/services/toros/easySwapper.d.ts +7 -0
  9. package/dist/services/toros/pool.d.ts +3 -0
  10. package/dist/test/constants.d.ts +15 -1
  11. package/dist/types.d.ts +2 -1
  12. package/dist/v2-sdk.cjs.development.js +4558 -115
  13. package/dist/v2-sdk.cjs.development.js.map +1 -1
  14. package/dist/v2-sdk.cjs.production.min.js +1 -1
  15. package/dist/v2-sdk.cjs.production.min.js.map +1 -1
  16. package/dist/v2-sdk.esm.js +4556 -113
  17. package/dist/v2-sdk.esm.js.map +1 -1
  18. package/package.json +1 -1
  19. package/src/abi/IAaveV3Incentives.json +614 -0
  20. package/src/abi/IAaveV3LendingPool.json +1241 -0
  21. package/src/abi/IAaveV3PoolAddressProvider.json +468 -0
  22. package/src/abi/IDhedgeEasySwapper.json +443 -0
  23. package/src/abi/IPriceOracle.json +244 -0
  24. package/src/config.ts +18 -4
  25. package/src/entities/dhedge.ts +9 -0
  26. package/src/entities/pool.ts +94 -51
  27. package/src/services/aave/assets.ts +26 -0
  28. package/src/services/aave/incentives.ts +23 -0
  29. package/src/services/chainLink/price.ts +26 -0
  30. package/src/services/oneInch/protocols.ts +18 -0
  31. package/src/services/toros/easySwapper.ts +110 -0
  32. package/src/services/toros/pool.ts +14 -0
  33. package/src/test/1inch.test.ts +3 -3
  34. package/src/test/aave.test.ts +40 -13
  35. package/src/test/arrakis.test.ts +2 -2
  36. package/src/test/constants.ts +17 -10
  37. package/src/test/toros.test.ts +117 -0
  38. package/src/test/wallet.ts +5 -5
  39. package/src/types.ts +2 -1
@@ -3839,6 +3839,7 @@ var Dapp;
3839
3839
  Dapp["SYNTHETIX"] = "synthetix";
3840
3840
  Dapp["AAVEV3"] = "aavev3";
3841
3841
  Dapp["ARRAKIS"] = "arrakis";
3842
+ Dapp["TOROS"] = "toros";
3842
3843
  })(Dapp || (Dapp = {}));
3843
3844
 
3844
3845
  var Transaction;
@@ -3865,14 +3866,15 @@ var Transaction;
3865
3866
  Transaction["REMOVE_LIQUIDITY_UNSTAKE"] = "removeLiquidityAndUnstake";
3866
3867
  })(Transaction || (Transaction = {}));
3867
3868
 
3868
- var _factoryAddress, _Network$POLYGON, _Network$OPTIMISM, _routerAddress, _Network$POLYGON2, _dappFactoryAddress, _Network$POLYGON3, _stakingAddress, _nonfungiblePositionM, _networkChainIdMap, _balancerSubgraph, _multiCallAddress;
3869
+ var _factoryAddress, _Network$POLYGON, _Network$OPTIMISM, _routerAddress, _Network$POLYGON2, _dappFactoryAddress, _Network$POLYGON3, _Network$OPTIMISM2, _stakingAddress, _Network$POLYGON4, _Network$OPTIMISM3, _aaveAddressProvider, _nonfungiblePositionM, _networkChainIdMap, _balancerSubgraph, _multiCallAddress;
3869
3870
 
3870
3871
  require("dotenv").config();
3871
3872
 
3872
3873
  var factoryAddress = (_factoryAddress = {}, _factoryAddress[Network.POLYGON] = process.env.STAGING_CONTRACTS ? "0xDd87eCdB10cFF7004276AAbAbd30e7a08F69bb53" : "0xfdc7b8bFe0DD3513Cc669bB8d601Cb83e2F69cB0", _factoryAddress[Network.OPTIMISM] = "0x5e61a079A178f0E5784107a4963baAe0c5a680c6", _factoryAddress);
3873
- 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] = "0x1111111254fb6c44bac0bed2854e76f90643097d", _Network$POLYGON[Dapp.QUICKSWAP] = "0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff", _Network$POLYGON[Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$POLYGON[Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$POLYGON[Dapp.ARRAKIS] = "0xbc91a120cCD8F80b819EAF32F0996daC3Fa76a6C", _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] = "0x1111111254760F7ab3F16433eea9304126DCd199", _Network$OPTIMISM), _routerAddress);
3874
+ 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] = "0x1111111254fb6c44bac0bed2854e76f90643097d", _Network$POLYGON[Dapp.QUICKSWAP] = "0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff", _Network$POLYGON[Dapp.BALANCER] = "0xBA12222222228d8Ba445958a75a0704d566BF2C8", _Network$POLYGON[Dapp.UNISWAPV3] = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", _Network$POLYGON[Dapp.ARRAKIS] = "0xbc91a120cCD8F80b819EAF32F0996daC3Fa76a6C", _Network$POLYGON[Dapp.TOROS] = "0x42B1DDcFa1c43E06F483BA0Dd1b9cC923043677f", _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] = "0x1111111254760F7ab3F16433eea9304126DCd199", _Network$OPTIMISM[Dapp.TOROS] = "0xf8C62BD5f2fEf9E1a329c197F32E77AD6866B022", _Network$OPTIMISM), _routerAddress);
3874
3875
  var dappFactoryAddress = (_dappFactoryAddress = {}, _dappFactoryAddress[Network.POLYGON] = (_Network$POLYGON2 = {}, _Network$POLYGON2[Dapp.SUSHISWAP] = "0xc35DADB65012eC5796536bD9864eD8773aBc74C4", _Network$POLYGON2[Dapp.QUICKSWAP] = "0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32", _Network$POLYGON2), _dappFactoryAddress[Network.OPTIMISM] = {}, _dappFactoryAddress);
3875
- 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), _stakingAddress[Network.OPTIMISM] = {}, _stakingAddress);
3876
+ 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);
3877
+ 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);
3876
3878
  var nonfungiblePositionManagerAddress = (_nonfungiblePositionM = {}, _nonfungiblePositionM[Network.POLYGON] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _nonfungiblePositionM[Network.OPTIMISM] = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88", _nonfungiblePositionM);
3877
3879
  var networkChainIdMap = (_networkChainIdMap = {}, _networkChainIdMap[Network.POLYGON] = 137, _networkChainIdMap[Network.OPTIMISM] = 10, _networkChainIdMap);
3878
3880
  var balancerSubgraph = (_balancerSubgraph = {}, _balancerSubgraph[Network.POLYGON] = "https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-polygon-v2", _balancerSubgraph[Network.OPTIMISM] = "", _balancerSubgraph);
@@ -9324,6 +9326,4389 @@ function _getUniswapV3SwapTxData() {
9324
9326
  return _getUniswapV3SwapTxData.apply(this, arguments);
9325
9327
  }
9326
9328
 
9329
+ var abi$g = [
9330
+ {
9331
+ inputs: [
9332
+ {
9333
+ internalType: "address payable",
9334
+ name: "_feeSink",
9335
+ type: "address"
9336
+ },
9337
+ {
9338
+ components: [
9339
+ {
9340
+ internalType: "contract IUniswapV2RouterSwapOnly",
9341
+ name: "swapRouter",
9342
+ type: "address"
9343
+ },
9344
+ {
9345
+ internalType: "contract IUniswapV2Router",
9346
+ name: "assetType2Router",
9347
+ type: "address"
9348
+ },
9349
+ {
9350
+ internalType: "contract IUniswapV2Router",
9351
+ name: "assetType5Router",
9352
+ type: "address"
9353
+ },
9354
+ {
9355
+ components: [
9356
+ {
9357
+ internalType: "contract ISynthetix",
9358
+ name: "snxProxy",
9359
+ type: "address"
9360
+ },
9361
+ {
9362
+ internalType: "contract IERC20",
9363
+ name: "swapSUSDToAsset",
9364
+ type: "address"
9365
+ },
9366
+ {
9367
+ internalType: "contract ISynthAddressProxy",
9368
+ name: "sUSDProxy",
9369
+ type: "address"
9370
+ }
9371
+ ],
9372
+ internalType: "struct EasySwapperStructs.SynthetixProps",
9373
+ name: "synthetixProps",
9374
+ type: "tuple"
9375
+ },
9376
+ {
9377
+ internalType: "contract IERC20",
9378
+ name: "weth",
9379
+ type: "address"
9380
+ }
9381
+ ],
9382
+ internalType: "struct EasySwapperStructs.WithdrawProps",
9383
+ name: "_withdrawProps",
9384
+ type: "tuple"
9385
+ }
9386
+ ],
9387
+ stateMutability: "nonpayable",
9388
+ type: "constructor"
9389
+ },
9390
+ {
9391
+ anonymous: false,
9392
+ inputs: [
9393
+ {
9394
+ indexed: false,
9395
+ internalType: "address",
9396
+ name: "pool",
9397
+ type: "address"
9398
+ },
9399
+ {
9400
+ indexed: false,
9401
+ internalType: "address",
9402
+ name: "depositor",
9403
+ type: "address"
9404
+ },
9405
+ {
9406
+ indexed: false,
9407
+ internalType: "address",
9408
+ name: "depositAsset",
9409
+ type: "address"
9410
+ },
9411
+ {
9412
+ indexed: false,
9413
+ internalType: "uint256",
9414
+ name: "amount",
9415
+ type: "uint256"
9416
+ },
9417
+ {
9418
+ indexed: false,
9419
+ internalType: "address",
9420
+ name: "poolDepositAsset",
9421
+ type: "address"
9422
+ },
9423
+ {
9424
+ indexed: false,
9425
+ internalType: "uint256",
9426
+ name: "liquidityMinted",
9427
+ type: "uint256"
9428
+ }
9429
+ ],
9430
+ name: "Deposit",
9431
+ type: "event"
9432
+ },
9433
+ {
9434
+ anonymous: false,
9435
+ inputs: [
9436
+ {
9437
+ indexed: true,
9438
+ internalType: "address",
9439
+ name: "previousOwner",
9440
+ type: "address"
9441
+ },
9442
+ {
9443
+ indexed: true,
9444
+ internalType: "address",
9445
+ name: "newOwner",
9446
+ type: "address"
9447
+ }
9448
+ ],
9449
+ name: "OwnershipTransferred",
9450
+ type: "event"
9451
+ },
9452
+ {
9453
+ inputs: [
9454
+ {
9455
+ internalType: "address",
9456
+ name: "",
9457
+ type: "address"
9458
+ }
9459
+ ],
9460
+ name: "allowedPools",
9461
+ outputs: [
9462
+ {
9463
+ internalType: "bool",
9464
+ name: "",
9465
+ type: "bool"
9466
+ }
9467
+ ],
9468
+ stateMutability: "view",
9469
+ type: "function"
9470
+ },
9471
+ {
9472
+ inputs: [
9473
+ {
9474
+ internalType: "address",
9475
+ name: "pool",
9476
+ type: "address"
9477
+ },
9478
+ {
9479
+ internalType: "contract IERC20",
9480
+ name: "depositAsset",
9481
+ type: "address"
9482
+ },
9483
+ {
9484
+ internalType: "uint256",
9485
+ name: "amount",
9486
+ type: "uint256"
9487
+ },
9488
+ {
9489
+ internalType: "contract IERC20",
9490
+ name: "poolDepositAsset",
9491
+ type: "address"
9492
+ },
9493
+ {
9494
+ internalType: "uint256",
9495
+ name: "expectedLiquidityMinted",
9496
+ type: "uint256"
9497
+ }
9498
+ ],
9499
+ name: "deposit",
9500
+ outputs: [
9501
+ {
9502
+ internalType: "uint256",
9503
+ name: "liquidityMinted",
9504
+ type: "uint256"
9505
+ }
9506
+ ],
9507
+ stateMutability: "nonpayable",
9508
+ type: "function"
9509
+ },
9510
+ {
9511
+ inputs: [
9512
+ {
9513
+ internalType: "address",
9514
+ name: "pool",
9515
+ type: "address"
9516
+ },
9517
+ {
9518
+ internalType: "contract IERC20",
9519
+ name: "depositAsset",
9520
+ type: "address"
9521
+ },
9522
+ {
9523
+ internalType: "uint256",
9524
+ name: "amount",
9525
+ type: "uint256"
9526
+ },
9527
+ {
9528
+ internalType: "contract IERC20",
9529
+ name: "poolDepositAsset",
9530
+ type: "address"
9531
+ }
9532
+ ],
9533
+ name: "depositQuote",
9534
+ outputs: [
9535
+ {
9536
+ internalType: "uint256",
9537
+ name: "expectedLiquidityMinted",
9538
+ type: "uint256"
9539
+ }
9540
+ ],
9541
+ stateMutability: "view",
9542
+ type: "function"
9543
+ },
9544
+ {
9545
+ inputs: [
9546
+ ],
9547
+ name: "feeDenominator",
9548
+ outputs: [
9549
+ {
9550
+ internalType: "uint256",
9551
+ name: "",
9552
+ type: "uint256"
9553
+ }
9554
+ ],
9555
+ stateMutability: "view",
9556
+ type: "function"
9557
+ },
9558
+ {
9559
+ inputs: [
9560
+ ],
9561
+ name: "feeNumerator",
9562
+ outputs: [
9563
+ {
9564
+ internalType: "uint256",
9565
+ name: "",
9566
+ type: "uint256"
9567
+ }
9568
+ ],
9569
+ stateMutability: "view",
9570
+ type: "function"
9571
+ },
9572
+ {
9573
+ inputs: [
9574
+ ],
9575
+ name: "feeSink",
9576
+ outputs: [
9577
+ {
9578
+ internalType: "address payable",
9579
+ name: "",
9580
+ type: "address"
9581
+ }
9582
+ ],
9583
+ stateMutability: "view",
9584
+ type: "function"
9585
+ },
9586
+ {
9587
+ inputs: [
9588
+ ],
9589
+ name: "owner",
9590
+ outputs: [
9591
+ {
9592
+ internalType: "address",
9593
+ name: "",
9594
+ type: "address"
9595
+ }
9596
+ ],
9597
+ stateMutability: "view",
9598
+ type: "function"
9599
+ },
9600
+ {
9601
+ inputs: [
9602
+ ],
9603
+ name: "renounceOwnership",
9604
+ outputs: [
9605
+ ],
9606
+ stateMutability: "nonpayable",
9607
+ type: "function"
9608
+ },
9609
+ {
9610
+ inputs: [
9611
+ {
9612
+ internalType: "uint256",
9613
+ name: "numerator",
9614
+ type: "uint256"
9615
+ },
9616
+ {
9617
+ internalType: "uint256",
9618
+ name: "denominator",
9619
+ type: "uint256"
9620
+ }
9621
+ ],
9622
+ name: "setFee",
9623
+ outputs: [
9624
+ ],
9625
+ stateMutability: "nonpayable",
9626
+ type: "function"
9627
+ },
9628
+ {
9629
+ inputs: [
9630
+ {
9631
+ internalType: "address payable",
9632
+ name: "sink",
9633
+ type: "address"
9634
+ }
9635
+ ],
9636
+ name: "setFeeSink",
9637
+ outputs: [
9638
+ ],
9639
+ stateMutability: "nonpayable",
9640
+ type: "function"
9641
+ },
9642
+ {
9643
+ inputs: [
9644
+ {
9645
+ internalType: "address",
9646
+ name: "pool",
9647
+ type: "address"
9648
+ },
9649
+ {
9650
+ internalType: "bool",
9651
+ name: "allowed",
9652
+ type: "bool"
9653
+ }
9654
+ ],
9655
+ name: "setPoolAllowed",
9656
+ outputs: [
9657
+ ],
9658
+ stateMutability: "nonpayable",
9659
+ type: "function"
9660
+ },
9661
+ {
9662
+ inputs: [
9663
+ {
9664
+ internalType: "contract IUniswapV2RouterSwapOnly",
9665
+ name: "_swapRouter",
9666
+ type: "address"
9667
+ }
9668
+ ],
9669
+ name: "setSwapRouter",
9670
+ outputs: [
9671
+ ],
9672
+ stateMutability: "nonpayable",
9673
+ type: "function"
9674
+ },
9675
+ {
9676
+ inputs: [
9677
+ {
9678
+ internalType: "address",
9679
+ name: "newOwner",
9680
+ type: "address"
9681
+ }
9682
+ ],
9683
+ name: "transferOwnership",
9684
+ outputs: [
9685
+ ],
9686
+ stateMutability: "nonpayable",
9687
+ type: "function"
9688
+ },
9689
+ {
9690
+ inputs: [
9691
+ ],
9692
+ name: "weth",
9693
+ outputs: [
9694
+ {
9695
+ internalType: "contract IERC20",
9696
+ name: "",
9697
+ type: "address"
9698
+ }
9699
+ ],
9700
+ stateMutability: "view",
9701
+ type: "function"
9702
+ },
9703
+ {
9704
+ inputs: [
9705
+ {
9706
+ internalType: "address",
9707
+ name: "pool",
9708
+ type: "address"
9709
+ },
9710
+ {
9711
+ internalType: "uint256",
9712
+ name: "fundTokenAmount",
9713
+ type: "uint256"
9714
+ },
9715
+ {
9716
+ internalType: "contract IERC20",
9717
+ name: "withdrawalAsset",
9718
+ type: "address"
9719
+ },
9720
+ {
9721
+ internalType: "uint256",
9722
+ name: "expectedAmountOut",
9723
+ type: "uint256"
9724
+ }
9725
+ ],
9726
+ name: "withdraw",
9727
+ outputs: [
9728
+ ],
9729
+ stateMutability: "nonpayable",
9730
+ type: "function"
9731
+ },
9732
+ {
9733
+ inputs: [
9734
+ ],
9735
+ name: "withdrawProps",
9736
+ outputs: [
9737
+ {
9738
+ internalType: "contract IUniswapV2RouterSwapOnly",
9739
+ name: "swapRouter",
9740
+ type: "address"
9741
+ },
9742
+ {
9743
+ internalType: "contract IUniswapV2Router",
9744
+ name: "assetType2Router",
9745
+ type: "address"
9746
+ },
9747
+ {
9748
+ internalType: "contract IUniswapV2Router",
9749
+ name: "assetType5Router",
9750
+ type: "address"
9751
+ },
9752
+ {
9753
+ components: [
9754
+ {
9755
+ internalType: "contract ISynthetix",
9756
+ name: "snxProxy",
9757
+ type: "address"
9758
+ },
9759
+ {
9760
+ internalType: "contract IERC20",
9761
+ name: "swapSUSDToAsset",
9762
+ type: "address"
9763
+ },
9764
+ {
9765
+ internalType: "contract ISynthAddressProxy",
9766
+ name: "sUSDProxy",
9767
+ type: "address"
9768
+ }
9769
+ ],
9770
+ internalType: "struct EasySwapperStructs.SynthetixProps",
9771
+ name: "synthetixProps",
9772
+ type: "tuple"
9773
+ },
9774
+ {
9775
+ internalType: "contract IERC20",
9776
+ name: "weth",
9777
+ type: "address"
9778
+ }
9779
+ ],
9780
+ stateMutability: "view",
9781
+ type: "function"
9782
+ }
9783
+ ];
9784
+ var IDhedgeEasySwapper = {
9785
+ abi: abi$g
9786
+ };
9787
+
9788
+ var abi$h = [
9789
+ {
9790
+ inputs: [
9791
+ {
9792
+ internalType: "string",
9793
+ name: "marketId",
9794
+ type: "string"
9795
+ },
9796
+ {
9797
+ internalType: "address",
9798
+ name: "owner",
9799
+ type: "address"
9800
+ }
9801
+ ],
9802
+ stateMutability: "nonpayable",
9803
+ type: "constructor"
9804
+ },
9805
+ {
9806
+ anonymous: false,
9807
+ inputs: [
9808
+ {
9809
+ indexed: true,
9810
+ internalType: "address",
9811
+ name: "oldAddress",
9812
+ type: "address"
9813
+ },
9814
+ {
9815
+ indexed: true,
9816
+ internalType: "address",
9817
+ name: "newAddress",
9818
+ type: "address"
9819
+ }
9820
+ ],
9821
+ name: "ACLAdminUpdated",
9822
+ type: "event"
9823
+ },
9824
+ {
9825
+ anonymous: false,
9826
+ inputs: [
9827
+ {
9828
+ indexed: true,
9829
+ internalType: "address",
9830
+ name: "oldAddress",
9831
+ type: "address"
9832
+ },
9833
+ {
9834
+ indexed: true,
9835
+ internalType: "address",
9836
+ name: "newAddress",
9837
+ type: "address"
9838
+ }
9839
+ ],
9840
+ name: "ACLManagerUpdated",
9841
+ type: "event"
9842
+ },
9843
+ {
9844
+ anonymous: false,
9845
+ inputs: [
9846
+ {
9847
+ indexed: true,
9848
+ internalType: "bytes32",
9849
+ name: "id",
9850
+ type: "bytes32"
9851
+ },
9852
+ {
9853
+ indexed: true,
9854
+ internalType: "address",
9855
+ name: "oldAddress",
9856
+ type: "address"
9857
+ },
9858
+ {
9859
+ indexed: true,
9860
+ internalType: "address",
9861
+ name: "newAddress",
9862
+ type: "address"
9863
+ }
9864
+ ],
9865
+ name: "AddressSet",
9866
+ type: "event"
9867
+ },
9868
+ {
9869
+ anonymous: false,
9870
+ inputs: [
9871
+ {
9872
+ indexed: true,
9873
+ internalType: "bytes32",
9874
+ name: "id",
9875
+ type: "bytes32"
9876
+ },
9877
+ {
9878
+ indexed: true,
9879
+ internalType: "address",
9880
+ name: "proxyAddress",
9881
+ type: "address"
9882
+ },
9883
+ {
9884
+ indexed: false,
9885
+ internalType: "address",
9886
+ name: "oldImplementationAddress",
9887
+ type: "address"
9888
+ },
9889
+ {
9890
+ indexed: true,
9891
+ internalType: "address",
9892
+ name: "newImplementationAddress",
9893
+ type: "address"
9894
+ }
9895
+ ],
9896
+ name: "AddressSetAsProxy",
9897
+ type: "event"
9898
+ },
9899
+ {
9900
+ anonymous: false,
9901
+ inputs: [
9902
+ {
9903
+ indexed: true,
9904
+ internalType: "string",
9905
+ name: "oldMarketId",
9906
+ type: "string"
9907
+ },
9908
+ {
9909
+ indexed: true,
9910
+ internalType: "string",
9911
+ name: "newMarketId",
9912
+ type: "string"
9913
+ }
9914
+ ],
9915
+ name: "MarketIdSet",
9916
+ type: "event"
9917
+ },
9918
+ {
9919
+ anonymous: false,
9920
+ inputs: [
9921
+ {
9922
+ indexed: true,
9923
+ internalType: "address",
9924
+ name: "previousOwner",
9925
+ type: "address"
9926
+ },
9927
+ {
9928
+ indexed: true,
9929
+ internalType: "address",
9930
+ name: "newOwner",
9931
+ type: "address"
9932
+ }
9933
+ ],
9934
+ name: "OwnershipTransferred",
9935
+ type: "event"
9936
+ },
9937
+ {
9938
+ anonymous: false,
9939
+ inputs: [
9940
+ {
9941
+ indexed: true,
9942
+ internalType: "address",
9943
+ name: "oldAddress",
9944
+ type: "address"
9945
+ },
9946
+ {
9947
+ indexed: true,
9948
+ internalType: "address",
9949
+ name: "newAddress",
9950
+ type: "address"
9951
+ }
9952
+ ],
9953
+ name: "PoolConfiguratorUpdated",
9954
+ type: "event"
9955
+ },
9956
+ {
9957
+ anonymous: false,
9958
+ inputs: [
9959
+ {
9960
+ indexed: true,
9961
+ internalType: "address",
9962
+ name: "oldAddress",
9963
+ type: "address"
9964
+ },
9965
+ {
9966
+ indexed: true,
9967
+ internalType: "address",
9968
+ name: "newAddress",
9969
+ type: "address"
9970
+ }
9971
+ ],
9972
+ name: "PoolDataProviderUpdated",
9973
+ type: "event"
9974
+ },
9975
+ {
9976
+ anonymous: false,
9977
+ inputs: [
9978
+ {
9979
+ indexed: true,
9980
+ internalType: "address",
9981
+ name: "oldAddress",
9982
+ type: "address"
9983
+ },
9984
+ {
9985
+ indexed: true,
9986
+ internalType: "address",
9987
+ name: "newAddress",
9988
+ type: "address"
9989
+ }
9990
+ ],
9991
+ name: "PoolUpdated",
9992
+ type: "event"
9993
+ },
9994
+ {
9995
+ anonymous: false,
9996
+ inputs: [
9997
+ {
9998
+ indexed: true,
9999
+ internalType: "address",
10000
+ name: "oldAddress",
10001
+ type: "address"
10002
+ },
10003
+ {
10004
+ indexed: true,
10005
+ internalType: "address",
10006
+ name: "newAddress",
10007
+ type: "address"
10008
+ }
10009
+ ],
10010
+ name: "PriceOracleSentinelUpdated",
10011
+ type: "event"
10012
+ },
10013
+ {
10014
+ anonymous: false,
10015
+ inputs: [
10016
+ {
10017
+ indexed: true,
10018
+ internalType: "address",
10019
+ name: "oldAddress",
10020
+ type: "address"
10021
+ },
10022
+ {
10023
+ indexed: true,
10024
+ internalType: "address",
10025
+ name: "newAddress",
10026
+ type: "address"
10027
+ }
10028
+ ],
10029
+ name: "PriceOracleUpdated",
10030
+ type: "event"
10031
+ },
10032
+ {
10033
+ anonymous: false,
10034
+ inputs: [
10035
+ {
10036
+ indexed: true,
10037
+ internalType: "bytes32",
10038
+ name: "id",
10039
+ type: "bytes32"
10040
+ },
10041
+ {
10042
+ indexed: true,
10043
+ internalType: "address",
10044
+ name: "proxyAddress",
10045
+ type: "address"
10046
+ },
10047
+ {
10048
+ indexed: true,
10049
+ internalType: "address",
10050
+ name: "implementationAddress",
10051
+ type: "address"
10052
+ }
10053
+ ],
10054
+ name: "ProxyCreated",
10055
+ type: "event"
10056
+ },
10057
+ {
10058
+ inputs: [
10059
+ ],
10060
+ name: "getACLAdmin",
10061
+ outputs: [
10062
+ {
10063
+ internalType: "address",
10064
+ name: "",
10065
+ type: "address"
10066
+ }
10067
+ ],
10068
+ stateMutability: "view",
10069
+ type: "function"
10070
+ },
10071
+ {
10072
+ inputs: [
10073
+ ],
10074
+ name: "getACLManager",
10075
+ outputs: [
10076
+ {
10077
+ internalType: "address",
10078
+ name: "",
10079
+ type: "address"
10080
+ }
10081
+ ],
10082
+ stateMutability: "view",
10083
+ type: "function"
10084
+ },
10085
+ {
10086
+ inputs: [
10087
+ {
10088
+ internalType: "bytes32",
10089
+ name: "id",
10090
+ type: "bytes32"
10091
+ }
10092
+ ],
10093
+ name: "getAddress",
10094
+ outputs: [
10095
+ {
10096
+ internalType: "address",
10097
+ name: "",
10098
+ type: "address"
10099
+ }
10100
+ ],
10101
+ stateMutability: "view",
10102
+ type: "function"
10103
+ },
10104
+ {
10105
+ inputs: [
10106
+ ],
10107
+ name: "getMarketId",
10108
+ outputs: [
10109
+ {
10110
+ internalType: "string",
10111
+ name: "",
10112
+ type: "string"
10113
+ }
10114
+ ],
10115
+ stateMutability: "view",
10116
+ type: "function"
10117
+ },
10118
+ {
10119
+ inputs: [
10120
+ ],
10121
+ name: "getPool",
10122
+ outputs: [
10123
+ {
10124
+ internalType: "address",
10125
+ name: "",
10126
+ type: "address"
10127
+ }
10128
+ ],
10129
+ stateMutability: "view",
10130
+ type: "function"
10131
+ },
10132
+ {
10133
+ inputs: [
10134
+ ],
10135
+ name: "getPoolConfigurator",
10136
+ outputs: [
10137
+ {
10138
+ internalType: "address",
10139
+ name: "",
10140
+ type: "address"
10141
+ }
10142
+ ],
10143
+ stateMutability: "view",
10144
+ type: "function"
10145
+ },
10146
+ {
10147
+ inputs: [
10148
+ ],
10149
+ name: "getPoolDataProvider",
10150
+ outputs: [
10151
+ {
10152
+ internalType: "address",
10153
+ name: "",
10154
+ type: "address"
10155
+ }
10156
+ ],
10157
+ stateMutability: "view",
10158
+ type: "function"
10159
+ },
10160
+ {
10161
+ inputs: [
10162
+ ],
10163
+ name: "getPriceOracle",
10164
+ outputs: [
10165
+ {
10166
+ internalType: "address",
10167
+ name: "",
10168
+ type: "address"
10169
+ }
10170
+ ],
10171
+ stateMutability: "view",
10172
+ type: "function"
10173
+ },
10174
+ {
10175
+ inputs: [
10176
+ ],
10177
+ name: "getPriceOracleSentinel",
10178
+ outputs: [
10179
+ {
10180
+ internalType: "address",
10181
+ name: "",
10182
+ type: "address"
10183
+ }
10184
+ ],
10185
+ stateMutability: "view",
10186
+ type: "function"
10187
+ },
10188
+ {
10189
+ inputs: [
10190
+ ],
10191
+ name: "owner",
10192
+ outputs: [
10193
+ {
10194
+ internalType: "address",
10195
+ name: "",
10196
+ type: "address"
10197
+ }
10198
+ ],
10199
+ stateMutability: "view",
10200
+ type: "function"
10201
+ },
10202
+ {
10203
+ inputs: [
10204
+ ],
10205
+ name: "renounceOwnership",
10206
+ outputs: [
10207
+ ],
10208
+ stateMutability: "nonpayable",
10209
+ type: "function"
10210
+ },
10211
+ {
10212
+ inputs: [
10213
+ {
10214
+ internalType: "address",
10215
+ name: "newAclAdmin",
10216
+ type: "address"
10217
+ }
10218
+ ],
10219
+ name: "setACLAdmin",
10220
+ outputs: [
10221
+ ],
10222
+ stateMutability: "nonpayable",
10223
+ type: "function"
10224
+ },
10225
+ {
10226
+ inputs: [
10227
+ {
10228
+ internalType: "address",
10229
+ name: "newAclManager",
10230
+ type: "address"
10231
+ }
10232
+ ],
10233
+ name: "setACLManager",
10234
+ outputs: [
10235
+ ],
10236
+ stateMutability: "nonpayable",
10237
+ type: "function"
10238
+ },
10239
+ {
10240
+ inputs: [
10241
+ {
10242
+ internalType: "bytes32",
10243
+ name: "id",
10244
+ type: "bytes32"
10245
+ },
10246
+ {
10247
+ internalType: "address",
10248
+ name: "newAddress",
10249
+ type: "address"
10250
+ }
10251
+ ],
10252
+ name: "setAddress",
10253
+ outputs: [
10254
+ ],
10255
+ stateMutability: "nonpayable",
10256
+ type: "function"
10257
+ },
10258
+ {
10259
+ inputs: [
10260
+ {
10261
+ internalType: "bytes32",
10262
+ name: "id",
10263
+ type: "bytes32"
10264
+ },
10265
+ {
10266
+ internalType: "address",
10267
+ name: "newImplementationAddress",
10268
+ type: "address"
10269
+ }
10270
+ ],
10271
+ name: "setAddressAsProxy",
10272
+ outputs: [
10273
+ ],
10274
+ stateMutability: "nonpayable",
10275
+ type: "function"
10276
+ },
10277
+ {
10278
+ inputs: [
10279
+ {
10280
+ internalType: "string",
10281
+ name: "newMarketId",
10282
+ type: "string"
10283
+ }
10284
+ ],
10285
+ name: "setMarketId",
10286
+ outputs: [
10287
+ ],
10288
+ stateMutability: "nonpayable",
10289
+ type: "function"
10290
+ },
10291
+ {
10292
+ inputs: [
10293
+ {
10294
+ internalType: "address",
10295
+ name: "newPoolConfiguratorImpl",
10296
+ type: "address"
10297
+ }
10298
+ ],
10299
+ name: "setPoolConfiguratorImpl",
10300
+ outputs: [
10301
+ ],
10302
+ stateMutability: "nonpayable",
10303
+ type: "function"
10304
+ },
10305
+ {
10306
+ inputs: [
10307
+ {
10308
+ internalType: "address",
10309
+ name: "newDataProvider",
10310
+ type: "address"
10311
+ }
10312
+ ],
10313
+ name: "setPoolDataProvider",
10314
+ outputs: [
10315
+ ],
10316
+ stateMutability: "nonpayable",
10317
+ type: "function"
10318
+ },
10319
+ {
10320
+ inputs: [
10321
+ {
10322
+ internalType: "address",
10323
+ name: "newPoolImpl",
10324
+ type: "address"
10325
+ }
10326
+ ],
10327
+ name: "setPoolImpl",
10328
+ outputs: [
10329
+ ],
10330
+ stateMutability: "nonpayable",
10331
+ type: "function"
10332
+ },
10333
+ {
10334
+ inputs: [
10335
+ {
10336
+ internalType: "address",
10337
+ name: "newPriceOracle",
10338
+ type: "address"
10339
+ }
10340
+ ],
10341
+ name: "setPriceOracle",
10342
+ outputs: [
10343
+ ],
10344
+ stateMutability: "nonpayable",
10345
+ type: "function"
10346
+ },
10347
+ {
10348
+ inputs: [
10349
+ {
10350
+ internalType: "address",
10351
+ name: "newPriceOracleSentinel",
10352
+ type: "address"
10353
+ }
10354
+ ],
10355
+ name: "setPriceOracleSentinel",
10356
+ outputs: [
10357
+ ],
10358
+ stateMutability: "nonpayable",
10359
+ type: "function"
10360
+ },
10361
+ {
10362
+ inputs: [
10363
+ {
10364
+ internalType: "address",
10365
+ name: "newOwner",
10366
+ type: "address"
10367
+ }
10368
+ ],
10369
+ name: "transferOwnership",
10370
+ outputs: [
10371
+ ],
10372
+ stateMutability: "nonpayable",
10373
+ type: "function"
10374
+ }
10375
+ ];
10376
+ var IAaveV3PoolAddressProvider = {
10377
+ abi: abi$h
10378
+ };
10379
+
10380
+ var abi$i = [
10381
+ {
10382
+ inputs: [
10383
+ {
10384
+ internalType: "address[]",
10385
+ name: "_assets",
10386
+ type: "address[]"
10387
+ },
10388
+ {
10389
+ internalType: "address[]",
10390
+ name: "_sources",
10391
+ type: "address[]"
10392
+ },
10393
+ {
10394
+ internalType: "address",
10395
+ name: "_fallbackOracle",
10396
+ type: "address"
10397
+ }
10398
+ ],
10399
+ payable: false,
10400
+ stateMutability: "nonpayable",
10401
+ type: "constructor"
10402
+ },
10403
+ {
10404
+ anonymous: false,
10405
+ inputs: [
10406
+ {
10407
+ indexed: true,
10408
+ internalType: "address",
10409
+ name: "asset",
10410
+ type: "address"
10411
+ },
10412
+ {
10413
+ indexed: true,
10414
+ internalType: "address",
10415
+ name: "source",
10416
+ type: "address"
10417
+ }
10418
+ ],
10419
+ name: "AssetSourceUpdated",
10420
+ type: "event"
10421
+ },
10422
+ {
10423
+ anonymous: false,
10424
+ inputs: [
10425
+ {
10426
+ indexed: true,
10427
+ internalType: "address",
10428
+ name: "fallbackOracle",
10429
+ type: "address"
10430
+ }
10431
+ ],
10432
+ name: "FallbackOracleUpdated",
10433
+ type: "event"
10434
+ },
10435
+ {
10436
+ anonymous: false,
10437
+ inputs: [
10438
+ {
10439
+ indexed: true,
10440
+ internalType: "address",
10441
+ name: "previousOwner",
10442
+ type: "address"
10443
+ },
10444
+ {
10445
+ indexed: true,
10446
+ internalType: "address",
10447
+ name: "newOwner",
10448
+ type: "address"
10449
+ }
10450
+ ],
10451
+ name: "OwnershipTransferred",
10452
+ type: "event"
10453
+ },
10454
+ {
10455
+ constant: true,
10456
+ inputs: [
10457
+ ],
10458
+ name: "isOwner",
10459
+ outputs: [
10460
+ {
10461
+ internalType: "bool",
10462
+ name: "",
10463
+ type: "bool"
10464
+ }
10465
+ ],
10466
+ payable: false,
10467
+ stateMutability: "view",
10468
+ type: "function"
10469
+ },
10470
+ {
10471
+ constant: true,
10472
+ inputs: [
10473
+ ],
10474
+ name: "owner",
10475
+ outputs: [
10476
+ {
10477
+ internalType: "address",
10478
+ name: "",
10479
+ type: "address"
10480
+ }
10481
+ ],
10482
+ payable: false,
10483
+ stateMutability: "view",
10484
+ type: "function"
10485
+ },
10486
+ {
10487
+ constant: false,
10488
+ inputs: [
10489
+ ],
10490
+ name: "renounceOwnership",
10491
+ outputs: [
10492
+ ],
10493
+ payable: false,
10494
+ stateMutability: "nonpayable",
10495
+ type: "function"
10496
+ },
10497
+ {
10498
+ constant: false,
10499
+ inputs: [
10500
+ {
10501
+ internalType: "address",
10502
+ name: "newOwner",
10503
+ type: "address"
10504
+ }
10505
+ ],
10506
+ name: "transferOwnership",
10507
+ outputs: [
10508
+ ],
10509
+ payable: false,
10510
+ stateMutability: "nonpayable",
10511
+ type: "function"
10512
+ },
10513
+ {
10514
+ constant: false,
10515
+ inputs: [
10516
+ {
10517
+ internalType: "address[]",
10518
+ name: "_assets",
10519
+ type: "address[]"
10520
+ },
10521
+ {
10522
+ internalType: "address[]",
10523
+ name: "_sources",
10524
+ type: "address[]"
10525
+ }
10526
+ ],
10527
+ name: "setAssetSources",
10528
+ outputs: [
10529
+ ],
10530
+ payable: false,
10531
+ stateMutability: "nonpayable",
10532
+ type: "function"
10533
+ },
10534
+ {
10535
+ constant: false,
10536
+ inputs: [
10537
+ {
10538
+ internalType: "address",
10539
+ name: "_fallbackOracle",
10540
+ type: "address"
10541
+ }
10542
+ ],
10543
+ name: "setFallbackOracle",
10544
+ outputs: [
10545
+ ],
10546
+ payable: false,
10547
+ stateMutability: "nonpayable",
10548
+ type: "function"
10549
+ },
10550
+ {
10551
+ constant: true,
10552
+ inputs: [
10553
+ {
10554
+ internalType: "address",
10555
+ name: "_asset",
10556
+ type: "address"
10557
+ }
10558
+ ],
10559
+ name: "getAssetPrice",
10560
+ outputs: [
10561
+ {
10562
+ internalType: "uint256",
10563
+ name: "",
10564
+ type: "uint256"
10565
+ }
10566
+ ],
10567
+ payable: false,
10568
+ stateMutability: "view",
10569
+ type: "function"
10570
+ },
10571
+ {
10572
+ constant: true,
10573
+ inputs: [
10574
+ {
10575
+ internalType: "address[]",
10576
+ name: "_assets",
10577
+ type: "address[]"
10578
+ }
10579
+ ],
10580
+ name: "getAssetsPrices",
10581
+ outputs: [
10582
+ {
10583
+ internalType: "uint256[]",
10584
+ name: "",
10585
+ type: "uint256[]"
10586
+ }
10587
+ ],
10588
+ payable: false,
10589
+ stateMutability: "view",
10590
+ type: "function"
10591
+ },
10592
+ {
10593
+ constant: true,
10594
+ inputs: [
10595
+ {
10596
+ internalType: "address",
10597
+ name: "_asset",
10598
+ type: "address"
10599
+ }
10600
+ ],
10601
+ name: "getSourceOfAsset",
10602
+ outputs: [
10603
+ {
10604
+ internalType: "address",
10605
+ name: "",
10606
+ type: "address"
10607
+ }
10608
+ ],
10609
+ payable: false,
10610
+ stateMutability: "view",
10611
+ type: "function"
10612
+ },
10613
+ {
10614
+ constant: true,
10615
+ inputs: [
10616
+ ],
10617
+ name: "getFallbackOracle",
10618
+ outputs: [
10619
+ {
10620
+ internalType: "address",
10621
+ name: "",
10622
+ type: "address"
10623
+ }
10624
+ ],
10625
+ payable: false,
10626
+ stateMutability: "view",
10627
+ type: "function"
10628
+ }
10629
+ ];
10630
+ var IPriceOracle = {
10631
+ abi: abi$i
10632
+ };
10633
+
10634
+ function getChainlinkPriceInUsd(_x, _x2) {
10635
+ return _getChainlinkPriceInUsd.apply(this, arguments);
10636
+ }
10637
+
10638
+ function _getChainlinkPriceInUsd() {
10639
+ _getChainlinkPriceInUsd = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool, asset) {
10640
+ var lendingPoolAddressProvider, priceOracleAddress, priceOracle;
10641
+ return runtime_1.wrap(function _callee$(_context) {
10642
+ while (1) {
10643
+ switch (_context.prev = _context.next) {
10644
+ case 0:
10645
+ //Workaround as Chainlink doesn't have feed registry on Polygon/Optimism
10646
+ //Use oracle from Aave which uses Chainlink
10647
+ lendingPoolAddressProvider = new ethers.Contract(aaveAddressProvider[pool.network][Dapp.AAVEV3], IAaveV3PoolAddressProvider.abi, pool.signer);
10648
+ _context.next = 3;
10649
+ return lendingPoolAddressProvider.getPriceOracle();
10650
+
10651
+ case 3:
10652
+ priceOracleAddress = _context.sent;
10653
+ priceOracle = new ethers.Contract(priceOracleAddress, IPriceOracle.abi, pool.signer);
10654
+ _context.next = 7;
10655
+ return priceOracle.getAssetPrice(asset);
10656
+
10657
+ case 7:
10658
+ return _context.abrupt("return", _context.sent);
10659
+
10660
+ case 8:
10661
+ case "end":
10662
+ return _context.stop();
10663
+ }
10664
+ }
10665
+ }, _callee);
10666
+ }));
10667
+ return _getChainlinkPriceInUsd.apply(this, arguments);
10668
+ }
10669
+
10670
+ function loadPool(_x, _x2) {
10671
+ return _loadPool.apply(this, arguments);
10672
+ }
10673
+
10674
+ function _loadPool() {
10675
+ _loadPool = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool, poolAddress) {
10676
+ var dhedge;
10677
+ return runtime_1.wrap(function _callee$(_context) {
10678
+ while (1) {
10679
+ switch (_context.prev = _context.next) {
10680
+ case 0:
10681
+ dhedge = new Dhedge(pool.signer, pool.network);
10682
+ _context.next = 3;
10683
+ return dhedge.loadPool(poolAddress);
10684
+
10685
+ case 3:
10686
+ return _context.abrupt("return", _context.sent);
10687
+
10688
+ case 4:
10689
+ case "end":
10690
+ return _context.stop();
10691
+ }
10692
+ }
10693
+ }, _callee);
10694
+ }));
10695
+ return _loadPool.apply(this, arguments);
10696
+ }
10697
+
10698
+ function isPool(_x3, _x4) {
10699
+ return _isPool.apply(this, arguments);
10700
+ }
10701
+
10702
+ function _isPool() {
10703
+ _isPool = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(pool, poolAddress) {
10704
+ var dhedge;
10705
+ return runtime_1.wrap(function _callee2$(_context2) {
10706
+ while (1) {
10707
+ switch (_context2.prev = _context2.next) {
10708
+ case 0:
10709
+ dhedge = new Dhedge(pool.signer, pool.network);
10710
+ _context2.next = 3;
10711
+ return dhedge.validatePool(poolAddress);
10712
+
10713
+ case 3:
10714
+ return _context2.abrupt("return", _context2.sent);
10715
+
10716
+ case 4:
10717
+ case "end":
10718
+ return _context2.stop();
10719
+ }
10720
+ }
10721
+ }, _callee2);
10722
+ }));
10723
+ return _isPool.apply(this, arguments);
10724
+ }
10725
+
10726
+ function getPoolDepositAsset(_x, _x2) {
10727
+ return _getPoolDepositAsset.apply(this, arguments);
10728
+ }
10729
+
10730
+ function _getPoolDepositAsset() {
10731
+ _getPoolDepositAsset = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool, poolAddress) {
10732
+ var _composition$find;
10733
+
10734
+ var torosPool, composition;
10735
+ return runtime_1.wrap(function _callee$(_context) {
10736
+ while (1) {
10737
+ switch (_context.prev = _context.next) {
10738
+ case 0:
10739
+ _context.next = 2;
10740
+ return loadPool(pool, poolAddress);
10741
+
10742
+ case 2:
10743
+ torosPool = _context.sent;
10744
+ _context.next = 5;
10745
+ return torosPool.getComposition();
10746
+
10747
+ case 5:
10748
+ composition = _context.sent;
10749
+ return _context.abrupt("return", (_composition$find = composition.find(function (e) {
10750
+ return e.isDeposit;
10751
+ })) == null ? void 0 : _composition$find.asset);
10752
+
10753
+ case 7:
10754
+ case "end":
10755
+ return _context.stop();
10756
+ }
10757
+ }
10758
+ }, _callee);
10759
+ }));
10760
+ return _getPoolDepositAsset.apply(this, arguments);
10761
+ }
10762
+
10763
+ function getTorosPoolTokenPrice(_x3, _x4) {
10764
+ return _getTorosPoolTokenPrice.apply(this, arguments);
10765
+ }
10766
+
10767
+ function _getTorosPoolTokenPrice() {
10768
+ _getTorosPoolTokenPrice = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(pool, poolAddress) {
10769
+ var torosPool;
10770
+ return runtime_1.wrap(function _callee2$(_context2) {
10771
+ while (1) {
10772
+ switch (_context2.prev = _context2.next) {
10773
+ case 0:
10774
+ _context2.next = 2;
10775
+ return loadPool(pool, poolAddress);
10776
+
10777
+ case 2:
10778
+ torosPool = _context2.sent;
10779
+ _context2.next = 5;
10780
+ return torosPool.poolLogic.tokenPrice();
10781
+
10782
+ case 5:
10783
+ return _context2.abrupt("return", _context2.sent);
10784
+
10785
+ case 6:
10786
+ case "end":
10787
+ return _context2.stop();
10788
+ }
10789
+ }
10790
+ }, _callee2);
10791
+ }));
10792
+ return _getTorosPoolTokenPrice.apply(this, arguments);
10793
+ }
10794
+
10795
+ function getEasySwapperDepositQuote(_x5, _x6, _x7, _x8, _x9) {
10796
+ return _getEasySwapperDepositQuote.apply(this, arguments);
10797
+ }
10798
+
10799
+ function _getEasySwapperDepositQuote() {
10800
+ _getEasySwapperDepositQuote = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(pool, torosAsset, investAsset, depositAsset, amountIn) {
10801
+ var easySwapper;
10802
+ return runtime_1.wrap(function _callee3$(_context3) {
10803
+ while (1) {
10804
+ switch (_context3.prev = _context3.next) {
10805
+ case 0:
10806
+ easySwapper = new ethers.Contract(routerAddress[pool.network][Dapp.TOROS], IDhedgeEasySwapper.abi, pool.signer);
10807
+ _context3.next = 3;
10808
+ return easySwapper.depositQuote(torosAsset, investAsset, amountIn, depositAsset);
10809
+
10810
+ case 3:
10811
+ return _context3.abrupt("return", _context3.sent);
10812
+
10813
+ case 4:
10814
+ case "end":
10815
+ return _context3.stop();
10816
+ }
10817
+ }
10818
+ }, _callee3);
10819
+ }));
10820
+ return _getEasySwapperDepositQuote.apply(this, arguments);
10821
+ }
10822
+
10823
+ function getEasySwapperWithdrawalQuote(_x10, _x11, _x12, _x13) {
10824
+ return _getEasySwapperWithdrawalQuote.apply(this, arguments);
10825
+ }
10826
+
10827
+ function _getEasySwapperWithdrawalQuote() {
10828
+ _getEasySwapperWithdrawalQuote = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(pool, torosAsset, investAsset, amountIn) {
10829
+ var _yield$Promise$all, torosTokenPrice, assetPrice, assetDecimals;
10830
+
10831
+ return runtime_1.wrap(function _callee4$(_context4) {
10832
+ while (1) {
10833
+ switch (_context4.prev = _context4.next) {
10834
+ case 0:
10835
+ _context4.next = 2;
10836
+ return Promise.all([getTorosPoolTokenPrice(pool, torosAsset), getChainlinkPriceInUsd(pool, investAsset), pool.utils.getDecimals(investAsset)]);
10837
+
10838
+ case 2:
10839
+ _yield$Promise$all = _context4.sent;
10840
+ torosTokenPrice = _yield$Promise$all[0];
10841
+ assetPrice = _yield$Promise$all[1];
10842
+ assetDecimals = _yield$Promise$all[2];
10843
+ return _context4.abrupt("return", amountIn.mul(torosTokenPrice).div(assetPrice).div(1e10).div(Math.pow(10, 18 - assetDecimals)));
10844
+
10845
+ case 7:
10846
+ case "end":
10847
+ return _context4.stop();
10848
+ }
10849
+ }
10850
+ }, _callee4);
10851
+ }));
10852
+ return _getEasySwapperWithdrawalQuote.apply(this, arguments);
10853
+ }
10854
+
10855
+ function getEasySwapperTxData(_x14, _x15, _x16, _x17, _x18) {
10856
+ return _getEasySwapperTxData.apply(this, arguments);
10857
+ }
10858
+
10859
+ function _getEasySwapperTxData() {
10860
+ _getEasySwapperTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(pool, assetFrom, assetTo, amountIn, slippage // eslint-disable-next-line @typescript-eslint/no-explicit-any
10861
+ ) {
10862
+ var isWithdrawal, _ref, torosAsset, investAsset, iDhedgeEasySwapper, minAmountOut, depositAsset, _minAmountOut;
10863
+
10864
+ return runtime_1.wrap(function _callee5$(_context5) {
10865
+ while (1) {
10866
+ switch (_context5.prev = _context5.next) {
10867
+ case 0:
10868
+ _context5.next = 2;
10869
+ return isPool(pool, assetFrom);
10870
+
10871
+ case 2:
10872
+ isWithdrawal = _context5.sent;
10873
+ _ref = isWithdrawal ? [assetFrom, assetTo] : [assetTo, assetFrom], torosAsset = _ref[0], investAsset = _ref[1];
10874
+ iDhedgeEasySwapper = new ethers.utils.Interface(IDhedgeEasySwapper.abi);
10875
+
10876
+ if (!isWithdrawal) {
10877
+ _context5.next = 12;
10878
+ break;
10879
+ }
10880
+
10881
+ _context5.next = 8;
10882
+ return getEasySwapperWithdrawalQuote(pool, torosAsset, investAsset, amountIn);
10883
+
10884
+ case 8:
10885
+ minAmountOut = _context5.sent;
10886
+ return _context5.abrupt("return", iDhedgeEasySwapper.encodeFunctionData("withdraw", [torosAsset, amountIn, investAsset, minAmountOut.mul(10000 - slippage * 100).div(10000)]));
10887
+
10888
+ case 12:
10889
+ _context5.next = 14;
10890
+ return getPoolDepositAsset(pool, torosAsset);
10891
+
10892
+ case 14:
10893
+ depositAsset = _context5.sent;
10894
+
10895
+ if (depositAsset) {
10896
+ _context5.next = 17;
10897
+ break;
10898
+ }
10899
+
10900
+ throw new Error("no deposit assets");
10901
+
10902
+ case 17:
10903
+ _context5.next = 19;
10904
+ return getEasySwapperDepositQuote(pool, torosAsset, investAsset, depositAsset, amountIn);
10905
+
10906
+ case 19:
10907
+ _minAmountOut = _context5.sent;
10908
+ return _context5.abrupt("return", iDhedgeEasySwapper.encodeFunctionData("deposit", [torosAsset, investAsset, amountIn, depositAsset, _minAmountOut.mul(10000 - slippage * 100).div(10000)]));
10909
+
10910
+ case 21:
10911
+ case "end":
10912
+ return _context5.stop();
10913
+ }
10914
+ }
10915
+ }, _callee5);
10916
+ }));
10917
+ return _getEasySwapperTxData.apply(this, arguments);
10918
+ }
10919
+
10920
+ var excludedProtocols = ["OPTIMISM_PMM6"]; //Clipper
10921
+
10922
+ function getOneInchProtocols(_x) {
10923
+ return _getOneInchProtocols.apply(this, arguments);
10924
+ }
10925
+
10926
+ function _getOneInchProtocols() {
10927
+ _getOneInchProtocols = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(chainId) {
10928
+ var response, protocols, filteredProtocols;
10929
+ return runtime_1.wrap(function _callee$(_context) {
10930
+ while (1) {
10931
+ switch (_context.prev = _context.next) {
10932
+ case 0:
10933
+ _context.prev = 0;
10934
+ _context.next = 3;
10935
+ return axios.get("https://api.1inch.io/v4.0/" + chainId + "/liquidity-sources");
10936
+
10937
+ case 3:
10938
+ response = _context.sent;
10939
+ protocols = response.data.protocols.map(function (e) {
10940
+ return e.id;
10941
+ });
10942
+ filteredProtocols = protocols.filter(function (e) {
10943
+ return !excludedProtocols.includes(e);
10944
+ });
10945
+ return _context.abrupt("return", "&protocols=" + filteredProtocols.join(","));
10946
+
10947
+ case 9:
10948
+ _context.prev = 9;
10949
+ _context.t0 = _context["catch"](0);
10950
+ return _context.abrupt("return", "");
10951
+
10952
+ case 12:
10953
+ case "end":
10954
+ return _context.stop();
10955
+ }
10956
+ }
10957
+ }, _callee, null, [[0, 9]]);
10958
+ }));
10959
+ return _getOneInchProtocols.apply(this, arguments);
10960
+ }
10961
+
10962
+ var abi$j = [
10963
+ {
10964
+ inputs: [
10965
+ {
10966
+ internalType: "address",
10967
+ name: "emissionManager",
10968
+ type: "address"
10969
+ }
10970
+ ],
10971
+ stateMutability: "nonpayable",
10972
+ type: "constructor"
10973
+ },
10974
+ {
10975
+ anonymous: false,
10976
+ inputs: [
10977
+ {
10978
+ indexed: true,
10979
+ internalType: "address",
10980
+ name: "asset",
10981
+ type: "address"
10982
+ },
10983
+ {
10984
+ indexed: true,
10985
+ internalType: "address",
10986
+ name: "reward",
10987
+ type: "address"
10988
+ },
10989
+ {
10990
+ indexed: true,
10991
+ internalType: "address",
10992
+ name: "user",
10993
+ type: "address"
10994
+ },
10995
+ {
10996
+ indexed: false,
10997
+ internalType: "uint256",
10998
+ name: "assetIndex",
10999
+ type: "uint256"
11000
+ },
11001
+ {
11002
+ indexed: false,
11003
+ internalType: "uint256",
11004
+ name: "userIndex",
11005
+ type: "uint256"
11006
+ },
11007
+ {
11008
+ indexed: false,
11009
+ internalType: "uint256",
11010
+ name: "rewardsAccrued",
11011
+ type: "uint256"
11012
+ }
11013
+ ],
11014
+ name: "Accrued",
11015
+ type: "event"
11016
+ },
11017
+ {
11018
+ anonymous: false,
11019
+ inputs: [
11020
+ {
11021
+ indexed: true,
11022
+ internalType: "address",
11023
+ name: "asset",
11024
+ type: "address"
11025
+ },
11026
+ {
11027
+ indexed: true,
11028
+ internalType: "address",
11029
+ name: "reward",
11030
+ type: "address"
11031
+ },
11032
+ {
11033
+ indexed: false,
11034
+ internalType: "uint256",
11035
+ name: "oldEmission",
11036
+ type: "uint256"
11037
+ },
11038
+ {
11039
+ indexed: false,
11040
+ internalType: "uint256",
11041
+ name: "newEmission",
11042
+ type: "uint256"
11043
+ },
11044
+ {
11045
+ indexed: false,
11046
+ internalType: "uint256",
11047
+ name: "oldDistributionEnd",
11048
+ type: "uint256"
11049
+ },
11050
+ {
11051
+ indexed: false,
11052
+ internalType: "uint256",
11053
+ name: "newDistributionEnd",
11054
+ type: "uint256"
11055
+ },
11056
+ {
11057
+ indexed: false,
11058
+ internalType: "uint256",
11059
+ name: "assetIndex",
11060
+ type: "uint256"
11061
+ }
11062
+ ],
11063
+ name: "AssetConfigUpdated",
11064
+ type: "event"
11065
+ },
11066
+ {
11067
+ anonymous: false,
11068
+ inputs: [
11069
+ {
11070
+ indexed: true,
11071
+ internalType: "address",
11072
+ name: "user",
11073
+ type: "address"
11074
+ },
11075
+ {
11076
+ indexed: true,
11077
+ internalType: "address",
11078
+ name: "claimer",
11079
+ type: "address"
11080
+ }
11081
+ ],
11082
+ name: "ClaimerSet",
11083
+ type: "event"
11084
+ },
11085
+ {
11086
+ anonymous: false,
11087
+ inputs: [
11088
+ {
11089
+ indexed: true,
11090
+ internalType: "address",
11091
+ name: "oldEmissionManager",
11092
+ type: "address"
11093
+ },
11094
+ {
11095
+ indexed: true,
11096
+ internalType: "address",
11097
+ name: "newEmissionManager",
11098
+ type: "address"
11099
+ }
11100
+ ],
11101
+ name: "EmissionManagerUpdated",
11102
+ type: "event"
11103
+ },
11104
+ {
11105
+ anonymous: false,
11106
+ inputs: [
11107
+ {
11108
+ indexed: true,
11109
+ internalType: "address",
11110
+ name: "reward",
11111
+ type: "address"
11112
+ },
11113
+ {
11114
+ indexed: true,
11115
+ internalType: "address",
11116
+ name: "rewardOracle",
11117
+ type: "address"
11118
+ }
11119
+ ],
11120
+ name: "RewardOracleUpdated",
11121
+ type: "event"
11122
+ },
11123
+ {
11124
+ anonymous: false,
11125
+ inputs: [
11126
+ {
11127
+ indexed: true,
11128
+ internalType: "address",
11129
+ name: "user",
11130
+ type: "address"
11131
+ },
11132
+ {
11133
+ indexed: true,
11134
+ internalType: "address",
11135
+ name: "reward",
11136
+ type: "address"
11137
+ },
11138
+ {
11139
+ indexed: true,
11140
+ internalType: "address",
11141
+ name: "to",
11142
+ type: "address"
11143
+ },
11144
+ {
11145
+ indexed: false,
11146
+ internalType: "address",
11147
+ name: "claimer",
11148
+ type: "address"
11149
+ },
11150
+ {
11151
+ indexed: false,
11152
+ internalType: "uint256",
11153
+ name: "amount",
11154
+ type: "uint256"
11155
+ }
11156
+ ],
11157
+ name: "RewardsClaimed",
11158
+ type: "event"
11159
+ },
11160
+ {
11161
+ anonymous: false,
11162
+ inputs: [
11163
+ {
11164
+ indexed: true,
11165
+ internalType: "address",
11166
+ name: "reward",
11167
+ type: "address"
11168
+ },
11169
+ {
11170
+ indexed: true,
11171
+ internalType: "address",
11172
+ name: "transferStrategy",
11173
+ type: "address"
11174
+ }
11175
+ ],
11176
+ name: "TransferStrategyInstalled",
11177
+ type: "event"
11178
+ },
11179
+ {
11180
+ inputs: [
11181
+ ],
11182
+ name: "REVISION",
11183
+ outputs: [
11184
+ {
11185
+ internalType: "uint256",
11186
+ name: "",
11187
+ type: "uint256"
11188
+ }
11189
+ ],
11190
+ stateMutability: "view",
11191
+ type: "function"
11192
+ },
11193
+ {
11194
+ inputs: [
11195
+ {
11196
+ internalType: "address[]",
11197
+ name: "assets",
11198
+ type: "address[]"
11199
+ },
11200
+ {
11201
+ internalType: "address",
11202
+ name: "to",
11203
+ type: "address"
11204
+ }
11205
+ ],
11206
+ name: "claimAllRewards",
11207
+ outputs: [
11208
+ {
11209
+ internalType: "address[]",
11210
+ name: "rewardsList",
11211
+ type: "address[]"
11212
+ },
11213
+ {
11214
+ internalType: "uint256[]",
11215
+ name: "claimedAmounts",
11216
+ type: "uint256[]"
11217
+ }
11218
+ ],
11219
+ stateMutability: "nonpayable",
11220
+ type: "function"
11221
+ },
11222
+ {
11223
+ inputs: [
11224
+ {
11225
+ internalType: "address[]",
11226
+ name: "assets",
11227
+ type: "address[]"
11228
+ },
11229
+ {
11230
+ internalType: "address",
11231
+ name: "user",
11232
+ type: "address"
11233
+ },
11234
+ {
11235
+ internalType: "address",
11236
+ name: "to",
11237
+ type: "address"
11238
+ }
11239
+ ],
11240
+ name: "claimAllRewardsOnBehalf",
11241
+ outputs: [
11242
+ {
11243
+ internalType: "address[]",
11244
+ name: "rewardsList",
11245
+ type: "address[]"
11246
+ },
11247
+ {
11248
+ internalType: "uint256[]",
11249
+ name: "claimedAmounts",
11250
+ type: "uint256[]"
11251
+ }
11252
+ ],
11253
+ stateMutability: "nonpayable",
11254
+ type: "function"
11255
+ },
11256
+ {
11257
+ inputs: [
11258
+ {
11259
+ internalType: "address[]",
11260
+ name: "assets",
11261
+ type: "address[]"
11262
+ }
11263
+ ],
11264
+ name: "claimAllRewardsToSelf",
11265
+ outputs: [
11266
+ {
11267
+ internalType: "address[]",
11268
+ name: "rewardsList",
11269
+ type: "address[]"
11270
+ },
11271
+ {
11272
+ internalType: "uint256[]",
11273
+ name: "claimedAmounts",
11274
+ type: "uint256[]"
11275
+ }
11276
+ ],
11277
+ stateMutability: "nonpayable",
11278
+ type: "function"
11279
+ },
11280
+ {
11281
+ inputs: [
11282
+ {
11283
+ internalType: "address[]",
11284
+ name: "assets",
11285
+ type: "address[]"
11286
+ },
11287
+ {
11288
+ internalType: "uint256",
11289
+ name: "amount",
11290
+ type: "uint256"
11291
+ },
11292
+ {
11293
+ internalType: "address",
11294
+ name: "to",
11295
+ type: "address"
11296
+ },
11297
+ {
11298
+ internalType: "address",
11299
+ name: "reward",
11300
+ type: "address"
11301
+ }
11302
+ ],
11303
+ name: "claimRewards",
11304
+ outputs: [
11305
+ {
11306
+ internalType: "uint256",
11307
+ name: "",
11308
+ type: "uint256"
11309
+ }
11310
+ ],
11311
+ stateMutability: "nonpayable",
11312
+ type: "function"
11313
+ },
11314
+ {
11315
+ inputs: [
11316
+ {
11317
+ internalType: "address[]",
11318
+ name: "assets",
11319
+ type: "address[]"
11320
+ },
11321
+ {
11322
+ internalType: "uint256",
11323
+ name: "amount",
11324
+ type: "uint256"
11325
+ },
11326
+ {
11327
+ internalType: "address",
11328
+ name: "user",
11329
+ type: "address"
11330
+ },
11331
+ {
11332
+ internalType: "address",
11333
+ name: "to",
11334
+ type: "address"
11335
+ },
11336
+ {
11337
+ internalType: "address",
11338
+ name: "reward",
11339
+ type: "address"
11340
+ }
11341
+ ],
11342
+ name: "claimRewardsOnBehalf",
11343
+ outputs: [
11344
+ {
11345
+ internalType: "uint256",
11346
+ name: "",
11347
+ type: "uint256"
11348
+ }
11349
+ ],
11350
+ stateMutability: "nonpayable",
11351
+ type: "function"
11352
+ },
11353
+ {
11354
+ inputs: [
11355
+ {
11356
+ internalType: "address[]",
11357
+ name: "assets",
11358
+ type: "address[]"
11359
+ },
11360
+ {
11361
+ internalType: "uint256",
11362
+ name: "amount",
11363
+ type: "uint256"
11364
+ },
11365
+ {
11366
+ internalType: "address",
11367
+ name: "reward",
11368
+ type: "address"
11369
+ }
11370
+ ],
11371
+ name: "claimRewardsToSelf",
11372
+ outputs: [
11373
+ {
11374
+ internalType: "uint256",
11375
+ name: "",
11376
+ type: "uint256"
11377
+ }
11378
+ ],
11379
+ stateMutability: "nonpayable",
11380
+ type: "function"
11381
+ },
11382
+ {
11383
+ inputs: [
11384
+ {
11385
+ components: [
11386
+ {
11387
+ internalType: "uint88",
11388
+ name: "emissionPerSecond",
11389
+ type: "uint88"
11390
+ },
11391
+ {
11392
+ internalType: "uint256",
11393
+ name: "totalSupply",
11394
+ type: "uint256"
11395
+ },
11396
+ {
11397
+ internalType: "uint32",
11398
+ name: "distributionEnd",
11399
+ type: "uint32"
11400
+ },
11401
+ {
11402
+ internalType: "address",
11403
+ name: "asset",
11404
+ type: "address"
11405
+ },
11406
+ {
11407
+ internalType: "address",
11408
+ name: "reward",
11409
+ type: "address"
11410
+ },
11411
+ {
11412
+ internalType: "contract ITransferStrategyBase",
11413
+ name: "transferStrategy",
11414
+ type: "address"
11415
+ },
11416
+ {
11417
+ internalType: "contract IEACAggregatorProxy",
11418
+ name: "rewardOracle",
11419
+ type: "address"
11420
+ }
11421
+ ],
11422
+ internalType: "struct RewardsDataTypes.RewardsConfigInput[]",
11423
+ name: "config",
11424
+ type: "tuple[]"
11425
+ }
11426
+ ],
11427
+ name: "configureAssets",
11428
+ outputs: [
11429
+ ],
11430
+ stateMutability: "nonpayable",
11431
+ type: "function"
11432
+ },
11433
+ {
11434
+ inputs: [
11435
+ {
11436
+ internalType: "address[]",
11437
+ name: "assets",
11438
+ type: "address[]"
11439
+ },
11440
+ {
11441
+ internalType: "address",
11442
+ name: "user",
11443
+ type: "address"
11444
+ }
11445
+ ],
11446
+ name: "getAllUserRewards",
11447
+ outputs: [
11448
+ {
11449
+ internalType: "address[]",
11450
+ name: "rewardsList",
11451
+ type: "address[]"
11452
+ },
11453
+ {
11454
+ internalType: "uint256[]",
11455
+ name: "unclaimedAmounts",
11456
+ type: "uint256[]"
11457
+ }
11458
+ ],
11459
+ stateMutability: "view",
11460
+ type: "function"
11461
+ },
11462
+ {
11463
+ inputs: [
11464
+ {
11465
+ internalType: "address",
11466
+ name: "asset",
11467
+ type: "address"
11468
+ }
11469
+ ],
11470
+ name: "getAssetDecimals",
11471
+ outputs: [
11472
+ {
11473
+ internalType: "uint8",
11474
+ name: "",
11475
+ type: "uint8"
11476
+ }
11477
+ ],
11478
+ stateMutability: "view",
11479
+ type: "function"
11480
+ },
11481
+ {
11482
+ inputs: [
11483
+ {
11484
+ internalType: "address",
11485
+ name: "user",
11486
+ type: "address"
11487
+ }
11488
+ ],
11489
+ name: "getClaimer",
11490
+ outputs: [
11491
+ {
11492
+ internalType: "address",
11493
+ name: "",
11494
+ type: "address"
11495
+ }
11496
+ ],
11497
+ stateMutability: "view",
11498
+ type: "function"
11499
+ },
11500
+ {
11501
+ inputs: [
11502
+ {
11503
+ internalType: "address",
11504
+ name: "asset",
11505
+ type: "address"
11506
+ },
11507
+ {
11508
+ internalType: "address",
11509
+ name: "reward",
11510
+ type: "address"
11511
+ }
11512
+ ],
11513
+ name: "getDistributionEnd",
11514
+ outputs: [
11515
+ {
11516
+ internalType: "uint256",
11517
+ name: "",
11518
+ type: "uint256"
11519
+ }
11520
+ ],
11521
+ stateMutability: "view",
11522
+ type: "function"
11523
+ },
11524
+ {
11525
+ inputs: [
11526
+ ],
11527
+ name: "getEmissionManager",
11528
+ outputs: [
11529
+ {
11530
+ internalType: "address",
11531
+ name: "",
11532
+ type: "address"
11533
+ }
11534
+ ],
11535
+ stateMutability: "view",
11536
+ type: "function"
11537
+ },
11538
+ {
11539
+ inputs: [
11540
+ {
11541
+ internalType: "address",
11542
+ name: "reward",
11543
+ type: "address"
11544
+ }
11545
+ ],
11546
+ name: "getRewardOracle",
11547
+ outputs: [
11548
+ {
11549
+ internalType: "address",
11550
+ name: "",
11551
+ type: "address"
11552
+ }
11553
+ ],
11554
+ stateMutability: "view",
11555
+ type: "function"
11556
+ },
11557
+ {
11558
+ inputs: [
11559
+ {
11560
+ internalType: "address",
11561
+ name: "asset",
11562
+ type: "address"
11563
+ }
11564
+ ],
11565
+ name: "getRewardsByAsset",
11566
+ outputs: [
11567
+ {
11568
+ internalType: "address[]",
11569
+ name: "",
11570
+ type: "address[]"
11571
+ }
11572
+ ],
11573
+ stateMutability: "view",
11574
+ type: "function"
11575
+ },
11576
+ {
11577
+ inputs: [
11578
+ {
11579
+ internalType: "address",
11580
+ name: "asset",
11581
+ type: "address"
11582
+ },
11583
+ {
11584
+ internalType: "address",
11585
+ name: "reward",
11586
+ type: "address"
11587
+ }
11588
+ ],
11589
+ name: "getRewardsData",
11590
+ outputs: [
11591
+ {
11592
+ internalType: "uint256",
11593
+ name: "",
11594
+ type: "uint256"
11595
+ },
11596
+ {
11597
+ internalType: "uint256",
11598
+ name: "",
11599
+ type: "uint256"
11600
+ },
11601
+ {
11602
+ internalType: "uint256",
11603
+ name: "",
11604
+ type: "uint256"
11605
+ },
11606
+ {
11607
+ internalType: "uint256",
11608
+ name: "",
11609
+ type: "uint256"
11610
+ }
11611
+ ],
11612
+ stateMutability: "view",
11613
+ type: "function"
11614
+ },
11615
+ {
11616
+ inputs: [
11617
+ ],
11618
+ name: "getRewardsList",
11619
+ outputs: [
11620
+ {
11621
+ internalType: "address[]",
11622
+ name: "",
11623
+ type: "address[]"
11624
+ }
11625
+ ],
11626
+ stateMutability: "view",
11627
+ type: "function"
11628
+ },
11629
+ {
11630
+ inputs: [
11631
+ {
11632
+ internalType: "address",
11633
+ name: "reward",
11634
+ type: "address"
11635
+ }
11636
+ ],
11637
+ name: "getTransferStrategy",
11638
+ outputs: [
11639
+ {
11640
+ internalType: "address",
11641
+ name: "",
11642
+ type: "address"
11643
+ }
11644
+ ],
11645
+ stateMutability: "view",
11646
+ type: "function"
11647
+ },
11648
+ {
11649
+ inputs: [
11650
+ {
11651
+ internalType: "address",
11652
+ name: "user",
11653
+ type: "address"
11654
+ },
11655
+ {
11656
+ internalType: "address",
11657
+ name: "reward",
11658
+ type: "address"
11659
+ }
11660
+ ],
11661
+ name: "getUserAccruedRewards",
11662
+ outputs: [
11663
+ {
11664
+ internalType: "uint256",
11665
+ name: "",
11666
+ type: "uint256"
11667
+ }
11668
+ ],
11669
+ stateMutability: "view",
11670
+ type: "function"
11671
+ },
11672
+ {
11673
+ inputs: [
11674
+ {
11675
+ internalType: "address",
11676
+ name: "user",
11677
+ type: "address"
11678
+ },
11679
+ {
11680
+ internalType: "address",
11681
+ name: "asset",
11682
+ type: "address"
11683
+ },
11684
+ {
11685
+ internalType: "address",
11686
+ name: "reward",
11687
+ type: "address"
11688
+ }
11689
+ ],
11690
+ name: "getUserAssetIndex",
11691
+ outputs: [
11692
+ {
11693
+ internalType: "uint256",
11694
+ name: "",
11695
+ type: "uint256"
11696
+ }
11697
+ ],
11698
+ stateMutability: "view",
11699
+ type: "function"
11700
+ },
11701
+ {
11702
+ inputs: [
11703
+ {
11704
+ internalType: "address[]",
11705
+ name: "assets",
11706
+ type: "address[]"
11707
+ },
11708
+ {
11709
+ internalType: "address",
11710
+ name: "user",
11711
+ type: "address"
11712
+ },
11713
+ {
11714
+ internalType: "address",
11715
+ name: "reward",
11716
+ type: "address"
11717
+ }
11718
+ ],
11719
+ name: "getUserRewards",
11720
+ outputs: [
11721
+ {
11722
+ internalType: "uint256",
11723
+ name: "",
11724
+ type: "uint256"
11725
+ }
11726
+ ],
11727
+ stateMutability: "view",
11728
+ type: "function"
11729
+ },
11730
+ {
11731
+ inputs: [
11732
+ {
11733
+ internalType: "address",
11734
+ name: "user",
11735
+ type: "address"
11736
+ },
11737
+ {
11738
+ internalType: "uint256",
11739
+ name: "totalSupply",
11740
+ type: "uint256"
11741
+ },
11742
+ {
11743
+ internalType: "uint256",
11744
+ name: "userBalance",
11745
+ type: "uint256"
11746
+ }
11747
+ ],
11748
+ name: "handleAction",
11749
+ outputs: [
11750
+ ],
11751
+ stateMutability: "nonpayable",
11752
+ type: "function"
11753
+ },
11754
+ {
11755
+ inputs: [
11756
+ {
11757
+ internalType: "address",
11758
+ name: "emissionManager",
11759
+ type: "address"
11760
+ }
11761
+ ],
11762
+ name: "initialize",
11763
+ outputs: [
11764
+ ],
11765
+ stateMutability: "nonpayable",
11766
+ type: "function"
11767
+ },
11768
+ {
11769
+ inputs: [
11770
+ {
11771
+ internalType: "address",
11772
+ name: "user",
11773
+ type: "address"
11774
+ },
11775
+ {
11776
+ internalType: "address",
11777
+ name: "caller",
11778
+ type: "address"
11779
+ }
11780
+ ],
11781
+ name: "setClaimer",
11782
+ outputs: [
11783
+ ],
11784
+ stateMutability: "nonpayable",
11785
+ type: "function"
11786
+ },
11787
+ {
11788
+ inputs: [
11789
+ {
11790
+ internalType: "address",
11791
+ name: "asset",
11792
+ type: "address"
11793
+ },
11794
+ {
11795
+ internalType: "address",
11796
+ name: "reward",
11797
+ type: "address"
11798
+ },
11799
+ {
11800
+ internalType: "uint32",
11801
+ name: "newDistributionEnd",
11802
+ type: "uint32"
11803
+ }
11804
+ ],
11805
+ name: "setDistributionEnd",
11806
+ outputs: [
11807
+ ],
11808
+ stateMutability: "nonpayable",
11809
+ type: "function"
11810
+ },
11811
+ {
11812
+ inputs: [
11813
+ {
11814
+ internalType: "address",
11815
+ name: "emissionManager",
11816
+ type: "address"
11817
+ }
11818
+ ],
11819
+ name: "setEmissionManager",
11820
+ outputs: [
11821
+ ],
11822
+ stateMutability: "nonpayable",
11823
+ type: "function"
11824
+ },
11825
+ {
11826
+ inputs: [
11827
+ {
11828
+ internalType: "address",
11829
+ name: "asset",
11830
+ type: "address"
11831
+ },
11832
+ {
11833
+ internalType: "address[]",
11834
+ name: "rewards",
11835
+ type: "address[]"
11836
+ },
11837
+ {
11838
+ internalType: "uint88[]",
11839
+ name: "newEmissionsPerSecond",
11840
+ type: "uint88[]"
11841
+ }
11842
+ ],
11843
+ name: "setEmissionPerSecond",
11844
+ outputs: [
11845
+ ],
11846
+ stateMutability: "nonpayable",
11847
+ type: "function"
11848
+ },
11849
+ {
11850
+ inputs: [
11851
+ {
11852
+ internalType: "address",
11853
+ name: "reward",
11854
+ type: "address"
11855
+ },
11856
+ {
11857
+ internalType: "contract IEACAggregatorProxy",
11858
+ name: "rewardOracle",
11859
+ type: "address"
11860
+ }
11861
+ ],
11862
+ name: "setRewardOracle",
11863
+ outputs: [
11864
+ ],
11865
+ stateMutability: "nonpayable",
11866
+ type: "function"
11867
+ },
11868
+ {
11869
+ inputs: [
11870
+ {
11871
+ internalType: "address",
11872
+ name: "reward",
11873
+ type: "address"
11874
+ },
11875
+ {
11876
+ internalType: "contract ITransferStrategyBase",
11877
+ name: "transferStrategy",
11878
+ type: "address"
11879
+ }
11880
+ ],
11881
+ name: "setTransferStrategy",
11882
+ outputs: [
11883
+ ],
11884
+ stateMutability: "nonpayable",
11885
+ type: "function"
11886
+ }
11887
+ ];
11888
+ var IAaveV3Incentives = {
11889
+ abi: abi$j
11890
+ };
11891
+
11892
+ var abi$k = [
11893
+ {
11894
+ inputs: [
11895
+ {
11896
+ internalType: "contract IPoolAddressesProvider",
11897
+ name: "provider",
11898
+ type: "address"
11899
+ }
11900
+ ],
11901
+ stateMutability: "nonpayable",
11902
+ type: "constructor"
11903
+ },
11904
+ {
11905
+ anonymous: false,
11906
+ inputs: [
11907
+ {
11908
+ indexed: true,
11909
+ internalType: "address",
11910
+ name: "reserve",
11911
+ type: "address"
11912
+ },
11913
+ {
11914
+ indexed: true,
11915
+ internalType: "address",
11916
+ name: "backer",
11917
+ type: "address"
11918
+ },
11919
+ {
11920
+ indexed: false,
11921
+ internalType: "uint256",
11922
+ name: "amount",
11923
+ type: "uint256"
11924
+ },
11925
+ {
11926
+ indexed: false,
11927
+ internalType: "uint256",
11928
+ name: "fee",
11929
+ type: "uint256"
11930
+ }
11931
+ ],
11932
+ name: "BackUnbacked",
11933
+ type: "event"
11934
+ },
11935
+ {
11936
+ anonymous: false,
11937
+ inputs: [
11938
+ {
11939
+ indexed: true,
11940
+ internalType: "address",
11941
+ name: "reserve",
11942
+ type: "address"
11943
+ },
11944
+ {
11945
+ indexed: false,
11946
+ internalType: "address",
11947
+ name: "user",
11948
+ type: "address"
11949
+ },
11950
+ {
11951
+ indexed: true,
11952
+ internalType: "address",
11953
+ name: "onBehalfOf",
11954
+ type: "address"
11955
+ },
11956
+ {
11957
+ indexed: false,
11958
+ internalType: "uint256",
11959
+ name: "amount",
11960
+ type: "uint256"
11961
+ },
11962
+ {
11963
+ indexed: false,
11964
+ internalType: "enum DataTypes.InterestRateMode",
11965
+ name: "interestRateMode",
11966
+ type: "uint8"
11967
+ },
11968
+ {
11969
+ indexed: false,
11970
+ internalType: "uint256",
11971
+ name: "borrowRate",
11972
+ type: "uint256"
11973
+ },
11974
+ {
11975
+ indexed: true,
11976
+ internalType: "uint16",
11977
+ name: "referralCode",
11978
+ type: "uint16"
11979
+ }
11980
+ ],
11981
+ name: "Borrow",
11982
+ type: "event"
11983
+ },
11984
+ {
11985
+ anonymous: false,
11986
+ inputs: [
11987
+ {
11988
+ indexed: true,
11989
+ internalType: "address",
11990
+ name: "target",
11991
+ type: "address"
11992
+ },
11993
+ {
11994
+ indexed: false,
11995
+ internalType: "address",
11996
+ name: "initiator",
11997
+ type: "address"
11998
+ },
11999
+ {
12000
+ indexed: true,
12001
+ internalType: "address",
12002
+ name: "asset",
12003
+ type: "address"
12004
+ },
12005
+ {
12006
+ indexed: false,
12007
+ internalType: "uint256",
12008
+ name: "amount",
12009
+ type: "uint256"
12010
+ },
12011
+ {
12012
+ indexed: false,
12013
+ internalType: "enum DataTypes.InterestRateMode",
12014
+ name: "interestRateMode",
12015
+ type: "uint8"
12016
+ },
12017
+ {
12018
+ indexed: false,
12019
+ internalType: "uint256",
12020
+ name: "premium",
12021
+ type: "uint256"
12022
+ },
12023
+ {
12024
+ indexed: true,
12025
+ internalType: "uint16",
12026
+ name: "referralCode",
12027
+ type: "uint16"
12028
+ }
12029
+ ],
12030
+ name: "FlashLoan",
12031
+ type: "event"
12032
+ },
12033
+ {
12034
+ anonymous: false,
12035
+ inputs: [
12036
+ {
12037
+ indexed: true,
12038
+ internalType: "address",
12039
+ name: "asset",
12040
+ type: "address"
12041
+ },
12042
+ {
12043
+ indexed: false,
12044
+ internalType: "uint256",
12045
+ name: "totalDebt",
12046
+ type: "uint256"
12047
+ }
12048
+ ],
12049
+ name: "IsolationModeTotalDebtUpdated",
12050
+ type: "event"
12051
+ },
12052
+ {
12053
+ anonymous: false,
12054
+ inputs: [
12055
+ {
12056
+ indexed: true,
12057
+ internalType: "address",
12058
+ name: "collateralAsset",
12059
+ type: "address"
12060
+ },
12061
+ {
12062
+ indexed: true,
12063
+ internalType: "address",
12064
+ name: "debtAsset",
12065
+ type: "address"
12066
+ },
12067
+ {
12068
+ indexed: true,
12069
+ internalType: "address",
12070
+ name: "user",
12071
+ type: "address"
12072
+ },
12073
+ {
12074
+ indexed: false,
12075
+ internalType: "uint256",
12076
+ name: "debtToCover",
12077
+ type: "uint256"
12078
+ },
12079
+ {
12080
+ indexed: false,
12081
+ internalType: "uint256",
12082
+ name: "liquidatedCollateralAmount",
12083
+ type: "uint256"
12084
+ },
12085
+ {
12086
+ indexed: false,
12087
+ internalType: "address",
12088
+ name: "liquidator",
12089
+ type: "address"
12090
+ },
12091
+ {
12092
+ indexed: false,
12093
+ internalType: "bool",
12094
+ name: "receiveAToken",
12095
+ type: "bool"
12096
+ }
12097
+ ],
12098
+ name: "LiquidationCall",
12099
+ type: "event"
12100
+ },
12101
+ {
12102
+ anonymous: false,
12103
+ inputs: [
12104
+ {
12105
+ indexed: true,
12106
+ internalType: "address",
12107
+ name: "reserve",
12108
+ type: "address"
12109
+ },
12110
+ {
12111
+ indexed: false,
12112
+ internalType: "address",
12113
+ name: "user",
12114
+ type: "address"
12115
+ },
12116
+ {
12117
+ indexed: true,
12118
+ internalType: "address",
12119
+ name: "onBehalfOf",
12120
+ type: "address"
12121
+ },
12122
+ {
12123
+ indexed: false,
12124
+ internalType: "uint256",
12125
+ name: "amount",
12126
+ type: "uint256"
12127
+ },
12128
+ {
12129
+ indexed: true,
12130
+ internalType: "uint16",
12131
+ name: "referralCode",
12132
+ type: "uint16"
12133
+ }
12134
+ ],
12135
+ name: "MintUnbacked",
12136
+ type: "event"
12137
+ },
12138
+ {
12139
+ anonymous: false,
12140
+ inputs: [
12141
+ {
12142
+ indexed: true,
12143
+ internalType: "address",
12144
+ name: "reserve",
12145
+ type: "address"
12146
+ },
12147
+ {
12148
+ indexed: false,
12149
+ internalType: "uint256",
12150
+ name: "amountMinted",
12151
+ type: "uint256"
12152
+ }
12153
+ ],
12154
+ name: "MintedToTreasury",
12155
+ type: "event"
12156
+ },
12157
+ {
12158
+ anonymous: false,
12159
+ inputs: [
12160
+ {
12161
+ indexed: true,
12162
+ internalType: "address",
12163
+ name: "reserve",
12164
+ type: "address"
12165
+ },
12166
+ {
12167
+ indexed: true,
12168
+ internalType: "address",
12169
+ name: "user",
12170
+ type: "address"
12171
+ }
12172
+ ],
12173
+ name: "RebalanceStableBorrowRate",
12174
+ type: "event"
12175
+ },
12176
+ {
12177
+ anonymous: false,
12178
+ inputs: [
12179
+ {
12180
+ indexed: true,
12181
+ internalType: "address",
12182
+ name: "reserve",
12183
+ type: "address"
12184
+ },
12185
+ {
12186
+ indexed: true,
12187
+ internalType: "address",
12188
+ name: "user",
12189
+ type: "address"
12190
+ },
12191
+ {
12192
+ indexed: true,
12193
+ internalType: "address",
12194
+ name: "repayer",
12195
+ type: "address"
12196
+ },
12197
+ {
12198
+ indexed: false,
12199
+ internalType: "uint256",
12200
+ name: "amount",
12201
+ type: "uint256"
12202
+ },
12203
+ {
12204
+ indexed: false,
12205
+ internalType: "bool",
12206
+ name: "useATokens",
12207
+ type: "bool"
12208
+ }
12209
+ ],
12210
+ name: "Repay",
12211
+ type: "event"
12212
+ },
12213
+ {
12214
+ anonymous: false,
12215
+ inputs: [
12216
+ {
12217
+ indexed: true,
12218
+ internalType: "address",
12219
+ name: "reserve",
12220
+ type: "address"
12221
+ },
12222
+ {
12223
+ indexed: false,
12224
+ internalType: "uint256",
12225
+ name: "liquidityRate",
12226
+ type: "uint256"
12227
+ },
12228
+ {
12229
+ indexed: false,
12230
+ internalType: "uint256",
12231
+ name: "stableBorrowRate",
12232
+ type: "uint256"
12233
+ },
12234
+ {
12235
+ indexed: false,
12236
+ internalType: "uint256",
12237
+ name: "variableBorrowRate",
12238
+ type: "uint256"
12239
+ },
12240
+ {
12241
+ indexed: false,
12242
+ internalType: "uint256",
12243
+ name: "liquidityIndex",
12244
+ type: "uint256"
12245
+ },
12246
+ {
12247
+ indexed: false,
12248
+ internalType: "uint256",
12249
+ name: "variableBorrowIndex",
12250
+ type: "uint256"
12251
+ }
12252
+ ],
12253
+ name: "ReserveDataUpdated",
12254
+ type: "event"
12255
+ },
12256
+ {
12257
+ anonymous: false,
12258
+ inputs: [
12259
+ {
12260
+ indexed: true,
12261
+ internalType: "address",
12262
+ name: "reserve",
12263
+ type: "address"
12264
+ },
12265
+ {
12266
+ indexed: true,
12267
+ internalType: "address",
12268
+ name: "user",
12269
+ type: "address"
12270
+ }
12271
+ ],
12272
+ name: "ReserveUsedAsCollateralDisabled",
12273
+ type: "event"
12274
+ },
12275
+ {
12276
+ anonymous: false,
12277
+ inputs: [
12278
+ {
12279
+ indexed: true,
12280
+ internalType: "address",
12281
+ name: "reserve",
12282
+ type: "address"
12283
+ },
12284
+ {
12285
+ indexed: true,
12286
+ internalType: "address",
12287
+ name: "user",
12288
+ type: "address"
12289
+ }
12290
+ ],
12291
+ name: "ReserveUsedAsCollateralEnabled",
12292
+ type: "event"
12293
+ },
12294
+ {
12295
+ anonymous: false,
12296
+ inputs: [
12297
+ {
12298
+ indexed: true,
12299
+ internalType: "address",
12300
+ name: "reserve",
12301
+ type: "address"
12302
+ },
12303
+ {
12304
+ indexed: false,
12305
+ internalType: "address",
12306
+ name: "user",
12307
+ type: "address"
12308
+ },
12309
+ {
12310
+ indexed: true,
12311
+ internalType: "address",
12312
+ name: "onBehalfOf",
12313
+ type: "address"
12314
+ },
12315
+ {
12316
+ indexed: false,
12317
+ internalType: "uint256",
12318
+ name: "amount",
12319
+ type: "uint256"
12320
+ },
12321
+ {
12322
+ indexed: true,
12323
+ internalType: "uint16",
12324
+ name: "referralCode",
12325
+ type: "uint16"
12326
+ }
12327
+ ],
12328
+ name: "Supply",
12329
+ type: "event"
12330
+ },
12331
+ {
12332
+ anonymous: false,
12333
+ inputs: [
12334
+ {
12335
+ indexed: true,
12336
+ internalType: "address",
12337
+ name: "reserve",
12338
+ type: "address"
12339
+ },
12340
+ {
12341
+ indexed: true,
12342
+ internalType: "address",
12343
+ name: "user",
12344
+ type: "address"
12345
+ },
12346
+ {
12347
+ indexed: false,
12348
+ internalType: "enum DataTypes.InterestRateMode",
12349
+ name: "interestRateMode",
12350
+ type: "uint8"
12351
+ }
12352
+ ],
12353
+ name: "SwapBorrowRateMode",
12354
+ type: "event"
12355
+ },
12356
+ {
12357
+ anonymous: false,
12358
+ inputs: [
12359
+ {
12360
+ indexed: true,
12361
+ internalType: "address",
12362
+ name: "user",
12363
+ type: "address"
12364
+ },
12365
+ {
12366
+ indexed: false,
12367
+ internalType: "uint8",
12368
+ name: "categoryId",
12369
+ type: "uint8"
12370
+ }
12371
+ ],
12372
+ name: "UserEModeSet",
12373
+ type: "event"
12374
+ },
12375
+ {
12376
+ anonymous: false,
12377
+ inputs: [
12378
+ {
12379
+ indexed: true,
12380
+ internalType: "address",
12381
+ name: "reserve",
12382
+ type: "address"
12383
+ },
12384
+ {
12385
+ indexed: true,
12386
+ internalType: "address",
12387
+ name: "user",
12388
+ type: "address"
12389
+ },
12390
+ {
12391
+ indexed: true,
12392
+ internalType: "address",
12393
+ name: "to",
12394
+ type: "address"
12395
+ },
12396
+ {
12397
+ indexed: false,
12398
+ internalType: "uint256",
12399
+ name: "amount",
12400
+ type: "uint256"
12401
+ }
12402
+ ],
12403
+ name: "Withdraw",
12404
+ type: "event"
12405
+ },
12406
+ {
12407
+ inputs: [
12408
+ ],
12409
+ name: "ADDRESSES_PROVIDER",
12410
+ outputs: [
12411
+ {
12412
+ internalType: "contract IPoolAddressesProvider",
12413
+ name: "",
12414
+ type: "address"
12415
+ }
12416
+ ],
12417
+ stateMutability: "view",
12418
+ type: "function"
12419
+ },
12420
+ {
12421
+ inputs: [
12422
+ ],
12423
+ name: "BRIDGE_PROTOCOL_FEE",
12424
+ outputs: [
12425
+ {
12426
+ internalType: "uint256",
12427
+ name: "",
12428
+ type: "uint256"
12429
+ }
12430
+ ],
12431
+ stateMutability: "view",
12432
+ type: "function"
12433
+ },
12434
+ {
12435
+ inputs: [
12436
+ ],
12437
+ name: "FLASHLOAN_PREMIUM_TOTAL",
12438
+ outputs: [
12439
+ {
12440
+ internalType: "uint128",
12441
+ name: "",
12442
+ type: "uint128"
12443
+ }
12444
+ ],
12445
+ stateMutability: "view",
12446
+ type: "function"
12447
+ },
12448
+ {
12449
+ inputs: [
12450
+ ],
12451
+ name: "FLASHLOAN_PREMIUM_TO_PROTOCOL",
12452
+ outputs: [
12453
+ {
12454
+ internalType: "uint128",
12455
+ name: "",
12456
+ type: "uint128"
12457
+ }
12458
+ ],
12459
+ stateMutability: "view",
12460
+ type: "function"
12461
+ },
12462
+ {
12463
+ inputs: [
12464
+ ],
12465
+ name: "MAX_NUMBER_RESERVES",
12466
+ outputs: [
12467
+ {
12468
+ internalType: "uint16",
12469
+ name: "",
12470
+ type: "uint16"
12471
+ }
12472
+ ],
12473
+ stateMutability: "view",
12474
+ type: "function"
12475
+ },
12476
+ {
12477
+ inputs: [
12478
+ ],
12479
+ name: "MAX_STABLE_RATE_BORROW_SIZE_PERCENT",
12480
+ outputs: [
12481
+ {
12482
+ internalType: "uint256",
12483
+ name: "",
12484
+ type: "uint256"
12485
+ }
12486
+ ],
12487
+ stateMutability: "view",
12488
+ type: "function"
12489
+ },
12490
+ {
12491
+ inputs: [
12492
+ ],
12493
+ name: "POOL_REVISION",
12494
+ outputs: [
12495
+ {
12496
+ internalType: "uint256",
12497
+ name: "",
12498
+ type: "uint256"
12499
+ }
12500
+ ],
12501
+ stateMutability: "view",
12502
+ type: "function"
12503
+ },
12504
+ {
12505
+ inputs: [
12506
+ {
12507
+ internalType: "address",
12508
+ name: "asset",
12509
+ type: "address"
12510
+ },
12511
+ {
12512
+ internalType: "uint256",
12513
+ name: "amount",
12514
+ type: "uint256"
12515
+ },
12516
+ {
12517
+ internalType: "uint256",
12518
+ name: "fee",
12519
+ type: "uint256"
12520
+ }
12521
+ ],
12522
+ name: "backUnbacked",
12523
+ outputs: [
12524
+ ],
12525
+ stateMutability: "nonpayable",
12526
+ type: "function"
12527
+ },
12528
+ {
12529
+ inputs: [
12530
+ {
12531
+ internalType: "address",
12532
+ name: "asset",
12533
+ type: "address"
12534
+ },
12535
+ {
12536
+ internalType: "uint256",
12537
+ name: "amount",
12538
+ type: "uint256"
12539
+ },
12540
+ {
12541
+ internalType: "uint256",
12542
+ name: "interestRateMode",
12543
+ type: "uint256"
12544
+ },
12545
+ {
12546
+ internalType: "uint16",
12547
+ name: "referralCode",
12548
+ type: "uint16"
12549
+ },
12550
+ {
12551
+ internalType: "address",
12552
+ name: "onBehalfOf",
12553
+ type: "address"
12554
+ }
12555
+ ],
12556
+ name: "borrow",
12557
+ outputs: [
12558
+ ],
12559
+ stateMutability: "nonpayable",
12560
+ type: "function"
12561
+ },
12562
+ {
12563
+ inputs: [
12564
+ {
12565
+ internalType: "uint8",
12566
+ name: "id",
12567
+ type: "uint8"
12568
+ },
12569
+ {
12570
+ components: [
12571
+ {
12572
+ internalType: "uint16",
12573
+ name: "ltv",
12574
+ type: "uint16"
12575
+ },
12576
+ {
12577
+ internalType: "uint16",
12578
+ name: "liquidationThreshold",
12579
+ type: "uint16"
12580
+ },
12581
+ {
12582
+ internalType: "uint16",
12583
+ name: "liquidationBonus",
12584
+ type: "uint16"
12585
+ },
12586
+ {
12587
+ internalType: "address",
12588
+ name: "priceSource",
12589
+ type: "address"
12590
+ },
12591
+ {
12592
+ internalType: "string",
12593
+ name: "label",
12594
+ type: "string"
12595
+ }
12596
+ ],
12597
+ internalType: "struct DataTypes.EModeCategory",
12598
+ name: "category",
12599
+ type: "tuple"
12600
+ }
12601
+ ],
12602
+ name: "configureEModeCategory",
12603
+ outputs: [
12604
+ ],
12605
+ stateMutability: "nonpayable",
12606
+ type: "function"
12607
+ },
12608
+ {
12609
+ inputs: [
12610
+ {
12611
+ internalType: "address",
12612
+ name: "asset",
12613
+ type: "address"
12614
+ },
12615
+ {
12616
+ internalType: "uint256",
12617
+ name: "amount",
12618
+ type: "uint256"
12619
+ },
12620
+ {
12621
+ internalType: "address",
12622
+ name: "onBehalfOf",
12623
+ type: "address"
12624
+ },
12625
+ {
12626
+ internalType: "uint16",
12627
+ name: "referralCode",
12628
+ type: "uint16"
12629
+ }
12630
+ ],
12631
+ name: "deposit",
12632
+ outputs: [
12633
+ ],
12634
+ stateMutability: "nonpayable",
12635
+ type: "function"
12636
+ },
12637
+ {
12638
+ inputs: [
12639
+ {
12640
+ internalType: "address",
12641
+ name: "asset",
12642
+ type: "address"
12643
+ }
12644
+ ],
12645
+ name: "dropReserve",
12646
+ outputs: [
12647
+ ],
12648
+ stateMutability: "nonpayable",
12649
+ type: "function"
12650
+ },
12651
+ {
12652
+ inputs: [
12653
+ {
12654
+ internalType: "address",
12655
+ name: "asset",
12656
+ type: "address"
12657
+ },
12658
+ {
12659
+ internalType: "address",
12660
+ name: "from",
12661
+ type: "address"
12662
+ },
12663
+ {
12664
+ internalType: "address",
12665
+ name: "to",
12666
+ type: "address"
12667
+ },
12668
+ {
12669
+ internalType: "uint256",
12670
+ name: "amount",
12671
+ type: "uint256"
12672
+ },
12673
+ {
12674
+ internalType: "uint256",
12675
+ name: "balanceFromBefore",
12676
+ type: "uint256"
12677
+ },
12678
+ {
12679
+ internalType: "uint256",
12680
+ name: "balanceToBefore",
12681
+ type: "uint256"
12682
+ }
12683
+ ],
12684
+ name: "finalizeTransfer",
12685
+ outputs: [
12686
+ ],
12687
+ stateMutability: "nonpayable",
12688
+ type: "function"
12689
+ },
12690
+ {
12691
+ inputs: [
12692
+ {
12693
+ internalType: "address",
12694
+ name: "receiverAddress",
12695
+ type: "address"
12696
+ },
12697
+ {
12698
+ internalType: "address[]",
12699
+ name: "assets",
12700
+ type: "address[]"
12701
+ },
12702
+ {
12703
+ internalType: "uint256[]",
12704
+ name: "amounts",
12705
+ type: "uint256[]"
12706
+ },
12707
+ {
12708
+ internalType: "uint256[]",
12709
+ name: "interestRateModes",
12710
+ type: "uint256[]"
12711
+ },
12712
+ {
12713
+ internalType: "address",
12714
+ name: "onBehalfOf",
12715
+ type: "address"
12716
+ },
12717
+ {
12718
+ internalType: "bytes",
12719
+ name: "params",
12720
+ type: "bytes"
12721
+ },
12722
+ {
12723
+ internalType: "uint16",
12724
+ name: "referralCode",
12725
+ type: "uint16"
12726
+ }
12727
+ ],
12728
+ name: "flashLoan",
12729
+ outputs: [
12730
+ ],
12731
+ stateMutability: "nonpayable",
12732
+ type: "function"
12733
+ },
12734
+ {
12735
+ inputs: [
12736
+ {
12737
+ internalType: "address",
12738
+ name: "receiverAddress",
12739
+ type: "address"
12740
+ },
12741
+ {
12742
+ internalType: "address",
12743
+ name: "asset",
12744
+ type: "address"
12745
+ },
12746
+ {
12747
+ internalType: "uint256",
12748
+ name: "amount",
12749
+ type: "uint256"
12750
+ },
12751
+ {
12752
+ internalType: "bytes",
12753
+ name: "params",
12754
+ type: "bytes"
12755
+ },
12756
+ {
12757
+ internalType: "uint16",
12758
+ name: "referralCode",
12759
+ type: "uint16"
12760
+ }
12761
+ ],
12762
+ name: "flashLoanSimple",
12763
+ outputs: [
12764
+ ],
12765
+ stateMutability: "nonpayable",
12766
+ type: "function"
12767
+ },
12768
+ {
12769
+ inputs: [
12770
+ {
12771
+ internalType: "address",
12772
+ name: "asset",
12773
+ type: "address"
12774
+ }
12775
+ ],
12776
+ name: "getConfiguration",
12777
+ outputs: [
12778
+ {
12779
+ components: [
12780
+ {
12781
+ internalType: "uint256",
12782
+ name: "data",
12783
+ type: "uint256"
12784
+ }
12785
+ ],
12786
+ internalType: "struct DataTypes.ReserveConfigurationMap",
12787
+ name: "",
12788
+ type: "tuple"
12789
+ }
12790
+ ],
12791
+ stateMutability: "view",
12792
+ type: "function"
12793
+ },
12794
+ {
12795
+ inputs: [
12796
+ {
12797
+ internalType: "uint8",
12798
+ name: "id",
12799
+ type: "uint8"
12800
+ }
12801
+ ],
12802
+ name: "getEModeCategoryData",
12803
+ outputs: [
12804
+ {
12805
+ components: [
12806
+ {
12807
+ internalType: "uint16",
12808
+ name: "ltv",
12809
+ type: "uint16"
12810
+ },
12811
+ {
12812
+ internalType: "uint16",
12813
+ name: "liquidationThreshold",
12814
+ type: "uint16"
12815
+ },
12816
+ {
12817
+ internalType: "uint16",
12818
+ name: "liquidationBonus",
12819
+ type: "uint16"
12820
+ },
12821
+ {
12822
+ internalType: "address",
12823
+ name: "priceSource",
12824
+ type: "address"
12825
+ },
12826
+ {
12827
+ internalType: "string",
12828
+ name: "label",
12829
+ type: "string"
12830
+ }
12831
+ ],
12832
+ internalType: "struct DataTypes.EModeCategory",
12833
+ name: "",
12834
+ type: "tuple"
12835
+ }
12836
+ ],
12837
+ stateMutability: "view",
12838
+ type: "function"
12839
+ },
12840
+ {
12841
+ inputs: [
12842
+ {
12843
+ internalType: "uint16",
12844
+ name: "id",
12845
+ type: "uint16"
12846
+ }
12847
+ ],
12848
+ name: "getReserveAddressById",
12849
+ outputs: [
12850
+ {
12851
+ internalType: "address",
12852
+ name: "",
12853
+ type: "address"
12854
+ }
12855
+ ],
12856
+ stateMutability: "view",
12857
+ type: "function"
12858
+ },
12859
+ {
12860
+ inputs: [
12861
+ {
12862
+ internalType: "address",
12863
+ name: "asset",
12864
+ type: "address"
12865
+ }
12866
+ ],
12867
+ name: "getReserveData",
12868
+ outputs: [
12869
+ {
12870
+ components: [
12871
+ {
12872
+ components: [
12873
+ {
12874
+ internalType: "uint256",
12875
+ name: "data",
12876
+ type: "uint256"
12877
+ }
12878
+ ],
12879
+ internalType: "struct DataTypes.ReserveConfigurationMap",
12880
+ name: "configuration",
12881
+ type: "tuple"
12882
+ },
12883
+ {
12884
+ internalType: "uint128",
12885
+ name: "liquidityIndex",
12886
+ type: "uint128"
12887
+ },
12888
+ {
12889
+ internalType: "uint128",
12890
+ name: "currentLiquidityRate",
12891
+ type: "uint128"
12892
+ },
12893
+ {
12894
+ internalType: "uint128",
12895
+ name: "variableBorrowIndex",
12896
+ type: "uint128"
12897
+ },
12898
+ {
12899
+ internalType: "uint128",
12900
+ name: "currentVariableBorrowRate",
12901
+ type: "uint128"
12902
+ },
12903
+ {
12904
+ internalType: "uint128",
12905
+ name: "currentStableBorrowRate",
12906
+ type: "uint128"
12907
+ },
12908
+ {
12909
+ internalType: "uint40",
12910
+ name: "lastUpdateTimestamp",
12911
+ type: "uint40"
12912
+ },
12913
+ {
12914
+ internalType: "uint16",
12915
+ name: "id",
12916
+ type: "uint16"
12917
+ },
12918
+ {
12919
+ internalType: "address",
12920
+ name: "aTokenAddress",
12921
+ type: "address"
12922
+ },
12923
+ {
12924
+ internalType: "address",
12925
+ name: "stableDebtTokenAddress",
12926
+ type: "address"
12927
+ },
12928
+ {
12929
+ internalType: "address",
12930
+ name: "variableDebtTokenAddress",
12931
+ type: "address"
12932
+ },
12933
+ {
12934
+ internalType: "address",
12935
+ name: "interestRateStrategyAddress",
12936
+ type: "address"
12937
+ },
12938
+ {
12939
+ internalType: "uint128",
12940
+ name: "accruedToTreasury",
12941
+ type: "uint128"
12942
+ },
12943
+ {
12944
+ internalType: "uint128",
12945
+ name: "unbacked",
12946
+ type: "uint128"
12947
+ },
12948
+ {
12949
+ internalType: "uint128",
12950
+ name: "isolationModeTotalDebt",
12951
+ type: "uint128"
12952
+ }
12953
+ ],
12954
+ internalType: "struct DataTypes.ReserveData",
12955
+ name: "",
12956
+ type: "tuple"
12957
+ }
12958
+ ],
12959
+ stateMutability: "view",
12960
+ type: "function"
12961
+ },
12962
+ {
12963
+ inputs: [
12964
+ {
12965
+ internalType: "address",
12966
+ name: "asset",
12967
+ type: "address"
12968
+ }
12969
+ ],
12970
+ name: "getReserveNormalizedIncome",
12971
+ outputs: [
12972
+ {
12973
+ internalType: "uint256",
12974
+ name: "",
12975
+ type: "uint256"
12976
+ }
12977
+ ],
12978
+ stateMutability: "view",
12979
+ type: "function"
12980
+ },
12981
+ {
12982
+ inputs: [
12983
+ {
12984
+ internalType: "address",
12985
+ name: "asset",
12986
+ type: "address"
12987
+ }
12988
+ ],
12989
+ name: "getReserveNormalizedVariableDebt",
12990
+ outputs: [
12991
+ {
12992
+ internalType: "uint256",
12993
+ name: "",
12994
+ type: "uint256"
12995
+ }
12996
+ ],
12997
+ stateMutability: "view",
12998
+ type: "function"
12999
+ },
13000
+ {
13001
+ inputs: [
13002
+ ],
13003
+ name: "getReservesList",
13004
+ outputs: [
13005
+ {
13006
+ internalType: "address[]",
13007
+ name: "",
13008
+ type: "address[]"
13009
+ }
13010
+ ],
13011
+ stateMutability: "view",
13012
+ type: "function"
13013
+ },
13014
+ {
13015
+ inputs: [
13016
+ {
13017
+ internalType: "address",
13018
+ name: "user",
13019
+ type: "address"
13020
+ }
13021
+ ],
13022
+ name: "getUserAccountData",
13023
+ outputs: [
13024
+ {
13025
+ internalType: "uint256",
13026
+ name: "totalCollateralBase",
13027
+ type: "uint256"
13028
+ },
13029
+ {
13030
+ internalType: "uint256",
13031
+ name: "totalDebtBase",
13032
+ type: "uint256"
13033
+ },
13034
+ {
13035
+ internalType: "uint256",
13036
+ name: "availableBorrowsBase",
13037
+ type: "uint256"
13038
+ },
13039
+ {
13040
+ internalType: "uint256",
13041
+ name: "currentLiquidationThreshold",
13042
+ type: "uint256"
13043
+ },
13044
+ {
13045
+ internalType: "uint256",
13046
+ name: "ltv",
13047
+ type: "uint256"
13048
+ },
13049
+ {
13050
+ internalType: "uint256",
13051
+ name: "healthFactor",
13052
+ type: "uint256"
13053
+ }
13054
+ ],
13055
+ stateMutability: "view",
13056
+ type: "function"
13057
+ },
13058
+ {
13059
+ inputs: [
13060
+ {
13061
+ internalType: "address",
13062
+ name: "user",
13063
+ type: "address"
13064
+ }
13065
+ ],
13066
+ name: "getUserConfiguration",
13067
+ outputs: [
13068
+ {
13069
+ components: [
13070
+ {
13071
+ internalType: "uint256",
13072
+ name: "data",
13073
+ type: "uint256"
13074
+ }
13075
+ ],
13076
+ internalType: "struct DataTypes.UserConfigurationMap",
13077
+ name: "",
13078
+ type: "tuple"
13079
+ }
13080
+ ],
13081
+ stateMutability: "view",
13082
+ type: "function"
13083
+ },
13084
+ {
13085
+ inputs: [
13086
+ {
13087
+ internalType: "address",
13088
+ name: "user",
13089
+ type: "address"
13090
+ }
13091
+ ],
13092
+ name: "getUserEMode",
13093
+ outputs: [
13094
+ {
13095
+ internalType: "uint256",
13096
+ name: "",
13097
+ type: "uint256"
13098
+ }
13099
+ ],
13100
+ stateMutability: "view",
13101
+ type: "function"
13102
+ },
13103
+ {
13104
+ inputs: [
13105
+ {
13106
+ internalType: "address",
13107
+ name: "asset",
13108
+ type: "address"
13109
+ },
13110
+ {
13111
+ internalType: "address",
13112
+ name: "aTokenAddress",
13113
+ type: "address"
13114
+ },
13115
+ {
13116
+ internalType: "address",
13117
+ name: "stableDebtAddress",
13118
+ type: "address"
13119
+ },
13120
+ {
13121
+ internalType: "address",
13122
+ name: "variableDebtAddress",
13123
+ type: "address"
13124
+ },
13125
+ {
13126
+ internalType: "address",
13127
+ name: "interestRateStrategyAddress",
13128
+ type: "address"
13129
+ }
13130
+ ],
13131
+ name: "initReserve",
13132
+ outputs: [
13133
+ ],
13134
+ stateMutability: "nonpayable",
13135
+ type: "function"
13136
+ },
13137
+ {
13138
+ inputs: [
13139
+ {
13140
+ internalType: "contract IPoolAddressesProvider",
13141
+ name: "provider",
13142
+ type: "address"
13143
+ }
13144
+ ],
13145
+ name: "initialize",
13146
+ outputs: [
13147
+ ],
13148
+ stateMutability: "nonpayable",
13149
+ type: "function"
13150
+ },
13151
+ {
13152
+ inputs: [
13153
+ {
13154
+ internalType: "address",
13155
+ name: "collateralAsset",
13156
+ type: "address"
13157
+ },
13158
+ {
13159
+ internalType: "address",
13160
+ name: "debtAsset",
13161
+ type: "address"
13162
+ },
13163
+ {
13164
+ internalType: "address",
13165
+ name: "user",
13166
+ type: "address"
13167
+ },
13168
+ {
13169
+ internalType: "uint256",
13170
+ name: "debtToCover",
13171
+ type: "uint256"
13172
+ },
13173
+ {
13174
+ internalType: "bool",
13175
+ name: "receiveAToken",
13176
+ type: "bool"
13177
+ }
13178
+ ],
13179
+ name: "liquidationCall",
13180
+ outputs: [
13181
+ ],
13182
+ stateMutability: "nonpayable",
13183
+ type: "function"
13184
+ },
13185
+ {
13186
+ inputs: [
13187
+ {
13188
+ internalType: "address[]",
13189
+ name: "assets",
13190
+ type: "address[]"
13191
+ }
13192
+ ],
13193
+ name: "mintToTreasury",
13194
+ outputs: [
13195
+ ],
13196
+ stateMutability: "nonpayable",
13197
+ type: "function"
13198
+ },
13199
+ {
13200
+ inputs: [
13201
+ {
13202
+ internalType: "address",
13203
+ name: "asset",
13204
+ type: "address"
13205
+ },
13206
+ {
13207
+ internalType: "uint256",
13208
+ name: "amount",
13209
+ type: "uint256"
13210
+ },
13211
+ {
13212
+ internalType: "address",
13213
+ name: "onBehalfOf",
13214
+ type: "address"
13215
+ },
13216
+ {
13217
+ internalType: "uint16",
13218
+ name: "referralCode",
13219
+ type: "uint16"
13220
+ }
13221
+ ],
13222
+ name: "mintUnbacked",
13223
+ outputs: [
13224
+ ],
13225
+ stateMutability: "nonpayable",
13226
+ type: "function"
13227
+ },
13228
+ {
13229
+ inputs: [
13230
+ {
13231
+ internalType: "address",
13232
+ name: "asset",
13233
+ type: "address"
13234
+ },
13235
+ {
13236
+ internalType: "address",
13237
+ name: "user",
13238
+ type: "address"
13239
+ }
13240
+ ],
13241
+ name: "rebalanceStableBorrowRate",
13242
+ outputs: [
13243
+ ],
13244
+ stateMutability: "nonpayable",
13245
+ type: "function"
13246
+ },
13247
+ {
13248
+ inputs: [
13249
+ {
13250
+ internalType: "address",
13251
+ name: "asset",
13252
+ type: "address"
13253
+ },
13254
+ {
13255
+ internalType: "uint256",
13256
+ name: "amount",
13257
+ type: "uint256"
13258
+ },
13259
+ {
13260
+ internalType: "uint256",
13261
+ name: "interestRateMode",
13262
+ type: "uint256"
13263
+ },
13264
+ {
13265
+ internalType: "address",
13266
+ name: "onBehalfOf",
13267
+ type: "address"
13268
+ }
13269
+ ],
13270
+ name: "repay",
13271
+ outputs: [
13272
+ {
13273
+ internalType: "uint256",
13274
+ name: "",
13275
+ type: "uint256"
13276
+ }
13277
+ ],
13278
+ stateMutability: "nonpayable",
13279
+ type: "function"
13280
+ },
13281
+ {
13282
+ inputs: [
13283
+ {
13284
+ internalType: "address",
13285
+ name: "asset",
13286
+ type: "address"
13287
+ },
13288
+ {
13289
+ internalType: "uint256",
13290
+ name: "amount",
13291
+ type: "uint256"
13292
+ },
13293
+ {
13294
+ internalType: "uint256",
13295
+ name: "interestRateMode",
13296
+ type: "uint256"
13297
+ }
13298
+ ],
13299
+ name: "repayWithATokens",
13300
+ outputs: [
13301
+ {
13302
+ internalType: "uint256",
13303
+ name: "",
13304
+ type: "uint256"
13305
+ }
13306
+ ],
13307
+ stateMutability: "nonpayable",
13308
+ type: "function"
13309
+ },
13310
+ {
13311
+ inputs: [
13312
+ {
13313
+ internalType: "address",
13314
+ name: "asset",
13315
+ type: "address"
13316
+ },
13317
+ {
13318
+ internalType: "uint256",
13319
+ name: "amount",
13320
+ type: "uint256"
13321
+ },
13322
+ {
13323
+ internalType: "uint256",
13324
+ name: "interestRateMode",
13325
+ type: "uint256"
13326
+ },
13327
+ {
13328
+ internalType: "address",
13329
+ name: "onBehalfOf",
13330
+ type: "address"
13331
+ },
13332
+ {
13333
+ internalType: "uint256",
13334
+ name: "deadline",
13335
+ type: "uint256"
13336
+ },
13337
+ {
13338
+ internalType: "uint8",
13339
+ name: "permitV",
13340
+ type: "uint8"
13341
+ },
13342
+ {
13343
+ internalType: "bytes32",
13344
+ name: "permitR",
13345
+ type: "bytes32"
13346
+ },
13347
+ {
13348
+ internalType: "bytes32",
13349
+ name: "permitS",
13350
+ type: "bytes32"
13351
+ }
13352
+ ],
13353
+ name: "repayWithPermit",
13354
+ outputs: [
13355
+ {
13356
+ internalType: "uint256",
13357
+ name: "",
13358
+ type: "uint256"
13359
+ }
13360
+ ],
13361
+ stateMutability: "nonpayable",
13362
+ type: "function"
13363
+ },
13364
+ {
13365
+ inputs: [
13366
+ {
13367
+ internalType: "address",
13368
+ name: "token",
13369
+ type: "address"
13370
+ },
13371
+ {
13372
+ internalType: "address",
13373
+ name: "to",
13374
+ type: "address"
13375
+ },
13376
+ {
13377
+ internalType: "uint256",
13378
+ name: "amount",
13379
+ type: "uint256"
13380
+ }
13381
+ ],
13382
+ name: "rescueTokens",
13383
+ outputs: [
13384
+ ],
13385
+ stateMutability: "nonpayable",
13386
+ type: "function"
13387
+ },
13388
+ {
13389
+ inputs: [
13390
+ {
13391
+ internalType: "address",
13392
+ name: "asset",
13393
+ type: "address"
13394
+ }
13395
+ ],
13396
+ name: "resetIsolationModeTotalDebt",
13397
+ outputs: [
13398
+ ],
13399
+ stateMutability: "nonpayable",
13400
+ type: "function"
13401
+ },
13402
+ {
13403
+ inputs: [
13404
+ {
13405
+ internalType: "address",
13406
+ name: "asset",
13407
+ type: "address"
13408
+ },
13409
+ {
13410
+ components: [
13411
+ {
13412
+ internalType: "uint256",
13413
+ name: "data",
13414
+ type: "uint256"
13415
+ }
13416
+ ],
13417
+ internalType: "struct DataTypes.ReserveConfigurationMap",
13418
+ name: "configuration",
13419
+ type: "tuple"
13420
+ }
13421
+ ],
13422
+ name: "setConfiguration",
13423
+ outputs: [
13424
+ ],
13425
+ stateMutability: "nonpayable",
13426
+ type: "function"
13427
+ },
13428
+ {
13429
+ inputs: [
13430
+ {
13431
+ internalType: "address",
13432
+ name: "asset",
13433
+ type: "address"
13434
+ },
13435
+ {
13436
+ internalType: "address",
13437
+ name: "rateStrategyAddress",
13438
+ type: "address"
13439
+ }
13440
+ ],
13441
+ name: "setReserveInterestRateStrategyAddress",
13442
+ outputs: [
13443
+ ],
13444
+ stateMutability: "nonpayable",
13445
+ type: "function"
13446
+ },
13447
+ {
13448
+ inputs: [
13449
+ {
13450
+ internalType: "uint8",
13451
+ name: "categoryId",
13452
+ type: "uint8"
13453
+ }
13454
+ ],
13455
+ name: "setUserEMode",
13456
+ outputs: [
13457
+ ],
13458
+ stateMutability: "nonpayable",
13459
+ type: "function"
13460
+ },
13461
+ {
13462
+ inputs: [
13463
+ {
13464
+ internalType: "address",
13465
+ name: "asset",
13466
+ type: "address"
13467
+ },
13468
+ {
13469
+ internalType: "bool",
13470
+ name: "useAsCollateral",
13471
+ type: "bool"
13472
+ }
13473
+ ],
13474
+ name: "setUserUseReserveAsCollateral",
13475
+ outputs: [
13476
+ ],
13477
+ stateMutability: "nonpayable",
13478
+ type: "function"
13479
+ },
13480
+ {
13481
+ inputs: [
13482
+ {
13483
+ internalType: "address",
13484
+ name: "asset",
13485
+ type: "address"
13486
+ },
13487
+ {
13488
+ internalType: "uint256",
13489
+ name: "amount",
13490
+ type: "uint256"
13491
+ },
13492
+ {
13493
+ internalType: "address",
13494
+ name: "onBehalfOf",
13495
+ type: "address"
13496
+ },
13497
+ {
13498
+ internalType: "uint16",
13499
+ name: "referralCode",
13500
+ type: "uint16"
13501
+ }
13502
+ ],
13503
+ name: "supply",
13504
+ outputs: [
13505
+ ],
13506
+ stateMutability: "nonpayable",
13507
+ type: "function"
13508
+ },
13509
+ {
13510
+ inputs: [
13511
+ {
13512
+ internalType: "address",
13513
+ name: "asset",
13514
+ type: "address"
13515
+ },
13516
+ {
13517
+ internalType: "uint256",
13518
+ name: "amount",
13519
+ type: "uint256"
13520
+ },
13521
+ {
13522
+ internalType: "address",
13523
+ name: "onBehalfOf",
13524
+ type: "address"
13525
+ },
13526
+ {
13527
+ internalType: "uint16",
13528
+ name: "referralCode",
13529
+ type: "uint16"
13530
+ },
13531
+ {
13532
+ internalType: "uint256",
13533
+ name: "deadline",
13534
+ type: "uint256"
13535
+ },
13536
+ {
13537
+ internalType: "uint8",
13538
+ name: "permitV",
13539
+ type: "uint8"
13540
+ },
13541
+ {
13542
+ internalType: "bytes32",
13543
+ name: "permitR",
13544
+ type: "bytes32"
13545
+ },
13546
+ {
13547
+ internalType: "bytes32",
13548
+ name: "permitS",
13549
+ type: "bytes32"
13550
+ }
13551
+ ],
13552
+ name: "supplyWithPermit",
13553
+ outputs: [
13554
+ ],
13555
+ stateMutability: "nonpayable",
13556
+ type: "function"
13557
+ },
13558
+ {
13559
+ inputs: [
13560
+ {
13561
+ internalType: "address",
13562
+ name: "asset",
13563
+ type: "address"
13564
+ },
13565
+ {
13566
+ internalType: "uint256",
13567
+ name: "interestRateMode",
13568
+ type: "uint256"
13569
+ }
13570
+ ],
13571
+ name: "swapBorrowRateMode",
13572
+ outputs: [
13573
+ ],
13574
+ stateMutability: "nonpayable",
13575
+ type: "function"
13576
+ },
13577
+ {
13578
+ inputs: [
13579
+ {
13580
+ internalType: "uint256",
13581
+ name: "protocolFee",
13582
+ type: "uint256"
13583
+ }
13584
+ ],
13585
+ name: "updateBridgeProtocolFee",
13586
+ outputs: [
13587
+ ],
13588
+ stateMutability: "nonpayable",
13589
+ type: "function"
13590
+ },
13591
+ {
13592
+ inputs: [
13593
+ {
13594
+ internalType: "uint128",
13595
+ name: "flashLoanPremiumTotal",
13596
+ type: "uint128"
13597
+ },
13598
+ {
13599
+ internalType: "uint128",
13600
+ name: "flashLoanPremiumToProtocol",
13601
+ type: "uint128"
13602
+ }
13603
+ ],
13604
+ name: "updateFlashloanPremiums",
13605
+ outputs: [
13606
+ ],
13607
+ stateMutability: "nonpayable",
13608
+ type: "function"
13609
+ },
13610
+ {
13611
+ inputs: [
13612
+ {
13613
+ internalType: "address",
13614
+ name: "asset",
13615
+ type: "address"
13616
+ },
13617
+ {
13618
+ internalType: "uint256",
13619
+ name: "amount",
13620
+ type: "uint256"
13621
+ },
13622
+ {
13623
+ internalType: "address",
13624
+ name: "to",
13625
+ type: "address"
13626
+ }
13627
+ ],
13628
+ name: "withdraw",
13629
+ outputs: [
13630
+ {
13631
+ internalType: "uint256",
13632
+ name: "",
13633
+ type: "uint256"
13634
+ }
13635
+ ],
13636
+ stateMutability: "nonpayable",
13637
+ type: "function"
13638
+ }
13639
+ ];
13640
+ var ILendingPoolV3 = {
13641
+ abi: abi$k
13642
+ };
13643
+
13644
+ function getAaveAssetsForUnderlying(_x, _x2, _x3) {
13645
+ return _getAaveAssetsForUnderlying.apply(this, arguments);
13646
+ }
13647
+
13648
+ function _getAaveAssetsForUnderlying() {
13649
+ _getAaveAssetsForUnderlying = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool, dapp, assets) {
13650
+ var iLendingPool, lendingPool, reserveData, aTokens, debtTokens;
13651
+ return runtime_1.wrap(function _callee$(_context) {
13652
+ while (1) {
13653
+ switch (_context.prev = _context.next) {
13654
+ case 0:
13655
+ iLendingPool = dapp === Dapp.AAVEV3 ? ILendingPoolV3 : ILendingPool;
13656
+ lendingPool = new ethers.Contract(routerAddress[pool.network][dapp], iLendingPool.abi, pool.signer);
13657
+ _context.next = 4;
13658
+ return Promise.all(assets.map(function (e) {
13659
+ return lendingPool.getReserveData(e);
13660
+ }));
13661
+
13662
+ case 4:
13663
+ reserveData = _context.sent;
13664
+ aTokens = reserveData.map(function (e) {
13665
+ return e.aTokenAddress;
13666
+ });
13667
+ debtTokens = reserveData.map(function (e) {
13668
+ return e.variableDebtTokenAddress;
13669
+ });
13670
+ return _context.abrupt("return", aTokens.concat(debtTokens));
13671
+
13672
+ case 8:
13673
+ case "end":
13674
+ return _context.stop();
13675
+ }
13676
+ }
13677
+ }, _callee);
13678
+ }));
13679
+ return _getAaveAssetsForUnderlying.apply(this, arguments);
13680
+ }
13681
+
13682
+ function getAaveV3ClaimTxData(_x, _x2, _x3) {
13683
+ return _getAaveV3ClaimTxData.apply(this, arguments);
13684
+ }
13685
+
13686
+ function _getAaveV3ClaimTxData() {
13687
+ _getAaveV3ClaimTxData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(pool, assets, rewardAsset) {
13688
+ var iAaveIncentives, aaveAsset, claimTxData;
13689
+ return runtime_1.wrap(function _callee$(_context) {
13690
+ while (1) {
13691
+ switch (_context.prev = _context.next) {
13692
+ case 0:
13693
+ iAaveIncentives = new ethers.utils.Interface(IAaveV3Incentives.abi);
13694
+ _context.next = 3;
13695
+ return getAaveAssetsForUnderlying(pool, Dapp.AAVEV3, assets);
13696
+
13697
+ case 3:
13698
+ aaveAsset = _context.sent;
13699
+ claimTxData = iAaveIncentives.encodeFunctionData("claimRewards", [aaveAsset, ethers.constants.MaxUint256, pool.address, rewardAsset]);
13700
+ return _context.abrupt("return", claimTxData);
13701
+
13702
+ case 6:
13703
+ case "end":
13704
+ return _context.stop();
13705
+ }
13706
+ }
13707
+ }, _callee);
13708
+ }));
13709
+ return _getAaveV3ClaimTxData.apply(this, arguments);
13710
+ }
13711
+
9327
13712
  var Pool = /*#__PURE__*/function () {
9328
13713
  function Pool(network, signer, poolLogic, mangerLogic, utils, factory) {
9329
13714
  this.network = network;
@@ -9713,7 +14098,7 @@ var Pool = /*#__PURE__*/function () {
9713
14098
  /*#__PURE__*/
9714
14099
  function () {
9715
14100
  var _trade = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(dapp, assetFrom, assetTo, amountIn, slippage, options) {
9716
- var swapTxData, chainId, apiUrl, response, iSynthetix, assets, daoAddress, iUniswapV2Router, minAmountOut, tx;
14101
+ var swapTxData, chainId, protocols, apiUrl, response, iSynthetix, assets, daoAddress, iUniswapV2Router, minAmountOut, tx;
9717
14102
  return runtime_1.wrap(function _callee9$(_context9) {
9718
14103
  while (1) {
9719
14104
  switch (_context9.prev = _context9.next) {
@@ -9726,73 +14111,73 @@ var Pool = /*#__PURE__*/function () {
9726
14111
  options = null;
9727
14112
  }
9728
14113
 
9729
- if (!(dapp === Dapp.ONEINCH)) {
9730
- _context9.next = 11;
9731
- break;
9732
- }
14114
+ _context9.t0 = dapp;
14115
+ _context9.next = _context9.t0 === Dapp.ONEINCH ? 5 : _context9.t0 === Dapp.BALANCER ? 15 : _context9.t0 === Dapp.SYNTHETIX ? 19 : _context9.t0 === Dapp.TOROS ? 26 : 30;
14116
+ break;
9733
14117
 
14118
+ case 5:
9734
14119
  chainId = networkChainIdMap[this.network];
9735
- apiUrl = "https://api.1inch.exchange/v4.0/" + chainId + "/swap?fromTokenAddress=" + assetFrom + "&toTokenAddress=" + assetTo + "&amount=" + amountIn.toString() + "&fromAddress=" + this.address + "&destReceiver=" + this.address + "&slippage=" + slippage.toString() + "&disableEstimate=true";
9736
- _context9.next = 7;
14120
+ _context9.next = 8;
14121
+ return getOneInchProtocols(chainId);
14122
+
14123
+ case 8:
14124
+ protocols = _context9.sent;
14125
+ apiUrl = "https://api.1inch.exchange/v4.0/" + chainId + "/swap?fromTokenAddress=" + assetFrom + "&toTokenAddress=" + assetTo + "&amount=" + amountIn.toString() + "&fromAddress=" + this.address + "&destReceiver=" + this.address + "&slippage=" + slippage.toString() + "&disableEstimate=true" + protocols;
14126
+ _context9.next = 12;
9737
14127
  return axios.get(apiUrl);
9738
14128
 
9739
- case 7:
14129
+ case 12:
9740
14130
  response = _context9.sent;
9741
14131
  swapTxData = response.data.tx.data;
9742
- _context9.next = 31;
9743
- break;
9744
-
9745
- case 11:
9746
- if (!(dapp === Dapp.BALANCER)) {
9747
- _context9.next = 17;
9748
- break;
9749
- }
14132
+ return _context9.abrupt("break", 35);
9750
14133
 
9751
- _context9.next = 14;
14134
+ case 15:
14135
+ _context9.next = 17;
9752
14136
  return this.utils.getBalancerSwapTx(this, assetFrom, assetTo, amountIn, slippage);
9753
14137
 
9754
- case 14:
9755
- swapTxData = _context9.sent;
9756
- _context9.next = 31;
9757
- break;
9758
-
9759
14138
  case 17:
9760
- if (!(dapp === Dapp.SYNTHETIX)) {
9761
- _context9.next = 26;
9762
- break;
9763
- }
14139
+ swapTxData = _context9.sent;
14140
+ return _context9.abrupt("break", 35);
9764
14141
 
14142
+ case 19:
9765
14143
  iSynthetix = new ethers.utils.Interface(ISynthetix.abi);
9766
14144
  assets = [assetFrom, assetTo].map(function (asset) {
9767
14145
  return ethers.utils.formatBytes32String(asset);
9768
14146
  });
9769
- _context9.next = 22;
14147
+ _context9.next = 23;
9770
14148
  return this.factory.owner();
9771
14149
 
9772
- case 22:
14150
+ case 23:
9773
14151
  daoAddress = _context9.sent;
9774
14152
  swapTxData = iSynthetix.encodeFunctionData(Transaction.SWAP_SYNTHS, [assets[0], amountIn, assets[1], daoAddress, SYNTHETIX_TRACKING_CODE]);
9775
- _context9.next = 31;
9776
- break;
14153
+ return _context9.abrupt("break", 35);
9777
14154
 
9778
14155
  case 26:
14156
+ _context9.next = 28;
14157
+ return getEasySwapperTxData(this, assetFrom, assetTo, ethers.BigNumber.from(amountIn), slippage);
14158
+
14159
+ case 28:
14160
+ swapTxData = _context9.sent;
14161
+ return _context9.abrupt("break", 35);
14162
+
14163
+ case 30:
9779
14164
  iUniswapV2Router = new ethers.utils.Interface(IUniswapV2Router.abi);
9780
- _context9.next = 29;
14165
+ _context9.next = 33;
9781
14166
  return this.utils.getMinAmountOut(dapp, assetFrom, assetTo, amountIn, slippage);
9782
14167
 
9783
- case 29:
14168
+ case 33:
9784
14169
  minAmountOut = _context9.sent;
9785
14170
  swapTxData = iUniswapV2Router.encodeFunctionData(Transaction.SWAP, [amountIn, minAmountOut, [assetFrom, assetTo], this.address, deadline]);
9786
14171
 
9787
- case 31:
9788
- _context9.next = 33;
14172
+ case 35:
14173
+ _context9.next = 37;
9789
14174
  return this.poolLogic.execTransaction(routerAddress[this.network][dapp], swapTxData, options);
9790
14175
 
9791
- case 33:
14176
+ case 37:
9792
14177
  tx = _context9.sent;
9793
14178
  return _context9.abrupt("return", tx);
9794
14179
 
9795
- case 35:
14180
+ case 39:
9796
14181
  case "end":
9797
14182
  return _context9.stop();
9798
14183
  }
@@ -10642,6 +15027,54 @@ var Pool = /*#__PURE__*/function () {
10642
15027
 
10643
15028
  return harvestAaveRewards;
10644
15029
  }()
15030
+ /**
15031
+ * Claim rewards from Aave platform
15032
+ * @param {string[]} assets Assets invested in Aave
15033
+ * @param {string} rewardAssets Reward token address
15034
+ * @param {any} options Transaction options
15035
+ * @returns {Promise<any>} Transaction
15036
+ */
15037
+ ;
15038
+
15039
+ _proto.harvestAaveV3Rewards =
15040
+ /*#__PURE__*/
15041
+ function () {
15042
+ var _harvestAaveV3Rewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee27(assets, rewardAsset, options) {
15043
+ var claimTxData, tx;
15044
+ return runtime_1.wrap(function _callee27$(_context27) {
15045
+ while (1) {
15046
+ switch (_context27.prev = _context27.next) {
15047
+ case 0:
15048
+ if (options === void 0) {
15049
+ options = null;
15050
+ }
15051
+
15052
+ _context27.next = 3;
15053
+ return getAaveV3ClaimTxData(this, assets, rewardAsset);
15054
+
15055
+ case 3:
15056
+ claimTxData = _context27.sent;
15057
+ _context27.next = 6;
15058
+ return this.poolLogic.execTransaction(stakingAddress[this.network][Dapp.AAVEV3], claimTxData, options);
15059
+
15060
+ case 6:
15061
+ tx = _context27.sent;
15062
+ return _context27.abrupt("return", tx);
15063
+
15064
+ case 8:
15065
+ case "end":
15066
+ return _context27.stop();
15067
+ }
15068
+ }
15069
+ }, _callee27, this);
15070
+ }));
15071
+
15072
+ function harvestAaveV3Rewards(_x92, _x93, _x94) {
15073
+ return _harvestAaveV3Rewards.apply(this, arguments);
15074
+ }
15075
+
15076
+ return harvestAaveV3Rewards;
15077
+ }()
10645
15078
  /**
10646
15079
  * Create UniswapV3 liquidity pool
10647
15080
  * @param {string} assetA First asset
@@ -10661,18 +15094,18 @@ var Pool = /*#__PURE__*/function () {
10661
15094
  _proto.addLiquidityUniswapV3 =
10662
15095
  /*#__PURE__*/
10663
15096
  function () {
10664
- var _addLiquidityUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee27(assetA, assetB, amountA, amountB, minPrice, maxPrice, minTick, maxTick, feeAmount, options) {
15097
+ var _addLiquidityUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee28(assetA, assetB, amountA, amountB, minPrice, maxPrice, minTick, maxTick, feeAmount, options) {
10665
15098
  var iNonfungiblePositionManager, mintTxParams, mintTxData, tx;
10666
- return runtime_1.wrap(function _callee27$(_context27) {
15099
+ return runtime_1.wrap(function _callee28$(_context28) {
10667
15100
  while (1) {
10668
- switch (_context27.prev = _context27.next) {
15101
+ switch (_context28.prev = _context28.next) {
10669
15102
  case 0:
10670
15103
  if (options === void 0) {
10671
15104
  options = null;
10672
15105
  }
10673
15106
 
10674
- if (!((!minPrice || !maxPrice) && (!minTick || !maxTick))) {
10675
- _context27.next = 3;
15107
+ if (!((minPrice === null || maxPrice === null) && (minTick === null || maxTick === null))) {
15108
+ _context28.next = 3;
10676
15109
  break;
10677
15110
  }
10678
15111
 
@@ -10680,28 +15113,28 @@ var Pool = /*#__PURE__*/function () {
10680
15113
 
10681
15114
  case 3:
10682
15115
  iNonfungiblePositionManager = new ethers.utils.Interface(INonfungiblePositionManager.abi);
10683
- _context27.next = 6;
15116
+ _context28.next = 6;
10684
15117
  return getUniswapV3MintParams(this, assetA, assetB, amountA, amountB, minPrice, maxPrice, minTick, maxTick, feeAmount);
10685
15118
 
10686
15119
  case 6:
10687
- mintTxParams = _context27.sent;
15120
+ mintTxParams = _context28.sent;
10688
15121
  mintTxData = iNonfungiblePositionManager.encodeFunctionData(Transaction.MINT, [mintTxParams]);
10689
- _context27.next = 10;
15122
+ _context28.next = 10;
10690
15123
  return this.poolLogic.execTransaction(nonfungiblePositionManagerAddress[this.network], mintTxData, options);
10691
15124
 
10692
15125
  case 10:
10693
- tx = _context27.sent;
10694
- return _context27.abrupt("return", tx);
15126
+ tx = _context28.sent;
15127
+ return _context28.abrupt("return", tx);
10695
15128
 
10696
15129
  case 12:
10697
15130
  case "end":
10698
- return _context27.stop();
15131
+ return _context28.stop();
10699
15132
  }
10700
15133
  }
10701
- }, _callee27, this);
15134
+ }, _callee28, this);
10702
15135
  }));
10703
15136
 
10704
- function addLiquidityUniswapV3(_x92, _x93, _x94, _x95, _x96, _x97, _x98, _x99, _x100, _x101) {
15137
+ function addLiquidityUniswapV3(_x95, _x96, _x97, _x98, _x99, _x100, _x101, _x102, _x103, _x104) {
10705
15138
  return _addLiquidityUniswapV.apply(this, arguments);
10706
15139
  }
10707
15140
 
@@ -10720,12 +15153,12 @@ var Pool = /*#__PURE__*/function () {
10720
15153
  _proto.decreaseLiquidity =
10721
15154
  /*#__PURE__*/
10722
15155
  function () {
10723
- var _decreaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee28(dapp, tokenId, amount, options) {
15156
+ var _decreaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee29(dapp, tokenId, amount, options) {
10724
15157
  var txData, dappAddress, abi, liquidity, decreaseLiquidityTxData, collectTxData, multicallParams, burnTxData, _abi, _liquidity, tx;
10725
15158
 
10726
- return runtime_1.wrap(function _callee28$(_context28) {
15159
+ return runtime_1.wrap(function _callee29$(_context29) {
10727
15160
  while (1) {
10728
- switch (_context28.prev = _context28.next) {
15161
+ switch (_context29.prev = _context29.next) {
10729
15162
  case 0:
10730
15163
  if (amount === void 0) {
10731
15164
  amount = 100;
@@ -10736,17 +15169,17 @@ var Pool = /*#__PURE__*/function () {
10736
15169
  }
10737
15170
 
10738
15171
  if (!(dapp === Dapp.UNISWAPV3)) {
10739
- _context28.next = 15;
15172
+ _context29.next = 15;
10740
15173
  break;
10741
15174
  }
10742
15175
 
10743
15176
  dappAddress = nonfungiblePositionManagerAddress[this.network];
10744
15177
  abi = new ethers.utils.Interface(INonfungiblePositionManager.abi);
10745
- _context28.next = 7;
15178
+ _context29.next = 7;
10746
15179
  return getUniswapV3Liquidity(tokenId, this);
10747
15180
 
10748
15181
  case 7:
10749
- liquidity = _context28.sent.mul(amount).div(100);
15182
+ liquidity = _context29.sent.mul(Math.round(amount * 1e4)).div(1e6);
10750
15183
  decreaseLiquidityTxData = abi.encodeFunctionData(Transaction.DECREASE_LIQUIDITY, [[tokenId, liquidity, 0, 0, deadline]]);
10751
15184
  collectTxData = abi.encodeFunctionData(Transaction.COLLECT, [[tokenId, this.address, MaxUint128, MaxUint128]]);
10752
15185
  multicallParams = [decreaseLiquidityTxData, collectTxData];
@@ -10757,46 +15190,46 @@ var Pool = /*#__PURE__*/function () {
10757
15190
  }
10758
15191
 
10759
15192
  txData = abi.encodeFunctionData(Transaction.MULTI_CALL, [multicallParams]);
10760
- _context28.next = 25;
15193
+ _context29.next = 25;
10761
15194
  break;
10762
15195
 
10763
15196
  case 15:
10764
15197
  if (!(dapp === Dapp.ARRAKIS)) {
10765
- _context28.next = 24;
15198
+ _context29.next = 24;
10766
15199
  break;
10767
15200
  }
10768
15201
 
10769
15202
  dappAddress = routerAddress[this.network][dapp];
10770
15203
  _abi = new ethers.utils.Interface(IArrakisV1RouterStaking.abi);
10771
- _context28.next = 20;
15204
+ _context29.next = 20;
10772
15205
  return this.utils.getBalance(tokenId, this.address);
10773
15206
 
10774
15207
  case 20:
10775
- _liquidity = _context28.sent.mul(amount).div(100);
15208
+ _liquidity = _context29.sent.mul(Math.round(amount * 1e4)).div(1e6);
10776
15209
  txData = _abi.encodeFunctionData(Transaction.REMOVE_LIQUIDITY_UNSTAKE, [tokenId, _liquidity, 0, 0, this.address]);
10777
- _context28.next = 25;
15210
+ _context29.next = 25;
10778
15211
  break;
10779
15212
 
10780
15213
  case 24:
10781
15214
  throw new Error("dapp not supported");
10782
15215
 
10783
15216
  case 25:
10784
- _context28.next = 27;
15217
+ _context29.next = 27;
10785
15218
  return this.poolLogic.execTransaction(dappAddress, txData, options);
10786
15219
 
10787
15220
  case 27:
10788
- tx = _context28.sent;
10789
- return _context28.abrupt("return", tx);
15221
+ tx = _context29.sent;
15222
+ return _context29.abrupt("return", tx);
10790
15223
 
10791
15224
  case 29:
10792
15225
  case "end":
10793
- return _context28.stop();
15226
+ return _context29.stop();
10794
15227
  }
10795
15228
  }
10796
- }, _callee28, this);
15229
+ }, _callee29, this);
10797
15230
  }));
10798
15231
 
10799
- function decreaseLiquidity(_x102, _x103, _x104, _x105) {
15232
+ function decreaseLiquidity(_x105, _x106, _x107, _x108) {
10800
15233
  return _decreaseLiquidity.apply(this, arguments);
10801
15234
  }
10802
15235
 
@@ -10816,60 +15249,60 @@ var Pool = /*#__PURE__*/function () {
10816
15249
  _proto.increaseLiquidity =
10817
15250
  /*#__PURE__*/
10818
15251
  function () {
10819
- var _increaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee29(dapp, tokenId, amountA, amountB, options) {
15252
+ var _increaseLiquidity = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee30(dapp, tokenId, amountA, amountB, options) {
10820
15253
  var txData, dappAddress, abi, _abi2, tx;
10821
15254
 
10822
- return runtime_1.wrap(function _callee29$(_context29) {
15255
+ return runtime_1.wrap(function _callee30$(_context30) {
10823
15256
  while (1) {
10824
- switch (_context29.prev = _context29.next) {
15257
+ switch (_context30.prev = _context30.next) {
10825
15258
  case 0:
10826
15259
  if (options === void 0) {
10827
15260
  options = null;
10828
15261
  }
10829
15262
 
10830
15263
  if (!(dapp === Dapp.UNISWAPV3)) {
10831
- _context29.next = 7;
15264
+ _context30.next = 7;
10832
15265
  break;
10833
15266
  }
10834
15267
 
10835
15268
  dappAddress = nonfungiblePositionManagerAddress[this.network];
10836
15269
  abi = new ethers.utils.Interface(INonfungiblePositionManager.abi);
10837
15270
  txData = abi.encodeFunctionData(Transaction.INCREASE_LIQUIDITY, [[tokenId, amountA, amountB, 0, 0, deadline]]);
10838
- _context29.next = 14;
15271
+ _context30.next = 14;
10839
15272
  break;
10840
15273
 
10841
15274
  case 7:
10842
15275
  if (!(dapp === Dapp.ARRAKIS)) {
10843
- _context29.next = 13;
15276
+ _context30.next = 13;
10844
15277
  break;
10845
15278
  }
10846
15279
 
10847
15280
  dappAddress = routerAddress[this.network][dapp];
10848
15281
  _abi2 = new ethers.utils.Interface(IArrakisV1RouterStaking.abi);
10849
15282
  txData = _abi2.encodeFunctionData(Transaction.ADD_LIQUIDITY_STAKE, [tokenId, amountA, amountB, 0, 0, this.address]);
10850
- _context29.next = 14;
15283
+ _context30.next = 14;
10851
15284
  break;
10852
15285
 
10853
15286
  case 13:
10854
15287
  throw new Error("dapp not supported");
10855
15288
 
10856
15289
  case 14:
10857
- _context29.next = 16;
15290
+ _context30.next = 16;
10858
15291
  return this.poolLogic.execTransaction(dappAddress, txData, options);
10859
15292
 
10860
15293
  case 16:
10861
- tx = _context29.sent;
10862
- return _context29.abrupt("return", tx);
15294
+ tx = _context30.sent;
15295
+ return _context30.abrupt("return", tx);
10863
15296
 
10864
15297
  case 18:
10865
15298
  case "end":
10866
- return _context29.stop();
15299
+ return _context30.stop();
10867
15300
  }
10868
15301
  }
10869
- }, _callee29, this);
15302
+ }, _callee30, this);
10870
15303
  }));
10871
15304
 
10872
- function increaseLiquidity(_x106, _x107, _x108, _x109, _x110) {
15305
+ function increaseLiquidity(_x109, _x110, _x111, _x112, _x113) {
10873
15306
  return _increaseLiquidity.apply(this, arguments);
10874
15307
  }
10875
15308
 
@@ -10887,59 +15320,59 @@ var Pool = /*#__PURE__*/function () {
10887
15320
  _proto.claimFees =
10888
15321
  /*#__PURE__*/
10889
15322
  function () {
10890
- var _claimFees = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee30(dapp, tokenId, options) {
15323
+ var _claimFees = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee31(dapp, tokenId, options) {
10891
15324
  var txData, contractAddress, iNonfungiblePositionManager, abi, tx;
10892
- return runtime_1.wrap(function _callee30$(_context30) {
15325
+ return runtime_1.wrap(function _callee31$(_context31) {
10893
15326
  while (1) {
10894
- switch (_context30.prev = _context30.next) {
15327
+ switch (_context31.prev = _context31.next) {
10895
15328
  case 0:
10896
15329
  if (options === void 0) {
10897
15330
  options = null;
10898
15331
  }
10899
15332
 
10900
15333
  if (!(dapp === Dapp.UNISWAPV3)) {
10901
- _context30.next = 7;
15334
+ _context31.next = 7;
10902
15335
  break;
10903
15336
  }
10904
15337
 
10905
15338
  contractAddress = nonfungiblePositionManagerAddress[this.network];
10906
15339
  iNonfungiblePositionManager = new ethers.utils.Interface(INonfungiblePositionManager.abi);
10907
15340
  txData = iNonfungiblePositionManager.encodeFunctionData(Transaction.COLLECT, [[tokenId, this.address, MaxUint128, MaxUint128]]);
10908
- _context30.next = 14;
15341
+ _context31.next = 14;
10909
15342
  break;
10910
15343
 
10911
15344
  case 7:
10912
15345
  if (!(dapp === Dapp.ARRAKIS || dapp === Dapp.BALANCER)) {
10913
- _context30.next = 13;
15346
+ _context31.next = 13;
10914
15347
  break;
10915
15348
  }
10916
15349
 
10917
15350
  contractAddress = tokenId;
10918
15351
  abi = new ethers.utils.Interface(ILiquidityGaugeV4.abi);
10919
15352
  txData = abi.encodeFunctionData("claim_rewards()", []);
10920
- _context30.next = 14;
15353
+ _context31.next = 14;
10921
15354
  break;
10922
15355
 
10923
15356
  case 13:
10924
15357
  throw new Error("dapp not supported");
10925
15358
 
10926
15359
  case 14:
10927
- _context30.next = 16;
15360
+ _context31.next = 16;
10928
15361
  return this.poolLogic.execTransaction(contractAddress, txData, options);
10929
15362
 
10930
15363
  case 16:
10931
- tx = _context30.sent;
10932
- return _context30.abrupt("return", tx);
15364
+ tx = _context31.sent;
15365
+ return _context31.abrupt("return", tx);
10933
15366
 
10934
15367
  case 18:
10935
15368
  case "end":
10936
- return _context30.stop();
15369
+ return _context31.stop();
10937
15370
  }
10938
15371
  }
10939
- }, _callee30, this);
15372
+ }, _callee31, this);
10940
15373
  }));
10941
15374
 
10942
- function claimFees(_x111, _x112, _x113) {
15375
+ function claimFees(_x114, _x115, _x116) {
10943
15376
  return _claimFees.apply(this, arguments);
10944
15377
  }
10945
15378
 
@@ -10961,11 +15394,11 @@ var Pool = /*#__PURE__*/function () {
10961
15394
  _proto.tradeUniswapV3 =
10962
15395
  /*#__PURE__*/
10963
15396
  function () {
10964
- var _tradeUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee31(assetFrom, assetTo, amountIn, feeAmount, slippage, options) {
15397
+ var _tradeUniswapV = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee32(assetFrom, assetTo, amountIn, feeAmount, slippage, options) {
10965
15398
  var swapxData, tx;
10966
- return runtime_1.wrap(function _callee31$(_context31) {
15399
+ return runtime_1.wrap(function _callee32$(_context32) {
10967
15400
  while (1) {
10968
- switch (_context31.prev = _context31.next) {
15401
+ switch (_context32.prev = _context32.next) {
10969
15402
  case 0:
10970
15403
  if (slippage === void 0) {
10971
15404
  slippage = 0.5;
@@ -10975,27 +15408,27 @@ var Pool = /*#__PURE__*/function () {
10975
15408
  options = null;
10976
15409
  }
10977
15410
 
10978
- _context31.next = 4;
15411
+ _context32.next = 4;
10979
15412
  return getUniswapV3SwapTxData(this, assetFrom, assetTo, amountIn, slippage, feeAmount);
10980
15413
 
10981
15414
  case 4:
10982
- swapxData = _context31.sent;
10983
- _context31.next = 7;
15415
+ swapxData = _context32.sent;
15416
+ _context32.next = 7;
10984
15417
  return this.poolLogic.execTransaction(routerAddress[this.network][Dapp.UNISWAPV3], swapxData, options);
10985
15418
 
10986
15419
  case 7:
10987
- tx = _context31.sent;
10988
- return _context31.abrupt("return", tx);
15420
+ tx = _context32.sent;
15421
+ return _context32.abrupt("return", tx);
10989
15422
 
10990
15423
  case 9:
10991
15424
  case "end":
10992
- return _context31.stop();
15425
+ return _context32.stop();
10993
15426
  }
10994
15427
  }
10995
- }, _callee31, this);
15428
+ }, _callee32, this);
10996
15429
  }));
10997
15430
 
10998
- function tradeUniswapV3(_x114, _x115, _x116, _x117, _x118, _x119) {
15431
+ function tradeUniswapV3(_x117, _x118, _x119, _x120, _x121, _x122) {
10999
15432
  return _tradeUniswapV.apply(this, arguments);
11000
15433
  }
11001
15434
 
@@ -11005,7 +15438,7 @@ var Pool = /*#__PURE__*/function () {
11005
15438
  return Pool;
11006
15439
  }();
11007
15440
 
11008
- var abi$g = [
15441
+ var abi$l = [
11009
15442
  {
11010
15443
  inputs: [
11011
15444
  {
@@ -11229,10 +15662,10 @@ var abi$g = [
11229
15662
  }
11230
15663
  ];
11231
15664
  var UniswapV2Factory = {
11232
- abi: abi$g
15665
+ abi: abi$l
11233
15666
  };
11234
15667
 
11235
- var abi$h = [
15668
+ var abi$m = [
11236
15669
  {
11237
15670
  anonymous: false,
11238
15671
  inputs: [
@@ -11976,7 +16409,7 @@ var evm = {
11976
16409
  }
11977
16410
  };
11978
16411
  var UniswapV2Pair = {
11979
- abi: abi$h,
16412
+ abi: abi$m,
11980
16413
  evm: evm,
11981
16414
  "interface": [
11982
16415
  {
@@ -12707,7 +17140,7 @@ var UniswapV2Pair = {
12707
17140
  ]
12708
17141
  };
12709
17142
 
12710
- var abi$i = [
17143
+ var abi$n = [
12711
17144
  {
12712
17145
  inputs: [
12713
17146
  {
@@ -13902,7 +18335,7 @@ var abi$i = [
13902
18335
  }
13903
18336
  ];
13904
18337
  var IBalancerV2Vault = {
13905
- abi: abi$i
18338
+ abi: abi$n
13906
18339
  };
13907
18340
 
13908
18341
  var Utils = /*#__PURE__*/function () {
@@ -14440,7 +18873,17 @@ var Dhedge = /*#__PURE__*/function () {
14440
18873
  }
14441
18874
 
14442
18875
  return loadPool;
14443
- }();
18876
+ }()
18877
+ /**
18878
+ * Check if pool address is valid
18879
+ * @param {string} address Pool address
18880
+ * @returns {boolean} Is valid pool address
18881
+ */
18882
+ ;
18883
+
18884
+ _proto.validatePool = function validatePool(address) {
18885
+ return this.factory.isPool(address);
18886
+ };
14444
18887
 
14445
18888
  return Dhedge;
14446
18889
  }();