You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good morning ! First of all thank you very much for this project! But I have a small question, I wanted to test a transaction but it sends me an error, I don't know where it can come from, can you help me? Thank you :)
package org.p2p.solanaj;
import java.nio.charset.StandardCharsets;
import org.p2p.solanaj.core.Account;
import org.p2p.solanaj.core.PublicKey;
import org.p2p.solanaj.core.Transaction;
import org.p2p.solanaj.programs.SystemProgram;
import org.p2p.solanaj.rpc.Cluster;
import org.p2p.solanaj.rpc.RpcClient;
public class app {
public static void main(String[] args) throws Exception {
RpcClient client = new RpcClient(Cluster.TESTNET);
PublicKey fromPublicKey = new PublicKey("7qZdRkPfAXr8dya3Ui5zaMNVR1u5yScTYC2nrU4zoqhq");
PublicKey toPublickKey = new PublicKey("CagvN2fgcgWBCSYZ7UgdeY7Rx7vMRj3tacBiCEuU8wPc");
int lamports = 1000;
String sKey = "*****************************************************************";
byte[] secret = sKey.getBytes(StandardCharsets.UTF_8);
Account signer = new Account(secret);
Transaction transaction = new Transaction()
.addInstruction(SystemProgram.transfer(fromPublicKey, toPublickKey, lamports));
String signature = client.getApi().sendTransaction(transaction, signer);
System.out.println(signature);
}
}
The text was updated successfully, but these errors were encountered:
Good morning ! First of all thank you very much for this project! But I have a small question, I wanted to test a transaction but it sends me an error, I don't know where it can come from, can you help me? Thank you :)
The text was updated successfully, but these errors were encountered: