Skip to main content

agent_pay/
lib.rs

1//! agent-pay - L402 + DID-signed invoices for agent-to-agent Lightning payments.
2//!
3//! Rust port of [`@p-vbordei/agent-pay`](https://github.com/p-vbordei/agent-pay).
4//! Passes the same conformance vectors (C1-missing, C1-bad-sig, C2, C3, C4).
5
6pub mod bolt11;
7pub mod client;
8pub mod envelope;
9pub mod error;
10pub mod jcs;
11pub mod jws;
12pub mod keys;
13pub mod lightning;
14pub mod lnd_rest;
15pub mod memory_node;
16pub mod replay;
17pub mod server;
18pub mod token;
19
20pub const VERSION: &str = "agent-pay/0.1";
21
22pub use bolt11::{parse_invoice, ParsedInvoice};
23pub use client::{fetch_with_l402, FetchFn, FetchOptions, FetchResponse};
24pub use envelope::{
25    sign_invoice_envelope, sign_receipt, verify_invoice_envelope, verify_receipt, InvoiceEnvelope,
26    ReceiptEnvelope, SignInvoiceOpts, SignReceiptOpts,
27};
28pub use error::Error;
29pub use jcs::{canonical_json, jcs_hash};
30pub use jws::{sign_compact, verify_compact, ResolveKey};
31pub use keys::{
32    did_key_from_public_key, ed25519_sign, ed25519_verify, generate_key_pair,
33    public_key_from_did_key, verification_method_id, KeyPair,
34};
35pub use lightning::{Invoice, InvoiceCreateRequest, InvoiceLookup, LightningNode, PaymentResult};
36pub use memory_node::{MemoryLedger, MemoryNode};
37pub use replay::ReplayCache;
38pub use server::{InnerHandler, Paywall, PaywallOptions, PaywallResponse};
39pub use token::{issue_token, verify_token, TokenPayload};