MPP.Methods.USDC.Profile behaviour (mpp v0.19.0)

Copy Markdown View Source

One usdc charge profile.

Stacks (Task 122) and Gateway (Task 123) register another module in MPP.Methods.USDC.profiles/0. That registration does not change the EVM or Solana verification modules.

Summary

Callbacks

Public profile object nested under methodDetails.type.

Credential payload.type this profile accepts.

Wire name stored in methodDetails.type.

Raise ArgumentError when method_config cannot advertise this profile.

Verify a credential and return the USDC receipt.

Callbacks

challenge_details(t)

@callback challenge_details(MPP.Intents.Charge.t()) :: map()

Public profile object nested under methodDetails.type.

credential_type()

@callback credential_type() :: String.t()

Credential payload.type this profile accepts.

name()

@callback name() :: String.t()

Wire name stored in methodDetails.type.

validate_config!(map)

@callback validate_config!(map()) :: :ok

Raise ArgumentError when method_config cannot advertise this profile.

verify(map, t)

@callback verify(map(), MPP.Intents.Charge.t()) ::
  {:ok, MPP.Receipt.t()} | {:error, MPP.Errors.t()}

Verify a credential and return the USDC receipt.