Skip to navigation

Options & Events

Initialization options, runtime events, and common error codes.
View as Markdown

Options

FieldTypeDefaultNotes
baseUrlstringSDK script originiframe domain. Pass explicitly in partner pages.
symbolstringBTCUSDTNormalized to uppercase and strips - / _.
themedark | lightdarkInitial theme parameter.
localeen | en-US | zh-CNBrowser/defaultEnglish and Simplified Chinese are supported.
layoutdefault | compactdefaultReserved layout option.
displayobjectshowHeader: false, showTicker: false, hidden: []Controls embed shell areas and high-level trading containers.
authobjectnoneUse partner-token for new SSO integrations.

Display controls

display controls the embedded trading page shell and high-level containers. In partner embeds, the PC header and bottom market ticker are hidden by default.

display: {
showHeader: false,
showTicker: false,
hidden: ['chart', 'orderBook'],
}
FieldTypeDefaultNotes
showHeaderbooleanfalseWhether to show the PC embed header inside the iframe.
showTickerbooleanfalseWhether to show the bottom market ticker in the embed shell.
hiddenstring[][]Hides high-level containers in the trading page.

Supported display.hidden values:

ValueContainer
chartChart container
orderBookOrder book container
orderFormOrder form panel
positionsBottom positions and open orders panel
accountAccount assets container

display.hidden hides whole containers only. It does not hide individual buttons, fields, or tools inside a container. Values that do not map to the current viewport are ignored.

Events

EventTrigger
readyiframe initialization finished.
errorSDK, iframe, or authentication error.
state_changedSDK lifecycle state changed.
auth_state_changedpartner-token auth state changed.
symbol_changedActual iframe symbol changed.
locale_changedActual iframe locale changed.
order_createdUser created an order inside the iframe.
order_failedOrder submission failed.
destroyedSDK instance destroyed.

Product pages and trading mode

Java Agent SDK and browser Trading Widget SDK are versioned independently. For seconds trading, use the current Widget capabilities and select both the page and trading mode explicitly.

OptionValuesMeaning
pageup-down, high-low, grid-predictionProduct page for seconds trading.
tradingModereal, demoDefaults to real; explicitly match the backend funding environment.

Check TradingWidget.capabilities.pages, TradingWidget.capabilities.tradingModes, and TradingWidget.capabilities.partnerToken before initialization. Token creation does not select a funds environment. To change users or real/demo mode, destroy the old instance and create a new one.

See complete seconds trading example and production/simulated configuration.

Additional display targets and events

The current runtime also accepts symbolFavorites and symbolTicker in display.hidden. Always check TradingWidget.capabilities.displayTargets; a target controls a high-level container and is not a field-level permission setting.

EventMeaning
renderedThe iframe sends its rendered notification.
theme_changedThe iframe reports its actual theme.
page_changedThe iframe reports its actual product page.

Use onRendered or widget.on('rendered', handler) to handle rendering separately from initialization. Current supported pages are published in TradingWidget.capabilities.pages; validate the requested page rather than guessing a path.