ot error -32603 (Internal Error | Something went wrong within Phantom.)
My Code:
const createAndMintIx = createAndMint(umi, {
mint,
authority: umi.identity,
name: metadata.name,
symbol: metadata.symbol,
uri: metadata.uri,
sellerFeeBasisPoints: percentAmount(0),
decimals: Number(formData.decimals),
amount: Number(formData.supply) * 10 ** Number(formData.decimals),
tokenOwner: umi.identity.publicKey,
isMutable: !immutable,
tokenStandard: TokenStandard.Fungible,
});
const instructions = [
...createAndMintIx.getInstructions().map(toWeb3JsInstruction)
];
const messageV0 = new TransactionMessage({
payerKey: toWeb3JsPublicKey(umi.identity.publicKey),
recentBlockhash: (await connection.getLatestBlockhash()).blockhash,
instructions,
}).compileToV0Message();
const transactionV0 = new VersionedTransaction(messageV0);
const res = await provider.signAndSendTransaction(transactionV0);
if (res) {
return {
success: true,
mint: mint.publicKey,
message: "Token Created",
};
} else {
return {
success: false,
message: "Transaction failed",
};
}