The Nevermined plan identifier (required)
Optional options: { Optional configuration with endpoint, agentId, httpVerb, network, description
Optional agentOptional description?: stringOptional endpoint?: stringOptional httpOptional network?: stringX402PaymentRequired object ready to use with verifyPermissions/settlePermissions
import { buildPaymentRequired } from '@nevermined-io/payments'
const paymentRequired = buildPaymentRequired('123456789', {
endpoint: '/api/v1/agents/task',
agentId: '987654321',
httpVerb: 'POST'
})
const result = await payments.facilitator.verifyPermissions({
paymentRequired,
x402AccessToken: token,
maxAmount: 2n
})
Build an X402PaymentRequired object for verify/settle operations.
This helper simplifies the creation of payment requirement objects that are needed for the facilitator API.