I am facing an issue while minting the SPLToken2022 using a React app. the problem arises when minting the transaction. The process works fine when passing the keypairs directly, but encounters an issue when using the Solana wallet adapter as the signer. While using the keypair, I called this function like
const mintSig = await mintTo(connection, userWallet, mintAddress.publicKey, sourceAccount, userWallet, mintAmount, [], undefined, TOKEN_2022_PROGRAM_ID);
When I've to mint a token using react, which function should I pass? If someone shares the rust program also with test cases, it'll be the helpful.
Thanks