T402 API Reference - v2.8.0
    Preparing search index...

    Function erc8004ReputationCheck

    • Create a BeforeVerifyHook that checks agent reputation before verification.

      Queries the Reputation Registry for the agent's score from trusted reviewers. If below threshold, aborts or warns per config.

      Parameters

      • client: ERC8004ReadClient

        Read-only client for contract calls

      • reputationRegistry: `0x${string}`

        Reputation Registry contract address

      • config: ReputationCheckConfig

        Reputation check configuration

      Returns BeforeVerifyHook

      BeforeVerifyHook for registration on t402ResourceServer

      const server = new t402ResourceServer(facilitatorClient);
      server.onBeforeVerify(erc8004ReputationCheck(viemClient, registryAddr, {
      minScore: 70,
      trustedReviewers: ["0x..."],
      onBelowThreshold: "reject",
      }));