Repository navigation
fix: replace dead tokensupply.singularitynet.io supply endpoints (#102) - #158
Merged
h2physics merged 1 commit intoSep 14, 2026
Merged
Conversation
…wap#102) Three verified tokens (Rejuve RJV, NuNet NTX, SingularityNet AGIX) pointed their maxSupply / circulatingOnChain fields at the now-deprecated tokensupply.singularitynet.io API. getAmountFromURL() fetches that URL and returns null on non-numeric HTML, so getMarketCapInfo() returns the null response and these assets show no market cap. Replace with stable, in-repo values: maxSupply -> documented total supply as a raw-unit integer circulatingOnChain -> the on-chain asset id, which getAmountFromArray() already resolves via getOnchainAmountOfAsset() (BlockFrost assetsById -> quantity) to the live on-chain total. This is the same mechanism healthy tokens use and removes the external-URL dependency entirely.
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.
Closes #102.
Three verified tokens still pointed their supply fields at the now-deprecated
tokensupply.singularitynet.ioAPI, which returns non-numeric HTML.getAmountFromURL()therefore returnsnull, andMarketCapApi.getMarketCapInfo()short-circuits to the null response — so Rejuve (RJV), NuNet (NTX) and SingularityNet (AGIX) currently render no market cap / circulating supply.Change
For each of the three files (
8cfd6893…524a56,edfd7a1d…e5458,f43a62fd…474958):maxSupply: dead URL → documented total supply as a raw-unit integer (RJV1e9, NTX1e9, AGIX2e9human ×10^decimals). Matches the existing convention for the ~89 tokens that store a numericmaxSupply.circulatingOnChain: dead URL → the on-chain asset id.getAmountFromArray()already resolves a bare asset id viagetOnchainAmountOfAsset()(BlockFrostassetsById→quantity) to the live on-chain total — the same mechanism healthy tokens use. This is more accurate than a cached third-party number and removes the external-URL dependency entirely.No code changes; only the three token YAMLs.
maxSupply(number|string) and acirculatingOnChainasset-id item both satisfytokenSchema(verified againstASSET_ID_REGEXand thegetAmountFromArraydispatch).Notes