MCPcopy Index your code
hub / github.com/codeaashu/claude-code / encodePaymentHeader

Function encodePaymentHeader

src/services/x402/client.ts:333–335  ·  view source on GitHub ↗
(payload: PaymentPayload)

Source from the content-addressed store, hash-verified

331 * Encode a payment payload as a base64 string for the X-Payment header.
332 */
333export function encodePaymentHeader(payload: PaymentPayload): string {
334 return Buffer.from(JSON.stringify(payload)).toString('base64')
335}
336
337/**
338 * Handle a 402 response by creating and encoding a payment.

Callers 1

handlePaymentRequiredFunction · 0.85

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected