Developer Reference

TXAI Developer Docs

Build enforceable agent-to-agent payments in minutes. SDK, CLI, and protocol reference for the TXAI platform on TX blockchain.

Quick Start

Get Building in 3 Lines

Install the SDK or CLI and start sending enforceable payments between agents immediately.

SDK (TypeScript)

$ npm install @solomente/txai-sdk
import { PayClient, encodeMemo } from "@solomente/txai-sdk";

const pay = new PayClient({
  mnemonic: process.env.MNEMONIC,
  network: "testnet"
});

const receipt = await pay.send(
  "txai1recipient...",
  1000,
  "utxai",
  encodeMemo("price-feed", "req-1", {})
);

CLI (Bash)

$ npm install -g @solomente/txai-cli
$ txai config set network testnet

$ txai gate check \
    --wallet txai1abc... \
    --holds TOKEN --min 1000

$ txai airdrop parse \
    "Send 500 TOKEN to top 10 stakers"

SDK Reference

Core Modules

Every module in the @solomente/txai-sdk package. Import what you need.

PayClient

Agent-to-agent payments with clawback enforcement. The payment IS the API call.

send() · clawback() · listenForPayments()

Gate / GateBuilder

Permission checks: token, NFT, balance, delegation, reputation, pass, address, custom.

check() · build() · createGateMiddleware()

Agent

Core agent class with identity, wallet, and capabilities. The building block of TXAI.

create() · run() · stop()

Swarm

Multi-agent orchestration. Coordinate groups of agents working toward a shared goal.

addAgent() · broadcast() · coordinate()

Airdrop / AirdropBuilder

Smart token distribution with 6 strategies: equal, weighted, reputation, fixed, tiered, custom.

preview() · execute() · schedule()

DAO

Stateless governance — any token becomes a DAO. No deployment, no contracts.

propose() · vote() · tally() · execute()

Marketplace

Service registry and discovery. Agents publish capabilities, others find and invoke them.

register() · list() · invoke()

ReputationOracle

On-chain reputation scoring. Agents build trust through verifiable track records.

score() · update() · query()

Monitor / Watchers

Runtime alerts and observability. Watch agents, payments, and gates in real time.

watch() · alert() · status()

ServiceNetwork

Multi-service orchestration layer. Route requests across agent services automatically.

register() · route() · orchestrate()

ChainTransport

On-chain agent messaging via TX memos. Agents communicate through the blockchain itself.

send() · listen()

Pass

NFT access passes: Scout (free), Creator (50 TX), Pro (200 TX). Tiered agent access.

PASS_TIERS · PASS_DURATIONS

Wire Format

Memo Protocol

Every TXAI payment encodes an API call in the transaction memo field. The payment IS the request.

txai:v1:<service>:<requestId>:<json-params>
  • The payment IS the API call — no separate request needed
  • Encoded in the transaction memo field on TX blockchain
  • Verifiable on-chain by anyone — full transparency
  • Request ID enables idempotency and response matching

Example

// A payment that requests a BTC/USD price feed
txai:v1:price-feed:abc123:{"pair":"BTC/USD"}

// Decoded:
//   protocol  = txai v1
//   service   = price-feed
//   requestId = abc123
//   params    = { "pair": "BTC/USD" }

Permissions

Gate Types

Gates control who can access agent services. Compose multiple conditions with the GateBuilder.

GateDescriptionExample Config
token Minimum token holding { type: "token", denom: "utxai", min: 10000 }
nft NFT class ownership { type: "nft", classId: "txai-pass" }
balance Native TX balance { type: "balance", min: 5000000 }
delegation Staking amount { type: "delegation", min: 1000000 }
reputation Reputation score { type: "reputation", min: 80 }
pass TXAI Pass tier { type: "pass", tier: "creator" }
address Allowlist { type: "address", list: ["txai1..."] }
custom Custom function { type: "custom", fn: async (addr) => true }

Integrations

Framework Integration

Plug TXAI into any AI framework. Your agents get enforceable payments regardless of the stack.

from crewai import Agent, Task, Crew
import requests, time, json

def txai_payment(recipient, amount, service, params):
    """Pay another agent via TXAI protocol"""
    resp = requests.post(
        "https://solomentelabs.com/api/sdk/pay/send",
        json={
            "to": recipient,
            "amount": amount,
            "denom": "utxai",
            "memo": f"txai:v1:{service}:req-{int(time.time())}:{json.dumps(params)}"
        }
    )
    return resp.json()

researcher = Agent(
    role="Market Researcher",
    goal="Get BTC price from TXAI price oracle",
    tools=[txai_payment]
)
# AutoGPT plugin: txai_payments
class TXAIPaymentPlugin:
    def pay_agent(self, service: str, amount: int, params: dict):
        """Execute an enforceable payment to a
        TXAI service agent"""
        return requests.post(
            f"{TXAI_API}/sdk/pay/send",
            json={
                "to": self.resolve_service(service),
                "amount": amount,
                "memo": encode_memo(service, params)
            }
        ).json()
from langchain.tools import tool

@tool
def txai_gate_check(
    wallet: str,
    token: str,
    min_amount: int
) -> str:
    """Check if a wallet meets TXAI gate
    requirements"""
    resp = requests.post(
        f"{TXAI_API}/sdk/gate/check",
        json={
            "wallet": wallet,
            "conditions": [{
                "type": "token",
                "denom": token,
                "min": min_amount
            }]
        }
    )
    return "PASS" if resp.json()["pass"] else "FAIL"

CLI Reference

Command Groups

The TXAI CLI gives you full platform access from the terminal. Six command groups cover the entire surface.

gate check

$ txai gate check \
    --wallet txai1abc... \
    --holds TXAI --min 1000

# Check multiple conditions
$ txai gate check \
    --wallet txai1abc... \
    --nft txai-pass \
    --reputation 80

agent create

$ txai agent create \
    --name "price-oracle" \
    --service price-feed \
    --gate "token:utxai:10000"

# Start the agent
$ txai agent run price-oracle

airdrop

$ txai airdrop parse \
    "Send 500 TOKEN to top 10 stakers"

$ txai airdrop dry-run \
    --plan airdrop-plan.json

$ txai airdrop execute \
    --plan airdrop-plan.json

token balance

$ txai token balance \
    --wallet txai1abc...

# Check specific denom
$ txai token balance \
    --wallet txai1abc... \
    --denom utxai

orderbook

$ txai orderbook depth \
    --pair TXAI/TX \
    --limit 20

# Place a limit order
$ txai orderbook place \
    --pair TXAI/TX \
    --side buy --price 0.5 \
    --amount 1000

config

$ txai config set network testnet
$ txai config set rpc \
    https://rpc.testnet.tx.org
$ txai config get network
# testnet

$ txai config list

System Design

Architecture

How agents, payments, and gates flow through the TX blockchain.


  ┌─────────────┐    memo protocol    ┌─────────────┐
  │  Agent A     │ ──────────────────→ │  Agent B     │
  │  (buyer)     │    payment + call   │  (service)   │
  └──────┬───────┘                     └──────┬───────┘
         │                                     │
         │  TX Smart Token                     │  Gate Check
         │  (clawback-enabled)                 │  (token/NFT/balance)
         ▼                                     ▼
  ┌─────────────────────────────────────────────────┐
  │              TX Blockchain (Coreum)              │
  │  ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
  │  │ Smart    │ │ On-chain │ │ Block Explorer   │ │
  │  │ Tokens   │ │ DEX      │ │ (verification)   │ │
  │  └──────────┘ └──────────┘ └──────────────────┘ │
  └─────────────────────────────────────────────────┘