Credential.from
Create a new Credential
Creates a Credential from the given parameters.
Usage
import { , } from 'mppx'
const = .({
: 'abc123',
: 'charge',
: 'tempo',
: 'mpp.dev',
: { : '1000000', : '0x...', : '0x...' },
})
const = .({
,
: { : '0x...' },
})Return type
type ReturnType = Credential<payload, challenge>A Credential object containing the Challenge and payment proof.
Parameters
challenge
- Type:
Challenge
The Challenge from the 402 response.
parameters
payload
- Type:
unknown
Method-specific payment proof.
source (optional)
- Type:
string
Payer identifier as a DID (for example, "did:pkh:eip155:1:0x...").