Skip to content

Use getTokenDetails in EditTokenScene #5586

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

Merged
merged 2 commits into from
May 27, 2025
Merged

Conversation

peachbits
Copy link
Contributor

@peachbits peachbits commented May 19, 2025

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

EdgeApp/edge-core-js#658
EdgeApp/edge-currency-accountbased#936

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

}

if (item.key === 'contractAddress') {
autoCompleteToken(value).catch(console.error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so in the other PR's, we talked about hiding errors in at the plugin level. We might even do that here too (.catch(() => [])), so we don't bother logging the errors to the console. It could be quite spammy if the internet is down.

return
}

const [token] = await wallet.currencyConfig.getTokenDetails({ contractAddress: searchString })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need some way to rate-limit this call, so we don't spam the network as the user types. The simplest way is a busy flag, so if one call is pending, we don't trigger any more until after that one finishes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a pretty basic rate limiter. There are obvious race conditions but since this is a field the user would most likely paste a value in I'm not concerned about it.

@peachbits peachbits force-pushed the matthew/get-token-details branch from 31a42de to c4d5fba Compare May 27, 2025 00:45
@peachbits peachbits marked this pull request as ready for review May 27, 2025 02:20
peachbits added 2 commits May 26, 2025 19:21
Specifically, if a field called "contractAddress' exists put it at the top
@peachbits peachbits force-pushed the matthew/get-token-details branch from c4d5fba to a739dd6 Compare May 27, 2025 02:21
@peachbits peachbits enabled auto-merge May 27, 2025 02:21
@peachbits peachbits merged commit 9bea31b into develop May 27, 2025
2 checks passed
@peachbits peachbits deleted the matthew/get-token-details branch May 27, 2025 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants