48 | {href ? ( 49 | 50 | {children} 51 | 52 | ) : ( 53 | children 54 | )} 55 |
56 | ); 57 | 58 | export default Text; -------------------------------------------------------------------------------- /src/utils/filterByScamsAndLegit.tsx: -------------------------------------------------------------------------------- 1 | import { PublicKey, Connection } from "@solana/web3.js"; 2 | import { SCAM_TOKEN_LIST } from "./scamToken"; 3 | import { TokenStandard } from "@metaplex-foundation/mpl-token-metadata"; 4 | import { Pda } from "@metaplex-foundation/umi"; 5 | 6 | export function filterByScamsAndLegit( 7 | assets: { 8 | account: PublicKey; 9 | program: PublicKey; 10 | lamports: number; 11 | mint: string; 12 | name: string; 13 | image: string; 14 | amount: number; 15 | hasWithheldAmount: boolean; 16 | tokenStandard: TokenStandard; 17 | collectionMetadata: Pda | undefined; 18 | tokenRecord: Pda | undefined 19 | }[] 20 | ) { 21 | const scamAssets: { 22 | account: PublicKey; 23 | program: PublicKey; 24 | lamports: number; 25 | mint: string; 26 | name: string; 27 | image: string; 28 | amount: number; 29 | hasWithheldAmount: boolean; 30 | tokenStandard: TokenStandard; 31 | collectionMetadata: Pda | undefined; 32 | tokenRecord: Pda | undefined 33 | }[] = []; 34 | const legitAssets: { 35 | account: PublicKey; 36 | program: PublicKey; 37 | lamports: number; 38 | mint: string; 39 | name: string; 40 | image: string; 41 | amount: number; 42 | hasWithheldAmount: boolean; 43 | tokenStandard: TokenStandard; 44 | collectionMetadata: Pda | undefined; 45 | tokenRecord: Pda | undefined 46 | }[] = []; 47 | 48 | assets.map((asset) => { 49 | if (SCAM_TOKEN_LIST.includes(asset.mint)) { 50 | scamAssets.push(asset) 51 | } 52 | else { 53 | legitAssets.push(asset) 54 | } 55 | }) 56 | 57 | return [scamAssets, legitAssets]; 58 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "solana-dapp-next", 3 | "version": "0.2.0", 4 | "author": "Immutal0", 5 | "license": "MIT", 6 | "private": false, 7 | "scripts": { 8 | "dev": "next dev", 9 | "build": "next build", 10 | "start": "next start", 11 | "lint": "next lint" 12 | }, 13 | "dependencies": { 14 | "@heroicons/react": "^1.0.5", 15 | "@metaplex-foundation/mpl-token-metadata": "^3.3.0", 16 | "@metaplex-foundation/mpl-toolbox": "^0.9.4", 17 | "@metaplex-foundation/umi": "^0.9.2", 18 | "@metaplex-foundation/umi-bundle-defaults": "^0.9.2", 19 | "@metaplex-foundation/umi-signer-wallet-adapters": "^0.9.2", 20 | "@metaplex-foundation/umi-uploader-irys": "^0.10.0-beta.0", 21 | "@noble/ed25519": "^1.7.1", 22 | "@solana/spl-token": "^0.4.9", 23 | "@solana/wallet-adapter-base": "^0.9.23", 24 | "@solana/wallet-adapter-react": "^0.15.35", 25 | "@solana/wallet-adapter-react-ui": "^0.9.35", 26 | "@solana/wallet-adapter-wallets": "^0.19.32", 27 | "@solana/web3.js": "^1.95.4", 28 | "@tailwindcss/typography": "^0.5.9", 29 | "bs58": "^6.0.0", 30 | "clsx": "^2.1.1", 31 | "daisyui": "^1.24.3", 32 | "date-fns": "^2.29.3", 33 | "helius-sdk": "^1.4.0", 34 | "immer": "^9.0.12", 35 | "lucide-react": "^0.454.0", 36 | "next": "^13.1.5", 37 | "next-compose-plugins": "^2.2.1", 38 | "next-transpile-modules": "^10.0.0", 39 | "react": "^18.2.0", 40 | "react-dom": "^18.2.0", 41 | "tailwind-merge": "^2.5.4", 42 | "zustand": "^3.6.9" 43 | }, 44 | "devDependencies": { 45 | "@types/node": "^18.11.18", 46 | "@types/react": "^18.0.27", 47 | "autoprefixer": "^10.4.2", 48 | "eslint": "8.7.0", 49 | "eslint-config-next": "^13.1.5", 50 | "postcss": "^8.4.5", 51 | "tailwindcss": "^3.2.4", 52 | "typescript": "^5.6.3" 53 | }, 54 | "engines": { 55 | "node": ">=16" 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/components/nav-element/index.tsx: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-empty */ 2 | import Link from 'next/link'; 3 | import Text from '../Text'; 4 | import { cn } from '../../utils'; 5 | import { useRouter } from 'next/router'; 6 | import { useEffect, useRef } from 'react'; 7 | 8 | type NavElementProps = { 9 | label: string; 10 | href: string; 11 | as?: string; 12 | scroll?: boolean; 13 | chipLabel?: string; 14 | disabled?: boolean; 15 | navigationStarts?: () => void; 16 | }; 17 | 18 | const NavElement = ({ 19 | label, 20 | href, 21 | as, 22 | scroll, 23 | disabled, 24 | navigationStarts = () => {}, 25 | }: NavElementProps) => { 26 | const router = useRouter(); 27 | const isActive = href === router.asPath || (as && as === router.asPath); 28 | const divRef = useRef
71 |
72 |
{description}
86 | ) : null} 87 | {txid ? ( 88 | 102 | ) : null} 103 |{item.description}
134 |