lib/emulator_market.js
function checkPlaceBetItem(self, desc) {
    if (desc.asianLineId !== '0' || desc.betCategoryType !== 'E')
        return 'UNKNOWN_ERROR';

    if (desc.betPersistenceType !== 'NONE' && desc.betPersistenceType !== 'IP')
        return 'INVALID_PERSISTENCE';

    if (desc.betType !== 'B' && desc.betType !== 'L')
        return 'INVALID_BET_TYPE';

    if (desc.bspLiability !== '0')
        return 'BSP_BETTING_NOT_ALLOWED';

    var price = betfairPrice.newBetfairPrice(desc.price);
    if (Math.abs(price.size - 1 * desc.price) > 0.0001)
        return 'INVALID_PRICE';

    if (!self.players[desc.selectionId])
        return 'SELECTION_REMOVED';

    if (1 * desc.size < minimumBetSize || 1 * desc.size > maximumBetSize)
        return 'INVALID_SIZE';

    // no checks failed, then bet is OK
    return null;
}
function checkPlaceBetItem(self, desc) {
    if (desc.asianLineId !== '0' || desc.betCategoryType !== 'E')
        return 'UNKNOWN_ERROR';

    if (desc.betPersistenceType !== 'NONE' && desc.betPersistenceType !== 'IP')
        return 'INVALID_PERSISTENCE';

    if (desc.betType !== 'B' && desc.betType !== 'L')
        return 'INVALID_BET_TYPE';

    if (desc.bspLiability !== '0')
        return 'BSP_BETTING_NOT_ALLOWED';

    var price = betfairPrice.newBetfairPrice(desc.price);
    if (Math.abs(price.size - 1 * desc.price) > 0.0001)
        return 'INVALID_PRICE';

    if (!self.players[desc.selectionId])
        return 'SELECTION_REMOVED';

    if (1 * desc.size < minimumBetSize || 1 * desc.size > maximumBetSize)
        return 'INVALID_SIZE';

    // no checks failed, then bet is OK
    return null;
}
function checkPlaceBetItem ( self , desc ) { if ( desc . asianLineId !== '0' || desc . betCategoryType !== 'E' ) return 'UNKNOWN_ERROR' ; if ( desc . betPersistenceType !== 'NONE' && desc . betPersistenceType !== 'IP' ) return 'INVALID_PERSISTENCE' ; if ( desc . betType !== 'B' && desc . betType !== 'L' ) return 'INVALID_BET_TYPE' ; if ( desc . bspLiability !== '0' ) return 'BSP_BETTING_NOT_ALLOWED' ; var price = betfairPrice . newBetfairPrice ( desc . price ) ; if ( Math . abs ( price . size - 1 * desc . price ) > 0.0001 ) return 'INVALID_PRICE' ; if ( ! self . players [ desc . selectionId ] ) return 'SELECTION_REMOVED' ; if ( 1 * desc . size < minimumBetSize || 1 * desc . size > maximumBetSize ) return 'INVALID_SIZE' ; // no checks failed, then bet is OK return null ; }
Check a single bet item from placeBets bets list
Check a single bet item from placeBets bets list