Generalize assets URL by chainId; change trustwallet image to reflect new directory structure

This commit is contained in:
Willian Mitsuda 2022-02-25 16:06:10 -03:00
parent c650c2f819
commit 3f503ab317
2 changed files with 2 additions and 4 deletions

View File

@ -10,7 +10,7 @@ RUN npm run build
FROM alpine:3.14.0 AS logobuilder
RUN apk add imagemagick parallel
WORKDIR /assets
COPY trustwallet/blockchains/ethereum/assets /assets/
COPY trustwallet/blockchains/ethereum/assets /assets/1/
RUN find . -name logo.png | parallel magick convert {} -filter Lanczos -resize 32x32 {}
FROM alpine:3.14.0 AS fourbytesbuilder

View File

@ -9,13 +9,11 @@ export const fourBytesURL = (
export const topic0URL = (assetsURLPrefix: string, topic0: string): string =>
`${assetsURLPrefix}/topic0/${topic0}`;
// TODO: generalize URL
export const tokenLogoURL = (
assetsURLPrefix: string,
chainId: number,
address: string
): string => `${assetsURLPrefix}/assets/${address}/logo.png`;
// ): string => `${assetsURLPrefix}/assets/${chainId}/${address}/logo.png`;
): string => `${assetsURLPrefix}/assets/${chainId}/${address}/logo.png`;
export const blockURL = (blockNum: BlockTag) => `/block/${blockNum}`;