API Reference

This API reference provides detailed information about the classes, methods, and parameters available in the Siriusnet Blockchain SDK.

Class: SiriusnetSDK

This is the main class that you'll interact with when using the SDK. It provides methods for recording and retrieving battle records.

__init__(self, api_key: str) -> None

This is the constructor for the SiriusnetSDK class. It takes one parameter:

  • api_key (str): Your API key for the Siriusnet Blockchain.

record_battle(self, player_id: str, game_id: str, result: str) -> dict

This method records a battle result for a player in a specific game. It takes three parameters:

  • player_id (str): The ID of the player.

  • game_id (str): The ID of the game.

  • result (str): The result of the battle. This should be either 'win' or 'lose'.

The method returns a dictionary with information about the recorded battle.

get_player_battles(self, player_id: str) -> list

This method retrieves all the battle records for a specific player. It takes one parameter:

  • player_id (str): The ID of the player.

The method returns a list of dictionaries, each representing a battle record.

Last updated