Skip to content

OvertakeWin/web3-icons-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloudflare Worker: Token Icon API

A Cloudflare Worker that returns token/chain icons given a chain ID and contract address or symbol.

Parameters

Param Required Description
chainId yes EVM chain ID (e.g. 1, 8453)
address no* Token contract address, or 0 for native token
symbol no* Token symbol (e.g. USDC)
png no Set to true to convert SVG icons to PNG
bust no Set to true to bypass cache and re-fetch

*At least one of address or symbol is required.

Fallback Chain

Address onlyaddress=0x...

  1. web3icons (by address)
  2. TrustWallet (by address)

Symbol onlysymbol=USDC

  1. Alexandria (by symbol)
  2. web3icons (by symbol)

Bothaddress=0x...&symbol=USDC

  1. web3icons (by address)
  2. TrustWallet (by address)
  3. Alexandria (by symbol)
  4. web3icons (by symbol)

Native tokenaddress=0

  1. TrustWallet chain logo
  2. Alexandria chain SVG

Usage

GET /?chainId=1&address=0x6B175474E89094C44Da98b954EedeAC495271d0F
GET /?chainId=1&symbol=USDC
GET /?chainId=1&address=0x6B175474E89094C44Da98b954EedeAC495271d0F&symbol=DAI
GET /?chainId=1&address=0&bust=true
GET /?chainId=1&symbol=USDC&png=true

Deploy to Cloudflare

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 100.0%