-
Notifications
You must be signed in to change notification settings - Fork 10
Add transactions tabs to contract details #34
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
bc1014f to
32087e8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey actually the designs have changed post our last conversation. I would recommend using these in place of <Tabs /> since @kariy has added this to our components to directly plug everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to delete this too. We would need this in the <DetailsPageSelector /> Component
| @@ -9,17 +9,17 @@ import { | |||
| useReactTable, | |||
| } from "@tanstack/react-table"; | |||
| import { ROUTES } from "@/constants/routes"; | |||
| import TxTypeToggle from "./TxTypeToggle"; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
src/modules/ContractDetails/page.tsx
Outdated
| const { events } = await RPC_PROVIDER.getEvents({ | ||
| address: contractAddress!, | ||
| chunk_size: 1, | ||
| from_block: { block_number: 0 }, | ||
| to_block: "latest", | ||
| }); | ||
|
|
||
| const txHashes = [...new Set(events.map(event => event.transaction_hash))]; | ||
|
|
||
| return Promise.all( | ||
| txHashes.map(async (hash, i) => { | ||
| const [receipt, details] = await Promise.all([ | ||
| RPC_PROVIDER.getTransactionReceipt(hash), | ||
| RPC_PROVIDER.getTransactionByHash(hash) | ||
| ]); | ||
| return { | ||
| id: padNumber(i + 1), | ||
| type: details.type, | ||
| status: receipt.statusReceipt, | ||
| hash, | ||
| }; | ||
| }) | ||
| ); | ||
| }, | ||
| initialData: [], | ||
| enabled: !!contractAddress |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it's intentional for now, but this will at most only fetch 1 event. For this to be correct we have to query it in a loop from block 0 -> block latest until no continuation token is returned by getEvents. And this would take a very long time. So, I don't think this query should be done in the client....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is something that would be solved if we have a dedicated indexer. I also think it's probably fine to fetch the events like this if it's on a locally hosted katana (ie, dev node), but not on any of the live Starknet chains. Considering they have A LOT of blocks.
d2a70ae to
bc9fe37
Compare
bc9fe37 to
f1eba98
Compare
6dfc51f to
c243d98
Compare
c243d98 to
84e2378
Compare
84e2378 to
941e700
Compare
|
close in favor of #40 |
Co-authored-by: kariy <26515232+kariy@users.noreply.github.com>
No description provided.