Skip to content

Commit dac9582

Browse files
committed
update table after deployment
1 parent 3207bc7 commit dac9582

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/cross-chain/data-table.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,18 @@ export function DataTable({
244244
deployStatusModal.setViewContractLink(
245245
`/${chain.id}/${crosschainContractAddress}`,
246246
);
247+
deployStatusModal.close();
248+
249+
setTableData((prevData) =>
250+
prevData.map((row) =>
251+
row.chainId === chainId
252+
? {
253+
...row,
254+
status: "DEPLOYED",
255+
}
256+
: row,
257+
),
258+
);
247259
} catch (e) {
248260
onError(e);
249261
console.error("failed to deploy contract", e);

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/cross-chain/page.tsx

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ import {
77
parseEventLogs,
88
prepareEvent,
99
} from "thirdweb";
10-
import {
11-
type ChainMetadata,
12-
defineChain,
13-
getChainMetadata,
14-
} from "thirdweb/chains";
10+
import { defineChain, getChainMetadata } from "thirdweb/chains";
1511
import {
1612
type FetchDeployMetadataResult,
1713
getContract,
@@ -34,19 +30,6 @@ export function getModuleInstallParams(mod: FetchDeployMetadataResult) {
3430
);
3531
}
3632

37-
async function fetchChainsFromApi() {
38-
const res = await fetch("https://api.thirdweb.com/v1/chains");
39-
const json = await res.json();
40-
41-
if (json.error) {
42-
throw new Error(json.error.message);
43-
}
44-
45-
return json.data as ChainMetadata[];
46-
}
47-
48-
const allChains = await fetchChainsFromApi();
49-
5033
export default async function Page(props: {
5134
params: Promise<{
5235
contractAddress: string;
@@ -135,11 +118,21 @@ export default async function Page(props: {
135118
creationBlockNumber = event?.blockNumber;
136119
}
137120

121+
const topOPStackTestnetChainIds = [
122+
84532, // Base
123+
11155420, // OP testnet
124+
919, // Mode Network
125+
111557560, // Cyber
126+
999999999, // Zora
127+
11155111, // sepolia
128+
421614,
129+
];
130+
138131
const chainsDeployedOn = (
139132
await Promise.all(
140-
allChains.map(async (c) => {
133+
topOPStackTestnetChainIds.map(async (c) => {
141134
// eslint-disable-next-line no-restricted-syntax
142-
const chain = defineChain(c.chainId);
135+
const chain = defineChain(c);
143136

144137
try {
145138
const chainMetadata = await getChainMetadata(chain);

0 commit comments

Comments
 (0)