> For the complete documentation index, see [llms.txt](https://betfin.gitbook.io/betfin-public/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://betfin.gitbook.io/betfin-public/smartcontracts-description/bet-interface.md).

# Bet Interface

The Bet Interface provides methods to interact with a betting contract on the Ethereum blockchain. This interface allows users to retrieve various information related to a bet, such as player address, bet amount, payout result, bet status, game address, and creation timestamp.

Every bet is deployed as an EIP-1167 minimal proxy clone (\~$0.01 gas cost), ensuring every bet has its own immutable on-chain record and state machine.

### Bet State Machine:

* Pending: Awaiting outcome (VRF or manual resolution).
* Resolved: Outcome reached, payout (if any) transferred.
* Refunded: Bet amount returned to recipient due to timeout or cancellation

#### Interface Methods

1. **getPlayer**
   * **Description**: Returns the address of the player who placed the bet.
   * **Usage**: Call this method to retrieve the address of the player.
   * **Return Type**: `address`
2. **getAmount**
   * **Description**: Returns the amount of the bet.
   * **Usage**: Call this method to retrieve the amount of the bet in Wei.
   * **Return Type**: `uint256`
3. **getResult**
   * **Description**: Returns the payout result of the bet.
   * **Usage**: Call this method to retrieve the payout result of the bet.
   * **Return Type**: `uint256`
4. **getStatus**
   * **Description**: Returns the status of the bet.
   * **Usage**: Call this method to retrieve the status of the bet.
   * **Return Type**: `uint256`
5. **getGame**
   * **Description**: Returns the address of the [game](broken://pages/0KDFaGti0KRtl1WalMA2) associated with the bet.
   * **Usage**: Call this method to retrieve the address of the game contract.
   * **Return Type**: `address`
6. **getCreated**
   * **Description**: Returns the timestamp when the bet was created.
   * **Usage**: Call this method to retrieve the creation timestamp of the bet.
   * **Return Type**: `uint256`
7. **getBetInfo**
   * **Description**: Returns all relevant information about the bet.
   * **Usage**: Call this method to retrieve all data related to the bet at once, including player address, game address, bet amount, payout result, bet status, and creation timestamp.
   * **Return Type**: `(address, address, uint256, uint256, uint256, uint256)`
