This repository uses a CLI tool (cli-update-asset.js) to manage contract metadata and icons following the CAIP-19 standard.
Use the set command to add a new asset or update an existing one:
# Add a new asset with all required fields
npm run asset:set -- \
--caip "eip155:1/erc20:0xTOKEN_ADDRESS" \
--name "Token Name" \
--symbol "SYMBOL" \
--decimals 18 \
--image ./path/to/logo.svg
# Add or update labels for an asset
npm run asset:set -- \
--caip "eip155:1/erc20:0xTOKEN_ADDRESS" \
--labels "stable_coin,blue_chip"
# Or use a direct URL for the image
npm run asset:set -- \
--caip "eip155:1/erc20:0xTOKEN_ADDRESS" \
--name "Token Name" \
--symbol "SYMBOL" \
--decimals 18 \
--image "https://example.com/logo.png"
# Update only specific fields of an existing asset
npm run asset:set -- \
--caip "eip155:1/erc20:0xTOKEN_ADDRESS" \
--name "Updated Token Name"
# Update just the image
npm run asset:set -- \
--caip "eip155:1/erc20:0xTOKEN_ADDRESS" \
--image ./new-logo.svgParameters:
--caip: CAIP-19 identifier (required) - Format:namespace:chainId/assetNamespace:assetReference--name: Token name (required for new assets)--symbol: Token symbol (required for new assets)--decimals: Number of decimals (required for new assets)--image: Path to image file or URL (required for new assets)- Supports:
.svg,.png,.jpg,.jpeg - Can be a local file path or HTTP/HTTPS URL
- Supports:
--labels: Labels for the asset (optional)- Comma-separated values (example:
stable_coin,blue_chip) - Or JSON array (example:
["stable_coin","blue_chip"])
- Comma-separated values (example:
--erc20: Set totrueorfalse(optional, auto-detected forerc20:prefix)--spl: Set totrueorfalse(optional, auto-detected forspl:prefix)
CAIP-19 Examples:
- Ethereum Mainnet:
eip155:1/erc20:0x6B175474E89094C44Da98b954EedeAC495271d0F - Polygon:
eip155:137/erc20:0xTOKEN_ADDRESS - Solana:
solana:mainnet/spl:TOKEN_ADDRESS
Check if an asset's metadata and icon files are valid:
npm run asset:verify -- \
--caip "eip155:1/erc20:0xTOKEN_ADDRESS"List all assets in a specific namespace:
# List all Ethereum Mainnet assets
npm run asset:list -- --namespace "eip155:1"
# List all Polygon assets
npm run asset:list -- --namespace "eip155:137"- Add or update an asset using
npm run asset:set - Verify the changes using
npm run asset:verify - Rebuild the contract-map.json:
node buildindex.js - Review the changes in git
- Commit and push your changes
The tool automatically manages:
- Metadata files:
metadata/{namespace}/{assetId}.json - Icon files:
icons/{namespace}/{assetId}.{ext}
- The tool validates all inputs using Zod schemas
- Icon files are automatically renamed to match the asset ID
- Old icons are removed when updating with a new image
- The
erc20andsplfields are auto-detected based on the asset namespace - Images from URLs are downloaded and saved with the correct extension