MCPcopy Index your code
hub / github.com/SmolDapp/tokenAssets

github.com/SmolDapp/tokenAssets @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
16 symbols 41 edges 8 files 3 documented · 19%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Token Assets

The goal of this project is to unify the cryptocurrency token assets under one CDN with pragmatic access.

The CDN supports SVG and PNGs (small, larger).

Usage

Currently the API/CDN endpoint is at:

https://assets.smold.app/api/token/[chainID]/[tokenAddress]/[fileName].[ext]

Usage

It's recommended to use PNG files. They are smaller and faster to load, come in two sizes (32x32 and 128x128) and are supported by all browsers. SVG files are also available, but they are larger and slower to load and can hurt performances for poorly optimized assets or very complex ones (ex: curvefi icon).

(Self) Hosting

The repo comes with two different server systems in _config:

  • a golang server, that serve the assets from github
  • a node server, configured to work with Vercel. If you want to self host, here is the config we are using:
Framework Preset: Next.js
Build Command: yarn --cwd _config/nodeAPI/ run build
Output Directory: _config/nodeAPI/.next
Install Command: yarn install && yarn --cwd _config/nodeAPI/ install
Development Command: next
Node Version: 18.x
Environment Variables: None

Supported chains

  • 1: Ethereum
  • 10: Optimism
  • 56: BSC
  • 100: Gnosis
  • 130: Unichain
  • 137: Polygon
  • 223: BSquared
  • 250: Fantom
  • 252: Fraxtal
  • 957: Derive
  • 964: Subtensor EVM
  • 1101: Polygon zkEVM
  • 1135: Lisk
  • 1750: Metal L2
  • 1868: Soneium
  • 1923: Swellchain
  • 5330: Superseed
  • 8453: Base
  • 34443: Mode
  • 42161: Arbitrum
  • 42220: Celo
  • 43114: Avalanche
  • 57073: Ink
  • 60808: BOB
  • 81457: Blast
  • 98866: Plume
  • 1380012617: Rari
  • 1151111081099710: Solana
  • btcm: Bitcoin

Contributing

You will need an SVG file of the logo of the asset. You can use Inkscape or a web tool like https://cloudconvert.com/svg-to-png to convert the SVG file into the PNGs.

With Inkscape you can run:

$ inkscape -w 128 -h 128 logo.svg -o logo-128.png
$ inkscape -w 32 -h 32 logo.svg -o logo-32.png

You can also use rsvg-convert from the librsvg2 package:

$ rsvg-convert -w 128 -h 128 logo.svg > logo-128.png
$ rsvg-convert -h 32 logo.svg > logo-32.png

$ rsvg-convert -h 32 logo.svg > logo-32.png && rsvg-convert -h 128 logo.svg > logo-128.png

Once ready, create a new directory with the chain ID, or use the existing one, and create a new directory for the token address (in lower case for EVM chains, or case sensitive for Solana) you are adding.

Fill-in the details when creating the pull-request, and we'll merge it shortly!

That's it, thank you!

Core symbols most depended-on inside this repo

ContainsSubString
called by 3
_config/goAPI/helpers.go
resolveNotFound
called by 2
_config/nodeAPI/app/api/token/[chainID]/[tokenAddress]/[filename]/route.ts
resolveGasToken
called by 2
_config/nodeAPI/app/api/token/[chainID]/[tokenAddress]/[filename]/route.ts
resolveNotFound
called by 2
_config/nodeAPI/app/api/chain/[chainID]/[filename]/route.ts
resolveNotFound
called by 2
_config/goAPI/serveToken.go
EndsWithSubstring
called by 1
_config/goAPI/helpers.go
resolveGasToken
called by 1
_config/goAPI/serveToken.go
accessLogger
called by 1
_config/goAPI/main.go

Shape

Function 16

Languages

Go62%
TypeScript38%

Modules by API surface

_config/goAPI/main.go4 symbols
_config/nodeAPI/app/api/token/[chainID]/[tokenAddress]/[filename]/route.ts3 symbols
_config/goAPI/serveToken.go3 symbols
_config/nodeAPI/app/api/chain/[chainID]/[filename]/route.ts2 symbols
_config/goAPI/helpers.go2 symbols
_config/nodeAPI/next.config.js1 symbols
_config/goAPI/serveChain.go1 symbols

For agents

$ claude mcp add tokenAssets \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact