diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ae6bd00..96e07e3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -31,7 +31,6 @@ jobs: npm install --save @project-serum/anchor npm install --save @types/bn.js npm install --save vite-plugin-node-polyfills - npm install --save @metaplex-foundation/mpl-token-metadata - name: Build run: | diff --git a/app/src/utils/getTokenInfo.ts b/app/src/utils/getTokenInfo.ts deleted file mode 100644 index 33cd90c..0000000 --- a/app/src/utils/getTokenInfo.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Connection, PublicKey } from '@solana/web3.js'; - -const tokenCache = new Map(); - -export async function getTokenInfo( - connection: Connection, - mintAddress: string -): Promise { - try { - if (tokenCache.has(mintAddress)) { - return tokenCache.get(mintAddress)!; - } - const Metadata = require("@metaplex-foundation/mpl-token-metadata"); - let mintPubkey = new PublicKey("9MwGzSyuQRqmBHqmYwE6wbP3vzRBj4WWiYxWns3rkR7A"); - let tokenmetaPubkey = await Metadata.getPDA(mintPubkey); - const tokenmeta = await Metadata.load(connection, tokenmetaPubkey); - - if (tokenmeta.symbol) { - tokenCache.set(mintAddress, tokenmeta.symbol); - return tokenmeta.symbol; - } - - return mintAddress.slice(0, 4) + '...' + mintAddress.slice(-4); - } catch (error) { - console.error('Error fetching token metadata:', error); - return mintAddress.slice(0, 4) + '...' + mintAddress.slice(-4); - } -} \ No newline at end of file