SDK

Architecture designed. Shipping post-mint.

Overview

The Litany SDK is a TypeScript/Python library for developers building custom agents or applications that interact with the Litany Protocol. It wraps the same contract interactions as the MCP server in a standard library format.

Use the SDK when you’re:

  • Building a custom agent framework (not using MCP)
  • Building direct contract interaction from a backend service
  • Building a frontend that reads Litany data
  • Need lower-level control than the MCP server provides

TypeScript (Planned)

import { Litany } from '@litany/sdk'
import { createWalletClient } from 'viem'

const litany = new Litany({
  rpcUrl: 'https://api.mainnet.abs.xyz',
  chainId: 2741,
  wallet: walletClient
})

// Read inscriptions
const cards = await litany.getOwnedCards(address)
const card = await litany.inspectCard(tokenId)

// Read Hollows
const hollows = await litany.getOwnedHollows(address)

// Load firmware
await litany.loadFirmware(cardTokenId, hollowTokenId)

// Arena (when live)
const challenges = await litany.getOpenChallenges()
await litany.createChallenge({
  team: [hollowId1, hollowId2, hollowId3],
  entryFee: parseEther('0.01')
})

Python (Planned)

from litany import LitanyClient

client = LitanyClient(
    rpc_url="https://api.mainnet.abs.xyz",
    chain_id=2741
)

cards = client.get_owned_cards(address)
card = client.inspect_card(token_id)
hollows = client.get_owned_hollows(address)

Contract Integration

For developers building onchain games that consume Litany assets, the SDK also provides helpers for reading inscription data from within smart contracts:

ILitanyCards litany = ILitanyCards(LITANY_CARDS_ADDRESS);

// Get packed indices (gas efficient)
uint256 indices = litany.getCardIndices(tokenId);

// Get resolved text (human/agent readable)
(string name, string class_, string speed, string aggression,
 string caution, string precision, string trait) =
    litany.getCardText(tokenId);

Package Publication

The SDK will be published to npm (@litany/sdk) and PyPI (litany-sdk). Publication timeline: post-genesis-mint.