Kate Docs
SDK

Wallet Client

Check token balance and transaction history with client.wallet.

The wallet client provides access to your token balance and transaction ledger.

Methods

balance()

Get your current token balance.

balance = await client.wallet.balance()
print(f"Balance: {balance} tokens")

Returns: int

ledger()

Get your full transaction history.

ledger = await client.wallet.ledger()
print(f"Balance: {ledger.balance}")
for entry in ledger.transactions:
    print(f"  {entry.entry_type}: {entry.amount:+d}  -  {entry.description}")

Returns: Ledger object with balance and transactions

Data Model

WalletEntry

@dataclass
class WalletEntry:
    id: str
    user_id: str
    amount: int           # Positive = credit, negative = debit
    balance_after: int    # Balance after this transaction
    entry_type: str       # e.g., "subscription", "query", "credit"
    description: str | None
    created_at: str | None

Entry Types

TypeDirectionDescription
subscriptionDebit (buyer) / Credit (seller)Artifact subscription payment
queryDebit (buyer) / Credit (seller)Per-query charge
creditCreditTokens added to account

Next Steps

On this page