// SPDX-License-Identifier: None
pragma solidity ^0.8.10;

import "./IBetAdminActions.sol";

interface IBettingPlatform is IBetAdminActions {

    struct PlayerBetInfo {
        uint256 betAmount;
        uint256 betSideId;
    }

    struct BettingPool {
        uint256 startTime;
        uint256 endTime;
        uint256 totalBetAmount;
        uint256[] betedAmounts;
        string[] betSides;
        string betConditionStr;
        string betConditionImg;
        int256 winBetSideId;
        bool finished;
    }

    struct IBetSide {
        uint256 betSideId;
        string betSide;
    }

    struct IBettingPool {
        uint256 bettingId;
        uint256 startTime;
        uint256 endTime;
        IBetSide[] betSides;
        string betConditionStr;
        string betConditionImg;
    }

    struct BettingInfo {
        uint256 bettingId;
        uint256 startTime;
        uint256 endTime;
        int256 winBetSideId;
        bool finished;
        string betConditionStr;
        string betConditionImg;
    }

    /// @notice Let users bet to a betting side.
    /// @param bettingId_ Id of betting pool.
    /// @param sideId_ Id of betting sides.
    function placeBet(
        uint256 bettingId_,
        uint256 sideId_
    ) external payable;

    /// @notice Get information for placed betting pools.
    /// @return Information for placed betting pools.
    function getPlacedBettingList() external view returns (IBettingPool[] memory);

    /// @notice Get information for all betting pools.
    /// @return Information for all betting pools.
    function getAllBettingList() external view returns (BettingInfo[] memory);

    event PlaceBet(address indexed player, uint256 bettingId, uint256 sideId, uint256 betAmount);
}
[{"inputs":[{"internalType":"address","name":"platformAsset_","type":"address"},{"internalType":"uint256","name":"minBetAmount_","type":"uint256"},{"internalType":"uint256","name":"discountThreshold_","type":"uint256"},{"internalType":"uint16","name":"platformFee_","type":"uint16"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"bettingId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sideId","type":"uint256"}],"name":"ChooseWinner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"bettingId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sideId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"betAmount","type":"uint256"}],"name":"PlaceBet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"betConditionStr","type":"string"},{"indexed":false,"internalType":"string","name":"betConditionImg","type":"string"},{"indexed":false,"internalType":"string[]","name":"betSides","type":"string[]"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"StartNewBet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"bettingId","type":"uint256"}],"name":"StopBet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMinBetAmount","type":"uint256"}],"name":"UpdateMinBetAmount","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAsset","type":"address"}],"name":"UpdatePlatformAsset","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"newFee","type":"uint16"}],"name":"UpdatePlatfromFee","type":"event"},{"inputs":[{"internalType":"uint256","name":"bettingId_","type":"uint256"},{"internalType":"uint256","name":"sideId_","type":"uint256"}],"name":"chooseWinner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAllBettingList","outputs":[{"components":[{"internalType":"uint256","name":"bettingId","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"int256","name":"winBetSideId","type":"int256"},{"internalType":"bool","name":"finished","type":"bool"},{"internalType":"string","name":"betConditionStr","type":"string"},{"internalType":"string","name":"betConditionImg","type":"string"}],"internalType":"struct IBettingPlatform.BettingInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPlacedBettingList","outputs":[{"components":[{"internalType":"uint256","name":"bettingId","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"components":[{"internalType":"uint256","name":"betSideId","type":"uint256"},{"internalType":"string","name":"betSide","type":"string"}],"internalType":"struct IBettingPlatform.IBetSide[]","name":"betSides","type":"tuple[]"},{"internalType":"string","name":"betConditionStr","type":"string"},{"internalType":"string","name":"betConditionImg","type":"string"}],"internalType":"struct IBettingPlatform.IBettingPool[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minBetAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"bettingId_","type":"uint256"},{"internalType":"uint256","name":"sideId_","type":"uint256"}],"name":"placeBet","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"placedBettingCnt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformAsset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformFee","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"betConditionStr_","type":"string"},{"internalType":"string","name":"betConditionImg_","type":"string"},{"internalType":"string[]","name":"betSides_","type":"string[]"},{"internalType":"uint256","name":"startTime_","type":"uint256"},{"internalType":"uint256","name":"endTime_","type":"uint256"}],"name":"startNewBet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"bettingId_","type":"uint256"}],"name":"stopBet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMinAmount_","type":"uint256"}],"name":"updateMinBetAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAsset_","type":"address"}],"name":"updatePlatformAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"newFee_","type":"uint16"}],"name":"updatePlatformFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]