Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

411
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda