3 Simulated Lifecycle
Watch a full escrow cycle play out step-by-step. Choose Happy Path (delivery confirmed) or Dispute Path (jury resolution).
▶ Happy Path
⚠ Dispute Path
Reset
Create Agreement
Payer sends 100 SVCTKN to escrow contract with memo
Delivery Window Opens
24h window — clawback BLOCKED during this time
Provider Delivers
Provider submits proof hash to contract
Confirmed
Payment released to provider permanently
Jury Resolves
Oracle jury votes on the dispute
Verdict Executed
Contract auto-executes the jury's ruling
Created
Clawback blocked
Window expires
4 SDK Integration
Wire your agents to the contract with the TXAI SDK. One import, full escrow access.
// Connect to TX mainnet
const tx = await TXToken.connect({ mnemonic, network: 'mainnet' })
// Create on-chain escrow — funds held in contract
const result = await tx.payments.escrow.create({
provider: 'core1provider...',
denom: 'ucore',
amount: '1000000',
memo: 'TXAI:v1:price-oracle:{"pairs":["TX/USD"]}',
deliveryWindowSecs: 86400,
})
// Agreement #1 created, 1 CORE escrowed
// Provider delivers + submits proof
await tx.payments.escrow.confirmDelivery(1, 'ipfs://QmProof...')
// Payer claws back if window expires
await tx.payments.escrow.clawback(1)
// Query on-chain state
const agreement = await tx.payments.escrow.getAgreement(1)
const stats = await tx.payments.escrow.getStats()
Execute:
create, confirmDelivery, clawback, raiseDispute, resolveDispute, forceClawback
Query:
getAgreement, listAgreements, getStats, getMyPayments, getMyServices, canClawback
5 Autonomous Agent Pipeline
The EscrowOracleAgent runs autonomously — detects incoming escrow requests, fetches prices, submits proof on-chain. No human intervention.
🔍
DETECT
Poll contract for new requests
📄
PARSE
Read TXAI memo protocol
📈
FETCH
Get price from 5 exchanges
🔒
HASH
SHA-256 delivery proof
✅
SUBMIT
confirmDelivery on-chain
▶ Run Agent Demo
Reset
// Autonomous Oracle Agent — 6 lines to run forever
import { TXToken, EscrowOracleAgent } from '@solomente/tx-token-sdk'
import { TXPriceFeed } from '@solomente/tx-price-feed'
const tx = await TXToken.connect({ mnemonic, network: 'mainnet' })
const feed = new TXPriceFeed({ sources: ['coingecko', 'kraken', 'mexc'] })
const agent = new EscrowOracleAgent(tx.payments, feed, {
pollInterval: 15000,
supportedActions: ['price-oracle'],
})
// Start autonomous loop — detects, delivers, proves, gets paid
agent.start()
agent.on('detected ', (a) => console.log('New request #' + a.id))
agent.on('fulfilled ', (d) => console.log('Delivered $' + d.price))
agent.on('submitted ', (d) => console.log('Proof on-chain: ' + d.txHash))
agent.on('error ', (e) => console.error(e))
Events
detected, fetching, submitting, fulfilled, submitted, error, started, stopped
Protection
No double-delivery, inflight tracking, max concurrency, nonce serialization
Runtime Stats
detected, fulfilled, failed, pollCount, startedAt, isRunning