MPP.Methods.EVM.Transaction (mpp v0.18.0)

Copy Markdown View Source

EVM type=transaction credential: client-signed EIP-1559 transfer, server broadcast.

The payload signature is a hex-encoded signed type-2 transaction (draft-evm-charge-00 § Transaction Payload). The server deserializes it, checks it against the challenged chain, token, recipient, and amount, rejects splits, checks the challenge expiry (a signed transfer has none of its own), then broadcasts via eth_sendRawTransaction. Settlement still requires the ERC-20 Transfer log, not only receipt status.

Enable acceptance and advertisement by setting "transaction" => true in method_config. Per draft-evm-charge-00 § Credential Type Negotiation, the MUST-accept default applies only when credentialTypes is omitted. EVM challenges always populate that list, so an unoffered transaction credential is rejected before decoding or RPC calls. Native ETH and split charges never advertise it and always reject it.

Summary

Functions

Broadcast a validated signed transaction and wait until the receipt is present.

Return true when this charge advertises and accepts type=transaction.

Decode and validate a signed EIP-1559 transfer against the charge.

Types

prepared()

@type prepared() :: %{hash: String.t(), raw: String.t()}

Functions

broadcast(map, charge)

@spec broadcast(prepared(), MPP.Intents.Charge.t()) ::
  {:ok, String.t()} | {:error, MPP.Errors.t()}

Broadcast a validated signed transaction and wait until the receipt is present.

offered?(charge)

@spec offered?(MPP.Intents.Charge.t()) :: boolean()

Return true when this charge advertises and accepts type=transaction.

validate(payload, charge)

@spec validate(map(), MPP.Intents.Charge.t()) ::
  {:ok, prepared()} | {:error, MPP.Errors.t()}

Decode and validate a signed EIP-1559 transfer against the charge.

Does not broadcast. Returns the canonical raw hex and its keccak hash.