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

268
Visualizações
Nami wallet and CIP-0008: signData got changed?

I have a web application which is using window.cardano.nami injection since months. Following CIP-0008, I'm trying to abstract all the source code to support ccvault and other Cardano wallets; everything works fine, but it seems the signData method has been changed.

I was using window.cardano.signData and the result was a plaintext signature like this: window.cardano.signData signature

const signedData = await window.cardano.signData(usedAddresses, hexMessage);

I switched to api.signData (where api is the new endpoint returned by window.cardano.nami.enable() and now the signature is an object like this: api.signData signature

const signedData = await wallet.signData(usedAddresses, hexMessage);

So, the type is different, but that's not enough: the signature itself (if I compare the first signature with the .signature attribute of the second signature object) is different!

Even more weird: ccvault works like a charm!

What am I missing?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The problem is there is a legacy version of nami and a new one, best is to check for both and return the correct one. Then just keep using it like normal.

   let connectNami = async () => {
    // @ts-ignore
    if (typeof window.cardano.nami !== "undefined") {
      // @ts-ignore
      return await window.cardano.nami.enable();
    } else {
      console.debug(`Using legacy nami wallet integration`);

      // @ts-ignore
      await window.cardano.enable();

      // @ts-ignore
      return window.cardano;
    }
  };
const cardano= await connectNami();
const token = await cardano.signData(address, messageToSign);
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