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

[Fix] QoL Update #283

Merged
merged 3 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading