Skip to main content

Official Kortana SDK for Python

Project description

kortana-dev-sdk — Official Kortana Python SDK

PyPI Python License: MIT

The official Python SDK for the Kortana blockchain payments platform.

Installation

pip install kortana-dev-sdk
# or
poetry add kortana-dev-sdk

Quick Start

import asyncio
import os
from kortana import kortana

async def main():
    async with kortana(
        api_key=os.environ["KORTANA_API_KEY"],
        environment="mainnet",
    ) as client:
        # Check network status
        status = await client.blockchain.get_network_status()
        print(f"Block: {status.block_number}")

        # Get wallet balance
        balance = await client.wallets.get_balance()
        print(f"Balance: {balance.available} DNR")

        # Create a payment link
        link = await client.payments.create_link(
            amount=1_000_000_000_000_000_000,  # 1 DNR in wei
            currency="DNR",
            description="Invoice #1001",
        )
        print(f"Payment URL: {link.url}")

asyncio.run(main())

Webhook Verification

from kortana import kortana

client = kortana(api_key="kt_live_...", webhook_secret="whsec_...")

@app.post("/webhooks")
async def handle_webhook(request: Request):
    payload = await request.body()
    signature = request.headers.get("X-Kortana-Signature", "")
    event = client.validate_webhook(payload.decode(), signature)
    if event["type"] == "transfer.completed":
        print("Transfer done!", event["data"])
    return {"received": True}

Modules

Module Description
client.blockchain Read-only blockchain data (blocks, txs, gas)
client.contracts Deploy and interact with smart contracts
client.wallets HD wallet management and transfers
client.payments Payment intents, invoices, subscriptions
client.banking Customer and bank account management
client.cards Virtual and physical card issuance
client.compliance KYC, KYB, and AML screening
client.settlement Ledger settlement and treasury
client.merchants Merchant onboarding and management

Requirements

  • Python 3.9+
  • httpx >= 0.27
  • pydantic >= 2.5

License

MIT © Kortana Labs

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

kortana_dev_sdk-1.0.0.tar.gz (13.9 kB view details)

Uploaded Source

File details

Details for the file kortana_dev_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: kortana_dev_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for kortana_dev_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 45b3c3c166989cf99458b5662385b06dbe27f3a0147b89672c8bad65f96fa902
MD5 5da794fdcfd455671d78909a3c4c820a
BLAKE2b-256 5da14e200eb2b49594aca5d85ebeba72c87b33a621f385557a82b8a253048929

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