Function: getTokenImageUrl()
Gala Launchpad SDK 9.0.0-rc.5 / index / getTokenImageUrl
Function: getTokenImageUrl()
getTokenImageUrl(
tokenName,baseUrl):string
Defined in: packages/launchpad-sdk/dist/utils/assetUrls.d.ts:105
Get redirect URL for a token image
Retrieves the main token image/logo. This is the primary visual representation of the token shown throughout the UI.
Backend: Redirects to S3 if available, otherwise returns placeholder.
Parameters
tokenName
string
Token name (lowercase, e.g., 'anime', 'GUSDC')
baseUrl
string
API base URL (e.g., 'https://api.example.com')
Returns
string
Full redirect URL to token image
Throws
Error if token name is invalid or empty
Example
const imageUrl = getTokenImageUrl('anime', 'https://api.example.com');
// → "https://api.example.com/v1/tokens/anime/assets/image"
// Fetch the image (will redirect to S3)
const response = await fetch(imageUrl);
const blob = await response.blob();
const imageElement = document.querySelector('img');
if (imageElement) {
imageElement.src = URL.createObjectURL(blob);
}
Since
7.3.0