Skip to content

feat: preloaded token list with icons, private tokens, show/hide toggle, and remote mainnet fetch#129

Open
plucena-coti wants to merge 3 commits into
coti-io:mainfrom
plucena-coti:feat-token-list
Open

feat: preloaded token list with icons, private tokens, show/hide toggle, and remote mainnet fetch#129
plucena-coti wants to merge 3 commits into
coti-io:mainfrom
plucena-coti:feat-token-list

Conversation

@plucena-coti

@plucena-coti plucena-coti commented Apr 6, 2026

Copy link
Copy Markdown

Changes

Token List (Remote Fetch)

  • Remove static PRELOADED_TOKENS constant — tokens are now fetched from the coti-io/coti-token-list GitHub repo
  • Mainnet: fetches from coti-mainnet branch, Testnet: fetches from coti-testnet branch
  • Use logoURI from the remote list for all token icons (removed local SVG icon mapping and assets)
  • Use private attribute from the remote list to determine private tokens (defaults to public if missing)
  • Fix resolveSnapId fallback to only match COTI snaps (prevents resolving to unrelated snaps like institutional-wallet-snap)
  • Fix Cross-Origin-Embedder-Policy from require-corp to credentialless to allow external token icon images

Google Tag Manager (GTM)

  • Add Vite plugin to conditionally inject GTM scripts (GTM-NVHGTMPD) at build time
  • GTM is only included in production builds from the main branch (controlled by VITE_ENABLE_GTM env var)
  • Update Content-Security-Policy in index.html to allow googletagmanager.com
  • Add site build step to publish-snap workflow with VITE_ENABLE_GTM=true
  • Local dev and feature branch builds do NOT include GTM

@plucena-coti
plucena-coti force-pushed the feat-token-list branch 2 times, most recently from 30b306b to 8123598 Compare April 7, 2026 11:59
@plucena-coti

Copy link
Copy Markdown
Author

@gmesika-coti please approve

- Add Vite plugin to conditionally inject GTM scripts at build time
- GTM is only included when VITE_ENABLE_GTM=true (set in main branch CI)
- Update CSP in index.html to allow googletagmanager.com
- Add site build step to publish workflow with GTM enabled
- GTM ID: GTM-NVHGTMPD
@plucena-coti

Copy link
Copy Markdown
Author

@gmesika-coti please approve

@gmesika-coti

Copy link
Copy Markdown
Member

not good.

  1. the tokens dont have a private version of the png
  2. they are hard coded when we disscussed that thier address will be fetched from the token list - also why not fetch the token icon online?
  3. please prepare a PR for the GTM that is not with the token list

@plucena-coti

Copy link
Copy Markdown
Author

@gmesika-coti as history shows the previous PR already included the fetching of tokens from token-list. There was a fallback option to use the static list in case the token-list was unavailable. This fallback static list was now removed. Also improved the token icon loading and included the private/public filters based on token-list PR.

Please approve. I can dismantle this into two separate PRs, but code wisely, it would be simpler if we could move those 2 items together.

Thanks

@plucena-coti
plucena-coti force-pushed the feat-token-list branch 2 times, most recently from 3cf5c0d to 14a2c08 Compare May 28, 2026 09:50
@plucena-coti

Copy link
Copy Markdown
Author

@gmesika-coti please review

@gmesika-coti

Copy link
Copy Markdown
Member

you should change in the token-list the flag to private on the token and then change it here from isPrivate to private? becuase it is optional

) : (
token.symbol[0]
)}
{token.isPrivate && (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change it to private?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, token list is now updated to isPrivate

- Remove static PRELOADED_TOKENS constant and file
- Fetch tokens from coti-io/coti-token-list GitHub repo (mainnet/testnet)
- Use logoURI from remote list for all token icons
- Use isPublic attribute from remote list to determine private tokens
- Remove local SVG icon mapping from TokenRow (use remote icons)
- Fix resolveSnapId fallback to only match COTI snaps
- Fix Cross-Origin-Embedder-Policy to allow external images (credentialless)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants