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.

1display: {
2 showHeader: false,
3 showTicker: false,
4 hidden: ['chart', 'orderBook'],
5}
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.