MPP.Methods.USDC.Binding (mpp v0.19.0)

Copy Markdown View Source

Challenge binding shared by every usdc profile.

The EVM authorization nonce and the public request hash follow draft-usdc-charge-00. requestHash inside the nonce preimage is the 0x-prefixed lowercase hex encoding of keccak256 over the UTF-8 JCS request. The draft names that digest but does not pick a JSON string encoding; hex with a 0x prefix matches the nonce field's own encoding.

Summary

Functions

EIP-3009 nonce bound to this USDC challenge.

Require a positive base-unit amount with no leading zeros.

Profile names the v00 draft allows in methodDetails.type.

Rebuild the public challenge request, without server config keys.

USDC receipt for a settled profile. network is the CAIP-2 settlement id.

Require a recipient for either direct USDC profile.

Select the single profile object whose key equals methodDetails.type.

Functions

authorization_nonce(id, realm, request)

@spec authorization_nonce(String.t(), String.t(), map()) :: String.t()

EIP-3009 nonce bound to this USDC challenge.

request is the public JCS request map, not the server config merge.

positive_amount(charge)

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

Require a positive base-unit amount with no leading zeros.

profile_types()

@spec profile_types() :: [String.t()]

Profile names the v00 draft allows in methodDetails.type.

public_request(charge)

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

Rebuild the public challenge request, without server config keys.

receipt(charge, type, reference, network)

USDC receipt for a settled profile. network is the CAIP-2 settlement id.

require_recipient(charge)

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

Require a recipient for either direct USDC profile.

select_profile(details)

@spec select_profile(map()) :: {:ok, String.t(), map()} | {:error, MPP.Errors.t()}

Select the single profile object whose key equals methodDetails.type.