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

extend user native asset #1717

Merged
merged 6 commits into from
Oct 2, 2024
Merged

extend user native asset #1717

merged 6 commits into from
Oct 2, 2024

Conversation

estebanmino
Copy link
Member

@estebanmino estebanmino commented Sep 26, 2024

Fixes BX-1635
Figma link (if any):

using metadata external token query to get native assets for all chains as described in ticket

now we have two different hooks for this:

  • useNativeAsset: that will give you a ParsedAsset object, that contains the price of the asset for stuff like tx fees
  • useUserNativeAsset: that will give you a ParsedUserAsset object, that contains the wallet's balance

What changed (plus any additional context for devs)

Screen recordings / screenshots

What to test

Copy link

linear bot commented Sep 26, 2024

@estebanmino estebanmino marked this pull request as ready for review September 26, 2024 18:31
Copy link
Member

@derHowie derHowie left a comment

Choose a reason for hiding this comment

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

Code looks good

Comment on lines 120 to 132
// Prefetch function for Token Price
export async function prefetchExternalToken({
address,
chainId,
currency,
}: ExternalTokenArgs) {
await queryClient.prefetchQuery({
queryKey: externalTokenQueryKey({ address, chainId, currency }),
queryFn: externalTokenQueryFunction,
staleTime: EXTERNAL_TOKEN_STALE_TIME,
gcTime: EXTERNAL_TOKEN_CACHE_TIME,
});
}
Copy link
Member

Choose a reason for hiding this comment

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

do you think we'll end up using this prefetch?

Copy link
Member Author

Choose a reason for hiding this comment

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

it was a copy paste from app, i can remove

Copy link

@walmat walmat left a comment

Choose a reason for hiding this comment

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

lgtm

@DanielSinclair DanielSinclair merged commit b8964d1 into master Oct 2, 2024
13 of 14 checks passed
@DanielSinclair DanielSinclair deleted the @esteban/user-native-asset branch October 2, 2024 06:25
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.

4 participants