Skip to content

Commit c1aae6a

Browse files
Merge pull request #91 from StabilityNexus/Frontend
Made Clowder multichain
2 parents 84307f3 + 1785fe8 commit c1aae6a

File tree

7 files changed

+44
-52
lines changed

7 files changed

+44
-52
lines changed

web/src/app/[cat]/InteractionClient.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ import { SupportedChainId } from "@/utils/indexedDB";
2626

2727
// Chain names mapping
2828
const CHAIN_NAMES: Record<SupportedChainId, string> = {
29-
// 137: "Polygon",
30-
// 534351: "Scroll Sepolia",
29+
137: "Polygon",
30+
534351: "Scroll Sepolia",
3131
5115: "Citrea Testnet",
32-
// 61: "Ethereum Classic",
33-
// 8453: "Base"
32+
61: "Ethereum Classic",
33+
8453: "Base"
3434
};
3535

3636

@@ -184,8 +184,7 @@ export default function InteractionClient() {
184184

185185
// Type guard for chain ID validation
186186
const isValidChainId = useCallback((chainId: number): chainId is SupportedChainId => {
187-
// const validChainIds: SupportedChainId[] = [ 137, 534351, 5115, 61, 8453];
188-
const validChainIds: SupportedChainId[] = [ 5115];
187+
const validChainIds: SupportedChainId[] = [ 137, 534351, 5115, 61, 8453];
189188
return validChainIds.includes(chainId as SupportedChainId);
190189
}, []);
191190

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

229-
const publicClient = getPublicClient(config, { chainId });
228+
const publicClient = getPublicClient(config, { chainId: chainId as any });
230229
if (!publicClient) {
231230
throw new Error(`No public client available for chain ${chainId}`);
232231
}

web/src/app/create/page.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,22 @@ import { ButtonLoadingState } from "@/components/ui/button-loading-state";
2222
import { getPublicClient } from "@wagmi/core";
2323

2424
// Define supported chain IDs and names
25-
// type SupportedChainId = 137 | 534351 | 5115 | 61 | 8453;
26-
type SupportedChainId = 5115;
25+
type SupportedChainId = 137 | 534351 | 5115 | 61 | 8453;
2726

2827
const CHAIN_NAMES: Record<SupportedChainId, string> = {
29-
// 137: "Polygon",
30-
// 534351: "Scroll Sepolia",
28+
137: "Polygon",
29+
534351: "Scroll Sepolia",
3130
5115: "Citrea Testnet",
32-
// 61: "Ethereum Classic",
33-
// 8453: "Base Mainnet",
31+
61: "Ethereum Classic",
32+
8453: "Base Mainnet",
3433
};
3534

3635
const CHAIN_COLORS: Record<SupportedChainId, string> = {
37-
// 137: "bg-purple-500",
38-
// 534351: "bg-orange-500",
36+
137: "bg-purple-500",
37+
534351: "bg-orange-500",
3938
5115: "bg-yellow-500",
40-
// 61: "bg-green-500",
41-
// 8453: "bg-blue-500",
39+
61: "bg-green-500",
40+
8453: "bg-blue-500",
4241
};
4342

4443
interface DeployContractProps {

web/src/app/my-cats/page.tsx

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,22 @@ import { useCATStorage } from "@/hooks/useCATStorage";
1919
import { SupportedChainId, CatDetails as StoredCatDetails } from "@/utils/indexedDB";
2020
import toast from "react-hot-toast";
2121

22-
// Define supported chain IDs - use the imported type from IndexedDB
23-
// type SupportedChainId = 137 | 534351 | 5115 | 61 | 8453;
24-
2522
// Chain ID to name mapping
2623
const CHAIN_NAMES: Record<SupportedChainId, string> = {
27-
// 137: "Polygon",
28-
// 534351: "Scroll Sepolia",
24+
137: "Polygon",
25+
534351: "Scroll Sepolia",
2926
5115: "Citrea Testnet",
30-
// 61: "Ethereum Classic",
31-
// 8453: "Base Mainnet",
27+
61: "Ethereum Classic",
28+
8453: "Base Mainnet",
3229
};
3330

3431
// Chain colors for visual distinction
3532
const CHAIN_COLORS: Record<SupportedChainId, string> = {
36-
// 137: "bg-purple-500",
37-
// 534351: "bg-orange-500",
33+
137: "bg-purple-500",
34+
534351: "bg-orange-500",
3835
5115: "bg-yellow-500",
39-
// 61: "bg-green-500",
40-
// 8453: "bg-blue-500",
36+
61: "bg-green-500",
37+
8453: "bg-blue-500",
4138
};
4239

4340
interface CatDetails {
@@ -60,8 +57,7 @@ interface PaginationInfo {
6057
const isValidChainId = (
6158
chainId: number | string
6259
): chainId is SupportedChainId => {
63-
// const validChainIds: SupportedChainId[] = [137, 534351, 5115, 61, 8453];
64-
const validChainIds: SupportedChainId[] = [5115];
60+
const validChainIds: SupportedChainId[] = [137, 534351, 5115, 61, 8453];
6561
return validChainIds.includes(Number(chainId) as SupportedChainId);
6662
};
6763

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

194-
const publicClient = getPublicClient(config, { chainId: Number(chainId) as SupportedChainId });
190+
const publicClient = getPublicClient(config, { chainId: Number(chainId) as any });
195191
if (!publicClient) continue;
196192

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

606602
try {

web/src/app/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ import { showTransactionToast } from "@/components/ui/transaction-toast"
2121

2222

2323
const supportedChains = [
24-
// { id: "534351", name: "Scroll Sepolia" },
24+
{ id: "534351", name: "Scroll Sepolia" },
2525
{ id: "5115", name: "Citrea Testnet" },
26-
// { id: "61", name: "Ethereum Classic" },
27-
// { id: "8453", name: "Base Mainnet" },
28-
// { id: "137", name: "Polygon Mainnet" },
26+
{ id: "61", name: "Ethereum Classic" },
27+
{ id: "8453", name: "Base Mainnet" },
28+
{ id: "137", name: "Polygon Mainnet" },
2929
];
3030

3131
const contact_links = [

web/src/components/ChainDropdown.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,24 @@ import { motion, AnimatePresence } from "framer-motion";
55
import { ChevronDown, Check, Network } from "lucide-react";
66

77
// Define supported chain IDs
8-
// type SupportedChainId = 137 | 534351 | 5115 | 61 | 8453;
9-
type SupportedChainId = 5115;
8+
type SupportedChainId = 137 | 534351 | 5115 | 61 | 8453;
109

1110
// Chain ID to name mapping
1211
const CHAIN_NAMES: Record<SupportedChainId, string> = {
13-
// 137: "Polygon",
14-
// 534351: "Scroll Sepolia",
12+
137: "Polygon",
13+
534351: "Scroll Sepolia",
1514
5115: "Citrea Testnet",
16-
// 61: "Ethereum Classic",
17-
// 8453: "Base Mainnet",
15+
61: "Ethereum Classic",
16+
8453: "Base Mainnet",
1817
};
1918

2019
// Chain colors for visual distinction
2120
const CHAIN_COLORS: Record<SupportedChainId, string> = {
22-
// 137: "bg-purple-500",
23-
// 534351: "bg-orange-500",
21+
137: "bg-purple-500",
22+
534351: "bg-orange-500",
2423
5115: "bg-yellow-500",
25-
// 61: "bg-green-500",
26-
// 8453: "bg-blue-500",
24+
61: "bg-green-500",
25+
8453: "bg-blue-500",
2726
};
2827

2928
interface ChainDropdownProps {

web/src/utils/address.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
export const ClowderVaultFactories = {
2-
// 534351: "0x9551a49da35158c97b5c7857b5ef46223c71e9e1",
2+
534351: "0x9551a49da35158c97b5c7857b5ef46223c71e9e1",
33
5115: "0x90070eD69ED51f606b899f5bB9069157Dec4A400",
4-
// 61: "0x6300F69Ff4Bf96EB4AaD8bf99ee82D8f1a19Bb0F",
5-
// 137: "0x562a404f844ea6097bd84feb005bd6f420d3640e",
6-
// 8453: "0x553859a7e3f8841aed994a2a131ebfb38aa9dc10",
4+
61: "0x6300F69Ff4Bf96EB4AaD8bf99ee82D8f1a19Bb0F",
5+
137: "0x562a404f844ea6097bd84feb005bd6f420d3640e",
6+
8453: "0x553859a7e3f8841aed994a2a131ebfb38aa9dc10",
77
} as {
88
[key: number]: `0x${string}`;
99
};

web/src/utils/indexedDB.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// IndexedDB service for storing CAT and token data
22
// Following best practices with versioning, proper indexing, and error handling
33

4-
// export type SupportedChainId = 137 | 534351 | 5115 | 61 | 8453;
5-
export type SupportedChainId = 5115;
4+
export type SupportedChainId = 137 | 534351 | 5115 | 61 | 8453;
65

76
export interface CatDetails {
87
chainId: SupportedChainId;

0 commit comments

Comments
 (0)