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

185
Visualizações
Using ethers.utils.FormatTypes.full returns object not string

I want to create a form from the Human-Readable ABI using the json file truffle creates. so the idea is to get the string Human-Readable ABI and then use regex to cut out and use the different parts to create my form. But using ethers.utils.FormatTypes.full does not return a string like the documentation suggest.

Here is my code:

 const iface = await new ethers.utils.Interface(Bank.abi);
 iface.format(ethers.utils.FormatTypes.full);

expected output:

[
 'function deposit() public payable',
 'function withdraw(uint256 _amount)',
 'function checkAssets() public view returns(uint256)'
];

actual output: enter image description here According to the documentation: Converting Between Formats

ethers.utils.FormatTypes.full ⇒ string. This is a full human-readable string, including all parameter names, any optional modifiers (e.g. indexed, public, etc) and white-space to aid in human readability.

But instead, it returns an object. Can anyone please assist?

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

0

Looking at the code, format will definitely return a string in all cases.

From your code excerpt, it's not clear what you're logging in the console.

It should be something like:

 const iface = await new ethers.utils.Interface(Bank.abi);
 console.log('Formatted ABI', iface.format(ethers.utils.FormatTypes.full));

From what you posted in the screenshot, it seems that you're logging the iface object itself.

I'd be happy for edit this answer if you provide the full code that you're using.

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