Skip to main content
verify-quote.ts is one function, verifyQuote(), that you call between requesting a quote and funding it. It throws if the quote does not match your request, and returns whether the recipient could be proven from route data. It depends only on viem and runs in Node.js and in the browser. The signature covers the quote ID, the intent hash set, and the expiry (what a signature proves). The module also decodes the funding transaction, recomputes the intent hashes, and checks who gets paid.

Prerequisites

  • viem 2.x: npm install viem
  • Node.js 22.18 or later, or a bundler such as Vite
  • An EVM source and destination chain. The module rejects other quotes; for a Solana source, use the reference script

The module

verify-quote.ts

Use it

Pass the request you sent, the quote you received, and the chains array from GET /v1/chains. Fund only after it returns. This script runs server-side with your key. Set up an ES module project in an empty folder, save verify-quote.ts and the script below in it, then run the script:
check-quote.ts

What it checks

recipientVerified is false when the payout happens inside a swap or bridge call, as on the multi-hop routes in Intent types. The signature and funding checks still pass; whether to fund such a quote is your decision. With options.allQuotes, run verifyQuote() on each entry in quotes[] and choose among the ones that pass. The module does not check price, solver behavior, or whether the intent will be fulfilled.

Next steps