Strict auth-capture receipt identity and escrow-event checks.
Expected events come from the execution layer's full verification result, not a request-provided assertion. Successful receipts must contain exactly one matching event from the configured escrow, with canonical ABI data and matching transaction/block provenance. Reverted receipts must have no logs.
This pure check does not establish chain identity, canonical inclusion, or finality. The execution layer must check those against its trusted RPC before recording a final journal outcome. Contract addresses are deployment configuration, not independent runtime-code authenticity proofs.
Summary
Functions
Checks receipt identity, status and event data, returning unfinalized inclusion.
Builds the exact escrow event for a fully verified operation.
Types
@type inclusion() :: %{ outcome: :confirmed | :reverted, block_hash: String.t(), block_number: non_neg_integer(), transaction_index: non_neg_integer() }
Functions
Checks receipt identity, status and event data, returning unfinalized inclusion.
identity must come from the frozen transaction. A successful result still
needs canonical-block and confirmation-depth checks by the execution layer.
Examples
iex> X402.AuthCapture.Receipt.check(nil, %{}, %{})
{:error, :invalid_receipt}
@spec expected_event( X402.Verify.AuthCaptureEVM.verification(), :primary | :void_remainder ) :: {:ok, event()} | {:error, term()}
Builds the exact escrow event for a fully verified operation.
:primary selects the original operation. :void_remainder selects the
separately submitted void leg after a partial capture and uses the remaining
capturable balance, not the captured amount.
Examples
iex> X402.AuthCapture.Receipt.expected_event(%{})
{:error, :invalid_verification}