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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://betfin.gitbook.io/betfin-public/smartcontracts-description/bet-interface.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
