Skip to content

Commit

Permalink
Merge branch 'main' into kumpis/mud-landing-page
Browse files Browse the repository at this point in the history
  • Loading branch information
karooolis committed Nov 14, 2024
2 parents 805b3ea + 1c8d951 commit 742de7a
Show file tree
Hide file tree
Showing 26 changed files with 263 additions and 522 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-trees-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/explorer": patch
---

The transactions list in the explorer is now updated every 100ms instead of on every incoming transaction, to improve performance when there are many incoming transactions.
5 changes: 5 additions & 0 deletions .changeset/hip-spies-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/explorer": patch
---

When accessing a new table in Explore tab, the SQL editor now encloses all column names in double quotes in order to prevent invalid queries.
5 changes: 5 additions & 0 deletions .changeset/lazy-windows-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/explorer": patch
---

The latest ABI changes are now consistently fetched correctly.
5 changes: 5 additions & 0 deletions .changeset/mighty-lions-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/explorer": patch
---

Transactions in `Observe` tab now display decoded `callFrom` function calls.
5 changes: 5 additions & 0 deletions .changeset/orange-houses-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/explorer": patch
---

Observer transport now uses the `blockExplorers.worldsExplorer.url` from the chain config if no `explorerUrl` is provided.
5 changes: 5 additions & 0 deletions .changeset/yellow-spoons-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/common": patch
---

Updated Rhodolite chain config.
14 changes: 14 additions & 0 deletions docs/app/DevconBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"use client";

export function DevconBanner() {
if (Date.now() > 1731603600000) return null;
return (
<div className="bg-mud/20 text-white p-4 text-center">
Hello Devcon! Come learn about MUD at{" "}
<a href="https://mud.dev/day" className="underline font-semibold">
MUD Day
</a>{" "}
on Thursday in Classroom A.
</div>
);
}
4 changes: 3 additions & 1 deletion docs/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Metadata } from "next";
import { ReactNode } from "react";
import localFont from "next/font/local";
import "./globals.css";
import { cn } from "../lib/cn";
import { DevconBanner } from "./DevconBanner";
import "./globals.css";

const basierCircle = localFont({
src: [
Expand Down Expand Up @@ -72,6 +73,7 @@ export default function Layout({ children }: Props) {
berkeleyMono.variable,
)}
>
<DevconBanner />
{children}
</body>
</html>
Expand Down
27 changes: 25 additions & 2 deletions packages/common/src/chains/rhodolite.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { chainConfig } from "viem/op-stack";
import { MUDChain } from "./types";
import { Chain } from "viem";

const sourceId = 17001;

const defaultRpcUrls = {
http: ["https://rpc.rhodolitechain.com"],
webSocket: ["wss://rpc.rhodolitechain.com"],
} as const satisfies Chain["rpcUrls"]["default"];

export const rhodolite = {
...chainConfig,
name: "Rhodolite Devnet",
Expand All @@ -11,9 +17,26 @@ export const rhodolite = {
sourceId,
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
rpcUrls: {
default: defaultRpcUrls,
bundler: defaultRpcUrls,
quarryPassIssuer: defaultRpcUrls,
wiresaw: defaultRpcUrls,
},
contracts: {
...chainConfig.contracts,
quarryPaymaster: {
address: "0x61f22c3827d90c390e0e2aaf220971524ac0a68d",
blockCreated: 11262,
},
},
blockExplorers: {
default: {
http: ["https://rpc.rhodolitechain.com"],
webSocket: ["wss://rpc.rhodolitechain.com"],
name: "Blockscout",
url: "https://explorer.rhodolitechain.com",
},
worldsExplorer: {
name: "MUD Worlds Explorer",
url: "https://explorer.mud.dev/rhodolite/worlds",
},
},
iconUrls: ["https://redstone.xyz/chain-icons/rhodolite.png"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { WagmiProvider, createConfig, http } from "wagmi";
import { WagmiProvider, createConfig, fallback, http, webSocket } from "wagmi";
import { injected, metaMask, safe } from "wagmi/connectors";
import { ReactNode, useMemo } from "react";
import { RainbowKitProvider, darkTheme } from "@rainbow-me/rainbowkit";
Expand All @@ -27,9 +27,14 @@ export function Providers({ children }: { children: ReactNode }) {
...getDefaultAnvilConnectors(chain.id),
],
transports: {
[chain.id]: http(),
[chain.id]: chain.rpcUrls.default.webSocket
? fallback([webSocket(chain.rpcUrls.default.webSocket[0]), http(chain.rpcUrls.default.http[0])])
: http(chain.rpcUrls.default.http[0]),
},
ssr: true,
pollingInterval: {
[chain.id]: chain.id === 31337 ? 100 : 500,
},
});
}, [chain]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ export function EditableTableCell({ name, table, keyTuple, value: defaultValue }
chainId,
});

const receipt = await waitForTransactionReceipt(wagmiConfig, {
hash: txHash,
pollingInterval: 100,
});
const receipt = await waitForTransactionReceipt(wagmiConfig, { hash: txHash });

return { txHash, receipt };
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { indexerForChainId } from "../../../../utils/indexerForChainId";
import { SQLEditor } from "./SQLEditor";
import { TableSelector } from "./TableSelector";
import { TablesViewer } from "./TablesViewer";
import { postgresKeywords } from "./consts";

export function Explorer() {
const { worldAddress } = useParams();
Expand All @@ -30,12 +29,10 @@ export function Explorer() {
const tableName = constructTableName(table, worldAddress as Hex, chainId);

if (indexer.type === "sqlite") {
setQuery(`SELECT * FROM "${tableName}"`);
setQuery(`SELECT * FROM "${tableName}";`);
} else {
const columns = Object.keys(table.schema).map((column) =>
postgresKeywords.includes(column.toLowerCase()) ? `"${column}"` : column,
);
setQuery(`SELECT ${columns.join(", ")} FROM ${tableName}`);
const columns = Object.keys(table.schema).map((column) => `"${column}"`);
setQuery(`SELECT ${columns.join(", ")} FROM ${tableName};`);
}
}
}, [chainId, setQuery, selectedTableId, table, worldAddress, prevSelectedTableId, query, indexer.type]);
Expand Down
Loading

0 comments on commit 742de7a

Please sign in to comment.