Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!