Appearance
Financial Limits
Players can limit how much they deposit, lose, or wager over a period. Casino regulations mandate that limits cannot be instantly raised or removed; that rule is enforced by the platform, not the operator.
Setting a limit
javascript
const limit = await sdk.responsibleGaming.setLimit({
type: 'DEPOSIT', // 'DEPOSIT' | 'LOSS' | 'WAGER'
period: 'WEEKLY', // 'DAILY' | 'WEEKLY' | 'MONTHLY'
amount: 500.00 // validated against the operator's config envelope
});The amount is validated against the operator's RGConfig envelope for that limit type; out-of-range amounts reject with RG_LIMIT_AMOUNT_OUT_OF_RANGE.
The cooling-off rule
text
GIVEN no existing limit for a type/period
WHEN setLimit is called with an in-range amount
THEN the limit is created ACTIVE immediately (appliedAt set).
GIVEN an existing limit and a NEW amount LOWER than the current one
WHEN setLimit is called
THEN the limit tightens IMMEDIATELY; status ACTIVE, appliedAt updated.
GIVEN an existing limit and a new amount HIGHER than the current one
WHEN setLimit is called
THEN the change enters PENDING with activatesAt = now + cooling-off
(default 24h); the CURRENT limit stays in force until then.
GIVEN a PENDING increase whose activatesAt arrives (scheduled) OR any
limits read occurs (defensive)
THEN the increase becomes ACTIVE and the LimitActivatedEvent fires
exactly once; reads never return a stale PENDING state.Show pending increases with their countdown:
javascript
const limits = await sdk.responsibleGaming.getActiveLimits();
limits.forEach(limit => {
if (limit.status === 'PENDING' && limit.activatesAt) {
if (limit.pendingChange === 'INCREASE') {
console.log(`Increase to $${limit.amount} activates at ${limit.activatesAt}`);
} else {
console.log(`Removal takes effect at ${limit.activatesAt}`);
}
} else if (limit.status === 'ACTIVE') {
console.log(`Active limit: $${limit.amount} (used $${limit.currentAmountUsed} this period)`);
}
});Removing a limit
Removal follows the same cooling-off discipline:
text
GIVEN an ACTIVE limit
WHEN removeLimit(type, period) is called
THEN the limit enters PENDING (pendingChange = 'REMOVAL', activatesAt =
now + cooling-off) and the current limit stays in force until then.
GIVEN a pending removal whose activatesAt is set
WHEN the moment arrives (scheduled evaluation) OR any limits read occurs
(defensive evaluation)
THEN the limit becomes REMOVED; terminal and observable in history:
getActiveLimits no longer returns it, and the LimitRemovedEvent
fires exactly once.Error contract
| Code | Error class | HTTP status | Trigger condition | Retryable |
|---|---|---|---|---|
RG_LIMIT_NOT_FOUND | LimitNotFoundError | 404 | removeLimit for a type/period with no limit | No |
RG_LIMIT_AMOUNT_OUT_OF_RANGE | LimitAmountOutOfRangeError | 400 | Amount outside the operator's config envelope | No (fix input) |
RG_LIMIT_TYPE_DISABLED | LimitTypeDisabledError | 409 | Setting a limit type the operator disabled | No |
Common errors are defined once in the Error Reference.
See RG Overview for structures, events, and the operator-configurable envelope.