Skip to content

Betting callbacks

Betting Callbacks are a list of functions used by our betting system to interact with the integrator

1
2
3
interface BettingCallbacks {
  getErrorTitle?: (errorCode: string) => string;
}

getErrorTitle

Description:
This function is used to retrieve an error title based on the provided error code. It is particularly used to set the error message for wl_defined errors when placing a bet

Parameters: errorCode (String) — custom error code given from WL. Example: "player_limit_reached"

Example:

1
2
3
4
5
6
7
8
bettingAPI.registerCallbacks({
    getErrorTitle: (errorCode: string) => {
        switch(errorCode) {
            case 'player_limit_reached':
                return 'Bet limit exceeded'
        }
    }
})

Note

When implementing the getErrorTitle callback, be sure to take the user's locale into account. The error messages should be localized to ensure a better user experience for players from different regions.