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