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

Up packages #170

Merged
merged 9 commits into from
Feb 7, 2025
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [16.x]
node: [lts/*]

steps:
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"scripts": {
"start": "yarn workspace @se-2/nextjs dev",
"next:build": "yarn workspace @se-2/nextjs build",
"next:lint": "yarn workspace @se-2/nextjs lint",
"next:format": "yarn workspace @se-2/nextjs format",
"next:check-types": "yarn workspace @se-2/nextjs check-types",
Expand Down
16 changes: 8 additions & 8 deletions packages/nextjs/components/NetworksDropdown/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@ export const filterChains = (
return Object.values(chains).filter(chain => !networkIds.has(chain.id) && !existingChainIds.has(chain.id));
};

const excludeChainKeys = ["lineaTestnet", "x1Testnet"]; // duplicate chains in viem chains

type Chains = Record<string, Chain>;

const unfilteredChains: Chains = wagmiChains as Chains;

export const filteredChains = Object.keys(unfilteredChains)
.filter(key => !excludeChainKeys.includes(key))
.reduce((obj: Chains, key) => {
obj[key] = unfilteredChains[key];
return obj;
}, {} as Chains);
// Remove duplicate chains by keeping only the first occurrence of each chainId
export const filteredChains = Object.entries(unfilteredChains).reduce((acc: Chains, [key, chain]) => {
const isDuplicateId = Object.values(acc).some(existingChain => existingChain.id === chain.id);
if (!isDuplicateId) {
acc[key] = chain;
}
return acc;
}, {} as Chains);

export const mapChainsToOptions = (chains: Chain[]): Options[] => {
return chains.map(chain => ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from "react";
import Link from "next/link";
import { CopyToClipboard } from "react-copy-to-clipboard";
import CopyToClipboard from "react-copy-to-clipboard";
import { CheckCircleIcon, DocumentDuplicateIcon } from "@heroicons/react/24/outline";

export const TransactionHash = ({ hash }: { hash: string }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/components/scaffold-eth/Address.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useState } from "react";
import { CopyToClipboard } from "react-copy-to-clipboard";
import CopyToClipboard from "react-copy-to-clipboard";
import { Address as AddressType, isAddress } from "viem";
import { hardhat } from "viem/chains";
import { normalize } from "viem/ens";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from "react";
import { CopyToClipboard } from "react-copy-to-clipboard";
import CopyToClipboard from "react-copy-to-clipboard";
import { TransactionReceipt } from "viem";
import { CheckCircleIcon, DocumentDuplicateIcon } from "@heroicons/react/24/outline";
import { ObjectFieldDisplay } from "~~/components/scaffold-eth";
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
18 changes: 9 additions & 9 deletions packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,35 @@
},
"dependencies": {
"@heroicons/react": "^2.0.11",
"@rainbow-me/rainbowkit": "2.1.2",
"@tanstack/react-query": "^5.28.6",
"@rainbow-me/rainbowkit": "2.1.6",
"@tanstack/react-query": "5.59.15",
"@uniswap/sdk-core": "^4.0.1",
"@uniswap/v2-sdk": "^3.0.1",
"@vercel/og": "^0.6.2",
"@web3icons/react": "^3.6.0",
"blo": "^1.0.1",
"burner-connector": "^0.0.8",
"daisyui": "^4.4.19",
"next": "13.3.4",
"next": "^14.2.11",
"next-plausible": "^3.12.0",
"next-themes": "^0.3.0",
"nextjs-progressbar": "^0.0.16",
"qrcode.react": "^3.1.0",
"react": "^18.2.0",
"react": "^18.3.1",
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "^18.2.0",
"react-dom": "^18.3.1",
"react-hot-toast": "^2.4.0",
"react-select": "^5.8.0",
"use-debounce": "^8.0.4",
"usehooks-ts": "^2.7.2",
"viem": "2.13.6",
"wagmi": "2.9.8",
"viem": "2.21.32",
"wagmi": "2.12.23",
"zustand": "^4.1.2"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@types/node": "^17.0.35",
"@types/react": "^18.0.9",
"@types/node": "^18.19.50",
"@types/react": "^18.3.5",
"@types/react-copy-to-clipboard": "^5.0.4",
"@typescript-eslint/eslint-plugin": "^5.39.0",
"abitype": "1.0.2",
Expand Down
6 changes: 4 additions & 2 deletions packages/nextjs/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import useFetchContractAbi from "~~/hooks/useFetchContractAbi";
import { useHeimdall } from "~~/hooks/useHeimdall";
import { useGlobalState } from "~~/services/store/store";
import { parseAndCorrectJSON } from "~~/utils/abi";
import { notification } from "~~/utils/scaffold-eth";
import { getAlchemyHttpUrl, notification } from "~~/utils/scaffold-eth";

enum TabName {
verifiedContract,
Expand Down Expand Up @@ -53,7 +53,9 @@ const Home: NextPage = () => {

const { abi: heimdallAbi, isLoading: isHeimdallFetching } = useHeimdall({
contractAddress: localAbiContractAddress as Address,
rpcUrl: publicClient?.chain.rpcUrls.default.http[0],
rpcUrl: getAlchemyHttpUrl(parseInt(network))
? getAlchemyHttpUrl(parseInt(network))
: publicClient?.chain.rpcUrls.default.http[0],
disabled: network === "31337" || !localAbiContractAddress,
});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/25414#issuecomment-1180518151
declare module "react-copy-to-clipboard" {
import React from "react";

interface Options {
debug: boolean;
message: string;
}

interface Props {
text: string;
onCopy?(a: string, b: boolean): void;
options?: Options;
}

class CopyToClipboard extends React.Component<PropsWithChildren<Props>, unknown> {}
export default CopyToClipboard;
}
6 changes: 0 additions & 6 deletions packages/nextjs/utils/scaffold-eth/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ export const NETWORKS_EXTRA_DATA: Record<string, ChainAttributes> = {
etherscanApiKey: ZKSYNC_ETHERSCAN_API_KEY,
icon: "/zksync.svg",
},
[chains.zkSyncTestnet.id]: {
color: "#5f4bb6",
etherscanEndpoint: "https://block-explorer-api.testnets.zksync.dev",
etherscanApiKey: ZKSYNC_ETHERSCAN_API_KEY,
icon: "/zksync.svg",
},
[chains.base.id]: {
color: "#1450EE",
etherscanEndpoint: "https://api.basescan.org",
Expand Down
Loading