walnuthq / op-scan

Lightweight transaction explorer for the OP Stack.
7 stars 16 forks source link

Latest L1->L2 transactions page #21

Open saimeunt opened 1 week ago

saimeunt commented 1 week ago

Latest L1->L2 transactions page

⚠️ Reading contributors guidelines to get assigned is MANDATORY!

Read contributors guidelines

User stories

Validation

It should look like the Etherscan latest L1->L2 txs list: https://optimistic.etherscan.io/txsEnqueued

Image

Don't forget to add external links to L1 block number, L1 tx hash, L1 tx origin and an internal link to L2 tx hash. You can take inspiration from here: https://github.com/walnuthq/op-scan/blob/main/src/components/pages/home/latest-l1-l2-transactions.tsx

Do NOT include the Queue index column. Do NOT add a "Download Page Data" button. Do NOT add pagination, it will be done in another separate issue. Do NOT add a "Show rows" dropdown, this is out of scope for this issue.

Implementation

Use a simple table from shadcn/ui, always display the last 50 txs from placeholder data. Update the fetchLatestL1L2Transactions (https://github.com/walnuthq/op-scan/blob/main/src/lib/utils.ts#L86) function to return all the fields necessary and 50 records instead of 6.

Resources

manlikeHB commented 1 week ago

I would like to take on this issue.

addegbenga commented 1 week ago

Hi, I’m Adeyemi with over 4 years of experience with React and Nextjs. To work on this, I will create a txs-enqueued page inside component pages. This page will render the result from the fetchLatestL1L2Transactions utility function and display the latest L1->L2 transactions in a shadcn table showing the following details: L1 block number, L2 tx hash, timestamp, L1 tx hash, L1 tx origin, and gas limit. When users click on external links like L1 block number, L1 tx hash, and L1 tx origin, they will be redirected to the block explorer in a new tab. Internal links will go to the internal tx page. I'll ensure the design matches Etherscan design. Looking to complete this in 2 days.

coxmars commented 1 week ago

Hello @saimeunt,

I'm a Software Developer with a strong background in front-end and back-end development and I'm excited to contribute to this project.

Component:

I will enhance the existing latest-l1-l2-transactions.tsx component to display the latest L1 -> L2 transactions by:

Data Fetching:

I will update the fetchLatestL1L2Transactions function to return all necessary fields and 50 records instead of 6. I will ensure external links to L1 block number, L1 tx hash, L1 tx origin, and an internal link to L2 tx hash are included.

Component Structure:

Parent Component: Fetch the transaction data and iterate over the transactions and pass details to the child component.

Child Component (latest-l1-l2-transaction.tsx): Render individual transaction details with appropriate external links for L1 block number, L1 tx hash, L1 tx origin, and internal link for L2 tx hash.

Table Implementation:

I will use the shadcn/ui Table component to display the transactions, following the given example from Etherscan. The table will display the last 50 transactions, with the following details:

I will exclude the "Queue index" column as specified.

Validation:

I will validate the implementation to ensure it looks like the Etherscan latest L1 -> L2 txs list provided in the example.

References: GitHub: https://github.com/coxmars OnlyDust: https://app.onlydust.com/u/coxmars Portfolio: https://marcox-portfolio.netlify.app/

I am looking forward to your feedback and the opportunity to contribute to this project.

armandocodecr commented 1 week ago

Plan to Resolve the Issue: Latest L1->L2 Transactions Page

Hello Walnut team,

I'm Armando, and I'm interested in working on the "Latest L1->L2 transactions page" problem. I have experience developing with Next.js and React, and I feel I can effectively contribute to solve this problem.

Description

The goal is to create a Next.js page that displays a list of the latest L1->L2 transactions created on the blockchain. This list should include details such as L1 block number, L2 transaction hash, timestamp, L1 transaction hash, L1 transaction origin, and gas limit. The visualization should be similar to the L1->L2 transactions list on Etherscan, providing external links for certain fields and excluding additional columns not requested.

Implementation

Create the Route for L1->L2 Transactions

Update the fetchLatestL1L2Transactions Function

Implement the Table Component

Technical Details

Route: /txs-enqueued

Table Component

fetchLatestL1L2Transactions Function

Verification and Testing

Data Validation

Manual Testing

Conclusion

This plan outlines a clear and precise strategy to implement the L1->L2 transactions page in Next.js. It focuses on following best practices of React and Next.js for data fetching and rendering, using Shadcn components for a consistent user interface. The proposed solution ensures users receive a seamless and visually similar experience to the transactions list on Etherscan, with external and internal links to facilitate navigation.

I look forward to the opportunity to work on this issue and contribute significantly to the project. Thank you for considering my proposal.

saimeunt commented 1 week ago

@coxmars Thank you for your proposal, I've assigned you the issue.

Please note that you should NOT update the existing latest-l1-l2-transactions.tsx component, this one is specific to the home page. What you should do instead is create a completely new top-level route and accompanying page async React Server Component to display the table of L1->L2 transactions. See work done on the block txs page for example: https://github.com/walnuthq/op-scan/pull/16/files#diff-2c257bfdf7a507af25cb686d28fbe76c4140147b9410bf455716eda82fb1dd35

@armandocodecr I appreciate the quality of your comment but I'm willing to give a chance to everyone to get their own issue. Don't worry there will be more issues early next week and you might automatically be assigned without the need to comment on similar issues in the coming days if there's no sign of draft PR from assignees 💪

armandocodecr commented 1 week ago

Don't worry @saimeunt , I know @coxmars from the Dojo Coding community of which I am a part and I am sure he will do an excellent job on this issue. 💪🚀

coxmars commented 1 week ago

@coxmars Thank you for your proposal, I've assigned you the issue.

Please note that you should NOT update the existing latest-l1-l2-transactions.tsx component, this one is specific to the home page. What you should do instead is create a completely new top-level route and accompanying page async React Server Component to display the table of L1->L2 transactions. See work done on the block txs page for example: https://github.com/walnuthq/op-scan/pull/16/files#diff-2c257bfdf7a507af25cb686d28fbe76c4140147b9410bf455716eda82fb1dd35

@armandocodecr I appreciate the quality of your comment but I'm willing to give a chance to everyone to get their own issue. Don't worry there will be more issues early next week and you might automatically be assigned without the need to comment on similar issues in the coming days if there's no sign of draft PR from assignees 💪

Okay, thanks for the advice and the opportunity 🫡

saimeunt commented 5 days ago

@coxmars how is it going with the issue? Are you still working on this? Please note that if you're not providing at least a draft PR by the end of Wednesday we'll have to assign someone else.

coxmars commented 5 days ago

@coxmars how is it going with the issue? Are you still working on this? Please note that if you're not providing at least a draft PR by the end of Wednesday we'll have to assign someone else.

Hi @saimeunt, I'm working on it and will send the first PR for review tomorrow.