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

improvement: refresh assets after swap #672

Merged
merged 15 commits into from
Jun 26, 2023

Conversation

estebanmino
Copy link
Contributor

@estebanmino estebanmino commented Jun 16, 2023

Fixes BX-836
Figma link (if any):

What changed (plus any additional context for devs)

the problem that the ticket is describing is that we don't trigger a new asset discovery request when a swap is made so i applied the same logic we have in the app

  • user swaps
  • we save the tokens that were swap
  • once swap is confirmed, we check the new balances for those assets
  • we update the assets list with these two new updated balances for 30 secs
  • then we start getting balances from backend as always

I also added

Screen recordings / screenshots

video with audio of me explaining some logs that i left to show that's working
https://www.loom.com/share/9caf4b965d71444a86603d54e9f693ef

What to test

Final checklist

  • I have tested my changes in a LavaMoat bundle (yarn build).
  • I have tested my changes in Chrome & Brave.
  • If your changes are visual, did you check both the light and dark themes?

@linear
Copy link

linear bot commented Jun 16, 2023

BX-836 Made a swap and the DAI didnt show up in my wallet

i swapped arbitrum ETH for DAI and the DAI shows up in my activity feed but dont see the DAI in my wallet https://arbiscan.io/tx/0x2920f1779b30d377baa634ddf7b37b074578bf4d9328b2761ff2209e99bad4c6

@github-actions
Copy link

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-a3f16875ca0f41e6145fa7e867da00f9ce29068f.zip

@estebanmino estebanmino force-pushed the @esteban/refresh-assets-after-swap branch from 83fafc2 to abd5380 Compare June 20, 2023 18:44
@github-actions
Copy link

Here's the packed extension for this build:
rainbowbx-2d9968d74aede552a9e66bdbf5b76612483886a0.zip

@github-actions
Copy link

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-cdb8b457a831aa879872e4e7ae83d7e6a97ec7ac.zip

@estebanmino estebanmino force-pushed the @esteban/refresh-assets-after-swap branch from 19be59b to 3768df5 Compare June 21, 2023 18:35
@github-actions
Copy link

Here's the packed extension for this build:
rainbowbx-2ed95d90c166d37fc56af4726b700c9b43b27869.zip

@estebanmino estebanmino force-pushed the @esteban/refresh-assets-after-swap branch from 3768df5 to e780bba Compare June 22, 2023 20:16
@estebanmino estebanmino marked this pull request as ready for review June 22, 2023 20:17
@github-actions
Copy link

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-3fbc42f689d85ecf1c90cbd8709fd32b9003cf3e.zip

@estebanmino estebanmino force-pushed the @esteban/refresh-assets-after-swap branch from e780bba to 4319a30 Compare June 23, 2023 14:51
address: currentAddress,
currency: currentCurrency,
connectedToHardhat,
staleTime: 0,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@greg-schrammel would love your input here

i'm trying to make tokens data stale for USER_ASSETS_STALE_INTERVAL secs to then continue fetching the data from backend as usual, that's why i set up a timeout here setting stale time as 0 again, does it make sense?

@github-actions
Copy link

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-c414cc73a9c4876b8104d92f9d0f6dec660b9730.zip

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.

👏 👏 working for me, nice

Comment on lines 575 to 588
const isPendingTransaction = (status: TransactionStatus) => {
return (
status === TransactionStatus.approving ||
status === TransactionStatus.bridging ||
status === TransactionStatus.cancelling ||
status === TransactionStatus.depositing ||
status === TransactionStatus.purchasing ||
status === TransactionStatus.receiving ||
status === TransactionStatus.sending ||
status === TransactionStatus.speeding_up ||
status === TransactionStatus.swapping ||
status === TransactionStatus.withdrawing
);
};
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@brunobar79 brunobar79 left a comment

Choose a reason for hiding this comment

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

🔥🔥🔥

@github-actions
Copy link

Here's the packed extension for this build:
node_modules.tar.gz

@estebanmino estebanmino force-pushed the @esteban/refresh-assets-after-swap branch from a4fe96f to 4749262 Compare June 26, 2023 19:56
@github-actions
Copy link

Here's the packed extension for this build:
node_modules.tar.gz

@github-actions
Copy link

Here's the packed extension for this build:
node_modules.tar.gz

@github-actions
Copy link

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-9977535bc6f852be22dc4a94db631df2cdf228dc.zip

@github-actions
Copy link

Here's the packed extension for this build:
rainbowbx-9977535bc6f852be22dc4a94db631df2cdf228dc.zip

@estebanmino estebanmino merged commit dd91996 into master Jun 26, 2023
@estebanmino estebanmino deleted the @esteban/refresh-assets-after-swap branch June 26, 2023 21:44
@github-actions
Copy link

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-dd9199680e735b881bba92adf1a6f20ad5acdd0e.zip

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.

3 participants