Skip to main content

Prerequisites

1

Install dependencies

npm install @x402r/helpers
2

Configure forwardToArbiter()

Add the forwardToArbiter() hook to your x402 resource server. After every successful auth-capture settlement, it POSTs to your arbiter service fire-and-forget:
import { forwardToArbiter } from '@x402r/helpers'
import { AuthCaptureEvmScheme } from '@x402r/evm/auth-capture/server'

const resourceServer = new x402ResourceServer(facilitatorConfig)
  .register(networkId, new AuthCaptureEvmScheme())
  .onAfterSettle(
    forwardToArbiter('http://your-arbiter:3001', {
      onError: (err) => console.error('Arbiter unreachable:', err),
    }),
  )
The hook POSTs to {arbiterUrl}/verify with:
{
  "responseBody": "the HTTP response body as a string",
  "transaction": "0xsettlement_tx_hash",
  "paymentInfoWire": {
    "operator": "0x...",
    "payer": "0x...",
    "receiver": "0x...",
    "token": "0x...",
    "maxAmount": "10000",
    "preApprovalExpiry": 1740758554,
    "authorizationExpiry": 1740762154,
    "refundExpiry": 1741276954,
    "minFeeBps": 0,
    "maxFeeBps": 500,
    "feeReceiver": "0x...",
    "salt": "0x..."
  }
}
The helper reconstructs PaymentInfoWire from the verified SettleResultContext. The arbiter consumes req.body.paymentInfoWire and runs it through PaymentInfo.fromWire(...) to recover the bigint-typed struct expected by SDK actions. See forwardToArbiter() docs for the full payload shape.
forwardToArbiter() is fire-and-forget. If the arbiter service is unreachable, funds stay in escrow until timeout. Add monitoring for arbiter availability.
3

Share addresses with the arbiter

The arbiter service needs operatorAddress and escrowPeriodAddress from your deployment to construct its SDK client. Share these via config, environment variables, or a shared registry.

Next Steps

Arbiter Setup

Build the service that evaluates responses and releases funds.

Deploy Operator

Full deployment config and condition slot details.