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

feat: ETH transfers custom native token chains part 1 #2106

Open
wants to merge 136 commits into
base: master
Choose a base branch
from

Conversation

brtkx
Copy link
Contributor

@brtkx brtkx commented Nov 28, 2024

Changes:

  • adds new token query param token=eth, which will indicate that the selected token is ETH. This is because selectedToken === null for custom native token chains by default indicates that the selected token is the custom native token. This way we can differentiate between the two.
  • adds useIsSelectedTokenEther hook, this will return true even if selectedToken === null but token query param is token=eth.
  • makes ETH selectable in the token dropdown alongside a custom native token.
  • small adjustments if ETH is selected, like token symbol, logo, etc.

@@ -48,6 +52,14 @@ function StyledLoader() {
)
}

function NativeTokenNetworkText({ chainId }: { chainId: number }) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to its own component from this file because it's reused now

@@ -136,18 +161,24 @@ function TokenListInfo({ token }: { token: ERC20BridgeToken | null }) {

interface TokenRowProps {
style?: React.CSSProperties
onTokenSelected: (token: ERC20BridgeToken | null) => void
token: ERC20BridgeToken | null
onTokenSelected: (parentErc20Address: string | null) => void
Copy link
Contributor Author

@brtkx brtkx Feb 3, 2025

Choose a reason for hiding this comment

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

We pass the address to query params anyway, so there's no point passing the entire object. We also don't have to handle different types of token objects for erc20 or native currency, we only pass either address or key.

Base automatically changed from token-query-params to master February 4, 2025 11:22
@brtkx brtkx marked this pull request as ready for review February 5, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants