@taprsvp/types
Version:
TypeScript types and interfaces for the Transaction Authorization Protocol (TAP)
102 lines • 4.92 kB
JavaScript
;
/**
* @fileoverview TAP Message Types and Data Structures
*
* This module provides TypeScript type definitions for the Transaction Authorization Protocol (TAP).
* TAP is a standardized protocol for multi-party transaction authorization before blockchain settlement.
*
* ## Key Features
* - **Type Safety**: Comprehensive TypeScript interfaces for all TAP message types
* - **JSON-LD Compatible**: All message types support JSON-LD contexts and type identifiers
* - **DIDComm Integration**: Built on DIDComm messaging for secure agent communication
* - **Chain Agnostic**: Support for multiple blockchains via CAIP standards
* - **Compliance Ready**: IVMS101 integration for travel rule compliance
*
* ## Core Message Types
* - `Transfer` - Initiate asset transfers between parties
* - `Payment` - Request payments from customers (merchant-initiated)
* - `Escrow` - Hold assets in escrow with conditional release
* - `Authorize` - Approve transactions after compliance checks
* - `Connect` - Establish connections between agents
* - `Settle` - Confirm on-chain settlement
*
* ## Usage Example
* ```typescript
* import { Transfer, TransferMessage } from '@taprsvp/types';
*
* const transfer: Transfer = {
* "@context": "https://tap.rsvp/schema/1.0",
* "@type": "Transfer",
* asset: "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f",
* amount: "100.00",
* originator: { ... },
* agents: [...]
* };
*
* const message: TransferMessage = {
* id: "uuid-here",
* type: "https://tap.rsvp/schema/1.0#Transfer",
* from: "did:example:sender",
* to: ["did:example:receiver"],
* created_time: Date.now(),
* body: transfer
* };
* ```
*
* @see {@link https://github.com/TransactionAuthorizationProtocol/TAIPs | TAIP Specifications}
* @see {@link https://tap.rsvp | TAP Protocol Documentation}
* @version 1.5.0
* @author Transaction Authorization Protocol Working Group
*/
Object.defineProperty(exports, "__esModule", { value: true });
// ============================================================================
// TAIP SPECIFICATION CROSS-REFERENCE
// ============================================================================
/**
* TAP Message Type to TAIP Specification Mapping
*
* This comprehensive mapping shows which TAIP specification defines each message type:
*
* **Core Protocol Framework:**
* - TAIP-1: Transaction Authorization Protocol Overview
* - TAIP-2: Message Format (DIDComm structure) → {@link DIDCommMessage}, {@link DIDCommReply}
*
* **Transaction Messages:**
* - TAIP-3: Transfer Message → {@link Transfer}, {@link TransferMessage}
* - TAIP-4: Authorization Flow → {@link Authorize}, {@link Settle}, {@link Reject}, {@link Cancel}, {@link Revert}, {@link AuthorizationRequired}
* - TAIP-14: Payment Request → {@link Payment}, {@link PaymentMessage}
* - TAIP-17: Composable Escrow → {@link Escrow}, {@link Capture}, {@link EscrowMessage}, {@link CaptureMessage}
*
* **Participant Management:**
* - TAIP-5: Agents → {@link Agent}, {@link UpdateAgent}, {@link AddAgents}, {@link ReplaceAgent}, {@link RemoveAgent}
* - TAIP-6: Party Identification → {@link Party}, {@link Person}, {@link Organization}, {@link UpdateParty}
*
* **Policy and Compliance:**
* - TAIP-7: Policies → {@link Policy}, {@link RequireAuthorization}, {@link RequirePresentation}, {@link RequirePurpose}, {@link UpdatePolicies}
* - TAIP-8: Verifiable Credentials → {@link RequirePresentation}, {@link PresentationMessage}
* - TAIP-9: Proof of Relationship → {@link RequireRelationshipConfirmation}, {@link ConfirmRelationship}
* - TAIP-12: Privacy-Preserving Name Matching → {@link Person.nameHash}
* - TAIP-13: Purpose Codes → {@link ISO20022PurposeCode}, {@link ISO20022CategoryPurposeCode}, {@link RequirePurpose}
*
* **Connection Management:**
* - TAIP-15: Agent Connection Protocol → {@link Connect}, {@link ConnectMessage}, {@link TransactionConstraints}
*
* **Invoice and Documentation:**
* - TAIP-16: Invoices → {@link Payment.invoice} (Invoice type imported from ./invoice)
*
* **Standards Integration:**
* - CAIP-2: Chain ID → {@link CAIP2}
* - CAIP-10: Account ID → {@link CAIP10}
* - CAIP-19: Asset ID → {@link CAIP19}
* - CAIP-74: CACAO → {@link CACAOAttachment}
* - CAIP-220: Transaction ID → {@link CAIP220}
* - RFC 8905: PayTo URI → {@link PayToURI}
* - ISO 24165: Digital Trust Identifier → {@link DTI}
* - ISO 17442: Legal Entity Identifier → {@link LEICode}
* - ISO 20022: Purpose Codes → {@link ISO20022PurposeCode}, {@link ISO20022CategoryPurposeCode}
* - IVMS101: Travel Rule Data → {@link Person}, {@link Organization}
*
* For the complete specifications, visit: https://github.com/TransactionAuthorizationProtocol/TAIPs
*/
// All types and interfaces are now exported directly in their declarations
//# sourceMappingURL=tap.js.map