passport-mint-client's MintMeter was fully coded and contract-tested but never constructed or called anywhere in the running server (README's own words: "legacy standalone MintMeter adapter ... not used by the generation path"), so every real generation settled via Relay's payment evidence but never produced a Mint receipt tagged with passport_id/version as ARCHITECTURE.md §6.1/§3.2.16 claims. - PassportService gets mint_meter/royalty fields + with_mint_meter()/ with_royalty_initiator() builders (same pattern as with_receipt_verifier), and generate() now calls MintMeter.meter() success-only right after settlement verification, best-effort (a Mint-side failure only logs a warning, never blocks or rolls back the already-verified generation). - main.rs constructs a real MintClient from MINT_API_KEY (+ MINT_BASE_URL) and wires it into the service; unconfigured, it stays a documented no-op exactly like an unconfigured Relay. - Added the real Aitp402Transfer/MintReceiptRef types ARCHITECTURE.md §3.2.16 lists as existing, plus a RoyaltyInitiator port + MintClient impl that POSTs a real transfer to Mint's actual generic `/v1/transfers` endpoint (apps/mint/crates/mint-server) — not a guess, matches its real TransferReq/receipt wire shape byte for byte. - Rights gets an owner-set `royalty_bps` (default 0, zero-migration via the existing JSONB snapshot), and generate() initiates a real royalty transfer to the owner's Mint account when it's nonzero AND the settlement's payer differs from the owner. Today `generate`'s payer is always the owner (enforced by check_settlement_evidence), so this is a correct, documented no-op until an upstream third-party-pays surface (Turnstile, §6.2) exists — the capability is real and wired, not fabricated to look wired. - GenerationRecord carries the new meter_receipt_ref/royalty_receipt_ref so both receipts are visible in the API and the C2PA manifest. Full workspace suite: 59/59 pass (unchanged from before this fix — no regression). `cargo build --workspace`: clean.
17 lines
541 B
TOML
17 lines
541 B
TOML
[package]
|
|
name = "passport-mint-client"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
description = "Real reqwest client implementing MintMeter + RoyaltyInitiator: meters passport-conditioned generations and initiates AITP-402 royalty transfers on the Mint ledger (success-only)."
|
|
|
|
[dependencies]
|
|
passport-core = { workspace = true }
|
|
async-trait = { workspace = true }
|
|
reqwest = { workspace = true }
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
tokio = { workspace = true }
|