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

Merged
merged 18 commits into from
Aug 8, 2024
Merged

added filter transactions by chain #1834

merged 18 commits into from
Aug 8, 2024

Conversation

glitch-txs
Copy link
Contributor

@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 Aug 8, 2024 10:37am
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Aug 8, 2024 10:37am
web3modal-react-wagmi-ex ✅ Ready (Inspect) Visit Preview Aug 8, 2024 10:37am
web3modal-vue-wagmi-ex ✅ Ready (Inspect) Visit Preview Aug 8, 2024 10:37am

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
Collaborator

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
Contributor 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
Collaborator

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 reown-com/blockchain-api#540 to track it and ping you when it's ready.

<wui-flex
flexDirection="column"
class="group-container"
last-group="${isLastGroup ? 'true' : 'false'}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

why use strings?
if neded, we can do String(isLastGroup)

@enesozturk enesozturk merged commit 059bc79 into main Aug 8, 2024
11 checks passed
@enesozturk enesozturk deleted the feat/filter-tx-chain branch August 8, 2024 10:47
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.

5 participants