Skip to content

Commit b011aee

Browse files
authored
Merge pull request #2766 from pyth-network/cprussin/entropy-explorer-live
feat(entropy-explorer): bind to live apis
2 parents 8d8e809 + bf4495f commit b011aee

35 files changed

+1626
-1221
lines changed

apps/entropy-explorer/NOTES.org

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
* TODO Lock timestamp to when page loaded & add sync button
2+
* TODO Add TODO items in requests.ts
3+
- providerContribution
4+
- gasUsed + randomNumber in errored state
5+
6+
* TODO Connect the wallet to execute the transaction.
7+
* TODO Have a blinking yellow-coloured pending status that can be turned Green using an event listener.
8+
* TODO A dashboard on the home page to display reference material, such as current fees and usage.
9+
* TODO Many people use the Block number to search in explorers as well. We can think about it.
10+
11+
* DONE Removing badges from the sequence number + making it bold
12+
CLOSED: [2025-05-09 Fri 20:06]
13+
* DONE Rename Caller -> From or Sender
14+
CLOSED: [2025-05-09 Fri 20:08]
15+
* DONE Option to filter Callback Status
16+
CLOSED: [2025-05-09 Fri 20:08]
17+
* DONE Reorder Failed Tx Fields.
18+
CLOSED: [2025-05-09 Fri 20:11]
19+
** Request Timestamp
20+
** Callback Timestamp
21+
** Request Tx +Hash+
22+
** From / Sender
23+
** Callback Tx +Hash+
24+
** Provider
25+
** +User Random Number+ User Contribution
26+
** Gas Used
27+
* DONE Put the cast command in the code background with syntax colouring/highlighting.
28+
CLOSED: [2025-05-09 Fri 20:11]
29+
* DONE Decoding [[https://docs.pyth.network/entropy/error-codes][Error codes]].
30+
CLOSED: [2025-05-12 Mon 13:53]
31+
* DONE The timestamp should be shown in the following format ~9 secs ago (May-09-2025 12:47:11 PM +utc:)~
32+
CLOSED: [2025-05-12 Mon 14:30]
33+
* DONE Tooltips
34+
CLOSED: [2025-05-12 Mon 22:37]
35+
** Request Tx
36+
** Callback Tx
37+
** User Random Number / User Contribution
38+
** Provider Random Number / User Contribution
39+
* DONE Show delay/latency (delta between callbackTimestamp and requestTimestamp) somehow
40+
CLOSED: [2025-05-12 Mon 22:45]
41+
* DONE As @Tejas mentioned above, a tooltip button for the code can be used, or it can redirect them [[https://docs.pyth.network/entropy/debug-callback-failures][here]].
42+
CLOSED: [2025-05-12 Mon 22:48]
43+
* DONE Finish paginator
44+
CLOSED: [2025-06-06 Fri 11:10]
45+
* DONE Improve use-search-params
46+
CLOSED: [2025-06-06 Fri 19:55]
47+
* DONE Fix callback error page for unknown callback errors (i.e. when fortuna sends a string that isn't an error code)
48+
CLOSED: [2025-06-06 Fri 20:07]
49+
* DONE Improve not found message, especially for invalid search
50+
CLOSED: [2025-06-10 Tue 12:24]
51+
* DONE Improve ErrorResult handling
52+
CLOSED: [2025-06-10 Tue 12:24]
53+
* DONE Add all chains + icons
54+
CLOSED: [2025-06-10 Tue 16:12]

apps/entropy-explorer/next.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ const config = {
77

88
pageExtensions: ["ts", "tsx", "mdx"],
99

10+
images: {
11+
remotePatterns: [
12+
new URL("https://icons.llamao.fi/icons/chains/*?w=20&h=20"),
13+
new URL("https://www.tabichain.com/images/new2/tabi.svg"),
14+
],
15+
},
16+
1017
logging: {
1118
fetches: {
1219
fullUrl: true,

apps/entropy-explorer/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,12 @@
2323
"@phosphor-icons/react": "catalog:",
2424
"@pythnetwork/component-library": "workspace:*",
2525
"clsx": "catalog:",
26-
"connectkit": "catalog:",
2726
"next": "catalog:",
2827
"nuqs": "catalog:",
2928
"react": "catalog:",
3029
"react-aria": "catalog:",
3130
"react-dom": "catalog:",
3231
"react-timeago": "catalog:",
33-
"viem": "catalog:",
34-
"wagmi": "catalog:",
3532
"zod": "catalog:"
3633
},
3734
"devDependencies": {

apps/entropy-explorer/src/components/Address/index.module.scss

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,4 @@
55
flex-flow: row nowrap;
66
gap: theme.spacing(2);
77
font-size: theme.font-size("sm");
8-
9-
.full {
10-
display: none;
11-
}
12-
13-
&:not([data-always-truncate]) {
14-
@include theme.breakpoint("xl") {
15-
.truncated {
16-
display: none;
17-
}
18-
19-
.full {
20-
display: unset;
21-
}
22-
}
23-
}
248
}

apps/entropy-explorer/src/components/Address/index.tsx

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,32 @@ import { truncate } from "../../truncate";
99
type Props = {
1010
value: string;
1111
chain: keyof typeof EntropyDeployments;
12-
alwaysTruncate?: boolean | undefined;
12+
isAccount?: boolean | undefined;
1313
};
1414

15-
export const Address = ({ value, chain, alwaysTruncate }: Props) => {
16-
const { explorer } = EntropyDeployments[chain];
15+
export const Account = (props: Omit<Props, "isAccount">) => (
16+
<Address {...props} isAccount />
17+
);
18+
19+
export const Transaction = (props: Omit<Props, "isAccount">) => (
20+
<Address {...props} />
21+
);
22+
23+
const Address = ({ value, chain, isAccount }: Props) => {
24+
const { explorerTxTemplate, explorerAccountTemplate } =
25+
EntropyDeployments[chain];
26+
const explorerTemplate = isAccount
27+
? explorerAccountTemplate
28+
: explorerTxTemplate;
1729
const truncatedValue = useMemo(() => truncate(value), [value]);
1830
return (
19-
<div
20-
data-always-truncate={alwaysTruncate ? "" : undefined}
21-
className={styles.address}
22-
>
31+
<div className={styles.address}>
2332
<Link
24-
href={explorer.replace("$ADDRESS", value)}
33+
href={explorerTemplate.replace("$ADDRESS", value)}
2534
target="_blank"
2635
rel="noreferrer"
2736
>
28-
<code className={styles.truncated}>{truncatedValue}</code>
29-
<code className={styles.full}>{value}</code>
37+
<code>{truncatedValue}</code>
3038
</Link>
3139
<CopyButton text={value} iconOnly />
3240
</div>

apps/entropy-explorer/src/components/Home/chain-select.tsx

Lines changed: 0 additions & 126 deletions
This file was deleted.

apps/entropy-explorer/src/components/Home/index.module.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,21 @@
1919
.body {
2020
@include theme.max-width;
2121

22+
.statusSelect {
23+
width: theme.spacing(44);
24+
}
25+
2226
.searchBar {
2327
width: 100%;
2428

2529
@include theme.breakpoint("lg") {
2630
width: theme.spacing(100);
2731
}
2832
}
33+
34+
.cardBody {
35+
background: theme.color("background", "primary");
36+
border-radius: theme.border-radius("xl");
37+
}
2938
}
3039
}

0 commit comments

Comments
 (0)