|
1 | 1 | package com.arnAAVE.java_sdk;
|
2 | 2 |
|
| 3 | +import com.arnAAVE.java_sdk.lendingPool.ILendingPool; |
| 4 | +import com.arnAAVE.java_sdk.lendingPool.LendingPoolAccess; |
3 | 5 | import org.springframework.boot.SpringApplication;
|
4 | 6 | import org.springframework.boot.autoconfigure.SpringBootApplication;
|
| 7 | +import org.web3j.crypto.Credentials; |
| 8 | +import org.web3j.protocol.Web3j; |
| 9 | +import org.web3j.protocol.core.methods.response.TransactionReceipt; |
| 10 | +import org.web3j.protocol.exceptions.TransactionException; |
| 11 | +import org.web3j.protocol.http.HttpService; |
| 12 | +import org.web3j.tx.Transfer; |
| 13 | +import org.web3j.tx.gas.ContractGasProvider; |
| 14 | +import org.web3j.utils.Convert; |
| 15 | + |
| 16 | +import java.io.IOException; |
| 17 | +import java.math.BigDecimal; |
| 18 | +import java.math.BigInteger; |
| 19 | +import java.util.List; |
5 | 20 |
|
6 | 21 | @SpringBootApplication
|
7 | 22 | public class JavaSdkApplication {
|
8 | 23 |
|
9 |
| - public static void main(String[] args) { |
| 24 | + public static void main(String[] args) throws Exception { |
| 25 | + Web3j web3j = Web3j.build(new HttpService( |
| 26 | + "https://kovan.infura.io/v3/b8c7cedb8701445bb9210f4731e42c0a")); |
| 27 | + |
| 28 | + Credentials credentials = Credentials.create("1238370fb9507a697d2744d9c511061a0c3cc284eba1af1fa7b24854a9084219"); |
| 29 | + ILendingPool lendingPool = ILendingPool.load("0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9", web3j, credentials, new BigInteger("1"), new BigInteger("2")); |
| 30 | + TransactionReceipt transactionReceipt = Transfer.sendFunds( |
| 31 | + web3j, credentials, "0x16B72adaB628D8762A25f707aCbfE9c170d9001d", |
| 32 | + BigDecimal.valueOf(0.0001), Convert.Unit.ETHER).send(); |
| 33 | + System.out.println(transactionReceipt); |
| 34 | + |
| 35 | + assert false; |
| 36 | + List<ILendingPool.BorrowEventResponse> responses = lendingPool.getBorrowEvents(transactionReceipt); |
| 37 | + System.out.println("Responses = " + responses); |
| 38 | + |
| 39 | + LendingPoolAccess access = new LendingPoolAccess(); |
| 40 | + TransactionReceipt receipt = access.deposit(); |
| 41 | + |
| 42 | + System.out.println("Receipt = " + receipt); |
| 43 | + |
10 | 44 | SpringApplication.run(JavaSdkApplication.class, args);
|
| 45 | + |
| 46 | + |
11 | 47 | }
|
12 | 48 |
|
13 | 49 | }
|
0 commit comments