WHITEPAPER
  • Siriusnet
  • 📖Whitepaper
    • Introduction
    • Gameplay
    • About us
    • Consensus
      • EVM
    • Chain Info
    • Wallet
      • Download
      • Support
        • Basic
        • How to Move Assets
    • Siriuswap
    • Siriusscan
  • 🪙TOKENOMICS
    • 1️⃣GP
    • 2️⃣TICKET
    • 3️⃣SINT
    • 4️⃣MCD
  • SDKs & APIs
    • 💻dApp
      • Build Your Siriusnet Client
      • dApp SDK
        • Guides
          • SDK Quick start
    • 🎮Games
      • SDK Documentation
        • Introduction
        • Getting Started
          • Installation
          • Configuration
        • API Reference
          • record_battle method
            • Description
            • Parameters
            • Return Value
            • Example Usage
          • get_player_battles method
            • Description
            • Parameters
            • Return Value
            • Example Usage
        • Error Handling
        • FAQ
  • 🏢COMPANY
    • Roadmap
    • Team
    • Brand asset
  • 💪COMMUNITY
    • Social Media
  • 🤙Collaborating
    • 💰Foundation
    • 💸Grants
  • 📢Policies
    • 🔏Privacy & Policy
  • 📡Notes
    • 🔏Attack address
Powered by GitBook
On this page
  1. SDKs & APIs
  2. Games
  3. SDK Documentation

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.

PreviousConfigurationNextrecord_battle method

Last updated 1 year ago

🎮