Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIP-583 Always populate EVM address on accounts REST API #5507

Closed
steven-sheehy opened this issue Feb 27, 2023 · 1 comment · Fixed by #5556
Closed

HIP-583 Always populate EVM address on accounts REST API #5507

steven-sheehy opened this issue Feb 27, 2023 · 1 comment · Fixed by #5556
Assignees
Labels
enhancement Type: New feature good first issue Good for newcomers rest Area: REST API
Milestone

Comments

@steven-sheehy
Copy link
Member

steven-sheehy commented Feb 27, 2023

Problem

As an EVM user, I'd like to know the account's EVM address and search by it regardless of which type mentioned in HIP-583 it is.

Solution

  • In the response of /api/v1/accounts and /api/v1/accounts/{id}, if the alias field is a 40 character (20 bytes) EVM address and evm_address field is null, populate evm_address with the alias
  • In the response of /api/v1/accounts and /api/v1/accounts/{id}, populate the evm_address field with the account num alias (i.e. long zero entity id) form if it's null and not the scenario from above
  • In all /api/v1/accounts/{id}/* APIs, if the ID in the request is an EVM address with all zero prefix to indicate it's an account num alias then convert to an entity ID and lookup using that

Alternatives

No response

@steven-sheehy steven-sheehy added enhancement Type: New feature rest Area: REST API labels Feb 27, 2023
@steven-sheehy steven-sheehy added this to the 0.77.0 milestone Feb 27, 2023
@steven-sheehy steven-sheehy added the good first issue Good for newcomers label Feb 27, 2023
@jascks
Copy link
Member

jascks commented Mar 1, 2023

@steven-sheehy, I'm less familiar with Node/Express etc., but is hedera-mirror-rest/account.js where I want to add this new logic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type: New feature good first issue Good for newcomers rest Area: REST API
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants