Methods
# static onTotalOddsChanged(args, callback)
onTotalOddsChanged - Handles the total odds request.
Parameters
Name | Type | Description |
---|---|---|
args |
OddsRequest | The arguments object containing odds data. |
callback |
OddsResponse | The callback function to handle the response. |
Example
function onTotalOddsChanged(args, callback) {
// Just an example call, replace with your own implementation
const oddsResponse = getOdds(args);
// Call the callback function with the response
callback(oddsResponse);
}
SIR('registerAdapter', '{ADAPTER_NAME}', { onTotalOddsChanged: onTotalOddsChanged });
SIR('addWidget', '#sr-widget', 'betRecommendation');
Type Definitions
Object
# Outcome
Properties:
Name | Type | Description |
---|---|---|
eventId |
string | |
outcomeId |
string | |
marketId |
string | |
specifier |
string |
Object
# OutcomesResponse
Properties:
Name | Type | Description |
---|---|---|
outcomes |
Array.<Outcome> | Array of outcomes that this total odds value belongs to. |
totalOdds |
string | number | String representation of the total odds calculated for the event. |