-
- Explore
-
-
-
- Interact
-
-
-
- Observe
-
+ Explore
+ Interact
+ Observe
{isFetched && !data?.isWorldDeployed && (
diff --git a/packages/explorer/src/components/ui/Badge.tsx b/packages/explorer/src/components/ui/Badge.tsx
new file mode 100644
index 0000000000..c264a23a12
--- /dev/null
+++ b/packages/explorer/src/components/ui/Badge.tsx
@@ -0,0 +1,34 @@
+import { type VariantProps, cva } from "class-variance-authority";
+import * as React from "react";
+import { cn } from "../../utils";
+
+const badgeVariants = cva(
+ cn(
+ "inline-flex items-center px-2.5 py-0.5",
+ "rounded-md border",
+ "text-xs font-semibold transition-colors",
+ "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
+ ),
+ {
+ variants: {
+ variant: {
+ default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
+ tertiary: "border-transparent bg-tertiary text-tertiary-foreground hover:bg-tertiary/80",
+ destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
+ outline: "text-foreground",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ },
+);
+
+export interface BadgeProps extends React.HTMLAttributes
, VariantProps {}
+
+function Badge({ className, variant, ...props }: BadgeProps) {
+ return
;
+}
+
+export { Badge, badgeVariants };
diff --git a/packages/explorer/src/components/ui/Table.tsx b/packages/explorer/src/components/ui/Table.tsx
index 4e90da239b..82addda6b0 100644
--- a/packages/explorer/src/components/ui/Table.tsx
+++ b/packages/explorer/src/components/ui/Table.tsx
@@ -3,9 +3,7 @@ import { cn } from "../../utils";
const Table = React.forwardRef>(
({ className, ...props }, ref) => (
-
+
),
);
Table.displayName = "Table";
diff --git a/packages/explorer/src/observer/decorator.ts b/packages/explorer/src/observer/decorator.ts
index 43077b4ada..ab4c109bf4 100644
--- a/packages/explorer/src/observer/decorator.ts
+++ b/packages/explorer/src/observer/decorator.ts
@@ -46,7 +46,7 @@ export function observer({ explorerUrl = "http://localhost:13690", waitForTransa
write.then((hash) => {
const receipt = getAction(client, waitForTransactionReceipt, "waitForTransactionReceipt")({ hash });
- emit("waitForTransactionReceipt", { writeId });
+ emit("waitForTransactionReceipt", { writeId, hash });
Promise.allSettled([receipt]).then(([result]) => {
emit("waitForTransactionReceipt:result", { ...result, writeId });
});
diff --git a/packages/explorer/src/observer/messages.ts b/packages/explorer/src/observer/messages.ts
index a906c9f615..d2d5f5db0f 100644
--- a/packages/explorer/src/observer/messages.ts
+++ b/packages/explorer/src/observer/messages.ts
@@ -14,6 +14,7 @@ export type Messages = {
};
waitForTransactionReceipt: {
writeId: string;
+ hash: Hash;
};
"waitForTransactionReceipt:result": PromiseSettledResult & {
writeId: string;
diff --git a/packages/explorer/src/observer/store.ts b/packages/explorer/src/observer/store.ts
index b0f065ff74..5c4e78b414 100644
--- a/packages/explorer/src/observer/store.ts
+++ b/packages/explorer/src/observer/store.ts
@@ -1,6 +1,6 @@
"use client";
-import { Address } from "viem";
+import { Address, Hex } from "viem";
import { createStore } from "zustand/vanilla";
import { relayChannelName } from "./common";
import { debug } from "./debug";
@@ -8,6 +8,8 @@ import { Message, MessageType } from "./messages";
export type Write = {
writeId: string;
+ type: MessageType;
+ hash?: Hex;
address: Address;
functionSignature: string;
args: unknown[];
@@ -36,6 +38,8 @@ channel.addEventListener("message", ({ data }: MessageEvent) => {
...state.writes,
[data.writeId]: {
...write,
+ type: data.type,
+ hash: data.type === "waitForTransactionReceipt" ? data.hash : write.hash,
events: [...write.events, data],
},
},
diff --git a/packages/explorer/tailwind.config.ts b/packages/explorer/tailwind.config.ts
index 4e7d355442..4ea11a90ca 100644
--- a/packages/explorer/tailwind.config.ts
+++ b/packages/explorer/tailwind.config.ts
@@ -14,10 +14,12 @@ const config = {
},
extend: {
fontFamily: {
- sans: ["var(--font-jetbrains-mono)"],
+ sans: ["var(--font-inter)"],
mono: ["var(--font-jetbrains-mono)"],
},
-
+ fontSize: {
+ "2xs": ["0.625rem", { lineHeight: "1rem" }],
+ },
colors: {
border: "hsl(var(--border))",
input: "hsl(var(--input))",
@@ -52,6 +54,7 @@ const config = {
DEFAULT: "hsl(var(--card))",
foreground: "hsl(var(--card-foreground))",
},
+ success: "#34d399",
},
borderRadius: {
lg: "var(--radius)",