EVM Permit2 credentials with challenge-bound witnesses and ordered splits.
Enable with "permit2" => true and a server "private_key" in method_config.
sign/5 takes the server's transaction-sending address as spender; this must
be agreed with the client because draft-evm-charge-00 does not define spender
discovery. The payer must already approve the Permit2 contract for the token.
The draft's exact witness suffix contains a space after the comma. Preserve
it in the Permit2 root type hash; the nested PaymentWitness struct uses the
canonical EIP-712 encoding. The canonical contract's batch entry point is an
overload of permitWitnessTransferFrom, not permitBatchWitnessTransferFrom.
Summary
Functions
Encode the canonical single or batch overload, retaining the draft witness suffix.
Compute the exact draft witness / canonical Permit2 EIP-712 digest.
Return whether this charge has an explicitly configured Permit2 settler.
Verify, submit, and confirm every ordered transfer in a Permit2 credential.
Sign a credential; nonce and deadline are decimal uint256 strings.
Validate the charge binding and recover the payer before any RPC or submission.
Functions
Encode the canonical single or batch overload, retaining the draft witness suffix.
@spec digest(map(), MPP.Intents.Charge.t(), String.t()) :: {:ok, binary()} | {:error, MPP.Errors.t()}
Compute the exact draft witness / canonical Permit2 EIP-712 digest.
@spec offered?(MPP.Intents.Charge.t()) :: boolean()
Return whether this charge has an explicitly configured Permit2 settler.
@spec settle(map(), MPP.Intents.Charge.t()) :: {:ok, MPP.Receipt.t()} | {:error, MPP.Errors.t()}
Verify, submit, and confirm every ordered transfer in a Permit2 credential.
@spec sign(MPP.Intents.Charge.t(), String.t(), String.t(), String.t(), String.t()) :: {:ok, map()} | {:error, MPP.Errors.t()}
Sign a credential; nonce and deadline are decimal uint256 strings.
@spec verify(map(), MPP.Intents.Charge.t()) :: {:ok, String.t()} | {:error, MPP.Errors.t()}
Validate the charge binding and recover the payer before any RPC or submission.