I'm trying to send USDC based on the answer in this thread - How to send USDC-SPL using @solana-labs/web3.js but he used the private key in his answer and I can't seem to get the signer for a real wallet. I keep getting errors like this:
Argument of type 'WalletAdapter' is not assignable to parameter of type 'Signer'. Property 'secretKey' is missing in type 'WalletAdapter' but required in type 'Signer'.
My code:
var connection = new web3.Connection(web3.clusterApiUrl("devnet"));
// Construct wallet keypairs
var fromWallet = wallet;
var toWallet =to;
// Construct my token class
var USDC_pubkey = new web3.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
var USDC_Token = new splToken.Token(
connection,
USDC_pubkey,
splToken.TOKEN_PROGRAM_ID,
fromWallet
);