pub struct ReceiptPayload<'a> {
pub kind: &'a str,
pub reference: &'a str,
pub amount: &'a str,
pub currency: &'a str,
pub recipient: &'a str,
pub method: &'a str,
pub timestamp: &'a str,
pub tool_call_id: &'a str,
pub approval_pos: &'a str,
pub approved_args_hash: &'a str,
pub subject: &'a str,
}Expand description
The receipt body fields receipt_payload signs, named at the call site.
Replaces positional &str arguments: with the positional form, two
same-typed fields (e.g. recipient and method) could be swapped at a call
site and still compile, silently signing a corrupt receipt. Naming the
fields here makes such a swap a compile error.
The field set, names, and the order they are serialized in
receipt_payload are the signed-payload contract: they must NOT change
without a version bump, or previously-persisted receipts stop verifying.
kind and the trailing four fields are v2 additions: the event kind
(direction) plus the binding tuple and an opaque subject. Inbound (the
server was paid) receipts have no approved tool call, so they pass empty
strings for the binding tuple and subject; outbound (the control plane
paid a 402 service) receipts populate them. Both directions sign their
kind.
Fields§
§kind: &'a strThe event kind the payload is stored under (payment_receipt for
inbound, outbound_payment_receipt for outbound). Signed so a payload
cannot be re-filed under the other direction’s kind (v2; empty for
legacy v1).
reference: &'a strChain/transaction reference (e.g. tx id) the receipt settles.
amount: &'a strDecimal amount as a string (avoids float drift).
currency: &'a strCurrency / asset symbol.
recipient: &'a strRecipient address.
method: &'a strSettlement method (e.g. tempo).
timestamp: &'a strRFC3339 settlement timestamp.
tool_call_id: &'a strThe paid_fetch tool-call id this payment answered (v2; empty for
inbound and legacy v1).
approval_pos: &'a strDecimal string of the approval_request log position the payment
answered (v2; empty for inbound and legacy v1).
approved_args_hash: &'a strsha256 hex of the approved args_json — the same idempotency-key
component the outbound_payment_attempt marker carries, so a verifier
can cross-check the receipt against the attempt (v2; empty otherwise).
subject: &'a strOpaque principal the spend is attributed to. Currently the conversation id; the structured agent/tenant identity is supplied later by the declarative-catalog identity model. Treat as opaque (v2; empty otherwise).
Trait Implementations§
Source§impl<'a> Clone for ReceiptPayload<'a>
impl<'a> Clone for ReceiptPayload<'a>
Source§fn clone(&self) -> ReceiptPayload<'a>
fn clone(&self) -> ReceiptPayload<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for ReceiptPayload<'a>
Auto Trait Implementations§
impl<'a> Freeze for ReceiptPayload<'a>
impl<'a> RefUnwindSafe for ReceiptPayload<'a>
impl<'a> Send for ReceiptPayload<'a>
impl<'a> Sync for ReceiptPayload<'a>
impl<'a> Unpin for ReceiptPayload<'a>
impl<'a> UnsafeUnpin for ReceiptPayload<'a>
impl<'a> UnwindSafe for ReceiptPayload<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more