Open solpower opened 4 weeks ago
Is there any problem with the following code? Use Umi Sdk to pass the following parameters, there is no problem
public static void mintV2() throws Exception { PublicKey programId = new PublicKey("CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR"); //
List<AccountMeta> accounts = getAccount();
byte[] datas = getTransData(); // System.out.println(b & 0x0FF);
Transaction trans = new Transaction();
trans.addInstruction(computeUnitPrice());
trans.addInstruction(computeUnitLimit());
trans.addInstruction(new TransactionInstruction(programId, accounts, datas));
Account signer = new Account(Base58.decode(secret_key));
List<Account> signers = Arrays.asList(signer, nftMint);
String signature = client.getApi().sendTransaction(trans, signers, null);
System.out.println(signature);
}
public static List
public static byte[] getTransData() throws Exception { ByteBuffer buffer = ByteBuffer.allocate(8); // 8 buffer.order(ByteOrder.LITTLE_ENDIAN); buffer.put((byte)120); buffer.put((byte)121); buffer.put((byte)23); buffer.put((byte)146); buffer.put((byte)173); buffer.put((byte)110); buffer.put((byte)199); buffer.put((byte)205); return buffer.array(); }
public static PublicKey nftMint() throws RpcException {
Account newAccount = new Account();
nftMint = newAccount;
log.info("new mint account: " + newAccount.getPublicKey().toBase58());
return newAccount.getPublicKey();
}
mint is not success, sendTransaction and response the signature , But the blockchain browser does not have this transaction Where should I troubleshoot the problem? Can give some help?
{"jsonrpc":"2.0","result":"5NkPinTA2mYDnXNAdSXpRZypkzHWHDAfpKP154QruzxDAuPvWRkXz1CioXwNmatfmSuA2ViBeQpADNdfyPLv96LQ","id":"f67457cd-f4fb-4b70-bc7d-f5097d0e3222"}