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

added filter transactions by chain #1834

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

glitch-txs
Copy link
Member

@glitch-txs glitch-txs commented Jan 24, 2024

Breaking Changes

  • Activity Tab is filtered by chain

Changes

  • feat: Added filter transactions by chain

Copy link

vercel bot commented Jan 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
web3modal-gallery ✅ Ready (Inspect) Visit Preview Feb 28, 2024 1:30am
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Feb 28, 2024 1:30am
web3modal-react-wagmi-ex ✅ Ready (Inspect) Visit Preview Feb 28, 2024 1:30am
web3modal-vue-wagmi-ex ✅ Ready (Inspect) Visit Preview Feb 28, 2024 1:30am

Copy link
Contributor

@xzilja xzilja left a comment

Choose a reason for hiding this comment

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

Looks like build is failing, so only leaving comments for now. As we are filtering data client side, will need to see how this affects pagination logic (we likely display less results than what we fetched).

Any chance this chain filtering can be done on blockchain api level vs on client?

packages/core/src/controllers/TransactionsController.ts Outdated Show resolved Hide resolved
packages/scaffold/src/views/w3m-transactions-view/index.ts Outdated Show resolved Hide resolved
Comment on lines +138 to +145
filterByConnectedChain(transactions: Transaction[]) {
const chainId = NetworkController.state.caipNetwork?.id
const filteredTransactions = transactions.filter(
transaction => transaction.metadata.chain === chainId
)

return filteredTransactions
},
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we were requesting the filtered txs directly from blockchain api 🤔

wouldn't this mess up with pagination?

Copy link
Member Author

Choose a reason for hiding this comment

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

wouldn't this mess up with pagination?

Mmm I'm not sure and I'm not able to test this 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

@geekbrother any way we can do the filterin directly on blockchain API side? I think there's an edge case to this where if we filter txs and don't have enough to fill the ui, we will never request more txs even if you have them

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we can filter it on the blockchain-api side and even request the filtered data from the provider.
I created an issue WalletConnect/blockchain-api#540 to track it and ping you when it's ready.

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.

None yet

4 participants