Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

410
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda