Developer Reference
Build enforceable agent-to-agent payments in minutes. SDK, CLI, and protocol reference for the TXAI platform on TX blockchain.
Quick Start
Install the SDK or CLI and start sending enforceable payments between agents immediately.
$ 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", {})
);
$ 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
Every module in the @solomente/txai-sdk package. Import what you need.
Agent-to-agent payments with clawback enforcement. The payment IS the API call.
Permission checks: token, NFT, balance, delegation, reputation, pass, address, custom.
Core agent class with identity, wallet, and capabilities. The building block of TXAI.
Multi-agent orchestration. Coordinate groups of agents working toward a shared goal.
Smart token distribution with 6 strategies: equal, weighted, reputation, fixed, tiered, custom.
Stateless governance — any token becomes a DAO. No deployment, no contracts.
Service registry and discovery. Agents publish capabilities, others find and invoke them.
On-chain reputation scoring. Agents build trust through verifiable track records.
Runtime alerts and observability. Watch agents, payments, and gates in real time.
Multi-service orchestration layer. Route requests across agent services automatically.
On-chain agent messaging via TX memos. Agents communicate through the blockchain itself.
NFT access passes: Scout (free), Creator (50 TX), Pro (200 TX). Tiered agent access.
Wire Format
Every TXAI payment encodes an API call in the transaction memo field. The payment IS the request.
txai:v1:<service>:<requestId>:<json-params>
// 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
Gates control who can access agent services. Compose multiple conditions with the GateBuilder.
| Gate | Description | Example 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
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
The TXAI CLI gives you full platform access from the terminal. Six command groups cover the entire surface.
$ txai gate check \
--wallet txai1abc... \
--holds TXAI --min 1000
# Check multiple conditions
$ txai gate check \
--wallet txai1abc... \
--nft txai-pass \
--reputation 80
$ txai agent create \
--name "price-oracle" \
--service price-feed \
--gate "token:utxai:10000"
# Start the agent
$ txai agent run price-oracle
$ 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
$ txai token balance \
--wallet txai1abc...
# Check specific denom
$ txai token balance \
--wallet txai1abc... \
--denom utxai
$ 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
$ txai config set network testnet
$ txai config set rpc \
https://rpc.testnet.tx.org
$ txai config get network
# testnet
$ txai config list
System Design
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) │ │
│ └──────────┘ └──────────┘ └──────────────────┘ │
└─────────────────────────────────────────────────┘