MPP.Client.Providers.Tempo (mpp v0.16.0)

Copy Markdown View Source

Built-in Tempo charge provider.

The provider parses a Tempo charge challenge, verifies that the configured RPC is serving the advertised chain, and signs either a TIP-20 transferWithMemo or, when the challenge advertises machineTokenEnabled, the canonical [approve, swapTo] machine-token settlement route. It returns a transaction credential for the server to broadcast.

Configuration is explicit:

  • :private_key — required 32-byte private key, raw or hex encoded
  • :rpc_url — required Tempo JSON-RPC URL
  • :expected_chain_id — optional additional chain pin
  • :client_id — optional attribution client identifier
  • :fee_token — optional fee token; defaults to the charge currency
  • :req_options — optional Req options for the chain-ID check

Transaction tuning options accepted by onchain_tempo (:gas_limit, :nonce, :nonce_key, :valid_before, and :valid_after) may also be supplied. Charge transactions use Tempo's expiring nonce lane by default.

Summary

Functions

Pays a Tempo charge or authorizes a Tempo subscription challenge.

Returns true for Tempo charge and subscription challenges.

Functions

pay(challenge, config)

@spec pay(MPP.Challenge.t(), map()) :: {:ok, MPP.Credential.t()} | {:error, term()}

Pays a Tempo charge or authorizes a Tempo subscription challenge.

supports?(arg1, arg2, config)

@spec supports?(String.t(), String.t(), map()) :: boolean()

Returns true for Tempo charge and subscription challenges.