trezor-suite icon indicating copy to clipboard operation
trezor-suite copied to clipboard

feat(crypto-icons): download crypto icons from Coingecko

Open FreeWall opened this issue 1 year ago • 7 comments

Description

  • download crypto icons from Coingecko and upload it to aws s3
  • icons resized into two sizes (24px, 48px), webp format
  • naming: [coingeckoId].webp or [platform]_[contract_address].webp

Related Issue

Resolve

Screenshots:

FreeWall avatar Jun 03 '24 10:06 FreeWall

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
Shell access npm/[email protected] 🚫
Unpopular package npm/[email protected] 🚫

View full report↗︎

Next steps

What is shell access?

This module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.

Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced.

What are unpopular packages?

This package is not very popular.

Unpopular packages may have less maintenance and contain other problems.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

socket-security[bot] avatar Jun 03 '24 10:06 socket-security[bot]

Please take a look.

How long will it run for? Will it be faster after the initial download and upload?

I implemented max time limit of 60 minutes for this script, which should run every day. We want to regularly update all icons and in order to check the coin image, request to coingecko needs to be made first, so it won't be faster next time.

FreeWall avatar Jun 21 '24 09:06 FreeWall

Can we implement it so it does not download the image we already have for a certain time period? I feel like it's wasting API limits and CI resources if we download whatever number of images every day. Otherwise, it should be fine.

vdovhanych avatar Jun 21 '24 10:06 vdovhanych

What are the limits suitable for you? I think I can lower the "limit per minute" from 60 to 30, so the whole cycle will complete in ~10 days.

FreeWall avatar Jun 24 '24 04:06 FreeWall

I dont really care if its 60 or 30 i was just asking if we download the same images every single time we run the script and how long does it need to run for the images to be uploaded, if we run it every day do we need to download all of the imagease again or just any new ones?

i just dont want to download stuff if we already have it...

vdovhanych avatar Jun 24 '24 20:06 vdovhanych

Icons of specific coins/tokens may change during time, so we need to download the existing ones again as well. About the upload, I'm not really sure how long it will take, it's about 8000 files (1 KB each) per github action run. If the upload is bottleneck, I could implement some file content comparison of existing icons, but it may increase CI resources too.

FreeWall avatar Jun 25 '24 04:06 FreeWall

ok, cron trigger removed

FreeWall avatar Jul 02 '24 10:07 FreeWall

Have all the relevant token icons downloaded already ? I can't find them, only the network/coin ones.

ffrediani avatar Aug 03 '24 02:08 ffrediani