@@ -67,11 +67,37 @@ TransactionReceipt repay(String amount, String assetAddress, String onBehalfOf)
67
67
68
68
return lendingPool .repay (assetAddress ,value ,BigInteger .ONE ,onBehalfOf ).send ();
69
69
}
70
+
71
+ TransactionReceipt swapBorrowRate (String amount , String assetAddress , String onBehalfOf ) throws Exception {
72
+ String poolAddress = lendingPoolAddress .getLendingPool ().send ();
73
+ BigInteger value = new BigInteger (amount );
74
+
75
+ ILendingPool lendingPool = ILendingPool .load (poolAddress ,connection .getWeb3j (),connection .getCredentials (),provider );
76
+ return lendingPool .swapBorrowRateMode (assetAddress ,BigInteger .ONE ).send ();
77
+ }
70
78
71
- TransactionReceipt swapBorrowRate (String assetAddress , String mode ) throws Exception {
72
- BigInteger value = new BigInteger (mode );
79
+ public TransactionReceipt setUsageAsCollateral (String asset , Boolean useAsCollateral ) throws Exception {
80
+ String poolAddress = lendingPoolAddress .getLendingPool ().send ();
81
+ BigInteger value = new BigInteger (asset );
82
+
83
+ ILendingPool lendingPool = ILendingPool .load (poolAddress ,connection .getWeb3j (),connection .getCredentials (),provider );
84
+ return lendingPool .setUserUseReserveAsCollateral (asset , useAsCollateral ).send ();
85
+ }
86
+
87
+ public TransactionReceipt liquidationCall (String collateralAsset , String debtAsset , String user , String debtToCover , Boolean receiveAToken ) throws Exception {
88
+ String poolAddress = lendingPoolAddress .getLendingPool ().send ();
89
+ BigInteger value = new BigInteger (debtToCover );
90
+
91
+ ILendingPool lendingPool = ILendingPool .load (poolAddress ,connection .getWeb3j (),connection .getCredentials (),provider );
92
+ return lendingPool .liquidationCall (collateralAsset ,debtAsset ,user ,value ,receiveAToken ).send ();
93
+ }
94
+
95
+ public RemoteFunctionCall <TransactionReceipt > flashLoans (String receiverAddress , List <String > assets , List <BigInteger > amounts , List <BigInteger > modes , String onBehalfOf , byte [] params , BigInteger referralCode ) throws Exception {
96
+ String poolAddress = lendingPoolAddress .getLendingPool ().send ();
97
+ BigInteger value = new BigInteger (String .valueOf (amounts ));
73
98
74
- return lendingPool .swapBorrowRateMode (assetAddress ,value ).send ();
99
+ ILendingPool lendingPool = ILendingPool .load (poolAddress , connection .getWeb3j (), connection .getCredentials (), provider );
100
+ return lendingPool .flashLoan (receiverAddress , assets ,amounts , modes ,onBehalfOf ,params , referralCode );
75
101
}
76
102
77
103
}
0 commit comments