# Description

The `record_battle` method is part of the `SiriusnetSDK` class in the Siriusnet Blockchain SDK. Its purpose is to record the result of a battle for a specific player in a specific game. This information is stored on the Siriusnet Blockchain, allowing for transparent and immutable record-keeping.

The method requires three parameters: `player_id`, `game_id`, and `result`.

* `player_id` is a string that uniquely identifies a player.
* `game_id` is a string that uniquely identifies a game.
* `result` is a string that indicates the outcome of the battle, expected to be either 'win' or 'lose'.

When the `record_battle` method is called, it sends a request to the Siriusnet Blockchain API to record the battle result. The API processes the request and, if successful, returns a dictionary containing information about the recorded battle. This dictionary typically includes the player ID, game ID, result, and timestamp of the battle.

It's important to note that this method may raise exceptions if there's an issue with the request. For instance, if the API key is invalid, the player ID or game ID doesn't exist, or there's a network error, an exception will be raised. Therefore, it's recommended to wrap calls to this method in a try/except block to handle potential exceptions.


---

# 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://siriusnetdocs.gitbook.io/doc/sdks-and-apis/games/sdk-documentation/api-reference/record_battle-method/description.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.
