mppx.broadcastCredential
Complete a Credential payment
Validates a Credential again and completes its payment on an Mppx.create instance.
Usage
Use broadcastCredential when a custom transport or background workflow accepts payment. It can settle payment or persist payment state.
import { , } from 'mppx/server'
const = .({ : [.()] })
const = await .('Payment credential="..."', {
: {
: '0.10',
: '0x20c0000000000000000000006a37DA5C996874BE', // OUSD on Tempo
: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
},
: 'GET /v1/report',
})
.(.)
successTempo charge and Session methods and EVM charge implement this lifecycle. For an EVM Credential, broadcasting revalidates the authorization—including a fresh facilitator check when configured—before settlement.
For a Session Credential, broadcasting validates again, accepts the voucher or management action, updates channel accounting, and returns a Session Receipt.
Payment-success hooks receive payer when the selected method reports a verified payer identity.
Return type
type ReturnType = Promise<Receipt>Parameters
capturedRequest (optional)
- Type:
Method.CapturedRequest
Authoritative request snapshot used by method hooks.
credential
- Type:
string | Credential
Serialized Payment Credential field value or parsed Credential object.
meta (optional)
- Type:
Record<string, string>
Expected Challenge metadata. Route comparison excludes the reserved _mppx_nonce issuance key; the Challenge HMAC still authenticates it. Clients return opaque unchanged.
realm (optional)
- Type:
string
Expected Challenge realm.
request (optional)
- Type:
Record<string, unknown>
Expected method request parameters. When supplied, payment-success hooks receive the resolved pre-transform route options as requestInput. The hook omits requestInput when you don't pass route options.
scope (optional)
- Type:
string
Expected route or resource scope bound to the Challenge.