From 872c4e510e323aa3fbb6f448b51c363f2b87cc65 Mon Sep 17 00:00:00 2001 From: 0xIchigo <0xIchigo@protonmail.com> Date: Wed, 7 Feb 2024 13:47:41 -0700 Subject: [PATCH 1/3] Fix Token/Account Routing --- src/lib/xray/lib/search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/xray/lib/search.ts b/src/lib/xray/lib/search.ts index 654016bc..faf2e6b9 100644 --- a/src/lib/xray/lib/search.ts +++ b/src/lib/xray/lib/search.ts @@ -58,7 +58,7 @@ export const search = async ( if (isValidPublicKey(query)) { const pubkey = new PublicKey(query); - const account = await connection.getParsedAccountInfo(pubkey); + const account = await connection.getAccountInfo(pubkey); // TODO Property 'program' does not exist on type 'Buffer | ParsedAccountData'. // @ts-ignore const program = account?.value?.data?.program; From 4b4206f72446c2e21839944efb1f9b83786fb5c1 Mon Sep 17 00:00:00 2001 From: 0xIchigo <0xIchigo@protonmail.com> Date: Wed, 7 Feb 2024 13:52:26 -0700 Subject: [PATCH 2/3] Add SOL and BONK as Recognized Tokens --- src/lib/util/recognized-tokens.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/util/recognized-tokens.ts b/src/lib/util/recognized-tokens.ts index 26995290..029dc220 100644 --- a/src/lib/util/recognized-tokens.ts +++ b/src/lib/util/recognized-tokens.ts @@ -1,6 +1,8 @@ import type { RecognizedTokens } from "$lib/types"; export const recognizedTokens: RecognizedTokens = { + BONK: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263", FOXY: "FoXyMu5xwXre7zEoSvzViRk3nGawHUp9kUh97y2NDhcq", + SOL: "So11111111111111111111111111111111111111112", USDC: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", }; From 8177e3ea86f9fc3696fa85b96be897ca65b5b98d Mon Sep 17 00:00:00 2001 From: 0xIchigo <0xIchigo@protonmail.com> Date: Wed, 7 Feb 2024 13:52:43 -0700 Subject: [PATCH 3/3] Formatooorrr --- .../components/providers/token-provider.svelte | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/lib/components/providers/token-provider.svelte b/src/lib/components/providers/token-provider.svelte index ed899509..3d5a702a 100644 --- a/src/lib/components/providers/token-provider.svelte +++ b/src/lib/components/providers/token-provider.svelte @@ -108,16 +108,16 @@ if (!response.ok) { throw new Error(`Status ${response.status}`); } - const contentType = response.headers.get('content-type'); - if (!contentType || !contentType.includes('application/json')) { - throw new TypeError('Received non-JSON content type'); + const contentType = response.headers.get("content-type"); + if (!contentType || !contentType.includes("application/json")) { + throw new TypeError("Received non-JSON content type"); } const jsonData = await response.json(); return jsonData.image; } catch (error) { // eslint-disable-next-line no-console - console.error('Error fetching or parsing JSON metadata:', error); - return ''; + console.error("Error fetching or parsing JSON metadata:", error); + return ""; } }; @@ -129,7 +129,7 @@ metadata.name = name; } - if (jsonUri && jsonUri.endsWith('.json')) { + if (jsonUri && jsonUri.endsWith(".json")) { (async () => { try { const imageUrl = await fetchJsonMetadata(jsonUri); @@ -138,14 +138,13 @@ } } catch (error) { // eslint-disable-next-line no-console - console.error('Error in fetchJsonMetadata:', error); + console.error("Error in fetchJsonMetadata:", error); } })(); } else if (jsonUri) { metadata.image = jsonUri; } -} - + } $: tokenIsLoading = (address !== SOL && $asset?.isLoading) ||