Skip to content
Merged
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
13 changes: 6 additions & 7 deletions web/src/app/[cat]/InteractionClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ import { SupportedChainId } from "@/utils/indexedDB";

// Chain names mapping
const CHAIN_NAMES: Record<SupportedChainId, string> = {
// 137: "Polygon",
// 534351: "Scroll Sepolia",
137: "Polygon",
534351: "Scroll Sepolia",
5115: "Citrea Testnet",
// 61: "Ethereum Classic",
// 8453: "Base"
61: "Ethereum Classic",
8453: "Base"
};


Expand Down Expand Up @@ -184,8 +184,7 @@ export default function InteractionClient() {

// Type guard for chain ID validation
const isValidChainId = useCallback((chainId: number): chainId is SupportedChainId => {
// const validChainIds: SupportedChainId[] = [ 137, 534351, 5115, 61, 8453];
const validChainIds: SupportedChainId[] = [ 5115];
const validChainIds: SupportedChainId[] = [ 137, 534351, 5115, 61, 8453];
return validChainIds.includes(chainId as SupportedChainId);
}, []);

Expand Down Expand Up @@ -226,7 +225,7 @@ export default function InteractionClient() {
setIsSyncing(true);
console.log('Fetching token details from blockchain...', { tokenAddress, chainId });

const publicClient = getPublicClient(config, { chainId });
const publicClient = getPublicClient(config, { chainId: chainId as any });
if (!publicClient) {
throw new Error(`No public client available for chain ${chainId}`);
}
Expand Down
19 changes: 9 additions & 10 deletions web/src/app/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,22 @@ import { ButtonLoadingState } from "@/components/ui/button-loading-state";
import { getPublicClient } from "@wagmi/core";

// Define supported chain IDs and names
// type SupportedChainId = 137 | 534351 | 5115 | 61 | 8453;
type SupportedChainId = 5115;
type SupportedChainId = 137 | 534351 | 5115 | 61 | 8453;

const CHAIN_NAMES: Record<SupportedChainId, string> = {
// 137: "Polygon",
// 534351: "Scroll Sepolia",
137: "Polygon",
534351: "Scroll Sepolia",
5115: "Citrea Testnet",
// 61: "Ethereum Classic",
// 8453: "Base Mainnet",
61: "Ethereum Classic",
8453: "Base Mainnet",
};

const CHAIN_COLORS: Record<SupportedChainId, string> = {
// 137: "bg-purple-500",
// 534351: "bg-orange-500",
137: "bg-purple-500",
534351: "bg-orange-500",
5115: "bg-yellow-500",
// 61: "bg-green-500",
// 8453: "bg-blue-500",
61: "bg-green-500",
8453: "bg-blue-500",
};

interface DeployContractProps {
Expand Down
26 changes: 11 additions & 15 deletions web/src/app/my-cats/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,22 @@ import { useCATStorage } from "@/hooks/useCATStorage";
import { SupportedChainId, CatDetails as StoredCatDetails } from "@/utils/indexedDB";
import toast from "react-hot-toast";

// Define supported chain IDs - use the imported type from IndexedDB
// type SupportedChainId = 137 | 534351 | 5115 | 61 | 8453;

// Chain ID to name mapping
const CHAIN_NAMES: Record<SupportedChainId, string> = {
// 137: "Polygon",
// 534351: "Scroll Sepolia",
137: "Polygon",
534351: "Scroll Sepolia",
5115: "Citrea Testnet",
// 61: "Ethereum Classic",
// 8453: "Base Mainnet",
61: "Ethereum Classic",
8453: "Base Mainnet",
};

// Chain colors for visual distinction
const CHAIN_COLORS: Record<SupportedChainId, string> = {
// 137: "bg-purple-500",
// 534351: "bg-orange-500",
137: "bg-purple-500",
534351: "bg-orange-500",
5115: "bg-yellow-500",
// 61: "bg-green-500",
// 8453: "bg-blue-500",
61: "bg-green-500",
8453: "bg-blue-500",
};

interface CatDetails {
Expand All @@ -60,8 +57,7 @@ interface PaginationInfo {
const isValidChainId = (
chainId: number | string
): chainId is SupportedChainId => {
// const validChainIds: SupportedChainId[] = [137, 534351, 5115, 61, 8453];
const validChainIds: SupportedChainId[] = [5115];
const validChainIds: SupportedChainId[] = [137, 534351, 5115, 61, 8453];
return validChainIds.includes(Number(chainId) as SupportedChainId);
};

Expand Down Expand Up @@ -191,7 +187,7 @@ export default function MyCATsPage() {
for (const [chainId, factoryAddress] of Object.entries(ClowderVaultFactories)) {
if (!isValidChainId(chainId)) continue;

const publicClient = getPublicClient(config, { chainId: Number(chainId) as SupportedChainId });
const publicClient = getPublicClient(config, { chainId: Number(chainId) as any });
if (!publicClient) continue;

try {
Expand Down Expand Up @@ -600,7 +596,7 @@ export default function MyCATsPage() {
chainId: SupportedChainId,
defaultRole: 'admin' | 'minter' | 'both'
): Promise<CatDetails[]> => {
const publicClient = getPublicClient(config, { chainId });
const publicClient = getPublicClient(config, { chainId: chainId as any });
if (!publicClient || !addresses.length) return [];

try {
Expand Down
8 changes: 4 additions & 4 deletions web/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import { showTransactionToast } from "@/components/ui/transaction-toast"


const supportedChains = [
// { id: "534351", name: "Scroll Sepolia" },
{ id: "534351", name: "Scroll Sepolia" },
{ id: "5115", name: "Citrea Testnet" },
// { id: "61", name: "Ethereum Classic" },
// { id: "8453", name: "Base Mainnet" },
// { id: "137", name: "Polygon Mainnet" },
{ id: "61", name: "Ethereum Classic" },
{ id: "8453", name: "Base Mainnet" },
{ id: "137", name: "Polygon Mainnet" },
];

const contact_links = [
Expand Down
19 changes: 9 additions & 10 deletions web/src/components/ChainDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,24 @@ import { motion, AnimatePresence } from "framer-motion";
import { ChevronDown, Check, Network } from "lucide-react";

// Define supported chain IDs
// type SupportedChainId = 137 | 534351 | 5115 | 61 | 8453;
type SupportedChainId = 5115;
type SupportedChainId = 137 | 534351 | 5115 | 61 | 8453;

// Chain ID to name mapping
const CHAIN_NAMES: Record<SupportedChainId, string> = {
// 137: "Polygon",
// 534351: "Scroll Sepolia",
137: "Polygon",
534351: "Scroll Sepolia",
5115: "Citrea Testnet",
// 61: "Ethereum Classic",
// 8453: "Base Mainnet",
61: "Ethereum Classic",
8453: "Base Mainnet",
};

// Chain colors for visual distinction
const CHAIN_COLORS: Record<SupportedChainId, string> = {
// 137: "bg-purple-500",
// 534351: "bg-orange-500",
137: "bg-purple-500",
534351: "bg-orange-500",
5115: "bg-yellow-500",
// 61: "bg-green-500",
// 8453: "bg-blue-500",
61: "bg-green-500",
8453: "bg-blue-500",
};

interface ChainDropdownProps {
Expand Down
8 changes: 4 additions & 4 deletions web/src/utils/address.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export const ClowderVaultFactories = {
// 534351: "0x9551a49da35158c97b5c7857b5ef46223c71e9e1",
534351: "0x9551a49da35158c97b5c7857b5ef46223c71e9e1",
5115: "0x90070eD69ED51f606b899f5bB9069157Dec4A400",
// 61: "0x6300F69Ff4Bf96EB4AaD8bf99ee82D8f1a19Bb0F",
// 137: "0x562a404f844ea6097bd84feb005bd6f420d3640e",
// 8453: "0x553859a7e3f8841aed994a2a131ebfb38aa9dc10",
61: "0x6300F69Ff4Bf96EB4AaD8bf99ee82D8f1a19Bb0F",
137: "0x562a404f844ea6097bd84feb005bd6f420d3640e",
8453: "0x553859a7e3f8841aed994a2a131ebfb38aa9dc10",
} as {
[key: number]: `0x${string}`;
};
3 changes: 1 addition & 2 deletions web/src/utils/indexedDB.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// IndexedDB service for storing CAT and token data
// Following best practices with versioning, proper indexing, and error handling

// export type SupportedChainId = 137 | 534351 | 5115 | 61 | 8453;
export type SupportedChainId = 5115;
export type SupportedChainId = 137 | 534351 | 5115 | 61 | 8453;

export interface CatDetails {
chainId: SupportedChainId;
Expand Down