INNER CODE UNIT · Python
actions_metadata
YichengYang-Ethan/oracle3 · oracle3/blinks/server.py:82
async def actions_metadata() -> JSONResponse:
return JSONResponse({
'rules': [
{'pathPattern': '/api/trade/**', 'apiPath': '/api/trade/**'},
],
})
@app.get('/api/trade/{market_ticker}')
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'