Iframe API
Operator commands
Messages your page may send to the game, and what each one does.
| Command | data |
|---|---|
ifc.set.balance | {value} |
ifc.update.balance | — |
ifc.set.sound | {value} |
ifc.set.music | {value} |
ifc.set.animation | {value} |
ifc.stop.autoplay | — |
ifc.open.help | — |
ifc.lock.UI | {value} |
ifc.stop.internal.reality.check | — |
Post a command to the game's window: frame.contentWindow.postMessage({cmd, data}, gameOrigin). Commands that change a switch answer with the matching event; the others answer nothing.
Commands#
ifc.set.balance#
All games: show this balance. Display only: it changes no limit and nothing in any wallet, and the next balance from our servers replaces it. No ifc.update.balance is sent back. The value is read as JavaScript prints it (String(value), so 5000000.129 shows as 5,000,000.129; an exponent form such as 1e-7 is read exactly), then digits finer than the currency has are cut off (rounded down, never up). The game never shows more than your page prints for the number: 0.3 shows as 0.30 USD. A negative value with finer digits moves one smallest amount down (-1.005 shows as −1.01 EUR). A number of 10^21 or more, which JavaScript prints with an exponent, is shown; release 1.0.0 ignored it. A value that is not finite, or too large for an amount (10^38 or more in smallest amounts), is ignored.
| Field | Type | Presence | Meaning |
|---|---|---|---|
value | number | required | The balance, in major units. |
{
"cmd": "ifc.set.balance",
"data": { "value": 55.2 }
}
ifc.update.balance#
All games: read the balance from your wallet (by info) and show it. At most once per 10 seconds: a command inside that window is dropped.
Takes no data.
{
"cmd": "ifc.update.balance"
}
ifc.set.sound#
All games: sound on or off. Answered with ifc.sound.
| Field | Type | Presence | Meaning |
|---|---|---|---|
value | boolean | required | Sound on. |
{
"cmd": "ifc.set.sound",
"data": { "value": false }
}
ifc.set.music#
Crash: its flight sound on or off, answered with ifc.music. Ignored by the other games.
| Field | Type | Presence | Meaning |
|---|---|---|---|
value | boolean | required | Music on. |
{
"cmd": "ifc.set.music",
"data": { "value": false }
}
ifc.set.animation#
All games: false reduces motion; true returns to the brand's and the device's own setting (it cannot undo reduced motion asked for by the system or the brand). Answered with ifc.animation.
| Field | Type | Presence | Meaning |
|---|---|---|---|
value | boolean | required | Animations on. |
{
"cmd": "ifc.set.animation",
"data": { "value": false }
}
ifc.stop.autoplay#
All games: autoplay stops as if the player pressed Stop: the bet in flight finishes and no new one starts. Crash also drops bets queued for the next round that were not sent. A bet we accepted is not cancelled, even while Crash's betting window is open: it plays. Answered with ifc.autoplay and value: false if autoplay was running.
Takes no data.
{
"cmd": "ifc.stop.autoplay"
}
ifc.open.help#
All games: open the game rules, unless a window that cannot be closed is open (the reality check, a fatal error).
Takes no data.
{
"cmd": "ifc.open.help"
}
ifc.lock.UI#
All games: true stops new bets and autoplay, and covers the game with a "Paused" layer as soon as nothing is in play; a round in play (a Mines board, a Chicken round, a Tower round or a HiLo round, a live Crash bet) stays playable to its end, so a lock never keeps a player from cashing out. false unlocks.
| Field | Type | Presence | Meaning |
|---|---|---|---|
value | boolean | required | Locked. |
{
"cmd": "ifc.lock.UI",
"data": { "value": true }
}
ifc.stop.internal.reality.check#
All games: switch off the game's own reality-check timer for the rest of the page's life. Code 412 keeps working.
Takes no data.
{
"cmd": "ifc.stop.internal.reality.check"
}