بنقرة واحدة
context-build-market-widget
Build an embeddable single-market prediction widget with buy/sell buttons
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Build an embeddable single-market prediction widget with buy/sell buttons
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Create, cancel, or manage multiple orders in a single batch
Place and manage prediction market orders on Context Markets
Build a portfolio dashboard showing positions, P&L, balances, and claimable winnings
Build prediction market frontends with the Context React SDK
Scaffold a full prediction market trading UI with market list, orders, and portfolio
Find interesting prediction markets by volume, trend, liquidity, or topic
| name | context-build-market-widget |
| description | Build an embeddable single-market prediction widget with buy/sell buttons |
Build a self-contained, embeddable component that shows a single market with price, oracle context, and one-click trading.
The user wants to embed a prediction market into an existing page — a compact component showing price, oracle context, and a buy button.
Self-contained provider wrapper — if embedding outside a Context app, the widget needs its own provider stack:
function MarketWidget({ marketId, apiKey }: { marketId: string; apiKey: string }) {
return (
<WagmiProvider config={wagmiConfig}>
<QueryClientProvider client={queryClient}>
<ContextProvider apiKey={apiKey}>
<WidgetContent marketId={marketId} />
</ContextProvider>
</QueryClientProvider>
</WagmiProvider>
)
}
Market display — useMarket(marketId) for question text, useQuotes(marketId) for current prices.
Oracle badge — use useOracle(marketId) for the oracle summary and useLatestOracleQuote(marketId) if you want a numeric oracle quote alongside the market price.
Trade preview — useSimulateTrade(marketId, params) to show estimated fill as the user adjusts the amount slider.
One-click trade — useCreateMarketOrder() for instant execution at market price. Show the simulation result before confirming.
Balance display — useBalance() to show available funds. Disable buy button if insufficient.
ContextProvider is always required.apiKey in ContextProvider is sent to the browser. Use a read-only key if the widget is public.useAccount() from wagmi.useQuotes is enough for display. Only fetch useOrderbook if showing depth.isLoading and error — show appropriate UI for each.