Background
Wraith currently indexes fungible token transfers. CAP-46 NFT contracts on Soroban emit similar transfer events but with a token_id discriminator. Indexing them turns Wraith into the only Stellar NFT activity explorer.
What to build
Detect NFT contracts by ABI sniff (presence of metadata/owner_of functions), parse transfer(from, to, token_id) events, and store them in a new nft_transfers table alongside cached metadata.
Key files
wraith/src/ingester/ — event handler dispatch
- New:
wraith/src/ingester/nft.ts
- New: migration adding
nft_transfers and nft_metadata
Suggested execution
git checkout -b feat/nft-indexing
- After fetching a contract's events, sniff its ABI to decide token type (fungible vs NFT)
- For NFT contracts, decode
transfer(from, to, token_id) events
- Lazy-load metadata via
metadata(token_id) call when first seen — cache it
- Expose
/nfts/transfers?contract=…&token_id=… and /nfts/owners/:contract/:token_id
- Add tests with a known NFT contract on testnet
Example commit message:
feat(ingester): add CAP-46 NFT indexing with metadata caching
Acceptance criteria
Drips Wave · Complexity: High · 200 points
Comment below to request assignment. PR must include Closes #[this issue].
Background
Wraith currently indexes fungible token transfers. CAP-46 NFT contracts on Soroban emit similar
transferevents but with atoken_iddiscriminator. Indexing them turns Wraith into the only Stellar NFT activity explorer.What to build
Detect NFT contracts by ABI sniff (presence of
metadata/owner_offunctions), parsetransfer(from, to, token_id)events, and store them in a newnft_transferstable alongside cached metadata.Key files
wraith/src/ingester/— event handler dispatchwraith/src/ingester/nft.tsnft_transfersandnft_metadataSuggested execution
transfer(from, to, token_id)eventsmetadata(token_id)call when first seen — cache it/nfts/transfers?contract=…&token_id=…and/nfts/owners/:contract/:token_idExample commit message:
feat(ingester): add CAP-46 NFT indexing with metadata cachingAcceptance criteria