The interaction code for the payment contract has been fully open-sourced on GitHub. You can download the source code and compile it locally. (Please ensure that you have JDK 1.8 or above installed for the code compilation process).
Import
You can directly import the SDK JAR package as a dependency through Maven.
<dependency>
<groupId>io.github.BlockATMOnLine.sdk</groupId>
<artifactId>blockatm-sdk-core</artifactId>
<version>1.0.3</version>
</dependency>
Due to some version compatibility issues with the dependency packages, in addition to the SDK JAR mentioned above, you also need to include two additional dependency packages.
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.1</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>1.3.70</version>
</dependency>
Coding program
Now you can start interacting with data on the blockchain through the encapsulated interfaces provided by the SDK. Here is an example of a method to query an account balance.
// Create an instance of Erc20Helper with the RPC URL
Erc20Helper erc20Helper = new Erc20Helper("RPC_URL");
// Retrieve the account balance using the getBalance() method
BigInteger balance = erc20Helper.getBalance("the address of the account", "the address of the ERC20 contract");
// Print the account balance
System.out.println(balance.toString());
You can get more information through the sdk interface documentation