graph-node icon indicating copy to clipboard operation
graph-node copied to clipboard

[Feature] Make `ethereum.getBalance` ENS aware

Open alex-pakalniskis opened this issue 10 months ago • 1 comments

Description

Developers using ethereum.getBalance() might want to reference ENS (or other) in addition to addresses

let balance = ethereum.getBalance(
    Address.fromString("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045")
);

or

let balance = ethereum.getBalance(
    Address.fromString("vitalik.eth")
);

Are you aware of any blockers that must be resolved before implementing this feature? If so, which? Link to any relevant GitHub issues.

No response

Some information to help us out

  • [ ] Tick this box if you plan on implementing this feature yourself.
  • [X] I have searched the issue tracker to make sure this issue is not a duplicate.

alex-pakalniskis avatar Mar 29 '24 16:03 alex-pakalniskis

I would like to work on this change. Just for clarity, should this change the Address.fromString() method, or only in the ethereum.getBalance() function? In my opinion, I think we should go with the Address.fromString() method. Other functions like ethereum.call() or ethereum.hasCode() might also want to use ens resolvers. Also, a direct type conversion from string to H160 of "vitalik.eth" will lead to problems.

nishim3 avatar May 11 '24 20:05 nishim3