# 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 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)`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.celestium.digital/smartcontracts-description/bet-interface.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
