Skip to content

Add Exchange/Quote messages (TAIP-18) and enhance Transfer/Payment/Connect#32

Merged
pelle merged 4 commits intomainfrom
claude/update-submodule-tap-protocol-ZEPqC
Feb 22, 2026
Merged

Add Exchange/Quote messages (TAIP-18) and enhance Transfer/Payment/Connect#32
pelle merged 4 commits intomainfrom
claude/update-submodule-tap-protocol-ZEPqC

Conversation

@pelle
Copy link
Copy Markdown
Contributor

@pelle pelle commented Feb 22, 2026

Summary

This PR implements TAIP-18 Exchange and Quote message types for asset exchange requests and pricing, while enhancing existing Transfer, Payment, and Connect messages with additional fields for compliance and operational requirements.

Key Changes

New Message Types (TAIP-18)

  • Exchange message: Initiates cross-asset exchange requests with support for multiple source/target assets, flexible amount specification (from_amount or to_amount), optional provider targeting, and policies
  • Quote message: Liquidity provider response to Exchange requests with specific asset pair, amounts, expiration timestamp, and agent tracking
  • Full validation and builder pattern support for both message types

Transfer Message Enhancements

  • Added expiry field for transaction expiration timestamps (ISO 8601)
  • Added transaction_value field containing TransactionValue struct with amount and currency for Travel Rule compliance (TAIP-3)
  • Updated all test fixtures and examples to include new fields

Payment Message Enhancements

  • Added expiry field for payment expiration
  • Enhanced invoice field to support both URL strings and structured invoice objects via InvoiceReference enum
  • Added fallback_settlement_addresses field with SettlementAddress parsing
  • Removed #[allow(dead_code)] from previously unused fields now being utilized
  • Added SupportedAsset enum and AssetPricing struct for flexible asset pricing with optional expiry

Connect Message Modernization (TAIP-15 v2)

  • Added requester field (Party) for explicit requester identification
  • Added agents field (Vec) for standard TAIP-5 agent support
  • Added agreement field for terms of service URLs
  • Added expiry field for connection expiration
  • Enhanced ConnectionConstraints with:
    • allowed_beneficiaries (Vec)
    • allowed_settlement_addresses (Vec, CAIP-10 format)
    • allowed_assets (Vec, CAIP-19 format)
  • Updated TransactionLimits with granular time periods: per_day, per_week, per_month, per_year (replacing daily)
  • Maintained backward compatibility with legacy fields (agent_id, agent, for_, role)

CLI and Tool Support

  • Added agent-mgmt command group for agent management (AddAgents, RemoveAgent, ReplaceAgent, UpdatePolicies)
  • Added Exchange and Quote subcommands to transaction CLI
  • Updated MCP tool schemas and registry to support new message types
  • Added TypeScript message helpers for Exchange and Quote creation

Supporting Infrastructure

  • Updated message enum and module exports to include Exchange and Quote
  • Updated all test fixtures across tap-msg, tap-node, tap-cli, and tap-agent to include new Transfer/Payment/Connect fields
  • Updated schema definitions in MCP tools for new parameters
  • Updated TAIP submodule reference

Implementation Details

  • New fields use #[serde(skip_serializing_if = "Option::is_none")] for backward compatibility
  • TransactionValue and TransactionValueInfo structs enable fiat value specification for compliance
  • InvoiceReference enum supports both simple URL and complex invoice object patterns
  • SettlementAddress::from_string() provides CAIP-10 parsing for settlement addresses
  • Connect message maintains dual API: legacy fields for backward compatibility, new v2 fields for modern usage
  • All new message types include comprehensive validation methods

https://claude.ai/code/session_01J3Noh65sbRuzL5MLTHazt2

Includes TAIP-3 transactionValue, TAIP-14 supportedAssets enhancements,
TAIP-15 Connect restructure, TAIP-18 Asset Exchange, and TAIP-19 ISO 20022.

https://claude.ai/code/session_01J3Noh65sbRuzL5MLTHazt2
- TAIP-3: Add transactionValue and expiry fields to Transfer message
- TAIP-14: Support flexible asset pricing in Payment (SupportedAsset enum
  with Simple and Priced variants via serde untagged)
- TAIP-15: Restructure Connect message with requester, agents, agreement,
  expiry fields; expand TransactionLimits (per_day/week/month/year) and
  ConnectionConstraints (allowedBeneficiaries/SettlementAddresses/Assets)
- TAIP-18: Add new Exchange and Quote message types with derive macros,
  validation, builders, CLI subcommands, and MCP tools
- Update all downstream crates, tests, examples, and TypeScript bindings

https://claude.ai/code/session_01J3Noh65sbRuzL5MLTHazt2
- Transfer (MCP + CLI): expose expiry and transaction_value fields
- Payment (MCP + CLI): expose expiry, wire invoice and fallback_settlement_addresses
- Connect (MCP + CLI): expose expiry, agreement, allowed_beneficiaries,
  allowed_settlement_addresses, allowed_assets in constraints
- CLI: add agent-mgmt subcommand with add-agents, remove-agent,
  replace-agent (TAIP-5) and update-policies (TAIP-7) commands

https://claude.ai/code/session_01J3Noh65sbRuzL5MLTHazt2
- tap-mcp: document tap_payment, tap_connect, tap_escrow, tap_capture,
  tap_exchange, tap_quote tools; add expiry and transaction_value to
  tap_create_transfer docs; update tool count to 38
- tap-cli: document --expiry, --transaction-value, --invoice-url,
  --fallback-addresses, --agreement flags; add exchange/quote commands;
  add agent-mgmt section (add-agents, remove-agent, replace-agent,
  update-policies)
- Root README: mention payment, exchange, and agent-mgmt commands;
  list all message types in key features

https://claude.ai/code/session_01J3Noh65sbRuzL5MLTHazt2
@pelle pelle merged commit 679ddfa into main Feb 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants