Parse and match Solana payment instructions for MPP.Methods.Solana.
Two input shapes are supported:
- compiled legacy transactions (
Cartouche.Solana.Transaction) for pull-mode pre-broadcast checks (instruction allow-list + payment legs) jsonParsedgetTransactionresults for push-mode and post-confirm payment matching
Observed jsonParsed transfer shapes were captured from Solana devnet
(getTransaction / getBlock on 2026-08-19) and are the authority for
field names used here.
Summary
Functions
Classify compiled instructions on a legacy transaction.
Classify top-level jsonParsed instructions from a getTransaction result.
Return the payment legs implied by a charge (primary remainder + splits).
Validate split entries in method_config (shape only; amount vs charge is checked when the charge is available).
Enforce the pull-mode instruction allow-list, ATA policy, and compute-budget ceilings, then match payment legs against the challenge.
Match payment legs in a confirmed jsonParsed transaction against the charge.
Types
Functions
@spec classify_compiled(Cartouche.Solana.Transaction.t()) :: {:ok, [classified()]} | {:error, String.t()}
Classify compiled instructions on a legacy transaction.
Returns {:ok, [classified]} or {:error, reason} when an account index
is out of range.
@spec classify_parsed(map()) :: {:ok, [classified()]} | {:error, String.t()}
Classify top-level jsonParsed instructions from a getTransaction result.
@spec payment_legs(MPP.Intents.Charge.t()) :: {:ok, [map()]} | {:error, MPP.Errors.t()}
Return the payment legs implied by a charge (primary remainder + splits).
@spec validate_splits_config!([map()] | nil) :: :ok
Validate split entries in method_config (shape only; amount vs charge is checked when the charge is available).
@spec verify_compiled(Cartouche.Solana.Transaction.t(), MPP.Intents.Charge.t(), map()) :: :ok | {:error, MPP.Errors.t()}
Enforce the pull-mode instruction allow-list, ATA policy, and compute-budget ceilings, then match payment legs against the challenge.
@spec verify_parsed(map(), MPP.Intents.Charge.t(), map()) :: :ok | {:error, MPP.Errors.t()}
Match payment legs in a confirmed jsonParsed transaction against the charge.