Skip to content

Commit 2fcabab

Browse files
pelleclaude
andauthored
Remove Complete message type per updated TAIP specifications (#21)
* Remove Complete message type per updated TAIP specifications - Remove Complete message implementation from tap-msg - Remove CompleteTool from tap-mcp tools - Update test files to remove Complete references - Update MCP integration test to expect 30 tools instead of 31 - Update README.md to list Cancel and Revert instead of Complete This aligns the codebase with the updated TAIP specifications where the Complete message has been removed in favor of using the standard TAIP-4 authorization flow (Payment -> Authorize -> Settle). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Update TAIPs submodule to latest and add implementation TASKS.md - Updated TAIPs submodule to commit 2f8e503 with significant enhancements: - Schema.org Organization attributes for Agents and Parties - AuthorizationRequired message moved to TAIP-4 - RFC 8905 PayTo URI support for settlement addresses - Fallback settlement addresses for Payment messages - Schema.org Product attributes for invoice line items - Enhanced IVMS101 data inclusion - ServiceUrl field for Agent DIDComm endpoint fallback - Added TASKS.md with TDD-focused implementation plan - Organized into 5 phases with test-first approach - Each feature has failing tests written before implementation - Maintains backward compatibility through optional fields * Phase 1: Add schema.org Organization fields to Agent and Party - Added schema.org Organization field accessors and builders to Agent: - name, url, logo, description, email, telephone fields - serviceUrl field for DIDComm endpoint fallback (TAIP-5) - All fields use existing metadata HashMap for backward compatibility - Added typed accessor methods and builder pattern support - Added schema.org Organization field accessors and builders to Party: - name, url, logo, description, email, telephone fields - Added with_metadata_field builder method - All fields use existing metadata HashMap for backward compatibility - Verified IVMS101 data can coexist with schema.org fields - Followed TDD approach: wrote failing tests first, then implementation - All tests passing, JSON-LD compliance maintained - Updated TASKS.md to mark Phase 1 as complete * Phase 2: Update AuthorizationRequired message to match TAIP-4 specification - Updated existing AuthorizationRequired struct in connection.rs: - Changed 'url' field to 'authorizationUrl' per TAIP-4 - Made 'expires' field required (was optional) - Added optional 'from' field for party type (customer, principal, originator, beneficiary) - Removed deprecated 'agent_id' field - Updated validation logic: - Validates expires is present and in ISO 8601 format - Validates 'from' field contains valid party type if present - Added comprehensive tests: - Creation and builder pattern tests - Serialization/deserialization tests - Validation tests for all fields - JSON compliance with TAIP-4 specification - Updated TASKS.md to mark Phase 2 as complete Note: AuthorizationRequired was moved from TAIP-15 to TAIP-4 as a standard authorization message, replacing the removed Complete message functionality. * Fix code formatting with cargo fmt - Applied cargo fmt to all modified files - Fixed formatting in Agent and Party accessor methods - Fixed formatting in test files - Fixed import statement formatting - No functional changes, only formatting cleanup * Update TAIPs submodule with latest test vectors - Added test vectors for AuthorizationRequired matching TAIP-4 specification - Added test vectors for Transfer with PayTo URI support (RFC 8905) - Added test vectors for Escrow messages (TAIP-17) - Added test vectors for Payment with PayTo URI invoices - Fixed existing test vectors to match JSON schema requirements The AuthorizationRequired test vectors now correctly use 'authorizationUrl' field name as specified in TAIP-4, which matches our implementation. * feat: Add settlement address and product attribute support per updated TAIPs - Add PayTo URI support (RFC 8905) for traditional payment systems - Add SettlementAddress enum supporting both CAIP-10 and PayTo URIs - Add fallbackSettlementAddresses field to Payment messages - Add schema.org/Product attributes (name, image, url) to LineItem - Add LineItem builder for easier construction - Update all existing LineItem usages with new fields - Add comprehensive tests for all new features 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: Update CHANGELOG with settlement address and product attribute changes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: Update TASKS.md with completed implementation items Mark all completed implementation tasks with [x]: - Phase 1-4: All tasks completed - Phase 5: Partial completion (integration and validation done) Remaining items are MCP-specific integrations and test vector validation which are separate from the core TAP message implementation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: Bump all crates to version 0.5.0 - Update workspace version from 0.4.0 to 0.5.0 - Update all internal dependencies between crates to 0.5.0 - Update CHANGELOG to mark 0.5.0 release 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: Update documentation for v0.5.0 release - Add v0.5.0 highlights to main README - Document PayTo URI support and settlement address flexibility - Add examples for fallback settlement addresses - Document enhanced metadata support for Agents/Parties/LineItems - Add code examples for new schema.org Organization fields - Add examples for Product attributes in invoice line items - Update tap-msg README with new features 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * feat: Add TAIP-17 Composable Escrow support - Implement Escrow message for holding assets on behalf of parties - Implement Capture message for releasing escrowed funds - Support both cryptocurrency assets (CAIP-19) and fiat currencies (ISO 4217) - Add automatic expiry handling for escrows - Enable payment guarantees, asset swaps, and conditional payments - Add EscrowAgent role with validation for exactly one per escrow - Add comprehensive tests for all escrow scenarios - Update TapMessage enum to include Escrow and Capture variants - Update CHANGELOG with TAIP-17 support documentation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * feat: Add MCP tools for TAIP-14, TAIP-15, and TAIP-17 messages This commit extends the TAP MCP server to support Payment (TAIP-14), Connect (TAIP-15), and Escrow/Capture (TAIP-17) message creation and management alongside the existing Transfer tools. New MCP Tools Added: - CreatePaymentTool: Creates TAIP-14 Payment messages with asset or currency support - CreateConnectTool: Creates TAIP-15 Connect messages with constraints and limits - CreateEscrowTool: Creates TAIP-17 Escrow messages with automatic EscrowAgent validation - CaptureTool: Creates TAIP-17 Capture messages for releasing escrowed funds Key Features: - Full schema definitions for all new tools with parameter validation - Support for both cryptocurrency (CAIP-19) and fiat currency transactions - Connection constraint handling with transaction limits - Automatic validation of EscrowAgent requirements per TAIP-17 - Integration with existing TAP node message delivery infrastructure Technical Details: - Added comprehensive parameter structures for each message type - Implemented proper field mapping between MCP parameters and TAP message structs - Fixed Payment struct compatibility by adding fallback_settlement_addresses field - Enhanced error handling and validation for all new message types 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * feat: Add MCP resources for database schema and enhanced TAP message schemas Add two new MCP resources to provide better access to read-only data: 1. Database Schema Resource (tap://database-schema) - Provides comprehensive database schema information for agent storage - Supports filtering by agent_did (required) and table_name (optional) - Returns table structures, column info, indexes, and row counts - Uses read-only SQLite connections for safety - Replaces need to use database schema tool for read-only access 2. Enhanced TAP Message Schemas Resource (tap://schemas) - Existing resource enhanced with individual schema lookup capability - Supports tap://schemas/{MessageType} for specific schemas - Includes comprehensive JSON schemas for all TAP message types - Added version information and structured metadata - Supports lookup by both message type name and URL Technical changes: - Updated resource registry to include new database-schema resource - Enhanced schemas resource with path-based routing for individual lookups - Added database connection logic to resources layer - Updated tests to reflect new resource count (6 total) - Updated tool count in tests (34 total) - Refactored schema generation to support both full and individual access 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * style: Apply cargo fmt formatting to resources.rs Apply standard Rust formatting to the new MCP resources code. * style: Apply cargo fmt formatting across workspace Apply standard Rust formatting to all files in the workspace. This includes formatting changes to: - tap-mcp tools and schemas - tap-msg message types and tests - Add Claude agent configuration file 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: Update README with new MCP resources documentation Update README.md to document the new MCP resources added in v0.5.0: 1. Database Schema Resource (tap://database-schema) - Document new resource for accessing agent database schemas - Show query parameters and usage examples - Explain relationship to tap_get_database_schema tool 2. Enhanced TAP Schemas Resource (tap://schemas) - Document individual schema lookup capability - Show examples for specific message types (Transfer, Authorize, etc.) - Highlight v0.5.0 enhancements 3. Updated Examples - Add examples showing how to use the new resources - Include database schema and individual message schema lookups - Maintain consistency with existing documentation style 4. Resource Count Update - Update tool count from 29 to 34 tools - Update resource count to 6 total resources - Reflect current capabilities accurately 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Resolve compiler warnings in transaction_tools.rs - Fix unused variable warnings by prefixing with underscores - Add #[allow(dead_code)] to unused struct fields in payment/connect params - Remove redundant uuid import 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: Update dependencies to latest compatible versions Update all workspace dependencies to their latest compatible versions: - tokio: 1.32.0 → 1.47.1 - anyhow: 1.0.75 → 1.0.99 - uuid: 1.16.0 → 1.18.0 - base64: 0.21 → 0.22 - async-trait: 0.1 → 0.1.89 - ed25519-dalek: 2.0 → 2.2 - reqwest: 0.11 → 0.12 - hyper: 0.14 → 1.6 - dirs: 5.0 → 6.0 - dashmap: 5.4 → 6.1 - tokio-tungstenite: 0.20 → 0.24 - sqlx: 0.8.2 → 0.8.6 - criterion: 0.5 → 0.6 - once_cell: 1.18/1.8 → 1.21.3 - proptest: 1.2/1.6 → 1.7 - rstest: 0.18 → 0.25 - clap: 4.4 → 4.5 Maintained compatibility versions for: - rand: kept at 0.8 for crypto library compatibility - getrandom: kept at 0.2 for WASM feature compatibility - thiserror: standardized on 1.0 across workspace All core crates (tap-msg, tap-caip, tap-ivms101) build and pass tests. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Individual schema lookup now returns only requested schema Fixed the MCP schemas resource to return only the specific schema when requesting individual message types (e.g., tap://schemas/Payment). Changes: - Modified read_specific_schema() to use consistent schema structure - Individual schema responses now match the format of full schema responses - Added test for specific schema resource access 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * feat: Add payment link support with Out-of-Band invitations to tap-agent This commit implements comprehensive payment link functionality for the tap-agent crate, enabling creation of shareable payment links using DIDComm v2 Out-of-Band invitations according to TAIP-2 and TAIP-14 specifications. ## New Features ### Out-of-Band (OOB) Message Support - Full DIDComm v2 Out-of-Band invitation implementation (TAIP-2 compliant) - URL encoding/decoding with base64url encoding for safe transmission - Signed attachment support for carrying DIDComm messages - Validation logic for TAP-specific goal codes (tap.payment, tap.connect, tap.transfer) - Builder pattern for easy OOB invitation creation ### Payment Link Functionality - PaymentLink struct with configurable service URLs and metadata - Default service URL: https://flow-connect.notabene.dev/payin - Support for custom metadata and goal descriptions - Builder pattern for streamlined configuration ### Extended Agent Trait - create_oob_invitation() - Generic method supporting any TAP message type - create_payment_link() - Specialized method for Payment messages - parse_oob_invitation() - Parse OOB invitation URLs back to structures - process_oob_invitation() - Extract and verify signed messages from invitations ### Generic Design - Works with any TAP message type implementing TapMessageBody trait - Not limited to payments - supports transfers, connections, and future message types - Configurable service endpoints for different deployment scenarios - Extensible metadata support for custom use cases ## Technical Implementation ### Cryptographic Integration - JWS (JSON Web Signature) message signing using Ed25519 keys - DIDComm v2 message packing/unpacking with proper key management - Signature verification with DID resolution support ### Standards Compliance - TAIP-2 (DIDComm messaging) specification compliance - TAIP-14 (payments) specification support - DIDComm v2 Out-of-Band invitation format adherence - URL-safe base64url encoding for query parameters ### Code Organization - tap-agent/src/oob.rs - Out-of-Band invitation core functionality - tap-agent/src/payment_link.rs - Payment link specific features - Extended Agent trait in tap-agent/src/agent.rs with 4 new methods - Comprehensive test suite with 14 total tests (7 integration + 7 unit tests) ## Files Added - tap-agent/src/oob.rs - Out-of-Band invitation implementation - tap-agent/src/payment_link.rs - Payment link functionality - tap-agent/tests/simple_payment_link_tests.rs - Comprehensive test suite - tap-agent/PAYMENT_LINKS.md - Documentation and usage examples ## Files Modified - tap-agent/src/agent.rs - Extended Agent trait with OOB methods - tap-agent/src/lib.rs - Added module exports for new functionality 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Resolve compilation errors and update deprecated APIs - Fix missing fallback_settlement_addresses field in Payment structs across examples and tests - Update base64 API calls to use new Engine interface (base64::engine::general_purpose::STANDARD.encode) - Migrate Hyper mock server to 1.x API with http-body-util for body handling - Fix payment_link_flow example with correct Secret, Party, and Agent constructors - Add missing imports and dependencies (tracing-subscriber, SettlementAddress, InvoiceReference) - Resolve field access patterns for Party.name() method calls - Remove non-existent policies field from Payment initialization - Update settlement address creation to use proper SettlementAddress::from_string() 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: Update TAIPs submodule to latest version Updated prds/taips submodule from 32b2b67 to ba992e1, which includes: - CHANGELOG.md updates - Reorganized test vectors structure (moved files to appropriate subdirectories) - Fixed test vector organization for better structure This ensures we have the latest TAIP specifications and test vectors for our payment link implementation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * test: Fix race condition in test_create_transfer_tool and improve test vector validation - Identified and resolved race condition in tap-mcp integration tests that caused intermittent failures - Enhanced test vector validation for Transfer, Payment, and Escrow messages with better error handling - Updated TAIPs submodule to latest version for compatibility - Tests now pass consistently when run with proper isolation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 56c18de commit 2fcabab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+5735
-308
lines changed

.claude/agents/tap-expert.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
name: tap-expert
3+
description: Use proactively to retrieve and extract relevant information about the TAP spec and TAIPs
4+
tools: Read, Grep, Glob
5+
color: blue
6+
---
7+
8+
You are a specialized information retrieval agent for TAP message specs. Your role is to efficiently fetch and extract relevant content from the TAP spec repo while avoiding duplication.
9+
10+
## Core Responsibilities
11+
12+
1. **Context Check First**: Determine if requested information is already in the main agent's context
13+
2. **Selective Reading**: Extract only the specific sections or information requested
14+
3. **Smart Retrieval**: Use grep to find relevant sections rather than reading entire files
15+
4. **Return Efficiently**: Provide only new information not already in context
16+
17+
## Supported File Types
18+
19+
- Specs: @prds/taips/TAIPs/*.md
20+
- Product docs: @prds/taips/*.md
21+
- Typescript types: @prds/taips/packages/typescript/src/*.ts
22+
- JSON schemas: @prds/taips/schemas/**/*.json
23+
24+
## Workflow
25+
26+
1. Check if the requested information appears to be in context already
27+
2. If not in context, locate the requested file(s)
28+
3. Extract only the relevant sections
29+
4. Return the specific information needed
30+
31+
## Output Format
32+
33+
For new information:
34+
```
35+
📄 Retrieved from [file-path]
36+
37+
[Extracted content]
38+
```
39+
40+
For already-in-context information:
41+
```
42+
✓ Already in context: [brief description of what was requested]
43+
```
44+
45+
## Smart Extraction Examples
46+
47+
Request: "Get the pitch from mission-lite.md"
48+
→ Extract only the pitch section, not the entire file
49+
50+
Request: "Find CSS styling rules from code-style.md"
51+
→ Use grep to find CSS-related sections only
52+
53+
Request: "Get Task 2.1 details from tasks.md"
54+
→ Extract only that specific task and its subtasks
55+
56+
## Important Constraints
57+
58+
- Never return information already visible in current context
59+
- Extract minimal necessary content
60+
- Use grep for targeted searches
61+
- Never modify any files
62+
- Keep responses concise
63+
64+
Example usage:
65+
- "Get the product pitch from mission-lite.md"
66+
- "Find Ruby style rules from code-style.md"
67+
- "Extract Task 3 requirements from the password-reset spec"

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,42 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.5.0] - 2025-08-14
9+
10+
### Added
11+
12+
#### Composable Escrow Support (TAIP-17)
13+
- New `Escrow` message for holding assets on behalf of parties
14+
- New `Capture` message for releasing escrowed funds
15+
- Support for both cryptocurrency assets and fiat currencies in escrows
16+
- Automatic expiry handling for escrows
17+
- Support for payment guarantees, asset swaps, and conditional payments
18+
- Multiple agent roles including dedicated EscrowAgent role
19+
- Full validation ensuring exactly one EscrowAgent per escrow
20+
21+
#### Settlement Address Enhancements
22+
- PayTo URI support (RFC 8905) for traditional payment systems (IBAN, ACH, BIC, UPI)
23+
- `SettlementAddress` enum supporting both CAIP-10 blockchain addresses and PayTo URIs
24+
- `fallbackSettlementAddresses` field in Payment messages for flexible payment options
25+
- Full validation and serialization for PayTo URIs
26+
27+
#### Invoice Product Attributes
28+
- Schema.org/Product attributes to LineItem (name, image, url)
29+
- LineItem builder pattern for easier construction
30+
- Support for product metadata in invoice line items
31+
32+
#### Agent and Party Enhancements
33+
- Schema.org Organization fields for Agent and Party structures
34+
- Added fields: name, url, logo, description, email, telephone, serviceUrl
35+
- Builder methods and accessor functions for all new fields
36+
- Backward compatible with existing IVMS101 data
37+
38+
### Changed
39+
- AuthorizationRequired message updated to match TAIP-4 specification
40+
- Field `url` renamed to `authorizationUrl`
41+
- Field `expires` now required
42+
- Added optional `from` field
43+
844
## [0.4.0] - 2025-06-17
945

1046
### Added

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ members = [
1212
resolver = "2"
1313

1414
[workspace.package]
15-
version = "0.4.0"
15+
version = "0.5.0"
1616
edition = "2021"
1717
authors = ["Pelle Braendgaard <pelle@notabene.id>"]
1818
description = "Rust implementation of the Transaction Authorization Protocol (TAP)"
@@ -33,7 +33,7 @@ serde = { version = "1.0", features = ["derive"] }
3333
serde_json = "1.0"
3434

3535
# Async runtime - minimal features for WASM compatibility
36-
tokio = { version = "1.32.0", default-features = false, features = [
36+
tokio = { version = "1.47.1", default-features = false, features = [
3737
"sync",
3838
"macros",
3939
"io-util",
@@ -43,10 +43,10 @@ tokio = { version = "1.32.0", default-features = false, features = [
4343

4444
# Error handling
4545
thiserror = "1.0"
46-
anyhow = "1.0.75"
46+
anyhow = "1.0.99"
4747

4848
# UUID generation with WASM support
49-
uuid = { version = "1.16.0", features = ["v4", "serde", "fast-rng", "js"] }
49+
uuid = { version = "1.18.0", features = ["v4", "serde", "fast-rng", "js"] }
5050

5151
# Time handling with serde support
5252
chrono = { version = "0.4", features = ["serde"] }
@@ -76,7 +76,7 @@ web-sys = { version = "0.3", features = [
7676
getrandom = { version = "0.2", features = ["js"] }
7777

7878
# Cryptography and encoding
79-
base64 = "0.21"
79+
base64 = "0.22"
8080
multibase = "0.9"
8181

8282
# Testing
@@ -85,7 +85,7 @@ assert_matches = "1.5.0"
8585
wasm-bindgen-test = "0.3"
8686

8787
# Async traits
88-
async-trait = "0.1"
88+
async-trait = "0.1.89"
8989

9090
# Common profile settings for all crates in the workspace
9191
[profile.release]

README.md

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
This repository contains a Rust implementation of the Transaction Authorization Protocol (TAP), a decentralized protocol for securely authorizing blockchain transactions before they are submitted on-chain. TAP-RS targets payment-related use cases, Travel Rule compliance, and secure transaction coordination.
44

5-
**New in this release**: Full Travel Rule support with IVMS101 data model implementation, automatic customer data extraction, and compliance workflow automation.
5+
**New in v0.5.0**:
6+
- PayTo URI support (RFC 8905) for traditional payment systems (IBAN, ACH, BIC, UPI)
7+
- Fallback settlement addresses for flexible payment options
8+
- Schema.org Product attributes for invoice line items
9+
- Enhanced Agent and Party structures with Organization fields
610

711
## Project Structure
812

@@ -116,12 +120,14 @@ See individual tool READMEs for detailed usage instructions.
116120

117121
## Key Features
118122

119-
- **Complete TAP Implementation**: Support for all TAP message types (Transfer, Authorize, Reject, Settle, Complete, etc.)
123+
- **Complete TAP Implementation**: Support for all TAP message types (Transfer, Authorize, Reject, Settle, Cancel, Revert, etc.)
120124
- **DIDComm v2 Integration**: Secure, encrypted messaging with authenticated signatures
121125
- **Chain Agnostic Identifiers**: Implementation of CAIP-2 (ChainID), CAIP-10 (AccountID), and CAIP-19 (AssetID)
126+
- **Settlement Address Flexibility**: Support for both blockchain (CAIP-10) and traditional payment systems (PayTo URI)
122127
- **Multiple DID Methods**: Support for did:key, did:web, did:pkh, and more
123128
- **Travel Rule Compliance**: Full IVMS 101.2023 implementation with automatic data attachment
124129
- **Customer Data Management**: Automatic extraction and storage of party information from TAP messages
130+
- **Enhanced Metadata Support**: Schema.org Organization fields for Agents/Parties and Product attributes for invoices
125131
- **Command-line Tools**: Utilities for DID generation, resolution, and key management
126132
- **Modular Agent Architecture**: Flexible identity and cryptography primitives
127133
- **High-Performance Message Routing**: Efficient node implementation for high-throughput environments
@@ -179,6 +185,67 @@ let message = transfer.to_didcomm_with_route(
179185

180186
See the [tap-msg README](./tap-msg/README.md) for more detailed examples.
181187

188+
## New in v0.5.0: Settlement Address Flexibility
189+
190+
TAP-RS now supports both blockchain and traditional payment settlement addresses:
191+
192+
```rust
193+
use tap_msg::settlement_address::{SettlementAddress, PayToUri};
194+
use tap_msg::Payment;
195+
196+
// Traditional payment system addresses using PayTo URI (RFC 8905)
197+
let iban_address = SettlementAddress::from_string(
198+
"payto://iban/DE75512108001245126199".to_string()
199+
)?;
200+
201+
let ach_address = SettlementAddress::from_string(
202+
"payto://ach/122000247/111000025".to_string()
203+
)?;
204+
205+
// Blockchain addresses using CAIP-10
206+
let eth_address = SettlementAddress::from_string(
207+
"eip155:1:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb".to_string()
208+
)?;
209+
210+
// Payment with fallback settlement addresses
211+
let payment = Payment::builder()
212+
.amount("100.00".to_string())
213+
.currency_code("USD".to_string())
214+
.merchant(Party::new("did:example:merchant"))
215+
.fallback_settlement_addresses(vec![
216+
iban_address, // Primary: traditional bank transfer
217+
eth_address, // Fallback: Ethereum address
218+
])
219+
.build();
220+
```
221+
222+
## Enhanced Metadata Support
223+
224+
Agents, Parties, and LineItems now support rich metadata:
225+
226+
```rust
227+
use tap_msg::{Agent, LineItem};
228+
229+
// Agent with Organization metadata
230+
let agent = Agent::new("did:example:agent", "PaymentProcessor", "did:example:merchant")
231+
.with_name("Example Payment Services")
232+
.with_url("https://example.com")
233+
.with_email("support@example.com")
234+
.with_telephone("+1-555-0100");
235+
236+
// LineItem with Product attributes
237+
let line_item = LineItem::builder()
238+
.id("item-001".to_string())
239+
.description("Premium Coffee Beans".to_string())
240+
.quantity(2.0)
241+
.unit_price(25.99)
242+
.line_total(51.98)
243+
.name("Colombian Arabica Premium Blend".to_string())
244+
.image("https://example.com/products/coffee.jpg".to_string())
245+
.url("https://example.com/products/coffee".to_string())
246+
.build();
247+
```
248+
182249
## Typed Messages for Type Safety
183250

184251
TAP-RS now supports generic typed messages for compile-time type safety while maintaining 100% backward compatibility:

0 commit comments

Comments
 (0)