Repository navigation
Load BSV-21 token icons through OrdFS with transforms - #82
Merged
Merged
Conversation
Token rows and token pages set the image src to the raw icon field, a bare outpoint, so the browser asked the site for a relative path and showed nothing. Icons now resolve to the chain's OrdFS content (txid_vout, txid.vout or _N on the deploy tx, or a trusted OrdFS URL) and go through /api/image resized for their tile. A failed load is logged and shows the coin. The market token page also no longer crashes when the stack answers null for a token with no listings.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
rohenaz
had a problem deploying
to
e2e-testnet
November 25, 2026 16:23 — with
GitHub Actions
Failure
The image API answers 502 with the error logged rather than a 200 placeholder SVG, so a page's onError sees the failure. Tokens with no icon show the coin instead of requesting their BSV-20 JSON deploy inscription. The market token page uses TokenIcon. Tiles carry their src so the e2e still checks it after a failed load swaps in the coin.
rohenaz
had a problem deploying
to
e2e-testnet
November 25, 2026 16:26 — with
GitHub Actions
Failure
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: the Tokens page rows and the BSV-21 token page used the raw
iconfield as the imagesrc, e.g.87f1d078…a00472_0. The browser requested a relative path on the site, so the icon was broken. Two other places also had problems:When processing failed,
/api/imageanswered 200 with an "Image Error" SVG. Pages couldn't detect the failure, and the error itself was dropped.After: every BSV-21 icon loads the chain's OrdFS content through
/api/image, resized for its tile:An icon that fails to load is logged and replaced by the coin. A token with no icon shows the coin; its deploy inscription is BSV-20 JSON, so there is nothing to request.
/api/imageprocessing failures now return 502 and log the full error. The market token page renders.How:
lib/bsv21-icon.tswithbsv21IconSrc(tokenId, icon, size, chain).txid_vout,txid.vout,_N(output N of the deploy tx) or a trusted OrdFS URL.stackContentUrlandgetCoverImageUrl.lib/p2p-bsv21-offer.ts, which now imports it. P2P offer images are unchanged.TokenIconat 80px.TokenIcongetsonError(log plus coin fallback) anddata-slot="token-icon"/data-icon-src.getBsv21Listingsreads the stack'snullanswer as no listings.Tests:
tests/bsv21-icon.test.tscovers bare outpoints,_N,txid.vout, testnet, trusted and rejected URLs, and the call sites.tests/bsv21-actions.test.tsadds a null-listings case./api/image, and a shown image must have pixels. The src is read from the tile, so a failed load that swapped in the coin is still checked.Local checks: bun test (1134 pass), tsc, biome, check-routes and build all pass. With
next startlocally, the VIBES market page renders/api/image?url=https://api.1sat.app/content/87f1…_0&w=160&h=160&q=80, which returned a 160×160 webp.