example

A command that creates runnable TypeScript examples for AGIRAILS, a software kit for AI-agent payments. The examples cover payment transactions, disputes, event monitoring, batch work, and agent integration.

In plain words
What is it for?
Use it to generate examples for basic payments, full transaction lifecycles, dispute handling, transaction-event monitoring, batch operations, or connecting AGIRAILS to an AI-agent framework.
Why use it?
It gives developers complete starting code instead of requiring them to assemble an integration from separate reference pages. This helps them try common payment workflows more quickly.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/agirails/claude-plugin/example
Clone the repo
git clone --depth 1 https://github.com/agirails/claude-plugin
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,783 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00013 $0.02783
Opus 5 $0.00006 $0.01392
Sonnet 5 $0.00003 $0.00557
Haiku 4.5 $0.00001 $0.00278

Measured yesterday against content hash 8eb03b36d83f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

example scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/example.md · 351 lines

How it starts

The opening of the file, as written. The whole thing — 351 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/agirails:example

Generate ready-to-run code examples for AGIRAILS SDK integration.

What This Command Does

  1. Show available use cases
  2. Generate complete, runnable code example
  3. Optionally save to file

Step-by-Step Instructions

Step 1: Select Use Case

If argument provided, match against known use cases.

Otherwise, present options:

"What would you like to build?"
Options:
  [Basic Payment] - Simple pay and release flow
  [Full Lifecycle] - Complete transaction with all states
  [Dispute Handling] - Handle disputes and resolutions
  [Event Monitoring] - Listen for transaction events
  [Batch Operations] - Multiple transactions efficiently
  [Agent Integration] - Integrate with AI agent framework

Step 2: Generate Example

Basic Payment (TypeScript)
/**
 * AGIRAILS Basic Payment Example
 *
 * This example demonstrates the simplest payment flow:
 * 1. Create client
 * 2. Make payment
 * 3. Provider delivers
 * 4. Release funds
 *
 * Run: npx ts-node basic-payment.ts
 */

import { ACTPClient, IMockRuntime } from '@agirails/sdk';
import { ethers } from 'ethers';

// Configuration
const PROVIDER_ADDRESS = '0x2222222222222222222222222222222222222222';
const PAYMENT_AMOUNT = 10.00; // USDC

async function main() {
  console.log('=== AGIRAILS Basic Payment ===\n');

  // 1. Create client in mock mode (no real funds needed)
  const client = await ACTPClient.create({ mode: 'mock' });
  const myAddress = client.getAddress();
  console.log('✓ Client created in mock mode\n');

  // 2. Mint test USDC (mock mode only)
  // Mint uses USDC wei (6 decimals): 1000 USDC = 1_000_000_000
  await client.mintTokens(myAddress, '1000000000');
  const balance = await client.getBalance(myAddress);
  console.log(`✓ Balance (wei): ${balance}\n`);

  // 3. Create payment
  const result = await client.basic.pay({
    to: PROVIDER_ADDRESS,
    amount: PAYMENT_AMOUNT,
    deadline: '+24h',
  });
  console.log('✓ Payment created');
  console.log(`  Transaction ID: ${result.txId}`);
  console.log(`  State: ${result.state}`);
  console.log('');

  // 4. Simulate provider delivering (in production, provider calls this)
  // IN_PROGRESS is REQUIRED before DELIVERED
  await client.standard.transitionState(result.txId, 'IN_PROGRESS');
  // DELIVERED requires ABI-encoded dispute window proof
  const abiCoder = ethers.AbiCoder.defaultAbiCoder();
  const proof = abiCoder.encode(['uint256'], [172800]); // 2 days
  await client.standard.transitionState(result.txId, 'DELIVERED', proof);
  console.log('✓ Provider delivered\n');

  // 5. Release payment (after dispute window)
  await (client.advanced as IMockRuntime).time.advanceTime(172801); // 2 days + 1s
  await client.standard.releaseEscrow(result.txId);
  console.log('✓ Payment released to provider\n');

  // 6. Verify final state
  const status = await client.basic.checkStatus(result.txId);
  console.log(`Final state: ${status.state}\n`);

  console.log('=== Example Complete ===');
}

main().catch(console.error);

Read the full file on GitHub · 351 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 351 lines · 13 tokens per session scan A 8eb03b36d83f

Subscribe to this mod's changes

example is a command published in the GitHub repository agirails/claude-plugin (2 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 13 tokens to every session and 2,783 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.