Skip to main content

Official Python SDK for BlackSwan Finance

Project description

BlackSwan SDK for Python

SDK for interacting with BlackSwan Finance smart contracts.

Installation

pip install blackswan-sdk

Usage

from blackswan import BlackSwanClient

# Amoy (Polygon testnet)
client = BlackSwanClient(
    network="amoy",
    rpc_url="https://polygon-amoy.g.alchemy.com/v2/your-api-key"
)

# Sepolia (Ethereum testnet)
client = BlackSwanClient(
    network="sepolia",
    rpc_url="https://eth-sepolia.g.alchemy.com/v2/your-api-key"
)

dashboard = client.get_credit_dashboard("0x...")
print(dashboard.trust_ratio)

Methods

  • get_credit_dashboard(wallet) - Returns CreditDashboard with trust_ratio, current_apr, borrowed_usd, repaid_usd, successful_loans, defaults, tier
  • get_trust_ratio(wallet) - Returns trust score (0-10000)
  • get_current_apr(wallet) - Returns current APR (raw value, divide by 10000 for percentage)
  • balance_of(wallet) - Returns 1 if wallet has SBT, 0 otherwise

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blackswan_sdk-0.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blackswan_sdk-0.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file blackswan_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: blackswan_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for blackswan_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b3c8a713f67d92e91bb1807c62b9e5e6fbfeedde4c801d6bd62c0ef6cd45684e
MD5 dd64129a09854f9555d5f34a7cb99d00
BLAKE2b-256 520a542c0f874d23e2790be5d91655d338b04ccba903d9c211d5aaf3d16d903e

See more details on using hashes here.

File details

Details for the file blackswan_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: blackswan_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for blackswan_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fab160088a311f0c558243a17b57af156f90149575977834d11b578795f1f6fa
MD5 106d69e26f2facf0233fed5776070fda
BLAKE2b-256 4f8f59e7bb08ce8b7caf8934c813d97036ef597d0fba0e3b21b613bf239098ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page