Skip to content
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

feat(explorer): rainbowkit burner wallet #3190

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/local-explorer/mprocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ procs:
SQLITE_FILENAME: "indexer.db"
explorer:
cwd: packages/contracts
shell: pnpm explorer --dev
shell: pnpm explorer --dev --chainId 17069 --worldAddress 0xa3d909f73f503fcb364d959cfc51c3778b37402f
1 change: 1 addition & 0 deletions packages/explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"@tanstack/react-table": "^8.19.3",
"@wagmi/core": "catalog:",
"better-sqlite3": "^8.6.0",
"burner-connector": "^0.0.8",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"debug": "^4.3.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,50 @@
"use client";

// import { burner } from "burner-connector";
import { rainbowkitBurnerWallet } from "burner-connector";
import { WagmiProvider, createConfig, http } from "wagmi";
import { injected, metaMask, safe } from "wagmi/connectors";
// import { injected, metaMask, safe } from "wagmi/connectors";
import { ReactNode, useMemo } from "react";
import { RainbowKitProvider, darkTheme } from "@rainbow-me/rainbowkit";
import { RainbowKitProvider, connectorsForWallets, darkTheme } from "@rainbow-me/rainbowkit";
import "@rainbow-me/rainbowkit/styles.css";
// import { getDefaultAnvilConnectors } from "../../../../../connectors/anvil";
import { metaMaskWallet } from "@rainbow-me/rainbowkit/wallets";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { getDefaultAnvilConnectors } from "../../../../../connectors/anvil";
import { useChain } from "../../../../../hooks/useChain";

const queryClient = new QueryClient();

const wallets = [metaMaskWallet, rainbowkitBurnerWallet];
const wagmiConnectors = connectorsForWallets(
[
{
groupName: "Supported Wallets",
wallets,
},
],
{
appName: "World Explorer",
projectId: "YOUR_WALLET_CONNECT_PROJECT_ID",
},
);

export function Providers({ children }: { children: ReactNode }) {
const chain = useChain();
const wagmiConfig = useMemo(() => {
return createConfig({
chains: [chain],
connectors: [
injected(),
metaMask({
dappMetadata: {
name: "World Explorer",
},
}),
safe(),
...getDefaultAnvilConnectors(chain.id),
],
connectors: wagmiConnectors,
// connectors: [
// injected(),
// metaMask({
// dappMetadata: {
// name: "World Explorer",
// },
// }),
// safe(),
// // ...getDefaultAnvilConnectors(chain.id),
// burner(),
// ],
transports: {
[chain.id]: http(),
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Lock } from "lucide-react";
import { useParams } from "next/navigation";
import { internalTableNames } from "@latticexyz/store-sync/sqlite";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../../../../../components/ui/Select";

type Props = {
Expand Down Expand Up @@ -28,9 +27,7 @@ export function TableSelector({ value, options }: Props) {
{options?.map((option) => {
return (
<SelectItem key={option} value={option} className="font-mono">
{(internalTableNames as string[]).includes(option) && (
<Lock className="mr-2 inline-block opacity-70" size={14} />
)}
{<Lock className="mr-2 inline-block opacity-70" size={14} />}
{option.replace(`${worldAddress}__`, "")}
</SelectItem>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ArrowUpDown, Loader } from "lucide-react";
import { useState } from "react";
import { internalTableNames } from "@latticexyz/store-sync/sqlite";
import { useQuery } from "@tanstack/react-query";
import {
ColumnDef,
Expand Down Expand Up @@ -122,7 +121,7 @@ export function TablesViewer({ table: selectedTable }: Props) {
const keysSchema = Object.keys(mudTableConfig?.key_schema || {});
const keyTuple = keysSchema.map((key) => row.getValue(key));
const value = row.getValue(name);
if ((selectedTable && (internalTableNames as string[]).includes(selectedTable)) || keysSchema.includes(name)) {
if (selectedTable && keysSchema.includes(name)) {
return value?.toString();
}

Expand Down
Loading
Loading