shine-solana/solana-shine-client-lib/src/main/java/com/shine/solana/test/Main.java

48 lines
1.7 KiB
Java

package com.shine.solana.test;
import me.shineup.solana.SolanaWrapper;
import me.shineup.solana.config.Const;
import me.shineup.solana.internal.callSolanaFunc.InitializeUserCounter.InitializeUserCounter;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class Main {
private static final ExecutorService executorService = Executors.newCachedThreadPool();
public static void main(String[] args) {
// SolanaWrapper.setRPC_URL("https://api.devnet.solana.com");
// InitializeUserCounter
long oneSolLamports = 5_000_000_000L; // 1 SOL в лампортах
try {
SolanaWrapper.requestAirdrop(
"FUc28vNixp7F3nnkpGVt6nuJbgvJ4429v4B5wS52Df6P",
oneSolLamports);
System.out.println(SolanaWrapper.getBalance("FUc28vNixp7F3nnkpGVt6nuJbgvJ4429v4B5wS52Df6P"));//H6q58ytZk5sd3KQisC57R6urKUjn5PaWKLCv7sNZtj4i"));
System.out.println("Баланс Shine" + SolanaWrapper.getBalance( "jZnbqzrbKaksVomiqAxsKGiz5ct8rHPgcNDiiKyTZDD"));
} catch (Exception e) {
System.out.println(e.getMessage());
}
// 5RpEoxRKSr2norQP3vEnq9XokQGh9EbGN8q8xUUVAdm1M5mTD1vMuyJPYJfViMWFf6c8qT5mj2bt64gLE2zm6VG3 - тестовые в фантом валет
// FUc28vNixp7F3nnkpGVt6nuJbgvJ4429v4B5wS52Df6P
//
// executorService.submit(() -> {
// try {
// System.out.println(SolanaWrapper.getUserById(1).login);
// } catch (Exception e) {
// System.out.println(e.getMessage());
// }
// });
}
}