MPP.Methods.Stellar (mpp v0.18.0)

Copy Markdown View Source

Stellar charge verification for SEP-41 token transfers.

Implements draft-stellar-charge-00. Pull credentials carry type: "transaction" with a base64 TransactionEnvelope XDR; push credentials carry type: "hash" with a 64-character hex transaction hash. Pull covers both unsponsored (client-signed, submitted as-is) and sponsored (feePayer) flows. SEP-41 transfer events are checked via Soroban RPC simulateTransaction (pull) and getTransaction (push).

Configure rpc_url (HTTPS Soroban RPC), network (stellar:pubnet or stellar:testnet), and optionally fee_payer with fee_payer_secret. Replay protection uses MPP.Tempo.Store and is on by default.

API Functions

FunctionArityDescriptionParam Kinds
verify2Verify a Stellar SEP-41 charge credential in pull or push mode.-
challenge_method_details1Expose network, feePayer and credential types.-
validate_config!1Validate RPC, network and optional fee-payer configuration.-
credential_types0Return the draft's two charge credential types.-
method_name0Return the Stellar payment method identifier.-

Summary

Functions

Expose network, feePayer and credential types.

Return the draft's two charge credential types.

Return the Stellar payment method identifier.

Validate RPC, network and optional fee-payer configuration.

Verify a Stellar SEP-41 charge credential in pull or push mode.

Functions

challenge_method_details(charge)

@spec challenge_method_details(MPP.Method.intent()) :: map() | nil
@spec challenge_method_details(MPP.Intents.Charge.t()) :: map()

Expose network, feePayer and credential types.

# descripex:contract
%{}

credential_types()

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

Return the draft's two charge credential types.

# descripex:contract
%{}

method_name()

@spec method_name() :: String.t()

Return the Stellar payment method identifier.

# descripex:contract
%{}

validate_config!(config)

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

Validate RPC, network and optional fee-payer configuration.

# descripex:contract
%{}

verify(payload, charge)

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

Verify a Stellar SEP-41 charge credential in pull or push mode.

# descripex:contract
%{}