-
Hi, I'm calling a function which returns a Promise / BigNumber using the ethers cli & I am trying to get a number out of it (like with
Now of course since I am on the command line I would rather not create a whole block with Many thanks for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I know this response doesn't exactly answer your question related to ethers CLI, but there is a playground.ethers.org which is like console/REPLish experience of ethers, which you can use for quick trying out stuff. |
Beta Was this translation helpful? Give feedback.
-
You need to await on a Promise, there isn’t much way around that. You could use a show script and use the CLI and use In your example above, you might be able to change the return type in the ABI to |
Beta Was this translation helpful? Give feedback.
You need to await on a Promise, there isn’t much way around that. You could use a show script and use the CLI and use
run
instead ofeval
. I could add support for “here documents” if that is what you are asking for?In your example above, you might be able to change the return type in the ABI to
uint48
instead ofuint256
(since output is not included in the selector), which will coerce it into a number, but will throw if it is outside the safe range. But that’s more specific to this example rather than something more general.