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

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

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 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