Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

409
Views
Can't get wallet signer @solana-labs/web3.js while trying to send USDC

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
    );
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

By design, wallets do not allow dapps to directly access the private key of a wallet. Otherwise, a malicious dapp could easily collect all of its users private keys and steal their funds.

Instead, wallets provide an interface for signing transactions. From your code snippet, it's not clear which wallet you're using, but you may want to use the solana-labs/wallet-adapter package to handle these connections. You can follow the steps at https://github.com/solana-labs/wallet-adapter/ to setup your dapp with any wallet!

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!