Skip to main content

Fetching Maximum Sub-Bet Limit

The getMaxSubBetLimit method retrieves the maximum limit allowed for a sub-bet within a combination bet. This helps in managing and controlling the maximum amount a user can bet on a sub-bet in a combo.

Usage

import kohin from "./kohinInstance";

const maxSubBetLimit = await kohin.getMaxSubBetLimit();

if (maxSubBetLimit.success) {
console.log("Max Sub Bet Limit:", maxSubBetLimit.maxSubBetLimit);
} else {
console.error("Error fetching max sub-bet limit:", maxSubBetLimit.error);
}

Return Value

The getMaxSubBetLimit method returns an object with the following structure:

{
success: boolean; // Indicates if the operation was successful
error?: string; // Error message if the operation failed
maxSubBetLimit?: number; // The maximum limit for a sub-bet in a combination bet
}

Error Handling

Here's how you can handle errors while fetching the maximum sub-bet limit:

try {
const res = await kohin.getMaxSubBetLimit();

if (res.success) {
console.log("Max Sub Bet Limit:", res.maxSubBetLimit);
} else {
console.error("Error fetching max sub-bet limit:", res.error);
}
} catch (error: any) {
console.error("Unexpected error while fetching max sub-bet limit:", error);
}

Example Response

Success Response:

{
"success": true,
"maxSubBetLimit": 1000
}

Error Response:

{
"success": false,
"error": "Unable to fetch max sub-bet limit."
}