Skip to content

Commit

Permalink
Merge pull request #283 from helius-labs/fix/account-routing
Browse files Browse the repository at this point in the history
[Fix] QoL Update
  • Loading branch information
0xIchigo committed Feb 7, 2024
2 parents e615b8d + 8177e3e commit e55a752
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
17 changes: 8 additions & 9 deletions src/lib/components/providers/token-provider.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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 "";
}
};
Expand All @@ -129,7 +129,7 @@
metadata.name = name;
}
if (jsonUri && jsonUri.endsWith('.json')) {
if (jsonUri && jsonUri.endsWith(".json")) {
(async () => {
try {
const imageUrl = await fetchJsonMetadata(jsonUri);
Expand All @@ -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) ||
Expand Down
2 changes: 2 additions & 0 deletions src/lib/util/recognized-tokens.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { RecognizedTokens } from "$lib/types";

export const recognizedTokens: RecognizedTokens = {
BONK: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
FOXY: "FoXyMu5xwXre7zEoSvzViRk3nGawHUp9kUh97y2NDhcq",
SOL: "So11111111111111111111111111111111111111112",
USDC: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
};
2 changes: 1 addition & 1 deletion src/lib/xray/lib/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e55a752

Please sign in to comment.