INNER CODE UNIT · Python
get_action
YichengYang-Ethan/oracle3 · oracle3/blinks/server.py:90
async def get_action(market_ticker: str) -> JSONResponse:
"""Return Solana Action metadata for a prediction market."""
if not _MARKET_TICKER_RE.match(market_ticker):
raise HTTPException(
status_code=400,
detail='market_ticker must be alphanumeric/underscores/hyphens, max 100 chars',
)
title = f'Trade: {market_ticker}'
description = f'Trade prediction market {market_ticker} on DFlow/Solana'
# Check cache first
cached = _get_cached_market(market_ticker)
if cached is not None:
title = cached['title']
description = cached['description']
else:
try: