Skip to main content

PredictController Actions

62 actions registered.

NameDeprecated
beforePublish
beforeSign
claimWithConfirmation
clearActiveOrder
clearActiveOrderTransactionId
clearOrderError
clearPendingDeposit
clearWithdrawTransaction
confirmClaim
depositWithConfirmation
enterPayWithAnyToken
getAccountState
getActivity
getBalance
getConnectionStatus
getCryptoPriceHistory
getCryptoTargetPrice
getMarket
getMarkets
getMarketSeries
getPositions
getPriceHistory
getPrices
getState
getUnrealizedPnL
initPayWithAnyToken
isWithdrawGasFeeTokenAvailable
listFilterOptions
listMarkets
onPlaceOrderSuccess
placeOrder
prepareWithdraw
previewOrder
publish
refreshEligibility
searchMarkets
selectPaymentToken
setSelectedPaymentToken
subscribeToConnectionStatus
subscribeToCryptoPrices
subscribeToGameUpdates
subscribeToMarketPrices
subscribeToOrderbook
trackActivityViewed
trackBannerAction
trackBetslipDismissed
trackCategoryClicked
trackFeedFilterChanged
trackFeedTabChanged
trackFeedViewed
trackGeoBlockTriggered
trackHomeSectionInteraction
trackHomeViewed
trackMarketDetailsOpened
trackPortfolioPositionsButtonTapped
trackPortfolioTransactionInitiated
trackPositionsScreenViewed
trackPositionsTabViewed
trackPositionViewed
trackPredictOrderEvent
trackSearchInteracted
trackShareAction

PredictController:beforePublish​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:418

Handler signature:

(request: {
transactionMeta: TransactionMeta;
}) => Promise<boolean>

PredictController:beforeSign​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:423

Handler signature:

(request: {
transactionMeta: TransactionMeta;
}) => Promise<
| {
updateTransaction?: (transaction: TransactionMeta) => void;
}
| undefined
>

PredictController:claimWithConfirmation​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:217

Handler signature:

(params: ClaimParams) => Promise<PredictClaim>

PredictController:clearActiveOrder​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:349

Handler signature:

() => void

PredictController:clearActiveOrderTransactionId​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:326

Handler signature:

() => void

PredictController:clearOrderError​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:316

Handler signature:

() => void

PredictController:clearPendingDeposit​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:379

Handler signature:

() => void

PredictController:clearWithdrawTransaction​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:433

Handler signature:

() => void

PredictController:confirmClaim​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:222

Handler signature:

({ address }: { address?: string }) => void

PredictController:depositWithConfirmation​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:359

Handler signature:

(_params: PrepareDepositParams) => Promise<Result<{ batchId: string }>>

PredictController:enterPayWithAnyToken​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:344

Moves an active buy order from PREVIEW to PAY_WITH_ANY_TOKEN without setting an ERC-20 selectedPaymentToken (used when funding from Money Account, whose pay token lives on TransactionPayController).

Also clears any stale ERC-20 selectedPaymentToken so subsequent order analytics and failure banners do not attribute the buy to a previous token.

Handler signature:

({
clearError = true,
}: { clearError?: boolean }) => void

PredictController:getAccountState​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:384

Handler signature:

(params: GetAccountStateParams) => Promise<AccountState>

PredictController:getActivity​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:66

Handler signature:

(params: GetActivityParams) => Promise<PredictActivityPage>

PredictController:getBalance​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:389

Handler signature:

(params: GetBalanceParams) => Promise<number>

PredictController:getConnectionStatus​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:311

Gets the current WebSocket connection status for live data feeds.

Returns: Connection status for sports, market, and RTDS data WebSocket channels

Handler signature:

() => ConnectionStatus

PredictController:getCryptoPriceHistory​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:51

Handler signature:

(params: GetCryptoPriceHistoryParams) => Promise<CryptoPriceHistoryPoint[]>

PredictController:getCryptoTargetPrice​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:41

Handler signature:

(params: GetCryptoTargetPriceParams & { eventId: string }) => Promise<number | null>

PredictController:getMarket​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:31

Get detailed information for a single market

Handler signature:

({
marketId,
}: {
marketId: string | number;
}) => Promise<PredictMarket>

PredictController:getMarkets​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:8

Handler signature:

(params: GetMarketsParams) => Promise<GetMarketsResult>

PredictController:getMarketSeries​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:36

Handler signature:

(params: GetSeriesParams) => Promise<PredictMarket[]>

PredictController:getPositions​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:61

Handler signature:

(params: GetPositionsParams) => Promise<PredictPosition[]>

PredictController:getPriceHistory​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:46

Handler signature:

(params: GetPriceHistoryParams) => Promise<PredictPriceHistoryPoint[]>

PredictController:getPrices​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:56

Handler signature:

(params: GetPriceParams) => Promise<GetPriceResponse>

PredictController:getState​

Source: app/components/UI/Predict/controllers/PredictController.ts:421

The action which can be used to retrieve the state of the PredictController.

Handler signature:

() => PredictControllerState

PredictController:getUnrealizedPnL​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:71

Handler signature:

({
address,
}: {
address?: string;
}) => Promise<UnrealizedPnL>

PredictController:initPayWithAnyToken​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:374

Prepares and submits a deposit transaction batch using the predictDepositAndOrder transaction type. This triggers the new deposit-and-order confirmation screen instead of the standard deposit screen.

The flow reuses provider.prepareDeposit but overrides the transaction type so the confirmation routing in info-root.tsx renders PredictPayWithAnyTokenInfo.

Handler signature:

() => Promise<Result<{ batchId: string }>>

PredictController:isWithdrawGasFeeTokenAvailable​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:408

Checks whether the gas station can pay a withdraw of amountRaw in pUSD.

The withdraw confirmation simulates an unsigned pUSD.transfer from the EOA, which holds no pUSD, so its gas fee token list is always empty before beforeSign swaps in the Safe call. This quotes gas fee tokens for the real Safe call instead. Deposit-wallet withdraws always return true because the relayer pays their gas.

Parameters:

NameDescription
paramsThe parameters.
params.addressThe EOA that owns the Predict account.
params.amountRawThe pUSD amount to withdraw, in raw units.

Returns: true when pUSD can pay the withdraw gas.

Handler signature:

({
address,
amountRaw,
}: {
address: string;
amountRaw: string;
}) => Promise<boolean>

PredictController:listFilterOptions​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:18

Handler signature:

(params: PredictFilterOptionsParams) => Promise<PredictFilterOption[]>

PredictController:listMarkets​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:13

Handler signature:

(params: PredictMarketListParams) => Promise<PredictMarketListResponse>

PredictController:onPlaceOrderSuccess​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:321

Handler signature:

() => void

PredictController:placeOrder​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:212

Handler signature:

(params: PlaceOrderParams) => Promise<Result>

PredictController:prepareWithdraw​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:413

Handler signature:

(_params: PrepareWithdrawParams) => Promise<Result<string>>

PredictController:previewOrder​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:207

Handler signature:

(params: PreviewOrderParams) => Promise<OrderPreview>

PredictController:publish​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:428

Handler signature:

(request: {
transactionMeta: TransactionMeta;
}) => Promise<{ transactionHash?: string }>

PredictController:refreshEligibility​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:238

Refresh eligibility status.

Concurrent callers share one in-flight request. A confirmed eligible / ineligible result stays in state while a re-check is in flight, so a routine foreground refresh or a slow geoblock check never blocks a user who was already confirmed; only the first check (or a retry after unavailable) reports checking. A definitive result requires a country; failures and incomplete responses become unavailable so they are never described as a geo-restriction.

Handler signature:

() => Promise<PredictEligibility>

PredictController:searchMarkets​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:23

Handler signature:

(params: SearchMarketsParams) => Promise<{ markets: PredictMarket[]; totalResults: number }>

PredictController:selectPaymentToken​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:331

Handler signature:

(token: AssetType | null) => void

PredictController:setSelectedPaymentToken​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:354

Handler signature:

(token: PredictControllerState['selectedPaymentToken']) => void

PredictController:subscribeToConnectionStatus​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:301

Subscribes to WebSocket connection-status changes for live data feeds. The callback fires immediately with the current status and thereafter only on real transitions, replacing per-subscriber polling.

Parameters:

NameDescription
callbackFunction invoked with the current ConnectionStatus.

Returns: Unsubscribe function to clean up the subscription.

Handler signature:

(callback: ConnectionStatusCallback) => () => void

PredictController:subscribeToCryptoPrices​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:288

Subscribes to real-time crypto price updates via RTDS WebSocket.

Parameters:

NameDescription
symbolsArray of crypto symbols to subscribe to (e.g., ['btcusdt'])
callbackFunction invoked when a crypto price update is received

Returns: Unsubscribe function to clean up the subscription

Handler signature:

(symbols: string[], callback: CryptoPriceUpdateCallback, options?: CryptoPriceSubscriptionOptions) => () => void

PredictController:subscribeToGameUpdates​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:250

Subscribes to real-time game updates via WebSocket.

Parameters:

NameDescription
gameIdUnique identifier of the game to subscribe to
callbackFunction invoked when game state changes (score, period, status)

Returns: Unsubscribe function to clean up the subscription

Handler signature:

(gameId: string, callback: GameUpdateCallback) => () => void

PredictController:subscribeToMarketPrices​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:262

Subscribes to real-time market price updates via WebSocket.

Parameters:

NameDescription
tokenIdsArray of token IDs to subscribe to price updates for
callbackFunction invoked when prices change (includes bestBid/bestAsk)

Returns: Unsubscribe function to clean up the subscription

Handler signature:

(tokenIds: string[], callback: PriceUpdateCallback) => () => void

PredictController:subscribeToOrderbook​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:276

Subscribes to real-time orderbook (depth) updates for a single outcome token via WebSocket. The first emission is seeded from a REST snapshot by the provider so consumers render immediately.

Parameters:

NameDescription
tokenIdThe outcome token ID to subscribe to orderbook updates for
callbackFunction invoked with each OrderbookSnapshot (bids desc, asks asc)

Returns: Unsubscribe function to clean up the subscription

Handler signature:

(tokenId: string, callback: OrderbookCallback) => () => void

PredictController:trackActivityViewed​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:96

Handler signature:

(args: Parameters<PredictAnalytics['trackActivityViewed']>[0]) => void

PredictController:trackBannerAction​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:131

Handler signature:

(args: Parameters<PredictAnalytics['trackBannerAction']>[0]) => void

PredictController:trackBetslipDismissed​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:202

Track Predict Betslip Dismissed analytics event

Handler signature:

(args: Parameters<PredictAnalytics['trackBetslipDismissed']>[0]) => void

PredictController:trackCategoryClicked​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:136

Handler signature:

(args: Parameters<PredictAnalytics['trackCategoryClicked']>[0]) => void

PredictController:trackFeedFilterChanged​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:192

Track Predict Feed Filter Changed analytics event (generic feed)

Handler signature:

(args: Parameters<PredictAnalytics['trackFeedFilterChanged']>[0]) => void

PredictController:trackFeedTabChanged​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:182

Track Predict Feed Tab Changed analytics event (generic feed)

Handler signature:

(args: Parameters<PredictAnalytics['trackFeedTabChanged']>[0]) => void

PredictController:trackFeedViewed​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:126

Handler signature:

(args: Parameters<PredictAnalytics['trackFeedViewed']>[0]) => void

PredictController:trackGeoBlockTriggered​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:121

Handler signature:

(args: Parameters<PredictAnalytics['trackGeoBlockTriggered']>[0]) => void

PredictController:trackHomeSectionInteraction​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:172

Track Predict Home Section Interaction analytics event (section viewed / tapped / see-all)

Handler signature:

(args: Parameters<PredictAnalytics['trackHomeSectionInteraction']>[0]) => void

PredictController:trackHomeViewed​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:161

Track Predict Home Viewed analytics event (redesigned home)

Handler signature:

(args: Parameters<PredictAnalytics['trackHomeViewed']>[0]) => void

PredictController:trackMarketDetailsOpened​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:86

Handler signature:

(args: Parameters<PredictAnalytics['trackMarketDetailsOpened']>[0]) => void

PredictController:trackPortfolioPositionsButtonTapped​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:101

Handler signature:

(args: Parameters<
PredictAnalytics['trackPortfolioPositionsButtonTapped']
>[0]) => void

PredictController:trackPortfolioTransactionInitiated​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:106

Handler signature:

(args: Parameters<PredictAnalytics['trackPortfolioTransactionInitiated']>[0]) => void

PredictController:trackPositionsScreenViewed​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:111

Handler signature:

(args: Parameters<PredictAnalytics['trackPositionsScreenViewed']>[0]) => void

PredictController:trackPositionsTabViewed​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:116

Handler signature:

(args: Parameters<PredictAnalytics['trackPositionsTabViewed']>[0]) => void

PredictController:trackPositionViewed​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:91

Handler signature:

(args: Parameters<PredictAnalytics['trackPositionViewed']>[0]) => void

PredictController:trackPredictOrderEvent​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:81

Track Predict trade transaction analytics event Uses a single consolidated event with status discriminator

Handler signature:

(args: Parameters<PredictAnalytics['trackPredictOrderEvent']>[0]) => Promise<void>

PredictController:trackSearchInteracted​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:151

Track Predict Search Interacted analytics event

Handler signature:

(args: Parameters<PredictAnalytics['trackSearchInteracted']>[0]) => void

PredictController:trackShareAction​

Source: app/components/UI/Predict/controllers/PredictController-method-action-types.ts:141

Handler signature:

(args: Parameters<PredictAnalytics['trackShareAction']>[0]) => void