chore: adds digestId to client responses#8283
Merged
Conversation
joaosantos15
requested changes
Mar 25, 2026
Contributor
There was a problem hiding this comment.
MarketOverviewReport doesn't currently include an ID. We can add it, but it's not there atm.
REQ: https://digest.dev-api.cx.metamask.io/api/v1/market-overview
RES:
{
"report": {
"trends": [
{
"title": "Trump postpones Iran strikes",
"impact": "positive",
"articles": [
{
"url": "https://www.coindesk.com/markets/2026/03/23/bitcoin-surges-above-usd71-000-as-trump-postpones-iran-strikes-for-five-days",
"date": "2026-03-23",
"title": "Bitcoin price news: BTC surges 5% to $71,000 as Trump ...",
"source": "coindesk.com"
}
],
"category": "geopolitical",
"description": "President Trump delays US attacks on Iran's infrastructure, sparking a 5% surge in Bitcoin to $71,000 and gains in major cryptocurrencies. This eases short-term geopolitical tensions boosting risk assets.",
"relatedAssets": [
{
"name": "Bitcoin",
"caip19": [
"bip122:000000000019d6689c085ae165831e93/slip44:0",
"eip155:1/erc20:0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"eip155:43114/erc20:0x0555E30da8f98308EdB960aa94C0Db47230d2B9c",
"eip155:56/erc20:0x0555E30da8f98308EdB960aa94C0Db47230d2B9c",
"tron:728126428/trc20:TYhWwKpw43ENFWBTGpzLHn3882f2au7SMi",
"tron:mainnet/trc20:TYhWwKpw43ENFWBTGpzLHn3882f2au7SMi",
"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/spl:5XZw2LKTyrfvfiskJ78AMpackRjPcyCif1WhUsPDuVqQ",
"eip155:8453/erc20:0x1ceA84203673764244E05693e42E6Ace62bE9BA5",
"eip155:10/erc20:0x68f180fcCe6836688e9084f035309E29Bf0A2095",
"eip155:1/erc20:0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
"eip155:8453/erc20:0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/spl:cbbtcf3aa214zXHbiAZQwf4122FBYbraNdFqgw4iMij",
"eip155:42161/erc20:0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
"eip155:42161/erc20:0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",
"eip155:137/erc20:0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",
"eip155:43114/erc20:0x50b7545627a5162F82A992c33b87aDc75187B218",
"eip155:56/erc20:0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c"
],
"symbol": "BTC",
"hlPerpsMarket": "BTC",
"sourceAssetId": "bitcoin"
}
]
},
{
"title": "US crypto legislation stalls",
"impact": "negative",
"articles": [
{
"url": "https://www.reuters.com/business/finance/citigroup-cuts-12-month-bitcoin-ether-targets-us-crypto-legislation-stalls-2026-03-17",
"date": "2026-03-17",
"title": "Citigroup cuts 12-month bitcoin, ether targets as US crypto ...",
"source": "reuters.com"
}
],
"category": "regulatory",
"description": "US crypto regulatory bills stall in Congress, leading Citigroup to cut its 12-month Bitcoin price target to $112,000 and Ether to $3,175. Ongoing uncertainty hampers bullish forecasts.",
"relatedAssets": [
{
"name": "Bitcoin",
"caip19": [
"bip122:000000000019d6689c085ae165831e93/slip44:0",
"eip155:1/erc20:0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"eip155:43114/erc20:0x0555E30da8f98308EdB960aa94C0Db47230d2B9c",
"eip155:56/erc20:0x0555E30da8f98308EdB960aa94C0Db47230d2B9c",
"tron:728126428/trc20:TYhWwKpw43ENFWBTGpzLHn3882f2au7SMi",
"tron:mainnet/trc20:TYhWwKpw43ENFWBTGpzLHn3882f2au7SMi",
"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/spl:5XZw2LKTyrfvfiskJ78AMpackRjPcyCif1WhUsPDuVqQ",
"eip155:8453/erc20:0x1ceA84203673764244E05693e42E6Ace62bE9BA5",
"eip155:10/erc20:0x68f180fcCe6836688e9084f035309E29Bf0A2095",
"eip155:1/erc20:0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
"eip155:8453/erc20:0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/spl:cbbtcf3aa214zXHbiAZQwf4122FBYbraNdFqgw4iMij",
"eip155:42161/erc20:0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
"eip155:42161/erc20:0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",
"eip155:137/erc20:0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",
"eip155:43114/erc20:0x50b7545627a5162F82A992c33b87aDc75187B218",
"eip155:56/erc20:0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c"
],
"symbol": "BTC",
"hlPerpsMarket": "BTC",
"sourceAssetId": "bitcoin"
},
{
"name": "Ethereum",
"caip19": [
"eip155:1/slip44:60",
"eip155:1/erc20:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"tron:728126428/trc20:THb4CqiFdwNHsWsQCs4JhzwjMWys4aqCbF",
"tron:mainnet/trc20:THb4CqiFdwNHsWsQCs4JhzwjMWys4aqCbF",
"eip155:42161/slip44:60",
"eip155:42161/erc20:0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
"eip155:10/slip44:60",
"eip155:10/erc20:0x4200000000000000000000000000000000000006",
"eip155:8453/slip44:60",
"eip155:8453/erc20:0x4200000000000000000000000000000000000006",
"eip155:59144/slip44:60",
"eip155:59144/erc20:0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f",
"eip155:324/slip44:60",
"eip155:324/erc20:0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91",
"eip155:534352/slip44:60",
"eip155:534352/erc20:0x5300000000000000000000000000000000000004",
"eip155:81457/slip44:60",
"eip155:81457/erc20:0x4300000000000000000000000000000000000004",
"eip155:1101/slip44:60",
"eip155:1101/erc20:0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9",
"eip155:137/erc20:0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
"eip155:43114/erc20:0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",
"eip155:56/erc20:0x2170Ed0880ac9A755fd29B2688956BD959F933F8",
"eip155:42220/erc20:0xD221812de1BD094f35587EE8E174B07B6167D9Af",
"eip155:100/erc20:0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1",
"eip155:314/erc20:0x522B61755b5FF8176B2931DA7bF1a5F9414Eb710"
],
"symbol": "ETH",
"hlPerpsMarket": "ETH",
"sourceAssetId": "ethereum"
}
]
},
{
"title": "Institutions adopt DeFi and Solana tools",
"impact": "positive",
"articles": [
{
"url": "https://www.coindesk.com/business/2026/03/24/crypto-finance-is-beginning-to-look-at-lot-more-traditional-aave-and-ethena-founders-say",
"date": "2026-03-24",
"title": "Crypto finance is beginning to look at lot more traditional, Aave and ...",
"source": "coindesk.com"
},
{
"url": "https://www.theblock.co/post/394756/mastercard-western-union-tap-solana-foundations-new-enterprise-developer-toolbox",
"date": "2026-03-24",
"title": "Mastercard, Western Union tap Solana Foundation's new enterprise ...",
"source": "theblock.co"
},
{
"url": "https://www.coindesk.com/opinion/2026/03/21/how-defi-is-quietly-rebuilding-the-fixed-income-stack-for-institutional-capital",
"date": "2026-03-21",
"title": "How DeFi is quietly rebuilding the fixed-income stack for institutional ...",
"source": "coindesk.com"
}
],
"category": "macro",
"description": "DeFi protocols gain traction with traditional firms as Aave and Ethena draw interest, and Mastercard plus Western Union use Solana's enterprise developer toolbox. This bridges institutional capital to crypto ecosystems.",
"relatedAssets": [
{
"name": "Ethereum",
"caip19": [
"eip155:1/slip44:60",
"eip155:1/erc20:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"tron:728126428/trc20:THb4CqiFdwNHsWsQCs4JhzwjMWys4aqCbF",
"tron:mainnet/trc20:THb4CqiFdwNHsWsQCs4JhzwjMWys4aqCbF",
"eip155:42161/slip44:60",
"eip155:42161/erc20:0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
"eip155:10/slip44:60",
"eip155:10/erc20:0x4200000000000000000000000000000000000006",
"eip155:8453/slip44:60",
"eip155:8453/erc20:0x4200000000000000000000000000000000000006",
"eip155:59144/slip44:60",
"eip155:59144/erc20:0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f",
"eip155:324/slip44:60",
"eip155:324/erc20:0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91",
"eip155:534352/slip44:60",
"eip155:534352/erc20:0x5300000000000000000000000000000000000004",
"eip155:81457/slip44:60",
"eip155:81457/erc20:0x4300000000000000000000000000000000000004",
"eip155:1101/slip44:60",
"eip155:1101/erc20:0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9",
"eip155:137/erc20:0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
"eip155:43114/erc20:0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",
"eip155:56/erc20:0x2170Ed0880ac9A755fd29B2688956BD959F933F8",
"eip155:42220/erc20:0xD221812de1BD094f35587EE8E174B07B6167D9Af",
"eip155:100/erc20:0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1",
"eip155:314/erc20:0x522B61755b5FF8176B2931DA7bF1a5F9414Eb710"
],
"symbol": "ETH",
"hlPerpsMarket": "ETH",
"sourceAssetId": "ethereum"
},
{
"name": "Solana",
"caip19": [
"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501",
"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/spl:So11111111111111111111111111111111111111112"
],
"symbol": "SOL",
"hlPerpsMarket": "SOL",
"sourceAssetId": "solana"
}
]
}
],
"version": "1.0",
"metadata": [
{
"provider": "xAI"
}
],
"generatedAt": "2026-03-25T08:00:39.704Z"
},
"generatedAt": "2026-03-25T08:00:39.808Z",
"processingTime": 35589,
"success": true,
"error": null,
"createdAt": "2026-03-25T08:00:39.815Z",
"updatedAt": "2026-03-25T08:00:39.815Z"
}…Mask/core into TSA-add-digestId-to-client-response
joaosantos15
approved these changes
Mar 25, 2026
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.
Explanation
The
/asset-summaryand/market-overviewAPI endpoints always return responses wrapped in an{ id, digest }/{ id, report }envelope whereidis a unique UUID identifying the digest. This PR updatesAiDigestServiceto require that envelope shape (removing the bare-response fallback path), extractsidand exposes it asdigestIdon bothMarketInsightsReportandMarketOverview, and makesdigestIda required field on both types. This enables downstream consumers like MM app to include adigest_idproperty in analytics events.References
Checklist
Note
Medium Risk
Introduces a breaking response-shape/type change by no longer accepting bare
/asset-summarypayloads and makingdigestIdrequired, which can break downstream consumers and tests that still expect the old shape.Overview
AI digest client responses now surface the API-provided digest UUID.
AiDigestService.searchDigestnow only accepts the{ id, digest }envelope for/asset-summary, validatesid, and returns the digest withidexposed as a requireddigestId.Tests are updated to mock enveloped responses and assert
digestIdis present, and theai-controllerschangelog documents the new required field and the removal of the bare-response fallback.Written by Cursor Bugbot for commit c0f3977. This will update automatically on new commits. Configure here.