Skip to main content

index/functions/getTokenAnimatedUrl.md

getTokenAnimatedUrl(tokenName, baseUrl, extension?): string

Get redirect URL for a token animated asset

Animated version of the token image (e.g., GIF or WebP with animation). Used in UI where motion attracts attention.

Backend: Redirects to S3 if available, otherwise returns static placeholder.

Parameters​

ParameterTypeDescription
tokenNamestringToken name (lowercase)
baseUrlstringAPI base URL
extension?stringFile extension (optional, default: 'gif')

Returns​

string

Full redirect URL to animated token image

Throws​

Error if token name is invalid or extension format is incorrect

Example​

const animUrl = getTokenAnimatedUrl('anime', 'https://api.example.com', 'webp');
// → "https://api.example.com/v1/tokens/anime/assets/animated.webp"

Since​

7.3.0