x402-chainlink
    Preparing search index...

    Class CREClient

    CRE Client for x402 payment workflows

    This client communicates with the Chainlink Runtime Environment to verify and settle payments using decentralized consensus.

    Usage:

    const client = new CREClient({
    endpoint: 'https://cre.chain.link/v1/workflows/my-workflow/trigger',
    network: 'eip155:84532',
    facilitatorAddress: '0x...',
    simulation: false, // Use real CRE workflow
    });

    const result = await client.verifyAndSettle(payload, requirements);
    Index

    Constructors

    Methods

    • Get the environment (staging/production)

      Returns "production" | "staging"

    • Get the facilitator address

      Returns `0x${string}`

    • Check if CRE service is available

      Returns Promise<boolean>

    • Check if running in simulation mode

      Returns boolean

    • Settle a payment using CRE workflow

      In production mode, this triggers the CRE workflow on the DON which submits a signed report to the X402Facilitator contract via KeystoneForwarder.

      Parameters

      • payload: PaymentPayload

        Payment payload with signature and authorization

      • requirements: PaymentRequirements

        Payment requirements

      • Optionalclient: {}

        Viem PublicClient (optional, kept for backward compatibility)

      Returns Promise<SettleResponse>

      Settlement result