tap_msg/
lib.rs

1//! Implementation of the Transaction Authorization Protocol (TAP)
2//!
3//! This crate provides the core functionality for the Transaction Authorization
4//! Protocol (TAP), including message definitions, serialization, validation,
5//! and DIDComm integration.
6//!
7//! The Transaction Authorization Protocol (TAP) is a multi-party protocol for
8//! authorizing, documenting, and recording financial transactions for
9//! cryptocurrency asset transfers.
10
11// Re-export the didcomm crate for convenience to users of tap-msg
12pub use didcomm;
13
14// Internal modules
15pub mod derive;
16pub mod error;
17pub mod examples;
18pub mod message;
19pub mod utils;
20
21// Re-export public types for easier access
22pub use error::{Error, Result};
23pub use message::{
24    create_tap_message, AddAgents, Attachment, AttachmentData, Authorize, DocumentReference,
25    ErrorBody, Invoice, LineItem, OrderReference, Participant, PaymentRequest, Presentation,
26    Reject, Settle, TapMessageBody, TaxCategory, TaxSubtotal, TaxTotal, Transfer, Validate,
27};
28
29// Conditional compilation for WASM targets
30#[cfg(target_arch = "wasm32")]
31pub mod wasm {
32    //! WASM-specific functionality
33
34    use wasm_bindgen::prelude::*;
35
36    /// Initialize the WASM module.
37    #[wasm_bindgen(start)]
38    pub fn init() {
39        #[cfg(feature = "console_error_panic_hook")]
40        console_error_panic_hook::set_once();
41    }
42}
43
44// Test modules
45#[cfg(test)]
46mod tests {
47    // Tests are now in the tests directory
48}