Credential.from
Create a new Credential
Creates a Credential from the given parameters.
Usage
import { , } from 'mppx'
const = .({
: 'abc123',
: 'charge',
: 'tempo',
: 'mpp.dev',
: {
: '1000000',
: '0x20c0000000000000000000006a37DA5C996874BE', // OUSD on Tempo
: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
},
})
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...").