Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 1.43 KB

File metadata and controls

46 lines (35 loc) · 1.43 KB

Migration Guide: Upgrading to SuperApi v1.0.0.11

This guide outlines the changes from the previous legacy superapi wrapper to the new official SuperApi SDK.

Key Changes

1. Class Name Update

  • Legacy: superApi (lowercase 's')
  • New: SuperApi (PascalCase)

2. Authentication Logic

The previous version required manual HMAC hashing of payloads and browser-based login redirects. The new version handles this internally.

Old Way:

# Manual HMAC and redirect URL parsing

New Way (Headless):

from superapi.superapi import SuperApi

api = SuperApi(api_key, user_id, password, api_secret)
api.validate_2fa_with_totp("123456") # Direct TOTP validation
# Session & Access Token are now generated automatically

3. Dependencies

The new SDK requires logzero for standardized logging.

pip install logzero pyotp cryptography requests

4. Method Parameter Names

Method signatures have been standardized to improve readability.

  • getFundDetails() -> get_fund_details()
  • getPositions() -> positions()
  • getHolding() -> getHoldings()

Why Upgrade?

  • Stability: Resolves "Invalid Session" errors caused by incorrect HMAC calculations.
  • Speed: Headless authentication allows for faster bot restarts without manual interaction.
  • Coverage: Added support for more order types and better market data parsing.

For support, please raise an issue in the repository.